From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 00:37:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A1874B71; Sun, 3 Mar 2013 00:37:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7BEE3AD2; Sun, 3 Mar 2013 00:37:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r230bZxX008183; Sun, 3 Mar 2013 00:37:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r230bZIv008182; Sun, 3 Mar 2013 00:37:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201303030037.r230bZIv008182@svn.freebsd.org> From: Glen Barber Date: Sun, 3 Mar 2013 00:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247677 - stable/9/usr.bin/dc 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 00:37:35 -0000 Author: gjb (doc,ports committer) Date: Sun Mar 3 00:37:34 2013 New Revision: 247677 URL: http://svnweb.freebsd.org/changeset/base/247677 Log: MFC r247441: Properly handle '-h' argument. PR: 176332 Modified: stable/9/usr.bin/dc/dc.c Directory Properties: stable/9/usr.bin/dc/ (props changed) Modified: stable/9/usr.bin/dc/dc.c ============================================================================== --- stable/9/usr.bin/dc/dc.c Sat Mar 2 23:40:42 2013 (r247676) +++ stable/9/usr.bin/dc/dc.c Sun Mar 3 00:37:34 2013 (r247677) @@ -84,7 +84,7 @@ main(int argc, char *argv[]) bool extended_regs = false, preproc_done = false; /* accept and ignore a single dash to be 4.4BSD dc(1) compatible */ - while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "e:f:hVx", long_options, NULL)) != -1) { switch (ch) { case 'e': if (!preproc_done) From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 01:02:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7735423C; Sun, 3 Mar 2013 01:02:58 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4FA98B6D; Sun, 3 Mar 2013 01:02:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2312vlW016447; Sun, 3 Mar 2013 01:02:57 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2312vJ1016446; Sun, 3 Mar 2013 01:02:57 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303030102.r2312vJ1016446@svn.freebsd.org> From: Attilio Rao Date: Sun, 3 Mar 2013 01:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247678 - head/sys/i386/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 01:02:58 -0000 Author: attilio Date: Sun Mar 3 01:02:57 2013 New Revision: 247678 URL: http://svnweb.freebsd.org/changeset/base/247678 Log: Fix-up r247622 by also renaming pv_list iterator into the xen pmap verbatim copy. Sponsored by: EMC / Isilon storage division Reported by: tinderbox Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sun Mar 3 00:37:34 2013 (r247677) +++ head/sys/i386/xen/pmap.c Sun Mar 3 01:02:57 2013 (r247678) @@ -2038,7 +2038,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) vm_page_dirty(m); if ((tpte & PG_A) != 0) vm_page_aflag_set(m, PGA_REFERENCED); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); pc->pc_map[field] |= 1UL << bit; @@ -2239,9 +2239,9 @@ pmap_pvh_remove(struct md_page *pvh, pma pv_entry_t pv; rw_assert(&pvh_global_lock, RA_WLOCKED); - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { - TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); + TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); break; } } @@ -2281,7 +2281,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm if (pv_entry_count < pv_entry_high_water && (pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); return (TRUE); } else return (FALSE); @@ -2503,7 +2503,7 @@ pmap_remove_all(vm_page_t m) vm_page_dirty(m); pmap_unuse_pt(pmap, pv->pv_va, &free); pmap_invalidate_page(pmap, pv->pv_va); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } @@ -2770,7 +2770,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pv == NULL) pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); pa |= PG_MANAGED; } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -3465,7 +3465,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; rw_wlock(&pvh_global_lock); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { if (PV_PMAP(pv) == pmap) { rv = TRUE; break; @@ -3497,7 +3497,7 @@ pmap_page_wired_mappings(vm_page_t m) return (count); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3602,7 +3602,7 @@ pmap_remove_pages(pmap_t pmap) if (tpte & PG_M) vm_page_dirty(m); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -3662,7 +3662,7 @@ pmap_is_modified(vm_page_t m) return (rv); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3723,7 +3723,7 @@ pmap_is_referenced(vm_page_t m) rv = FALSE; rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3793,7 +3793,7 @@ pmap_remove_write(vm_page_t m) return; rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3852,9 +3852,9 @@ pmap_ts_referenced(vm_page_t m) if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pvf = pv; do { - pvn = TAILQ_NEXT(pv, pv_list); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + pvn = TAILQ_NEXT(pv, pv_next); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3901,7 +3901,7 @@ pmap_clear_modify(vm_page_t m) return; rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3936,7 +3936,7 @@ pmap_clear_reference(vm_page_t m) ("pmap_clear_reference: page %p is not managed", m)); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -4418,7 +4418,7 @@ pmap_pvdump(vm_paddr_t pa) printf("pa %x", pa); m = PHYS_TO_VM_PAGE(pa); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); printf(" -> pmap %p, va %x", (void *)pmap, pv->pv_va); pads(pmap); From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 02:11:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EF84599; Sun, 3 Mar 2013 02:11:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91D91E07; Sun, 3 Mar 2013 02:11:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r232B4CL039203; Sun, 3 Mar 2013 02:11:04 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r232B4RR039202; Sun, 3 Mar 2013 02:11:04 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201303030211.r232B4RR039202@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 3 Mar 2013 02:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247683 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 02:11:04 -0000 Author: pfg Date: Sun Mar 3 02:11:03 2013 New Revision: 247683 URL: http://svnweb.freebsd.org/changeset/base/247683 Log: libedit does not need to be linked with ncurses libedit uses the terminfo headers but doesn't really need to be linked with ncurses. Discussed with: christos@NetBSD MFC after; 3 days Modified: head/lib/libedit/Makefile Modified: head/lib/libedit/Makefile ============================================================================== --- head/lib/libedit/Makefile Sun Mar 3 01:36:31 2013 (r247682) +++ head/lib/libedit/Makefile Sun Mar 3 02:11:03 2013 (r247683) @@ -11,7 +11,6 @@ OSRCS= chared.c common.c el.c emacs.c fc parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} -LDADD= -lncurses MAN= editline.3 editrc.5 From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 06:42:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2D766F0A; Sun, 3 Mar 2013 06:42:37 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 08F977EF; Sun, 3 Mar 2013 06:42:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r236galx021708; Sun, 3 Mar 2013 06:42:36 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r236ga0i021707; Sun, 3 Mar 2013 06:42:36 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201303030642.r236ga0i021707@svn.freebsd.org> From: Rui Paulo Date: Sun, 3 Mar 2013 06:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247684 - head/sys/cddl/compat/opensolaris/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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 06:42:37 -0000 Author: rpaulo Date: Sun Mar 3 06:42:36 2013 New Revision: 247684 URL: http://svnweb.freebsd.org/changeset/base/247684 Log: Remove the extra parenthesis from the cv_init() macro. They are not necessary because we already use parenthesis in zfs_cv_init(). This fixes a long standing bug where there would be an extra ")" at the end of the string. This extra parenthesis would show up in the WCHAN of the process (top, stty status, etc.). Modified: head/sys/cddl/compat/opensolaris/sys/kcondvar.h Modified: head/sys/cddl/compat/opensolaris/sys/kcondvar.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kcondvar.h Sun Mar 3 02:11:03 2013 (r247683) +++ head/sys/cddl/compat/opensolaris/sys/kcondvar.h Sun Mar 3 06:42:36 2013 (r247684) @@ -55,7 +55,7 @@ typedef enum { _name = #cv; \ cv_init((cv), _name); \ } while (0) -#define cv_init(cv, name, type, arg) zfs_cv_init((cv), (name), (type), (arg)) +#define cv_init(cv, name, type, arg) zfs_cv_init(cv, name, type, arg) #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 07:09:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F63D2D7; Sun, 3 Mar 2013 07:09:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5006F87C; Sun, 3 Mar 2013 07:09:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2379Q6e028815; Sun, 3 Mar 2013 07:09:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2379PQD028812; Sun, 3 Mar 2013 07:09:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303030709.r2379PQD028812@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Mar 2013 07:09:25 +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: r247685 - stable/9/sys/fs/msdosfs 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 07:09:26 -0000 Author: kib Date: Sun Mar 3 07:09:25 2013 New Revision: 247685 URL: http://svnweb.freebsd.org/changeset/base/247685 Log: MFC r246921: Do not update the fsinfo block on each update of any fat block. Postpone the flush to VFS_SYNC(). Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c stable/9/sys/fs/msdosfs/msdosfs_vfsops.c stable/9/sys/fs/msdosfs/msdosfsmount.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_fat.c Sun Mar 3 06:42:36 2013 (r247684) +++ stable/9/sys/fs/msdosfs/msdosfs_fat.c Sun Mar 3 07:09:25 2013 (r247685) @@ -328,29 +328,6 @@ updatefats(pmp, bp, fatbn) printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn); #endif - /* - * If we have an FSInfo block, update it. - */ - if (pmp->pm_fsinfo) { - if (bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec, - NOCRED, &bpn) != 0) { - /* - * Ignore the error, but turn off FSInfo update for the future. - */ - pmp->pm_fsinfo = 0; - brelse(bpn); - } else { - struct fsinfo *fp = (struct fsinfo *)bpn->b_data; - - putulong(fp->fsinfree, pmp->pm_freeclustercount); - putulong(fp->fsinxtfree, pmp->pm_nxtfree); - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) - bwrite(bpn); - else - bdwrite(bpn); - } - } - if (pmp->pm_flags & MSDOSFS_FATMIRROR) { /* * Now copy the block(s) of the modified fat to the other copies of @@ -393,9 +370,6 @@ updatefats(pmp, bp, fatbn) bwrite(bp); else bdwrite(bp); - /* - * Maybe update fsinfo sector here? - */ } /* @@ -431,6 +405,7 @@ usemap_alloc(pmp, cn) pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little")); pmp->pm_freeclustercount--; + pmp->pm_flags |= MSDOSFS_FSIMOD; } static __inline void @@ -441,6 +416,7 @@ usemap_free(pmp, cn) MSDOSFS_ASSERT_MP_LOCKED(pmp); pmp->pm_freeclustercount++; + pmp->pm_flags |= MSDOSFS_FSIMOD; KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) != 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS, (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); @@ -742,7 +718,10 @@ chainalloc(pmp, start, count, fillwith, for (cl = start, n = count; n-- > 0;) usemap_alloc(pmp, cl++); - + pmp->pm_nxtfree = start + count; + if (pmp->pm_nxtfree > pmp->pm_maxcluster) + pmp->pm_nxtfree = CLUST_FIRST; + pmp->pm_flags |= MSDOSFS_FSIMOD; error = fatchain(pmp, start, count, fillwith); if (error != 0) return (error); @@ -754,9 +733,6 @@ chainalloc(pmp, start, count, fillwith, *retcluster = start; if (got) *got = count; - pmp->pm_nxtfree = start + count; - if (pmp->pm_nxtfree > pmp->pm_maxcluster) - pmp->pm_nxtfree = CLUST_FIRST; return (0); } Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Sun Mar 3 06:42:36 2013 (r247684) +++ stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Sun Mar 3 07:09:25 2013 (r247685) @@ -897,6 +897,40 @@ msdosfs_statfs(struct mount *mp, struct return (0); } +/* + * If we have an FSInfo block, update it. + */ +static int +msdosfs_fsiflush(struct msdosfsmount *pmp, int waitfor) +{ + struct fsinfo *fp; + struct buf *bp; + int error; + + MSDOSFS_LOCK_MP(pmp); + if (pmp->pm_fsinfo == 0 || (pmp->pm_flags & MSDOSFS_FSIMOD) == 0) { + error = 0; + goto unlock; + } + error = bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec, + NOCRED, &bp); + if (error != 0) { + brelse(bp); + goto unlock; + } + fp = (struct fsinfo *)bp->b_data; + putulong(fp->fsinfree, pmp->pm_freeclustercount); + putulong(fp->fsinxtfree, pmp->pm_nxtfree); + pmp->pm_flags &= ~MSDOSFS_FSIMOD; + if (waitfor == MNT_WAIT) + error = bwrite(bp); + else + bawrite(bp); +unlock: + MSDOSFS_UNLOCK_MP(pmp); + return (error); +} + static int msdosfs_sync(struct mount *mp, int waitfor) { @@ -959,6 +993,10 @@ loop: allerror = error; VOP_UNLOCK(pmp->pm_devvp, 0); } + + error = msdosfs_fsiflush(pmp, waitfor); + if (error != 0) + allerror = error; return (allerror); } Modified: stable/9/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfsmount.h Sun Mar 3 06:42:36 2013 (r247684) +++ stable/9/sys/fs/msdosfs/msdosfsmount.h Sun Mar 3 07:09:25 2013 (r247685) @@ -262,6 +262,7 @@ struct msdosfs_args { #define MSDOSFSMNT_WAITONFAT 0x40000000 /* mounted synchronous */ #define MSDOSFS_FATMIRROR 0x20000000 /* FAT is mirrored */ #define MSDOSFS_LARGEFS 0x10000000 /* perform fileno mapping */ +#define MSDOSFS_FSIMOD 0x01000000 #define MSDOSFS_ARGSMAGIC 0xe4eff300 From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 07:27:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 771334F4; Sun, 3 Mar 2013 07:27:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4EDFF8CF; Sun, 3 Mar 2013 07:27:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r237RGo6034492; Sun, 3 Mar 2013 07:27:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r237RFDv034489; Sun, 3 Mar 2013 07:27:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303030727.r237RFDv034489@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Mar 2013 07:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247686 - stable/8/sys/fs/msdosfs 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 07:27:16 -0000 Author: kib Date: Sun Mar 3 07:27:15 2013 New Revision: 247686 URL: http://svnweb.freebsd.org/changeset/base/247686 Log: MFC r246921: Do not update the fsinfo block on each update of any fat block. Postpone the flush to VFS_SYNC(). Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c stable/8/sys/fs/msdosfs/msdosfs_vfsops.c stable/8/sys/fs/msdosfs/msdosfsmount.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_fat.c Sun Mar 3 07:09:25 2013 (r247685) +++ stable/8/sys/fs/msdosfs/msdosfs_fat.c Sun Mar 3 07:27:15 2013 (r247686) @@ -328,29 +328,6 @@ updatefats(pmp, bp, fatbn) printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn); #endif - /* - * If we have an FSInfo block, update it. - */ - if (pmp->pm_fsinfo) { - if (bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec, - NOCRED, &bpn) != 0) { - /* - * Ignore the error, but turn off FSInfo update for the future. - */ - pmp->pm_fsinfo = 0; - brelse(bpn); - } else { - struct fsinfo *fp = (struct fsinfo *)bpn->b_data; - - putulong(fp->fsinfree, pmp->pm_freeclustercount); - putulong(fp->fsinxtfree, pmp->pm_nxtfree); - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) - bwrite(bpn); - else - bdwrite(bpn); - } - } - if (pmp->pm_flags & MSDOSFS_FATMIRROR) { /* * Now copy the block(s) of the modified fat to the other copies of @@ -393,9 +370,6 @@ updatefats(pmp, bp, fatbn) bwrite(bp); else bdwrite(bp); - /* - * Maybe update fsinfo sector here? - */ } /* @@ -431,6 +405,7 @@ usemap_alloc(pmp, cn) pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little")); pmp->pm_freeclustercount--; + pmp->pm_flags |= MSDOSFS_FSIMOD; } static __inline void @@ -441,6 +416,7 @@ usemap_free(pmp, cn) MSDOSFS_ASSERT_MP_LOCKED(pmp); pmp->pm_freeclustercount++; + pmp->pm_flags |= MSDOSFS_FSIMOD; KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) != 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS, (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); @@ -742,7 +718,10 @@ chainalloc(pmp, start, count, fillwith, for (cl = start, n = count; n-- > 0;) usemap_alloc(pmp, cl++); - + pmp->pm_nxtfree = start + count; + if (pmp->pm_nxtfree > pmp->pm_maxcluster) + pmp->pm_nxtfree = CLUST_FIRST; + pmp->pm_flags |= MSDOSFS_FSIMOD; error = fatchain(pmp, start, count, fillwith); if (error != 0) return (error); @@ -754,9 +733,6 @@ chainalloc(pmp, start, count, fillwith, *retcluster = start; if (got) *got = count; - pmp->pm_nxtfree = start + count; - if (pmp->pm_nxtfree > pmp->pm_maxcluster) - pmp->pm_nxtfree = CLUST_FIRST; return (0); } Modified: stable/8/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_vfsops.c Sun Mar 3 07:09:25 2013 (r247685) +++ stable/8/sys/fs/msdosfs/msdosfs_vfsops.c Sun Mar 3 07:27:15 2013 (r247686) @@ -893,6 +893,40 @@ msdosfs_statfs(struct mount *mp, struct return (0); } +/* + * If we have an FSInfo block, update it. + */ +static int +msdosfs_fsiflush(struct msdosfsmount *pmp, int waitfor) +{ + struct fsinfo *fp; + struct buf *bp; + int error; + + MSDOSFS_LOCK_MP(pmp); + if (pmp->pm_fsinfo == 0 || (pmp->pm_flags & MSDOSFS_FSIMOD) == 0) { + error = 0; + goto unlock; + } + error = bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec, + NOCRED, &bp); + if (error != 0) { + brelse(bp); + goto unlock; + } + fp = (struct fsinfo *)bp->b_data; + putulong(fp->fsinfree, pmp->pm_freeclustercount); + putulong(fp->fsinxtfree, pmp->pm_nxtfree); + pmp->pm_flags &= ~MSDOSFS_FSIMOD; + if (waitfor == MNT_WAIT) + error = bwrite(bp); + else + bawrite(bp); +unlock: + MSDOSFS_UNLOCK_MP(pmp); + return (error); +} + static int msdosfs_sync(struct mount *mp, int waitfor) { @@ -962,6 +996,10 @@ loop: allerror = error; VOP_UNLOCK(pmp->pm_devvp, 0); } + + error = msdosfs_fsiflush(pmp, waitfor); + if (error != 0) + allerror = error; return (allerror); } Modified: stable/8/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfsmount.h Sun Mar 3 07:09:25 2013 (r247685) +++ stable/8/sys/fs/msdosfs/msdosfsmount.h Sun Mar 3 07:27:15 2013 (r247686) @@ -262,6 +262,7 @@ struct msdosfs_args { #define MSDOSFSMNT_WAITONFAT 0x40000000 /* mounted synchronous */ #define MSDOSFS_FATMIRROR 0x20000000 /* FAT is mirrored */ #define MSDOSFS_LARGEFS 0x10000000 /* perform fileno mapping */ +#define MSDOSFS_FSIMOD 0x01000000 #define MSDOSFS_ARGSMAGIC 0xe4eff300 From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 07:45:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CB85D7DF; Sun, 3 Mar 2013 07:45:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99AB9960; Sun, 3 Mar 2013 07:45:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r237jf57040066; Sun, 3 Mar 2013 07:45:41 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r237jf8K040062; Sun, 3 Mar 2013 07:45:41 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030745.r237jf8K040062@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 07:45:41 +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: r247687 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 07:45:42 -0000 Author: dteske Date: Sun Mar 3 07:45:40 2013 New Revision: 247687 URL: http://svnweb.freebsd.org/changeset/base/247687 Log: MFS 9->8 r234737: Fix several 'format string is not a literal' warnings in sysinstall. Since sysinstall does not exist anymore in head, this is a direct commit. Modified: stable/8/usr.sbin/sysinstall/dispatch.c stable/8/usr.sbin/sysinstall/install.c stable/8/usr.sbin/sysinstall/label.c stable/8/usr.sbin/sysinstall/modules.c Modified: stable/8/usr.sbin/sysinstall/dispatch.c ============================================================================== --- stable/8/usr.sbin/sysinstall/dispatch.c Sun Mar 3 07:27:15 2013 (r247686) +++ stable/8/usr.sbin/sysinstall/dispatch.c Sun Mar 3 07:45:40 2013 (r247687) @@ -591,7 +591,7 @@ dispatch_load_menu(dialogMenuItem *self) if (err != NULL) { what |= DITEM_FAILURE; if (!variable_get(VAR_NO_ERROR)) - msgConfirm(err); + msgConfirm("%s", err); } return (what); Modified: stable/8/usr.sbin/sysinstall/install.c ============================================================================== --- stable/8/usr.sbin/sysinstall/install.c Sun Mar 3 07:27:15 2013 (r247686) +++ stable/8/usr.sbin/sysinstall/install.c Sun Mar 3 07:45:40 2013 (r247687) @@ -1018,10 +1018,10 @@ performNewfs(PartInfo *pi, char *dname, } if (queue == QUEUE_YES) { - command_shell_add(pi->mountpoint, buffer); + command_shell_add(pi->mountpoint, "%s", buffer); return (0); } else - return (vsystem(buffer)); + return (vsystem("%s", buffer)); } return (0); } Modified: stable/8/usr.sbin/sysinstall/label.c ============================================================================== --- stable/8/usr.sbin/sysinstall/label.c Sun Mar 3 07:27:15 2013 (r247686) +++ stable/8/usr.sbin/sysinstall/label.c Sun Mar 3 07:45:40 2013 (r247687) @@ -978,7 +978,7 @@ diskLabel(Device *dev) } if (msg) { if (req) { - msgConfirm(msg); + msgConfirm("%s", msg); clear_wins(); msg = NULL; } Modified: stable/8/usr.sbin/sysinstall/modules.c ============================================================================== --- stable/8/usr.sbin/sysinstall/modules.c Sun Mar 3 07:27:15 2013 (r247686) +++ stable/8/usr.sbin/sysinstall/modules.c Sun Mar 3 07:45:40 2013 (r247687) @@ -199,7 +199,7 @@ kldBrowser(dialogMenuItem *self) if (err != NULL) { what |= DITEM_FAILURE; if (!variable_get(VAR_NO_ERROR)) - msgConfirm(err); + msgConfirm("%s", err); } return (what); From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 07:50:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 09C2396E; Sun, 3 Mar 2013 07:50:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E552697C; Sun, 3 Mar 2013 07:50:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r237oXsC040720; Sun, 3 Mar 2013 07:50:33 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r237oX8k040719; Sun, 3 Mar 2013 07:50:33 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030750.r237oX8k040719@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 07:50:33 +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: r247688 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 07:50:34 -0000 Author: dteske Date: Sun Mar 3 07:50:33 2013 New Revision: 247688 URL: http://svnweb.freebsd.org/changeset/base/247688 Log: MFS 9->8 r244573: Fix typo. (fixing them as I find them) Modified: stable/8/usr.sbin/sysinstall/ftp.c Modified: stable/8/usr.sbin/sysinstall/ftp.c ============================================================================== --- stable/8/usr.sbin/sysinstall/ftp.c Sun Mar 3 07:45:40 2013 (r247687) +++ stable/8/usr.sbin/sysinstall/ftp.c Sun Mar 3 07:50:33 2013 (r247688) @@ -107,7 +107,7 @@ try: hostname = variable_get(VAR_FTP_HOST); dir = variable_get(VAR_FTP_DIR); if (!hostname || !dir) { - msgConfirm("Missing FTP host or directory specification. FTP media not initialized,"); + msgConfirm("Missing FTP host or directory specification. FTP media not initialized."); netDown(dev); return FALSE; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 07:54:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 52669BCB; Sun, 3 Mar 2013 07:54:29 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9E999C; Sun, 3 Mar 2013 07:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r237sTYL042877; Sun, 3 Mar 2013 07:54:29 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r237sT6p042876; Sun, 3 Mar 2013 07:54:29 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030754.r237sT6p042876@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 07:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247689 - stable/8/usr.sbin/sysinstall/help 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 07:54:29 -0000 Author: dteske Date: Sun Mar 3 07:54:28 2013 New Revision: 247689 URL: http://svnweb.freebsd.org/changeset/base/247689 Log: MFS 9->8 r245438: Oops, r186202 (4 years ago) forgot to remove Tape from the F1 Help file. Modified: stable/8/usr.sbin/sysinstall/help/media.hlp Modified: stable/8/usr.sbin/sysinstall/help/media.hlp ============================================================================== --- stable/8/usr.sbin/sysinstall/help/media.hlp Sun Mar 3 07:50:33 2013 (r247688) +++ stable/8/usr.sbin/sysinstall/help/media.hlp Sun Mar 3 07:54:28 2013 (r247689) @@ -46,9 +46,3 @@ You can install from the following types If this install method hangs on you or refuses to work properly, you may need to set some special options for your NFS server. See the Options screen for more details. - - - Tape Extract distribution files from tape into a temporary - directory and install from there. If the tape was created - with blocksize other than 20, you may wish to change this - in the Options screen. From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 08:02:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B2076D98; Sun, 3 Mar 2013 08:02:08 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A5829CA; Sun, 3 Mar 2013 08:02:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r238283X045697; Sun, 3 Mar 2013 08:02:08 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23828Ae045695; Sun, 3 Mar 2013 08:02:08 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030802.r23828Ae045695@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 08:02:08 +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: r247690 - stable/8/usr.sbin/sysinstall/help 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 08:02:08 -0000 Author: dteske Date: Sun Mar 3 08:02:07 2013 New Revision: 247690 URL: http://svnweb.freebsd.org/changeset/base/247690 Log: MFS 9->8 r247241: Oops, r186202 (over 4 years ago) forgot to remove Tape from the F1 Help file. Direct commit to stable/9 (no sysinstall in head). MFS 9->8 r247242: Oops, r215291 (over 2 years ago) forgot to remove mention of "medium" from the F1 Help file. Direct commit to stable/9 (no sysinstall in head). Modified: stable/8/usr.sbin/sysinstall/help/options.hlp Modified: stable/8/usr.sbin/sysinstall/help/options.hlp ============================================================================== --- stable/8/usr.sbin/sysinstall/help/options.hlp Sun Mar 3 07:54:28 2013 (r247689) +++ stable/8/usr.sbin/sysinstall/help/options.hlp Sun Mar 3 08:02:07 2013 (r247690) @@ -88,21 +88,12 @@ Editor: Specify which screen editor to setting to `/usr/bin/vi'. -Tape Blocksize: Specify block size in 512 byte blocks of tape. - - This defaults to 20 blocks, which should work with most - tape drive + tar combinations. It may not allow your particular - drive to win any records for speed, however, and the more - adventurous among you might try experimenting with larger sizes. - - Extract Detail: How to show filenames on debug screen as they're extracted. While a distribution is being extracted, the default detail level of "high" will show the full file names as they're extracted. - If you would prefer a more terse form for this, namely dots, select - the "medium" detail level. If you want nothing to be printed - on the debugging screen during extraction, select "low". + If you want nothing to be printed on the debugging screen during + extraction, select "low". Release Name: Which release to attempt to load from installation media. From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 08:04:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 28284F05; Sun, 3 Mar 2013 08:04:12 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 18E009D2; Sun, 3 Mar 2013 08:04:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2384BYG046066; Sun, 3 Mar 2013 08:04:11 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2384Bcl046065; Sun, 3 Mar 2013 08:04:11 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030804.r2384Bcl046065@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 08:04:11 +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: r247691 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 08:04:12 -0000 Author: dteske Date: Sun Mar 3 08:04:11 2013 New Revision: 247691 URL: http://svnweb.freebsd.org/changeset/base/247691 Log: MFS 9->8 r244676: Fix another typo while we're here. Modified: stable/8/usr.sbin/sysinstall/http.c Modified: stable/8/usr.sbin/sysinstall/http.c ============================================================================== --- stable/8/usr.sbin/sysinstall/http.c Sun Mar 3 08:02:07 2013 (r247690) +++ stable/8/usr.sbin/sysinstall/http.c Sun Mar 3 08:04:11 2013 (r247691) @@ -253,7 +253,7 @@ mediaGetHTTP(Device *dev, char *file, Bo msgConfirm("Client error %s, you could try an other server",buf); return NULL; } else if (rv >= 300) { - msgConfirm("Error %s,",buf); + msgConfirm("Error %s",buf); return NULL; } else if (rv != 200) { msgConfirm("Error %s when sending %s, you could try an other server",buf, req); From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 08:17:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 09F4F499; Sun, 3 Mar 2013 08:17:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E4348A30; Sun, 3 Mar 2013 08:17:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r238HHHK049850; Sun, 3 Mar 2013 08:17:17 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r238HH9o049848; Sun, 3 Mar 2013 08:17:17 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030817.r238HH9o049848@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 08:17:17 +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: r247692 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 08:17:18 -0000 Author: dteske Date: Sun Mar 3 08:17:17 2013 New Revision: 247692 URL: http://svnweb.freebsd.org/changeset/base/247692 Log: MFS 9->8 r215224: We still support PLIP devices, so mention them in addition to ethernet. Modified: stable/8/usr.sbin/sysinstall/install.c stable/8/usr.sbin/sysinstall/menus.c Modified: stable/8/usr.sbin/sysinstall/install.c ============================================================================== --- stable/8/usr.sbin/sysinstall/install.c Sun Mar 3 08:04:11 2013 (r247691) +++ stable/8/usr.sbin/sysinstall/install.c Sun Mar 3 08:17:17 2013 (r247692) @@ -690,7 +690,7 @@ nodisks: "may do so by typing: /usr/sbin/sysinstall."); } if (mediaDevice->type != DEVICE_TYPE_FTP && mediaDevice->type != DEVICE_TYPE_NFS) { - if (!msgYesNo("Would you like to configure any Ethernet network devices?")) { + if (!msgYesNo("Would you like to configure any Ethernet or PLIP network devices?")) { Device *tmp = tcpDeviceSelect(); if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) Modified: stable/8/usr.sbin/sysinstall/menus.c ============================================================================== --- stable/8/usr.sbin/sysinstall/menus.c Sun Mar 3 08:04:11 2013 (r247691) +++ stable/8/usr.sbin/sysinstall/menus.c Sun Mar 3 08:17:17 2013 (r247692) @@ -884,7 +884,7 @@ DMenu MenuMediaFTP = { DMenu MenuNetworkDevice = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Network interface information required", - "Please select the ethernet device to configure.\n\n" + "Please select the ethernet or PLIP device to configure.\n\n" "", "Press F1 to read network configuration manual", "network_device", From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 08:21:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D87846D7; Sun, 3 Mar 2013 08:21:17 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CADB6A5D; Sun, 3 Mar 2013 08:21:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r238LHWa052022; Sun, 3 Mar 2013 08:21:17 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r238LH2i052020; Sun, 3 Mar 2013 08:21:17 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030821.r238LH2i052020@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 08:21:17 +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: r247693 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 08:21:17 -0000 Author: dteske Date: Sun Mar 3 08:21:17 2013 New Revision: 247693 URL: http://svnweb.freebsd.org/changeset/base/247693 Log: MFS 9->8 r209778: Add further documentation for netDev in install.cfg to reflect the new usage. Approved by: cperciva Modified: stable/8/usr.sbin/sysinstall/install.cfg Modified: stable/8/usr.sbin/sysinstall/install.cfg ============================================================================== --- stable/8/usr.sbin/sysinstall/install.cfg Sun Mar 3 08:17:17 2013 (r247692) +++ stable/8/usr.sbin/sysinstall/install.cfg Sun Mar 3 08:21:17 2013 (r247693) @@ -20,6 +20,7 @@ netmask=255.255.255.240 ################################ # Which installation device to use - ftp is pointed directly at my local # machine and the installation device is my WD8013 ethernet interface. +# netDev can be set to ANY or a comma-delimited list of interfaces. _ftpPath=ftp://time.cdrom.com/pub netDev=ed0 mediaSetFTP From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 08:51:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B3D5A2B; Sun, 3 Mar 2013 08:51:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8C8C9AE9; Sun, 3 Mar 2013 08:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r238pve1060793; Sun, 3 Mar 2013 08:51:57 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r238pv0r060791; Sun, 3 Mar 2013 08:51:57 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030851.r238pv0r060791@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 08:51:57 +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: r247694 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 08:51:57 -0000 Author: dteske Date: Sun Mar 3 08:51:56 2013 New Revision: 247694 URL: http://svnweb.freebsd.org/changeset/base/247694 Log: MFS 9->8 r217491 with slight modification: Reduce the amount of text users need to read on each screen. Also try and make it more relevant to modern systems: for example users will be familiar with the MBR but possibly less so with MS-DOS. After installation has finished don't return to the main menu but exit. Slight modification: Ignore the last sentence (need feedback from brucec before carrying that back to 8 where sysinstall is still the main installer). Modified: stable/8/usr.sbin/sysinstall/install.c stable/8/usr.sbin/sysinstall/menus.c Modified: stable/8/usr.sbin/sysinstall/install.c ============================================================================== --- stable/8/usr.sbin/sysinstall/install.c Sun Mar 3 08:21:17 2013 (r247693) +++ stable/8/usr.sbin/sysinstall/install.c Sun Mar 3 08:51:56 2013 (r247694) @@ -635,10 +635,10 @@ installStandard(dialogMenuItem *self) variable_set2(SYSTEM_STATE, "standard", 0); dialog_clear_norefresh(); #ifdef WITH_SLICES - msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n" + msgConfirm("In the next menu, you will need to set up an MBR partitioning\n" "scheme for your hard disk. If you simply wish to devote all disk space\n" - "to FreeBSD (overwriting anything else that might be on the disk(s) selected)\n" - "then use the (A)ll command to select the default partitioning scheme followed\n" + "to FreeBSD (overwriting anything else that might be on the disk selected)\n" + "then use the (A)ll command to create a single partition followed\n" "by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n" "partition marked \"unused\" and use the (C)reate command."); @@ -653,7 +653,7 @@ nodisks: goto nodisks; } - msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n" + msgConfirm("Now you need to create BSD partitions inside of the MBR partition(s)\n" "just created. If you have a reasonable amount of disk space (1GB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" "allocate space automatically. If you have more specific needs or just don't\n" Modified: stable/8/usr.sbin/sysinstall/menus.c ============================================================================== --- stable/8/usr.sbin/sysinstall/menus.c Sun Mar 3 08:21:17 2013 (r247693) +++ stable/8/usr.sbin/sysinstall/menus.c Sun Mar 3 08:51:56 2013 (r247694) @@ -174,7 +174,7 @@ DMenu MenuIndex = { #ifdef WITH_MICE { " Device, Mouse", "The mouse configuration menu.", NULL, dmenuSubmenu, NULL, &MenuMouse }, #endif - { " Disklabel", "The disk Label editor", NULL, diskLabelEditor }, + { " Disklabel", "The disk label editor", NULL, diskLabelEditor }, { " Dists, All", "Root of the distribution tree.", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { " Dists, Basic", "Basic FreeBSD distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSubDistributions }, { " Dists, Developer", "Select developer's distribution.", checkDistDeveloper, distSetDeveloper }, @@ -213,7 +213,7 @@ DMenu MenuIndex = { { " Media, UFS", "Select UFS installation media.", NULL, mediaSetUFS }, { " Media, FTP", "Select FTP installation media.", NULL, mediaSetFTP }, { " Media, FTP Passive", "Select passive FTP installation media.", NULL, mediaSetFTPPassive }, - { " Media, HTTP", "Select FTP via HTTP proxy installation media.", NULL, mediaSetHTTP }, + { " Media, HTTP", "Select FTP via HTTP proxy install media.", NULL, mediaSetHTTP }, { " Network Interfaces", "Configure network interfaces", NULL, tcpMenuSelect }, { " Networking Services", "The network services menu.", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " NFS, client", "Set NFS client flag.", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, @@ -222,7 +222,7 @@ DMenu MenuIndex = { { " Options", "The options editor.", NULL, optionsEditor }, { " Packages", "The packages collection", NULL, configPackages }, #ifdef WITH_SLICES - { " Partition", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, + { " Partition", "The disk slice (PC-style partition) editor", NULL, diskPartitionEditor }, #endif { " PCNFSD", "Run authentication server for PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, @@ -1215,10 +1215,10 @@ DMenu MenuConfigure = { { " Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, #ifdef WITH_SLICES - { " Fdisk", "The disk Slice (PC-style partition) Editor", + { " Fdisk", "The disk slice (PC-style partition) editor", NULL, diskPartitionEditor }, #endif - { " Label", "The disk Label editor", + { " Label", "The disk label editor", NULL, diskLabelEditor }, { " User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, @@ -1864,10 +1864,7 @@ DMenu MenuSysconsKeymap = { "System Console Keymap", "The system console driver for FreeBSD defaults to a standard\n" "\"PC-98x1\" keyboard map. Users may wish to choose one of the\n" - "other keymaps below.\n" - "Note that sysinstall itself only uses the part of the keyboard map\n" - "which is required to generate the ANSI character subset, but your\n" - "choice of keymap will also be saved for later (fuller) use.", + "other keymaps below.", "Choose a keyboard map", NULL, { { "Japanese PC-98x1", "Japanese PC-98x1 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98" }, @@ -1879,12 +1876,8 @@ DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The system console driver for FreeBSD defaults to a standard\n" - "\"American\" keyboard map. Users in other countries (or with\n" - "different keyboard preferences) may wish to choose one of the\n" - "other keymaps below.\n" - "Note that sysinstall itself only uses the part of the keyboard map\n" - "which is required to generate the ANSI character subset, but your\n" - "choice of keymap will also be saved for later (fuller) use.", + "\"US\" keyboard map. Users may wish to choose one of the\n" + "other keymaps below.", "Choose a keyboard map", NULL, { { "Belgian", "Belgian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=be.iso" }, From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 08:56:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8A178BB3; Sun, 3 Mar 2013 08:56:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7BFFFB02; Sun, 3 Mar 2013 08:56:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r238uB6E061412; Sun, 3 Mar 2013 08:56:11 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r238uBau061411; Sun, 3 Mar 2013 08:56:11 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030856.r238uBau061411@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 08:56:11 +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: r247695 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 08:56:11 -0000 Author: dteske Date: Sun Mar 3 08:56:10 2013 New Revision: 247695 URL: http://svnweb.freebsd.org/changeset/base/247695 Log: MFS 9->8 the sysinstall portion of r223492: Remove duplicated header files Modified: stable/8/usr.sbin/sysinstall/modules.c Modified: stable/8/usr.sbin/sysinstall/modules.c ============================================================================== --- stable/8/usr.sbin/sysinstall/modules.c Sun Mar 3 08:51:56 2013 (r247694) +++ stable/8/usr.sbin/sysinstall/modules.c Sun Mar 3 08:56:10 2013 (r247695) @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 09:10:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B300C49B; Sun, 3 Mar 2013 09:10:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4FE5B5C; Sun, 3 Mar 2013 09:10:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239A0VV065403; Sun, 3 Mar 2013 09:10:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239A0Bb065396; Sun, 3 Mar 2013 09:10:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030910.r239A0Bb065396@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 09:10:00 +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: r247697 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 09:10:00 -0000 Author: dteske Date: Sun Mar 3 09:09:59 2013 New Revision: 247697 URL: http://svnweb.freebsd.org/changeset/base/247697 Log: MFS 9->8 r209782: Add support for remote logging to syslogd via an install.cfg variable. Approved by: cperciva Modified: stable/8/usr.sbin/sysinstall/install.cfg stable/8/usr.sbin/sysinstall/msg.c stable/8/usr.sbin/sysinstall/sysinstall.h Modified: stable/8/usr.sbin/sysinstall/install.cfg ============================================================================== --- stable/8/usr.sbin/sysinstall/install.cfg Sun Mar 3 09:09:35 2013 (r247696) +++ stable/8/usr.sbin/sysinstall/install.cfg Sun Mar 3 09:09:59 2013 (r247697) @@ -17,6 +17,9 @@ ipaddr=204.216.27.230 netmask=255.255.255.240 ################################ +# Log to a remote syslogd server +syslogdServer=10.0.1.1 + ################################ # Which installation device to use - ftp is pointed directly at my local # machine and the installation device is my WD8013 ethernet interface. Modified: stable/8/usr.sbin/sysinstall/msg.c ============================================================================== --- stable/8/usr.sbin/sysinstall/msg.c Sun Mar 3 09:09:35 2013 (r247696) +++ stable/8/usr.sbin/sysinstall/msg.c Sun Mar 3 09:09:59 2013 (r247697) @@ -34,10 +34,18 @@ * */ -#include "sysinstall.h" -#include #include #include +#include +#include + +#include +#include + +#include +#include + +#include "sysinstall.h" Boolean isDebug(void) @@ -47,6 +55,50 @@ isDebug(void) return (cp = variable_get(VAR_DEBUG)) && strcmp(cp, "no"); } +static Boolean +isNetworkUp(void) +{ + if (!(RunningAsInit) || + (variable_check("NETWORK_CONFIGURED=NO")) != TRUE) { + return TRUE; + } + + return FALSE; +} + +void +msgSyslog(const char *errstr) +{ + struct sockaddr_in server; + struct hostent *hp; + char *host, *line; + int sock; + + if (!isNetworkUp()) + return; + + if (!(host = variable_get(VAR_SYSLOG_SERVER))) + return; + + if (!(hp = gethostbyname2(host, AF_INET))) + return; + + if (!(sock = socket(AF_INET, SOCK_DGRAM, 0))) + return; + + bzero(&server, sizeof(struct sockaddr_in)); + server.sin_family = AF_INET; + server.sin_port = htons(514); + bcopy((char *)hp->h_addr, (char *)&server.sin_addr, hp->h_length); + + asprintf(&line, "<%d>%s", LOG_NOTICE, errstr); + sendto(sock, line, strlen(line), 0, (struct sockaddr *)&server, + sizeof(struct sockaddr_in)); + + close(sock); + free(line); +} + /* Whack up an informational message on the status line, in stand-out */ void msgYap(char *fmt, ...) @@ -99,6 +151,8 @@ msgInfo(char *fmt, ...) attrset(attrs); move(StatusLine, 79); refresh(); + + msgSyslog(errstr); } /* Whack up a warning on the status line */ @@ -120,8 +174,15 @@ msgWarn(char *fmt, ...) mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); - if (OnVTY && isDebug()) - msgDebug("Warning message `%s'\n", errstr); + + /* we don't want this hitting syslog twice */ + if (isDebug()) { + if (OnVTY) + msgDebug("Warning message `%s'\n", errstr); + else + msgSyslog(errstr); + } + } /* Whack up an error on the status line */ @@ -143,8 +204,14 @@ msgError(char *fmt, ...) mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); - if (OnVTY && isDebug()) - msgDebug("Error message `%s'\n", errstr); + + /* we don't want this hitting syslog twice */ + if (isDebug()) { + if (OnVTY) + msgDebug("Error message `%s'\n", errstr); + else + msgSyslog(errstr); + } } /* Whack up a fatal error on the status line */ @@ -174,6 +241,8 @@ msgFatal(char *fmt, ...) refresh(); if (OnVTY) msgDebug("Fatal error `%s'!\n", errstr); + else + msgSyslog(errstr); getch(); systemShutdown(1); } @@ -316,6 +385,9 @@ msgDebug(char *fmt, ...) va_start(args, fmt); vsnprintf((char *)(dbg + strlen(dbg)), FILENAME_MAX, fmt, args); va_end(args); + + msgSyslog(dbg); + write(DebugFD, dbg, strlen(dbg)); } Modified: stable/8/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- stable/8/usr.sbin/sysinstall/sysinstall.h Sun Mar 3 09:09:35 2013 (r247696) +++ stable/8/usr.sbin/sysinstall/sysinstall.h Sun Mar 3 09:09:59 2013 (r247697) @@ -183,6 +183,7 @@ #define VAR_SERIAL_SPEED "serialSpeed" #define VAR_SLOW_ETHER "slowEthernetCard" #define VAR_SWAP_SIZE "swapSize" +#define VAR_SYSLOG_SERVER "syslogdServer" #define VAR_TRY_DHCP "tryDHCP" #define VAR_TRY_RTSOL "tryRTSOL" #define VAR_UFS_PATH "ufs" From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 09:11:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E33D3613; Sun, 3 Mar 2013 09:11:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BFB87B6A; Sun, 3 Mar 2013 09:11:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239BO8G067284; Sun, 3 Mar 2013 09:11:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239BOId067283; Sun, 3 Mar 2013 09:11:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303030911.r239BOId067283@svn.freebsd.org> From: Alexander Motin Date: Sun, 3 Mar 2013 09:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247698 - 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 09:11:25 -0000 Author: mav Date: Sun Mar 3 09:11:24 2013 New Revision: 247698 URL: http://svnweb.freebsd.org/changeset/base/247698 Log: MFcalloutng: Some whitespace fixes. Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sun Mar 3 09:09:59 2013 (r247697) +++ head/sys/kern/kern_timeout.c Sun Mar 3 09:11:24 2013 (r247698) @@ -205,7 +205,7 @@ cc_cme_migrating(struct callout_cpu *cc) } /* - * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization + * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization * * This code is called very early in the kernel initialization sequence, * and may be called more then once. @@ -704,7 +704,7 @@ softclock(void *arg) * Initialize a handle so that using it with untimeout is benign. * * See AT&T BCI Driver Reference Manual for specification. This - * implementation differs from that one in that although an + * implementation differs from that one in that although an * identification value is returned from timeout, the original * arguments to timeout as well as the identifier are used to * identify entries for untimeout. From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 09:13:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0CD5C7AB; Sun, 3 Mar 2013 09:13:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F33ACBD9; Sun, 3 Mar 2013 09:13:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239DIov067690; Sun, 3 Mar 2013 09:13:18 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239DI9p067689; Sun, 3 Mar 2013 09:13:18 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030913.r239DI9p067689@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 09:13:18 +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: r247700 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 09:13:19 -0000 Author: dteske Date: Sun Mar 3 09:13:18 2013 New Revision: 247700 URL: http://svnweb.freebsd.org/changeset/base/247700 Log: MFS 9->8 r247267: Oops, r55392 (over 13 years ago) forgot to classify the new HTTP Proxy for the options dialog (causing "" to be displayed for the HTTP media type). Modified: stable/8/usr.sbin/sysinstall/options.c Modified: stable/8/usr.sbin/sysinstall/options.c ============================================================================== --- stable/8/usr.sbin/sysinstall/options.c Sun Mar 3 09:13:17 2013 (r247699) +++ stable/8/usr.sbin/sysinstall/options.c Sun Mar 3 09:13:18 2013 (r247700) @@ -75,6 +75,9 @@ mediaCheck(Option *opt) case DEVICE_TYPE_FTP: return "FTP"; + case DEVICE_TYPE_HTTP: + return "HTTP Proxy"; + case DEVICE_TYPE_CDROM: return "CDROM"; From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 09:21:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4FA6DBB5; Sun, 3 Mar 2013 09:21:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 370DCC1E; Sun, 3 Mar 2013 09:21:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239LJXC070439; Sun, 3 Mar 2013 09:21:19 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239LJ4d070437; Sun, 3 Mar 2013 09:21:19 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030921.r239LJ4d070437@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 09:21:19 +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: r247702 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 09:21:19 -0000 Author: dteske Date: Sun Mar 3 09:21:18 2013 New Revision: 247702 URL: http://svnweb.freebsd.org/changeset/base/247702 Log: MFS 9->8 r209481: Update the man page to reflect the changes to the netDev configuration variable. Approved by: cperciva MFS 9->8 r209446: Remove unnecessarily inflammatory commentary. Approved by: cperciva Modified: stable/8/usr.sbin/sysinstall/sysinstall.8 Modified: stable/8/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- stable/8/usr.sbin/sysinstall/sysinstall.8 Sun Mar 3 09:18:15 2013 (r247701) +++ stable/8/usr.sbin/sysinstall/sysinstall.8 Sun Mar 3 09:21:18 2013 (r247702) @@ -642,12 +642,10 @@ The domain name of the host being instal .It defaultrouter The default router for this host (non-optional). .It netDev -Which host interface to use -.Ar ( ed0 -or -.Ar ep0 , -for example. -Non-optional). +Which network interface to use. +Multiple network interfaces may be specified using a comma delimited list. +If netDev is set to ANY, all available network interfaces will be probed and the +first interface found to have a link will be used. (non-optional). .It netInteractive If set, bring up the interactive network setup form even if all relevant configuration variables are already set (optional). @@ -900,8 +898,5 @@ and .Xr bsdlabel 8 for these tasks. .Pp -This utility is a prototype which lasted several years past -its expiration date and is greatly in need of death. -.Pp There are a (great) number of undocumented variables. UTSL. From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 09:23:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D06B1D36; Sun, 3 Mar 2013 09:23:52 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B843EC34; Sun, 3 Mar 2013 09:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239NqQ3070817; Sun, 3 Mar 2013 09:23:52 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239NqBE070816; Sun, 3 Mar 2013 09:23:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030923.r239NqBE070816@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 09:23:52 +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: r247703 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 09:23:52 -0000 Author: dteske Date: Sun Mar 3 09:23:52 2013 New Revision: 247703 URL: http://svnweb.freebsd.org/changeset/base/247703 Log: MFS 9->8 r215314: ipv6_enable has been obsoleted in favour of ipv6_activate_all_interfaces. Modified: stable/8/usr.sbin/sysinstall/sysinstall.h Modified: stable/8/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- stable/8/usr.sbin/sysinstall/sysinstall.h Sun Mar 3 09:21:18 2013 (r247702) +++ stable/8/usr.sbin/sysinstall/sysinstall.h Sun Mar 3 09:23:52 2013 (r247703) @@ -130,7 +130,7 @@ #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" -#define VAR_IPV6_ENABLE "ipv6_enable" +#define VAR_IPV6_ENABLE "ipv6_activate_all_interfaces" #define VAR_IPV6ADDR "ipv6addr" #define VAR_KERN_SECURELEVEL "kern_securelevel" #define VAR_KEYMAP "keymap" From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 09:26:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 446A6EDB; Sun, 3 Mar 2013 09:26:59 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F885CC4; Sun, 3 Mar 2013 09:26:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239QxRX071272; Sun, 3 Mar 2013 09:26:59 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239QwPl071271; Sun, 3 Mar 2013 09:26:58 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303030926.r239QwPl071271@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 09:26:58 +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: r247704 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 09:26:59 -0000 Author: dteske Date: Sun Mar 3 09:26:58 2013 New Revision: 247704 URL: http://svnweb.freebsd.org/changeset/base/247704 Log: MFS 9->8 r244688: Fix error message to be accurate for when ProgName is not "sysinstall" (oops?) Modified: stable/8/usr.sbin/sysinstall/variable.c Modified: stable/8/usr.sbin/sysinstall/variable.c ============================================================================== --- stable/8/usr.sbin/sysinstall/variable.c Sun Mar 3 09:23:52 2013 (r247703) +++ stable/8/usr.sbin/sysinstall/variable.c Sun Mar 3 09:26:58 2013 (r247704) @@ -247,8 +247,8 @@ dump_variables(dialogMenuItem *unused) fp = fopen("/etc/sysinstall.vars", "w"); if (!fp) { - msgConfirm("Unable to write to /etc/%s.vars: %s", - ProgName, strerror(errno)); + msgConfirm("Unable to write to /etc/sysinstall.vars: %s", + strerror(errno)); return DITEM_FAILURE; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 09:47:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C972E22C; Sun, 3 Mar 2013 09:47:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5490D14; Sun, 3 Mar 2013 09:47:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239lmiN077225; Sun, 3 Mar 2013 09:47:48 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239lmdi077219; Sun, 3 Mar 2013 09:47:48 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201303030947.r239lmdi077219@svn.freebsd.org> From: Josh Paetzel Date: Sun, 3 Mar 2013 09:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247705 - in head/usr.sbin/pc-sysinstall: backend examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 09:47:48 -0000 Author: jpaetzel Date: Sun Mar 3 09:47:47 2013 New Revision: 247705 URL: http://svnweb.freebsd.org/changeset/base/247705 Log: Fix a bug extracting files from dist scheme Obtained from: PC-BSD Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh head/usr.sbin/pc-sysinstall/backend/functions-parse.sh head/usr.sbin/pc-sysinstall/backend/parseconfig.sh head/usr.sbin/pc-sysinstall/examples/README Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Sun Mar 3 09:26:58 2013 (r247704) +++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Sun Mar 3 09:47:47 2013 (r247705) @@ -29,23 +29,60 @@ . ${BACKEND}/functions-mountoptical.sh +# Performs the extraction of data to disk from FreeBSD dist files +start_extract_dist() +{ + if [ -z "$1" ] ; then exit_err "Called dist extraction with no directory set!"; fi + if [ -z "$INSFILE" ]; then exit_err "Called extraction with no install file set!"; fi + local DDIR="$1" + + # Check if we are doing an upgrade, and if so use our exclude list + if [ "${INSTALLMODE}" = "upgrade" ]; then + TAROPTS="-X ${PROGDIR}/conf/exclude-from-upgrade" + else + TAROPTS="" + fi + + # Loop though and extract dist files + for di in $INSFILE + do + # Check the MANIFEST see if we have an archive size / count + if [ -e "${DDIR}/MANIFEST" ]; then + count=`grep "^${di}.txz" ${DDIR}/MANIFEST | awk '{print $3}'` + if [ ! -z "$count" ] ; then + echo "INSTALLCOUNT: $count" + fi + fi + echo_log "pc-sysinstall: Starting Extraction (${di})" + tar -xpv -C ${FSMNT} -f ${DDIR}/${di}.txz ${TAROPTS} >&1 2>&1 + if [ $? -ne 0 ]; then + exit_err "ERROR: Failed extracting the dist file: $di" + fi + done + + # Check if this was a FTP download and clean it up now + if [ "${INSTALLMEDIUM}" = "ftp" ]; then + echo_log "Cleaning up downloaded archives" + rm -rf ${DDIR} + fi + + echo_log "pc-sysinstall: Extraction Finished" +} + # Performs the extraction of data to disk from a uzip or tar archive start_extract_uzip_tar() { - if [ -z "$INSFILE" ] - then + if [ -z "$INSFILE" ]; then exit_err "ERROR: Called extraction with no install file set!" fi # Check if we have a .count file, and echo it out for a front-end to use in progress bars - if [ -e "${INSFILE}.count" ] - then + if [ -e "${INSFILE}.count" ]; then echo "INSTALLCOUNT: `cat ${INSFILE}.count`" fi # Check if we are doing an upgrade, and if so use our exclude list - if [ "${INSTALLMODE}" = "upgrade" ] - then + if [ "${INSTALLMODE}" = "upgrade" ]; then TAROPTS="-X ${PROGDIR}/conf/exclude-from-upgrade" else TAROPTS="" @@ -87,9 +124,8 @@ start_extract_uzip_tar() mdconfig -d -u ${MDDEVICE} ;; tar) - tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1 - if [ $? -ne 0 ] - then + tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1 + if [ $? -ne 0 ]; then exit_err "ERROR: Failed extracting the tar image" fi ;; @@ -176,6 +212,38 @@ start_extract_split() echo_log "pc-sysinstall: Extraction Finished" }; +# Function which will attempt to fetch the dist file(s) before we start +fetch_dist_file() +{ + get_value_from_cfg ftpPath + if [ -z "$VAL" ] + then + exit_err "ERROR: Install medium was set to ftp, but no ftpPath was provided!" + fi + + FTPPATH="${VAL}" + + # Check if we have a /usr partition to save the download + if [ -d "${FSMNT}/usr" ] + then + DLDIR="${FSMNT}/usr/.fetch.$$" + else + DLDIR="${FSMNT}/.fetch.$$" + fi + mkdir -p ${DLDIR} + + # Do the fetch of the dist archive(s) now + for di in $INSFILE + do + fetch_file "${FTPPATH}/${di}.txz" "${DLDIR}/${di}.txz" "1" + done + + # Check to see if there is a MANIFEST file for this install + fetch_file "${FTPPATH}/MANIFEST" "${DLDIR}/MANIFEST" "0" + + export DLDIR +}; + # Function which will attempt to fetch the install file before we start # the install fetch_install_file() @@ -390,6 +458,13 @@ init_extraction() case $PACKAGETYPE in uzip) INSFILE="${FBSD_UZIP_FILE}" ;; tar) INSFILE="${FBSD_TAR_FILE}" ;; + dist) + get_value_from_cfg_with_spaces distFiles + if [ -z "$VAL" ] ; then + exit_err "No dist files specified!" + fi + INSFILE="${VAL}" + ;; split) INSDIR="${FBSD_BRANCH_DIR}" @@ -401,6 +476,13 @@ init_extraction() case $PACKAGETYPE in uzip) INSFILE="${UZIP_FILE}" ;; tar) INSFILE="${TAR_FILE}" ;; + dist) + get_value_from_cfg_with_spaces distFiles + if [ -z "$VAL" ] ; then + exit_err "No dist files specified!" + fi + INSFILE="${VAL}" + ;; esac fi export INSFILE @@ -417,22 +499,32 @@ init_extraction() start_extract_split else - INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE - start_extract_uzip_tar + if [ "$PACKAGETYPE" = "dist" ] ; then + start_extract_dist "${CDMNT}/usr/freebsd-dist" + else + INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE + start_extract_uzip_tar + fi fi ;; ftp) - if [ "$PACKAGETYPE" = "split" ] - then - fetch_split_files + case $PACKAGETYPE in + split) + fetch_split_files - INSDIR="${INSFILE}" ; export INSDIR - start_extract_split - else - fetch_install_file - start_extract_uzip_tar - fi + INSDIR="${INSFILE}" ; export INSDIR + start_extract_split + ;; + dist) + fetch_dist_file + start_extract_dist "$DLDIR" + ;; + *) + fetch_install_file + start_extract_uzip_tar + ;; + esac ;; sftp) ;; @@ -446,8 +538,13 @@ init_extraction() exit_err "Install medium was set to local, but no localPath was provided!" fi LOCALPATH=$VAL - INSFILE="${LOCALPATH}/${INSFILE}" ; export INSFILE - start_extract_uzip_tar + if [ "$PACKAGETYPE" = "dist" ] ; then + INSFILE="${INSFILE}" ; export INSFILE + start_extract_dist "$LOCALPATH" + else + INSFILE="${LOCALPATH}/${INSFILE}" ; export INSFILE + start_extract_uzip_tar + fi ;; *) exit_err "ERROR: Unknown install medium" ;; esac Modified: head/usr.sbin/pc-sysinstall/backend/functions-parse.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-parse.sh Sun Mar 3 09:26:58 2013 (r247704) +++ head/usr.sbin/pc-sysinstall/backend/functions-parse.sh Sun Mar 3 09:47:47 2013 (r247705) @@ -45,7 +45,7 @@ get_value_from_cfg_with_spaces() { if [ -n "${1}" ] then - export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2-` + export VAL="`grep ^${1}= ${CFGF} | head -n 1 | cut -d '=' -f 2-`" else exit_err "Error: Did we forgot to supply a setting to grab?" fi Modified: head/usr.sbin/pc-sysinstall/backend/parseconfig.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Sun Mar 3 09:26:58 2013 (r247704) +++ head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Sun Mar 3 09:47:47 2013 (r247705) @@ -69,7 +69,7 @@ file_sanity_check "installMode installTy check_value installMode "fresh upgrade extract" check_value installType "PCBSD FreeBSD" check_value installMedium "dvd usb ftp rsync image local" -check_value packageType "uzip tar rsync split" +check_value packageType "uzip tar rsync split dist" if_check_value_exists mirrorbal "load prefer round-robin split" # We passed all sanity checks! Yay, lets start the install Modified: head/usr.sbin/pc-sysinstall/examples/README ============================================================================== --- head/usr.sbin/pc-sysinstall/examples/README Sun Mar 3 09:26:58 2013 (r247704) +++ head/usr.sbin/pc-sysinstall/examples/README Sun Mar 3 09:47:47 2013 (r247705) @@ -243,11 +243,16 @@ Set installMedium= to the source type we Available Types: dvd - Search for and mount the DVD which contains the install archive +local - Pull files directly from a local directory usb - Search for and mount the USB drive which contains the install archive ftp - The install archive will be fetched from a FTP / HTTP server before install rsync - Pull the system data from a ssh + rsync server, specified with variables below image - Install system from an image +# localPath=/usr/freebsd-dist + +Location of the directory we will be pulling installation files from + # installType=(PCBSD, FreeBSD) Set the type of system we are installing, PCBSD or FreeBSD @@ -256,10 +261,14 @@ Set the type of system we are installing The installer archive, if not using the defaults specified in conf/pc-sysinstall.conf -# packageType=(tar, uzip, split) +# packageType=(tar, uzip, split, dist) The archive type we are extracting from when using dvd, usb or ftp +# distFiles=base src kernel + +List of dist files to install when packageType=dist + # ftpPath=ftp://ftp.pcbsd.org/pub/8.0/netinstall Location of the installer archive when using a installMedium=ftp From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 11:09:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 125B24D4; Sun, 3 Mar 2013 11:09:56 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E2B8DF40; Sun, 3 Mar 2013 11:09:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23B9tj1002566; Sun, 3 Mar 2013 11:09:55 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23B9tMU002565; Sun, 3 Mar 2013 11:09:55 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201303031109.r23B9tMU002565@svn.freebsd.org> From: Antoine Brodin Date: Sun, 3 Mar 2013 11:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247709 - 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 11:09:56 -0000 Author: antoine Date: Sun Mar 3 11:09:55 2013 New Revision: 247709 URL: http://svnweb.freebsd.org/changeset/base/247709 Log: Add more obsolete files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Mar 3 10:52:41 2013 (r247708) +++ head/ObsoleteFiles.inc Sun Mar 3 11:09:55 2013 (r247709) @@ -39,6 +39,8 @@ # done # 20130302: NTFS support removed +OLD_FILES+=rescue/mount_ntfs +OLD_FILES+=sbin/mount_ntfs OLD_FILES+=usr/include/fs/ntfs/ntfs.h OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h @@ -51,6 +53,7 @@ OLD_FILES+=usr/share/man/man8/mount_ntfs # 20130302: PORTALFS support removed OLD_FILES+=usr/include/fs/portalfs/portal.h OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/sbin/mount_portalfs OLD_FILES+=usr/share/examples/portal/README OLD_FILES+=usr/share/examples/portal/portal.conf OLD_DIRS+=usr/share/examples/portal @@ -79,9 +82,10 @@ OLD_DIRS+=var/remote # 20121114: zpool-features manual page moved from section 5 to 7 OLD_FILES+=usr/share/man/man5/zpool-features.5.gz # 20121022: remove harp, hfa and idt man page -OLD_FILES+=share/man/man4/harp.4 -OLD_FILES+=share/man/man4/hfa.4 -OLD_FILES+=share/man/man4/idt.4 +OLD_FILES+=usr/share/man/man4/harp.4.gz +OLD_FILES+=usr/share/man/man4/hfa.4.gz +OLD_FILES+=usr/share/man/man4/idt.4.gz +OLD_FILES+=usr/share/man/man4/if_idt.4.gz # 20121022: VFS_LOCK_GIANT elimination OLD_FILES+=usr/share/man/man9/VFS_LOCK_GIANT.9.gz OLD_FILES+=usr/share/man/man9/VFS_UNLOCK_GIANT.9.gz From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 13:21:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 02F36BEA; Sun, 3 Mar 2013 13:21:22 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ia0-x236.google.com (mail-ia0-x236.google.com [IPv6:2607:f8b0:4001:c02::236]) by mx1.freebsd.org (Postfix) with ESMTP id 860B5714; Sun, 3 Mar 2013 13:21:21 +0000 (UTC) Received: by mail-ia0-f182.google.com with SMTP id w21so2056109iac.27 for ; Sun, 03 Mar 2013 05:21:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=p4ErHjMKZGR9pUQlPH440e9MQKRD527jEzlPCPtDJE8=; b=pTkFYJ2ZEdGCG+EQmW6YA56iYZ5R76tTDZ+uStgQLHyHblGHpD2eLirmGKQgcflMDN aNiRYNU2IArjLSPH/E2R3e3i72hAccfoCnMb6aKkYrCCMrXBbm4kt5Epg4T1u25De09u yhr9ZrVayiyPeqDQhANiqcxg8OR8rtbhGcY63GVIv4ippSlmslUAnKhcNoswrRazSx6+ x0f5cxRn9GwkT8ldIx2z1E5kSv1CIoUgZeReBgP0Vh6/rUs6vOD630ZsNqOPwlsN79ms 8tRNwwWznP96FDAaZ5j/wXLuw7x/eQ9O81Aa/q8o1ssbttbkfWtCJbS1g/S7nLAqp1ig fr6A== MIME-Version: 1.0 X-Received: by 10.50.184.132 with SMTP id eu4mr141613igc.19.1362316881136; Sun, 03 Mar 2013 05:21:21 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Sun, 3 Mar 2013 05:21:20 -0800 (PST) In-Reply-To: <201303031109.r23B9tMU002565@svn.freebsd.org> References: <201303031109.r23B9tMU002565@svn.freebsd.org> Date: Sun, 3 Mar 2013 14:21:20 +0100 X-Google-Sender-Auth: ks2YFKeqk6JNnbZYlct7NNiK-Zw Message-ID: Subject: Re: svn commit: r247709 - head From: Attilio Rao To: Antoine Brodin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages 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 Mar 2013 13:21:22 -0000 On Sun, Mar 3, 2013 at 12:09 PM, Antoine Brodin wrote: > Author: antoine > Date: Sun Mar 3 11:09:55 2013 > New Revision: 247709 > URL: http://svnweb.freebsd.org/changeset/base/247709 > > Log: > Add more obsolete files. Pointy hat to me (most of). Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 13:43:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1B02D52A; Sun, 3 Mar 2013 13:43:18 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id D7A617EE; Sun, 3 Mar 2013 13:43:17 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 341833592DA; Sun, 3 Mar 2013 14:43:15 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 1ECBA2848C; Sun, 3 Mar 2013 14:43:15 +0100 (CET) Date: Sun, 3 Mar 2013 14:43:14 +0100 From: Jilles Tjoelker To: "Pedro F. Giffuni" Subject: Re: svn commit: r247683 - head/lib/libedit Message-ID: <20130303134314.GA21318@stack.nl> References: <201303030211.r232B4RR039202@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201303030211.r232B4RR039202@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 13:43:18 -0000 On Sun, Mar 03, 2013 at 02:11:04AM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Sun Mar 3 02:11:03 2013 > New Revision: 247683 > URL: http://svnweb.freebsd.org/changeset/base/247683 > Log: > libedit does not need to be linked with ncurses > libedit uses the terminfo headers but doesn't really need > to be linked with ncurses. > Discussed with: christos@NetBSD > MFC after; 3 days > Modified: > head/lib/libedit/Makefile > Modified: head/lib/libedit/Makefile > ============================================================================== > --- head/lib/libedit/Makefile Sun Mar 3 01:36:31 2013 (r247682) > +++ head/lib/libedit/Makefile Sun Mar 3 02:11:03 2013 (r247683) > @@ -11,7 +11,6 @@ OSRCS= chared.c common.c el.c emacs.c fc > parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c > > DPADD= ${LIBNCURSES} > -LDADD= -lncurses > > MAN= editline.3 editrc.5 > This is wrong. libedit.so uses symbols such as tgetent from libcurses.so, so it should be linked to libcurses.so. These symbols are easily visible in the output of objdump -T /lib/libedit.so.7 because they are unversioned. There is not much breakage because most applications using libedit explicitly link to libcurses, since that is required for static linking. For dynamic linking it is really a case of overlinking, particularly because libedit completely abstracts away libcurses from the application's point of view (in other words, the application need not call libcurses itself). More subtle breakage will result if libcurses.so starts using versioned symbols and libedit.so uses a symbol with more than one version, as rtld will then give it the oldest version where libedit.so expects a newer version. Perhaps we should add -Wl,--no-undefined to SOLINKOPTS in bsd.lib.mk with the exception of libraries that deliberately have undefined symbols (for example, to be supplied by the application). -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 14:05:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F2BFC48; Sun, 3 Mar 2013 14:05:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5ECE48B2; Sun, 3 Mar 2013 14:05:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23E54Zl056673; Sun, 3 Mar 2013 14:05:04 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23E53aT056667; Sun, 3 Mar 2013 14:05:03 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303031405.r23E53aT056667@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 3 Mar 2013 14:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247712 - 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 14:05:04 -0000 Author: melifaro Date: Sun Mar 3 14:05:03 2013 New Revision: 247712 URL: http://svnweb.freebsd.org/changeset/base/247712 Log: Implement buffer size checking in ipfw(8) add cmd. PR: bin/65961 Submitted by: Eugene Grosbein MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sbin/ipfw/ipv6.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Mar 3 13:53:58 2013 (r247711) +++ head/sbin/ipfw/ipfw2.c Sun Mar 3 14:05:03 2013 (r247712) @@ -64,6 +64,22 @@ int ipfw_socket = -1; #define s6_addr32 __u6_addr.__u6_addr32 #endif +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) +/* + * Check if we have enough space in cmd buffer. Note that since + * first 8? u32 words are reserved by reserved header, full cmd + * buffer can't be used, so we need to protect from buffer overrun + * only. At the beginnig, cblen is less than actual buffer size by + * size of ipfw_insn_u32 instruction + 1 u32 work. This eliminates need + * for checking small instructions fitting in given range. + * We also (ab)use the fact that ipfw_insn is always the first field + * for any custom instruction. + */ +#define CHECK_CMDLEN CHECK_LENGTH(cblen, F_LEN((ipfw_insn *)cmd)) + #define GET_UINT_ARG(arg, min, max, tok, s_x) do { \ if (!av[0]) \ errx(EX_USAGE, "%s: missing argument", match_value(s_x, tok)); \ @@ -653,7 +669,7 @@ strtoport(char *s, char **end, int base, * Fill the body of the command with the list of port ranges. */ static int -fill_newports(ipfw_insn_u16 *cmd, char *av, int proto) +fill_newports(ipfw_insn_u16 *cmd, char *av, int proto, int cblen) { uint16_t a, b, *p = cmd->ports; int i = 0; @@ -664,6 +680,8 @@ fill_newports(ipfw_insn_u16 *cmd, char * if (s == av) /* empty or invalid argument */ return (0); + CHECK_LENGTH(cblen, i + 2); + switch (*s) { case '-': /* a range */ av = s + 1; @@ -2068,7 +2086,7 @@ lookup_host (char *host, struct in_addr * We can have multiple comma-separated address/mask entries. */ static void -fill_ip(ipfw_insn_ip *cmd, char *av) +fill_ip(ipfw_insn_ip *cmd, char *av, int cblen) { int len = 0; uint32_t *d = ((ipfw_insn_u32 *)cmd)->d; @@ -2108,6 +2126,8 @@ fill_ip(ipfw_insn_ip *cmd, char *av) int masklen; char md, nd = '\0'; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn) + 2 + len); + if (p) { md = *p; *p++ = '\0'; @@ -2366,11 +2386,13 @@ ipfw_delete(char *av[]) * patterns which match interfaces. */ static void -fill_iface(ipfw_insn_if *cmd, char *arg) +fill_iface(ipfw_insn_if *cmd, char *arg, int cblen) { cmd->name[0] = '\0'; cmd->o.len |= F_INSN_SIZE(ipfw_insn_if); + CHECK_CMDLEN; + /* Parse the interface or address */ if (strcmp(arg, "any") == 0) cmd->o.len = 0; /* effectively ignore this command */ @@ -2441,8 +2463,10 @@ get_mac_addr_mask(const char *p, uint8_t * the new command in case it has been clobbered before. */ static ipfw_insn * -next_cmd(ipfw_insn *cmd) +next_cmd(ipfw_insn *cmd, int *len) { + *len -= F_LEN(cmd); + CHECK_LENGTH(*len, 0); cmd += F_LEN(cmd); bzero(cmd, sizeof(*cmd)); return cmd; @@ -2452,7 +2476,7 @@ next_cmd(ipfw_insn *cmd) * Takes arguments and copies them into a comment */ static void -fill_comment(ipfw_insn *cmd, char **av) +fill_comment(ipfw_insn *cmd, char **av, int cblen) { int i, l; char *p = (char *)(cmd + 1); @@ -2470,6 +2494,8 @@ fill_comment(ipfw_insn *cmd, char **av) "comment too long (max 80 chars)"); l = 1 + (l+3)/4; cmd->len = (cmd->len & (F_NOT | F_OR)) | l; + CHECK_CMDLEN; + for (i = 0; av[i] != NULL; i++) { strcpy(p, av[i]); p += strlen(av[i]); @@ -2495,7 +2521,7 @@ fill_cmd(ipfw_insn *cmd, enum ipfw_opcod * two microinstructions, and returns the pointer to the last one. */ static ipfw_insn * -add_mac(ipfw_insn *cmd, char *av[]) +add_mac(ipfw_insn *cmd, char *av[], int cblen) { ipfw_insn_mac *mac; @@ -2504,6 +2530,7 @@ add_mac(ipfw_insn *cmd, char *av[]) cmd->opcode = O_MACADDR2; cmd->len = (cmd->len & (F_NOT | F_OR)) | F_INSN_SIZE(ipfw_insn_mac); + CHECK_CMDLEN; mac = (ipfw_insn_mac *)cmd; get_mac_addr_mask(av[0], mac->addr, mac->mask); /* dst */ @@ -2513,12 +2540,13 @@ add_mac(ipfw_insn *cmd, char *av[]) } static ipfw_insn * -add_mactype(ipfw_insn *cmd, char *av) +add_mactype(ipfw_insn *cmd, char *av, int cblen) { if (!av) errx(EX_DATAERR, "missing MAC type"); if (strcmp(av, "any") != 0) { /* we have a non-null type */ - fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE); + fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE, + cblen); cmd->opcode = O_MAC_TYPE; return cmd; } else @@ -2587,9 +2615,9 @@ add_proto_compat(ipfw_insn *cmd, char *a } static ipfw_insn * -add_srcip(ipfw_insn *cmd, char *av) +add_srcip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2604,9 +2632,9 @@ add_srcip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_dstip(ipfw_insn *cmd, char *av) +add_dstip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2621,12 +2649,12 @@ add_dstip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode) +add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode, int cblen) { /* XXX "any" is trapped before. Perhaps "to" */ if (_substrcmp(av, "any") == 0) { return NULL; - } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto)) { + } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto, cblen)) { /* XXX todo: check that we have a protocol with ports */ cmd->opcode = opcode; return cmd; @@ -2635,7 +2663,7 @@ add_ports(ipfw_insn *cmd, char *av, u_ch } static ipfw_insn * -add_src(ipfw_insn *cmd, char *av, u_char proto) +add_src(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2648,11 +2676,11 @@ add_src(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_srcip6(cmd, av); + ret = add_srcip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_srcip(cmd, av); + ret = add_srcip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2661,7 +2689,7 @@ add_src(ipfw_insn *cmd, char *av, u_char } static ipfw_insn * -add_dst(ipfw_insn *cmd, char *av, u_char proto) +add_dst(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2674,11 +2702,11 @@ add_dst(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_dstip6(cmd, av); + ret = add_dstip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_dstip(cmd, av); + ret = add_dstip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2708,6 +2736,7 @@ ipfw_add(char *av[]) * go into actbuf[]. */ static uint32_t rulebuf[255], actbuf[255], cmdbuf[255]; + int rblen, ablen, cblen; ipfw_insn *src, *dst, *cmd, *action, *prev=NULL; ipfw_insn *first_cmd; /* first match pattern */ @@ -2738,6 +2767,15 @@ ipfw_add(char *av[]) cmd = (ipfw_insn *)cmdbuf; action = (ipfw_insn *)actbuf; + rblen = sizeof(rulebuf) / sizeof(rulebuf[0]); + rblen -= offsetof(struct ip_fw, cmd) / sizeof(rulebuf[0]); + ablen = sizeof(actbuf) / sizeof(actbuf[0]); + cblen = sizeof(cmdbuf) / sizeof(cmdbuf[0]); + cblen -= F_INSN_SIZE(ipfw_insn_u32) + 1; + +#define CHECK_RBUFLEN(len) { CHECK_LENGTH(rblen, len); rblen -= len; } +#define CHECK_ACTLEN CHECK_LENGTH(ablen, action->len) + av++; /* [rule N] -- Rule number optional */ @@ -2769,6 +2807,7 @@ ipfw_add(char *av[]) i = match_token(rule_actions, *av); av++; action->len = 1; /* default */ + CHECK_ACTLEN; switch(i) { case TOK_CHECKSTATE: have_state = action; @@ -2820,6 +2859,7 @@ ipfw_add(char *av[]) case TOK_NAT: action->opcode = O_NAT; action->len = F_INSN_SIZE(ipfw_insn_nat); + CHECK_ACTLEN; if (_substrcmp(*av, "global") == 0) { action->arg1 = 0; av++; @@ -2936,6 +2976,7 @@ chkarg: action->opcode = O_FORWARD_IP; action->len = F_INSN_SIZE(ipfw_insn_sa); + CHECK_ACTLEN; /* * In the kernel we assume AF_INET and use only @@ -2952,6 +2993,7 @@ chkarg: action->opcode = O_FORWARD_IP6; action->len = F_INSN_SIZE(ipfw_insn_sa6); + CHECK_ACTLEN; p->sa.sin6_len = sizeof(struct sockaddr_in6); p->sa.sin6_family = AF_INET6; @@ -3005,7 +3047,7 @@ chkarg: default: errx(EX_DATAERR, "invalid action %s\n", av[-1]); } - action = next_cmd(action); + action = next_cmd(action, &ablen); /* * [altq queuename] -- altq tag, optional @@ -3027,6 +3069,7 @@ chkarg: "log cannot be specified more than once"); have_log = (ipfw_insn *)c; cmd->len = F_INSN_SIZE(ipfw_insn_log); + CHECK_CMDLEN; cmd->opcode = O_LOG; if (av[0] && _substrcmp(*av, "logamount") == 0) { av++; @@ -3058,6 +3101,7 @@ chkarg: "altq cannot be specified more than once"); have_altq = (ipfw_insn *)a; cmd->len = F_INSN_SIZE(ipfw_insn_altq); + CHECK_CMDLEN; cmd->opcode = O_ALTQ; a->qid = altq_name_to_qid(*av); av++; @@ -3083,7 +3127,7 @@ chkarg: default: abort(); } - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } if (have_state) /* must be a check-state, we are done */ @@ -3168,7 +3212,7 @@ chkarg: av++; if (F_LEN(cmd) != 0) { prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else if (first_cmd != cmd) { errx(EX_DATAERR, "invalid protocol ``%s''", *av); @@ -3189,11 +3233,11 @@ chkarg: OR_START(source_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing source address"); - if (add_src(cmd, *av, proto)) { + if (add_src(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx(EX_USAGE, "bad source address %s", *av); @@ -3205,10 +3249,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if ( av[0] != NULL ) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3225,11 +3269,11 @@ chkarg: OR_START(dest_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing dst address"); - if (add_dst(cmd, *av, proto)) { + if (add_dst(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx( EX_USAGE, "bad destination address %s", *av); @@ -3241,10 +3285,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if (av[0]) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3332,7 +3376,7 @@ read_options: case TOK_VIA: NEED1("recv, xmit, via require interface name" " or address"); - fill_iface((ipfw_insn_if *)cmd, av[0]); + fill_iface((ipfw_insn_if *)cmd, av[0], cblen); av++; if (F_LEN(cmd) == 0) /* not a valid address */ break; @@ -3352,14 +3396,14 @@ read_options: case TOK_ICMP6TYPES: NEED1("icmptypes requires list of types"); - fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av); + fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av, cblen); av++; break; case TOK_IPTTL: NEED1("ipttl requires TTL"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPTTL)) + if (!add_ports(cmd, *av, 0, O_IPTTL, cblen)) errx(EX_DATAERR, "invalid ipttl %s", *av); } else fill_cmd(cmd, O_IPTTL, 0, strtoul(*av, NULL, 0)); @@ -3369,7 +3413,7 @@ read_options: case TOK_IPID: NEED1("ipid requires id"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPID)) + if (!add_ports(cmd, *av, 0, O_IPID, cblen)) errx(EX_DATAERR, "invalid ipid %s", *av); } else fill_cmd(cmd, O_IPID, 0, strtoul(*av, NULL, 0)); @@ -3379,7 +3423,7 @@ read_options: case TOK_IPLEN: NEED1("iplen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPLEN)) + if (!add_ports(cmd, *av, 0, O_IPLEN, cblen)) errx(EX_DATAERR, "invalid ip len %s", *av); } else fill_cmd(cmd, O_IPLEN, 0, strtoul(*av, NULL, 0)); @@ -3475,7 +3519,7 @@ read_options: case TOK_TCPDATALEN: NEED1("tcpdatalen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPDATALEN)) + if (!add_ports(cmd, *av, 0, O_TCPDATALEN, cblen)) errx(EX_DATAERR, "invalid tcpdata len %s", *av); } else fill_cmd(cmd, O_TCPDATALEN, 0, @@ -3501,7 +3545,7 @@ read_options: case TOK_TCPWIN: NEED1("tcpwin requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPWIN)) + if (!add_ports(cmd, *av, 0, O_TCPWIN, cblen)) errx(EX_DATAERR, "invalid tcpwin len %s", *av); } else fill_cmd(cmd, O_TCPWIN, 0, @@ -3540,6 +3584,7 @@ read_options: have_state = cmd; cmd->len = F_INSN_SIZE(ipfw_insn_limit); + CHECK_CMDLEN; cmd->opcode = O_LIMIT; c->limit_mask = c->conn_limit = 0; @@ -3571,28 +3616,28 @@ read_options: case TOK_SRCIP: NEED1("missing source IP"); - if (add_srcip(cmd, *av)) { + if (add_srcip(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP: NEED1("missing destination IP"); - if (add_dstip(cmd, *av)) { + if (add_dstip(cmd, *av, cblen)) { av++; } break; case TOK_SRCIP6: NEED1("missing source IP6"); - if (add_srcip6(cmd, *av)) { + if (add_srcip6(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP6: NEED1("missing destination IP6"); - if (add_dstip6(cmd, *av)) { + if (add_dstip6(cmd, *av, cblen)) { av++; } break; @@ -3600,7 +3645,7 @@ read_options: case TOK_SRCPORT: NEED1("missing source port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid source port %s", *av); @@ -3609,7 +3654,7 @@ read_options: case TOK_DSTPORT: NEED1("missing destination port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid destination port %s", @@ -3617,13 +3662,13 @@ read_options: break; case TOK_MAC: - if (add_mac(cmd, av)) + if (add_mac(cmd, av, cblen)) av += 2; break; case TOK_MACTYPE: NEED1("missing mac type"); - if (!add_mactype(cmd, *av)) + if (!add_mactype(cmd, *av, cblen)) errx(EX_DATAERR, "invalid mac type %s", *av); av++; break; @@ -3661,18 +3706,18 @@ read_options: if (proto != IPPROTO_IPV6 ) errx( EX_USAGE, "flow-id filter is active " "only for ipv6 protocol\n"); - fill_flow6( (ipfw_insn_u32 *) cmd, *av ); + fill_flow6( (ipfw_insn_u32 *) cmd, *av, cblen); av++; break; case TOK_COMMENT: - fill_comment(cmd, av); + fill_comment(cmd, av, cblen); av[0]=NULL; break; case TOK_TAGGED: if (av[0] && strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TAGGED)) + if (!add_ports(cmd, *av, 0, O_TAGGED, cblen)) errx(EX_DATAERR, "tagged: invalid tag" " list: %s", *av); } @@ -3725,7 +3770,7 @@ read_options: } if (F_LEN(cmd) > 0) { /* prepare to advance */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3754,12 +3799,13 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { fill_cmd(dst, O_PROBE_STATE, 0, 0); - dst = next_cmd(dst); + dst = next_cmd(dst, &rblen); } /* copy all commands but O_LOG, O_KEEP_STATE, O_LIMIT, O_ALTQ, O_TAG */ for (src = (ipfw_insn *)cmdbuf; src != cmd; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); switch (src->opcode) { case O_LOG: @@ -3779,6 +3825,7 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { i = F_LEN(have_state); + CHECK_RBUFLEN(i); bcopy(have_state, dst, i * sizeof(uint32_t)); dst += i; } @@ -3790,24 +3837,29 @@ done: /* put back O_LOG, O_ALTQ, O_TAG if necessary */ if (have_log) { i = F_LEN(have_log); + CHECK_RBUFLEN(i); bcopy(have_log, dst, i * sizeof(uint32_t)); dst += i; } if (have_altq) { i = F_LEN(have_altq); + CHECK_RBUFLEN(i); bcopy(have_altq, dst, i * sizeof(uint32_t)); dst += i; } if (have_tag) { i = F_LEN(have_tag); + CHECK_RBUFLEN(i); bcopy(have_tag, dst, i * sizeof(uint32_t)); dst += i; } + /* * copy all other actions */ for (src = (ipfw_insn *)actbuf; src != action; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); bcopy(src, dst, i * sizeof(uint32_t)); dst += i; } Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Sun Mar 3 13:53:58 2013 (r247711) +++ head/sbin/ipfw/ipfw2.h Sun Mar 3 14:05:03 2013 (r247712) @@ -283,10 +283,10 @@ void print_flow6id(struct _ipfw_insn_u32 void print_icmp6types(struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct _ipfw_insn *cmd ); -struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av); -struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av); +struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av, int cblen); +struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av, int cblen); -void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av ); +void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av, int cblen); void fill_unreach6_code(u_short *codep, char *str); -void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av); +void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av, int cblen); int fill_ext6hdr(struct _ipfw_insn *cmd, char *av); Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Sun Mar 3 13:53:58 2013 (r247711) +++ head/sbin/ipfw/ipv6.c Sun Mar 3 14:05:03 2013 (r247712) @@ -42,6 +42,11 @@ #include #include +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) + static struct _s_x icmp6codes[] = { { "no-route", ICMP6_DST_UNREACH_NOROUTE }, { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, @@ -131,10 +136,12 @@ print_ip6(ipfw_insn_ip6 *cmd, char const } void -fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av) +fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cblen) { uint8_t type; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_icmp6)); + bzero(cmd, sizeof(*cmd)); while (*av) { if (*av == ',') @@ -327,7 +334,7 @@ lookup_host6 (char *host, struct in6_add * Return 1 on success, 0 on failure. */ static int -fill_ip6(ipfw_insn_ip6 *cmd, char *av) +fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen) { int len = 0; struct in6_addr *d = &(cmd->addr6); @@ -379,6 +386,8 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) int masklen; char md = '\0'; + CHECK_LENGTH(cblen, 1 + len + 2 * F_INSN_SIZE(struct in6_addr)); + if ((p = strpbrk(av, "/,")) ) { md = *p; /* save the separator */ *p = '\0'; /* terminate address string */ @@ -453,7 +462,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) * additional flow-id we want to filter, the basic is 1 */ void -fill_flow6( ipfw_insn_u32 *cmd, char *av ) +fill_flow6( ipfw_insn_u32 *cmd, char *av, int cblen) { u_int32_t type; /* Current flow number */ u_int16_t nflow = 0; /* Current flow index */ @@ -461,6 +470,8 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av cmd->d[0] = 0; /* Initializing the base number*/ while (s) { + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_u32) + nflow + 1); + av = strsep( &s, ",") ; type = strtoul(av, &av, 0); if (*av != ',' && *av != '\0') @@ -481,10 +492,10 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av } ipfw_insn * -add_srcip6(ipfw_insn *cmd, char *av) +add_srcip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -503,10 +514,10 @@ add_srcip6(ipfw_insn *cmd, char *av) } ipfw_insn * -add_dstip6(ipfw_insn *cmd, char *av) +add_dstip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 14:42:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 858825E0; Sun, 3 Mar 2013 14:42:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74FAA9F4; Sun, 3 Mar 2013 14:42:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23EgGAb068253; Sun, 3 Mar 2013 14:42:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23EgGQ7068252; Sun, 3 Mar 2013 14:42:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201303031442.r23EgGQ7068252@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Mar 2013 14:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247713 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 14:42:16 -0000 Author: jilles Date: Sun Mar 3 14:42:15 2013 New Revision: 247713 URL: http://svnweb.freebsd.org/changeset/base/247713 Log: libedit: Revert r247683 to fix buildworld. I think r247683 is wrong because libedit.so actually uses symbols from libcurses.so. Since it breaks the build, revert it now. Modified: head/lib/libedit/Makefile Modified: head/lib/libedit/Makefile ============================================================================== --- head/lib/libedit/Makefile Sun Mar 3 14:05:03 2013 (r247712) +++ head/lib/libedit/Makefile Sun Mar 3 14:42:15 2013 (r247713) @@ -11,6 +11,7 @@ OSRCS= chared.c common.c el.c emacs.c fc parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} +LDADD= -lncurses MAN= editline.3 editrc.5 From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 14:43:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29CBE765; Sun, 3 Mar 2013 14:43:27 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id E3C6BA04; Sun, 3 Mar 2013 14:43:26 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 538AB358C5A; Sun, 3 Mar 2013 15:43:26 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 312922848C; Sun, 3 Mar 2013 15:43:26 +0100 (CET) Date: Sun, 3 Mar 2013 15:43:26 +0100 From: Jilles Tjoelker To: "Pedro F. Giffuni" Subject: Re: svn commit: r247683 - head/lib/libedit Message-ID: <20130303144325.GB21318@stack.nl> References: <201303030211.r232B4RR039202@svn.freebsd.org> <20130303134314.GA21318@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130303134314.GA21318@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 14:43:27 -0000 On Sun, Mar 03, 2013 at 02:43:14PM +0100, Jilles Tjoelker wrote: > On Sun, Mar 03, 2013 at 02:11:04AM +0000, Pedro F. Giffuni wrote: > > Author: pfg > > Date: Sun Mar 3 02:11:03 2013 > > New Revision: 247683 > > URL: http://svnweb.freebsd.org/changeset/base/247683 > > Log: > > libedit does not need to be linked with ncurses > > libedit uses the terminfo headers but doesn't really need > > to be linked with ncurses. > > Discussed with: christos@NetBSD > > MFC after; 3 days > > Modified: > > head/lib/libedit/Makefile > > > Modified: head/lib/libedit/Makefile > > ============================================================================== > > --- head/lib/libedit/Makefile Sun Mar 3 01:36:31 2013 (r247682) > > +++ head/lib/libedit/Makefile Sun Mar 3 02:11:03 2013 (r247683) > > @@ -11,7 +11,6 @@ OSRCS= chared.c common.c el.c emacs.c fc > > parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c > > > > DPADD= ${LIBNCURSES} > > -LDADD= -lncurses > > > > MAN= editline.3 editrc.5 > > > This is wrong. libedit.so uses symbols such as tgetent from > libcurses.so, so it should be linked to libcurses.so. These symbols are > easily visible in the output of > objdump -T /lib/libedit.so.7 > because they are unversioned. > There is not much breakage because most applications using libedit > explicitly link to libcurses, since that is required for static linking. > For dynamic linking it is really a case of overlinking, particularly > because libedit completely abstracts away libcurses from the > application's point of view (in other words, the application need not > call libcurses itself). This actually happens in buildworld, so I have taken the liberty to revert your commit. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 14:47:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 77F43B81; Sun, 3 Mar 2013 14:47:03 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68FD3A2A; Sun, 3 Mar 2013 14:47:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23El3QK069183; Sun, 3 Mar 2013 14:47:03 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23El34A069179; Sun, 3 Mar 2013 14:47:03 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303031447.r23El34A069179@svn.freebsd.org> From: Davide Italiano Date: Sun, 3 Mar 2013 14:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247714 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 14:47:03 -0000 Author: davide Date: Sun Mar 3 14:47:02 2013 New Revision: 247714 URL: http://svnweb.freebsd.org/changeset/base/247714 Log: Remove a couple of unused include. Modified: head/sys/kern/kern_timeout.c head/sys/sys/systm.h Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sun Mar 3 14:42:15 2013 (r247713) +++ head/sys/kern/kern_timeout.c Sun Mar 3 14:47:02 2013 (r247714) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sun Mar 3 14:42:15 2013 (r247713) +++ head/sys/sys/systm.h Sun Mar 3 14:47:02 2013 (r247714) @@ -44,7 +44,6 @@ #include #include #include /* for people using printf mainly */ -#include extern int cold; /* nonzero if we are doing a cold boot */ extern int rebooting; /* kern_reboot() has been called. */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 15:01:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C02AFB0; Sun, 3 Mar 2013 15:01:34 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC7F3A96; Sun, 3 Mar 2013 15:01:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23F1XH5074534; Sun, 3 Mar 2013 15:01:33 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23F1XvA074533; Sun, 3 Mar 2013 15:01:33 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303031501.r23F1XvA074533@svn.freebsd.org> From: Davide Italiano Date: Sun, 3 Mar 2013 15:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247715 - 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 15:01:34 -0000 Author: davide Date: Sun Mar 3 15:01:33 2013 New Revision: 247715 URL: http://svnweb.freebsd.org/changeset/base/247715 Log: callwheelmask and callwheelsize are always greater than zero. Switch their type to u_int. Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sun Mar 3 14:47:02 2013 (r247714) +++ head/sys/kern/kern_timeout.c Sun Mar 3 15:01:33 2013 (r247715) @@ -83,7 +83,7 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca * TODO: * allocate more timeout table slots when table overflows. */ -int callwheelsize, callwheelmask; +u_int callwheelsize, callwheelmask; /* * The callout cpu migration entity represents informations necessary for From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 15:02:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C30E51D0; Sun, 3 Mar 2013 15:02:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC4E3AA9; Sun, 3 Mar 2013 15:02:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23F2uL3074856; Sun, 3 Mar 2013 15:02:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23F2uAT074855; Sun, 3 Mar 2013 15:02:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201303031502.r23F2uAT074855@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Mar 2013 15:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247716 - 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 15:02:56 -0000 Author: jilles Date: Sun Mar 3 15:02:56 2013 New Revision: 247716 URL: http://svnweb.freebsd.org/changeset/base/247716 Log: MAINTAINERS: Document my maintainership of sh(1). Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Sun Mar 3 15:01:33 2013 (r247715) +++ head/MAINTAINERS Sun Mar 3 15:02:56 2013 (r247716) @@ -124,3 +124,6 @@ isci(4) jimharris Pre-commit review req cmx daniel@roe.ch Pre-commit review preferred. filemon obrien Pre-commit review preferred. sysdoc trhodes Pre-commit review preferred. +sh(1) jilles Pre-commit review requested. This also applies + to kill(1), printf(1) and test(1) which are + compiled in as builtins. From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 15:34:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 05099E46 for ; Sun, 3 Mar 2013 15:34:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm12-vm0.bullet.mail.ne1.yahoo.com (nm12-vm0.bullet.mail.ne1.yahoo.com [98.138.91.51]) by mx1.freebsd.org (Postfix) with ESMTP id ADC58C30 for ; Sun, 3 Mar 2013 15:34:40 +0000 (UTC) Received: from [98.138.90.55] by nm12.bullet.mail.ne1.yahoo.com with NNFMP; 03 Mar 2013 15:34:34 -0000 Received: from [98.138.84.35] by tm8.bullet.mail.ne1.yahoo.com with NNFMP; 03 Mar 2013 15:34:34 -0000 Received: from [127.0.0.1] by smtp103.mail.ne1.yahoo.com with NNFMP; 03 Mar 2013 15:34:34 -0000 X-Yahoo-Newman-Id: 242951.15589.bm@smtp103.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 6WA_vLwVM1kIXUKjJAU59aB.Tc0lJYO67vOD5lxSoUy_1r5 Nv_hblC0BkBlrCI3pHtGwAd5QOyOrFUHkGmEu.cUGdoGEMvLgM9UDj2WHoxY azSxS.0q6f.AjzRx1uOTWzsuvmpPNos.nigh_lP.TrHdPmSWFgkGHundTHq0 m58jditn.ToyZTPyQb29VMZGKNZkbvKLXeLdZM5lCJdF.Z_EJuzoHpgv.pnL 4_..8TeZWcKRBkide_jcW_AKlzqWMNAYnhG25bKz8UeDqPiX514qiovvOLdj sRieFh52ntLbJNOgPr3tfhlNxwGywX06Zuqqgwebfx_KdkSmUTUhE7K27ndr llfrhl.Wy6QeUlM2RcGtl_acqGzdjixLRE865DROZ7IxXVEUDLbg16B4Ew72 7kJJEryUTLHVEus7g1qnaT7qn10lIb_ZN_fFuhlHUiuwb.rbeEHCgXYJjOvd l1LfhOGgdrpve6HjoJ9zN._JE_T1uM64l_qsPJdTO41SjFreO._bJaFNvnoW Zmjzo7xyij5qyquWpYGrotQlY3bDGjImVRpMnqGl4oiFvf.rWmeW6lysMO.U X7lJuTRkb6y57BsdZUOPSo4Yc X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [190.157.124.18] (pfg@190.157.124.18 with plain) by smtp103.mail.ne1.yahoo.com with SMTP; 03 Mar 2013 07:34:34 -0800 PST Message-ID: <51336D8C.9000105@FreeBSD.org> Date: Sun, 03 Mar 2013 10:34:36 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130201 Thunderbird/17.0.2 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: svn commit: r247713 - head/lib/libedit References: <201303031442.r23EgGQ7068252@svn.freebsd.org> In-Reply-To: <201303031442.r23EgGQ7068252@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 15:34:41 -0000 On 03/03/2013 09:42, Jilles Tjoelker wrote: > Author: jilles > Date: Sun Mar 3 14:42:15 2013 > New Revision: 247713 > URL: http://svnweb.freebsd.org/changeset/base/247713 > > Log: > libedit: Revert r247683 to fix buildworld. > > I think r247683 is wrong because libedit.so actually uses symbols from > libcurses.so. Since it breaks the build, revert it now. > > Modified: > head/lib/libedit/Makefile > > Modified: head/lib/libedit/Makefile > ============================================================================== > --- head/lib/libedit/Makefile Sun Mar 3 14:05:03 2013 (r247712) > +++ head/lib/libedit/Makefile Sun Mar 3 14:42:15 2013 (r247713) > @@ -11,6 +11,7 @@ OSRCS= chared.c common.c el.c emacs.c fc > parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c > > DPADD= ${LIBNCURSES} > +LDADD= -lncurses > > MAN= editline.3 editrc.5 > > Thank you for reverting. My router broke this morning or I would've done it first. I have no idea why NetBSD survives without linking ncurses here but next time I will test this further before trusting the package author. Pedro. From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 16:16:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 36DF3BD4; Sun, 3 Mar 2013 16:16:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 117BAE38; Sun, 3 Mar 2013 16:16:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23GGA7V097684; Sun, 3 Mar 2013 16:16:10 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23GGAWP097683; Sun, 3 Mar 2013 16:16:10 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303031616.r23GGAWP097683@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 16:16:10 +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: r247718 - stable/8/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 16:16:11 -0000 Author: dteske Date: Sun Mar 3 16:16:10 2013 New Revision: 247718 URL: http://svnweb.freebsd.org/changeset/base/247718 Log: MFC r232297: Grammar: tzsetup now has more than one option. Modified: stable/8/usr.sbin/tzsetup/tzsetup.8 Modified: stable/8/usr.sbin/tzsetup/tzsetup.8 ============================================================================== --- stable/8/usr.sbin/tzsetup/tzsetup.8 Sun Mar 3 15:19:49 2013 (r247717) +++ stable/8/usr.sbin/tzsetup/tzsetup.8 Sun Mar 3 16:16:10 2013 (r247718) @@ -49,7 +49,7 @@ utility also determines whether any adju the hardware clock does not keep .Tn UTC . .Pp -The following option is available: +The following options are available: .Bl -tag -offset indent -width Fl .It Fl C Ar chroot_directory Open all files and directories relative to From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 16:17:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0936BD46; Sun, 3 Mar 2013 16:17:10 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C12B4E45; Sun, 3 Mar 2013 16:17:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23GH9L9097872; Sun, 3 Mar 2013 16:17:09 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23GH9F1097871; Sun, 3 Mar 2013 16:17:09 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201303031617.r23GH9F1097871@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 3 Mar 2013 16:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247719 - head/sys/modules/mqueue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 16:17:10 -0000 Author: uqs Date: Sun Mar 3 16:17:09 2013 New Revision: 247719 URL: http://svnweb.freebsd.org/changeset/base/247719 Log: Fix 'make depend' Modified: head/sys/modules/mqueue/Makefile Modified: head/sys/modules/mqueue/Makefile ============================================================================== --- head/sys/modules/mqueue/Makefile Sun Mar 3 16:16:10 2013 (r247718) +++ head/sys/modules/mqueue/Makefile Sun Mar 3 16:17:09 2013 (r247719) @@ -5,6 +5,6 @@ KMOD= mqueuefs SRCS= uipc_mqueue.c \ vnode_if.h \ - opt_posix.h opt_compat.h + opt_posix.h opt_compat.h opt_capsicum.h .include From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 17:34:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BAD60CA4; Sun, 3 Mar 2013 17:34:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A07D3CA; Sun, 3 Mar 2013 17:34:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23HY0sN021426; Sun, 3 Mar 2013 17:34:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23HY00n021423; Sun, 3 Mar 2013 17:34:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201303031734.r23HY00n021423@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Mar 2013 17:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247720 - in head: bin/sh tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 17:34:00 -0000 Author: jilles Date: Sun Mar 3 17:33:59 2013 New Revision: 247720 URL: http://svnweb.freebsd.org/changeset/base/247720 Log: sh: When executing a trap, keep exit status along with evalskip. This ensures 'return' in a trap returns the correct status to the caller. If evalskip is not set or if it is overridden by a previous evalskip, keep the old behaviour of restoring the exit status from before the trap. Added: head/tools/regression/bin/sh/builtins/trap12.0 (contents, props changed) Modified: head/bin/sh/trap.c Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sun Mar 3 16:17:09 2013 (r247719) +++ head/bin/sh/trap.c Sun Mar 3 17:33:59 2013 (r247720) @@ -455,7 +455,6 @@ dotrap(void) last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); - exitstatus = savestatus; /* * If such a command was not @@ -464,9 +463,11 @@ dotrap(void) * trap action to have an effect * outside of it. */ - if (prev_evalskip != 0) { + if (evalskip == 0 || + prev_evalskip != 0) { evalskip = prev_evalskip; skipcount = prev_skipcount; + exitstatus = savestatus; } if (i == SIGCHLD) Added: head/tools/regression/bin/sh/builtins/trap12.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap12.0 Sun Mar 3 17:33:59 2013 (r247720) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +f() { + trap 'return 42' USR1 + kill -USR1 $$ + return 3 +} +f +r=$? +[ "$r" = 42 ] From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 17:39:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9423AD9; Sun, 3 Mar 2013 17:39:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D977113; Sun, 3 Mar 2013 17:39:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23HdUG2022292; Sun, 3 Mar 2013 17:39:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23HdUYi022290; Sun, 3 Mar 2013 17:39:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303031739.r23HdUYi022290@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 17:39:30 +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: r247721 - stable/9/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 17:39:30 -0000 Author: dteske Date: Sun Mar 3 17:39:29 2013 New Revision: 247721 URL: http://svnweb.freebsd.org/changeset/base/247721 Log: MFC r230005: Use a reasonable-sized buffer when formatting error messages about installing zoneinfo. While we're in the vicinity, add some missing error checking to eliminate an unhelpful error message when unlink() fails. /me is embarrassed by the quality of his 16-year-old code. The whole thing is awful and could stand a complete rewrite. PR: 164038 Submitted by: Devin Teske (but implemented differently) Modified: stable/9/usr.sbin/tzsetup/tzsetup.c Modified: stable/9/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 17:33:59 2013 (r247720) +++ stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 17:39:29 2013 (r247721) @@ -56,6 +56,13 @@ __FBSDID("$FreeBSD$"); #define _PATH_DB "/var/db/zoneinfo" #define _PATH_WALL_CMOS_CLOCK "/etc/wall_cmos_clock" +#ifdef PATH_MAX +#define SILLY_BUFFER_SIZE 2*PATH_MAX +#else +#warning "Somebody needs to fix this to dynamically size this buffer." +#define SILLY_BUFFER_SIZE 2048 +#endif + static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; @@ -523,7 +530,7 @@ static int install_zoneinfo_file(const char *zoneinfo_file) { char buf[1024]; - char title[64], prompt[64]; + char title[64], prompt[SILLY_BUFFER_SIZE]; struct stat sb; ssize_t len; int fd1, fd2, copymode; @@ -594,7 +601,18 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } - unlink(path_localtime); + if (unlink(path_localtime) < 0 && errno != ENOENT) { + snprintf(prompt, sizeof(prompt), + "Could not unlink %s: %s", + path_localtime, strerror(errno)); + if (usedialog) { + snprintf(title, sizeof(title), "Error"); + dialog_msgbox(title, prompt, 8, 72, 1); + } else + fprintf(stderr, "%s\n", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + fd2 = open(path_localtime, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IRGRP | S_IROTH); if (fd2 < 0) { @@ -640,7 +658,17 @@ install_zoneinfo_file(const char *zonein fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } - unlink(path_localtime); + if (unlink(path_localtime) < 0 && errno != ENOENT) { + snprintf(prompt, sizeof(prompt), + "Could not unlink %s: %s", + path_localtime, strerror(errno)); + if (usedialog) { + snprintf(title, sizeof(title), "Error"); + dialog_msgbox(title, prompt, 8, 72, 1); + } else + fprintf(stderr, "%s\n", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } if (symlink(zoneinfo_file, path_localtime) < 0) { snprintf(title, sizeof(title), "Error"); snprintf(prompt, sizeof(prompt), From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 17:52:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8BA23D2 for ; Sun, 3 Mar 2013 17:52:41 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) by mx1.freebsd.org (Postfix) with ESMTP id 3B612162 for ; Sun, 3 Mar 2013 17:52:40 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/avgusCdtw9+43oQGYIsZZxQQ0xcmsA== X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (cl-3506.cgn-01.de.sixxs.net [IPv6:2001:4dd0:ff00:db1::2]) by smtp.strato.de (josoe mo29) (RZmta 31.19 AUTH) with (AES128-SHA encrypted) ESMTPA id u06ca5p23Gcidq for ; Sun, 3 Mar 2013 18:51:48 +0100 (CET) Received: by britannica.bec.de (sSMTP sendmail emulation); Sun, 03 Mar 2013 18:51:47 +0100 Date: Sun, 3 Mar 2013 18:51:47 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Subject: Re: svn commit: r247713 - head/lib/libedit Message-ID: <20130303175147.GA7549@britannica.bec.de> References: <201303031442.r23EgGQ7068252@svn.freebsd.org> <51336D8C.9000105@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51336D8C.9000105@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 17:52:41 -0000 On Sun, Mar 03, 2013 at 10:34:36AM -0500, Pedro Giffuni wrote: > I have no idea why NetBSD survives without linking ncurses here but > next time I will test this further before trusting the package author. libedit links against libterminfo on NetBSD. Joerg From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 19:00:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E79294C; Sun, 3 Mar 2013 19:00:01 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0FFF12E3; Sun, 3 Mar 2013 19:00:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23J00En046469; Sun, 3 Mar 2013 19:00:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23J00U2046463; Sun, 3 Mar 2013 19:00:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303031900.r23J00U2046463@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 19:00: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: r247722 - stable/9/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 19:00:01 -0000 Author: dteske Date: Sun Mar 3 18:59:59 2013 New Revision: 247722 URL: http://svnweb.freebsd.org/changeset/base/247722 Log: MFC r227934: Port to new libdialog. Modified: stable/9/usr.sbin/tzsetup/Makefile stable/9/usr.sbin/tzsetup/tzsetup.c Modified: stable/9/usr.sbin/tzsetup/Makefile ============================================================================== --- stable/9/usr.sbin/tzsetup/Makefile Sun Mar 3 17:39:29 2013 (r247721) +++ stable/9/usr.sbin/tzsetup/Makefile Sun Mar 3 18:59:59 2013 (r247722) @@ -3,11 +3,11 @@ PROG= tzsetup MAN= tzsetup.8 -CFLAGS+= -I${.CURDIR}/../../gnu/lib/libodialog -I. +CFLAGS+= -I${.CURDIR}/../../contrib/dialog -I. WARNS?= 3 -DPADD= ${LIBODIALOG} ${LIBNCURSES} -LDADD= -lodialog -lncurses +DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} +LDADD= -ldialog -lncursesw -lm .include Modified: stable/9/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 17:39:29 2013 (r247721) +++ stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 18:59:59 2013 (r247722) @@ -35,7 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -49,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #define _PATH_ZONETAB "/usr/share/zoneinfo/zone.tab" #define _PATH_ISO3166 "/usr/share/misc/iso3166" #define _PATH_ZONEINFO "/usr/share/zoneinfo" @@ -63,8 +64,130 @@ __FBSDID("$FreeBSD$"); #define SILLY_BUFFER_SIZE 2048 #endif +/* special return codes for `fire' actions */ +#define DITEM_FAILURE 1 + +/* flags - returned in upper 16 bits of return status */ +#define DITEM_LEAVE_MENU (1 << 16) +#define DITEM_RECREATE (1 << 18) + +/* for use in describing more exotic behaviors */ +typedef struct dialogMenuItem { + char *prompt; + char *title; + int (*fire)(struct dialogMenuItem *self); + void *data; +} dialogMenuItem; + +static int +xdialog_count_rows(const char *p) +{ + int rows = 0; + + while ((p = strchr(p, '\n')) != NULL) { + p++; + if (*p == '\0') + break; + rows++; + } + + return rows ? rows : 1; +} + +static int +xdialog_count_columns(const char *p) +{ + int len; + int max_len = 0; + const char *q; + + for (; (q = strchr(p, '\n')) != NULL; p = q + 1) { + len = q - p; + max_len = MAX(max_len, len); + } + + len = strlen(p); + max_len = MAX(max_len, len); + return max_len; +} + +static int +xdialog_menu(const char *title, const char *cprompt, int height, int width, + int menu_height, int item_no, dialogMenuItem *ditems) +{ + int i, result, choice = 0; + DIALOG_LISTITEM *listitems; + DIALOG_VARS save_vars; + + dlg_save_vars(&save_vars); + + /* initialize list items */ + listitems = dlg_calloc(DIALOG_LISTITEM, item_no + 1); + assert_ptr(listitems, "xdialog_menu"); + for (i = 0; i < item_no; i++) { + listitems[i].name = ditems[i].prompt; + listitems[i].text = ditems[i].title; + } + + /* calculate height */ + if (height < 0) + height = xdialog_count_rows(cprompt) + menu_height + 4 + 2; + if (height > LINES) + height = LINES; + + /* calculate width */ + if (width < 0) { + int tag_x = 0; + + for (i = 0; i < item_no; i++) { + int j, l; + + l = strlen(listitems[i].name); + for (j = 0; j < item_no; j++) { + int k = strlen(listitems[j].text); + tag_x = MAX(tag_x, l + k + 2); + } + } + width = MAX(xdialog_count_columns(cprompt), title != NULL ? xdialog_count_columns(title) : 0); + width = MAX(width, tag_x + 4) + 4; + } + width = MAX(width, 24); + if (width > COLS) + width = COLS; + +again: + dialog_vars.default_item = listitems[choice].name; + result = dlg_menu(title, cprompt, height, width, + menu_height, item_no, listitems, &choice, NULL); + switch (result) { + case DLG_EXIT_ESC: + result = -1; + break; + case DLG_EXIT_OK: + if (ditems[choice].fire != NULL) { + int status; + + status = ditems[choice].fire(ditems + choice); + if (status & DITEM_RECREATE) { + dlg_clear(); + goto again; + } + } + result = 0; + break; + case DLG_EXIT_CANCEL: + default: + result = 1; + break; + } + + free(listitems); + dlg_restore_vars(&save_vars); + return result; +} + static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], - path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], + path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; static int reallydoit = 1; @@ -84,8 +207,6 @@ static int set_zone_utc(void); struct continent { dialogMenuItem *menu; int nitems; - int ch; - int sc; }; static struct continent africa, america, antarctica, arctic, asia, atlantic; @@ -105,7 +226,7 @@ static struct continent_names { { "Europe", &europe }, { "Indian", &indian }, { "Pacific", &pacific }, - { "UTC", &utc } + { "UTC", &utc } }; static struct continent_items { @@ -141,7 +262,7 @@ continent_country_menu(dialogMenuItem *c int rv; if (strcmp(continent->title, "UTC") == 0) - return set_zone_utc(); + return set_zone_utc(); /* Short cut -- if there's only one country, don't post a menu. */ if (contp->nitems == 1) @@ -159,8 +280,8 @@ continent_country_menu(dialogMenuItem *c } menulen = contp->nitems < 16 ? contp->nitems : 16; - rv = dialog_menu(title, prompt, -1, -1, menulen, -contp->nitems, - contp->menu, 0, &contp->ch, &contp->sc); + rv = xdialog_menu(title, prompt, -1, -1, menulen, contp->nitems, + contp->menu); if (rv == 0) return (DITEM_LEAVE_MENU); return (DITEM_RECREATE); @@ -273,7 +394,7 @@ add_zone_to_country(int lineno, const ch if (tlc[0] < 'A' || tlc[0] > 'Z' || tlc[1] < 'A' || tlc[1] > 'Z') errx(1, "%s:%d: country code `%s' invalid", path_zonetab, lineno, tlc); - + cp = &countries[CODE2INT(tlc)]; if (cp->name == 0) errx(1, "%s:%d: country code `%s' unknown", path_zonetab, @@ -287,7 +408,7 @@ add_zone_to_country(int lineno, const ch zp = malloc(sizeof(*zp)); if (zp == 0) errx(1, "malloc(%zu)", sizeof(*zp)); - + if (cp->nzones == 0) TAILQ_INIT(&cp->zones); @@ -458,9 +579,7 @@ make_menus(void) memset(dmi, 0, sizeof(*dmi)); asprintf(&dmi->prompt, "%d", ++cp->continent->nitems); dmi->title = cp->name; - dmi->checked = 0; dmi->fire = set_zone_whole_country; - dmi->selected = 0; dmi->data = cp; } else { cp->submenu = malloc(cp->nzones * sizeof(*dmi)); @@ -473,9 +592,7 @@ make_menus(void) memset(dmi, 0, sizeof(*dmi)); asprintf(&dmi->prompt, "%d", ++cp->nzones); dmi->title = zp->descr; - dmi->checked = 0; dmi->fire = set_zone_multi; - dmi->selected = 0; dmi->data = zp; for (zp2 = TAILQ_FIRST(&cp->zones); @@ -489,9 +606,7 @@ make_menus(void) memset(dmi, 0, sizeof(*dmi)); asprintf(&dmi->prompt, "%d", ++cont->nitems); dmi->title = cp->name; - dmi->checked = 0; dmi->fire = set_zone_menu; - dmi->selected = 0; dmi->data = cp; } } @@ -510,8 +625,8 @@ set_zone_menu(dialogMenuItem *dmi) snprintf(prompt, sizeof(prompt), "Select a zone which observes the same time as your locality."); menulen = cp->nzones < 16 ? cp->nzones : 16; - rv = dialog_menu(title, prompt, -1, -1, menulen, -cp->nzones, - cp->submenu, 0, 0, 0); + rv = xdialog_menu(title, prompt, -1, -1, menulen, cp->nzones, + cp->submenu); if (rv != 0) return (DITEM_RECREATE); return (DITEM_LEAVE_MENU); @@ -522,7 +637,7 @@ set_zone_utc(void) { if (!confirm_zone(NULL)) return (DITEM_FAILURE | DITEM_RECREATE); - + return (install_zoneinfo_file(NULL)); } @@ -566,7 +681,7 @@ install_zoneinfo_file(const char *zonein "Could not delete %s: %s", path_localtime, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); @@ -578,7 +693,7 @@ install_zoneinfo_file(const char *zonein "Could not delete %s: %s", path_db, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); @@ -586,7 +701,7 @@ install_zoneinfo_file(const char *zonein } return (DITEM_LEAVE_MENU); } - + if (copymode) { fd1 = open(zoneinfo_file, O_RDONLY, 0); if (fd1 < 0) { @@ -595,7 +710,7 @@ install_zoneinfo_file(const char *zonein "Could not open %s: %s", zoneinfo_file, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -621,7 +736,7 @@ install_zoneinfo_file(const char *zonein "Could not open %s: %s", path_localtime, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -637,7 +752,7 @@ install_zoneinfo_file(const char *zonein "Error copying %s to %s %s", zoneinfo_file, path_localtime, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); /* Better to leave none than a corrupt one. */ @@ -653,7 +768,7 @@ install_zoneinfo_file(const char *zonein "Cannot access %s: %s", zoneinfo_file, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -676,7 +791,7 @@ install_zoneinfo_file(const char *zonein path_localtime, zoneinfo_file, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -695,7 +810,7 @@ install_zoneinfo_file(const char *zonein "Created symbolic link from %s to %s", zoneinfo_file, path_localtime); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); #endif @@ -729,7 +844,7 @@ confirm_zone(const char *filename) time_t t = time(0); struct tm *tm; int rv; - + setenv("TZ", filename == NULL ? "" : filename, 1); tzset(); tm = localtime(&t); @@ -776,12 +891,6 @@ usage(void) exit(1); } -#if defined(__sparc64__) -#define DIALOG_UTC dialog_yesno -#else -#define DIALOG_UTC dialog_noyes -#endif - int main(int argc, char **argv) { @@ -886,15 +995,24 @@ main(int argc, char **argv) /* FALLTHROUGH */ } - init_dialog(); + init_dialog(stdin, stdout); if (skiputc == 0) { + DIALOG_VARS save_vars; + int yesno; + snprintf(title, sizeof(title), "Select local or UTC (Greenwich Mean Time) clock"); snprintf(prompt, sizeof(prompt), "Is this machine's CMOS clock set to UTC? " "If it is set to local time,\n" "or you don't know, please choose NO here!"); - if (!DIALOG_UTC(title, prompt, 7, 72)) { + dlg_save_vars(&save_vars); +#if !defined(__sparc64__) + dialog_vars.defaultno = TRUE; +#endif + yesno = dialog_yesno(title, prompt, 7, 73); + dlg_restore_vars(&save_vars); + if (!yesno) { if (reallydoit) unlink(path_wall_cmos_clock); } else { @@ -910,7 +1028,7 @@ main(int argc, char **argv) close(fd); } } - dialog_clear_norefresh(); + dlg_clear(); } if (optind == argc - 1) { snprintf(title, sizeof(title), "Default timezone provided"); @@ -918,18 +1036,18 @@ main(int argc, char **argv) "\nUse the default `%s' zone?", argv[optind]); if (!dialog_yesno(title, prompt, 7, 72)) { rv = install_zoneinfo_file(argv[optind]); - dialog_clear(); + dlg_clear(); end_dialog(); exit(rv & ~DITEM_LEAVE_MENU); } - dialog_clear_norefresh(); + dlg_clear(); } snprintf(title, sizeof(title), "Time Zone Selector"); snprintf(prompt, sizeof(prompt), "Select a region"); - dialog_menu(title, prompt, -1, -1, NCONTINENTS, -NCONTINENTS, - continents, 0, NULL, NULL); + xdialog_menu(title, prompt, -1, -1, NCONTINENTS, NCONTINENTS, + continents); - dialog_clear(); + dlg_clear(); end_dialog(); return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 19:02:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99956AC5; Sun, 3 Mar 2013 19:02:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 735E22F0; Sun, 3 Mar 2013 19:02:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23J2CPG048493; Sun, 3 Mar 2013 19:02:12 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23J2Crb048491; Sun, 3 Mar 2013 19:02:12 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201303031902.r23J2Crb048491@svn.freebsd.org> From: Mark Johnston Date: Sun, 3 Mar 2013 19:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247723 - stable/8/lib/libelf 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 19:02:12 -0000 Author: markj Date: Sun Mar 3 19:02:11 2013 New Revision: 247723 URL: http://svnweb.freebsd.org/changeset/base/247723 Log: MFC r246978: - Make sure to set an error code when trying to obtain a data descriptor for a section of type SHT_NULL. - Update the man page to reflect the fact that elf_getdata() and elf_rawdata() may return with an error of ELF_E_SECTION. Approved by: rstone (co-mentor) Modified: stable/8/lib/libelf/elf_data.c stable/8/lib/libelf/elf_getdata.3 Directory Properties: stable/8/lib/libelf/ (props changed) Modified: stable/8/lib/libelf/elf_data.c ============================================================================== --- stable/8/lib/libelf/elf_data.c Sun Mar 3 18:59:59 2013 (r247722) +++ stable/8/lib/libelf/elf_data.c Sun Mar 3 19:02:11 2013 (r247723) @@ -78,8 +78,10 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } - if (sh_type == SHT_NULL) + if (sh_type == SHT_NULL) { + LIBELF_SET_ERROR(SECTION, 0); return (NULL); + } if ((elftype = _libelf_xlate_shtype(sh_type)) < ELF_T_FIRST || elftype > ELF_T_LAST || (sh_type != SHT_NOBITS && @@ -217,8 +219,10 @@ elf_rawdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } - if (sh_type == SHT_NULL) + if (sh_type == SHT_NULL) { + LIBELF_SET_ERROR(SECTION, 0); return (NULL); + } if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); Modified: stable/8/lib/libelf/elf_getdata.3 ============================================================================== --- stable/8/lib/libelf/elf_getdata.3 Sun Mar 3 18:59:59 2013 (r247722) +++ stable/8/lib/libelf/elf_getdata.3 Sun Mar 3 19:02:11 2013 (r247723) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2011 +.Dd February 18, 2013 .Dt ELF_GETDATA 3 .Os .Sh NAME @@ -186,6 +186,23 @@ was not associated with section descript .Ar scn . .It Bq Er ELF_E_RESOURCE An out of memory condition was detected. +.It Bq Er ELF_E_SECTION +Section +.Ar scn +had type +.Dv SHT_NULL . +.It Bq Er ELF_E_SECTION +The type of the section +.Ar scn +was not recognized by the library. +.It Bq Er ELF_E_SECTION +The size of the section +.Ar scn +is not a multiple of the file size for its section type. +.It Bq Er ELF_E_SECTION +The file offset for section +.Ar scn +is incorrect. .El .Sh SEE ALSO .Xr elf 3 , From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 19:02:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 20345BDB; Sun, 3 Mar 2013 19:02:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EEBA12F2; Sun, 3 Mar 2013 19:02:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23J2NR7048559; Sun, 3 Mar 2013 19:02:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23J2N58048556; Sun, 3 Mar 2013 19:02:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201303031902.r23J2N58048556@svn.freebsd.org> From: Mark Johnston Date: Sun, 3 Mar 2013 19:02:23 +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: r247724 - stable/9/lib/libelf 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 19:02:24 -0000 Author: markj Date: Sun Mar 3 19:02:23 2013 New Revision: 247724 URL: http://svnweb.freebsd.org/changeset/base/247724 Log: MFC r246978: - Make sure to set an error code when trying to obtain a data descriptor for a section of type SHT_NULL. - Update the man page to reflect the fact that elf_getdata() and elf_rawdata() may return with an error of ELF_E_SECTION. Approved by: rstone (co-mentor) Modified: stable/9/lib/libelf/elf_data.c stable/9/lib/libelf/elf_getdata.3 Directory Properties: stable/9/lib/libelf/ (props changed) Modified: stable/9/lib/libelf/elf_data.c ============================================================================== --- stable/9/lib/libelf/elf_data.c Sun Mar 3 19:02:11 2013 (r247723) +++ stable/9/lib/libelf/elf_data.c Sun Mar 3 19:02:23 2013 (r247724) @@ -78,8 +78,10 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } - if (sh_type == SHT_NULL) + if (sh_type == SHT_NULL) { + LIBELF_SET_ERROR(SECTION, 0); return (NULL); + } if ((elftype = _libelf_xlate_shtype(sh_type)) < ELF_T_FIRST || elftype > ELF_T_LAST || (sh_type != SHT_NOBITS && @@ -219,8 +221,10 @@ elf_rawdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } - if (sh_type == SHT_NULL) + if (sh_type == SHT_NULL) { + LIBELF_SET_ERROR(SECTION, 0); return (NULL); + } if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); Modified: stable/9/lib/libelf/elf_getdata.3 ============================================================================== --- stable/9/lib/libelf/elf_getdata.3 Sun Mar 3 19:02:11 2013 (r247723) +++ stable/9/lib/libelf/elf_getdata.3 Sun Mar 3 19:02:23 2013 (r247724) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2011 +.Dd February 18, 2013 .Dt ELF_GETDATA 3 .Os .Sh NAME @@ -186,6 +186,23 @@ was not associated with section descript .Ar scn . .It Bq Er ELF_E_RESOURCE An out of memory condition was detected. +.It Bq Er ELF_E_SECTION +Section +.Ar scn +had type +.Dv SHT_NULL . +.It Bq Er ELF_E_SECTION +The type of the section +.Ar scn +was not recognized by the library. +.It Bq Er ELF_E_SECTION +The size of the section +.Ar scn +is not a multiple of the file size for its section type. +.It Bq Er ELF_E_SECTION +The file offset for section +.Ar scn +is incorrect. .El .Sh SEE ALSO .Xr elf 3 , From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 19:10:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 21E1EDE7; Sun, 3 Mar 2013 19:10:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F057329; Sun, 3 Mar 2013 19:10:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23JASfA050285; Sun, 3 Mar 2013 19:10:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23JAS3L050275; Sun, 3 Mar 2013 19:10:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303031910.r23JAS3L050275@svn.freebsd.org> From: Alexander Motin Date: Sun, 3 Mar 2013 19:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247725 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 19:10:29 -0000 Author: mav Date: Sun Mar 3 19:10:28 2013 New Revision: 247725 URL: http://svnweb.freebsd.org/changeset/base/247725 Log: Fix typos in hint names. MFC after: 1 week Modified: head/share/man/man4/mvs.4 Modified: head/share/man/man4/mvs.4 ============================================================================== --- head/share/man/man4/mvs.4 Sun Mar 3 19:02:23 2013 (r247724) +++ head/share/man/man4/mvs.4 Sun Mar 3 19:10:28 2013 (r247725) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2010 +.Dd March 3, 2013 .Dt MVS 4 .Os .Sh NAME @@ -62,7 +62,7 @@ command latency. .It Va hint.mvs. Ns Ar X Ns Va .cccc defines number of completed commands for CCC, which trigger interrupt without waiting for specified coalescing timeout. -.It Va hint.mvs. Ns Ar X Ns Va .pm_level +.It Va hint.mvsch. Ns Ar X Ns Va .pm_level controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. @@ -82,7 +82,7 @@ driver initiates SLUMBER PM state transi Note that interface Power Management is not compatible with device presence detection. A manual bus reset is needed on device hot-plug. -.It Va hint.mvs. Ns Ar X Ns Va .sata_rev +.It Va hint.mvsch. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .El From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 19:12:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D916AF67; Sun, 3 Mar 2013 19:12:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1F9B339; Sun, 3 Mar 2013 19:12:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23JC79Q051916; Sun, 3 Mar 2013 19:12:07 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23JC7v4051914; Sun, 3 Mar 2013 19:12:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303031912.r23JC7v4051914@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 19:12: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: r247726 - stable/9/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 19:12:07 -0000 Author: dteske Date: Sun Mar 3 19:12:07 2013 New Revision: 247726 URL: http://svnweb.freebsd.org/changeset/base/247726 Log: Dummy commit to show r247722 was (in addition to being an MFC for r227934), an MFC for r227947: calloc +1 DIALOG_LISTITEM to prevent possible wild pointer access in dlg_default_listitem(). and also for r228176: Sync xdialog_menu() implementation with sade. Modified: stable/9/usr.sbin/tzsetup/tzsetup.c Modified: stable/9/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:10:28 2013 (r247725) +++ stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:12:07 2013 (r247726) @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD$"); #include #include From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 19:20:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2D99B1C7; Sun, 3 Mar 2013 19:20:31 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 070CF36C; Sun, 3 Mar 2013 19:20:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23JKUY3054745; Sun, 3 Mar 2013 19:20:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23JKUUx054728; Sun, 3 Mar 2013 19:20:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303031920.r23JKUUx054728@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 19:20:30 +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: r247727 - stable/9/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 19:20:31 -0000 Author: dteske Date: Sun Mar 3 19:20:30 2013 New Revision: 247727 URL: http://svnweb.freebsd.org/changeset/base/247727 Log: MFC r230299: Fix #ifdef VERBOSE for UTC case Update verbose output to match what actually happens when selecting the UTC option, and when the -n option is used. Patch updated slightly for new libdialog. PR: bin/164042 Submitted by: dteske Modified: stable/9/usr.sbin/tzsetup/tzsetup.c Modified: stable/9/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:12:07 2013 (r247726) +++ stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:20:30 2013 (r247727) @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD$"); #include #include @@ -659,16 +659,19 @@ install_zoneinfo_file(const char *zonein copymode = 1; #ifdef VERBOSE - if (copymode) + snprintf(title, sizeof(title), "Info"); + if (zoneinfo_file == NULL) + snprintf(prompt, sizeof(prompt), + "Removing %s", path_localtime); + else if (copymode) snprintf(prompt, sizeof(prompt), "Copying %s to %s", zoneinfo_file, path_localtime); else snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", - path_localtime, - zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file); + path_localtime, zoneinfo_file); if (usedialog) - dialog_notify(prompt); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); #endif @@ -699,6 +702,10 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } +#ifdef VERBOSE + snprintf(prompt, sizeof(prompt), + "Removed %s", path_localtime); +#endif return (DITEM_LEAVE_MENU); } @@ -797,23 +804,23 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } } - } #ifdef VERBOSE - snprintf(title, sizeof(title), "Done"); - if (copymode) - snprintf(prompt, sizeof(prompt), - "Copied timezone file from %s to %s", zoneinfo_file, - path_localtime); - else - snprintf(prompt, sizeof(prompt), - "Created symbolic link from %s to %s", zoneinfo_file, - path_localtime); - if (usedialog) - dialog_msgbox(title, prompt, 8, 72, 1); - else - fprintf(stderr, "%s\n", prompt); + snprintf(title, sizeof(title), "Done"); + if (copymode) + snprintf(prompt, sizeof(prompt), + "Copied timezone file from %s to %s", + zoneinfo_file, path_localtime); + else + snprintf(prompt, sizeof(prompt), + "Created symbolic link from %s to %s", + zoneinfo_file, path_localtime); + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else + fprintf(stderr, "%s\n", prompt); #endif + } /* reallydoit */ return (DITEM_LEAVE_MENU); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 19:26:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1717D4B8; Sun, 3 Mar 2013 19:26:06 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 090743D5; Sun, 3 Mar 2013 19:26:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23JQ5i7055689; Sun, 3 Mar 2013 19:26:05 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23JQ5ZL055687; Sun, 3 Mar 2013 19:26:05 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303031926.r23JQ5ZL055687@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 19:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247728 - stable/9/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 19:26:06 -0000 Author: dteske Date: Sun Mar 3 19:26:05 2013 New Revision: 247728 URL: http://svnweb.freebsd.org/changeset/base/247728 Log: MFC r230296: Don't write /var/db/zoneinfo when zone is not actually changed. If the specified zone file does not exist or the -n flag is specified, do not update /var/db/zoneinfo. PR: bin/164039 Submitted by: dteske Modified: stable/9/usr.sbin/tzsetup/tzsetup.c Modified: stable/9/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:20:30 2013 (r247727) +++ stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:26:05 2013 (r247728) @@ -836,9 +836,11 @@ install_zoneinfo(const char *zoneinfo) rv = install_zoneinfo_file(path_zoneinfo_file); /* Save knowledge for later */ - if ((f = fopen(path_db, "w")) != NULL) { - fprintf(f, "%s\n", zoneinfo); - fclose(f); + if (reallydoit && (rv & DITEM_FAILURE) == 0) { + if ((f = fopen(path_db, "w")) != NULL) { + fprintf(f, "%s\n", zoneinfo); + fclose(f); + } } return (rv); From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 19:31:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE8146BF; Sun, 3 Mar 2013 19:31:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D513403; Sun, 3 Mar 2013 19:31:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23JVi75058028; Sun, 3 Mar 2013 19:31:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23JViKf058027; Sun, 3 Mar 2013 19:31:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303031931.r23JViKf058027@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 19:31: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: r247729 - stable/9/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 19:31:44 -0000 Author: dteske Date: Sun Mar 3 19:31:44 2013 New Revision: 247729 URL: http://svnweb.freebsd.org/changeset/base/247729 Log: MFC r230520: Clean up reinstall option and remove duplicate code - Move the reinstall logic to be before menus are initialised (menus are not needed when reinstalling a zonefile). - Remove unnecessary re-initialization of path_db. - Update variable name and error message because we now use the zone name relative to /usr/share/zoneinfo, not the full path. PR: bin/164041 Submitted by: dteske Modified: stable/9/usr.sbin/tzsetup/tzsetup.c Modified: stable/9/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:26:05 2013 (r247728) +++ stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:31:44 2013 (r247729) @@ -951,32 +951,16 @@ main(int argc, char **argv) /* Override the user-supplied umask. */ (void)umask(S_IWGRP | S_IWOTH); - read_iso3166_table(); - read_zones(); - sort_countries(); - make_menus(); - if (reinstall == 1) { FILE *f; - char zonefile[MAXPATHLEN]; - char path_db[MAXPATHLEN]; - - zonefile[0] = '\0'; - path_db[0] = '\0'; - if (chrootenv != NULL) { - sprintf(zonefile, "%s/", chrootenv); - sprintf(path_db, "%s/", chrootenv); - } - strcat(zonefile, _PATH_ZONEINFO); - strcat(zonefile, "/"); - strcat(path_db, _PATH_DB); + char zoneinfo[MAXPATHLEN]; if ((f = fopen(path_db, "r")) != NULL) { - if (fgets(zonefile, sizeof(zonefile), f) != NULL) { - zonefile[sizeof(zonefile) - 1] = 0; - if (strlen(zonefile) > 0) { - zonefile[strlen(zonefile) - 1] = 0; - rv = install_zoneinfo(zonefile); + if (fgets(zoneinfo, sizeof(zoneinfo), f) != NULL) { + zoneinfo[sizeof(zoneinfo) - 1] = 0; + if (strlen(zoneinfo) > 0) { + zoneinfo[strlen(zoneinfo) - 1] = 0; + rv = install_zoneinfo(zoneinfo); exit(rv & ~DITEM_LEAVE_MENU); } errx(1, "Error reading %s.\n", path_db); @@ -984,7 +968,7 @@ main(int argc, char **argv) fclose(f); errx(1, "Unable to determine earlier installed zoneinfo " - "file. Check %s", path_db); + "name. Check %s", path_db); } errx(1, "Cannot open %s for reading. Does it exist?", path_db); } @@ -1004,6 +988,11 @@ main(int argc, char **argv) /* FALLTHROUGH */ } + read_iso3166_table(); + read_zones(); + sort_countries(); + make_menus(); + init_dialog(stdin, stdout); if (skiputc == 0) { DIALOG_VARS save_vars; From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 20:10:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8CF0EA6; Sun, 3 Mar 2013 20:10:57 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2DF373A; Sun, 3 Mar 2013 20:10:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23KAvq4069162; Sun, 3 Mar 2013 20:10:57 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23KAusJ069153; Sun, 3 Mar 2013 20:10:56 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201303032010.r23KAusJ069153@svn.freebsd.org> From: David Malone Date: Sun, 3 Mar 2013 20:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247730 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 20:10:57 -0000 Author: dwmalone Date: Sun Mar 3 20:10:56 2013 New Revision: 247730 URL: http://svnweb.freebsd.org/changeset/base/247730 Log: Add an option for finding sparse files. Reviewed by: iedowse MFC after: 3 weeks Modified: head/usr.bin/find/extern.h head/usr.bin/find/find.1 head/usr.bin/find/function.c head/usr.bin/find/option.c Modified: head/usr.bin/find/extern.h ============================================================================== --- head/usr.bin/find/extern.h Sun Mar 3 19:31:44 2013 (r247729) +++ head/usr.bin/find/extern.h Sun Mar 3 20:10:56 2013 (r247730) @@ -73,6 +73,7 @@ creat_f c_regex; creat_f c_samefile; creat_f c_simple; creat_f c_size; +creat_f c_sparse; creat_f c_type; creat_f c_user; creat_f c_xdev; @@ -109,6 +110,7 @@ exec_f f_prune; exec_f f_quit; exec_f f_regex; exec_f f_size; +exec_f f_sparse; exec_f f_type; exec_f f_user; Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Sun Mar 3 19:31:44 2013 (r247729) +++ head/usr.bin/find/find.1 Sun Mar 3 20:10:56 2013 (r247730) @@ -816,6 +816,10 @@ terabytes (1024 gigabytes) .It Cm P petabytes (1024 terabytes) .El +.It Ic -sparse +True if the current file is sparse, +i.e. has fewer blocks allocated than expected based on its size in bytes. +This might also match files that have been compressed by the filesystem. .It Ic -type Ar t True if the file is of the specified type. Possible file types are as follows: @@ -997,7 +1001,7 @@ and as well as .Ic -amin , -anewer , -cmin , -cnewer , -delete , -empty , -fstype , .Ic -iname , -inum , -iregex , -ls , -maxdepth , -mindepth , -mmin , -.Ic -path , -print0 , -regex +.Ic -path , -print0 , -regex, -sparse and all of the .Ic -B* birthtime related primaries are extensions to Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sun Mar 3 19:31:44 2013 (r247729) +++ head/usr.bin/find/function.c Sun Mar 3 20:10:56 2013 (r247730) @@ -1497,6 +1497,29 @@ c_size(OPTION *option, char ***argvp) } /* + * -sparse functions -- + * + * Check if a file is sparse by finding if it occupies fewer blocks + * than we expect based on its size. + */ +int +f_sparse(PLAN *plan __unused, FTSENT *entry) +{ + off_t expected_blocks; + + expected_blocks = (entry->fts_statp->st_size + 511) / 512; + return entry->fts_statp->st_blocks < expected_blocks; +} + +PLAN * +c_sparse(OPTION *option, char ***argvp __unused) +{ + ftsoptions &= ~FTS_NOSTAT; + + return palloc(option); +} + +/* * -type c functions -- * * True if the type of the file is c, where c is b, c, d, p, f or w Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Sun Mar 3 19:31:44 2013 (r247729) +++ head/usr.bin/find/option.c Sun Mar 3 20:10:56 2013 (r247730) @@ -145,6 +145,7 @@ static OPTION const options[] = { { "-regex", c_regex, f_regex, 0 }, { "-samefile", c_samefile, f_inum, 0 }, { "-size", c_size, f_size, 0 }, + { "-sparse", c_sparse, f_sparse, 0 }, { "-true", c_simple, f_always_true, 0 }, { "-type", c_type, f_type, 0 }, { "-uid", c_user, f_user, 0 }, From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 21:48:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 834261F5; Sun, 3 Mar 2013 21:48:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 668B8AE2; Sun, 3 Mar 2013 21:48:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23Lmf9c099338; Sun, 3 Mar 2013 21:48:41 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23LmfgF099335; Sun, 3 Mar 2013 21:48:41 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303032148.r23LmfgF099335@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 3 Mar 2013 21:48:41 +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: r247732 - in stable/8/sys: kern net security/mac 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 21:48:41 -0000 Author: melifaro Date: Sun Mar 3 21:48:40 2013 New Revision: 247732 URL: http://svnweb.freebsd.org/changeset/base/247732 Log: Merge * r233937 - Improve BPF locking model * r233938 - Improve performace for writer-only BPF users * r233946 - Fix build * r235744 - Fix (new) panic on attaching to non-existent interface * r235745 - Fix old panic when BPF consumer attaches to destroying interface * r235746 - Call bpf_jitter() before acquiring BPF global lock * r235747 - Make most BPF ioctls() SMP-safe. * r236231 - Fix BPF_JITTER code broken by r235746. * r236261 - Save the previous filter right before we set new one. * r236262 - Fix style(9) nits, reduce unnecessary type castings. * r236559 - Fix panic introduced by r235745 * r236806 - Fix typo introduced in r236559. r233937 - Improve BPF locking model. Interface locks and descriptor locks are converted from mutex(9) to rwlock(9). This greately improves performance: in most common case we need to acquire 1 reader lock instead of 2 mutexes. - Remove filter(descriptor) (reader) lock in bpf_mtap[2] This was suggested by glebius@. We protect filter by requesting interface writer lock on filter change. - Cover struct bpf_if under BPF_INTERNAL define. This permits including bpf.h without including rwlock stuff. However, this is is temporary solution, struct bpf_if should be made opaque for any external caller. r233938 - Improve performace for writer-only BPF users. Linux and Solaris (at least OpenSolaris) has PF_PACKET socket families to send raw ethernet frames. The only FreeBSD interface that can be used to send raw frames is BPF. As a result, many programs like cdpd, lldpd, various dhcp stuff uses BPF only to send data. This leads us to the situation when software like cdpd, being run on high-traffic-volume interface significantly reduces overall performance since we have to acquire additional locks for every packet. Here we add sysctl that changes BPF behavior in the following way: If program came and opens BPF socket without explicitly specifyin read filter we assume it to be write-only and add it to special writer-only per-interface list. This makes bpf_peers_present() return 0, so no additional overhead is introduced. After filter is supplied, descriptor is added to original per-interface list permitting packets to be captured. Unfortunately, pcap_open_live() sets catch-all filter itself for the purpose of setting snap length. Fortunately, most programs explicitly sets (event catch-all) filter after that. tcpdump(1) is a good example. So a bit hackis approach is taken: we upgrade description only after second BIOCSETF is received. Sysctl is named net.bpf.optimize_writers and is turned off by default. - While here, document all sysctl variables in bpf.4 r233946 Fix build broken by r233938. r235744 Fix panic on attaching to non-existent interface (introduced by r233937, pointed by hrs@) Fix panic on tcpdump being attached to interface being removed (introduced by r233937, pointed by hrs@ and adrian@) Protect most of bpf_setf() by BPF global lock Add several forgotten assertions (thanks to adrian@) Document current locking model inside bpf.c Document EVENTHANDLER(9) usage inside BPF. r235745 Fix old panic when BPF consumer attaches to destroying interface. 'flags' field is added to the end of bpf_if structure. Currently the only flag is BPFIF_FLAG_DYING which is set on bpf detach and checked by bpf_attachd() Problem can be easily triggered on SMP stable/[89] by the following command (sort of): 'while true; do ifconfig vlan222 create vlan 222 vlandev em0 up ; \ tcpdump -pi vlan222 & ; ifconfig vlan222 destroy ; done' Fix possible use-after-free when BPF detaches itself from interface, freeing bpf_bif memory, while interface is still UP and there can be routes via this interface. Freeing is now delayed till ifnet_departure_event is received via eventhandler(9) api. Convert bpfd rwlock back to mutex due lack of performance gain (currently checking if packet matches filter is done without holding bpfd lock and we have to acquire write lock if packet matches) r235746 Call bpf_jitter() before acquiring BPF global lock due to malloc() being used inside bpf_jitter. Eliminate bpf_buffer_alloc() and allocate BPF buffers on descriptor creation and BIOCSBLEN ioctl. This permits us not to allocate buffers inside bpf_attachd() which is protected by global lock. r235747 Make most BPF ioctls() SMP-safe. r236559 Fix panic introduced by r235745. Panic occurs after first packet traverse renamed interface. Add several comments on locking r236231 Fix BPF_JITTER code broken by r235746. r236261 - Save the previous filter right before we set new one. - Reduce duplicate code and make it little easier to read. r236262 Fix style(9) nits, reduce unnecessary type castings, etc., for bpf_setf(). r236806 Fix typo introduced in r236559. Modified: stable/8/sys/kern/subr_witness.c stable/8/sys/net/bpf.c stable/8/sys/net/bpf.h stable/8/sys/net/bpf_buffer.c stable/8/sys/net/bpf_buffer.h stable/8/sys/net/bpfdesc.h stable/8/sys/security/mac/mac_net.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/net/ (props changed) stable/8/sys/security/ (props changed) Modified: stable/8/sys/kern/subr_witness.c ============================================================================== --- stable/8/sys/kern/subr_witness.c Sun Mar 3 20:37:27 2013 (r247731) +++ stable/8/sys/kern/subr_witness.c Sun Mar 3 21:48:40 2013 (r247732) @@ -568,7 +568,7 @@ static struct witness_order_list_entry o * BPF */ { "bpf global lock", &lock_class_mtx_sleep }, - { "bpf interface lock", &lock_class_mtx_sleep }, + { "bpf interface lock", &lock_class_rw }, { "bpf cdev lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* Modified: stable/8/sys/net/bpf.c ============================================================================== --- stable/8/sys/net/bpf.c Sun Mar 3 20:37:27 2013 (r247731) +++ stable/8/sys/net/bpf.c Sun Mar 3 21:48:40 2013 (r247732) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -66,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define BPF_INTERNAL #include #include #ifdef BPF_JITTER @@ -139,6 +142,7 @@ static int bpf_bpfd_cnt; static void bpf_attachd(struct bpf_d *, struct bpf_if *); static void bpf_detachd(struct bpf_d *); +static void bpf_detachd_locked(struct bpf_d *); static void bpf_freed(struct bpf_d *); static int bpf_movein(struct uio *, int, struct ifnet *, struct mbuf **, struct sockaddr *, int *, struct bpf_insn *); @@ -150,7 +154,7 @@ static void catchpacket(struct bpf_d *, void (*)(struct bpf_d *, caddr_t, u_int, void *, u_int), struct timeval *); static void reset_d(struct bpf_d *); -static int bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd); +static int bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd); static int bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *); static int bpf_setdlt(struct bpf_d *, u_int); static void filt_bpfdetach(struct knote *); @@ -168,6 +172,12 @@ SYSCTL_INT(_net_bpf, OID_AUTO, zerocopy_ SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_MPSAFE | CTLFLAG_RW, bpf_stats_sysctl, "bpf statistics portal"); +static VNET_DEFINE(int, bpf_optimize_writers) = 0; +#define V_bpf_optimize_writers VNET(bpf_optimize_writers) +SYSCTL_VNET_INT(_net_bpf, OID_AUTO, optimize_writers, + CTLFLAG_RW, &VNET_NAME(bpf_optimize_writers), 0, + "Do not send packets until BPF program is set"); + static d_open_t bpfopen; static d_read_t bpfread; static d_write_t bpfwrite; @@ -189,6 +199,37 @@ static struct cdevsw bpf_cdevsw = { static struct filterops bpfread_filtops = { 1, NULL, filt_bpfdetach, filt_bpfread }; +eventhandler_tag bpf_ifdetach_cookie = NULL; + +/* + * LOCKING MODEL USED BY BPF: + * Locks: + * 1) global lock (BPF_LOCK). Mutex, used to protect interface addition/removal, + * some global counters and every bpf_if reference. + * 2) Interface lock. Rwlock, used to protect list of BPF descriptors and their filters. + * 3) Descriptor lock. Mutex, used to protect BPF buffers and various structure fields + * used by bpf_mtap code. + * + * Lock order: + * + * Global lock, interface lock, descriptor lock + * + * We have to acquire interface lock before descriptor main lock due to BPF_MTAP[2] + * working model. In many places (like bpf_detachd) we start with BPF descriptor + * (and we need to at least rlock it to get reliable interface pointer). This + * gives us potential LOR. As a result, we use global lock to protect from bpf_if + * change in every such place. + * + * Changing d->bd_bif is protected by 1) global lock, 2) interface lock and + * 3) descriptor main wlock. + * Reading bd_bif can be protected by any of these locks, typically global lock. + * + * Changing read/write BPF filter is protected by the same three locks, + * the same applies for reading. + * + * Sleeping in global lock is not allowed due to bpfdetach() using it. + */ + /* * Wrapper functions for various buffering methods. If the set of buffer * modes expands, we will probably want to introduce a switch data structure @@ -282,7 +323,6 @@ bpf_canfreebuf(struct bpf_d *d) static int bpf_canwritebuf(struct bpf_d *d) { - BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { @@ -561,17 +601,92 @@ bad: static void bpf_attachd(struct bpf_d *d, struct bpf_if *bp) { + int op_w; + + BPF_LOCK_ASSERT(); + + /* + * Save sysctl value to protect from sysctl change + * between reads + */ + op_w = V_bpf_optimize_writers; + + if (d->bd_bif != NULL) + bpf_detachd_locked(d); /* - * Point d at bp, and add d to the interface's list of listeners. - * Finally, point the driver's bpf cookie at the interface so - * it will divert packets to bpf. + * Point d at bp, and add d to the interface's list. + * Since there are many applicaiotns using BPF for + * sending raw packets only (dhcpd, cdpd are good examples) + * we can delay adding d to the list of active listeners until + * some filter is configured. */ - BPFIF_LOCK(bp); + + BPFIF_WLOCK(bp); + BPFD_LOCK(d); + d->bd_bif = bp; - LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); + + if (op_w != 0) { + /* Add to writers-only list */ + LIST_INSERT_HEAD(&bp->bif_wlist, d, bd_next); + /* + * We decrement bd_writer on every filter set operation. + * First BIOCSETF is done by pcap_open_live() to set up + * snap length. After that appliation usually sets its own filter + */ + d->bd_writer = 2; + } else + LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); + + BPFD_UNLOCK(d); + BPFIF_WUNLOCK(bp); bpf_bpfd_cnt++; - BPFIF_UNLOCK(bp); + + CTR3(KTR_NET, "%s: bpf_attach called by pid %d, adding to %s list", + __func__, d->bd_pid, d->bd_writer ? "writer" : "active"); + + if (op_w == 0) + EVENTHANDLER_INVOKE(bpf_track, bp->bif_ifp, bp->bif_dlt, 1); +} + +/* + * Add d to the list of active bp filters. + * Reuqires bpf_attachd() to be called before + */ +static void +bpf_upgraded(struct bpf_d *d) +{ + struct bpf_if *bp; + + BPF_LOCK_ASSERT(); + + bp = d->bd_bif; + + /* + * Filter can be set several times without specifying interface. + * Mark d as reader and exit. + */ + if (bp == NULL) { + BPFD_LOCK(d); + d->bd_writer = 0; + BPFD_UNLOCK(d); + return; + } + + BPFIF_WLOCK(bp); + BPFD_LOCK(d); + + /* Remove from writers-only list */ + LIST_REMOVE(d, bd_next); + LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); + /* Mark d as reader */ + d->bd_writer = 0; + + BPFD_UNLOCK(d); + BPFIF_WUNLOCK(bp); + + CTR2(KTR_NET, "%s: upgrade required by pid %d", __func__, d->bd_pid); EVENTHANDLER_INVOKE(bpf_track, bp->bif_ifp, bp->bif_dlt, 1); } @@ -582,26 +697,47 @@ bpf_attachd(struct bpf_d *d, struct bpf_ static void bpf_detachd(struct bpf_d *d) { + BPF_LOCK(); + bpf_detachd_locked(d); + BPF_UNLOCK(); +} + +static void +bpf_detachd_locked(struct bpf_d *d) +{ int error; struct bpf_if *bp; struct ifnet *ifp; - bp = d->bd_bif; - BPFIF_LOCK(bp); + CTR2(KTR_NET, "%s: detach required by pid %d", __func__, d->bd_pid); + + BPF_LOCK_ASSERT(); + + /* Check if descriptor is attached */ + if ((bp = d->bd_bif) == NULL) + return; + + BPFIF_WLOCK(bp); BPFD_LOCK(d); - ifp = d->bd_bif->bif_ifp; + + /* Save bd_writer value */ + error = d->bd_writer; /* * Remove d from the interface's descriptor list. */ LIST_REMOVE(d, bd_next); - bpf_bpfd_cnt--; + ifp = bp->bif_ifp; d->bd_bif = NULL; BPFD_UNLOCK(d); - BPFIF_UNLOCK(bp); + BPFIF_WUNLOCK(bp); - EVENTHANDLER_INVOKE(bpf_track, ifp, bp->bif_dlt, 0); + bpf_bpfd_cnt--; + + /* Call event handler iff d is attached */ + if (error == 0) + EVENTHANDLER_INVOKE(bpf_track, ifp, bp->bif_dlt, 0); /* * Check if this descriptor had requested promiscuous mode. @@ -640,10 +776,7 @@ bpf_dtor(void *data) d->bd_state = BPF_IDLE; BPFD_UNLOCK(d); funsetown(&d->bd_sigio); - mtx_lock(&bpf_mtx); - if (d->bd_bif) - bpf_detachd(d); - mtx_unlock(&bpf_mtx); + bpf_detachd(d); #ifdef MAC mac_bpfdesc_destroy(d); #endif /* MAC */ @@ -663,7 +796,7 @@ static int bpfopen(struct cdev *dev, int flags, int fmt, struct thread *td) { struct bpf_d *d; - int error; + int error, size; d = malloc(sizeof(*d), M_BPF, M_WAITOK | M_ZERO); error = devfs_set_cdevpriv(d, bpf_dtor); @@ -681,14 +814,18 @@ bpfopen(struct cdev *dev, int flags, int d->bd_bufmode = BPF_BUFMODE_BUFFER; d->bd_sig = SIGIO; d->bd_direction = BPF_D_INOUT; - d->bd_pid = td->td_proc->p_pid; + BPF_PID_REFRESH(d, td); #ifdef MAC mac_bpfdesc_init(d); mac_bpfdesc_create(td->td_ucred, d); #endif - mtx_init(&d->bd_mtx, devtoname(dev), "bpf cdev lock", MTX_DEF); - callout_init_mtx(&d->bd_callout, &d->bd_mtx, 0); - knlist_init_mtx(&d->bd_sel.si_note, &d->bd_mtx); + mtx_init(&d->bd_lock, devtoname(dev), "bpf cdev lock", MTX_DEF); + callout_init_mtx(&d->bd_callout, &d->bd_lock, 0); + knlist_init_mtx(&d->bd_sel.si_note, &d->bd_lock); + + /* Allocate default buffers */ + size = d->bd_bufsize; + bpf_buffer_ioctl_sblen(d, &size); return (0); } @@ -718,7 +855,7 @@ bpfread(struct cdev *dev, struct uio *ui non_block = ((ioflag & O_NONBLOCK) != 0); BPFD_LOCK(d); - d->bd_pid = curthread->td_proc->p_pid; + BPF_PID_REFRESH_CUR(d); if (d->bd_bufmode != BPF_BUFMODE_BUFFER) { BPFD_UNLOCK(d); return (EOPNOTSUPP); @@ -764,7 +901,7 @@ bpfread(struct cdev *dev, struct uio *ui BPFD_UNLOCK(d); return (EWOULDBLOCK); } - error = msleep(d, &d->bd_mtx, PRINET|PCATCH, + error = msleep(d, &d->bd_lock, PRINET|PCATCH, "bpf", d->bd_rtout); if (error == EINTR || error == ERESTART) { BPFD_UNLOCK(d); @@ -881,8 +1018,9 @@ bpfwrite(struct cdev *dev, struct uio *u if (error != 0) return (error); - d->bd_pid = curthread->td_proc->p_pid; + BPF_PID_REFRESH_CUR(d); d->bd_wcount++; + /* XXX: locking required */ if (d->bd_bif == NULL) { d->bd_wdcount++; return (ENXIO); @@ -903,6 +1041,7 @@ bpfwrite(struct cdev *dev, struct uio *u bzero(&dst, sizeof(dst)); m = NULL; hlen = 0; + /* XXX: bpf_movein() can sleep */ error = bpf_movein(uio, (int)d->bd_bif->bif_dlt, ifp, &m, &dst, &hlen, d->bd_wfilter); if (error) { @@ -962,7 +1101,7 @@ static void reset_d(struct bpf_d *d) { - mtx_assert(&d->bd_mtx, MA_OWNED); + BPFD_LOCK_ASSERT(d); if ((d->bd_hbuf != NULL) && (d->bd_bufmode != BPF_BUFMODE_ZBUF || bpf_canfreebuf(d))) { @@ -1028,7 +1167,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Refresh PID associated with this descriptor. */ BPFD_LOCK(d); - d->bd_pid = td->td_proc->p_pid; + BPF_PID_REFRESH(d, td); if (d->bd_state == BPF_WAITING) callout_stop(&d->bd_callout); d->bd_state = BPF_IDLE; @@ -1079,7 +1218,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BIOCGDLTLIST32: case BIOCGRTIMEOUT32: case BIOCSRTIMEOUT32: + BPFD_LOCK(d); d->bd_compat32 = 1; + BPFD_UNLOCK(d); } #endif @@ -1124,7 +1265,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get buffer len [for read()]. */ case BIOCGBLEN: + BPFD_LOCK(d); *(u_int *)addr = d->bd_bufsize; + BPFD_UNLOCK(d); break; /* @@ -1179,10 +1322,12 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get current data link type. */ case BIOCGDLT: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else *(u_int *)addr = d->bd_bif->bif_dlt; + BPF_UNLOCK(); break; /* @@ -1197,6 +1342,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c list32 = (struct bpf_dltlist32 *)addr; dltlist.bfl_len = list32->bfl_len; dltlist.bfl_list = PTRIN(list32->bfl_list); + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else { @@ -1204,31 +1350,37 @@ bpfioctl(struct cdev *dev, u_long cmd, c if (error == 0) list32->bfl_len = dltlist.bfl_len; } + BPF_UNLOCK(); break; } #endif case BIOCGDLTLIST: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else error = bpf_getdltlist(d, (struct bpf_dltlist *)addr); + BPF_UNLOCK(); break; /* * Set data link type. */ case BIOCSDLT: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else error = bpf_setdlt(d, *(u_int *)addr); + BPF_UNLOCK(); break; /* * Get interface name. */ case BIOCGETIF: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else { @@ -1238,13 +1390,16 @@ bpfioctl(struct cdev *dev, u_long cmd, c strlcpy(ifr->ifr_name, ifp->if_xname, sizeof(ifr->ifr_name)); } + BPF_UNLOCK(); break; /* * Set interface. */ case BIOCSETIF: + BPF_LOCK(); error = bpf_setif(d, (struct ifreq *)addr); + BPF_UNLOCK(); break; /* @@ -1327,7 +1482,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set immediate mode. */ case BIOCIMMEDIATE: + BPFD_LOCK(d); d->bd_immediate = *(u_int *)addr; + BPFD_UNLOCK(d); break; case BIOCVERSION: @@ -1343,21 +1500,27 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get "header already complete" flag */ case BIOCGHDRCMPLT: + BPFD_LOCK(d); *(u_int *)addr = d->bd_hdrcmplt; + BPFD_UNLOCK(d); break; /* * Set "header already complete" flag */ case BIOCSHDRCMPLT: + BPFD_LOCK(d); d->bd_hdrcmplt = *(u_int *)addr ? 1 : 0; + BPFD_UNLOCK(d); break; /* * Get packet direction flag */ case BIOCGDIRECTION: + BPFD_LOCK(d); *(u_int *)addr = d->bd_direction; + BPFD_UNLOCK(d); break; /* @@ -1372,7 +1535,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BPF_D_IN: case BPF_D_INOUT: case BPF_D_OUT: + BPFD_LOCK(d); d->bd_direction = direction; + BPFD_UNLOCK(d); break; default: error = EINVAL; @@ -1381,26 +1546,38 @@ bpfioctl(struct cdev *dev, u_long cmd, c break; case BIOCFEEDBACK: + BPFD_LOCK(d); d->bd_feedback = *(u_int *)addr; + BPFD_UNLOCK(d); break; case BIOCLOCK: + BPFD_LOCK(d); d->bd_locked = 1; + BPFD_UNLOCK(d); break; case FIONBIO: /* Non-blocking I/O */ break; case FIOASYNC: /* Send signal on receive packets */ + BPFD_LOCK(d); d->bd_async = *(int *)addr; + BPFD_UNLOCK(d); break; case FIOSETOWN: + /* + * XXX: Add some sort of locking here? + * fsetown() can sleep. + */ error = fsetown(*(int *)addr, &d->bd_sigio); break; case FIOGETOWN: + BPFD_LOCK(d); *(int *)addr = fgetown(&d->bd_sigio); + BPFD_UNLOCK(d); break; /* This is deprecated, FIOSETOWN should be used instead. */ @@ -1421,16 +1598,23 @@ bpfioctl(struct cdev *dev, u_long cmd, c if (sig >= NSIG) error = EINVAL; - else + else { + BPFD_LOCK(d); d->bd_sig = sig; + BPFD_UNLOCK(d); + } break; } case BIOCGRSIG: + BPFD_LOCK(d); *(u_int *)addr = d->bd_sig; + BPFD_UNLOCK(d); break; case BIOCGETBUFMODE: + BPFD_LOCK(d); *(u_int *)addr = d->bd_bufmode; + BPFD_UNLOCK(d); break; case BIOCSETBUFMODE: @@ -1485,19 +1669,31 @@ bpfioctl(struct cdev *dev, u_long cmd, c /* * Set d's packet filter program to fp. If this file already has a filter, * free it and replace it. Returns EINVAL for bogus requests. + * + * Note we need global lock here to serialize bpf_setf() and bpf_setif() calls + * since reading d->bd_bif can't be protected by d or interface lock due to + * lock order. + * + * Additionally, we have to acquire interface write lock due to bpf_mtap() uses + * interface read lock to read all filers. + * */ static int bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_long cmd) { +#ifdef COMPAT_FREEBSD32 + struct bpf_program fp_swab; + struct bpf_program32 *fp32; +#endif struct bpf_insn *fcode, *old; - u_int wfilter, flen, size; #ifdef BPF_JITTER - bpf_jit_filter *ofunc; + bpf_jit_filter *jfunc, *ofunc; #endif -#ifdef COMPAT_FREEBSD32 - struct bpf_program32 *fp32; - struct bpf_program fp_swab; + size_t size; + u_int flen; + int need_upgrade; +#ifdef COMPAT_FREEBSD32 switch (cmd) { case BIOCSETF32: case BIOCSETWF32: @@ -1517,73 +1713,86 @@ bpf_setf(struct bpf_d *d, struct bpf_pro break; } #endif - if (cmd == BIOCSETWF) { - old = d->bd_wfilter; - wfilter = 1; -#ifdef BPF_JITTER - ofunc = NULL; -#endif - } else { - wfilter = 0; - old = d->bd_rfilter; + + fcode = NULL; #ifdef BPF_JITTER - ofunc = d->bd_bfilter; + jfunc = ofunc = NULL; #endif - } - if (fp->bf_insns == NULL) { - if (fp->bf_len != 0) + need_upgrade = 0; + + /* + * Check new filter validness before acquiring any locks. + * Allocate memory for new filter, if needed. + */ + flen = fp->bf_len; + if (flen > bpf_maxinsns || (fp->bf_insns == NULL && flen != 0)) + return (EINVAL); + size = flen * sizeof(*fp->bf_insns); + if (size > 0) { + /* We're setting up new filter. Copy and check actual data. */ + fcode = malloc(size, M_BPF, M_WAITOK); + if (copyin(fp->bf_insns, fcode, size) != 0 || + !bpf_validate(fcode, flen)) { + free(fcode, M_BPF); return (EINVAL); - BPFD_LOCK(d); - if (wfilter) - d->bd_wfilter = NULL; - else { - d->bd_rfilter = NULL; -#ifdef BPF_JITTER - d->bd_bfilter = NULL; -#endif - if (cmd == BIOCSETF) - reset_d(d); } - BPFD_UNLOCK(d); - if (old != NULL) - free((caddr_t)old, M_BPF); #ifdef BPF_JITTER - if (ofunc != NULL) - bpf_destroy_jit_filter(ofunc); + /* Filter is copied inside fcode and is perfectly valid. */ + jfunc = bpf_jitter(fcode, flen); #endif - return (0); } - flen = fp->bf_len; - if (flen > bpf_maxinsns) - return (EINVAL); - size = flen * sizeof(*fp->bf_insns); - fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK); - if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) == 0 && - bpf_validate(fcode, (int)flen)) { - BPFD_LOCK(d); - if (wfilter) - d->bd_wfilter = fcode; - else { - d->bd_rfilter = fcode; + BPF_LOCK(); + + /* + * Set up new filter. + * Protect filter change by interface lock. + * Additionally, we are protected by global lock here. + */ + if (d->bd_bif != NULL) + BPFIF_WLOCK(d->bd_bif); + BPFD_LOCK(d); + if (cmd == BIOCSETWF) { + old = d->bd_wfilter; + d->bd_wfilter = fcode; + } else { + old = d->bd_rfilter; + d->bd_rfilter = fcode; #ifdef BPF_JITTER - d->bd_bfilter = bpf_jitter(fcode, flen); + ofunc = d->bd_bfilter; + d->bd_bfilter = jfunc; #endif - if (cmd == BIOCSETF) - reset_d(d); + if (cmd == BIOCSETF) + reset_d(d); + + if (fcode != NULL) { + /* + * Do not require upgrade by first BIOCSETF + * (used to set snaplen) by pcap_open_live(). + */ + if (d->bd_writer != 0 && --d->bd_writer == 0) + need_upgrade = 1; + CTR4(KTR_NET, "%s: filter function set by pid %d, " + "bd_writer counter %d, need_upgrade %d", + __func__, d->bd_pid, d->bd_writer, need_upgrade); } - BPFD_UNLOCK(d); - if (old != NULL) - free((caddr_t)old, M_BPF); + } + BPFD_UNLOCK(d); + if (d->bd_bif != NULL) + BPFIF_WUNLOCK(d->bd_bif); + if (old != NULL) + free(old, M_BPF); #ifdef BPF_JITTER - if (ofunc != NULL) - bpf_destroy_jit_filter(ofunc); + if (ofunc != NULL) + bpf_destroy_jit_filter(ofunc); #endif - return (0); - } - free((caddr_t)fcode, M_BPF); - return (EINVAL); + /* Move d to active readers list. */ + if (need_upgrade) + bpf_upgraded(d); + + BPF_UNLOCK(); + return (0); } /* @@ -1597,28 +1806,30 @@ bpf_setif(struct bpf_d *d, struct ifreq struct bpf_if *bp; struct ifnet *theywant; + BPF_LOCK_ASSERT(); + theywant = ifunit(ifr->ifr_name); if (theywant == NULL || theywant->if_bpf == NULL) return (ENXIO); bp = theywant->if_bpf; + /* Check if interface is not being detached from BPF */ + BPFIF_RLOCK(bp); + if (bp->flags & BPFIF_FLAG_DYING) { + BPFIF_RUNLOCK(bp); + return (ENXIO); + } + BPFIF_RUNLOCK(bp); + /* * Behavior here depends on the buffering model. If we're using * kernel memory buffers, then we can allocate them here. If we're * using zero-copy, then the user process must have registered * buffers by the time we get here. If not, return an error. - * - * XXXRW: There are locking issues here with multi-threaded use: what - * if two threads try to set the interface at once? */ switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: - if (d->bd_sbuf == NULL) - bpf_buffer_alloc(d); - KASSERT(d->bd_sbuf != NULL, ("bpf_setif: bd_sbuf NULL")); - break; - case BPF_BUFMODE_ZBUF: if (d->bd_sbuf == NULL) return (EINVAL); @@ -1627,15 +1838,8 @@ bpf_setif(struct bpf_d *d, struct ifreq default: panic("bpf_setif: bufmode %d", d->bd_bufmode); } - if (bp != d->bd_bif) { - if (d->bd_bif) - /* - * Detach if attached to something else. - */ - bpf_detachd(d); - + if (bp != d->bd_bif) bpf_attachd(d, bp); - } BPFD_LOCK(d); reset_d(d); BPFD_UNLOCK(d); @@ -1663,7 +1867,7 @@ bpfpoll(struct cdev *dev, int events, st */ revents = events & (POLLOUT | POLLWRNORM); BPFD_LOCK(d); - d->bd_pid = td->td_proc->p_pid; + BPF_PID_REFRESH(d, td); if (events & (POLLIN | POLLRDNORM)) { if (bpf_ready(d)) revents |= events & (POLLIN | POLLRDNORM); @@ -1698,7 +1902,7 @@ bpfkqfilter(struct cdev *dev, struct kno * Refresh PID associated with this descriptor. */ BPFD_LOCK(d); - d->bd_pid = curthread->td_proc->p_pid; + BPF_PID_REFRESH_CUR(d); kn->kn_fop = &bpfread_filtops; kn->kn_hook = d; knlist_add(&d->bd_sel.si_note, kn, 1); @@ -1754,9 +1958,19 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, struct timeval tv; gottime = 0; - BPFIF_LOCK(bp); + + BPFIF_RLOCK(bp); + LIST_FOREACH(d, &bp->bif_dlist, bd_next) { - BPFD_LOCK(d); + /* + * We are not using any locks for d here because: + * 1) any filter change is protected by interface + * write lock + * 2) destroying/detaching d is protected by interface + * write lock, too + */ + + /* XXX: Do not protect counter for the sake of performance. */ ++d->bd_rcount; /* * NB: We dont call BPF_CHECK_DIRECTION() here since there is no @@ -1772,6 +1986,11 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, #endif slen = bpf_filter(d->bd_rfilter, pkt, pktlen, pktlen); if (slen != 0) { + /* + * Filter matches. Let's to acquire write lock. + */ + BPFD_LOCK(d); + d->bd_fcount++; if (!gottime) { microtime(&tv); @@ -1782,10 +2001,10 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, #endif catchpacket(d, pkt, pktlen, slen, bpf_append_bytes, &tv); + BPFD_UNLOCK(d); } - BPFD_UNLOCK(d); } - BPFIF_UNLOCK(bp); + BPFIF_RUNLOCK(bp); } #define BPF_CHECK_DIRECTION(d, r, i) \ @@ -1794,6 +2013,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, /* * Incoming linkage from device drivers, when packet is in an mbuf chain. + * Locking model is explained in bpf_tap(). */ void bpf_mtap(struct bpf_if *bp, struct mbuf *m) @@ -1816,11 +2036,11 @@ bpf_mtap(struct bpf_if *bp, struct mbuf pktlen = m_length(m, NULL); - BPFIF_LOCK(bp); + BPFIF_RLOCK(bp); + LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp)) continue; - BPFD_LOCK(d); ++d->bd_rcount; #ifdef BPF_JITTER bf = bpf_jitter_enable != 0 ? d->bd_bfilter : NULL; @@ -1831,6 +2051,8 @@ bpf_mtap(struct bpf_if *bp, struct mbuf #endif slen = bpf_filter(d->bd_rfilter, (u_char *)m, pktlen, 0); if (slen != 0) { + BPFD_LOCK(d); + d->bd_fcount++; if (!gottime) { microtime(&tv); @@ -1841,10 +2063,10 @@ bpf_mtap(struct bpf_if *bp, struct mbuf #endif catchpacket(d, (u_char *)m, pktlen, slen, bpf_append_mbuf, &tv); + BPFD_UNLOCK(d); } - BPFD_UNLOCK(d); } - BPFIF_UNLOCK(bp); + BPFIF_RUNLOCK(bp); } /* @@ -1879,14 +2101,17 @@ bpf_mtap2(struct bpf_if *bp, void *data, mb.m_len = dlen; pktlen += dlen; - BPFIF_LOCK(bp); + + BPFIF_RLOCK(bp); + LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp)) continue; - BPFD_LOCK(d); ++d->bd_rcount; slen = bpf_filter(d->bd_rfilter, (u_char *)&mb, pktlen, 0); if (slen != 0) { + BPFD_LOCK(d); + d->bd_fcount++; if (!gottime) { microtime(&tv); @@ -1897,10 +2122,10 @@ bpf_mtap2(struct bpf_if *bp, void *data, #endif catchpacket(d, (u_char *)&mb, pktlen, slen, bpf_append_mbuf, &tv); + BPFD_UNLOCK(d); } - BPFD_UNLOCK(d); } - BPFIF_UNLOCK(bp); + BPFIF_RUNLOCK(bp); } #undef BPF_CHECK_DIRECTION @@ -2050,7 +2275,7 @@ bpf_freed(struct bpf_d *d) } if (d->bd_wfilter != NULL) free((caddr_t)d->bd_wfilter, M_BPF); - mtx_destroy(&d->bd_mtx); + mtx_destroy(&d->bd_lock); } /* @@ -2080,15 +2305,16 @@ bpfattach2(struct ifnet *ifp, u_int dlt, panic("bpfattach"); LIST_INIT(&bp->bif_dlist); + LIST_INIT(&bp->bif_wlist); bp->bif_ifp = ifp; bp->bif_dlt = dlt; - mtx_init(&bp->bif_mtx, "bpf interface lock", NULL, MTX_DEF); + rw_init(&bp->bif_lock, "bpf interface lock"); KASSERT(*driverp == NULL, ("bpfattach2: driverp already initialized")); *driverp = bp; - mtx_lock(&bpf_mtx); + BPF_LOCK(); LIST_INSERT_HEAD(&bpf_iflist, bp, bif_next); - mtx_unlock(&bpf_mtx); + BPF_UNLOCK(); /* * Compute the length of the bpf header. This is not necessarily @@ -2103,10 +2329,9 @@ bpfattach2(struct ifnet *ifp, u_int dlt, } /* - * Detach bpf from an interface. This involves detaching each descriptor - * associated with the interface, and leaving bd_bif NULL. Notify each - * descriptor as it's detached so that any sleepers wake up and get - * ENXIO. + * Detach bpf from an interface. This involves detaching each descriptor + * associated with the interface. Notify each descriptor as it's detached + * so that any sleepers wake up and get ENXIO. */ void bpfdetach(struct ifnet *ifp) @@ -2119,31 +2344,45 @@ bpfdetach(struct ifnet *ifp) ndetached = 0; #endif + BPF_LOCK(); /* Find all bpf_if struct's which reference ifp and detach them. */ do { - mtx_lock(&bpf_mtx); LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (ifp == bp->bif_ifp) break; } if (bp != NULL) LIST_REMOVE(bp, bif_next); - mtx_unlock(&bpf_mtx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 22:33:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 336511A5; Sun, 3 Mar 2013 22:33:14 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2459ACDA; Sun, 3 Mar 2013 22:33:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23MXDQ9014056; Sun, 3 Mar 2013 22:33:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23MXDcG014055; Sun, 3 Mar 2013 22:33:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201303032233.r23MXDcG014055@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Mar 2013 22:33:13 +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: r247733 - stable/8/bin/sh 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 22:33:14 -0000 Author: jilles Date: Sun Mar 3 22:33:13 2013 New Revision: 247733 URL: http://svnweb.freebsd.org/changeset/base/247733 Log: MFC r246371: sh: Do not test for digit_contig in mksyntax. ISO/IEC 9899:1999 (E) 5.2.1p3 guarantees that the values of the characters 0123456789 are contiguous. The generated syntax.c and syntax.h remain the same. Submitted by: Christoph Mallon Modified: stable/8/bin/sh/mksyntax.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/mksyntax.c ============================================================================== --- stable/8/bin/sh/mksyntax.c Sun Mar 3 21:48:40 2013 (r247732) +++ stable/8/bin/sh/mksyntax.c Sun Mar 3 22:33:13 2013 (r247733) @@ -105,14 +105,12 @@ static const char *syntax[513]; static int base; static int size; /* number of values which a char variable can have */ static int nbits; /* number of bits in a character */ -static int digit_contig;/* true if digits are contiguous */ static void filltable(const char *); static void init(void); static void add(const char *, const char *); static void print(const char *); static void output_type_macros(void); -static void digit_convert(void); int main(int argc __unused, char **argv __unused) @@ -123,7 +121,6 @@ main(int argc __unused, char **argv __un int i; char buf[80]; int pos; - static char digit[] = "0123456789"; /* Create output files */ if ((cfile = fopen("syntax.c", "w")) == NULL) { @@ -156,11 +153,6 @@ main(int argc __unused, char **argv __un base = 1; if (sign) base += 1 << (nbits - 1); - digit_contig = 1; - for (i = 0 ; i < 10 ; i++) { - if (digit[i] != '0' + i) - digit_contig = 0; - } fputs("#include \n", hfile); fputs("#include \n", hfile); @@ -247,8 +239,6 @@ main(int argc __unused, char **argv __un add("_", "ISUNDER"); add("#?$!-*@", "ISSPECL"); print("is_type"); - if (! digit_contig) - digit_convert(); exit(0); } @@ -339,12 +329,13 @@ print(const char *name) */ static const char *macro[] = { - "#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)", + "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)", "#define is_eof(c)\t((c) == PEOF)", "#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))", "#define is_name(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && ((c) == '_' || isalpha((unsigned char) (c))))", "#define is_in_name(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && ((c) == '_' || isalnum((unsigned char) (c))))", "#define is_special(c)\t((is_type+SYNBASE)[c] & (ISSPECL|ISDIGIT))", + "#define digit_val(c)\t((c) - '0')", NULL }; @@ -353,41 +344,6 @@ output_type_macros(void) { const char **pp; - if (digit_contig) - macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; for (pp = macro ; *pp ; pp++) fprintf(hfile, "%s\n", *pp); - if (digit_contig) - fputs("#define digit_val(c)\t((c) - '0')\n", hfile); - else - fputs("#define digit_val(c)\t(digit_value[c])\n", hfile); -} - - - -/* - * Output digit conversion table (if digits are not contiguous). - */ - -static void -digit_convert(void) -{ - int maxdigit; - static char digit[] = "0123456789"; - char *p; - int i; - - maxdigit = 0; - for (p = digit ; *p ; p++) - if (*p > maxdigit) - maxdigit = *p; - fputs("extern const char digit_value[];\n", hfile); - fputs("\n\nconst char digit_value[] = {\n", cfile); - for (i = 0 ; i <= maxdigit ; i++) { - for (p = digit ; *p && *p != i ; p++); - if (*p == '\0') - p = digit; - fprintf(cfile, " %d,\n", (int)(p - digit)); - } - fputs("};\n", cfile); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 23:01:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 812727C2; Sun, 3 Mar 2013 23:01:47 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6403BDA3; Sun, 3 Mar 2013 23:01:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23N1lK8023041; Sun, 3 Mar 2013 23:01:47 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23N1lZa023039; Sun, 3 Mar 2013 23:01:47 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201303032301.r23N1lZa023039@svn.freebsd.org> From: Josh Paetzel Date: Sun, 3 Mar 2013 23:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247734 - head/usr.sbin/pc-sysinstall/backend X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 23:01:47 -0000 Author: jpaetzel Date: Sun Mar 3 23:01:46 2013 New Revision: 247734 URL: http://svnweb.freebsd.org/changeset/base/247734 Log: Improves and enhances using the "installPackages=" variable. Adds "pkgExt=" variable to set if pkgs are .tbz or .txz or other. Auto-detects if packages are PKGNG or old PKG format. Auto-bootstrap of PKGNG for the new installed environment. Fixes issues with installing packages from local media, such as DVD/USB. Switch to using a space-delimiter for installPackages, since a number of packages use a "," in their version string. Fix pc-sysinstall to ignore install scripts, and not hang on user interaction prompts when installing pkgs. Add pkg2ng command as apart of pkgng bootstrap process. Obtained from: PC-BSD Modified: head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh head/usr.sbin/pc-sysinstall/backend/functions-packages.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh Sun Mar 3 22:33:13 2013 (r247733) +++ head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh Sun Mar 3 23:01:46 2013 (r247734) @@ -76,50 +76,113 @@ fetch_package_dependencies() # Check for any packages specified, and begin loading them install_packages() { + echo "Checking for packages to install..." + sleep 2 + # First, lets check and see if we even have any packages to install get_value_from_cfg installPackages - if [ -n "${VAL}" ] - then - HERE=`pwd` - rc_nohalt "mkdir -p ${FSMNT}/${PKGTMPDIR}" - rc_nohalt "cd ${FSMNT}/${PKGTMPDIR}" - if [ ! -f "${CONFDIR}/INDEX" ] + # Nothing to do? + if [ -z "${VAL}" ]; then return; fi + + echo "Installing packages..." + sleep 3 + + local PKGPTH + + HERE=`pwd` + rc_halt "mkdir -p ${FSMNT}${PKGTMPDIR}" + + # Determine the directory we will install packages from + get_package_location + rc_halt "cd ${PKGDLDIR}" + + # Set the location of the INDEXFILE + INDEXFILE="${TMPDIR}/INDEX" + + if [ ! -f "${INDEXFILE}" ]; then + get_package_index + fi + + if [ ! -f "${TMPDIR}/INDEX.parsed" -a "$INSTALLMEDIUM" = "ftp" ]; then + parse_package_index + fi + + # What extension are we using for pkgs? + PKGEXT="txz" + get_value_from_cfg pkgExt + if [ -n "${VAL}" ]; then + strip_white_space ${VAL} + PKGEXT="$VAL" + fi + export PKGEXT + + # We dont want to be bothered with scripts asking questions + PACKAGE_BUILDING=yes + export PACKAGE_BUILDING + + # Lets start by cleaning up the string and getting it ready to parse + get_value_from_cfg_with_spaces installPackages + PACKAGES="${VAL}" + echo_log "Packages to install: `echo $PACKAGES | wc -w | awk '{print $1}'`" + for i in $PACKAGES + do + if ! get_package_name "${i}" then - get_package_index + echo_log "Unable to locate package ${i}" + continue + fi + + PKGNAME="${VAL}" + + # Fetch package + deps, but skip if installing from local media + if [ "${INSTALLMEDIUM}" = "ftp" ] ; then + DEPFILE="${FSMNT}/${PKGTMPDIR}/.${PKGNAME}.deps" + rc_nohalt "touch ${DEPFILE}" + determine_package_dependencies "${PKGNAME}" "${DEPFILE}" + fetch_package_dependencies "${DEPFILE}" "${FSMNT}/${PKGTMPDIR}" fi - if [ ! -f "${CONFDIR}/INDEX.parsed" ] + # Set package location + case "${INSTALLMEDIUM}" in + usb|dvd|local) PKGPTH="${PKGTMPDIR}/All/${PKGNAME}" ;; + *) PKGPTH="${PKGTMPDIR}/${PKGNAME}" ;; + esac + + # See if we need to determine the package format we are working with + if [ -z "${PKGINFO}" ] ; then + tar tqf "${FSMNT}${PKGPTH}" '+MANIFEST' >/dev/null 2>/dev/null + if [ $? -ne 0 ] ; then + PKGADD="pkg_add -C ${FSMNT}" + PKGINFO="pkg_info" + else + PKGADD="pkg -c ${FSMNT} add" + PKGINFO="pkg info" + bootstrap_pkgng + fi + fi + + # If the package is not already installed, install it! + if ! run_chroot_cmd "${PKGINFO} -e ${PKGNAME}" >/dev/null 2>/dev/null then - parse_package_index + echo_log "Installing package: ${PKGNAME}" + rc_nohalt "${PKGADD} ${PKGPTH}" fi - # Lets start by cleaning up the string and getting it ready to parse - strip_white_space ${VAL} - PACKAGES=`echo ${VAL} | sed -e "s|,| |g"` - for i in $PACKAGES - do - if get_package_name "${i}" - then - PKGNAME="${VAL}" - DEPFILE="${FSMNT}/${PKGTMPDIR}/.${PKGNAME}.deps" - - rc_nohalt "touch ${DEPFILE}" - determine_package_dependencies "${PKGNAME}" "${DEPFILE}" - fetch_package_dependencies "${DEPFILE}" "${FSMNT}/${PKGTMPDIR}" - - # If the package is not already installed, install it! - if ! run_chroot_cmd "pkg_info -e ${PKGNAME}" - then - rc_nohalt "pkg_add -C ${FSMNT} ${PKGTMPDIR}/${PKGNAME}.tbz" - fi + if [ "${INSTALLMEDIUM}" = "ftp" ] ; then + rc_nohalt "rm ${DEPFILE}" + fi - rc_nohalt "rm ${DEPFILE}" - fi + done - rc_nohalt "cd ${HERE}" - done + echo_log "Package installation complete!" - rm -rf "${FSMNT}/${PKGTMPDIR}" + # Cleanup after ourselves + rc_halt "cd ${HERE}" + if [ "${INSTALLMEDIUM}" = "ftp" ] ; then + rc_halt "rm -rf ${FSMNT}${PKGTMPDIR}" >/dev/null 2>/dev/null + else + rc_halt "umount ${FSMNT}${PKGTMPDIR}" >/dev/null 2>/dev/null + rc_halt "rmdir ${FSMNT}${PKGTMPDIR}" >/dev/null 2>/dev/null fi }; Modified: head/usr.sbin/pc-sysinstall/backend/functions-packages.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-packages.sh Sun Mar 3 22:33:13 2013 (r247733) +++ head/usr.sbin/pc-sysinstall/backend/functions-packages.sh Sun Mar 3 23:01:46 2013 (r247734) @@ -45,9 +45,11 @@ get_package_index_by_ftp() then INDEX_FILE="${INDEX_FILE}.bz2" USE_BZIP2=1 + INDEX_PATH="${INDEXFILE}.bz2" + else + INDEX_PATH="${INDEXFILE}" fi - INDEX_PATH="${CONFDIR}/${INDEX_FILE}" fetch_file "${FTP_SERVER}/${INDEX_FILE}" "${INDEX_PATH}" "1" if [ -f "${INDEX_PATH}" ] && [ "${USE_BZIP2}" -eq "1" ] then @@ -57,17 +59,18 @@ get_package_index_by_ftp() get_package_index_by_fs() { - local INDEX_FILE - - INDEX_FILE="${CDMNT}/packages/INDEX" - fetch_file "${INDEX_FILE}" "${CONFDIR}/" "0" + if [ "$INSTALLMEDIUM" = "local" ] ; then + INDEXFILE="${LOCALPATH}/packages/INDEX" + else + INDEXFILE="${CDMNT}/packages/INDEX" + fi }; get_package_index_size() { - if [ -f "${CONFDIR}/INDEX" ] + if [ -f "${INDEXFILE}" ] then - SIZE=`ls -l ${CONFDIR}/INDEX | awk '{ print $5 }'` + SIZE=`ls -l ${INDEXFILE} | awk '{ print $5 }'` else get_ftp_mirror FTPHOST="${VAL}" @@ -94,28 +97,24 @@ get_package_index() get_package_index_by_ftp "${FTPPATH}" else - get_value_from_cfg ftpHost - if [ -z "$VAL" ] - then - exit_err "ERROR: Install medium was set to ftp, but no ftpHost was provided!" - fi - - FTPHOST="${VAL}" - - get_value_from_cfg ftpDir - if [ -z "$VAL" ] - then - exit_err "ERROR: Install medium was set to ftp, but no ftpDir was provided!" - fi - - FTPDIR="${VAL}" - FTPPATH="ftp://${FTPHOST}${FTPDIR}" case "${INSTALLMEDIUM}" in - usb|dvd) get_package_index_by_fs ;; - ftp) get_package_index_by_ftp "${FTPPATH}" ;; - sftp) ;; - *) RES=1 ;; + usb|dvd|local) get_package_index_by_fs ;; + ftp) get_value_from_cfg ftpHost + if [ -z "$VAL" ]; then + exit_err "ERROR: Install medium was set to ftp, but no ftpHost was provided!" + fi + FTPHOST="${VAL}" + + get_value_from_cfg ftpDir + if [ -z "$VAL" ]; then + exit_err "ERROR: Install medium was set to ftp, but no ftpDir was provided!" + fi + FTPDIR="${VAL}" + FTPPATH="ftp://${FTPHOST}${FTPDIR}" + get_package_index_by_ftp "${FTPPATH}" ;; + sftp) ;; + *) RES=1 ;; esac fi @@ -125,10 +124,11 @@ get_package_index() parse_package_index() { + echo_log "Building package dep list.. Please wait.." INDEX_FILE="${PKGDIR}/INDEX" exec 3<&0 - exec 0<"${INDEX_FILE}" + exec 0<"${INDEXFILE}" while read -r line do @@ -257,20 +257,38 @@ get_package_name() { PACKAGE="${1}" RES=0 + local PKGPTH - INDEX_FILE="${PKGDIR}/INDEX.deps" - REGEX="^${PACKAGE}|" + # If we are on a local medium, we can parse the Latest/ directory + if [ "${INSTALLMEDIUM}" != "ftp" ] ; then + case "${INSTALLMEDIUM}" in + usb|dvd) PKGPTH="${CDMNT}/packages" ;; + *) PKGPTH="${LOCALPATH}/packages" ;; + esac + + # Check the /Latest dir for generic names, then look for specific version in All/ + if [ -e "${PKGPTH}/Latest/${PACKAGE}.${PKGEXT}" ] ; then + NAME=`ls -al ${PKGPTH}/Latest/${PACKAGE}.${PKGEXT} 2>/dev/null | cut -d '>' -f 2 | rev | cut -f1 -d'/' | rev | tr -s ' '` + else + NAME=`ls -al ${PKGPTH}/All/${PACKAGE}.${PKGEXT} 2>/dev/null | cut -d '>' -f 2 | rev | cut -f1 -d'/' | rev | tr -s ' '` + fi + export VAL="${NAME}" + else + # Doing remote fetch, we we will look up, but some generic names like + # "perl" wont work, since we don't know the default version + INDEX_FILE="${PKGDIR}/INDEX.deps" + REGEX="^${PACKAGE}|" - LINE=`grep "${REGEX}" "${INDEX_FILE}" 2>/dev/null` - NAME=`echo "${LINE}"|cut -f2 -d'|'` + LINE=`grep "${REGEX}" "${INDEX_FILE}" 2>/dev/null` + NAME=`echo "${LINE}"|cut -f2 -d'|'` - export VAL="${NAME}" + export VAL="${NAME}" + fi if [ -z "${VAL}" ] then RES=1 fi - return ${RES} }; @@ -334,7 +352,7 @@ fetch_package_by_ftp() fi FTPDIR="${VAL}" - PACKAGE="${PACKAGE}.tbz" + PACKAGE="${PACKAGE}.${PKGEXT}" FTP_SERVER="ftp://${FTPHOST}${FTPDIR}" if [ ! -f "${SAVEDIR}/${PACKAGE}" ] @@ -345,28 +363,49 @@ fetch_package_by_ftp() fi }; -fetch_package_by_fs() -{ - CATEGORY="${1}" - PACKAGE="${2}" - SAVEDIR="${3}" - - PACKAGE="${PACKAGE}.tbz" - if [ ! -f "${SAVEDIR}/${PACKAGE}" ] - then - fetch_file "${CDMNT}/packages/${CATEGORY}/${PACKAGE}" "${SAVEDIR}/" "0" - fi -}; - fetch_package() { CATEGORY="${1}" PACKAGE="${2}" SAVEDIR="${3}" + # Fetch package, but skip if installing from local media case "${INSTALLMEDIUM}" in - usb|dvd) fetch_package_by_fs "${CATEGORY}" "${PACKAGE}" "${SAVEDIR}" ;; + usb|dvd|local) return ;; ftp) fetch_package_by_ftp "${CATEGORY}" "${PACKAGE}" "${SAVEDIR}" ;; sftp) ;; esac }; + +bootstrap_pkgng() +{ + # Check if we need to boot-strap pkgng + if run_chroot_cmd "which pkg-static" >/dev/null 2>/dev/null + then + return + fi + local PKGPTH + + # Ok, lets boot-strap this sucker + echo_log "Bootstraping pkgng.." + fetch_package "Latest" "pkg" "${PKGDLDIR}" + + # Figure out real location of "pkg" package + case "${INSTALLMEDIUM}" in + usb|dvd|local) PKGPTH="${PKGTMPDIR}/Latest/pkg.${PKGEXT}" ;; + *) PKGPTH="${PKGTMPDIR}/pkg.${PKGEXT}" ;; + esac + rc_halt "pkg -c ${FSMNT} add ${PKGPTH}" ; run_chroot_cmd "pkg2ng" +} + +get_package_location() +{ + case "${INSTALLMEDIUM}" in + usb|dvd) rc_halt "mount_nullfs ${CDMNT}/packages ${FSMNT}${PKGTMPDIR}" + PKGDLDIR="${FSMNT}${PKGTMPDIR}/All" ;; + local) rc_halt "mount_nullfs ${LOCALPATH}/packages ${FSMNT}${PKGTMPDIR}" + PKGDLDIR="${FSMNT}${PKGTMPDIR}/All" ;; + *) PKGDLDIR="${FSMNT}${PKGTMPDIR}" ;; + esac + export PKGDLDIR +} From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 23:07:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 327E796D; Sun, 3 Mar 2013 23:07:29 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B84CDC5; Sun, 3 Mar 2013 23:07:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23N7S5u024049; Sun, 3 Mar 2013 23:07:28 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23N7RXa024039; Sun, 3 Mar 2013 23:07:27 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201303032307.r23N7RXa024039@svn.freebsd.org> From: Josh Paetzel Date: Sun, 3 Mar 2013 23:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247735 - in head/usr.sbin/pc-sysinstall: backend 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 23:07:29 -0000 Author: jpaetzel Date: Sun Mar 3 23:07:27 2013 New Revision: 247735 URL: http://svnweb.freebsd.org/changeset/base/247735 Log: Use GNOP to force ZFS pools to 4k. Obtained from: PC-BSD Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh head/usr.sbin/pc-sysinstall/backend/functions-disk.sh head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh head/usr.sbin/pc-sysinstall/backend/functions.sh head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sun Mar 3 23:01:46 2013 (r247734) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sun Mar 3 23:07:27 2013 (r247735) @@ -62,7 +62,18 @@ get_fs_line_xvars() echo $ZFSVARS | grep -qE "^(disk|file|mirror|raidz(1|2|3)?|spare|log|cache):" 2>/dev/null if [ $? -eq 0 ] ; then ZTYPE=`echo $ZFSVARS | cut -f1 -d:` - ZFSVARS=`echo $ZFSVARS | sed "s|$ZTYPE: ||g" | sed "s|$ZTYPE:||g"` + tmpVars=`echo $ZFSVARS | sed "s|$ZTYPE: ||g" | sed "s|$ZTYPE:||g"` + ZFSVARS="" + # make sure we have a '/dev' in front of the extra devices + for i in $tmpVars + do + echo $i | grep -q '/dev/' + if [ $? -ne 0 ] ; then + ZFSVARS="$ZFSVARS /dev/${i}" + else + ZFSVARS="$ZFSVARS $i" + fi + done fi # Return the ZFS options Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Sun Mar 3 23:01:46 2013 (r247734) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Sun Mar 3 23:07:27 2013 (r247735) @@ -33,6 +33,7 @@ is_disk() for _dsk in `sysctl -n kern.disks` do [ "$_dsk" = "${1}" ] && return 0 + [ "/dev/$_dsk" = "${1}" ] && return 0 done return 1 Modified: head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Sun Mar 3 23:01:46 2013 (r247734) +++ head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Sun Mar 3 23:07:27 2013 (r247735) @@ -149,12 +149,12 @@ mount_all_filesystems() for PART in `ls ${PARTDIR}` do PARTDEV=`echo $PART | sed 's|-|/|g'` - if [ ! -e "${PARTDEV}" ] + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + if [ ! -e "${PARTDEV}" -a "${PARTFS}" != "ZFS" ] then exit_err "ERROR: The partition ${PARTDEV} does not exist. Failure in bsdlabel?" fi - PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" @@ -186,12 +186,12 @@ mount_all_filesystems() for PART in `ls ${PARTDIR}` do PARTDEV=`echo $PART | sed 's|-|/|g'` - if [ ! -e "${PARTDEV}" ] + PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" + if [ ! -e "${PARTDEV}" -a "${PARTFS}" != "ZFS" ] then exit_err "ERROR: The partition ${PARTDEV} does not exist. Failure in bsdlabel?" fi - PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" Modified: head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Sun Mar 3 23:01:46 2013 (r247734) +++ head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Sun Mar 3 23:07:27 2013 (r247735) @@ -60,18 +60,56 @@ setup_zfs_filesystem() fi done - # Check if we have some custom zpool arguments and use them if so if [ ! -z "${ZPOOLOPTS}" ] ; then - rc_halt "zpool create -m none -f ${ZPOOLNAME} ${ZPOOLOPTS}" + # Sort through devices and run gnop on them + local gnopDev="" + local newOpts="" + for i in $ZPOOLOPTS + do + echo "$i" | grep -q '/dev/' + if [ $? -eq 0 ] ; then + rc_halt "gnop create -S 4096 ${i}" + gnopDev="$gnopDev $i" + newOpts="$newOpts ${i}.nop" + else + newOpts="$newOpts $i" + fi + done + + echo_log "Creating zpool ${ZPOOLNAME} with $newOpts" + rc_halt "zpool create -m none -f ${ZPOOLNAME} ${newOpts}" + + # Export the pool + rc_halt "zpool export ${ZPOOLNAME}" + + # Destroy the gnop devices + for i in $gnopDev + do + rc_halt "gnop destroy ${i}.nop" + done + + # And lastly re-import the pool + rc_halt "zpool import ${ZPOOLNAME}" else + # Lets do our pseudo-4k drive + rc_halt "gnop create -S 4096 ${PART}${EXT}" + # No zpool options, create pool on single device - rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}" + echo_log "Creating zpool ${ZPOOLNAME} on ${PART}${EXT}" + rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}.nop" + + # Finish up the gnop 4k trickery + rc_halt "zpool export ${ZPOOLNAME}" + rc_halt "gnop destroy ${PART}${EXT}.nop" + rc_halt "zpool import ${ZPOOLNAME}" fi # Disable atime for this zfs partition, speed increase rc_nohalt "zfs set atime=off ${ZPOOLNAME}" + + }; # Runs newfs on all the partiions which we've setup with bsdlabel Modified: head/usr.sbin/pc-sysinstall/backend/functions.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions.sh Sun Mar 3 23:01:46 2013 (r247734) +++ head/usr.sbin/pc-sysinstall/backend/functions.sh Sun Mar 3 23:07:27 2013 (r247735) @@ -277,7 +277,11 @@ get_zpool_name() while : do NEWNAME="${BASENAME}${NUM}" - zpool import | grep -qw "${NEWNAME}" || break + zpool list | grep -qw "${NEWNAME}" + local chk1=$? + zpool import | grep -qw "${NEWNAME}" + local chk2=$? + if [ $chk1 -eq 1 -a $chk2 -eq 1 ] ; then break ; fi NUM=$((NUM+1)) done Modified: head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf ============================================================================== --- head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf Sun Mar 3 23:01:46 2013 (r247734) +++ head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf Sun Mar 3 23:07:27 2013 (r247735) @@ -5,11 +5,9 @@ TMPDIR="/tmp/.pc-sysinstall" export TMPDIR -if [ ! -d "${TMPDIR}" ] -then - mkdir -p ${TMPDIR} - chmod 777 ${TMPDIR} -fi +# Create a fresh TMPDIR +if [ -d "${TMPDIR}" -a "$TMPDIR" != '/' ]; then rm -rf ${TMPDIR}; fi +mkdir -p ${TMPDIR} # Set our temp directory for storing partition information PARTDIR="${TMPDIR}/part-info" From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 23:23:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85608CF1; Sun, 3 Mar 2013 23:23:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5AA94E75; Sun, 3 Mar 2013 23:23:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23NNaTT029683; Sun, 3 Mar 2013 23:23:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23NNZY4029680; Sun, 3 Mar 2013 23:23:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201303032323.r23NNZY4029680@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 3 Mar 2013 23:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247736 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 23:23:36 -0000 Author: pjd Date: Sun Mar 3 23:23:35 2013 New Revision: 247736 URL: http://svnweb.freebsd.org/changeset/base/247736 Log: Plug memory leaks in file descriptors passing. Modified: head/sys/kern/kern_descrip.c head/sys/kern/uipc_usrreq.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Mar 3 23:07:27 2013 (r247735) +++ head/sys/kern/kern_descrip.c Sun Mar 3 23:23:35 2013 (r247736) @@ -1397,7 +1397,7 @@ filecaps_copy(const struct filecaps *src /* * Move filecaps structure to the new place and clear the old place. */ -static void +void filecaps_move(struct filecaps *src, struct filecaps *dst) { Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Mar 3 23:07:27 2013 (r247735) +++ head/sys/kern/uipc_usrreq.c Sun Mar 3 23:23:35 2013 (r247736) @@ -1686,6 +1686,7 @@ unp_freerights(struct filedescent *fde, for (i = 0; i < fdcount; i++, fde++) { fp = fde->fde_file; + filecaps_free(&fdep->fde_caps); bzero(fde, sizeof(*fde)); unp_discard(fp); } @@ -1760,7 +1761,7 @@ unp_externalize(struct mbuf *control, st panic("unp_externalize fdalloc failed"); fde = &fdesc->fd_ofiles[f]; fde->fde_file = fdep->fde_file; - filecaps_copy(&fdep->fde_caps, &fde->fde_caps); + filecaps_move(&fdep->fde_caps, &fde->fde_caps); unp_externalize_fp(fde->fde_file); *fdp = f; } Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Sun Mar 3 23:07:27 2013 (r247735) +++ head/sys/sys/filedesc.h Sun Mar 3 23:23:35 2013 (r247736) @@ -136,6 +136,7 @@ struct thread; void filecaps_init(struct filecaps *fcaps); void filecaps_copy(const struct filecaps *src, struct filecaps *dst); +void filecaps_move(struct filecaps *src, struct filecaps *dst); void filecaps_free(struct filecaps *fcaps); int closef(struct file *fp, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 23:25:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 77C94E71; Sun, 3 Mar 2013 23:25:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68C57E84; Sun, 3 Mar 2013 23:25:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23NPkAZ030012; Sun, 3 Mar 2013 23:25:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23NPk50030011; Sun, 3 Mar 2013 23:25:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201303032325.r23NPk50030011@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 3 Mar 2013 23:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247737 - 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 23:25:46 -0000 Author: pjd Date: Sun Mar 3 23:25:45 2013 New Revision: 247737 URL: http://svnweb.freebsd.org/changeset/base/247737 Log: Use dedicated malloc type for filecaps-related data, so we can detect any memory leaks easier. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Mar 3 23:23:35 2013 (r247736) +++ head/sys/kern/kern_descrip.c Sun Mar 3 23:25:45 2013 (r247737) @@ -104,6 +104,7 @@ static MALLOC_DEFINE(M_FILEDESC, "filede static MALLOC_DEFINE(M_FILEDESC_TO_LEADER, "filedesc_to_leader", "file desc to leader structures"); static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures"); +MALLOC_DEFINE(M_FILECAPS, "filecaps", "descriptor capabilities"); MALLOC_DECLARE(M_FADVISE); @@ -1389,7 +1390,7 @@ filecaps_copy(const struct filecaps *src ("fc_ioctls != NULL, but fc_nioctls=%hd", src->fc_nioctls)); size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls; - dst->fc_ioctls = malloc(size, M_TEMP, M_WAITOK); + dst->fc_ioctls = malloc(size, M_FILECAPS, M_WAITOK); bcopy(src->fc_ioctls, dst->fc_ioctls, size); } } @@ -1425,7 +1426,7 @@ void filecaps_free(struct filecaps *fcaps) { - free(fcaps->fc_ioctls, M_TEMP); + free(fcaps->fc_ioctls, M_FILECAPS); bzero(fcaps, sizeof(*fcaps)); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 23:26:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4A6EFE7; Sun, 3 Mar 2013 23:26:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BCDCEE8E; Sun, 3 Mar 2013 23:26:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23NQI6b030151; Sun, 3 Mar 2013 23:26:18 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23NQHrI030145; Sun, 3 Mar 2013 23:26:17 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303032326.r23NQHrI030145@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 3 Mar 2013 23:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247738 - in vendor/libyaml: . dist dist/config dist/doc dist/doc/html dist/include dist/src dist/tests dist/win32 dist/win32/vc6 dist/win32/vs2003 dist/win32/vs2008 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 23:26:18 -0000 Author: bapt Date: Sun Mar 3 23:26:17 2013 New Revision: 247738 URL: http://svnweb.freebsd.org/changeset/base/247738 Log: Import libyaml 0.1.4 into vendor Added: vendor/libyaml/ vendor/libyaml/dist/ vendor/libyaml/dist/LICENSE vendor/libyaml/dist/Makefile.am (contents, props changed) vendor/libyaml/dist/Makefile.in (contents, props changed) vendor/libyaml/dist/README vendor/libyaml/dist/aclocal.m4 vendor/libyaml/dist/config/ vendor/libyaml/dist/config.h.in (contents, props changed) vendor/libyaml/dist/config/config.guess (contents, props changed) vendor/libyaml/dist/config/config.sub (contents, props changed) vendor/libyaml/dist/config/depcomp (contents, props changed) vendor/libyaml/dist/config/install-sh (contents, props changed) vendor/libyaml/dist/config/ltmain.sh (contents, props changed) vendor/libyaml/dist/config/missing (contents, props changed) vendor/libyaml/dist/configure (contents, props changed) vendor/libyaml/dist/configure.ac vendor/libyaml/dist/doc/ vendor/libyaml/dist/doc/doxygen.cfg vendor/libyaml/dist/doc/html/ vendor/libyaml/dist/doc/html/annotated.html (contents, props changed) vendor/libyaml/dist/doc/html/bc_s.png (contents, props changed) vendor/libyaml/dist/doc/html/classes.html (contents, props changed) vendor/libyaml/dist/doc/html/closed.png (contents, props changed) vendor/libyaml/dist/doc/html/doxygen.css (contents, props changed) vendor/libyaml/dist/doc/html/doxygen.png (contents, props changed) vendor/libyaml/dist/doc/html/files.html (contents, props changed) vendor/libyaml/dist/doc/html/functions.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x62.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x63.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x64.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x65.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x66.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x68.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x69.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x6b.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x6c.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x6d.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x6e.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x6f.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x70.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x71.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x72.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x73.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x74.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x75.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x76.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_0x77.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x62.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x63.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x64.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x65.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x66.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x68.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x69.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x6b.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x6c.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x6d.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x6e.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x6f.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x70.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x71.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x72.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x73.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x74.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x75.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x76.html (contents, props changed) vendor/libyaml/dist/doc/html/functions_vars_0x77.html (contents, props changed) vendor/libyaml/dist/doc/html/globals.html (contents, props changed) vendor/libyaml/dist/doc/html/globals_defs.html (contents, props changed) vendor/libyaml/dist/doc/html/globals_enum.html (contents, props changed) vendor/libyaml/dist/doc/html/globals_eval.html (contents, props changed) vendor/libyaml/dist/doc/html/globals_func.html (contents, props changed) vendor/libyaml/dist/doc/html/globals_type.html (contents, props changed) vendor/libyaml/dist/doc/html/group__basic.html (contents, props changed) vendor/libyaml/dist/doc/html/group__emitter.html (contents, props changed) vendor/libyaml/dist/doc/html/group__events.html (contents, props changed) vendor/libyaml/dist/doc/html/group__export.html (contents, props changed) vendor/libyaml/dist/doc/html/group__nodes.html (contents, props changed) vendor/libyaml/dist/doc/html/group__parser.html (contents, props changed) vendor/libyaml/dist/doc/html/group__styles.html (contents, props changed) vendor/libyaml/dist/doc/html/group__tokens.html (contents, props changed) vendor/libyaml/dist/doc/html/group__version.html (contents, props changed) vendor/libyaml/dist/doc/html/index.html (contents, props changed) vendor/libyaml/dist/doc/html/modules.html (contents, props changed) vendor/libyaml/dist/doc/html/nav_f.png (contents, props changed) vendor/libyaml/dist/doc/html/nav_h.png (contents, props changed) vendor/libyaml/dist/doc/html/open.png (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__alias__data__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__document__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__emitter__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__event__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__mark__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__node__pair__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__node__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__parser__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__simple__key__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__tag__directive__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__token__s.html (contents, props changed) vendor/libyaml/dist/doc/html/structyaml__version__directive__s.html (contents, props changed) vendor/libyaml/dist/doc/html/tab_a.png (contents, props changed) vendor/libyaml/dist/doc/html/tab_b.png (contents, props changed) vendor/libyaml/dist/doc/html/tab_h.png (contents, props changed) vendor/libyaml/dist/doc/html/tab_s.png (contents, props changed) vendor/libyaml/dist/doc/html/tabs.css (contents, props changed) vendor/libyaml/dist/doc/html/yaml_8h.html (contents, props changed) vendor/libyaml/dist/include/ vendor/libyaml/dist/include/Makefile.am (contents, props changed) vendor/libyaml/dist/include/Makefile.in (contents, props changed) vendor/libyaml/dist/include/yaml.h (contents, props changed) vendor/libyaml/dist/src/ vendor/libyaml/dist/src/Makefile.am (contents, props changed) vendor/libyaml/dist/src/Makefile.in (contents, props changed) vendor/libyaml/dist/src/api.c (contents, props changed) vendor/libyaml/dist/src/dumper.c (contents, props changed) vendor/libyaml/dist/src/emitter.c (contents, props changed) vendor/libyaml/dist/src/loader.c (contents, props changed) vendor/libyaml/dist/src/parser.c (contents, props changed) vendor/libyaml/dist/src/reader.c (contents, props changed) vendor/libyaml/dist/src/scanner.c (contents, props changed) vendor/libyaml/dist/src/writer.c (contents, props changed) vendor/libyaml/dist/src/yaml_private.h (contents, props changed) vendor/libyaml/dist/tests/ vendor/libyaml/dist/tests/Makefile.am (contents, props changed) vendor/libyaml/dist/tests/Makefile.in (contents, props changed) vendor/libyaml/dist/tests/example-deconstructor-alt.c (contents, props changed) vendor/libyaml/dist/tests/example-deconstructor.c (contents, props changed) vendor/libyaml/dist/tests/example-reformatter-alt.c (contents, props changed) vendor/libyaml/dist/tests/example-reformatter.c (contents, props changed) vendor/libyaml/dist/tests/run-dumper.c (contents, props changed) vendor/libyaml/dist/tests/run-emitter.c (contents, props changed) vendor/libyaml/dist/tests/run-loader.c (contents, props changed) vendor/libyaml/dist/tests/run-parser.c (contents, props changed) vendor/libyaml/dist/tests/run-scanner.c (contents, props changed) vendor/libyaml/dist/tests/test-reader.c (contents, props changed) vendor/libyaml/dist/tests/test-version.c (contents, props changed) vendor/libyaml/dist/win32/ vendor/libyaml/dist/win32/Makefile.am (contents, props changed) vendor/libyaml/dist/win32/Makefile.in (contents, props changed) vendor/libyaml/dist/win32/config.h (contents, props changed) vendor/libyaml/dist/win32/vc6/ vendor/libyaml/dist/win32/vc6/example_deconstructor.dsp vendor/libyaml/dist/win32/vc6/example_deconstructor_alt.dsp vendor/libyaml/dist/win32/vc6/example_reformatter.dsp vendor/libyaml/dist/win32/vc6/example_reformatter_alt.dsp vendor/libyaml/dist/win32/vc6/libyaml.dsw vendor/libyaml/dist/win32/vc6/run_dumper.dsp vendor/libyaml/dist/win32/vc6/run_emitter.dsp vendor/libyaml/dist/win32/vc6/run_loader.dsp vendor/libyaml/dist/win32/vc6/run_parser.dsp vendor/libyaml/dist/win32/vc6/run_scanner.dsp vendor/libyaml/dist/win32/vc6/test_reader.dsp vendor/libyaml/dist/win32/vc6/test_version.dsp vendor/libyaml/dist/win32/vc6/yaml.dsp vendor/libyaml/dist/win32/vc6/yamldll.dsp vendor/libyaml/dist/win32/vs2003/ vendor/libyaml/dist/win32/vs2003/example_deconstructor.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/example_deconstructor_alt.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/example_reformatter.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/example_reformatter_alt.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/libyaml.sln vendor/libyaml/dist/win32/vs2003/run_dumper.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/run_emitter.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/run_loader.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/run_parser.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/run_scanner.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/test_reader.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/test_version.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/yaml.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2003/yamldll.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/ vendor/libyaml/dist/win32/vs2008/example_deconstructor.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/example_deconstructor_alt.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/example_reformatter.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/example_reformatter_alt.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/libyaml.sln vendor/libyaml/dist/win32/vs2008/run_dumper.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/run_emitter.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/run_loader.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/run_parser.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/run_scanner.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/test_reader.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/test_version.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/yaml.vcproj (contents, props changed) vendor/libyaml/dist/win32/vs2008/yamldll.vcproj (contents, props changed) vendor/libyaml/dist/yaml-0.1.pc.in (contents, props changed) Added: vendor/libyaml/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libyaml/dist/LICENSE Sun Mar 3 23:26:17 2013 (r247738) @@ -0,0 +1,19 @@ +Copyright (c) 2006 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. Added: vendor/libyaml/dist/Makefile.am ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libyaml/dist/Makefile.am Sun Mar 3 23:26:17 2013 (r247738) @@ -0,0 +1,18 @@ +## Run `./bootstrap` to generate the "Makefile.in" files in this directory and +## the "$SUBDIRS" subdirectories. + +SUBDIRS = include src . tests win32 + +EXTRA_DIST = README LICENSE doc/doxygen.cfg + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = yaml-0.1.pc + +maintainer-clean-local: + -rm -f aclocal.m4 config.h.in configure config/* + -find ${builddir} -name Makefile.in -exec rm -f '{}' ';' + +.PHONY: bootstrap +bootstrap: maintainer-clean + ./bootstrap + Added: vendor/libyaml/dist/Makefile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libyaml/dist/Makefile.in Sun Mar 3 23:26:17 2013 (r247738) @@ -0,0 +1,782 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/yaml-0.1.pc.in $(top_srcdir)/configure \ + config/config.guess config/config.sub config/depcomp \ + config/install-sh config/ltmain.sh config/missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = yaml-0.1.pc +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +YAML_LT_AGE = @YAML_LT_AGE@ +YAML_LT_CURRENT = @YAML_LT_CURRENT@ +YAML_LT_RELEASE = @YAML_LT_RELEASE@ +YAML_LT_REVISION = @YAML_LT_REVISION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = include src . tests win32 +EXTRA_DIST = README LICENSE doc/doxygen.cfg +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = yaml-0.1.pc +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +yaml-0.1.pc: $(top_builddir)/config.status $(srcdir)/yaml-0.1.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-local mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-pkgconfigDATA + + +maintainer-clean-local: + -rm -f aclocal.m4 config.h.in configure config/* + -find ${builddir} -name Makefile.in -exec rm -f '{}' ';' + +.PHONY: bootstrap +bootstrap: maintainer-clean + ./bootstrap + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: vendor/libyaml/dist/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libyaml/dist/README Sun Mar 3 23:26:17 2013 (r247738) @@ -0,0 +1,27 @@ +LibYAML - A C library for parsing and emitting YAML. + +To build and install the library, run: +$ ./configure +$ make +# make install + +If you checked the source code from the Subversion repository, run +$ ./bootstrap +$ ./configure +$ make +# make install + +For more information, check the LibYAML homepage: +'http://pyyaml.org/wiki/LibYAML'. + +Post your questions and opinions to the YAML-Core mailing list: +'http://lists.sourceforge.net/lists/listinfo/yaml-core'. + +Submit bug reports and feature requests to the LibYAML bug tracker: +'http://pyyaml.org/newticket?component=libyaml'. + +LibYAML is written by Kirill Simonov . It is released +under the MIT license. See the file LICENSE for more details. + +This project is developed for Python Software Foundation as a part of +Google Summer of Code under the mentorship of Clark Evans. Added: vendor/libyaml/dist/aclocal.m4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libyaml/dist/aclocal.m4 Sun Mar 3 23:26:17 2013 (r247738) @@ -0,0 +1,8917 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 23:27:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 638041DE; Sun, 3 Mar 2013 23:27:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2713EE9A; Sun, 3 Mar 2013 23:27:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23NRMeb030321; Sun, 3 Mar 2013 23:27:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23NRMgr030320; Sun, 3 Mar 2013 23:27:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303032327.r23NRMgr030320@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 3 Mar 2013 23:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247739 - vendor/libyaml/0.1.4 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 23:27:22 -0000 Author: bapt Date: Sun Mar 3 23:27:21 2013 New Revision: 247739 URL: http://svnweb.freebsd.org/changeset/base/247739 Log: Tag libyaml 0.1.4 Added: vendor/libyaml/0.1.4/ - copied from r247738, vendor/libyaml/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Mar 3 23:39:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E5434E1; Sun, 3 Mar 2013 23:39:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 65B66EE5; Sun, 3 Mar 2013 23:39:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23NdUbh033512; Sun, 3 Mar 2013 23:39:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23NdUxm033511; Sun, 3 Mar 2013 23:39:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201303032339.r23NdUxm033511@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 3 Mar 2013 23:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247740 - 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.14 Precedence: list List-Id: "SVN commit messages 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 Mar 2013 23:39:31 -0000 Author: pjd Date: Sun Mar 3 23:39:30 2013 New Revision: 247740 URL: http://svnweb.freebsd.org/changeset/base/247740 Log: For some reason when I started to pass filedescent structures instead of pointers to the file structure receiving descriptors stopped to work when also at least few kilobytes of data is being send. In the kernel the soreceive_generic() function doesn't see control mbuf as the first mbuf and unp_externalize() is never called, first 6(?) kilobytes of data is missing as well on receiving end. This breaks for example tmux. I don't know yet why going from 8 bytes to sizeof(struct filedescent) per descriptor (or even to 16 bytes per descriptor) breaks things, but to work-around it for now use 8 bytes per file descriptor at the cost of memory allocation. Reported by: flo, Diane Bruce, Jan Beich Simple testcase provided by: mjg Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Mar 3 23:27:21 2013 (r247739) +++ head/sys/kern/uipc_usrreq.c Sun Mar 3 23:39:30 2013 (r247740) @@ -102,6 +102,8 @@ __FBSDID("$FreeBSD$"); #include +MALLOC_DECLARE(M_FILECAPS); + /* * Locking key: * (l) Locked using list lock @@ -282,7 +284,7 @@ static void unp_drop(struct unpcb *, int static void unp_gc(__unused void *, int); static void unp_scan(struct mbuf *, void (*)(struct file *)); static void unp_discard(struct file *); -static void unp_freerights(struct filedescent *, int); +static void unp_freerights(struct filedescent **, int); static void unp_init(void); static int unp_internalize(struct mbuf **, struct thread *); static void unp_internalize_fp(struct file *); @@ -1679,17 +1681,17 @@ unp_drop(struct unpcb *unp, int errno) } static void -unp_freerights(struct filedescent *fde, int fdcount) +unp_freerights(struct filedescent **fdep, int fdcount) { struct file *fp; int i; - for (i = 0; i < fdcount; i++, fde++) { - fp = fde->fde_file; - filecaps_free(&fdep->fde_caps); - bzero(fde, sizeof(*fde)); + for (i = 0; i < fdcount; i++) { + fp = fdep[i]->fde_file; + filecaps_free(&fdep[i]->fde_caps); unp_discard(fp); } + free(fdep[0], M_FILECAPS); } static int @@ -1700,7 +1702,7 @@ unp_externalize(struct mbuf *control, st int i; int *fdp; struct filedesc *fdesc = td->td_proc->p_fd; - struct filedescent *fde, *fdep; + struct filedescent *fde, **fdep; void *data; socklen_t clen = control->m_len, datalen; int error, newfds; @@ -1756,16 +1758,18 @@ unp_externalize(struct mbuf *control, st fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); - for (i = 0; i < newfds; i++, fdep++, fdp++) { + for (i = 0; i < newfds; i++, fdp++) { if (fdalloc(td, 0, &f)) panic("unp_externalize fdalloc failed"); fde = &fdesc->fd_ofiles[f]; - fde->fde_file = fdep->fde_file; - filecaps_move(&fdep->fde_caps, &fde->fde_caps); + fde->fde_file = fdep[0]->fde_file; + filecaps_move(&fdep[0]->fde_caps, + &fde->fde_caps); unp_externalize_fp(fde->fde_file); *fdp = f; } FILEDESC_XUNLOCK(fdesc); + free(fdep[0], M_FILECAPS); } else { /* We can just copy anything else across. */ if (error || controlp == NULL) @@ -1840,7 +1844,7 @@ unp_internalize(struct mbuf **controlp, struct bintime *bt; struct cmsghdr *cm = mtod(control, struct cmsghdr *); struct cmsgcred *cmcred; - struct filedescent *fde, *fdep; + struct filedescent *fde, **fdep, *fdev; struct file *fp; struct timeval *tv; int i, fd, *fdp; @@ -1914,7 +1918,7 @@ unp_internalize(struct mbuf **controlp, * Now replace the integer FDs with pointers to the * file structure and capability rights. */ - newlen = oldfds * sizeof(*fdep); + newlen = oldfds * sizeof(fdep[0]); *controlp = sbcreatecontrol(NULL, newlen, SCM_RIGHTS, SOL_SOCKET); if (*controlp == NULL) { @@ -1923,13 +1927,17 @@ unp_internalize(struct mbuf **controlp, goto out; } fdp = data; - fdep = (struct filedescent *) + fdep = (struct filedescent **) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); - for (i = 0; i < oldfds; i++, fdep++, fdp++) { + fdev = malloc(sizeof(*fdev) * oldfds, M_FILECAPS, + M_WAITOK); + for (i = 0; i < oldfds; i++, fdev++, fdp++) { fde = &fdesc->fd_ofiles[*fdp]; - fdep->fde_file = fde->fde_file; - filecaps_copy(&fde->fde_caps, &fdep->fde_caps); - unp_internalize_fp(fdep->fde_file); + fdep[i] = fdev; + fdep[i]->fde_file = fde->fde_file; + filecaps_copy(&fde->fde_caps, + &fdep[i]->fde_caps); + unp_internalize_fp(fdep[i]->fde_file); } FILEDESC_SUNLOCK(fdesc); break; @@ -2291,7 +2299,7 @@ static void unp_scan(struct mbuf *m0, void (*op)(struct file *)) { struct mbuf *m; - struct filedescent *fdep; + struct filedescent **fdep; struct cmsghdr *cm; void *data; int i; @@ -2318,8 +2326,8 @@ unp_scan(struct mbuf *m0, void (*op)(str cm->cmsg_type == SCM_RIGHTS) { qfds = datalen / sizeof(*fdep); fdep = data; - for (i = 0; i < qfds; i++, fdep++) - (*op)(fdep->fde_file); + for (i = 0; i < qfds; i++) + (*op)(fdep[i]->fde_file); } if (CMSG_SPACE(datalen) < clen) { From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 01:14:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C629B588; Mon, 4 Mar 2013 01:14:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 879B61D4; Mon, 4 Mar 2013 01:14:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r241E6B1063605; Mon, 4 Mar 2013 01:14:06 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r241E6LF063604; Mon, 4 Mar 2013 01:14:06 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303040114.r241E6LF063604@svn.freebsd.org> From: Devin Teske Date: Mon, 4 Mar 2013 01:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247745 - stable/8/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 01:14:07 -0000 Author: dteske Date: Mon Mar 4 01:14:06 2013 New Revision: 247745 URL: http://svnweb.freebsd.org/changeset/base/247745 Log: MFC r230005: Use a reasonable-sized buffer when formatting error messages about installing zoneinfo. While we're in the vicinity, add some missing error checking to eliminate an unhelpful error message when unlink() fails. /me is embarrassed by the quality of his 16-year-old code. The whole thing is awful and could stand a complete rewrite. PR: 164038 Submitted by: Devin Teske (but implemented differently) Modified: stable/8/usr.sbin/tzsetup/tzsetup.c Modified: stable/8/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 00:21:38 2013 (r247744) +++ stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:14:06 2013 (r247745) @@ -56,6 +56,13 @@ __FBSDID("$FreeBSD$"); #define _PATH_DB "/var/db/zoneinfo" #define _PATH_WALL_CMOS_CLOCK "/etc/wall_cmos_clock" +#ifdef PATH_MAX +#define SILLY_BUFFER_SIZE 2*PATH_MAX +#else +#warning "Somebody needs to fix this to dynamically size this buffer." +#define SILLY_BUFFER_SIZE 2048 +#endif + static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; @@ -523,7 +530,7 @@ static int install_zoneinfo_file(const char *zoneinfo_file) { char buf[1024]; - char title[64], prompt[64]; + char title[64], prompt[SILLY_BUFFER_SIZE]; struct stat sb; ssize_t len; int fd1, fd2, copymode; @@ -594,7 +601,18 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } - unlink(path_localtime); + if (unlink(path_localtime) < 0 && errno != ENOENT) { + snprintf(prompt, sizeof(prompt), + "Could not unlink %s: %s", + path_localtime, strerror(errno)); + if (usedialog) { + snprintf(title, sizeof(title), "Error"); + dialog_msgbox(title, prompt, 8, 72, 1); + } else + fprintf(stderr, "%s\n", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + fd2 = open(path_localtime, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IRGRP | S_IROTH); if (fd2 < 0) { @@ -640,7 +658,17 @@ install_zoneinfo_file(const char *zonein fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } - unlink(path_localtime); + if (unlink(path_localtime) < 0 && errno != ENOENT) { + snprintf(prompt, sizeof(prompt), + "Could not unlink %s: %s", + path_localtime, strerror(errno)); + if (usedialog) { + snprintf(title, sizeof(title), "Error"); + dialog_msgbox(title, prompt, 8, 72, 1); + } else + fprintf(stderr, "%s\n", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } if (symlink(zoneinfo_file, path_localtime) < 0) { snprintf(title, sizeof(title), "Error"); snprintf(prompt, sizeof(prompt), From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 01:22:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 41E2F738; Mon, 4 Mar 2013 01:22:08 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 172A7206; Mon, 4 Mar 2013 01:22:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r241M7Kw066295; Mon, 4 Mar 2013 01:22:07 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r241M76U066294; Mon, 4 Mar 2013 01:22:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303040122.r241M76U066294@svn.freebsd.org> From: Devin Teske Date: Mon, 4 Mar 2013 01:22:07 +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: r247746 - stable/8/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 01:22:08 -0000 Author: dteske Date: Mon Mar 4 01:22:07 2013 New Revision: 247746 URL: http://svnweb.freebsd.org/changeset/base/247746 Log: MFC only the whitespace changes* from r227934: Port to new libdialog. * In other words, no changes to dialog; whitespace changes only. Modified: stable/8/usr.sbin/tzsetup/tzsetup.c Modified: stable/8/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:14:06 2013 (r247745) +++ stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:22:07 2013 (r247746) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #endif static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], - path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], + path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; static int reallydoit = 1; @@ -105,7 +105,7 @@ static struct continent_names { { "Europe", &europe }, { "Indian", &indian }, { "Pacific", &pacific }, - { "UTC", &utc } + { "UTC", &utc } }; static struct continent_items { @@ -141,7 +141,7 @@ continent_country_menu(dialogMenuItem *c int rv; if (strcmp(continent->title, "UTC") == 0) - return set_zone_utc(); + return set_zone_utc(); /* Short cut -- if there's only one country, don't post a menu. */ if (contp->nitems == 1) @@ -273,7 +273,7 @@ add_zone_to_country(int lineno, const ch if (tlc[0] < 'A' || tlc[0] > 'Z' || tlc[1] < 'A' || tlc[1] > 'Z') errx(1, "%s:%d: country code `%s' invalid", path_zonetab, lineno, tlc); - + cp = &countries[CODE2INT(tlc)]; if (cp->name == 0) errx(1, "%s:%d: country code `%s' unknown", path_zonetab, @@ -287,7 +287,7 @@ add_zone_to_country(int lineno, const ch zp = malloc(sizeof(*zp)); if (zp == 0) errx(1, "malloc(%zu)", sizeof(*zp)); - + if (cp->nzones == 0) TAILQ_INIT(&cp->zones); @@ -522,7 +522,7 @@ set_zone_utc(void) { if (!confirm_zone(NULL)) return (DITEM_FAILURE | DITEM_RECREATE); - + return (install_zoneinfo_file(NULL)); } @@ -586,7 +586,7 @@ install_zoneinfo_file(const char *zonein } return (DITEM_LEAVE_MENU); } - + if (copymode) { fd1 = open(zoneinfo_file, O_RDONLY, 0); if (fd1 < 0) { @@ -729,7 +729,7 @@ confirm_zone(const char *filename) time_t t = time(0); struct tm *tm; int rv; - + setenv("TZ", filename == NULL ? "" : filename, 1); tzset(); tm = localtime(&t); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 01:32:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 48A168DC; Mon, 4 Mar 2013 01:32:25 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DBBA231; Mon, 4 Mar 2013 01:32:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r241WO0I069253; Mon, 4 Mar 2013 01:32:25 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r241WOOv069252; Mon, 4 Mar 2013 01:32:24 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303040132.r241WOOv069252@svn.freebsd.org> From: Devin Teske Date: Mon, 4 Mar 2013 01:32:24 +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: r247747 - stable/8/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 01:32:25 -0000 Author: dteske Date: Mon Mar 4 01:32:24 2013 New Revision: 247747 URL: http://svnweb.freebsd.org/changeset/base/247747 Log: MFC r230299: Fix #ifdef VERBOSE for UTC case Update verbose output to match what actually happens when selecting the UTC option, and when the -n option is used. Patch updated slightly for new libdialog. PR: bin/164042 Submitted by: dteske Modified: stable/8/usr.sbin/tzsetup/tzsetup.c Modified: stable/8/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:22:07 2013 (r247746) +++ stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:32:24 2013 (r247747) @@ -544,16 +544,19 @@ install_zoneinfo_file(const char *zonein copymode = 1; #ifdef VERBOSE - if (copymode) + snprintf(title, sizeof(title), "Info"); + if (zoneinfo_file == NULL) + snprintf(prompt, sizeof(prompt), + "Removing %s", path_localtime); + else if (copymode) snprintf(prompt, sizeof(prompt), "Copying %s to %s", zoneinfo_file, path_localtime); else snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", - path_localtime, - zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file); + path_localtime, zoneinfo_file); if (usedialog) - dialog_notify(prompt); + dialog_mesgbox(title, prompt, 8, 72); else fprintf(stderr, "%s\n", prompt); #endif @@ -584,6 +587,10 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } +#ifdef VERBOSE + snprintf(prompt, sizeof(prompt), + "Removed %s", path_localtime); +#endif return (DITEM_LEAVE_MENU); } @@ -682,23 +689,23 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } } - } #ifdef VERBOSE - snprintf(title, sizeof(title), "Done"); - if (copymode) - snprintf(prompt, sizeof(prompt), - "Copied timezone file from %s to %s", zoneinfo_file, - path_localtime); - else - snprintf(prompt, sizeof(prompt), - "Created symbolic link from %s to %s", zoneinfo_file, - path_localtime); - if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); - else - fprintf(stderr, "%s\n", prompt); + snprintf(title, sizeof(title), "Done"); + if (copymode) + snprintf(prompt, sizeof(prompt), + "Copied timezone file from %s to %s", + zoneinfo_file, path_localtime); + else + snprintf(prompt, sizeof(prompt), + "Created symbolic link from %s to %s", + zoneinfo_file, path_localtime); + if (usedialog) + dialog_mesgbox(title, prompt, 8, 72); + else + fprintf(stderr, "%s\n", prompt); #endif + } /* reallydoit */ return (DITEM_LEAVE_MENU); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 01:35:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 33BF2A5A; Mon, 4 Mar 2013 01:35:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1BB16241; Mon, 4 Mar 2013 01:35:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r241Zuhm069769; Mon, 4 Mar 2013 01:35:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r241Zu77069768; Mon, 4 Mar 2013 01:35:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303040135.r241Zu77069768@svn.freebsd.org> From: Devin Teske Date: Mon, 4 Mar 2013 01:35:56 +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: r247748 - stable/8/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 01:35:57 -0000 Author: dteske Date: Mon Mar 4 01:35:56 2013 New Revision: 247748 URL: http://svnweb.freebsd.org/changeset/base/247748 Log: MFC r230296: Don't write /var/db/zoneinfo when zone is not actually changed. If the specified zone file does not exist or the -n flag is specified, do not update /var/db/zoneinfo. PR: bin/164039 Submitted by: dteske Modified: stable/8/usr.sbin/tzsetup/tzsetup.c Modified: stable/8/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:32:24 2013 (r247747) +++ stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:35:56 2013 (r247748) @@ -721,9 +721,11 @@ install_zoneinfo(const char *zoneinfo) rv = install_zoneinfo_file(path_zoneinfo_file); /* Save knowledge for later */ - if ((f = fopen(path_db, "w")) != NULL) { - fprintf(f, "%s\n", zoneinfo); - fclose(f); + if (reallydoit && (rv & DITEM_FAILURE) == 0) { + if ((f = fopen(path_db, "w")) != NULL) { + fprintf(f, "%s\n", zoneinfo); + fclose(f); + } } return (rv); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 01:47:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1CA09CA2; Mon, 4 Mar 2013 01:47:38 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D135827F; Mon, 4 Mar 2013 01:47:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r241lbZR072878; Mon, 4 Mar 2013 01:47:37 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r241lb3L072877; Mon, 4 Mar 2013 01:47:37 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303040147.r241lb3L072877@svn.freebsd.org> From: Devin Teske Date: Mon, 4 Mar 2013 01:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247749 - stable/8/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 01:47:38 -0000 Author: dteske Date: Mon Mar 4 01:47:37 2013 New Revision: 247749 URL: http://svnweb.freebsd.org/changeset/base/247749 Log: MFC r230520: Clean up reinstall option and remove duplicate code - Move the reinstall logic to be before menus are initialised (menus are not needed when reinstalling a zonefile). - Remove unnecessary re-initialization of path_db. - Update variable name and error message because we now use the zone name relative to /usr/share/zoneinfo, not the full path. pr: bin/164041 Submitted by: dteske Modified: stable/8/usr.sbin/tzsetup/tzsetup.c Modified: stable/8/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:35:56 2013 (r247748) +++ stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 01:47:37 2013 (r247749) @@ -842,32 +842,16 @@ main(int argc, char **argv) /* Override the user-supplied umask. */ (void)umask(S_IWGRP | S_IWOTH); - read_iso3166_table(); - read_zones(); - sort_countries(); - make_menus(); - if (reinstall == 1) { FILE *f; - char zonefile[MAXPATHLEN]; - char path_db[MAXPATHLEN]; - - zonefile[0] = '\0'; - path_db[0] = '\0'; - if (chrootenv != NULL) { - sprintf(zonefile, "%s/", chrootenv); - sprintf(path_db, "%s/", chrootenv); - } - strcat(zonefile, _PATH_ZONEINFO); - strcat(zonefile, "/"); - strcat(path_db, _PATH_DB); + char zoneinfo[MAXPATHLEN]; if ((f = fopen(path_db, "r")) != NULL) { - if (fgets(zonefile, sizeof(zonefile), f) != NULL) { - zonefile[sizeof(zonefile) - 1] = 0; - if (strlen(zonefile) > 0) { - zonefile[strlen(zonefile) - 1] = 0; - rv = install_zoneinfo(zonefile); + if (fgets(zoneinfo, sizeof(zoneinfo), f) != NULL) { + zoneinfo[sizeof(zoneinfo) - 1] = 0; + if (strlen(zoneinfo) > 0) { + zoneinfo[strlen(zoneinfo) - 1] = 0; + rv = install_zoneinfo(zoneinfo); exit(rv & ~DITEM_LEAVE_MENU); } errx(1, "Error reading %s.\n", path_db); @@ -875,7 +859,7 @@ main(int argc, char **argv) fclose(f); errx(1, "Unable to determine earlier installed zoneinfo " - "file. Check %s", path_db); + "name. Check %s", path_db); } errx(1, "Cannot open %s for reading. Does it exist?", path_db); } @@ -895,6 +879,11 @@ main(int argc, char **argv) /* FALLTHROUGH */ } + read_iso3166_table(); + read_zones(); + sort_countries(); + make_menus(); + init_dialog(); if (skiputc == 0) { snprintf(title, sizeof(title), From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:19:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C34077B; Mon, 4 Mar 2013 02:19:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F91C380; Mon, 4 Mar 2013 02:19:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242JuLj082930; Mon, 4 Mar 2013 02:19:56 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242JuAX082928; Mon, 4 Mar 2013 02:19:56 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040219.r242JuAX082928@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247751 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:19:56 -0000 Author: eadler Date: Mon Mar 4 02:19:55 2013 New Revision: 247751 URL: http://svnweb.freebsd.org/changeset/base/247751 Log: Constify where possible. Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.cc head/sbin/devd/devd.hh Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 4 01:56:00 2013 (r247750) +++ head/sbin/devd/devd.cc Mon Mar 4 02:19:55 2013 (r247751) @@ -653,7 +653,7 @@ config::expand_string(const char *src, c } bool -config::chop_var(char *&buffer, char *&lhs, char *&rhs) +config::chop_var(char *&buffer, char *&lhs, char *&rhs) const { char *walker; Modified: head/sbin/devd/devd.hh ============================================================================== --- head/sbin/devd/devd.hh Mon Mar 4 01:56:00 2013 (r247750) +++ head/sbin/devd/devd.hh Mon Mar 4 02:19:55 2013 (r247751) @@ -172,7 +172,7 @@ protected: void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); bool is_id_char(char) const; - bool chop_var(char *&buffer, char *&lhs, char *&rhs); + bool chop_var(char *&buffer, char *&lhs, char *&rhs) const; private: std::vector _dir_list; std::string _pidfile; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0F26A90B; Mon, 4 Mar 2013 02:21:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F2157391; Mon, 4 Mar 2013 02:21:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242L3xS084753; Mon, 4 Mar 2013 02:21:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242L3uo084752; Mon, 4 Mar 2013 02:21:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242L3uo084752@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247752 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:04 -0000 Author: eadler Date: Mon Mar 4 02:21:03 2013 New Revision: 247752 URL: http://svnweb.freebsd.org/changeset/base/247752 Log: Due to calendar(1)'s abuse of the C preprocessor "unix" gets expanded to "1". 'Fix' this. PR: bin/175790 Submitted by: ak Approved by: cperciva (mentor) Modified: head/usr.bin/calendar/calendars/calendar.birthday Modified: head/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.birthday Mon Mar 4 02:19:55 2013 (r247751) +++ head/usr.bin/calendar/calendars/calendar.birthday Mon Mar 4 02:21:03 2013 (r247752) @@ -6,6 +6,7 @@ #ifndef _calendar_birthday_ #define _calendar_birthday_ +#undef unix 01/01 J.D. Salinger born, 1919 01/01 Paul Revere born in Boston, 1735 From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD7F690C; Mon, 4 Mar 2013 02:21:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6AAA392; Mon, 4 Mar 2013 02:21:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242L6T0084792; Mon, 4 Mar 2013 02:21:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242L65q084791; Mon, 4 Mar 2013 02:21:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242L65q084791@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247753 - head/usr.bin/hexdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:06 -0000 Author: eadler Date: Mon Mar 4 02:21:06 2013 New Revision: 247753 URL: http://svnweb.freebsd.org/changeset/base/247753 Log: Fix typo ('1' != 'l') PR: bin/175975 Submitted by: William Ahern Approved by: cperciva (mentor) Modified: head/usr.bin/hexdump/conv.c Modified: head/usr.bin/hexdump/conv.c ============================================================================== --- head/usr.bin/hexdump/conv.c Mon Mar 4 02:21:03 2013 (r247752) +++ head/usr.bin/hexdump/conv.c Mon Mar 4 02:21:06 2013 (r247753) @@ -151,7 +151,7 @@ conv_u(PR *pr, u_char *p) static char const * list[] = { "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "lf", "vt", "ff", "cr", "so", "si", - "dle", "dcl", "dc2", "dc3", "dc4", "nak", "syn", "etb", + "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc", "fs", "gs", "rs", "us", }; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3DD7690D; Mon, 4 Mar 2013 02:21:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1AE42393; Mon, 4 Mar 2013 02:21:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242L8HG084829; Mon, 4 Mar 2013 02:21:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242L81G084828; Mon, 4 Mar 2013 02:21:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242L81G084828@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247754 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:09 -0000 Author: eadler Date: Mon Mar 4 02:21:08 2013 New Revision: 247754 URL: http://svnweb.freebsd.org/changeset/base/247754 Log: devd: Use volatile sig_atomic_t for the flag set by a signal handler. Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 4 02:21:06 2013 (r247753) +++ head/sbin/devd/devd.cc Mon Mar 4 02:21:08 2013 (r247754) @@ -116,7 +116,7 @@ static struct pidfh *pfh; int Dflag; int dflag; int nflag; -int romeo_must_die = 0; +static volatile sig_atomic_t romeo_must_die = 0; static const char *configfile = CF; @@ -1076,7 +1076,7 @@ set_variable(const char *var, const char static void gensighand(int) { - romeo_must_die++; + romeo_must_die = 1; _exit(0); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC34FA62; Mon, 4 Mar 2013 02:21:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0231397; Mon, 4 Mar 2013 02:21:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LCRm084872; Mon, 4 Mar 2013 02:21:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LCNk084871; Mon, 4 Mar 2013 02:21:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LCNk084871@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247755 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:13 -0000 Author: eadler Date: Mon Mar 4 02:21:12 2013 New Revision: 247755 URL: http://svnweb.freebsd.org/changeset/base/247755 Log: devd: Remove call to _exit() from signal handler, which also sets a stop flag. Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 4 02:21:08 2013 (r247754) +++ head/sbin/devd/devd.cc Mon Mar 4 02:21:12 2013 (r247755) @@ -1077,7 +1077,6 @@ static void gensighand(int) { romeo_must_die = 1; - _exit(0); } static void From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 60A7EB6C; Mon, 4 Mar 2013 02:21:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3004398; Mon, 4 Mar 2013 02:21:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LFf2084911; Mon, 4 Mar 2013 02:21:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LFrL084910; Mon, 4 Mar 2013 02:21:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LFrL084910@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247756 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:17 -0000 Author: eadler Date: Mon Mar 4 02:21:15 2013 New Revision: 247756 URL: http://svnweb.freebsd.org/changeset/base/247756 Log: devd: Simplify while (1) { if (x) break; } to while (!x) {}. Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 4 02:21:12 2013 (r247755) +++ head/sbin/devd/devd.cc Mon Mar 4 02:21:15 2013 (r247756) @@ -912,9 +912,7 @@ event_loop(void) server_fd = create_socket(PIPE); accepting = 1; max_fd = max(fd, server_fd) + 1; - while (1) { - if (romeo_must_die) - break; + while (!romeo_must_die) { if (!once && !dflag && !nflag) { // Check to see if we have any events pending. tv.tv_sec = 0; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 20EF6B89; Mon, 4 Mar 2013 02:21:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14EFA39A; Mon, 4 Mar 2013 02:21:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LH79084952; Mon, 4 Mar 2013 02:21:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LHdj084951; Mon, 4 Mar 2013 02:21:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LHdj084951@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247757 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:18 -0000 Author: eadler Date: Mon Mar 4 02:21:17 2013 New Revision: 247757 URL: http://svnweb.freebsd.org/changeset/base/247757 Log: devd: Use the standard constructor of std::string instead of string(""). Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.hh Modified: head/sbin/devd/devd.hh ============================================================================== --- head/sbin/devd/devd.hh Mon Mar 4 02:21:15 2013 (r247756) +++ head/sbin/devd/devd.hh Mon Mar 4 02:21:17 2013 (r247757) @@ -144,7 +144,7 @@ private: class config { public: - config() : _pidfile("") { push_var_table(); } + config() { push_var_table(); } virtual ~config() { reset(); } void add_attach(int, event_proc *); void add_detach(int, event_proc *); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B7B6B8A; Mon, 4 Mar 2013 02:21:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F6313A4; Mon, 4 Mar 2013 02:21:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LKYp084988; Mon, 4 Mar 2013 02:21:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LKGY084987; Mon, 4 Mar 2013 02:21:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LKGY084987@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247758 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:20 -0000 Author: eadler Date: Mon Mar 4 02:21:19 2013 New Revision: 247758 URL: http://svnweb.freebsd.org/changeset/base/247758 Log: devd: Avoid unnecessary temporary objects (and simplify the code) when handling std::string. Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 4 02:21:17 2013 (r247757) +++ head/sbin/devd/devd.cc Mon Mar 4 02:21:19 2013 (r247758) @@ -460,7 +460,7 @@ config::open_pidfile() { pid_t otherpid; - if (_pidfile == "") + if (_pidfile.empty()) return; pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); if (pfh == NULL) { @@ -528,7 +528,7 @@ config::add_notify(int prio, event_proc void config::set_pidfile(const char *fn) { - _pidfile = string(fn); + _pidfile = fn; } void @@ -617,7 +617,7 @@ config::expand_one(const char *&src, str do { buffer.append(src++, 1); } while (is_id_char(*src)); - dst.append(get_variable(buffer.c_str())); + dst.append(get_variable(buffer)); } const string From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7DBCACB8; Mon, 4 Mar 2013 02:21:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C512D3C6; Mon, 4 Mar 2013 02:21:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LMl2085031; Mon, 4 Mar 2013 02:21:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LMs7085030; Mon, 4 Mar 2013 02:21:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LMs7085030@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247759 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:23 -0000 Author: eadler Date: Mon Mar 4 02:21:22 2013 New Revision: 247759 URL: http://svnweb.freebsd.org/changeset/base/247759 Log: devd: Remove empty virtual destructor from class, which has noch subclasses. Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.hh Modified: head/sbin/devd/devd.hh ============================================================================== --- head/sbin/devd/devd.hh Mon Mar 4 02:21:19 2013 (r247758) +++ head/sbin/devd/devd.hh Mon Mar 4 02:21:22 2013 (r247759) @@ -42,7 +42,6 @@ class var_list { public: var_list() {} - virtual ~var_list() {} /** Set a variable in this var list. */ void set_variable(const std::string &var, const std::string &val); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A639CF7; Mon, 4 Mar 2013 02:21:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E8673C8; Mon, 4 Mar 2013 02:21:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LPwv085067; Mon, 4 Mar 2013 02:21:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LO9G085066; Mon, 4 Mar 2013 02:21:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LO9G085066@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247760 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:25 -0000 Author: eadler Date: Mon Mar 4 02:21:24 2013 New Revision: 247760 URL: http://svnweb.freebsd.org/changeset/base/247760 Log: devd: Remove unnecessary empty default constructors. Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.hh Modified: head/sbin/devd/devd.hh ============================================================================== --- head/sbin/devd/devd.hh Mon Mar 4 02:21:22 2013 (r247759) +++ head/sbin/devd/devd.hh Mon Mar 4 02:21:24 2013 (r247760) @@ -41,7 +41,6 @@ class config; class var_list { public: - var_list() {} /** Set a variable in this var list. */ void set_variable(const std::string &var, const std::string &val); @@ -67,7 +66,6 @@ private: struct eps { public: - eps() {} virtual ~eps() {} /** Does this eps match the current config? */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2824DE14; Mon, 4 Mar 2013 02:21:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61D023CB; Mon, 4 Mar 2013 02:21:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LR4K085112; Mon, 4 Mar 2013 02:21:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LRvw085110; Mon, 4 Mar 2013 02:21:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LRvw085110@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247761 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:29 -0000 Author: eadler Date: Mon Mar 4 02:21:26 2013 New Revision: 247761 URL: http://svnweb.freebsd.org/changeset/base/247761 Log: devd: Use string::empty() instea of string::length() == 0. Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 4 02:21:24 2013 (r247760) +++ head/sbin/devd/devd.cc Mon Mar 4 02:21:26 2013 (r247761) @@ -319,7 +319,7 @@ media::do_match(config &c) // the name of interest, first try device-name and fall back // to subsystem if none exists. value = c.get_variable("device-name"); - if (value.length() == 0) + if (value.empty()) value = c.get_variable("subsystem"); if (Dflag) fprintf(stderr, "Testing media type of %s against 0x%x\n", From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ACC6BE1F; Mon, 4 Mar 2013 02:21:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0CCA3CE; Mon, 4 Mar 2013 02:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LTvb085146; Mon, 4 Mar 2013 02:21:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LTbZ085145; Mon, 4 Mar 2013 02:21:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LTbZ085145@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247762 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:29 -0000 Author: eadler Date: Mon Mar 4 02:21:29 2013 New Revision: 247762 URL: http://svnweb.freebsd.org/changeset/base/247762 Log: devd: Use simpler dst += *x instead of str.append(x, 1). Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 4 02:21:26 2013 (r247761) +++ head/sbin/devd/devd.cc Mon Mar 4 02:21:29 2013 (r247762) @@ -585,7 +585,7 @@ config::expand_one(const char *&src, str src++; // $$ -> $ if (*src == '$') { - dst.append(src++, 1); + dst += *src++; return; } @@ -593,7 +593,7 @@ config::expand_one(const char *&src, str // Not sure if I want to support this or not, so for now we just pass // it through. if (*src == '(') { - dst.append("$"); + dst += '$'; count = 1; /* If the string ends before ) is matched , return. */ while (count > 0 && *src) { @@ -601,21 +601,21 @@ config::expand_one(const char *&src, str count--; else if (*src == '(') count++; - dst.append(src++, 1); + dst += *src++; } return; } // ${^A-Za-z] -> $\1 if (!isalpha(*src)) { - dst.append("$"); - dst.append(src++, 1); + dst += '$'; + dst += *src++; return; } // $var -> replace with value do { - buffer.append(src++, 1); + buffer += *src++; } while (is_id_char(*src)); dst.append(get_variable(buffer)); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 976D9F3B; Mon, 4 Mar 2013 02:21:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E94E23D4; Mon, 4 Mar 2013 02:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LV5Z085187; Mon, 4 Mar 2013 02:21:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LVv3085186; Mon, 4 Mar 2013 02:21:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LVv3085186@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247763 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:34 -0000 Author: eadler Date: Mon Mar 4 02:21:31 2013 New Revision: 247763 URL: http://svnweb.freebsd.org/changeset/base/247763 Log: devd: Correct typo in comment. Submitted by: Christoph Mallon Approved by: cperciva (mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Mar 4 02:21:29 2013 (r247762) +++ head/sbin/devd/devd.cc Mon Mar 4 02:21:31 2013 (r247763) @@ -606,7 +606,7 @@ config::expand_one(const char *&src, str return; } - // ${^A-Za-z] -> $\1 + // $[^A-Za-z] -> $\1 if (!isalpha(*src)) { dst += '$'; dst += *src++; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 02:21:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 15365F4B; Mon, 4 Mar 2013 02:21:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 091593D8; Mon, 4 Mar 2013 02:21:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242LYiw085228; Mon, 4 Mar 2013 02:21:34 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242LYAH085225; Mon, 4 Mar 2013 02:21:34 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303040221.r242LYAH085225@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 02:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247764 - in head/sys/compat: linprocfs linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 02:21:35 -0000 Author: eadler Date: Mon Mar 4 02:21:34 2013 New Revision: 247764 URL: http://svnweb.freebsd.org/changeset/base/247764 Log: Remove check for NULL prior to free(9) and m_freem(9). Approved by: cperciva (mentor) Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Mar 4 02:21:31 2013 (r247763) +++ head/sys/compat/linprocfs/linprocfs.c Mon Mar 4 02:21:34 2013 (r247764) @@ -386,8 +386,7 @@ linprocfs_domtab(PFS_FILL_ARGS) sbuf_printf(sb, " 0 0\n"); } mtx_unlock(&mountlist_mtx); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } @@ -447,8 +446,7 @@ linprocfs_dopartitions(PFS_FILL_ARGS) } g_topology_unlock(); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Mar 4 02:21:31 2013 (r247763) +++ head/sys/compat/linux/linux_file.c Mon Mar 4 02:21:34 2013 (r247764) @@ -517,8 +517,7 @@ eof: td->td_retval[0] = nbytes - resid; out: - if (cookies) - free(cookies, M_TEMP); + free(cookies, M_TEMP); VOP_UNLOCK(vp, 0); foffset_unlock(fp, off, 0); Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Mar 4 02:21:31 2013 (r247763) +++ head/sys/compat/linux/linux_socket.c Mon Mar 4 02:21:34 2013 (r247764) @@ -1443,10 +1443,8 @@ out: bad: free(iov, M_IOV); - if (control != NULL) - m_freem(control); - if (linux_cmsg != NULL) - free(linux_cmsg, M_TEMP); + m_freem(control); + free(linux_cmsg, M_TEMP); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 05:46:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EE9E0C7D; Mon, 4 Mar 2013 05:46:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DB044D53; Mon, 4 Mar 2013 05:46:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r245ka83008718; Mon, 4 Mar 2013 05:46:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r245ka9l008710; Mon, 4 Mar 2013 05:46:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201303040546.r245ka9l008710@svn.freebsd.org> From: Hiroki Sato Date: Mon, 4 Mar 2013 05:46:36 +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: r247767 - in stable/9: etc sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 05:46:37 -0000 Author: hrs Date: Mon Mar 4 05:46:35 2013 New Revision: 247767 URL: http://svnweb.freebsd.org/changeset/base/247767 Log: MFC r226775: - Add support for a "!" character in regex matching in devd(8). It inverts the logic (true/false) of the matching. - Add "!usbus[0-9]+" to IFNET ATTACH notification handler in the default devd.conf to prevent rc.d/netif from running when usbus[0-9]+ is attached. Modified: stable/9/etc/devd.conf stable/9/sbin/devd/devd.cc stable/9/sbin/devd/devd.conf.5 stable/9/sbin/devd/devd.hh Directory Properties: stable/9/etc/ (props changed) stable/9/sbin/devd/ (props changed) Modified: stable/9/etc/devd.conf ============================================================================== --- stable/9/etc/devd.conf Mon Mar 4 05:26:09 2013 (r247766) +++ stable/9/etc/devd.conf Mon Mar 4 05:46:35 2013 (r247767) @@ -38,6 +38,7 @@ options { # notify 0 { match "system" "IFNET"; + match "subsystem" "!usbus[0-9]+"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; Modified: stable/9/sbin/devd/devd.cc ============================================================================== --- stable/9/sbin/devd/devd.cc Mon Mar 4 05:26:09 2013 (r247766) +++ stable/9/sbin/devd/devd.cc Mon Mar 4 05:46:35 2013 (r247767) @@ -251,7 +251,14 @@ action::do_action(config &c) match::match(config &c, const char *var, const char *re) : _var(var), _re("^") { - _re.append(c.expand_string(string(re))); + if (!c.expand_string(string(re)).empty() && + c.expand_string(string(re)).at(0) == '!') { + _re.append(c.expand_string(string(re)).substr(1)); + _inv = 1; + } else { + _re.append(c.expand_string(string(re))); + _inv = 0; + } _re.append("$"); regcomp(&_regex, _re.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE); } @@ -268,10 +275,13 @@ match::do_match(config &c) bool retval; if (Dflag) - fprintf(stderr, "Testing %s=%s against %s\n", _var.c_str(), - value.c_str(), _re.c_str()); + fprintf(stderr, "Testing %s=%s against %s, invert=%d\n", + _var.c_str(), value.c_str(), _re.c_str(), _inv); retval = (regexec(&_regex, value.c_str(), 0, NULL, 0) == 0); + if (_inv == 1) + retval = (retval == 0) ? 1 : 0; + return retval; } Modified: stable/9/sbin/devd/devd.conf.5 ============================================================================== --- stable/9/sbin/devd/devd.conf.5 Mon Mar 4 05:26:09 2013 (r247766) +++ stable/9/sbin/devd/devd.conf.5 Mon Mar 4 05:46:35 2013 (r247767) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd March 8, 2009 +.Dd March 4, 2013 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -121,6 +121,10 @@ Creates a regular expression and assigns .Ar regexp-name . The variable is available throughout the rest of the configuration file. +If the string begins with +.Ql \&! , +it matches if the regular expression formed by the rest of the string +does not match. All regular expressions have an implicit .Ql ^$ around them. Modified: stable/9/sbin/devd/devd.hh ============================================================================== --- stable/9/sbin/devd/devd.hh Mon Mar 4 05:26:09 2013 (r247766) +++ stable/9/sbin/devd/devd.hh Mon Mar 4 05:46:35 2013 (r247767) @@ -92,6 +92,7 @@ public: private: std::string _var; std::string _re; + bool _inv; regex_t _regex; }; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 05:46:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 38147DE6; Mon, 4 Mar 2013 05:46:56 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1BDE7D58; Mon, 4 Mar 2013 05:46:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r245ktub008794; Mon, 4 Mar 2013 05:46:56 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r245ktxQ008788; Mon, 4 Mar 2013 05:46:55 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201303040546.r245ktxQ008788@svn.freebsd.org> From: Hiroki Sato Date: Mon, 4 Mar 2013 05:46:55 +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: r247768 - in stable/8: etc sbin/devd 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 05:46:56 -0000 Author: hrs Date: Mon Mar 4 05:46:54 2013 New Revision: 247768 URL: http://svnweb.freebsd.org/changeset/base/247768 Log: MFC r226775: - Add support for a "!" character in regex matching in devd(8). It inverts the logic (true/false) of the matching. - Add "!usbus[0-9]+" to IFNET ATTACH notification handler in the default devd.conf to prevent rc.d/netif from running when usbus[0-9]+ is attached. Modified: stable/8/etc/devd.conf stable/8/sbin/devd/devd.cc stable/8/sbin/devd/devd.conf.5 stable/8/sbin/devd/devd.hh Directory Properties: stable/8/etc/ (props changed) stable/8/sbin/devd/ (props changed) Modified: stable/8/etc/devd.conf ============================================================================== --- stable/8/etc/devd.conf Mon Mar 4 05:46:35 2013 (r247767) +++ stable/8/etc/devd.conf Mon Mar 4 05:46:54 2013 (r247768) @@ -38,6 +38,7 @@ options { # notify 0 { match "system" "IFNET"; + match "subsystem" "!usbus[0-9]+"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Mon Mar 4 05:46:35 2013 (r247767) +++ stable/8/sbin/devd/devd.cc Mon Mar 4 05:46:54 2013 (r247768) @@ -167,7 +167,14 @@ match::match(config &c, const char *var, { string pattern = re; _re = "^"; - _re.append(c.expand_string(string(re))); + if (!c.expand_string(string(re)).empty() && + c.expand_string(string(re)).at(0) == '!') { + _re.append(c.expand_string(string(re)).substr(1)); + _inv = 1; + } else { + _re.append(c.expand_string(string(re))); + _inv = 0; + } _re.append("$"); regcomp(&_regex, _re.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE); } @@ -184,10 +191,13 @@ match::do_match(config &c) bool retval; if (Dflag) - fprintf(stderr, "Testing %s=%s against %s\n", _var.c_str(), - value.c_str(), _re.c_str()); + fprintf(stderr, "Testing %s=%s against %s, invert=%d\n", + _var.c_str(), value.c_str(), _re.c_str(), _inv); retval = (regexec(&_regex, value.c_str(), 0, NULL, 0) == 0); + if (_inv == 1) + retval = (retval == 0) ? 1 : 0; + return retval; } Modified: stable/8/sbin/devd/devd.conf.5 ============================================================================== --- stable/8/sbin/devd/devd.conf.5 Mon Mar 4 05:46:35 2013 (r247767) +++ stable/8/sbin/devd/devd.conf.5 Mon Mar 4 05:46:54 2013 (r247768) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd March 8, 2009 +.Dd March 4, 2013 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -122,6 +122,10 @@ Creates a regular expression and assigns .Ar regexp-name . The variable is available throughout the rest of the configuration file. +If the string begins with +.Ql \&! , +it matches if the regular expression formed by the rest of the string +does not match. All regular expressions have an implicit .Ql ^$ around them. Modified: stable/8/sbin/devd/devd.hh ============================================================================== --- stable/8/sbin/devd/devd.hh Mon Mar 4 05:46:35 2013 (r247767) +++ stable/8/sbin/devd/devd.hh Mon Mar 4 05:46:54 2013 (r247768) @@ -92,6 +92,7 @@ public: private: std::string _var; std::string _re; + bool _inv; regex_t _regex; }; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 07:47:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95D44717; Mon, 4 Mar 2013 07:47:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2B420167; Mon, 4 Mar 2013 07:40:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r247epTJ075347; Mon, 4 Mar 2013 07:40:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r247eoYx075341; Mon, 4 Mar 2013 07:40:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303040740.r247eoYx075341@svn.freebsd.org> From: Adrian Chadd Date: Mon, 4 Mar 2013 07:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247774 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 07:47:00 -0000 Author: adrian Date: Mon Mar 4 07:40:49 2013 New Revision: 247774 URL: http://svnweb.freebsd.org/changeset/base/247774 Log: add a method to set/clear the VMF field in the TX descriptor. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Mar 4 07:25:11 2013 (r247773) +++ head/sys/dev/ath/ath_hal/ah.h Mon Mar 4 07:40:49 2013 (r247774) @@ -1527,11 +1527,13 @@ struct ath_hal { struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, struct ath_desc *); - void __ahdecl(*ah_clr11nAggr)(struct ath_hal *, struct ath_desc *); void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, struct ath_desc *, u_int); + void __ahdecl(*ah_set11nVirtMoreFrag)(struct ath_hal *, + struct ath_desc *, u_int); + HAL_BOOL __ahdecl(*ah_getMibCycleCounts) (struct ath_hal *, HAL_SURVEY_SAMPLE *); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 07:25:11 2013 (r247773) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 07:40:49 2013 (r247774) @@ -409,8 +409,9 @@ extern void ar5416Set11nAggrFirst(struct u_int aggrLen, u_int numDelims); extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds); - extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds); +extern void ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, + struct ath_desc *ds, u_int vmf); extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 07:25:11 2013 (r247773) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 07:40:49 2013 (r247774) @@ -194,6 +194,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_set11nMac2040 = ar5416Set11nMac2040; ah->ah_get11nRxClear = ar5416Get11nRxClear; ah->ah_set11nRxClear = ar5416Set11nRxClear; + ah->ah_set11nVirtMoreFrag = ar5416Set11nVirtualMoreFrag; /* Interrupt functions */ ah->ah_isInterruptPending = ar5416IsInterruptPending; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 07:25:11 2013 (r247773) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 07:40:49 2013 (r247774) @@ -825,6 +825,17 @@ ar5416Clr11nAggr(struct ath_hal *ah, str ads->ds_ctl6 &= ~AR_AggrLen; } +void +ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, struct ath_desc *ds, + u_int vmf) +{ + struct ar5416_desc *ads = AR5416DESC(ds); + if (vmf) + ads->ds_ctl0 |= AR_VirtMoreFrag; + else + ads->ds_ctl0 &= ~AR_VirtMoreFrag; +} + /* * Program the burst duration, with the included BA delta if it's * applicable. Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Mar 4 07:25:11 2013 (r247773) +++ head/sys/dev/ath/if_athvar.h Mon Mar 4 07:40:49 2013 (r247774) @@ -1297,6 +1297,8 @@ void ath_intr(void *); ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) #define ath_hal_clr11n_aggr(_ah, _ds) \ ((*(_ah)->ah_clr11nAggr)((_ah), (_ds))) +#define ath_hal_set11n_virtmorefrag(_ah, _ds, _v) \ + ((*(_ah)->ah_set11nVirtMoreFrag)((_ah), (_ds), (_v))) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 10:41:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A58E7519; Mon, 4 Mar 2013 10:41:54 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99AA7B2B; Mon, 4 Mar 2013 10:41:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24AfshF014573; Mon, 4 Mar 2013 10:41:54 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24Afs5J014572; Mon, 4 Mar 2013 10:41:54 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201303041041.r24Afs5J014572@svn.freebsd.org> From: Olivier Houchard Date: Mon, 4 Mar 2013 10:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247776 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 10:41:54 -0000 Author: cognet Date: Mon Mar 4 10:41:54 2013 New Revision: 247776 URL: http://svnweb.freebsd.org/changeset/base/247776 Log: If we're using a PIPT L2 cache, only merge 2 segments if both the virtual and the physical addreses are contiguous. Submitted by: Thomas Skibo Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Mon Mar 4 09:35:50 2013 (r247775) +++ head/sys/arm/arm/busdma_machdep-v6.c Mon Mar 4 10:41:54 2013 (r247776) @@ -1007,6 +1007,9 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm } else { sl = &map->slist[map->sync_count - 1]; if (map->sync_count == 0 || +#ifdef ARM_L2_PIPT + curaddr != sl->busaddr + sl->datacount || +#endif vaddr != sl->vaddr + sl->datacount) { if (++map->sync_count > dmat->nsegments) goto cleanup; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 11:09:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 536A88FB; Mon, 4 Mar 2013 11:09:58 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37A201019; Mon, 4 Mar 2013 11:09:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24B9weq022399; Mon, 4 Mar 2013 11:09:58 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24B9vbt022388; Mon, 4 Mar 2013 11:09:57 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041109.r24B9vbt022388@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 11:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247777 - in head/sys: conf kern netinet 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:09:58 -0000 Author: davide Date: Mon Mar 4 11:09:56 2013 New Revision: 247777 URL: http://svnweb.freebsd.org/changeset/base/247777 Log: - Make callout(9) tickless, relying on eventtimers(4) as backend for precise time event generation. This greatly improves granularity of callouts which are not anymore constrained to wait next tick to be scheduled. - Extend the callout KPI introducing a set of callout_reset_sbt* functions, which take a sbintime_t as timeout argument. The new KPI also offers a way for consumers to specify precision tolerance they allow, so that callout can coalesce events and reduce number of interrupts as well as potentially avoid scheduling a SWI thread. - Introduce support for dispatching callouts directly from hardware interrupt context, specifying an additional flag. This feature should be used carefully, as long as interrupt context has some limitations (e.g. no sleeping locks can be held). - Enhance mechanisms to gather informations about callwheel, introducing a new sysctl to obtain stats. This change breaks the KBI. struct callout fields has been changed, in particular 'int ticks' (4 bytes) has been replaced with 'sbintime_t' (8 bytes) and another 'sbintime_t' field was added for precision. Together with: mav Reviewed by: attilio, bde, luigi, phk Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo (amd64, sparc64), marius (sparc64), ian (arm), markj (amd64), mav, Fabian Keil Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/kern/kern_tc.c head/sys/kern/kern_timeout.c head/sys/kern/subr_param.c head/sys/netinet/tcp_timer.c head/sys/sys/_callout.h head/sys/sys/callout.h head/sys/sys/systm.h head/sys/sys/time.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Mar 4 10:41:54 2013 (r247776) +++ head/sys/conf/NOTES Mon Mar 4 11:09:56 2013 (r247777) @@ -259,6 +259,8 @@ options SX_NOINLINE # SMP Debugging Options: # +# CALLOUT_PROFILING enables rudimentary profiling of the callwheel data +# structure used as backend in callout(9). # PREEMPTION allows the threads that are in the kernel to be preempted by # higher priority [interrupt] threads. It helps with interactivity # and allows interrupt threads to run sooner rather than waiting. @@ -297,6 +299,9 @@ options LOCK_PROFILING options MPROF_BUFFERS="1536" options MPROF_HASH_SIZE="1543" +# Profiling for the callout(9) backend. +options CALLOUT_PROFILING + # Profiling for internal hash tables. options SLEEPQUEUE_PROFILING options TURNSTILE_PROFILING Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Mar 4 10:41:54 2013 (r247776) +++ head/sys/conf/options Mon Mar 4 11:09:56 2013 (r247777) @@ -68,6 +68,7 @@ TEXTDUMP_VERBOSE opt_ddb.h ADAPTIVE_LOCKMGRS ALQ AUDIT opt_global.h +CALLOUT_PROFILING CAPABILITIES opt_capsicum.h CAPABILITY_MODE opt_capsicum.h COMPAT_43 opt_compat.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon Mar 4 10:41:54 2013 (r247776) +++ head/sys/kern/kern_clock.c Mon Mar 4 11:09:56 2013 (r247777) @@ -460,7 +460,7 @@ hardclock_cpu(int usermode) if (td->td_intr_frame != NULL) PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); #endif - callout_tick(); + callout_process(sbinuptime()); } /* @@ -550,7 +550,6 @@ hardclock_cnt(int cnt, int usermode) if (td->td_intr_frame != NULL) PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); #endif - callout_tick(); /* We are in charge to handle this tick duty. */ if (newticks > 0) { /* Dangerous and no need to call these things concurrently. */ Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Mon Mar 4 10:41:54 2013 (r247776) +++ head/sys/kern/kern_clocksource.c Mon Mar 4 11:09:56 2013 (r247777) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2012 Alexander Motin + * Copyright (c) 2010-2013 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,17 +64,14 @@ int cpu_can_deep_sleep = 0; /* C3 stat int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */ static void setuptimer(void); -static void loadtimer(struct bintime *now, int first); +static void loadtimer(sbintime_t now, int first); static int doconfigtimer(void); static void configtimer(int start); static int round_freq(struct eventtimer *et, int freq); -static void getnextcpuevent(struct bintime *event, int idle); -static void getnextevent(struct bintime *event); -static int handleevents(struct bintime *now, int fake); -#ifdef SMP -static void cpu_new_callout(int cpu, int ticks); -#endif +static sbintime_t getnextcpuevent(int idle); +static sbintime_t getnextevent(void); +static int handleevents(sbintime_t now, int fake); static struct mtx et_hw_mtx; @@ -94,13 +92,11 @@ static struct mtx et_hw_mtx; } static struct eventtimer *timer = NULL; -static struct bintime timerperiod; /* Timer period for periodic mode. */ -static struct bintime hardperiod; /* hardclock() events period. */ -static struct bintime statperiod; /* statclock() events period. */ -static struct bintime profperiod; /* profclock() events period. */ -static struct bintime nexttick; /* Next global timer tick time. */ -static struct bintime nexthard; /* Next global hardlock() event. */ -static u_int busy = 0; /* Reconfiguration is in progress. */ +static sbintime_t timerperiod; /* Timer period for periodic mode. */ +static sbintime_t statperiod; /* statclock() events period. */ +static sbintime_t profperiod; /* profclock() events period. */ +static sbintime_t nexttick; /* Next global timer tick time. */ +static u_int busy = 1; /* Reconfiguration is in progress. */ static int profiling = 0; /* Profiling events enabled. */ static char timername[32]; /* Wanted timer. */ @@ -116,11 +112,6 @@ TUNABLE_INT("kern.eventtimer.idletick", SYSCTL_UINT(_kern_eventtimer, OID_AUTO, idletick, CTLFLAG_RW, &idletick, 0, "Run periodic events when idle"); -static u_int activetick = 1; /* Run all periodic events when active. */ -TUNABLE_INT("kern.eventtimer.activetick", &activetick); -SYSCTL_UINT(_kern_eventtimer, OID_AUTO, activetick, CTLFLAG_RW, &activetick, - 0, "Run all periodic events when active"); - static int periodic = 0; /* Periodic or one-shot mode. */ static int want_periodic = 0; /* What mode to prefer. */ TUNABLE_INT("kern.eventtimer.periodic", &want_periodic); @@ -129,31 +120,23 @@ struct pcpu_state { struct mtx et_hw_mtx; /* Per-CPU timer mutex. */ u_int action; /* Reconfiguration requests. */ u_int handle; /* Immediate handle resuests. */ - struct bintime now; /* Last tick time. */ - struct bintime nextevent; /* Next scheduled event on this CPU. */ - struct bintime nexttick; /* Next timer tick time. */ - struct bintime nexthard; /* Next hardlock() event. */ - struct bintime nextstat; /* Next statclock() event. */ - struct bintime nextprof; /* Next profclock() event. */ + sbintime_t now; /* Last tick time. */ + sbintime_t nextevent; /* Next scheduled event on this CPU. */ + sbintime_t nexttick; /* Next timer tick time. */ + sbintime_t nexthard; /* Next hardlock() event. */ + sbintime_t nextstat; /* Next statclock() event. */ + sbintime_t nextprof; /* Next profclock() event. */ + sbintime_t nextcall; /* Next callout event. */ + sbintime_t nextcallopt; /* Next optional callout event. */ #ifdef KDTRACE_HOOKS - struct bintime nextcyc; /* Next OpenSolaris cyclics event. */ + sbintime_t nextcyc; /* Next OpenSolaris cyclics event. */ #endif int ipi; /* This CPU needs IPI. */ int idle; /* This CPU is in idle mode. */ }; static DPCPU_DEFINE(struct pcpu_state, timerstate); - -#define FREQ2BT(freq, bt) \ -{ \ - (bt)->sec = 0; \ - (bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \ -} -#define BT2FREQ(bt) \ - (((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ - ((bt)->frac >> 1)) - -#define SBT2FREQ(sbt) ((SBT_1S + ((sbt) >> 1)) / (sbt)) +DPCPU_DEFINE(sbintime_t, hardclocktime); /* * Timer broadcast IPI handler. @@ -161,7 +144,7 @@ static DPCPU_DEFINE(struct pcpu_state, t int hardclockintr(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; int done; @@ -169,10 +152,9 @@ hardclockintr(void) return (FILTER_HANDLED); state = DPCPU_PTR(timerstate); now = state->now; - CTR4(KTR_SPARE2, "ipi at %d: now %d.%08x%08x", - curcpu, now.sec, (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); - done = handleevents(&now, 0); + CTR3(KTR_SPARE2, "ipi at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); + done = handleevents(now, 0); return (done ? FILTER_HANDLED : FILTER_STRAY); } @@ -180,48 +162,43 @@ hardclockintr(void) * Handle all events for specified time on this CPU */ static int -handleevents(struct bintime *now, int fake) +handleevents(sbintime_t now, int fake) { - struct bintime t; + sbintime_t t, *hct; struct trapframe *frame; struct pcpu_state *state; - uintfptr_t pc; int usermode; int done, runs; - CTR4(KTR_SPARE2, "handle at %d: now %d.%08x%08x", - curcpu, now->sec, (u_int)(now->frac >> 32), - (u_int)(now->frac & 0xffffffff)); + CTR3(KTR_SPARE2, "handle at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); done = 0; if (fake) { frame = NULL; usermode = 0; - pc = 0; } else { frame = curthread->td_intr_frame; usermode = TRAPF_USERMODE(frame); - pc = TRAPF_PC(frame); } state = DPCPU_PTR(timerstate); runs = 0; - while (bintime_cmp(now, &state->nexthard, >=)) { - bintime_addx(&state->nexthard, hardperiod.frac); + while (now >= state->nexthard) { + state->nexthard += tick_sbt; runs++; } if (runs) { - if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 && - bintime_cmp(&state->nexthard, &nexthard, >)) - nexthard = state->nexthard; + hct = DPCPU_PTR(hardclocktime); + *hct = state->nexthard - tick_sbt; if (fake < 2) { hardclock_cnt(runs, usermode); done = 1; } } runs = 0; - while (bintime_cmp(now, &state->nextstat, >=)) { - bintime_addx(&state->nextstat, statperiod.frac); + while (now >= state->nextstat) { + state->nextstat += statperiod; runs++; } if (runs && fake < 2) { @@ -230,31 +207,29 @@ handleevents(struct bintime *now, int fa } if (profiling) { runs = 0; - while (bintime_cmp(now, &state->nextprof, >=)) { - bintime_addx(&state->nextprof, profperiod.frac); + while (now >= state->nextprof) { + state->nextprof += profperiod; runs++; } if (runs && !fake) { - profclock_cnt(runs, usermode, pc); + profclock_cnt(runs, usermode, TRAPF_PC(frame)); done = 1; } } else state->nextprof = state->nextstat; + if (now >= state->nextcallopt) { + state->nextcall = state->nextcallopt = INT64_MAX; + callout_process(now); + } #ifdef KDTRACE_HOOKS - if (fake == 0 && cyclic_clock_func != NULL && - state->nextcyc.sec != -1 && - bintime_cmp(now, &state->nextcyc, >=)) { - state->nextcyc.sec = -1; + if (fake == 0 && now >= state->nextcyc && cyclic_clock_func != NULL) { + state->nextcyc = INT64_MAX; (*cyclic_clock_func)(frame); } #endif - getnextcpuevent(&t, 0); - if (fake == 2) { - state->nextevent = t; - return (done); - } + t = getnextcpuevent(0); ET_HW_LOCK(state); if (!busy) { state->idle = 0; @@ -268,84 +243,81 @@ handleevents(struct bintime *now, int fa /* * Schedule binuptime of the next event on current CPU. */ -static void -getnextcpuevent(struct bintime *event, int idle) +static sbintime_t +getnextcpuevent(int idle) { - struct bintime tmp; + sbintime_t event; struct pcpu_state *state; - int skip; + u_int hardfreq; state = DPCPU_PTR(timerstate); - /* Handle hardclock() events. */ - *event = state->nexthard; - if (idle || (!activetick && !profiling && - (timer->et_flags & ET_FLAGS_PERCPU) == 0)) { - skip = idle ? 4 : (stathz / 2); - if (curcpu == CPU_FIRST() && tc_min_ticktock_freq > skip) - skip = tc_min_ticktock_freq; - skip = callout_tickstofirst(hz / skip) - 1; - CTR2(KTR_SPARE2, "skip at %d: %d", curcpu, skip); - tmp = hardperiod; - bintime_mul(&tmp, skip); - bintime_add(event, &tmp); - } + /* Handle hardclock() events, skipping some if CPU is idle. */ + event = state->nexthard; + if (idle) { + hardfreq = (u_int)hz / 2; + if (tc_min_ticktock_freq > 2 +#ifdef SMP + && curcpu == CPU_FIRST() +#endif + ) + hardfreq = hz / tc_min_ticktock_freq; + if (hardfreq > 1) + event += tick_sbt * (hardfreq - 1); + } + /* Handle callout events. */ + if (event > state->nextcall) + event = state->nextcall; if (!idle) { /* If CPU is active - handle other types of events. */ - if (bintime_cmp(event, &state->nextstat, >)) - *event = state->nextstat; - if (profiling && bintime_cmp(event, &state->nextprof, >)) - *event = state->nextprof; + if (event > state->nextstat) + event = state->nextstat; + if (profiling && event > state->nextprof) + event = state->nextprof; } #ifdef KDTRACE_HOOKS - if (state->nextcyc.sec != -1 && bintime_cmp(event, &state->nextcyc, >)) - *event = state->nextcyc; + if (event > state->nextcyc) + event = state->nextcyc; #endif + return (event); } /* * Schedule binuptime of the next event on all CPUs. */ -static void -getnextevent(struct bintime *event) +static sbintime_t +getnextevent(void) { struct pcpu_state *state; + sbintime_t event; #ifdef SMP int cpu; #endif - int c, nonidle; + int c; state = DPCPU_PTR(timerstate); - *event = state->nextevent; - c = curcpu; - nonidle = !state->idle; - if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { + event = state->nextevent; + c = -1; #ifdef SMP - if (smp_started) { - CPU_FOREACH(cpu) { - if (curcpu == cpu) - continue; - state = DPCPU_ID_PTR(cpu, timerstate); - nonidle += !state->idle; - if (bintime_cmp(event, &state->nextevent, >)) { - *event = state->nextevent; - c = cpu; - } + if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { + CPU_FOREACH(cpu) { + state = DPCPU_ID_PTR(cpu, timerstate); + if (event > state->nextevent) { + event = state->nextevent; + c = cpu; } } -#endif - if (nonidle != 0 && bintime_cmp(event, &nexthard, >)) - *event = nexthard; } - CTR5(KTR_SPARE2, "next at %d: next %d.%08x%08x by %d", - curcpu, event->sec, (u_int)(event->frac >> 32), - (u_int)(event->frac & 0xffffffff), c); +#endif + CTR4(KTR_SPARE2, "next at %d: next %d.%08x by %d", + curcpu, (int)(event >> 32), (u_int)(event & 0xffffffff), c); + return (event); } /* Hardware timer callback function. */ static void timercb(struct eventtimer *et, void *arg) { - struct bintime now; - struct bintime *next; + sbintime_t now; + sbintime_t *next; struct pcpu_state *state; #ifdef SMP int cpu, bcast; @@ -360,16 +332,14 @@ timercb(struct eventtimer *et, void *arg next = &state->nexttick; } else next = &nexttick; - binuptime(&now); - if (periodic) { - *next = now; - bintime_addx(next, timerperiod.frac); /* Next tick in 1 period. */ - } else - next->sec = -1; /* Next tick is not scheduled yet. */ + now = sbinuptime(); + if (periodic) + *next = now + timerperiod; + else + *next = -1; /* Next tick is not scheduled yet. */ state->now = now; - CTR4(KTR_SPARE2, "intr at %d: now %d.%08x%08x", - curcpu, (int)(now.sec), (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); + CTR3(KTR_SPARE2, "intr at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); #ifdef SMP /* Prepare broadcasting to other CPUs for non-per-CPU timers. */ @@ -379,8 +349,8 @@ timercb(struct eventtimer *et, void *arg state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); state->now = now; - if (bintime_cmp(&now, &state->nextevent, >=)) { - state->nextevent.sec++; + if (now >= state->nextevent) { + state->nextevent += SBT_1S; if (curcpu != cpu) { state->ipi = 1; bcast = 1; @@ -392,7 +362,7 @@ timercb(struct eventtimer *et, void *arg #endif /* Handle events for this time on this CPU. */ - handleevents(&now, 0); + handleevents(now, 0); #ifdef SMP /* Broadcast interrupt to other CPUs for non-per-CPU timers. */ @@ -414,11 +384,11 @@ timercb(struct eventtimer *et, void *arg * Load new value into hardware timer. */ static void -loadtimer(struct bintime *now, int start) +loadtimer(sbintime_t now, int start) { struct pcpu_state *state; - struct bintime new; - struct bintime *next; + sbintime_t new; + sbintime_t *next; uint64_t tmp; int eq; @@ -433,30 +403,24 @@ loadtimer(struct bintime *now, int start * Try to start all periodic timers aligned * to period to make events synchronous. */ - tmp = ((uint64_t)now->sec << 36) + (now->frac >> 28); - tmp = (tmp % (timerperiod.frac >> 28)) << 28; - new.sec = 0; - new.frac = timerperiod.frac - tmp; - if (new.frac < tmp) /* Left less then passed. */ - bintime_addx(&new, timerperiod.frac); + tmp = now % timerperiod; + new = timerperiod - tmp; + if (new < tmp) /* Left less then passed. */ + new += timerperiod; CTR5(KTR_SPARE2, "load p at %d: now %d.%08x first in %d.%08x", - curcpu, now->sec, (u_int)(now->frac >> 32), - new.sec, (u_int)(new.frac >> 32)); - *next = new; - bintime_add(next, now); - et_start(timer, bttosbt(new), bttosbt(timerperiod)); + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff), + (int)(new >> 32), (u_int)(new & 0xffffffff)); + *next = new + now; + et_start(timer, new, timerperiod); } } else { - getnextevent(&new); - eq = bintime_cmp(&new, next, ==); - CTR5(KTR_SPARE2, "load at %d: next %d.%08x%08x eq %d", - curcpu, new.sec, (u_int)(new.frac >> 32), - (u_int)(new.frac & 0xffffffff), - eq); + new = getnextevent(); + eq = (new == *next); + CTR4(KTR_SPARE2, "load at %d: next %d.%08x eq %d", + curcpu, (int)(new >> 32), (u_int)(new & 0xffffffff), eq); if (!eq) { *next = new; - bintime_sub(&new, now); - et_start(timer, bttosbt(new), 0); + et_start(timer, new - now, 0); } } } @@ -478,7 +442,7 @@ setuptimer(void) while (freq < (profiling ? profhz : stathz)) freq += hz; freq = round_freq(timer, freq); - FREQ2BT(freq, &timerperiod); + timerperiod = SBT_1S / freq; } /* @@ -487,15 +451,15 @@ setuptimer(void) static int doconfigtimer(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; state = DPCPU_PTR(timerstate); switch (atomic_load_acq_int(&state->action)) { case 1: - binuptime(&now); + now = sbinuptime(); ET_HW_LOCK(state); - loadtimer(&now, 1); + loadtimer(now, 1); ET_HW_UNLOCK(state); state->handle = 0; atomic_store_rel_int(&state->action, 0); @@ -509,8 +473,8 @@ doconfigtimer(void) return (1); } if (atomic_readandclear_int(&state->handle) && !busy) { - binuptime(&now); - handleevents(&now, 0); + now = sbinuptime(); + handleevents(now, 0); return (1); } return (0); @@ -523,40 +487,45 @@ doconfigtimer(void) static void configtimer(int start) { - struct bintime now, next; + sbintime_t now, next; struct pcpu_state *state; int cpu; if (start) { setuptimer(); - binuptime(&now); - } + now = sbinuptime(); + } else + now = 0; critical_enter(); ET_HW_LOCK(DPCPU_PTR(timerstate)); if (start) { /* Initialize time machine parameters. */ - next = now; - bintime_addx(&next, timerperiod.frac); + next = now + timerperiod; if (periodic) nexttick = next; else - nexttick.sec = -1; + nexttick = -1; CPU_FOREACH(cpu) { state = DPCPU_ID_PTR(cpu, timerstate); state->now = now; - state->nextevent = next; + if (!smp_started && cpu != CPU_FIRST()) + state->nextevent = INT64_MAX; + else + state->nextevent = next; if (periodic) state->nexttick = next; else - state->nexttick.sec = -1; + state->nexttick = -1; state->nexthard = next; state->nextstat = next; state->nextprof = next; + state->nextcall = next; + state->nextcallopt = next; hardclock_sync(cpu); } busy = 0; /* Start global timer or per-CPU timer of this CPU. */ - loadtimer(&now, 1); + loadtimer(now, 1); } else { busy = 1; /* Stop global timer or per-CPU timer of this CPU. */ @@ -629,12 +598,11 @@ cpu_initclocks_bsp(void) state = DPCPU_ID_PTR(cpu, timerstate); mtx_init(&state->et_hw_mtx, "et_hw_mtx", NULL, MTX_SPIN); #ifdef KDTRACE_HOOKS - state->nextcyc.sec = -1; + state->nextcyc = INT64_MAX; #endif + state->nextcall = INT64_MAX; + state->nextcallopt = INT64_MAX; } -#ifdef SMP - callout_new_inserted = cpu_new_callout; -#endif periodic = want_periodic; /* Grab requested timer or the best of present. */ if (timername[0]) @@ -698,9 +666,10 @@ cpu_initclocks_bsp(void) profhz = round_freq(timer, stathz * 64); } tick = 1000000 / hz; - FREQ2BT(hz, &hardperiod); - FREQ2BT(stathz, &statperiod); - FREQ2BT(profhz, &profperiod); + tick_sbt = SBT_1S / hz; + tick_bt = sbttobt(tick_sbt); + statperiod = SBT_1S / stathz; + profperiod = SBT_1S / profhz; ET_LOCK(); configtimer(1); ET_UNLOCK(); @@ -712,18 +681,22 @@ cpu_initclocks_bsp(void) void cpu_initclocks_ap(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; + struct thread *td; state = DPCPU_PTR(timerstate); - binuptime(&now); + now = sbinuptime(); ET_HW_LOCK(state); state->now = now; hardclock_sync(curcpu); - handleevents(&state->now, 2); - if (timer->et_flags & ET_FLAGS_PERCPU) - loadtimer(&now, 1); + spinlock_enter(); ET_HW_UNLOCK(state); + td = curthread; + td->td_intr_nesting_level++; + handleevents(state->now, 2); + td->td_intr_nesting_level--; + spinlock_exit(); } /* @@ -772,7 +745,7 @@ cpu_stopprofclock(void) sbintime_t cpu_idleclock(void) { - struct bintime now, t; + sbintime_t now, t; struct pcpu_state *state; if (idletick || busy || @@ -786,19 +759,17 @@ cpu_idleclock(void) if (periodic) now = state->now; else - binuptime(&now); - CTR4(KTR_SPARE2, "idle at %d: now %d.%08x%08x", - curcpu, now.sec, (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); - getnextcpuevent(&t, 1); + now = sbinuptime(); + CTR3(KTR_SPARE2, "idle at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); + t = getnextcpuevent(1); ET_HW_LOCK(state); state->idle = 1; state->nextevent = t; if (!periodic) - loadtimer(&now, 0); + loadtimer(now, 0); ET_HW_UNLOCK(state); - bintime_sub(&t, &now); - return (MAX(bttosbt(t), 0)); + return (MAX(t - now, 0)); } /* @@ -807,7 +778,7 @@ cpu_idleclock(void) void cpu_activeclock(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; struct thread *td; @@ -817,101 +788,98 @@ cpu_activeclock(void) if (periodic) now = state->now; else - binuptime(&now); - CTR4(KTR_SPARE2, "active at %d: now %d.%08x%08x", - curcpu, now.sec, (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); + now = sbinuptime(); + CTR3(KTR_SPARE2, "active at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); spinlock_enter(); td = curthread; td->td_intr_nesting_level++; - handleevents(&now, 1); + handleevents(now, 1); td->td_intr_nesting_level--; spinlock_exit(); } #ifdef KDTRACE_HOOKS void -clocksource_cyc_set(const struct bintime *t) +clocksource_cyc_set(const struct bintime *bt) { - struct bintime now; + sbintime_t now, t; struct pcpu_state *state; + /* Do not touch anything if somebody reconfiguring timers. */ + if (busy) + return; + t = bttosbt(*bt); state = DPCPU_PTR(timerstate); if (periodic) now = state->now; else - binuptime(&now); + now = sbinuptime(); - CTR4(KTR_SPARE2, "set_cyc at %d: now %d.%08x%08x", - curcpu, now.sec, (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); - CTR4(KTR_SPARE2, "set_cyc at %d: t %d.%08x%08x", - curcpu, t->sec, (u_int)(t->frac >> 32), - (u_int)(t->frac & 0xffffffff)); + CTR5(KTR_SPARE2, "set_cyc at %d: now %d.%08x t %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff), + (int)(t >> 32), (u_int)(t & 0xffffffff)); ET_HW_LOCK(state); - if (bintime_cmp(t, &state->nextcyc, ==)) { - ET_HW_UNLOCK(state); - return; - } - state->nextcyc = *t; - if (bintime_cmp(&state->nextcyc, &state->nextevent, >=)) { - ET_HW_UNLOCK(state); - return; - } - state->nextevent = state->nextcyc; + if (t == state->nextcyc) + goto done; + state->nextcyc = t; + if (t >= state->nextevent) + goto done; + state->nextevent = t; if (!periodic) - loadtimer(&now, 0); + loadtimer(now, 0); +done: ET_HW_UNLOCK(state); } #endif -#ifdef SMP -static void -cpu_new_callout(int cpu, int ticks) +void +cpu_new_callout(int cpu, sbintime_t bt, sbintime_t bt_opt) { - struct bintime tmp; struct pcpu_state *state; - CTR3(KTR_SPARE2, "new co at %d: on %d in %d", - curcpu, cpu, ticks); + /* Do not touch anything if somebody reconfiguring timers. */ + if (busy) + return; + CTR6(KTR_SPARE2, "new co at %d: on %d at %d.%08x - %d.%08x", + curcpu, cpu, (int)(bt_opt >> 32), (u_int)(bt_opt & 0xffffffff), + (int)(bt >> 32), (u_int)(bt & 0xffffffff)); state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); - if (state->idle == 0 || busy) { - ET_HW_UNLOCK(state); - return; - } + /* - * If timer is periodic - just update next event time for target CPU. - * If timer is global - there is chance it is already programmed. + * If there is callout time already set earlier -- do nothing. + * This check may appear redundant because we check already in + * callout_process() but this double check guarantees we're safe + * with respect to race conditions between interrupts execution + * and scheduling. */ - if (periodic || (timer->et_flags & ET_FLAGS_PERCPU) == 0) { - tmp = hardperiod; - bintime_mul(&tmp, ticks - 1); - bintime_add(&tmp, &state->nexthard); - if (bintime_cmp(&tmp, &state->nextevent, <)) - state->nextevent = tmp; - if (periodic || - bintime_cmp(&state->nextevent, &nexttick, >=)) { - ET_HW_UNLOCK(state); - return; - } + state->nextcallopt = bt_opt; + if (bt >= state->nextcall) + goto done; + state->nextcall = bt; + /* If there is some other event set earlier -- do nothing. */ + if (bt >= state->nextevent) + goto done; + state->nextevent = bt; + /* If timer is periodic -- there is nothing to reprogram. */ + if (periodic) + goto done; + /* If timer is global or of the current CPU -- reprogram it. */ + if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || cpu == curcpu) { + loadtimer(sbinuptime(), 0); +done: + ET_HW_UNLOCK(state); + return; } - /* - * Otherwise we have to wake that CPU up, as we can't get present - * bintime to reprogram global timer from here. If timer is per-CPU, - * we by definition can't do it from here. - */ + /* Otherwise make other CPU to reprogram it. */ + state->handle = 1; ET_HW_UNLOCK(state); - if (timer->et_flags & ET_FLAGS_PERCPU) { - state->handle = 1; - ipi_cpu(cpu, IPI_HARDCLOCK); - } else { - if (!cpu_idle_wakeup(cpu)) - ipi_cpu(cpu, IPI_AST); - } -} +#ifdef SMP + ipi_cpu(cpu, IPI_HARDCLOCK); #endif +} /* * Report or change the active event timers hardware. Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon Mar 4 10:41:54 2013 (r247776) +++ head/sys/kern/kern_tc.c Mon Mar 4 11:09:56 2013 (r247777) @@ -22,6 +22,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef FFCLOCK #include #include @@ -119,6 +120,21 @@ static int timestepwarnings; SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, ×tepwarnings, 0, "Log time steps"); +struct bintime bt_timethreshold; +struct bintime bt_tickthreshold; +sbintime_t sbt_timethreshold; +sbintime_t sbt_tickthreshold; +struct bintime tc_tick_bt; +sbintime_t tc_tick_sbt; +int tc_precexp; +int tc_timepercentage = TC_DEFAULTPERC; +TUNABLE_INT("kern.timecounter.alloweddeviation", &tc_timepercentage); +static int sysctl_kern_timecounter_adjprecision(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_kern_timecounter, OID_AUTO, alloweddeviation, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_kern_timecounter_adjprecision, "I", + "Allowed time interval deviation in percents"); + static void tc_windup(void); static void cpu_tick_calibrate(int); @@ -1746,10 +1762,47 @@ tc_ticktock(int cnt) tc_windup(); } +static void __inline +tc_adjprecision(void) +{ + int t; + + if (tc_timepercentage > 0) { + t = (99 + tc_timepercentage) / tc_timepercentage; + tc_precexp = fls(t + (t >> 1)) - 1; + FREQ2BT(hz / tc_tick, &bt_timethreshold); + FREQ2BT(hz, &bt_tickthreshold); + bintime_shift(&bt_timethreshold, tc_precexp); + bintime_shift(&bt_tickthreshold, tc_precexp); + } else { + tc_precexp = 31; + bt_timethreshold.sec = INT_MAX; + bt_timethreshold.frac = ~(uint64_t)0; + bt_tickthreshold = bt_timethreshold; + } + sbt_timethreshold = bttosbt(bt_timethreshold); + sbt_tickthreshold = bttosbt(bt_tickthreshold); +} + +static int +sysctl_kern_timecounter_adjprecision(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = tc_timepercentage; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + tc_timepercentage = val; + tc_adjprecision(); + return (0); +} + static void inittimecounter(void *dummy) { u_int p; + int tick_rate; /* * Set the initial timeout to @@ -1763,6 +1816,12 @@ inittimecounter(void *dummy) tc_tick = (hz + 500) / 1000; else tc_tick = 1; + tc_adjprecision(); + FREQ2BT(hz, &tick_bt); + tick_sbt = bttosbt(tick_bt); + tick_rate = hz / tc_tick; + FREQ2BT(tick_rate, &tc_tick_bt); + tc_tick_sbt = bttosbt(tc_tick_bt); p = (tc_tick * 1000000) / hz; printf("Timecounters tick every %d.%03u msec\n", p / 1000, p % 1000); Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Mar 4 10:41:54 2013 (r247776) +++ head/sys/kern/kern_timeout.c Mon Mar 4 11:09:56 2013 (r247777) @@ -37,7 +37,11 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_callout_profiling.h" #include "opt_kdtrace.h" +#if defined(__arm__) +#include "opt_timer.h" +#endif #include #include @@ -59,6 +63,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifndef NO_EVENTTIMERS +DPCPU_DECLARE(sbintime_t, hardclocktime); +#endif + SDT_PROVIDER_DEFINE(callout_execute); SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start, callout-start); SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0, @@ -67,6 +75,7 @@ SDT_PROBE_DEFINE(callout_execute, kernel SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_end, 0, "struct callout *"); +#ifdef CALLOUT_PROFILING static int avg_depth; SYSCTL_INT(_debug, OID_AUTO, to_avg_depth, CTLFLAG_RD, &avg_depth, 0, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 11:22:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7E226FA6; Mon, 4 Mar 2013 11:22:20 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F35110F5; Mon, 4 Mar 2013 11:22:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24BMK25027580; Mon, 4 Mar 2013 11:22:20 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24BMJSu027575; Mon, 4 Mar 2013 11:22:19 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041122.r24BMJSu027575@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 11:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247778 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:22:20 -0000 Author: davide Date: Mon Mar 4 11:22:19 2013 New Revision: 247778 URL: http://svnweb.freebsd.org/changeset/base/247778 Log: MFcalloutng (r244355): Make loadavg calculation callout direct. There are several reasons for it: - it is very simple and doesn't worth context switch to SWI; - since SWI is no longer used here, we can remove twelve years old hack, excluding this SWI from from the loadavg statistics; - it fixes problem when eventtimer (HPET) shares interrupt with some other device, and that interrupt thread counted as permanent loadavg of 1; now loadavg accounted before that interrupt thread is scheduled. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, Fabian Keil, markj Modified: head/sys/kern/kern_intr.c head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Mon Mar 4 11:09:56 2013 (r247777) +++ head/sys/kern/kern_intr.c Mon Mar 4 11:22:19 2013 (r247778) @@ -1103,7 +1103,6 @@ int swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler, void *arg, int pri, enum intr_type flags, void **cookiep) { - struct thread *td; struct intr_event *ie; int error; @@ -1125,15 +1124,7 @@ swi_add(struct intr_event **eventp, cons } error = intr_event_add_handler(ie, name, NULL, handler, arg, PI_SWI(pri), flags, cookiep); - if (error) - return (error); - if (pri == SWI_CLOCK) { - td = ie->ie_thread->it_thread; - thread_lock(td); - td->td_flags |= TDF_NOLOAD; - thread_unlock(td); - } - return (0); + return (error); } /* Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Mon Mar 4 11:09:56 2013 (r247777) +++ head/sys/kern/kern_synch.c Mon Mar 4 11:22:19 2013 (r247778) @@ -560,8 +560,9 @@ loadav(void *arg) * random variation to avoid synchronisation with processes that * run at regular intervals. */ - callout_reset(&loadav_callout, hz * 4 + (int)(random() % (hz * 2 + 1)), - loadav, NULL); + callout_reset_sbt(&loadav_callout, + tick_sbt * (hz * 4 + (int)(random() % (hz * 2 + 1))), 0, + loadav, NULL, C_DIRECT_EXEC | C_HARDCLOCK); } /* ARGSUSED */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 11:27:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A46220E; Mon, 4 Mar 2013 11:27:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D82EB112F; Mon, 4 Mar 2013 11:27:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24BRgiU028301; Mon, 4 Mar 2013 11:27:42 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24BRfdZ028293; Mon, 4 Mar 2013 11:27:41 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303041127.r24BRfdZ028293@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 4 Mar 2013 11:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247779 - in head: contrib/libyaml lib lib/libyaml share/mk tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:27:43 -0000 Author: bapt Date: Mon Mar 4 11:27:41 2013 New Revision: 247779 URL: http://svnweb.freebsd.org/changeset/base/247779 Log: Import libyaml as libbsdyml (private brand name) LibYAML is a YAML 1.1 parser and emitter under MIT license which will soon be used by the pkg boostrap (usr.bin/pkg) and bhyve Reviewed by: roberto, antoine Added: head/contrib/libyaml/ - copied from r247775, vendor/libyaml/dist/ head/lib/libyaml/ head/lib/libyaml/Makefile (contents, props changed) head/lib/libyaml/config.h (contents, props changed) Modified: head/lib/Makefile head/share/mk/bsd.libnames.mk head/tools/make_libdeps.sh Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Mar 4 11:22:19 2013 (r247778) +++ head/lib/Makefile Mon Mar 4 11:27:41 2013 (r247779) @@ -119,6 +119,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libvmmapi} \ libwrap \ liby \ + libyaml \ libz \ ${_atf} \ ${_bind} \ Added: head/lib/libyaml/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libyaml/Makefile Mon Mar 4 11:27:41 2013 (r247779) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +LIBYAML= ${.CURDIR}/../../contrib/libyaml + +LIB= bsdyml +SHLIB_MAJOR= 0 +INCS= bsdyml.h +SRCS= api.c dumper.c emitter.c loader.c \ + parser.c reader.c scanner.c writer.c + +.PATH: ${LIBYAML}/src ${LIBYAML}/include +CLEANFILES= bsdyml.h + +WARNS?= 1 +CFLAGS+= -I${LIBYAML}/include \ + -I${LIBYAML} \ + -I${.CURDIR} \ + -DHAVE_CONFIG_H + +bsdyml.h: yaml.h + cp -f ${.ALLSRC} ${.TARGET} + +.include Added: head/lib/libyaml/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libyaml/config.h Mon Mar 4 11:27:41 2013 (r247779) @@ -0,0 +1,83 @@ +/* $FreeBSD$ */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "yaml" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component=libyaml" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yaml" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "yaml 0.1.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "yaml" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.1.4" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.1.4" + +/* Define the major version number. */ +#define YAML_VERSION_MAJOR 0 + +/* Define the minor version number. */ +#define YAML_VERSION_MINOR 1 + +/* Define the patch version number. */ +#define YAML_VERSION_PATCH 4 + +/* Define the version string. */ +#define YAML_VERSION_STRING "0.1.4" + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Mon Mar 4 11:22:19 2013 (r247778) +++ head/share/mk/bsd.libnames.mk Mon Mar 4 11:27:41 2013 (r247779) @@ -25,6 +25,7 @@ LIBBIND9?= ${DESTDIR}${LIBDIR}/libbind9. .endif LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a +LIBBSDYML?= ${DESTDIR}${LIBDIR}/libbsdyml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a Modified: head/tools/make_libdeps.sh ============================================================================== --- head/tools/make_libdeps.sh Mon Mar 4 11:22:19 2013 (r247778) +++ head/tools/make_libdeps.sh Mon Mar 4 11:27:41 2013 (r247779) @@ -47,6 +47,7 @@ sed -E -e's; ;! ;g' -e's;$;!;' -e's;-lbsdxml!;lib/libexpat;g' + -e's;-lbsdyml!;lib/libyaml;g' -e's;-lpthread!;lib/libthr;g' -e's;-lm!;lib/msun;g' -e's;-l(ncurses|termcap)!;lib/ncurses/ncurses;g' From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 11:34:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7D4494C3; Mon, 4 Mar 2013 11:34:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A61E1194; Mon, 4 Mar 2013 11:34:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24BYWTq030846; Mon, 4 Mar 2013 11:34:32 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24BYW5K030845; Mon, 4 Mar 2013 11:34:32 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303041134.r24BYW5K030845@svn.freebsd.org> From: Devin Teske Date: Mon, 4 Mar 2013 11:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247780 - head/usr.sbin/tzsetup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:34:32 -0000 Author: dteske Date: Mon Mar 4 11:34:31 2013 New Revision: 247780 URL: http://svnweb.freebsd.org/changeset/base/247780 Log: Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option. PR: bin/164976 Submitted by: dteske Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 11:27:41 2013 (r247779) +++ head/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 11:34:31 2013 (r247780) @@ -703,8 +703,13 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } #ifdef VERBOSE + snprintf(title, sizeof(title), "Done"); snprintf(prompt, sizeof(prompt), "Removed %s", path_localtime); + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else + fprintf(stderr, "%s\n", prompt); #endif return (DITEM_LEAVE_MENU); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 11:40:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 92177905; Mon, 4 Mar 2013 11:40:53 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 855C411FD; Mon, 4 Mar 2013 11:40:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24BerKt033247; Mon, 4 Mar 2013 11:40:53 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24Beq4g033246; Mon, 4 Mar 2013 11:40:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303041140.r24Beq4g033246@svn.freebsd.org> From: Devin Teske Date: Mon, 4 Mar 2013 11:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247781 - stable/9/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:40:53 -0000 Author: dteske Date: Mon Mar 4 11:40:52 2013 New Revision: 247781 URL: http://svnweb.freebsd.org/changeset/base/247781 Log: MFC r247780: Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option. PR: bin/164976 Submitted by: dteske Modified: stable/9/usr.sbin/tzsetup/tzsetup.c Modified: stable/9/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 11:34:31 2013 (r247780) +++ stable/9/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 11:40:52 2013 (r247781) @@ -703,8 +703,13 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } #ifdef VERBOSE + snprintf(title, sizeof(title), "Done"); snprintf(prompt, sizeof(prompt), "Removed %s", path_localtime); + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else + fprintf(stderr, "%s\n", prompt); #endif return (DITEM_LEAVE_MENU); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 11:43:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DE28CA9B; Mon, 4 Mar 2013 11:43:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D1027121A; Mon, 4 Mar 2013 11:43:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24BhLfV033593; Mon, 4 Mar 2013 11:43:21 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24BhLnS033592; Mon, 4 Mar 2013 11:43:21 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303041143.r24BhLnS033592@svn.freebsd.org> From: Devin Teske Date: Mon, 4 Mar 2013 11:43:21 +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: r247782 - stable/8/usr.sbin/tzsetup 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:43:22 -0000 Author: dteske Date: Mon Mar 4 11:43:20 2013 New Revision: 247782 URL: http://svnweb.freebsd.org/changeset/base/247782 Log: MFC r247780: Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option. PR: bin/164976 Submitted by: dteske Modified: stable/8/usr.sbin/tzsetup/tzsetup.c Modified: stable/8/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 11:40:52 2013 (r247781) +++ stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar 4 11:43:20 2013 (r247782) @@ -588,8 +588,13 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } #ifdef VERBOSE + snprintf(title, sizeof(title), "Done"); snprintf(prompt, sizeof(prompt), "Removed %s", path_localtime); + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else + fprintf(stderr, "%s\n", prompt); #endif return (DITEM_LEAVE_MENU); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 11:51:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5FDFCEE5; Mon, 4 Mar 2013 11:51:47 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 300C112B7; Mon, 4 Mar 2013 11:51:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24BplIM036415; Mon, 4 Mar 2013 11:51:47 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24BpkrJ036413; Mon, 4 Mar 2013 11:51:46 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041151.r24BpkrJ036413@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 11:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247783 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:51:47 -0000 Author: davide Date: Mon Mar 4 11:51:46 2013 New Revision: 247783 URL: http://svnweb.freebsd.org/changeset/base/247783 Log: MFcalloutng: Convert sleepqueue(9) bits to the new callout KPI. Take advantage of the possibility to run callback directly from hw interrupt context. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/kern/subr_sleepqueue.c head/sys/sys/sleepqueue.h Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Mon Mar 4 11:43:20 2013 (r247782) +++ head/sys/kern/subr_sleepqueue.c Mon Mar 4 11:51:46 2013 (r247783) @@ -361,7 +361,8 @@ sleepq_add(void *wchan, struct lock_obje * sleep queue after timo ticks if the thread has not already been awakened. */ void -sleepq_set_timeout(void *wchan, int timo) +sleepq_set_timeout_sbt(void *wchan, sbintime_t sbt, sbintime_t pr, + int flags) { struct sleepqueue_chain *sc; struct thread *td; @@ -372,7 +373,8 @@ sleepq_set_timeout(void *wchan, int timo MPASS(TD_ON_SLEEPQ(td)); MPASS(td->td_sleepqueue == NULL); MPASS(wchan != NULL); - callout_reset_curcpu(&td->td_slpcallout, timo, sleepq_timeout, td); + callout_reset_sbt_on(&td->td_slpcallout, sbt, pr, + sleepq_timeout, td, PCPU_GET(cpuid), flags | C_DIRECT_EXEC); } /* Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Mon Mar 4 11:43:20 2013 (r247782) +++ head/sys/sys/sleepqueue.h Mon Mar 4 11:51:46 2013 (r247783) @@ -108,7 +108,10 @@ struct sleepqueue *sleepq_lookup(void *w void sleepq_release(void *wchan); void sleepq_remove(struct thread *td, void *wchan); int sleepq_signal(void *wchan, int flags, int pri, int queue); -void sleepq_set_timeout(void *wchan, int timo); +void sleepq_set_timeout_sbt(void *wchan, sbintime_t sbt, + sbintime_t pr, int flags); +#define sleepq_set_timeout(wchan, timo) \ + sleepq_set_timeout_sbt((wchan), (tick_sbt * (timo)), 0, C_HARDCLOCK) u_int sleepq_sleepcnt(void *wchan, int queue); int sleepq_timedwait(void *wchan, int pri); int sleepq_timedwait_sig(void *wchan, int pri); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 11:55:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A38B8120; Mon, 4 Mar 2013 11:55:32 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB9F12D2; Mon, 4 Mar 2013 11:55:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24BtWnY036982; Mon, 4 Mar 2013 11:55:32 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24BtWF9036981; Mon, 4 Mar 2013 11:55:32 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041155.r24BtWF9036981@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 11:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247784 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:55:32 -0000 Author: davide Date: Mon Mar 4 11:55:32 2013 New Revision: 247784 URL: http://svnweb.freebsd.org/changeset/base/247784 Log: Style fix: remove useless braces. Sorry, my bad. Submitted by: bde Modified: head/sys/sys/sleepqueue.h Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Mon Mar 4 11:51:46 2013 (r247783) +++ head/sys/sys/sleepqueue.h Mon Mar 4 11:55:32 2013 (r247784) @@ -111,7 +111,7 @@ int sleepq_signal(void *wchan, int flags void sleepq_set_timeout_sbt(void *wchan, sbintime_t sbt, sbintime_t pr, int flags); #define sleepq_set_timeout(wchan, timo) \ - sleepq_set_timeout_sbt((wchan), (tick_sbt * (timo)), 0, C_HARDCLOCK) + sleepq_set_timeout_sbt((wchan), tick_sbt * (timo), 0, C_HARDCLOCK) u_int sleepq_sleepcnt(void *wchan, int queue); int sleepq_timedwait(void *wchan, int pri); int sleepq_timedwait_sig(void *wchan, int pri); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 12:20:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF373A29; Mon, 4 Mar 2013 12:20:49 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B242315B3; Mon, 4 Mar 2013 12:20:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24CKn29044636; Mon, 4 Mar 2013 12:20:49 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24CKn1G044424; Mon, 4 Mar 2013 12:20:49 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041220.r24CKn1G044424@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 12:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247785 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 12:20:49 -0000 Author: davide Date: Mon Mar 4 12:20:48 2013 New Revision: 247785 URL: http://svnweb.freebsd.org/changeset/base/247785 Log: MFcalloutng: Extend condvar(9) KPI introducing sbt variant of cv_timedwait. This rely on the previously committed sleepq_set_timeout_sbt(). Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/kern/kern_condvar.c head/sys/sys/condvar.h Modified: head/sys/kern/kern_condvar.c ============================================================================== --- head/sys/kern/kern_condvar.c Mon Mar 4 11:55:32 2013 (r247784) +++ head/sys/kern/kern_condvar.c Mon Mar 4 12:20:48 2013 (r247785) @@ -270,12 +270,13 @@ _cv_wait_sig(struct cv *cvp, struct lock } /* - * Wait on a condition variable for at most timo/hz seconds. Returns 0 if the - * process was resumed by cv_signal or cv_broadcast, EWOULDBLOCK if the timeout - * expires. + * Wait on a condition variable for (at most) the value specified in sbt + * argument. Returns 0 if the process was resumed by cv_signal or cv_broadcast, + * EWOULDBLOCK if the timeout expires. */ int -_cv_timedwait(struct cv *cvp, struct lock_object *lock, int timo) +_cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, + sbintime_t pr, int flags) { WITNESS_SAVE_DECL(lock_witness); struct lock_class *class; @@ -311,7 +312,7 @@ _cv_timedwait(struct cv *cvp, struct loc DROP_GIANT(); sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0); - sleepq_set_timeout(cvp, timo); + sleepq_set_timeout_sbt(cvp, sbt, pr, flags); if (lock != &Giant.lock_object) { if (class->lc_flags & LC_SLEEPABLE) sleepq_release(cvp); @@ -336,13 +337,15 @@ _cv_timedwait(struct cv *cvp, struct loc } /* - * Wait on a condition variable for at most timo/hz seconds, allowing - * interruption by signals. Returns 0 if the thread was resumed by cv_signal - * or cv_broadcast, EWOULDBLOCK if the timeout expires, and EINTR or ERESTART if - * a signal was caught. + * Wait on a condition variable for (at most) the value specified in sbt + * argument, allowing interruption by signals. + * Returns 0 if the thread was resumed by cv_signal or cv_broadcast, + * EWOULDBLOCK if the timeout expires, and EINTR or ERESTART if a signal + * was caught. */ int -_cv_timedwait_sig(struct cv *cvp, struct lock_object *lock, int timo) +_cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, + sbintime_t sbt, sbintime_t pr, int flags) { WITNESS_SAVE_DECL(lock_witness); struct lock_class *class; @@ -379,7 +382,7 @@ _cv_timedwait_sig(struct cv *cvp, struct sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR | SLEEPQ_INTERRUPTIBLE, 0); - sleepq_set_timeout(cvp, timo); + sleepq_set_timeout_sbt(cvp, sbt, pr, flags); if (lock != &Giant.lock_object) { if (class->lc_flags & LC_SLEEPABLE) sleepq_release(cvp); Modified: head/sys/sys/condvar.h ============================================================================== --- head/sys/sys/condvar.h Mon Mar 4 11:55:32 2013 (r247784) +++ head/sys/sys/condvar.h Mon Mar 4 12:20:48 2013 (r247785) @@ -55,8 +55,10 @@ void cv_destroy(struct cv *cvp); void _cv_wait(struct cv *cvp, struct lock_object *lock); void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock); int _cv_wait_sig(struct cv *cvp, struct lock_object *lock); -int _cv_timedwait(struct cv *cvp, struct lock_object *lock, int timo); -int _cv_timedwait_sig(struct cv *cvp, struct lock_object *lock, int timo); +int _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, + sbintime_t sbt, sbintime_t pr, int flags); +int _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, + sbintime_t sbt, sbintime_t pr, int flags); void cv_signal(struct cv *cvp); void cv_broadcastpri(struct cv *cvp, int pri); @@ -68,9 +70,15 @@ void cv_broadcastpri(struct cv *cvp, int #define cv_wait_sig(cvp, lock) \ _cv_wait_sig((cvp), &(lock)->lock_object) #define cv_timedwait(cvp, lock, timo) \ - _cv_timedwait((cvp), &(lock)->lock_object, (timo)) + _cv_timedwait_sbt((cvp), &(lock)->lock_object, \ + tick_sbt * (timo), 0, C_HARDCLOCK) +#define cv_timedwait_sbt(cvp, lock, sbt, pr, flags) \ + _cv_timedwait_sbt((cvp), &(lock)->lock_object, (sbt), (pr), (flags)) #define cv_timedwait_sig(cvp, lock, timo) \ - _cv_timedwait_sig((cvp), &(lock)->lock_object, (timo)) + _cv_timedwait_sig_sbt((cvp), &(lock)->lock_object, \ + tick_sbt * (timo), 0, C_HARDCLOCK) +#define cv_timedwait_sig_sbt(cvp, lock, sbt, pr, flags) \ + _cv_timedwait_sig_sbt((cvp), &(lock)->lock_object, (sbt), (pr), (flags)) #define cv_broadcast(cvp) cv_broadcastpri(cvp, 0) From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 12:48:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6C5EF16B; Mon, 4 Mar 2013 12:48:43 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5085B16B0; Mon, 4 Mar 2013 12:48:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24CmhRI052625; Mon, 4 Mar 2013 12:48:43 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24Cmg2Q052617; Mon, 4 Mar 2013 12:48:42 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041248.r24Cmg2Q052617@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 12:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247787 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 12:48:43 -0000 Author: davide Date: Mon Mar 4 12:48:41 2013 New Revision: 247787 URL: http://svnweb.freebsd.org/changeset/base/247787 Log: MFcalloutng: Introduce sbt variants of msleep(), msleep_spin(), pause(), tsleep() in the KPI, allowing to specify timeout in 'sbintime_t' rather than ticks. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/kern/kern_synch.c head/sys/sys/mutex.h head/sys/sys/rwlock.h head/sys/sys/sx.h head/sys/sys/systm.h Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Mon Mar 4 12:33:40 2013 (r247786) +++ head/sys/kern/kern_synch.c Mon Mar 4 12:48:41 2013 (r247787) @@ -146,12 +146,12 @@ sleepinit(void) */ int _sleep(void *ident, struct lock_object *lock, int priority, - const char *wmesg, int timo) + const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags) { struct thread *td; struct proc *p; struct lock_class *class; - int catch, flags, lock_state, pri, rval; + int catch, lock_state, pri, rval, sleepq_flags; WITNESS_SAVE_DECL(lock_witness); td = curthread; @@ -162,7 +162,7 @@ _sleep(void *ident, struct lock_object * #endif WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Sleeping on \"%s\"", wmesg); - KASSERT(timo != 0 || mtx_owned(&Giant) || lock != NULL, + KASSERT(sbt != 0 || mtx_owned(&Giant) || lock != NULL, ("sleeping without a lock")); KASSERT(p != NULL, ("msleep1")); KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); @@ -199,13 +199,13 @@ _sleep(void *ident, struct lock_object * sleepq_remove(td, td->td_wchan); if (ident == &pause_wchan) - flags = SLEEPQ_PAUSE; + sleepq_flags = SLEEPQ_PAUSE; else - flags = SLEEPQ_SLEEP; + sleepq_flags = SLEEPQ_SLEEP; if (catch) - flags |= SLEEPQ_INTERRUPTIBLE; + sleepq_flags |= SLEEPQ_INTERRUPTIBLE; if (priority & PBDRY) - flags |= SLEEPQ_STOP_ON_BDRY; + sleepq_flags |= SLEEPQ_STOP_ON_BDRY; sleepq_lock(ident); CTR5(KTR_PROC, "sleep: thread %ld (pid %ld, %s) on %s (%p)", @@ -231,18 +231,18 @@ _sleep(void *ident, struct lock_object * * stopped, then td will no longer be on a sleep queue upon * return from cursig(). */ - sleepq_add(ident, lock, wmesg, flags, 0); - if (timo) - sleepq_set_timeout(ident, timo); + sleepq_add(ident, lock, wmesg, sleepq_flags, 0); + if (sbt != 0) + sleepq_set_timeout_sbt(ident, sbt, pr, flags); if (lock != NULL && class->lc_flags & LC_SLEEPABLE) { sleepq_release(ident); WITNESS_SAVE(lock, lock_witness); lock_state = class->lc_unlock(lock); sleepq_lock(ident); } - if (timo && catch) + if (sbt != 0 && catch) rval = sleepq_timedwait_sig(ident, pri); - else if (timo) + else if (sbt != 0) rval = sleepq_timedwait(ident, pri); else if (catch) rval = sleepq_wait_sig(ident, pri); @@ -263,7 +263,8 @@ _sleep(void *ident, struct lock_object * } int -msleep_spin(void *ident, struct mtx *mtx, const char *wmesg, int timo) +msleep_spin_sbt(void *ident, struct mtx *mtx, const char *wmesg, + sbintime_t sbt, sbintime_t pr, int flags) { struct thread *td; struct proc *p; @@ -301,8 +302,8 @@ msleep_spin(void *ident, struct mtx *mtx * We put ourselves on the sleep queue and start our timeout. */ sleepq_add(ident, &mtx->lock_object, wmesg, SLEEPQ_SLEEP, 0); - if (timo) - sleepq_set_timeout(ident, timo); + if (sbt != 0) + sleepq_set_timeout_sbt(ident, sbt, pr, flags); /* * Can't call ktrace with any spin locks held so it can lock the @@ -324,7 +325,7 @@ msleep_spin(void *ident, struct mtx *mtx wmesg); sleepq_lock(ident); #endif - if (timo) + if (sbt != 0) rval = sleepq_timedwait(ident, 0); else { sleepq_wait(ident, 0); @@ -348,28 +349,30 @@ msleep_spin(void *ident, struct mtx *mtx * to a "timo" value of one. */ int -pause(const char *wmesg, int timo) +pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags) { - KASSERT(timo >= 0, ("pause: timo must be >= 0")); + int sbt_sec; + + sbt_sec = sbintime_getsec(sbt); + KASSERT(sbt_sec >= 0, ("pause: timo must be >= 0")); /* silently convert invalid timeouts */ - if (timo < 1) - timo = 1; + if (sbt == 0) + sbt = tick_sbt; if (cold) { /* - * We delay one HZ at a time to avoid overflowing the + * We delay one second at a time to avoid overflowing the * system specific DELAY() function(s): */ - while (timo >= hz) { + while (sbt_sec > 0) { DELAY(1000000); - timo -= hz; + sbt_sec--; } - if (timo > 0) - DELAY(timo * tick); + DELAY((sbt & 0xffffffff) / SBT_1US); return (0); } - return (tsleep(&pause_wchan, 0, wmesg, timo)); + return (_sleep(&pause_wchan, NULL, 0, wmesg, sbt, pr, flags)); } /* Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Mon Mar 4 12:33:40 2013 (r247786) +++ head/sys/sys/mutex.h Mon Mar 4 12:48:41 2013 (r247787) @@ -376,7 +376,8 @@ extern struct mtx_pool *mtxpool_sleep; mtx_assert_((m), (what), __FILE__, __LINE__) #define mtx_sleep(chan, mtx, pri, wmesg, timo) \ - _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (timo)) + _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), \ + tick_sbt * (timo), 0, C_HARDCLOCK) #define mtx_initialized(m) lock_initalized(&(m)->lock_object) Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Mon Mar 4 12:33:40 2013 (r247786) +++ head/sys/sys/rwlock.h Mon Mar 4 12:48:41 2013 (r247787) @@ -211,7 +211,8 @@ void __rw_assert(const volatile uintptr_ rw_runlock(rw); \ } while (0) #define rw_sleep(chan, rw, pri, wmesg, timo) \ - _sleep((chan), &(rw)->lock_object, (pri), (wmesg), (timo)) + _sleep((chan), &(rw)->lock_object, (pri), (wmesg), \ + tick_sbt * (timo), 0, C_HARDCLOCK) #define rw_initialized(rw) lock_initalized(&(rw)->lock_object) Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Mon Mar 4 12:33:40 2013 (r247786) +++ head/sys/sys/sx.h Mon Mar 4 12:48:41 2013 (r247787) @@ -275,7 +275,8 @@ __sx_sunlock(struct sx *sx, const char * #define sx_unlock(sx) sx_unlock_((sx), LOCK_FILE, LOCK_LINE) #define sx_sleep(chan, sx, pri, wmesg, timo) \ - _sleep((chan), &(sx)->lock_object, (pri), (wmesg), (timo)) + _sleep((chan), &(sx)->lock_object, (pri), (wmesg), \ + tick_sbt * (timo), 0, C_HARDCLOCK) /* * Options passed to sx_init_flags(). Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon Mar 4 12:33:40 2013 (r247786) +++ head/sys/sys/systm.h Mon Mar 4 12:48:41 2013 (r247787) @@ -340,14 +340,27 @@ static __inline void splx(intrmask_t ip * less often. */ int _sleep(void *chan, struct lock_object *lock, int pri, const char *wmesg, - int timo) __nonnull(1); + sbintime_t sbt, sbintime_t pr, int flags) __nonnull(1); #define msleep(chan, mtx, pri, wmesg, timo) \ - _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (timo)) -int msleep_spin(void *chan, struct mtx *mtx, const char *wmesg, int timo) - __nonnull(1); -int pause(const char *wmesg, int timo); + _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), \ + tick_sbt * (timo), 0, C_HARDCLOCK) +#define msleep_sbt(chan, mtx, pri, wmesg, bt, pr, flags) \ + _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (bt), (pr), \ + (flags)) +int msleep_spin_sbt(void *chan, struct mtx *mtx, const char *wmesg, + sbintime_t sbt, sbintime_t pr, int flags) __nonnull(1); +#define msleep_spin(chan, mtx, wmesg, timo) \ + msleep_spin_sbt((chan), (mtx), (wmesg), tick_sbt * (timo), \ + 0, C_HARDCLOCK) +int pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, + int flags); +#define pause(wmesg, timo) \ + pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK) #define tsleep(chan, pri, wmesg, timo) \ - _sleep((chan), NULL, (pri), (wmesg), (timo)) + _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \ + 0, C_HARDCLOCK) +#define tsleep_sbt(chan, pri, wmesg, bt, pr, flags) \ + _sleep((chan), NULL, (pri), (wmesg), (bt), (pr), (flags)) void wakeup(void *chan) __nonnull(1); void wakeup_one(void *chan) __nonnull(1); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 13:11:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C1826B6; Mon, 4 Mar 2013 13:11:00 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E57121798; Mon, 4 Mar 2013 13:10:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24DAxD7061142; Mon, 4 Mar 2013 13:10:59 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24DAxau061141; Mon, 4 Mar 2013 13:10:59 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303041310.r24DAxau061141@svn.freebsd.org> From: Attilio Rao Date: Mon, 4 Mar 2013 13:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247788 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:11:00 -0000 Author: attilio Date: Mon Mar 4 13:10:59 2013 New Revision: 247788 URL: http://svnweb.freebsd.org/changeset/base/247788 Log: Merge from vmcontention: As vm objects are type-stable there is no need to initialize the resident splay tree pointer and the cache splay tree pointer in _vm_object_allocate() but this could be done in the init UMA zone handler. The destructor UMA zone handler, will further check if the condition is retained at every destruction and catch for bugs. Sponsored by: EMC / Isilon storage division Submitted by: alc Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Mar 4 12:48:41 2013 (r247787) +++ head/sys/vm/vm_object.c Mon Mar 4 13:10:59 2013 (r247788) @@ -165,8 +165,9 @@ vm_object_zdtor(void *mem, int size, voi object = (vm_object_t)mem; KASSERT(TAILQ_EMPTY(&object->memq), - ("object %p has resident pages", - object)); + ("object %p has resident pages in its memq", object)); + KASSERT(object->root == NULL, + ("object %p has resident pages in its tree", object)); #if VM_NRESERVLEVEL > 0 KASSERT(LIST_EMPTY(&object->rvq), ("object %p has reservations", @@ -197,9 +198,11 @@ vm_object_zinit(void *mem, int size, int mtx_init(&object->mtx, "vm object", NULL, MTX_DEF | MTX_DUPOK); /* These are true for any object that has been freed */ + object->root = NULL; object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; + object->cache = NULL; return (0); } @@ -210,7 +213,6 @@ _vm_object_allocate(objtype_t type, vm_p TAILQ_INIT(&object->memq); LIST_INIT(&object->shadow_head); - object->root = NULL; object->type = type; switch (type) { case OBJT_DEAD: @@ -247,7 +249,6 @@ _vm_object_allocate(objtype_t type, vm_p #if VM_NRESERVLEVEL > 0 LIST_INIT(&object->rvq); #endif - object->cache = NULL; mtx_lock(&vm_object_list_mtx); TAILQ_INSERT_TAIL(&vm_object_list, object, object_list); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 13:57:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9BE869AA; Mon, 4 Mar 2013 13:57:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 78C9419EE; Mon, 4 Mar 2013 13:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24DvkLa073931; Mon, 4 Mar 2013 13:57:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24DvkkM073928; Mon, 4 Mar 2013 13:57:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201303041357.r24DvkkM073928@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Mar 2013 13:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247791 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:57:47 -0000 Author: eadler Date: Mon Mar 4 13:57:46 2013 New Revision: 247791 URL: http://svnweb.freebsd.org/changeset/base/247791 Log: Modernize some portions of the ports man page. Stop documenting other operating systems's default patha Approved by: bcr (mentor) Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Mon Mar 4 13:17:52 2013 (r247790) +++ head/share/man/man7/ports.7 Mon Mar 4 13:57:46 2013 (r247791) @@ -490,27 +490,17 @@ single file .Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact .It Pa /usr/ports The default ports directory -.No ( Fx -and -.Ox ) . -.It Pa /usr/pkgsrc -The default ports directory -.Pq Nx . .It Pa /usr/ports/Mk/bsd.port.mk The big Kahuna. .El .Sh SEE ALSO .Xr make 1 , -.Xr pkg_add 1 , -.Xr pkg_create 1 , -.Xr pkg_delete 1 , -.Xr pkg_info 1 , -.Xr pkg_version 1 +.Xr pkg 8 , +.Xr portsnap 8 .Pp The following are part of the ports collection: .Pp .Xr portaudit 1 , -.Xr portcheckout 1 , .Xr portlint 1 .Rs .%B "The FreeBSD Handbook" From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 14:00:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A8E5DCFC; Mon, 4 Mar 2013 14:00:59 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2E51A1C; Mon, 4 Mar 2013 14:00:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24E0xR9076177; Mon, 4 Mar 2013 14:00:59 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24E0xOo076175; Mon, 4 Mar 2013 14:00:59 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041400.r24E0xOo076175@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 14:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247792 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 14:00:59 -0000 Author: davide Date: Mon Mar 4 14:00:58 2013 New Revision: 247792 URL: http://svnweb.freebsd.org/changeset/base/247792 Log: MFcalloutng (r244249, r244306 by mav): - Switch syscons from timeout() to callout_reset_flags() and specify that precision is not important there -- anything from 20 to 30Hz will be fine. - Reduce syscons "refresh" rate to 1-2Hz when console is in graphics mode and there is nothing to do except some polling for keyboard. Text mode refresh would also be nice to have adaptive, but this change at least should help laptop users who running X. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Mar 4 13:57:46 2013 (r247791) +++ head/sys/dev/syscons/syscons.c Mon Mar 4 14:00:58 2013 (r247792) @@ -506,6 +506,8 @@ sc_attach_unit(int unit, int flags) sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE); sc->config = flags; + callout_init(&sc->ctimeout, 0); + callout_init(&sc->cblink, 0); scp = sc_get_stat(sc->dev[0]); if (sc_console == NULL) /* sc_console_unit < 0 */ sc_console = scp; @@ -1831,13 +1833,11 @@ static void scrn_timer(void *arg) { #ifndef PC98 - static int kbd_interval = 0; + static time_t kbd_time_stamp = 0; #endif - struct timeval tv; sc_softc_t *sc; scr_stat *scp; - int again; - int s; + int again, rate; again = (arg != NULL); if (arg != NULL) @@ -1847,18 +1847,18 @@ scrn_timer(void *arg) else return; + /* find the vty to update */ + scp = sc->cur_scp; + /* don't do anything when we are performing some I/O operations */ - if (suspend_in_progress || sc->font_loading_in_progress) { - if (again) - timeout(scrn_timer, sc, hz / 10); - return; - } - s = spltty(); + if (suspend_in_progress || sc->font_loading_in_progress) + goto done; #ifndef PC98 if ((sc->kbd == NULL) && (sc->config & SC_AUTODETECT_KBD)) { /* try to allocate a keyboard automatically */ - if (++kbd_interval >= 25) { + if (kbd_time_stamp != time_uptime) { + kbd_time_stamp = time_uptime; sc->keyboard = sc_allocate_keyboard(sc, -1); if (sc->keyboard >= 0) { sc->kbd = kbd_get_keyboard(sc->keyboard); @@ -1867,25 +1867,20 @@ scrn_timer(void *arg) update_kbd_state(sc->cur_scp, sc->cur_scp->status, LOCK_MASK); } - kbd_interval = 0; } } #endif /* PC98 */ - /* find the vty to update */ - scp = sc->cur_scp; - /* should we stop the screen saver? */ - getmicrouptime(&tv); if (debugger > 0 || panicstr || shutdown_in_progress) sc_touch_scrn_saver(); if (run_scrn_saver) { - if (tv.tv_sec > sc->scrn_time_stamp + scrn_blank_time) + if (time_uptime > sc->scrn_time_stamp + scrn_blank_time) sc->flags |= SC_SCRN_IDLE; else sc->flags &= ~SC_SCRN_IDLE; } else { - sc->scrn_time_stamp = tv.tv_sec; + sc->scrn_time_stamp = time_uptime; sc->flags &= ~SC_SCRN_IDLE; if (scrn_blank_time > 0) run_scrn_saver = TRUE; @@ -1898,12 +1893,8 @@ scrn_timer(void *arg) /* should we just return ? */ if (sc->blink_in_progress || sc->switch_in_progress - || sc->write_in_progress) { - if (again) - timeout(scrn_timer, sc, hz / 10); - splx(s); - return; - } + || sc->write_in_progress) + goto done; /* Update the screen */ scp = sc->cur_scp; /* cur_scp may have changed... */ @@ -1917,9 +1908,19 @@ scrn_timer(void *arg) (*current_saver)(sc, TRUE); #endif - if (again) - timeout(scrn_timer, sc, hz / 25); - splx(s); +done: + if (again) { + /* + * Use reduced "refresh" rate if we are in graphics and that is not a + * graphical screen saver. In such case we just have nothing to do. + */ + if (ISGRAPHSC(scp) && !(sc->flags & SC_SCRN_BLANKED)) + rate = 2; + else + rate = 30; + callout_reset_sbt(&sc->ctimeout, SBT_1S / rate, 0, + scrn_timer, sc, C_PREL(1)); + } } static int @@ -3863,7 +3864,8 @@ blink_screen(void *arg) (*scp->rndr->draw)(scp, 0, scp->xsize*scp->ysize, scp->sc->blink_in_progress & 1); scp->sc->blink_in_progress--; - timeout(blink_screen, scp, hz / 10); + callout_reset_sbt(&scp->sc->cblink, SBT_1S / 15, 0, + blink_screen, scp, C_PREL(0)); } } Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Mon Mar 4 13:57:46 2013 (r247791) +++ head/sys/dev/syscons/syscons.h Mon Mar 4 14:00:58 2013 (r247792) @@ -269,6 +269,8 @@ typedef struct sc_softc { #ifdef KDB int sc_altbrk; #endif + struct callout ctimeout; + struct callout cblink; } sc_softc_t; /* virtual screen */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 14:50:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ACE3AEED; Mon, 4 Mar 2013 14:50:07 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 5C7931E4C; Mon, 4 Mar 2013 14:50:06 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 91FBC7300A; Mon, 4 Mar 2013 15:42:16 +0100 (CET) Date: Mon, 4 Mar 2013 15:42:16 +0100 From: Luigi Rizzo To: Davide Italiano Subject: Re: svn commit: r247792 - head/sys/dev/syscons Message-ID: <20130304144216.GA63659@onelab2.iet.unipi.it> References: <201303041400.r24E0xOo076175@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201303041400.r24E0xOo076175@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 14:50:07 -0000 On Mon, Mar 04, 2013 at 02:00:59PM +0000, Davide Italiano wrote: > Author: davide > Date: Mon Mar 4 14:00:58 2013 > New Revision: 247792 > URL: http://svnweb.freebsd.org/changeset/base/247792 > > Log: > MFcalloutng (r244249, r244306 by mav): > - Switch syscons from timeout() to callout_reset_flags() and specify that > precision is not important there -- anything from 20 to 30Hz will be fine. > - Reduce syscons "refresh" rate to 1-2Hz when console is in graphics mode > and there is nothing to do except some polling for keyboard. Text mode just to understand, how does this 1-2Hz affect the respose to keypresses ? does it mean it takes 0.5..1s to see the keypress ? cheers luigi From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 14:55:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8EF10185; Mon, 4 Mar 2013 14:55:56 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 5B2E91E85; Mon, 4 Mar 2013 14:55:55 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id fj20so5008472lab.20 for ; Mon, 04 Mar 2013 06:55:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=QhxVr1gwG5YTvBgZfD+wIkmOG/6mBzKzbdujFaQk1Ec=; b=BtR6+vdYdLSsBOTEKyHoHQLwKcGmSyOSFWCNozoiP/7S4uQfxtql4+KywKL4q9vK9n 1uBnQnm7c5nJIkx8S6WNFnIEOG1IRusBC0Y45WOA1IVWKi83MmzHkzACBQtdjPOFJyC9 cw3xVMX4maS3xz7e1kvjMBdaxU/IVwz1cFUQaGrQClV5l6dnnLIsfewHuuAA1RfiSxCa cL5fTwFZD3U4MOPX72B71ndn7fIyOTgam6V2aU6mwdykoSTjwf/8cO/nQQV55AQ/A6+Q Z4OPhv3nedI20wpcT11Zsu0tJ6xyM0RGdFoOBk0HRhsLAhM6QKzXfpMPNdnY4Wg9U3FX Q16w== X-Received: by 10.152.46.12 with SMTP id r12mr18210722lam.15.1362408954358; Mon, 04 Mar 2013 06:55:54 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id b13sm7388208lbd.10.2013.03.04.06.55.51 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Mar 2013 06:55:53 -0800 (PST) Sender: Alexander Motin Message-ID: <5134B5F5.7000204@FreeBSD.org> Date: Mon, 04 Mar 2013 16:55:49 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130125 Thunderbird/17.0.2 MIME-Version: 1.0 To: Luigi Rizzo Subject: Re: svn commit: r247792 - head/sys/dev/syscons References: <201303041400.r24E0xOo076175@svn.freebsd.org> <20130304144216.GA63659@onelab2.iet.unipi.it> In-Reply-To: <20130304144216.GA63659@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Davide Italiano , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 14:55:56 -0000 On 04.03.2013 16:42, Luigi Rizzo wrote: > On Mon, Mar 04, 2013 at 02:00:59PM +0000, Davide Italiano wrote: >> Author: davide >> Date: Mon Mar 4 14:00:58 2013 >> New Revision: 247792 >> URL: http://svnweb.freebsd.org/changeset/base/247792 >> >> Log: >> MFcalloutng (r244249, r244306 by mav): >> - Switch syscons from timeout() to callout_reset_flags() and specify that >> precision is not important there -- anything from 20 to 30Hz will be fine. >> - Reduce syscons "refresh" rate to 1-2Hz when console is in graphics mode >> and there is nothing to do except some polling for keyboard. Text mode > > just to understand, how does this 1-2Hz affect the respose to keypresses ? > does it mean it takes 0.5..1s to see the keypress ? No, it is a polling for keyboard presence, and its rate already limited to 1Hz by comparing kbd_time_stamp to time_uptime there. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 15:03:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D29E63D1; Mon, 4 Mar 2013 15:03:52 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFD361EDE; Mon, 4 Mar 2013 15:03:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24F3qvX094573; Mon, 4 Mar 2013 15:03:52 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24F3qW7094572; Mon, 4 Mar 2013 15:03:52 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041503.r24F3qW7094572@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 15:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247793 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:03:52 -0000 Author: davide Date: Mon Mar 4 15:03:52 2013 New Revision: 247793 URL: http://svnweb.freebsd.org/changeset/base/247793 Log: Fix build with DIAGNOSTIC/CALLOUT_PROFILING options turned on. Reported by: kib, David Wolfskill Pointy-hat to: davide Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Mar 4 14:00:58 2013 (r247792) +++ head/sys/kern/kern_timeout.c Mon Mar 4 15:03:52 2013 (r247793) @@ -601,7 +601,7 @@ softclock_call_cc(struct callout *c, str sbintime_t new_time; #endif #if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) - sbintime_t bt1, bt2; + sbintime_t sbt1, sbt2; struct timespec ts2; static sbintime_t maxdt = 2 * SBT_1MS; /* 2 msec */ static timeout_t *lastfunc; @@ -655,7 +655,7 @@ softclock_call_cc(struct callout *c, str CTR3(KTR_CALLOUT, "callout %p func %p arg %p", c, c_func, c_arg); } -#ifdef DIAGNOSTIC +#if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) sbt1 = sbinuptime(); #endif THREAD_NO_SLEEPING(); @@ -663,17 +663,17 @@ softclock_call_cc(struct callout *c, str c_func(c_arg); SDT_PROBE(callout_execute, kernel, , callout_end, c, 0, 0, 0, 0); THREAD_SLEEPING_OK(); -#ifdef DIAGNOSTIC - bt2 = sbinuptime(); - bt2 -= bt1; - if (bt2 > maxdt) { - if (lastfunc != c_func || bt2 > maxdt * 2) { - ts2 = sbttots(bt2); +#if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) + sbt2 = sbinuptime(); + sbt2 -= sbt1; + if (sbt2 > maxdt) { + if (lastfunc != c_func || sbt2 > maxdt * 2) { + ts2 = sbttots(sbt2); printf( "Expensive timeout(9) function: %p(%p) %jd.%09ld s\n", c_func, c_arg, (intmax_t)ts2.tv_sec, ts2.tv_nsec); } - maxdt = bt2; + maxdt = sbt2; lastfunc = c_func; } #endif From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 15:30:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8A8E7DA9; Mon, 4 Mar 2013 15:30:39 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63CCD118; Mon, 4 Mar 2013 15:30:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24FUd9E001954; Mon, 4 Mar 2013 15:30:39 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24FUdDu001953; Mon, 4 Mar 2013 15:30:39 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201303041530.r24FUdDu001953@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 4 Mar 2013 15:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247794 - stable/9/sys/dev/mxge 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:30:39 -0000 Author: gallatin Date: Mon Mar 4 15:30:38 2013 New Revision: 247794 URL: http://svnweb.freebsd.org/changeset/base/247794 Log: MFC r247159 Improvements for newer mxge nics: - Some mxge nics may store the serial number in the SN2 field of the EEPROM. These will also have an SN=0 field, so parse the SN2 field, and give it precedence. - Skip MXGEFW_CMD_UNALIGNED_TEST on mxge nics which do not require it. This saves roughly 10ms per port at device attach time. Modified: stable/9/sys/dev/mxge/if_mxge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/9/sys/dev/mxge/if_mxge.c Mon Mar 4 15:03:52 2013 (r247793) +++ stable/9/sys/dev/mxge/if_mxge.c Mon Mar 4 15:30:38 2013 (r247794) @@ -290,11 +290,12 @@ mxge_parse_strings(mxge_softc_t *sc) #define MXGE_NEXT_STRING(p) while(ptr < limit && *ptr++) char *ptr, *limit; - int i, found_mac; + int i, found_mac, found_sn2; ptr = sc->eeprom_strings; limit = sc->eeprom_strings + MXGE_EEPROM_STRINGS_SIZE; found_mac = 0; + found_sn2 = 0; while (ptr < limit && *ptr != '\0') { if (memcmp(ptr, "MAC=", 4) == 0) { ptr += 1; @@ -310,10 +311,16 @@ mxge_parse_strings(mxge_softc_t *sc) ptr += 3; strncpy(sc->product_code_string, ptr, sizeof (sc->product_code_string) - 1); - } else if (memcmp(ptr, "SN=", 3) == 0) { + } else if (!found_sn2 && (memcmp(ptr, "SN=", 3) == 0)) { ptr += 3; strncpy(sc->serial_number_string, ptr, sizeof (sc->serial_number_string) - 1); + } else if (memcmp(ptr, "SN2=", 4) == 0) { + /* SN2 takes precedence over SN */ + ptr += 4; + found_sn2 = 1; + strncpy(sc->serial_number_string, ptr, + sizeof (sc->serial_number_string) - 1); } MXGE_NEXT_STRING(ptr); } @@ -580,9 +587,10 @@ mxge_firmware_probe(mxge_softc_t *sc) /* * Run a DMA test which watches for unaligned completions and - * aborts on the first one seen. + * aborts on the first one seen. Not required on Z8ES or newer. */ - + if (pci_get_revid(sc->dev) >= MXGE_PCI_REV_Z8ES) + return 0; status = mxge_dma_test(sc, MXGEFW_CMD_UNALIGNED_TEST); if (status == 0) return 0; /* keep the aligned firmware */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 15:32:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BECAAF48; Mon, 4 Mar 2013 15:32:39 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1D1113F; Mon, 4 Mar 2013 15:32:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24FWdCO003692; Mon, 4 Mar 2013 15:32:39 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24FWdNG003690; Mon, 4 Mar 2013 15:32:39 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201303041532.r24FWdNG003690@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 4 Mar 2013 15:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247795 - stable/9/sys/dev/mxge 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:32:39 -0000 Author: gallatin Date: Mon Mar 4 15:32:38 2013 New Revision: 247795 URL: http://svnweb.freebsd.org/changeset/base/247795 Log: MFC r247160 Bump mxge copyright. Modified: stable/9/sys/dev/mxge/if_mxge.c stable/9/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/9/sys/dev/mxge/if_mxge.c Mon Mar 4 15:30:38 2013 (r247794) +++ stable/9/sys/dev/mxge/if_mxge.c Mon Mar 4 15:32:38 2013 (r247795) @@ -1,6 +1,6 @@ /****************************************************************************** -Copyright (c) 2006-2009, Myricom Inc. +Copyright (c) 2006-2013, Myricom Inc. All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/9/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/9/sys/dev/mxge/if_mxge_var.h Mon Mar 4 15:30:38 2013 (r247794) +++ stable/9/sys/dev/mxge/if_mxge_var.h Mon Mar 4 15:32:38 2013 (r247795) @@ -1,6 +1,6 @@ /******************************************************************************* -Copyright (c) 2006-2009, Myricom Inc. +Copyright (c) 2006-2013, Myricom Inc. All rights reserved. Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 15:34:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD24F199; Mon, 4 Mar 2013 15:34:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B8101176; Mon, 4 Mar 2013 15:34:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24FYxV4004061; Mon, 4 Mar 2013 15:34:59 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24FYxOK004060; Mon, 4 Mar 2013 15:34:59 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201303041534.r24FYxOK004060@svn.freebsd.org> From: Glen Barber Date: Mon, 4 Mar 2013 15:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r247796 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:34:59 -0000 Author: gjb (doc,ports committer) Date: Mon Mar 4 15:34:59 2013 New Revision: 247796 URL: http://svnweb.freebsd.org/changeset/base/247796 Log: Add myself to access.doc Approved by: core (kib), doceng (implicit) Modified: svnadmin/conf/access.doc Modified: svnadmin/conf/access.doc ============================================================================== --- svnadmin/conf/access.doc Mon Mar 4 15:32:38 2013 (r247795) +++ svnadmin/conf/access.doc Mon Mar 4 15:34:59 2013 (r247796) @@ -19,6 +19,7 @@ # blackend chern +gjb jcamou joel mwlucas From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 15:57:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D5AA0CAE; Mon, 4 Mar 2013 15:57:41 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5B962DD; Mon, 4 Mar 2013 15:57:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24FvfJD010387; Mon, 4 Mar 2013 15:57:41 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24Fvfvx010386; Mon, 4 Mar 2013 15:57:41 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041557.r24Fvfvx010386@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 15:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247797 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:57:41 -0000 Author: davide Date: Mon Mar 4 15:57:41 2013 New Revision: 247797 URL: http://svnweb.freebsd.org/changeset/base/247797 Log: MFcalloutng: kern_nanosleep() is now converted to use tsleep_sbt(). With this change nanosleep() and usleep() can handle sub-tick precision for timeouts. Also, try to help coalesce of events passing as argument to tsleep_bt() a precision value calculated as a percentage of the sleep time. This percentage is default 5%, but it can tuned according to users need via the sysctl interface. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Mon Mar 4 15:34:59 2013 (r247796) +++ head/sys/kern/kern_time.c Mon Mar 4 15:57:41 2013 (r247797) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -481,38 +482,37 @@ static int nanowait; int kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt) { - struct timespec ts, ts2, ts3; - struct timeval tv; + struct timespec ts; + sbintime_t sbt, sbtt, prec, tmp; int error; if (rqt->tv_nsec < 0 || rqt->tv_nsec >= 1000000000) return (EINVAL); if (rqt->tv_sec < 0 || (rqt->tv_sec == 0 && rqt->tv_nsec == 0)) return (0); - getnanouptime(&ts); - timespecadd(&ts, rqt); - TIMESPEC_TO_TIMEVAL(&tv, rqt); - for (;;) { - error = tsleep(&nanowait, PWAIT | PCATCH, "nanslp", - tvtohz(&tv)); - getnanouptime(&ts2); - if (error != EWOULDBLOCK) { - if (error == ERESTART) - error = EINTR; - if (rmt != NULL) { - timespecsub(&ts, &ts2); - if (ts.tv_sec < 0) - timespecclear(&ts); - *rmt = ts; - } - return (error); + tmp = tstosbt(*rqt); + prec = tmp; + prec >>= tc_precexp; + if (TIMESEL(&sbt, tmp)) + sbt += tc_tick_sbt; + sbt += tmp; + error = tsleep_sbt(&nanowait, PWAIT | PCATCH, "nanslp", sbt, prec, + C_ABSOLUTE); + if (error != EWOULDBLOCK) { + if (error == ERESTART) + error = EINTR; + TIMESEL(&sbtt, tmp); + if (rmt != NULL) { + ts = sbttots(sbt - sbtt); + if (ts.tv_sec < 0) + timespecclear(&ts); + *rmt = ts; } - if (timespeccmp(&ts2, &ts, >=)) + if (sbtt >= sbt) return (0); - ts3 = ts; - timespecsub(&ts3, &ts2); - TIMESPEC_TO_TIMEVAL(&tv, &ts3); + return (error); } + return (0); } #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 16:07:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2774C267; Mon, 4 Mar 2013 16:07:56 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A90D378; Mon, 4 Mar 2013 16:07:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24G7tHK013654; Mon, 4 Mar 2013 16:07:55 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24G7t02013653; Mon, 4 Mar 2013 16:07:55 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041607.r24G7t02013653@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 16:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247798 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:07:56 -0000 Author: davide Date: Mon Mar 4 16:07:55 2013 New Revision: 247798 URL: http://svnweb.freebsd.org/changeset/base/247798 Log: MFcalloutng (r244255 by mav, with minor changes): Specify that syslog doesn't need exactly 5 wakeups per second. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/kern/subr_log.c Modified: head/sys/kern/subr_log.c ============================================================================== --- head/sys/kern/subr_log.c Mon Mar 4 15:57:41 2013 (r247797) +++ head/sys/kern/subr_log.c Mon Mar 4 16:07:55 2013 (r247798) @@ -117,8 +117,8 @@ logopen(struct cdev *dev, int flags, int return (EBUSY); } log_open = 1; - callout_reset(&logsoftc.sc_callout, hz / log_wakeups_per_second, - logtimeout, NULL); + callout_reset_sbt(&logsoftc.sc_callout, + SBT_1S / log_wakeups_per_second, 0, logtimeout, NULL, C_PREL(1)); mtx_unlock(&msgbuf_lock); fsetown(td->td_proc->p_pid, &logsoftc.sc_sigio); /* signal process only */ @@ -233,22 +233,21 @@ logtimeout(void *arg) if (!log_open) return; - if (log_wakeups_per_second < 1) { - printf("syslog wakeup is less than one. Adjusting to 1.\n"); - log_wakeups_per_second = 1; - } - if (msgbuftrigger == 0) { - callout_schedule(&logsoftc.sc_callout, - hz / log_wakeups_per_second); - return; - } + if (msgbuftrigger == 0) + goto done; msgbuftrigger = 0; selwakeuppri(&logsoftc.sc_selp, LOG_RDPRI); KNOTE_LOCKED(&logsoftc.sc_selp.si_note, 0); if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL) pgsigio(&logsoftc.sc_sigio, SIGIO, 0); cv_broadcastpri(&log_wakeup, LOG_RDPRI); - callout_schedule(&logsoftc.sc_callout, hz / log_wakeups_per_second); +done: + if (log_wakeups_per_second < 1) { + printf("syslog wakeup is less than one. Adjusting to 1.\n"); + log_wakeups_per_second = 1; + } + callout_reset_sbt(&logsoftc.sc_callout, + SBT_1S / log_wakeups_per_second, 0, logtimeout, NULL, C_PREL(1)); } /*ARGSUSED*/ From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 16:16:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4CC266D; Mon, 4 Mar 2013 16:16:23 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4B15616; Mon, 4 Mar 2013 16:16:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24GGN7A016796; Mon, 4 Mar 2013 16:16:23 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24GGNNs016795; Mon, 4 Mar 2013 16:16:23 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041616.r24GGNNs016795@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 16:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247799 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:16:24 -0000 Author: davide Date: Mon Mar 4 16:16:23 2013 New Revision: 247799 URL: http://svnweb.freebsd.org/changeset/base/247799 Log: MFcalloutng (r236314 by mav): Specify that wakeup rate of 7.5-10Hz is enough for yarrow harvesting thread. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/dev/random/randomdev_soft.c Modified: head/sys/dev/random/randomdev_soft.c ============================================================================== --- head/sys/dev/random/randomdev_soft.c Mon Mar 4 16:07:55 2013 (r247798) +++ head/sys/dev/random/randomdev_soft.c Mon Mar 4 16:16:23 2013 (r247799) @@ -242,10 +242,10 @@ random_kthread(void *arg __unused) local_count = 0; /* Process until told to stop */ + mtx_lock_spin(&harvest_mtx); for (; random_kthread_control >= 0;) { /* Cycle through all the entropy sources */ - mtx_lock_spin(&harvest_mtx); for (source = RANDOM_START; source < ENTROPYSOURCE; source++) { /* * Drain entropy source records into a thread-local @@ -270,7 +270,6 @@ random_kthread(void *arg __unused) emptyfifo.count += local_count; local_count = 0; } - mtx_unlock_spin(&harvest_mtx); KASSERT(local_count == 0, ("random_kthread: local_count %d", local_count)); @@ -283,9 +282,11 @@ random_kthread(void *arg __unused) random_kthread_control = 0; /* Work done, so don't belabour the issue */ - pause("-", hz / 10); + msleep_spin_sbt(&random_kthread_control, &harvest_mtx, + "-", SBT_1S / 10, 0, C_PREL(1)); } + mtx_unlock_spin(&harvest_mtx); random_set_wakeup_exit(&random_kthread_control); /* NOTREACHED */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 16:25:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7AE0CAA1; Mon, 4 Mar 2013 16:25:13 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6DEB26CB; Mon, 4 Mar 2013 16:25:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24GPD1o019591; Mon, 4 Mar 2013 16:25:13 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24GPD5m019590; Mon, 4 Mar 2013 16:25:13 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041625.r24GPD5m019590@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 16:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247800 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:25:13 -0000 Author: davide Date: Mon Mar 4 16:25:12 2013 New Revision: 247800 URL: http://svnweb.freebsd.org/changeset/base/247800 Log: MFcalloutng (r244251 with minor changes): Specify that precision of 0.5s is enough for resource limitation. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Mon Mar 4 16:16:23 2013 (r247799) +++ head/sys/kern/kern_resource.c Mon Mar 4 16:25:12 2013 (r247800) @@ -645,7 +645,8 @@ lim_cb(void *arg) } } if ((p->p_flag & P_WEXIT) == 0) - callout_reset(&p->p_limco, hz, lim_cb, p); + callout_reset_sbt(&p->p_limco, SBT_1S, 0, + lim_cb, p, C_PREL(1)); } int @@ -697,7 +698,8 @@ kern_proc_setrlimit(struct thread *td, s case RLIMIT_CPU: if (limp->rlim_cur != RLIM_INFINITY && p->p_cpulimit == RLIM_INFINITY) - callout_reset(&p->p_limco, hz, lim_cb, p); + callout_reset_sbt(&p->p_limco, SBT_1S, 0, + lim_cb, p, C_PREL(1)); p->p_cpulimit = limp->rlim_cur; break; case RLIMIT_DATA: @@ -1137,7 +1139,8 @@ lim_fork(struct proc *p1, struct proc *p p2->p_limit = lim_hold(p1->p_limit); callout_init_mtx(&p2->p_limco, &p2->p_mtx, 0); if (p1->p_cpulimit != RLIM_INFINITY) - callout_reset(&p2->p_limco, hz, lim_cb, p2); + callout_reset_sbt(&p2->p_limco, SBT_1S, 0, + lim_cb, p2, C_PREL(1)); } void From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 16:41:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8DFFBF99; Mon, 4 Mar 2013 16:41:28 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 808EB764; Mon, 4 Mar 2013 16:41:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24GfSS6025065; Mon, 4 Mar 2013 16:41:28 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24GfSUD025064; Mon, 4 Mar 2013 16:41:28 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041641.r24GfSUD025064@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 16:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247801 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:41:28 -0000 Author: davide Date: Mon Mar 4 16:41:27 2013 New Revision: 247801 URL: http://svnweb.freebsd.org/changeset/base/247801 Log: MFcalloutng: Fix kern_select() and sys_poll() so that they can handle sub-tick precision for timeouts (in the same fashion it was done for nanosleep() in r247797). Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/kern/sys_generic.c Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Mon Mar 4 16:25:12 2013 (r247800) +++ head/sys/kern/sys_generic.c Mon Mar 4 16:41:27 2013 (r247801) @@ -103,7 +103,7 @@ static int dofilewrite(struct thread *, off_t, int); static void doselwakeup(struct selinfo *, int); static void seltdinit(struct thread *); -static int seltdwait(struct thread *, int); +static int seltdwait(struct thread *, sbintime_t, sbintime_t); static void seltdclear(struct thread *); /* @@ -950,9 +950,10 @@ kern_select(struct thread *td, int nd, f */ fd_mask s_selbits[howmany(2048, NFDBITS)]; fd_mask *ibits[3], *obits[3], *selbits, *sbp; - struct timeval atv, rtv, ttv; - int error, lf, ndu, timo; + struct timeval rtv; + sbintime_t asbt, precision, rsbt; u_int nbufbytes, ncpbytes, ncpubytes, nfdbits; + int error, lf, ndu; if (nd < 0) return (EINVAL); @@ -1042,35 +1043,29 @@ kern_select(struct thread *td, int nd, f if (nbufbytes != 0) bzero(selbits, nbufbytes / 2); + precision = 0; if (tvp != NULL) { - atv = *tvp; - if (itimerfix(&atv)) { + rtv = *tvp; + if (rtv.tv_sec < 0 || rtv.tv_usec < 0 || + rtv.tv_usec >= 1000000) { error = EINVAL; goto done; } - getmicrouptime(&rtv); - timevaladd(&atv, &rtv); - } else { - atv.tv_sec = 0; - atv.tv_usec = 0; - } - timo = 0; + rsbt = tvtosbt(rtv); + precision = rsbt; + precision >>= tc_precexp; + if (TIMESEL(&asbt, rsbt)) + asbt += tc_tick_sbt; + asbt += rsbt; + } else + asbt = -1; seltdinit(td); /* Iterate until the timeout expires or descriptors become ready. */ for (;;) { error = selscan(td, ibits, obits, nd); if (error || td->td_retval[0] != 0) break; - if (atv.tv_sec || atv.tv_usec) { - getmicrouptime(&rtv); - if (timevalcmp(&rtv, &atv, >=)) - break; - ttv = atv; - timevalsub(&ttv, &rtv); - timo = ttv.tv_sec > 24 * 60 * 60 ? - 24 * 60 * 60 * hz : tvtohz(&ttv); - } - error = seltdwait(td, timo); + error = seltdwait(td, asbt, precision); if (error) break; error = selrescan(td, ibits, obits); @@ -1278,9 +1273,9 @@ sys_poll(td, uap) { struct pollfd *bits; struct pollfd smallbits[32]; - struct timeval atv, rtv, ttv; - int error, timo; + sbintime_t asbt, precision, rsbt; u_int nfds; + int error; size_t ni; nfds = uap->nfds; @@ -1294,36 +1289,27 @@ sys_poll(td, uap) error = copyin(uap->fds, bits, ni); if (error) goto done; + precision = 0; if (uap->timeout != INFTIM) { - atv.tv_sec = uap->timeout / 1000; - atv.tv_usec = (uap->timeout % 1000) * 1000; - if (itimerfix(&atv)) { + if (uap->timeout < 0) { error = EINVAL; goto done; } - getmicrouptime(&rtv); - timevaladd(&atv, &rtv); - } else { - atv.tv_sec = 0; - atv.tv_usec = 0; - } - timo = 0; + rsbt = SBT_1MS * uap->timeout; + precision = rsbt; + precision >>= tc_precexp; + if (TIMESEL(&asbt, rsbt)) + asbt += tc_tick_sbt; + asbt += rsbt; + } else + asbt = -1; seltdinit(td); /* Iterate until the timeout expires or descriptors become ready. */ for (;;) { error = pollscan(td, bits, nfds); if (error || td->td_retval[0] != 0) break; - if (atv.tv_sec || atv.tv_usec) { - getmicrouptime(&rtv); - if (timevalcmp(&rtv, &atv, >=)) - break; - ttv = atv; - timevalsub(&ttv, &rtv); - timo = ttv.tv_sec > 24 * 60 * 60 ? - 24 * 60 * 60 * hz : tvtohz(&ttv); - } - error = seltdwait(td, timo); + error = seltdwait(td, asbt, precision); if (error) break; error = pollrescan(td); @@ -1667,7 +1653,7 @@ out: } static int -seltdwait(struct thread *td, int timo) +seltdwait(struct thread *td, sbintime_t sbt, sbintime_t precision) { struct seltd *stp; int error; @@ -1686,8 +1672,11 @@ seltdwait(struct thread *td, int timo) mtx_unlock(&stp->st_mtx); return (0); } - if (timo > 0) - error = cv_timedwait_sig(&stp->st_wait, &stp->st_mtx, timo); + if (sbt == 0) + error = EWOULDBLOCK; + else if (sbt != -1) + error = cv_timedwait_sig_sbt(&stp->st_wait, &stp->st_mtx, + sbt, precision, C_ABSOLUTE); else error = cv_wait_sig(&stp->st_wait, &stp->st_mtx); mtx_unlock(&stp->st_mtx); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 16:44:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7EAD2286; Mon, 4 Mar 2013 16:44:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 70D3B797; Mon, 4 Mar 2013 16:44:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24GiKhM025521; Mon, 4 Mar 2013 16:44:20 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24GiKhv025520; Mon, 4 Mar 2013 16:44:20 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201303041644.r24GiKhv025520@svn.freebsd.org> From: Ian Lepore Date: Mon, 4 Mar 2013 16:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247802 - stable/9/sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:44:20 -0000 Author: ian Date: Mon Mar 4 16:44:19 2013 New Revision: 247802 URL: http://svnweb.freebsd.org/changeset/base/247802 Log: MFC r246361 ... bump .Dd for content change. Modified: stable/9/sbin/devd/devd.8 Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.8 ============================================================================== --- stable/9/sbin/devd/devd.8 Mon Mar 4 16:41:27 2013 (r247801) +++ stable/9/sbin/devd/devd.8 Mon Mar 4 16:44:19 2013 (r247802) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2005 +.Dd January 30, 2013 .Dt DEVD 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 16:50:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CFE4B44A; Mon, 4 Mar 2013 16:50:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C253C7CB; Mon, 4 Mar 2013 16:50:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24Go1PK026357; Mon, 4 Mar 2013 16:50:01 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24Go1M9026353; Mon, 4 Mar 2013 16:50:01 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201303041650.r24Go1M9026353@svn.freebsd.org> From: Ian Lepore Date: Mon, 4 Mar 2013 16:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247803 - stable/9/sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:50:01 -0000 Author: ian Date: Mon Mar 4 16:50:01 2013 New Revision: 247803 URL: http://svnweb.freebsd.org/changeset/base/247803 Log: MFC r246134 ... Improve devd startup time, by tweaking some string handling routines that are heavily used when parsing config files. Mostly these changes avoid making temporary copies of the strings, and avoid doing byte at a time append operations, on the most-used code path. On a 1.2 GHz ARM processor this reduces the time to parse the config files from 13 to 6 seconds. Modified: stable/9/sbin/devd/devd.cc stable/9/sbin/devd/devd.hh Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.cc ============================================================================== --- stable/9/sbin/devd/devd.cc Mon Mar 4 16:44:19 2013 (r247802) +++ stable/9/sbin/devd/devd.cc Mon Mar 4 16:50:01 2013 (r247803) @@ -137,7 +137,7 @@ config cfg; event_proc::event_proc() : _prio(-1) { - // nothing + _epsvec.reserve(4); } event_proc::~event_proc() @@ -241,25 +241,18 @@ my_system(const char *command) bool action::do_action(config &c) { - string s = c.expand_string(_cmd); + string s = c.expand_string(_cmd.c_str()); if (Dflag) fprintf(stderr, "Executing '%s'\n", s.c_str()); my_system(s.c_str()); return (true); } -match::match(config &c, const char *var, const char *re) - : _var(var), _re("^") +match::match(config &c, const char *var, const char *re) : + _inv(re[0] == '!'), + _var(var), + _re(c.expand_string(_inv ? re + 1 : re, "^", "$")) { - if (!c.expand_string(string(re)).empty() && - c.expand_string(string(re)).at(0) == '!') { - _re.append(c.expand_string(string(re)).substr(1)); - _inv = 1; - } else { - _re.append(c.expand_string(string(re))); - _inv = 0; - } - _re.append("$"); regcomp(&_regex, _re.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE); } @@ -625,24 +618,37 @@ config::expand_one(const char *&src, str do { buffer.append(src++, 1); } while (is_id_char(*src)); - buffer.append("", 1); dst.append(get_variable(buffer.c_str())); } const string -config::expand_string(const string &s) +config::expand_string(const char *src, const char *prepend, const char *append) { - const char *src; + const char *var_at; string dst; - src = s.c_str(); - while (*src) { - if (*src == '$') - expand_one(src, dst); - else - dst.append(src++, 1); + /* + * 128 bytes is enough for 2427 of 2438 expansions that happen + * while parsing config files, as tested on 2013-01-30. + */ + dst.reserve(128); + + if (prepend != NULL) + dst = prepend; + + for (;;) { + var_at = strchr(src, '$'); + if (var_at == NULL) { + dst.append(src); + break; + } + dst.append(src, var_at - src); + src = var_at; + expand_one(src, dst); } - dst.append("", 1); + + if (append != NULL) + dst.append(append); return (dst); } Modified: stable/9/sbin/devd/devd.hh ============================================================================== --- stable/9/sbin/devd/devd.hh Mon Mar 4 16:44:19 2013 (r247802) +++ stable/9/sbin/devd/devd.hh Mon Mar 4 16:50:01 2013 (r247803) @@ -90,9 +90,9 @@ public: virtual bool do_match(config &); virtual bool do_action(config &) { return true; } private: + bool _inv; std::string _var; std::string _re; - bool _inv; regex_t _regex; }; @@ -162,7 +162,8 @@ public: void pop_var_table(); void set_variable(const char *var, const char *val); const std::string &get_variable(const std::string &var); - const std::string expand_string(const std::string &var); + const std::string expand_string(const char * var, + const char * prepend = NULL, const char * append = NULL); char *set_vars(char *); void find_and_execute(char); protected: From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 16:55:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C936385E; Mon, 4 Mar 2013 16:55:16 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BBEE481E; Mon, 4 Mar 2013 16:55:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24GtGIm028730; Mon, 4 Mar 2013 16:55:16 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24GtGAM028729; Mon, 4 Mar 2013 16:55:16 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041655.r24GtGAM028729@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 16:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247804 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:55:16 -0000 Author: davide Date: Mon Mar 4 16:55:16 2013 New Revision: 247804 URL: http://svnweb.freebsd.org/changeset/base/247804 Log: MFcalloutng: - Rewrite kevent() timeout implementation to allow sub-tick precision. - Make the interval timings for EVFILT_TIMER more accurate. This also removes an hack introduced in r238424. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Mar 4 16:50:01 2013 (r247803) +++ head/sys/kern/kern_event.c Mon Mar 4 16:55:16 2013 (r247804) @@ -517,39 +517,28 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ -static int -timertoticks(intptr_t data) +static __inline sbintime_t +timer2sbintime(intptr_t data) { - struct timeval tv; - int tticks; - - tv.tv_sec = data / 1000; - tv.tv_usec = (data % 1000) * 1000; - tticks = tvtohz(&tv); - return tticks; + return (SBT_1MS * data); } static void filt_timerexpire(void *knx) { - struct knote *kn = knx; struct callout *calloutp; + struct knote *kn; + kn = knx; kn->kn_data++; KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */ - /* - * timertoticks() uses tvtohz() which always adds 1 to allow - * for the time until the next clock interrupt being strictly - * less than 1 clock tick. We don't want that here since we - * want to appear to be in sync with the clock interrupt even - * when we're delayed. - */ if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; - callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata) - 1, - filt_timerexpire, kn); + callout_reset_sbt_on(calloutp, + timer2sbintime(kn->kn_sdata), 0 /* 1ms? */, + filt_timerexpire, kn, PCPU_GET(cpuid), 0); } } @@ -573,8 +562,9 @@ filt_timerattach(struct knote *kn) calloutp = malloc(sizeof(*calloutp), M_KQUEUE, M_WAITOK); callout_init(calloutp, CALLOUT_MPSAFE); kn->kn_hook = calloutp; - callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata), - filt_timerexpire, kn); + callout_reset_sbt_on(calloutp, + timer2sbintime(kn->kn_sdata), 0 /* 1ms? */, + filt_timerexpire, kn, PCPU_GET(cpuid), 0); return (0); } @@ -1319,10 +1309,9 @@ kqueue_scan(struct kqueue *kq, int maxev const struct timespec *tsp, struct kevent *keva, struct thread *td) { struct kevent *kevp; - struct timeval atv, rtv, ttv; struct knote *kn, *marker; - int count, timeout, nkev, error, influx; - int haskqglobal, touch; + sbintime_t asbt, rsbt; + int count, error, haskqglobal, influx, nkev, touch; count = maxevents; nkev = 0; @@ -1332,24 +1321,23 @@ kqueue_scan(struct kqueue *kq, int maxev if (maxevents == 0) goto done_nl; + rsbt = 0; if (tsp != NULL) { - TIMESPEC_TO_TIMEVAL(&atv, tsp); - if (itimerfix(&atv)) { + if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 || + tsp->tv_nsec > 1000000000) { error = EINVAL; goto done_nl; } - if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) - timeout = -1; - else - timeout = atv.tv_sec > 24 * 60 * 60 ? - 24 * 60 * 60 * hz : tvtohz(&atv); - getmicrouptime(&rtv); - timevaladd(&atv, &rtv); - } else { - atv.tv_sec = 0; - atv.tv_usec = 0; - timeout = 0; - } + if (timespecisset(tsp)) { + rsbt = tstosbt(*tsp); + if (TIMESEL(&asbt, rsbt)) + asbt += tc_tick_sbt; + asbt += rsbt; + rsbt >>= tc_precexp; + } else + asbt = -1; + } else + asbt = 0; marker = knote_alloc(1); if (marker == NULL) { error = ENOMEM; @@ -1357,28 +1345,16 @@ kqueue_scan(struct kqueue *kq, int maxev } marker->kn_status = KN_MARKER; KQ_LOCK(kq); - goto start; retry: - if (atv.tv_sec || atv.tv_usec) { - getmicrouptime(&rtv); - if (timevalcmp(&rtv, &atv, >=)) - goto done; - ttv = atv; - timevalsub(&ttv, &rtv); - timeout = ttv.tv_sec > 24 * 60 * 60 ? - 24 * 60 * 60 * hz : tvtohz(&ttv); - } - -start: kevp = keva; if (kq->kq_count == 0) { - if (timeout < 0) { + if (asbt == -1) { error = EWOULDBLOCK; } else { kq->kq_state |= KQ_SLEEP; - error = msleep(kq, &kq->kq_lock, PSOCK | PCATCH, - "kqread", timeout); + error = msleep_sbt(kq, &kq->kq_lock, PSOCK | PCATCH, + "kqread", asbt, rsbt, C_ABSOLUTE); } if (error == 0) goto retry; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 17:35:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB58E749; Mon, 4 Mar 2013 17:35:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A9A16A1C; Mon, 4 Mar 2013 17:35:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24HZBVw041108; Mon, 4 Mar 2013 17:35:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24HZBof041106; Mon, 4 Mar 2013 17:35:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201303041735.r24HZBof041106@svn.freebsd.org> From: John Baldwin Date: Mon, 4 Mar 2013 17:35:11 +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: r247805 - stable/8/sys/dev/an 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 17:35:11 -0000 Author: jhb Date: Mon Mar 4 17:35:10 2013 New Revision: 247805 URL: http://svnweb.freebsd.org/changeset/base/247805 Log: MFC 199757: - For 350 chips, don't set various INTR bits in TX control word; turning INTR bits on seems to confuse hardware TX engine. - For 350 chips, set TX desc's buffer physical address before turning on the TX desc valid bit. PR: kern/85886 Modified: stable/8/sys/dev/an/if_an.c stable/8/sys/dev/an/if_anreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/an/ (props changed) Modified: stable/8/sys/dev/an/if_an.c ============================================================================== --- stable/8/sys/dev/an/if_an.c Mon Mar 4 16:55:16 2013 (r247804) +++ stable/8/sys/dev/an/if_an.c Mon Mar 4 17:35:10 2013 (r247805) @@ -2803,7 +2803,7 @@ an_start(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len, (caddr_t)&sc->an_txbuf); - txcontrol = AN_TXCTL_8023; + txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); /* write the txcontrol only */ an_write_data(sc, id, 0x08, (caddr_t)&txcontrol, sizeof(txcontrol)); @@ -2866,7 +2866,7 @@ an_start(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len, (caddr_t)&sc->an_txbuf); - txcontrol = AN_TXCTL_8023; + txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); /* write the txcontrol only */ bcopy((caddr_t)&txcontrol, &buf[0x08], sizeof(txcontrol)); @@ -2888,7 +2888,7 @@ an_start(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len; an_tx_desc.an_phys = sc->an_tx_buffer[idx].an_dma_paddr; - for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) { + for (i = sizeof(an_tx_desc) / 4 - 1; i >= 0; i--) { CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET /* zero for now */ + (0 * sizeof(an_tx_desc)) Modified: stable/8/sys/dev/an/if_anreg.h ============================================================================== --- stable/8/sys/dev/an/if_anreg.h Mon Mar 4 16:55:16 2013 (r247804) +++ stable/8/sys/dev/an/if_anreg.h Mon Mar 4 17:35:10 2013 (r247805) @@ -394,13 +394,18 @@ struct an_txframe_802_3 { #define AN_PAYLOADTYPE_ETHER 0x0000 #define AN_PAYLOADTYPE_LLC 0x0010 -#define AN_TXCTL_80211 \ - (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211| \ - AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE) - -#define AN_TXCTL_8023 \ - (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023| \ - AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE) +#define AN_TXCTL_80211 (AN_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC) + +#define AN_TXCTL_8023 (AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER) + +/* + * Additions to transmit control bits for MPI350 + */ +#define AN_TXCTL_HW(x) \ + ( x ? (AN_TXCTL_NORELEASE) \ + : \ + (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE) \ + ) #define AN_TXGAP_80211 0 #define AN_TXGAP_8023 0 From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 17:39:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6C2D3976; Mon, 4 Mar 2013 17:39:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 535EDA47; Mon, 4 Mar 2013 17:39:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24HdI1X041687; Mon, 4 Mar 2013 17:39:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24HdIAI041685; Mon, 4 Mar 2013 17:39:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201303041739.r24HdIAI041685@svn.freebsd.org> From: Ian Lepore Date: Mon, 4 Mar 2013 17:39:18 +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: r247806 - stable/8/sbin/devd 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 17:39:18 -0000 Author: ian Date: Mon Mar 4 17:39:17 2013 New Revision: 247806 URL: http://svnweb.freebsd.org/changeset/base/247806 Log: MFC r246121 r246361 ... Fix a descriptor leak in devd. Clients reading /var/run/devd.pipe can close their socket connection any time, and devd only notices that when it gets an error trying to write an event to the client. On a system with no device change activity, clients could connect and disappear repeatedly without devd noticing, leading to an ever-growing list of open socket descriptors in devd. Now devd uses poll(2) looking for POLLHUP on all existing clients every time a new client connection is established, and also periodically (once a minute) to proactively find zombie clients and reap the socket descriptors. It also now has a connection limit, configurable with a new -l command line arg. When the maximum number of connections is reached it stops accepting new connections until some current clients drop off. Bump .Dd in for content change (r246361). Modified: stable/8/sbin/devd/devd.8 stable/8/sbin/devd/devd.cc Directory Properties: stable/8/sbin/devd/ (props changed) Modified: stable/8/sbin/devd/devd.8 ============================================================================== --- stable/8/sbin/devd/devd.8 Mon Mar 4 17:35:10 2013 (r247805) +++ stable/8/sbin/devd/devd.8 Mon Mar 4 17:39:17 2013 (r247806) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2005 +.Dd January 30, 2013 .Dt DEVD 8 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nm .Op Fl Ddn .Op Fl f Ar file +.Op Fl l Ar num .Sh DESCRIPTION The .Nm @@ -55,6 +56,12 @@ instead of the default If option .Fl f is specified more than once, the last file specified is used. +.It Fl l Ar num +Limit concurrent +.Pa /var/run/devd.pipe +connections to +.Ar num . +The default connection limit is 10. .It Fl n Do not process all pending events before becoming a daemon. Instead, call daemon right away. Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Mon Mar 4 17:35:10 2013 (r247805) +++ stable/8/sbin/devd/devd.cc Mon Mar 4 17:39:17 2013 (r247806) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -718,23 +719,58 @@ create_socket(const char *name) return (fd); } +unsigned int max_clients = 10; /* Default, can be overriden on cmdline. */ +unsigned int num_clients; list clients; void notify_clients(const char *data, int len) { - list bad; - list::const_iterator i; + list::iterator i; - for (i = clients.begin(); i != clients.end(); ++i) { - if (write(*i, data, len) <= 0) { - bad.push_back(*i); + /* + * Deliver the data to all clients. Throw clients overboard at the + * first sign of trouble. This reaps clients who've died or closed + * their sockets, and also clients who are alive but failing to keep up + * (or who are maliciously not reading, to consume buffer space in + * kernel memory or tie up the limited number of available connections). + */ + for (i = clients.begin(); i != clients.end(); ) { + if (write(*i, data, len) != len) { + --num_clients; close(*i); - } + i = clients.erase(i); + } else + ++i; } +} + +void +check_clients(void) +{ + int s; + struct pollfd pfd; + list::iterator i; - for (i = bad.begin(); i != bad.end(); ++i) - clients.erase(find(clients.begin(), clients.end(), *i)); + /* + * Check all existing clients to see if any of them have disappeared. + * Normally we reap clients when we get an error trying to send them an + * event. This check eliminates the problem of an ever-growing list of + * zombie clients because we're never writing to them on a system + * without frequent device-change activity. + */ + pfd.events = 0; + for (i = clients.begin(); i != clients.end(); ) { + pfd.fd = *i; + s = poll(&pfd, 1, 0); + if ((s < 0 && s != EINTR ) || + (s > 0 && (pfd.revents & POLLHUP))) { + --num_clients; + close(*i); + i = clients.erase(i); + } else + ++i; + } } void @@ -742,9 +778,18 @@ new_client(int fd) { int s; + /* + * First go reap any zombie clients, then accept the connection, and + * shut down the read side to stop clients from consuming kernel memory + * by sending large buffers full of data we'll never read. + */ + check_clients(); s = accept(fd, NULL, NULL); - if (s != -1) + if (s != -1) { + shutdown(s, SHUT_RD); clients.push_back(s); + ++num_clients; + } } static void @@ -755,6 +800,7 @@ event_loop(void) char buffer[DEVCTL_MAXBUF]; int once = 0; int server_fd, max_fd; + int accepting; timeval tv; fd_set fds; @@ -764,6 +810,7 @@ event_loop(void) if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) err(1, "Can't set close-on-exec flag on devctl"); server_fd = create_socket(PIPE); + accepting = 1; max_fd = max(fd, server_fd) + 1; while (1) { if (romeo_must_die) @@ -786,15 +833,38 @@ event_loop(void) once++; } } + /* + * When we've already got the max number of clients, stop + * accepting new connections (don't put server_fd in the set), + * shrink the accept() queue to reject connections quickly, and + * poll the existing clients more often, so that we notice more + * quickly when any of them disappear to free up client slots. + */ FD_ZERO(&fds); FD_SET(fd, &fds); - FD_SET(server_fd, &fds); - rv = select(max_fd, &fds, NULL, NULL, NULL); + if (num_clients < max_clients) { + if (!accepting) { + listen(server_fd, max_clients); + accepting = 1; + } + FD_SET(server_fd, &fds); + tv.tv_sec = 60; + tv.tv_usec = 0; + } else { + if (accepting) { + listen(server_fd, 0); + accepting = 0; + } + tv.tv_sec = 2; + tv.tv_usec = 0; + } + rv = select(max_fd, &fds, NULL, NULL, &tv); if (rv == -1) { if (errno == EINTR) continue; err(1, "select"); - } + } else if (rv == 0) + check_clients(); if (FD_ISSET(fd, &fds)) { rv = read(fd, buffer, sizeof(buffer) - 1); if (rv > 0) { @@ -913,7 +983,8 @@ gensighand(int) static void usage() { - fprintf(stderr, "usage: %s [-Ddn] [-f file]\n", getprogname()); + fprintf(stderr, "usage: %s [-Ddn] [-l connlimit] [-f file]\n", + getprogname()); exit(1); } @@ -942,7 +1013,7 @@ main(int argc, char **argv) int ch; check_devd_enabled(); - while ((ch = getopt(argc, argv, "Ddf:n")) != -1) { + while ((ch = getopt(argc, argv, "Ddf:l:n")) != -1) { switch (ch) { case 'D': Dflag++; @@ -953,6 +1024,9 @@ main(int argc, char **argv) case 'f': configfile = optarg; break; + case 'l': + max_clients = MAX(1, strtoul(optarg, NULL, 0)); + break; case 'n': nflag++; break; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 18:28:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9D32E976; Mon, 4 Mar 2013 18:28:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A636D4D; Mon, 4 Mar 2013 18:28:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24ISORK056870; Mon, 4 Mar 2013 18:28:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24ISOVd056869; Mon, 4 Mar 2013 18:28:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201303041828.r24ISOVd056869@svn.freebsd.org> From: John Baldwin Date: Mon, 4 Mar 2013 18:28:24 +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: r247808 - stable/8/sys/compat/linprocfs 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:28:24 -0000 Author: jhb Date: Mon Mar 4 18:28:24 2013 New Revision: 247808 URL: http://svnweb.freebsd.org/changeset/base/247808 Log: MFC 205541,205592: Implement /proc/filesystems. PR: kern/142595 Modified: stable/8/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/compat/ (props changed) Modified: stable/8/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/8/sys/compat/linprocfs/linprocfs.c Mon Mar 4 18:07:28 2013 (r247807) +++ stable/8/sys/compat/linprocfs/linprocfs.c Mon Mar 4 18:28:24 2013 (r247808) @@ -1427,6 +1427,24 @@ linprocfs_docmdline(PFS_FILL_ARGS) return (0); } +/* + * Filler function for proc/filesystems + */ +static int +linprocfs_dofilesystems(PFS_FILL_ARGS) +{ + struct vfsconf *vfsp; + + mtx_lock(&Giant); + TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { + if (vfsp->vfc_flags & VFCF_SYNTHETIC) + sbuf_printf(sb, "nodev"); + sbuf_printf(sb, "\t%s\n", vfsp->vfc_name); + } + mtx_unlock(&Giant); + return(0); +} + #if 0 /* * Filler function for proc/modules @@ -1462,6 +1480,8 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "devices", &linprocfs_dodevices, NULL, NULL, NULL, PFS_RD); + pfs_create_file(root, "filesystems", &linprocfs_dofilesystems, + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "loadavg", &linprocfs_doloadavg, NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "meminfo", &linprocfs_domeminfo, From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 18:46:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E3075D74; Mon, 4 Mar 2013 18:46:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5DDFDFC; Mon, 4 Mar 2013 18:46:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24Ikuvw062610; Mon, 4 Mar 2013 18:46:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24Iku0u062605; Mon, 4 Mar 2013 18:46:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201303041846.r24Iku0u062605@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Mar 2013 18:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247809 - in vendor/openpam/dist: doc/man lib 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:46:59 -0000 Author: des Date: Mon Mar 4 18:46:55 2013 New Revision: 247809 URL: http://svnweb.freebsd.org/changeset/base/247809 Log: Merge upstream r634:646: correctly parse mixed quoted / unquoted text. See http://www.openpam.org/wiki/Errata#Configurationparsing for details. Modified: vendor/openpam/dist/doc/man/openpam_straddch.3 vendor/openpam/dist/lib/openpam_readline.c vendor/openpam/dist/lib/openpam_readword.c Modified: vendor/openpam/dist/doc/man/openpam_straddch.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_straddch.3 Mon Mar 4 18:28:24 2013 (r247808) +++ vendor/openpam/dist/doc/man/openpam_straddch.3 Mon Mar 4 18:46:55 2013 (r247809) @@ -34,7 +34,7 @@ .\" .\" $Id$ .\" -.Dd May 26, 2012 +.Dd March 3, 2013 .Dt OPENPAM_STRADDCH 3 .Os .Sh NAME @@ -73,6 +73,21 @@ and argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively. .Pp +The final argument, +.Fa ch , +is the character that should be appended to +the string. If +.Fa ch +is 0, nothing is appended, but a new buffer is +still allocated if +.Fa str +is NULL. This can be used to +.Do +bootstrap +.Dc +the +string. +.Pp If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, .Fa str @@ -91,7 +106,9 @@ If the function is successful, it increments the integer variable pointed to by .Fa len -and returns 0. +(unless +.Fa ch +was 0) and returns 0. Otherwise, it leaves the variables pointed to by .Fa str , .Fa size Modified: vendor/openpam/dist/lib/openpam_readline.c ============================================================================== --- vendor/openpam/dist/lib/openpam_readline.c Mon Mar 4 18:28:24 2013 (r247808) +++ vendor/openpam/dist/lib/openpam_readline.c Mon Mar 4 18:46:55 2013 (r247809) @@ -62,11 +62,9 @@ openpam_readline(FILE *f, int *lineno, s size_t len, size; int ch; - if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); + line = NULL; + if (openpam_straddch(&line, &size, &len, 0) != 0) return (NULL); - } - len = 0; for (;;) { ch = fgetc(f); /* strip comment */ Modified: vendor/openpam/dist/lib/openpam_readword.c ============================================================================== --- vendor/openpam/dist/lib/openpam_readword.c Mon Mar 4 18:28:24 2013 (r247808) +++ vendor/openpam/dist/lib/openpam_readword.c Mon Mar 4 18:46:55 2013 (r247809) @@ -86,13 +86,8 @@ openpam_readword(FILE *f, int *lineno, s /* begin quote */ quote = ch; /* edge case: empty quoted string */ - if (word == NULL && (word = malloc(1)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); - errno = ENOMEM; + if (openpam_straddch(&word, &size, &len, 0) != 0) return (NULL); - } - *word = '\0'; - size = 1; } else if (ch == quote && !escape) { /* end quote */ quote = 0; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 18:51:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 92FD5F97; Mon, 4 Mar 2013 18:51:54 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6CB09E20; Mon, 4 Mar 2013 18:51:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24Ipsie064910; Mon, 4 Mar 2013 18:51:54 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24IpraJ064904; Mon, 4 Mar 2013 18:51:53 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201303041851.r24IpraJ064904@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Mar 2013 18:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247810 - in head/contrib/openpam: doc/man lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:51:54 -0000 Author: des Date: Mon Mar 4 18:51:53 2013 New Revision: 247810 URL: http://svnweb.freebsd.org/changeset/base/247810 Log: Merge upstream r634:646: correctly parse mixed quoted / unquoted text. Modified: head/contrib/openpam/doc/man/openpam_straddch.3 head/contrib/openpam/lib/openpam_readline.c head/contrib/openpam/lib/openpam_readword.c Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/doc/man/openpam_straddch.3 ============================================================================== --- head/contrib/openpam/doc/man/openpam_straddch.3 Mon Mar 4 18:46:55 2013 (r247809) +++ head/contrib/openpam/doc/man/openpam_straddch.3 Mon Mar 4 18:51:53 2013 (r247810) @@ -34,7 +34,7 @@ .\" .\" $Id$ .\" -.Dd May 26, 2012 +.Dd March 3, 2013 .Dt OPENPAM_STRADDCH 3 .Os .Sh NAME @@ -73,6 +73,21 @@ and argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively. .Pp +The final argument, +.Fa ch , +is the character that should be appended to +the string. If +.Fa ch +is 0, nothing is appended, but a new buffer is +still allocated if +.Fa str +is NULL. This can be used to +.Do +bootstrap +.Dc +the +string. +.Pp If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, .Fa str @@ -91,7 +106,9 @@ If the function is successful, it increments the integer variable pointed to by .Fa len -and returns 0. +(unless +.Fa ch +was 0) and returns 0. Otherwise, it leaves the variables pointed to by .Fa str , .Fa size Modified: head/contrib/openpam/lib/openpam_readline.c ============================================================================== --- head/contrib/openpam/lib/openpam_readline.c Mon Mar 4 18:46:55 2013 (r247809) +++ head/contrib/openpam/lib/openpam_readline.c Mon Mar 4 18:51:53 2013 (r247810) @@ -62,11 +62,9 @@ openpam_readline(FILE *f, int *lineno, s size_t len, size; int ch; - if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); + line = NULL; + if (openpam_straddch(&line, &size, &len, 0) != 0) return (NULL); - } - len = 0; for (;;) { ch = fgetc(f); /* strip comment */ Modified: head/contrib/openpam/lib/openpam_readword.c ============================================================================== --- head/contrib/openpam/lib/openpam_readword.c Mon Mar 4 18:46:55 2013 (r247809) +++ head/contrib/openpam/lib/openpam_readword.c Mon Mar 4 18:51:53 2013 (r247810) @@ -86,13 +86,8 @@ openpam_readword(FILE *f, int *lineno, s /* begin quote */ quote = ch; /* edge case: empty quoted string */ - if (word == NULL && (word = malloc(1)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); - errno = ENOMEM; + if (openpam_straddch(&word, &size, &len, 0) != 0) return (NULL); - } - *word = '\0'; - size = 1; } else if (ch == quote && !escape) { /* end quote */ quote = 0; From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 19:01:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 324382E1; Mon, 4 Mar 2013 19:01:39 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A7B1E86; Mon, 4 Mar 2013 19:01:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24J1ceL067960; Mon, 4 Mar 2013 19:01:38 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24J1cBe067959; Mon, 4 Mar 2013 19:01:38 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303041901.r24J1cBe067959@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 4 Mar 2013 19:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247811 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 19:01:39 -0000 Author: melifaro Date: Mon Mar 4 19:01:38 2013 New Revision: 247811 URL: http://svnweb.freebsd.org/changeset/base/247811 Log: Do not suddenly fail on some rulesets if -n (syntax check only) is specified and ipfw(4) module is not loaded. MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Mar 4 18:51:53 2013 (r247810) +++ head/sbin/ipfw/ipfw2.c Mon Mar 4 19:01:38 2013 (r247811) @@ -3083,9 +3083,14 @@ chkarg: } else { len = sizeof(c->max_log); if (sysctlbyname("net.inet.ip.fw.verbose_limit", - &c->max_log, &len, NULL, 0) == -1) + &c->max_log, &len, NULL, 0) == -1) { + if (co.test_only) { + c->max_log = 0; + break; + } errx(1, "sysctlbyname(\"%s\")", "net.inet.ip.fw.verbose_limit"); + } } } break; @@ -3986,9 +3991,13 @@ ipfw_table_handler(int ac, char *av[]) mask = 0; // XXX uninitialized ? len = sizeof(tables_max); if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len, - NULL, 0) == -1) - errx(1, "Can't determine maximum number of ipfw tables. " - "Perhaps you forgot to load ipfw module?"); + NULL, 0) == -1) { + if (co.test_only) + tables_max = 128; /* Old conservative default */ + else + errx(1, "Can't determine maximum number of ipfw tables." + " Perhaps you forgot to load ipfw module?"); + } memset(&xent, 0, sizeof(xent)); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 19:10:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 333A35E2; Mon, 4 Mar 2013 19:10:41 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15ED0EF0; Mon, 4 Mar 2013 19:10:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24JAenZ069562; Mon, 4 Mar 2013 19:10:40 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24JAd04069553; Mon, 4 Mar 2013 19:10:39 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041910.r24JAd04069553@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 19:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247812 - in head/share/man: man4 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 19:10:41 -0000 Author: davide Date: Mon Mar 4 19:10:39 2013 New Revision: 247812 URL: http://svnweb.freebsd.org/changeset/base/247812 Log: MFcalloutng: Dcoument the new functions added to condvar(9), sleep(9), sleepqueue(9) KPIs. Also document recent changes in timeout(9) and eventtimers(4). Modified: head/share/man/man4/eventtimers.4 head/share/man/man9/Makefile head/share/man/man9/condvar.9 head/share/man/man9/sleep.9 head/share/man/man9/sleepqueue.9 head/share/man/man9/timeout.9 Modified: head/share/man/man4/eventtimers.4 ============================================================================== --- head/share/man/man4/eventtimers.4 Mon Mar 4 19:01:38 2013 (r247811) +++ head/share/man/man4/eventtimers.4 Mon Mar 4 19:10:39 2013 (r247812) @@ -143,14 +143,6 @@ By default this options is disabled. If chosen timer is per-CPU and runs in periodic mode, this option has no effect - all interrupts are always generating. -.It Va kern.eventtimer.activetick -makes each CPU to receive all kinds of timer interrupts when they are busy. -Disabling it allows to skip some -.Fn hardclock -calls in some cases. -By default this options is enabled. -If chosen timer is per-CPU, this option has no effect - all interrupts are -always generating, as timer reprogramming is too expensive for that case. .El .Sh SEE ALSO .Xr apic 4 , Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Mar 4 19:01:38 2013 (r247811) +++ head/share/man/man9/Makefile Mon Mar 4 19:10:39 2013 (r247812) @@ -1196,9 +1196,13 @@ MLINKS+=signal.9 cursig.9 \ signal.9 SIG_STOPSIGMASK.9 \ signal.9 trapsignal.9 MLINKS+=sleep.9 msleep.9 \ + sleep.9 msleep_sbt.9 \ sleep.9 msleep_spin.9 \ + sleep.9 msleep_spin_sbt.9 \ sleep.9 pause.9 \ + sleep.9 pause_sbt.9 \ sleep.9 tsleep.9 \ + sleep.9 tsleep_sbt.9 \ sleep.9 wakeup.9 \ sleep.9 wakeup_one.9 MLINKS+=sleepqueue.9 init_sleepqueues.9 \ @@ -1213,6 +1217,7 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_release.9 \ sleepqueue.9 sleepq_remove.9 \ sleepqueue.9 sleepq_set_timeout.9 \ + sleepqueue.9 sleepq_set_timeout_sbt.9 \ sleepqueue.9 sleepq_signal.9 \ sleepqueue.9 sleepq_timedwait.9 \ sleepqueue.9 sleepq_timedwait_sig.9 \ @@ -1335,6 +1340,9 @@ MLINKS+=timeout.9 callout.9 \ timeout.9 callout_init_rw.9 \ timeout.9 callout_pending.9 \ timeout.9 callout_reset.9 \ + timeout.9 callout_reset_sbt.9 \ + timeout.9 callout_reset_on.9 \ + timeout.9 callout_reset_sbt_on.9 \ timeout.9 callout_schedule.9 \ timeout.9 callout_stop.9 \ timeout.9 untimeout.9 Modified: head/share/man/man9/condvar.9 ============================================================================== --- head/share/man/man9/condvar.9 Mon Mar 4 19:01:38 2013 (r247811) +++ head/share/man/man9/condvar.9 Mon Mar 4 19:10:39 2013 (r247812) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2007 +.Dd February 19, 2013 .Dt CONDVAR 9 .Os .Sh NAME @@ -37,7 +37,9 @@ .Nm cv_wait_sig , .Nm cv_wait_unlock , .Nm cv_timedwait , +.Nm cv_timedwait_sbt , .Nm cv_timedwait_sig , +.Nm cv_timedwait_sig_sbt , .Nm cv_signal , .Nm cv_broadcast , .Nm cv_broadcastpri , @@ -60,7 +62,13 @@ .Ft int .Fn cv_timedwait "struct cv *cvp" "lock" "int timo" .Ft int +.Fn cv_timedwait_sbt "struct cv *cvp" "lock" "sbintime_t sbt" \ +"sbintime_t pr" "int flags" +.Ft int .Fn cv_timedwait_sig "struct cv *cvp" "lock" "int timo" +.Ft int +.Fn cv_timedwait_sig_sbt "struct cv *cvp" "lock" "sbintime_t sbt" \ +"sbintime_t pr" "int flags" .Ft void .Fn cv_signal "struct cv *cvp" .Ft void @@ -191,6 +199,25 @@ if a signal is caught, or 0 if signaled .Fn cv_signal or .Fn cv_broadcast . +.Pp +.Fn cv_timedwait_sbt +and +.Fn cv_timedwait_sig_sbt +functions take +.Fa sbt +argument instead of +.Fa timo . +It allows to specify relative or absolute unblock time with higher resolution +in form of +.Vt sbintime_t . +The parameter +.Fa pr +allows to specify wanted absolute event precision. +The parameter +.Fa flags +allows to pass additional +.Fn callout_reset_sbt +flags. .Sh RETURN VALUES If successful, .Fn cv_wait_sig , @@ -230,4 +257,5 @@ Timeout expired. .Xr rwlock 9 , .Xr sema 9 , .Xr sleep 9 , -.Xr sx 9 +.Xr sx 9 , +.Xr timeout 9 Modified: head/share/man/man9/sleep.9 ============================================================================== --- head/share/man/man9/sleep.9 Mon Mar 4 19:01:38 2013 (r247811) +++ head/share/man/man9/sleep.9 Mon Mar 4 19:10:39 2013 (r247812) @@ -25,14 +25,18 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2009 +.Dd February 19, 2013 .Dt SLEEP 9 .Os .Sh NAME .Nm msleep , +.Nm msleep_sbt , .Nm msleep_spin , +.Nm msleep_spin_sbt , .Nm pause , +.Nm pause_sbt , .Nm tsleep , +.Nm tsleep_sbt , .Nm wakeup .Nd wait for events .Sh SYNOPSIS @@ -42,11 +46,23 @@ .Ft int .Fn msleep "void *chan" "struct mtx *mtx" "int priority" "const char *wmesg" "int timo" .Ft int +.Fn msleep_sbt "void *chan" "struct mtx *mtx" "int priority" \ +"const char *wmesg" "sbintime_t sbt" "sbintime_t pr" "int flags" +.Ft int .Fn msleep_spin "void *chan" "struct mtx *mtx" "const char *wmesg" "int timo" +.Ft int +.Fn msleep_spin_sbt "void *chan" "struct mtx *mtx" "const char *wmesg" \ +"sbintime_t sbt" "sbintime_t pr" "int flags" .Ft void .Fn pause "const char *wmesg" "int timo" +.Ft void +.Fn pause_sbt "const char *wmesg" "sbintime_t sbt" "sbintime_t pr" \ + "int flags" .Ft int .Fn tsleep "void *chan" "int priority" "const char *wmesg" "int timo" +.Ft int +.Fn tsleep_sbt "void *chan" "int priority" "const char *wmesg" \ +"sbintime_t sbt" "sbintime_t pr" "int flags" .Ft void .Fn wakeup "void *chan" .Ft void @@ -148,6 +164,27 @@ If the timeout expires, then the sleep function will return .Er EWOULDBLOCK . .Pp +.Fn msleep_sbt , +.Fn msleep_spin_sbt , +.Fn pause_sbt +and +.Fn tsleep_sbt +functions take +.Fa sbt +parameter instead of +.Fa timo . +It allows to specify relative or absolite wakeup time with higher resolution +in form of +.Vt sbintime_t . +The parameter +.Fa pr +allows to specify wanted absolute event precision. +The parameter +.Fa flags +allows to pass additional +.Fn callout_reset_sbt +flags. +.Pp Several of the sleep functions including .Fn msleep , .Fn msleep_spin , @@ -301,7 +338,8 @@ A non-zero timeout was specified and the .Xr mi_switch 9 , .Xr mtx_sleep 9 , .Xr rw_sleep 9 , -.Xr sx_sleep 9 +.Xr sx_sleep 9 , +.Xr timeout 9 .Sh HISTORY The functions .Fn sleep Modified: head/share/man/man9/sleepqueue.9 ============================================================================== --- head/share/man/man9/sleepqueue.9 Mon Mar 4 19:01:38 2013 (r247811) +++ head/share/man/man9/sleepqueue.9 Mon Mar 4 19:10:39 2013 (r247812) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd February 19, 2013 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -41,6 +41,7 @@ .Nm sleepq_remove , .Nm sleepq_signal , .Nm sleepq_set_timeout , +.Nm sleepq_set_timeout_sbt , .Nm sleepq_sleepcnt , .Nm sleepq_timedwait , .Nm sleepq_timedwait_sig , @@ -79,6 +80,9 @@ .Fn sleepq_signal "void *wchan" "int flags" "int pri" "int queue" .Ft void .Fn sleepq_set_timeout "void *wchan" "int timo" +.Ft void +.Fn sleepq_set_timeout_sbt "void *wchan" "sbintime_t sbt" \ +"sbintime_t pr" "int flags" .Ft u_int .Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int @@ -231,6 +235,23 @@ The .Fa timo parameter should specify the timeout value in ticks. .Pp +.Fn sleepq_set_timeout_sbt +function takes +.Fa sbt +argument instead of +.Fa timo . +It allows to specify relative or absolute wakeup time with higher resolution +in form of +.Vt sbintime_t . +The parameter +.Fa pr +allows to specify wanted absolute event precision. +The parameter +.Fa flags +allows to pass additional +.Fn callout_reset_sbt +flags. +.Pp The current thread may be marked interruptible by calling .Fn sleepq_catch_signals with @@ -400,4 +421,5 @@ than manipulating sleep queues directly. .Xr condvar 9 , .Xr runqueue 9 , .Xr scheduler 9 , -.Xr sleep 9 +.Xr sleep 9 , +.Xr timeout 9 Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Mon Mar 4 19:01:38 2013 (r247811) +++ head/share/man/man9/timeout.9 Mon Mar 4 19:10:39 2013 (r247812) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2012 +.Dd February 19, 2013 .Dt TIMEOUT 9 .Os .Sh NAME @@ -44,6 +44,9 @@ .Nm callout_reset , .Nm callout_reset_on , .Nm callout_reset_curcpu , +.Nm callout_reset_sbt , +.Nm callout_reset_sbt_on , +.Nm callout_reset_sbt_curcpu , .Nm callout_schedule , .Nm callout_schedule_on , .Nm callout_schedule_curcpu , @@ -82,6 +85,9 @@ struct callout_handle handle = CALLOUT_H .Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \ "void *arg" "int cpu" .Ft int +.Fn callout_reset_sbt_on "struct callout *c" "sbintime_t sbt" \ +"sbintime_t pr" "timeout_t *func" "void *arg" "int cpu" "int flags" +.Ft int .Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ "void *arg" .Ft int @@ -326,6 +332,33 @@ and .Fn callout_schedule but take an extra parameter specifying the target CPU for the callout. .Pp +The function +.Fn callout_reset_sbt_on +allows to get higher time resolution, taking relative or absolute time +and precision instead of relative ticks count. +If specified time is in past, it will be silently converted to present +to run handler as soon as possible. +.Pp +The following +.Fa flags +may be specified: +.Bl -tag -width ".Dv C_DIRECT_EXEC" +.It Dv C_ALSOLUTE +Handle the +.Fa sbt +argument as absolute time of the event since boot, or relative time otherwise. +.It Dv C_DIRECT_EXEC +Run handler directly from hardware interrupt context instead of softclock swi. +It is faster, but puts more constraints on handlers. +Handlers may use only spin mutexes for locking, and they must be fast because +they run with absolute priority. +.It Fn C_PREL +Specifies relative event time precision as binary logarithm of time interval +divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4, etc. +Smaller value allows to aggregate more events in one timer interrupt to +reduce processing overhead and power consumption. +.El +.Pp The functions .Fn callout_reset_curcpu and From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 21:09:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0173758; Mon, 4 Mar 2013 21:09:22 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D2D73152B; Mon, 4 Mar 2013 21:09:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24L9M3f005917; Mon, 4 Mar 2013 21:09:22 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24L9Mm1005916; Mon, 4 Mar 2013 21:09:22 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303042109.r24L9Mm1005916@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 21:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247813 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 21:09:22 -0000 Author: davide Date: Mon Mar 4 21:09:22 2013 New Revision: 247813 URL: http://svnweb.freebsd.org/changeset/base/247813 Log: Use C99 'bool' rather than Machish 'boolean_t'. Requested by: jhb Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Mar 4 19:10:39 2013 (r247812) +++ head/sys/kern/kern_timeout.c Mon Mar 4 21:09:22 2013 (r247813) @@ -126,8 +126,8 @@ struct cc_exec { int ce_migration_cpu; sbintime_t ce_migration_time; #endif - boolean_t cc_cancel; - boolean_t cc_waiting; + bool cc_cancel; + bool cc_waiting; }; /* From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 21:18:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 048F4BC2; Mon, 4 Mar 2013 21:18:47 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DCA0B15C2; Mon, 4 Mar 2013 21:18:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24LIk8I008921; Mon, 4 Mar 2013 21:18:46 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24LIj5e008913; Mon, 4 Mar 2013 21:18:45 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201303042118.r24LIj5e008913@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 4 Mar 2013 21:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247814 - in head: . sys/amd64/conf sys/cam/ctl sys/conf sys/i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 21:18:47 -0000 Author: ken Date: Mon Mar 4 21:18:45 2013 New Revision: 247814 URL: http://svnweb.freebsd.org/changeset/base/247814 Log: Re-enable CTL in GENERIC on i386 and amd64, but turn on the CTL disable tunable by default. This will allow GENERIC configurations to boot on small memory boxes, but not require end users who want to use CTL to recompile their kernel. They can simply set kern.cam.ctl.disable=0 in loader.conf. The eventual solution to the memory usage problem is to change the way CTL allocates memory to be more configurable, but this should fix things for small memory situations in the mean time. UPDATING: Explain the change in the CTL configuration, and how users can enable CTL if they would like to use it. sys/conf/options: Add a new option, CTL_DISABLE, that prevents CTL from initializing. ctl.c: If CTL_DISABLE is turned on, don't initialize. i386/conf/GENERIC, amd64/conf/GENERIC: Re-enable device ctl, and add the CTL_DISABLE option. Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/cam/ctl/ctl.c head/sys/conf/options head/sys/i386/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Mar 4 21:09:22 2013 (r247813) +++ head/UPDATING Mon Mar 4 21:18:45 2013 (r247814) @@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130304: + The ctl device has been re-enabled in GENERIC for i386 and amd64, + but does not initialize by default (because of the new CTL_DISABLE + option) to save memory. To re-enable it, remove the CTL_DISABLE + option from the kernel config file or set kern.cam.ctl.disable=0 + in /boot/loader.conf. + 20130301: The ctl device has been disabled in GENERIC for i386 and amd64. This was done due to the extra memory being allocated at system Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Mar 4 21:09:22 2013 (r247813) +++ head/sys/amd64/conf/GENERIC Mon Mar 4 21:18:45 2013 (r247814) @@ -138,7 +138,10 @@ device sa # Sequential Access (tape et device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) -#device ctl # CAM Target Layer +device ctl # CAM Target Layer +options CTL_DISABLE # Disable CTL by default to save memory. + # Re-enable with kern.cam.ctl.disable=0 in + # /boot/loader.conf # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Mar 4 21:09:22 2013 (r247813) +++ head/sys/cam/ctl/ctl.c Mon Mar 4 21:18:45 2013 (r247814) @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_ctl.h" + struct ctl_softc *control_softc = NULL; /* @@ -317,7 +319,11 @@ static int persis_offset; static uint8_t ctl_pause_rtr; static int ctl_is_single; static int index_to_aps_page; +#ifdef CTL_DISABLE +int ctl_disable = 1; +#else int ctl_disable = 0; +#endif SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); SYSCTL_INT(_kern_cam_ctl, OID_AUTO, disable, CTLFLAG_RDTUN, &ctl_disable, 0, Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Mar 4 21:09:22 2013 (r247813) +++ head/sys/conf/options Mon Mar 4 21:18:45 2013 (r247814) @@ -329,6 +329,9 @@ SCSI_PT_DEFAULT_TIMEOUT opt_pt.h # Options used only in cam/scsi/scsi_ses.c SES_ENABLE_PASSTHROUGH opt_ses.h +# Options used only in cam/ctl +CTL_DISABLE opt_ctl.h + # Options used in dev/sym/ (Symbios SCSI driver). SYM_SETUP_LP_PROBE_MAP opt_sym.h #-Low Priority Probe Map (bits) # Allows the ncr to take precedence Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Mar 4 21:09:22 2013 (r247813) +++ head/sys/i386/conf/GENERIC Mon Mar 4 21:18:45 2013 (r247814) @@ -146,7 +146,10 @@ device sa # Sequential Access (tape et device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) -#device ctl # CAM Target Layer +device ctl # CAM Target Layer +options CTL_DISABLE # Disable CTL by default to save memory. + # Re-enable with kern.cam.ctl.disable=0 in + # /boot/loader.conf # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 21:20:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 24EA0E58; Mon, 4 Mar 2013 21:20:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17EC715E3; Mon, 4 Mar 2013 21:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24LKDEr009455; Mon, 4 Mar 2013 21:20:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24LKDWv009452; Mon, 4 Mar 2013 21:20:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303042120.r24LKDWv009452@svn.freebsd.org> From: Alexander Motin Date: Mon, 4 Mar 2013 21:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247815 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 21:20:14 -0000 Author: mav Date: Mon Mar 4 21:20:13 2013 New Revision: 247815 URL: http://svnweb.freebsd.org/changeset/base/247815 Log: Add quirk to enable headphones redirection on Lenovo X220. PR: kern/174876 MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Mar 4 21:18:45 2013 (r247814) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Mar 4 21:20:13 2013 (r247815) @@ -333,6 +333,13 @@ hdac_pin_patch(struct hdaa_widget *w) patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_CX20590 && + subid == LENOVO_X220_SUBVENDOR) { + switch (nid) { + case 25: + patch = "as=1 seq=15"; + break; + } } if (patch != NULL) Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Mon Mar 4 21:18:45 2013 (r247814) +++ head/sys/dev/sound/pci/hda/hdac.h Mon Mar 4 21:20:13 2013 (r247815) @@ -220,6 +220,7 @@ #define LENOVO_3KN200_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_B450_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3a0d) #define LENOVO_TCA55_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x1015) +#define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da) #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 21:52:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 868ADC02; Mon, 4 Mar 2013 21:52:13 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4819F175E; Mon, 4 Mar 2013 21:52:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24LqDEu020113; Mon, 4 Mar 2013 21:52:13 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24LqDA7020112; Mon, 4 Mar 2013 21:52:13 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303042152.r24LqDA7020112@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 21:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247818 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 21:52:13 -0000 Author: davide Date: Mon Mar 4 21:52:12 2013 New Revision: 247818 URL: http://svnweb.freebsd.org/changeset/base/247818 Log: Complete r247813: Use true/false instead of TRUE/FALSE. Reported by: attilio Requested by: jhb Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Mar 4 21:36:34 2013 (r247817) +++ head/sys/kern/kern_timeout.c Mon Mar 4 21:52:12 2013 (r247818) @@ -215,8 +215,8 @@ cc_cce_cleanup(struct callout_cpu *cc, i cc->cc_exec_entity[direct].cc_curr = NULL; cc->cc_exec_entity[direct].cc_next = NULL; - cc->cc_exec_entity[direct].cc_cancel = FALSE; - cc->cc_exec_entity[direct].cc_waiting = FALSE; + cc->cc_exec_entity[direct].cc_cancel = false; + cc->cc_exec_entity[direct].cc_waiting = false; #ifdef SMP cc->cc_exec_entity[direct].ce_migration_cpu = CPUBLOCK; cc->cc_exec_entity[direct].ce_migration_time = 0; @@ -621,7 +621,7 @@ softclock_call_cc(struct callout *c, str else c->c_flags &= ~CALLOUT_PENDING; cc->cc_exec_entity[direct].cc_curr = c; - cc->cc_exec_entity[direct].cc_cancel = FALSE; + cc->cc_exec_entity[direct].cc_cancel = false; CC_UNLOCK(cc); if (c_lock != NULL) { class->lc_lock(c_lock, sharedlock); @@ -634,7 +634,7 @@ softclock_call_cc(struct callout *c, str goto skip; } /* The callout cannot be stopped now. */ - cc->cc_exec_entity[direct].cc_cancel = TRUE; + cc->cc_exec_entity[direct].cc_cancel = true; if (c_lock == &Giant.lock_object) { #ifdef CALLOUT_PROFILING (*gcalls)++; @@ -700,7 +700,7 @@ skip: */ c->c_flags &= ~CALLOUT_DFRMIGRATION; } - cc->cc_exec_entity[direct].cc_waiting = FALSE; + cc->cc_exec_entity[direct].cc_waiting = false; CC_UNLOCK(cc); wakeup(&cc->cc_exec_entity[direct].cc_waiting); CC_LOCK(cc); @@ -954,7 +954,7 @@ callout_reset_sbt_on(struct callout *c, * can cancel the callout if it has not really started. */ if (c->c_lock != NULL && !cc->cc_exec_entity[direct].cc_cancel) - cancelled = cc->cc_exec_entity[direct].cc_cancel = TRUE; + cancelled = cc->cc_exec_entity[direct].cc_cancel = true; if (cc->cc_exec_entity[direct].cc_waiting) { /* * Someone has called callout_drain to kill this @@ -1135,7 +1135,7 @@ again: * will be packed up, just let softclock() * take care of it. */ - cc->cc_exec_entity[direct].cc_waiting = TRUE; + cc->cc_exec_entity[direct].cc_waiting = true; DROP_GIANT(); CC_UNLOCK(cc); sleepq_add( @@ -1161,7 +1161,7 @@ again: * lock, the callout will be skipped in * softclock(). */ - cc->cc_exec_entity[direct].cc_cancel = TRUE; + cc->cc_exec_entity[direct].cc_cancel = true; CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", c, c->c_func, c->c_arg); KASSERT(!cc_cce_migrating(cc, direct), From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 22:04:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 94E2920C; Mon, 4 Mar 2013 22:04:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 77E5217EF; Mon, 4 Mar 2013 22:04:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24M4FUv023538; Mon, 4 Mar 2013 22:04:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24M4FI2023536; Mon, 4 Mar 2013 22:04:15 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201303042204.r24M4FI2023536@svn.freebsd.org> From: Ian Lepore Date: Mon, 4 Mar 2013 22:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247819 - stable/8/sbin/devd 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 22:04:15 -0000 Author: ian Date: Mon Mar 4 22:04:14 2013 New Revision: 247819 URL: http://svnweb.freebsd.org/changeset/base/247819 Log: MFC r209583 ... Expand system into my_system, and add the necessary tidyness that we need. Close the pidfile. Then close all descriptors >= 3 to avoid information leakage to children. This solves the problem of not being able to restart devd when you have, for example, a dhclient forked to configure your network... Modified: stable/8/sbin/devd/devd.cc stable/8/sbin/devd/devd.hh Directory Properties: stable/8/sbin/devd/ (props changed) Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Mon Mar 4 21:52:12 2013 (r247818) +++ stable/8/sbin/devd/devd.cc Mon Mar 4 22:04:14 2013 (r247819) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002-2003 M. Warner Losh. + * Copyright (c) 2002-2010 M. Warner Losh. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,6 +22,35 @@ * 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. + * + * my_system is a variation on lib/libc/stdlib/system.c: + * + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ /* @@ -41,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -50,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -153,13 +184,67 @@ action::~action() // nothing } +static int +my_system(const char *command) +{ + pid_t pid, savedpid; + int pstat; + struct sigaction ign, intact, quitact; + sigset_t newsigblock, oldsigblock; + + if (!command) /* just checking... */ + return(1); + + /* + * Ignore SIGINT and SIGQUIT, block SIGCHLD. Remember to save + * existing signal dispositions. + */ + ign.sa_handler = SIG_IGN; + ::sigemptyset(&ign.sa_mask); + ign.sa_flags = 0; + ::sigaction(SIGINT, &ign, &intact); + ::sigaction(SIGQUIT, &ign, &quitact); + ::sigemptyset(&newsigblock); + ::sigaddset(&newsigblock, SIGCHLD); + ::sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); + switch (pid = ::fork()) { + case -1: /* error */ + break; + case 0: /* child */ + /* + * Restore original signal dispositions and exec the command. + */ + ::sigaction(SIGINT, &intact, NULL); + ::sigaction(SIGQUIT, &quitact, NULL); + ::sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + /* + * Close the PID file, and all other open descriptors. + * Inherit std{in,out,err} only. + */ + cfg.close_pidfile(); + ::closefrom(3); + ::execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); + ::_exit(127); + default: /* parent */ + savedpid = pid; + do { + pid = ::wait4(savedpid, &pstat, 0, (struct rusage *)0); + } while (pid == -1 && errno == EINTR); + break; + } + ::sigaction(SIGINT, &intact, NULL); + ::sigaction(SIGQUIT, &quitact, NULL); + ::sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + return (pid == -1 ? -1 : pstat); +} + bool action::do_action(config &c) { string s = c.expand_string(_cmd); if (Dflag) fprintf(stderr, "Executing '%s'\n", s.c_str()); - ::system(s.c_str()); + my_system(s.c_str()); return (true); } @@ -403,6 +488,13 @@ config::write_pidfile() } void +config::close_pidfile() +{ + + pidfile_close(pfh); +} + +void config::remove_pidfile() { Modified: stable/8/sbin/devd/devd.hh ============================================================================== --- stable/8/sbin/devd/devd.hh Mon Mar 4 21:52:12 2013 (r247818) +++ stable/8/sbin/devd/devd.hh Mon Mar 4 22:04:14 2013 (r247819) @@ -154,6 +154,7 @@ public: void set_pidfile(const char *); void reset(); void parse(); + void close_pidfile(); void open_pidfile(); void write_pidfile(); void remove_pidfile(); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 22:07:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 883AB3A9; Mon, 4 Mar 2013 22:07:37 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6259B180E; Mon, 4 Mar 2013 22:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24M7blZ024136; Mon, 4 Mar 2013 22:07:37 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24M7brA024135; Mon, 4 Mar 2013 22:07:37 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201303042207.r24M7brA024135@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 4 Mar 2013 22:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247820 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 22:07:37 -0000 Author: gibbs Date: Mon Mar 4 22:07:36 2013 New Revision: 247820 URL: http://svnweb.freebsd.org/changeset/base/247820 Log: Fix assertion failure when using userland DTrace probes from the pid provider on a kernel compiled with INVARIANTS. sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c: In fasttrap_probe_pid(), attempts to write to the address space of the thread that fired the probe must be performed with the process of the thread held. Use _PHOLD() to ensure this is the case. In fasttrap_probe_pid(), use proc_write_regs() instead of calling set_regs() directly. proc_write_regs() performs invariant checks to verify the calling environment of set_regs(). PROC_LOCK()/UNLOCK() around the call to proc_write_regs() so that it's invariants are satisfied. Sponsored by: Spectra Logic Corporation Reviewed by: gnn, rpaulo MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Mar 4 22:04:14 2013 (r247819) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Mar 4 22:07:36 2013 (r247820) @@ -1034,6 +1034,7 @@ fasttrap_pid_probe(struct reg *rp) #endif PROC_LOCK(p); + _PHOLD(p); pid = p->p_pid; #if defined(sun) pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; @@ -1059,6 +1060,7 @@ fasttrap_pid_probe(struct reg *rp) #if defined(sun) mutex_exit(pid_mtx); #endif + _PRELE(p); PROC_UNLOCK(p); return (-1); } @@ -1732,7 +1734,6 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); - #if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { #else @@ -1794,7 +1795,11 @@ done: } rp->r_rip = new_pc; - set_regs(curthread, rp); + + PROC_LOCK(p); + proc_write_regs(curthread, rp); + _PRELE(p); + PROC_UNLOCK(p); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 22:27:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57DFB73C; Mon, 4 Mar 2013 22:27:33 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 4480E1897; Mon, 4 Mar 2013 22:27:33 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 438A01A3D17; Mon, 4 Mar 2013 14:27:26 -0800 (PST) Message-ID: <51351FCA.7040303@mu.org> Date: Mon, 04 Mar 2013 14:27:22 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: "Kenneth D. Merry" Subject: Re: svn commit: r247814 - in head: . sys/amd64/conf sys/cam/ctl sys/conf sys/i386/conf References: <201303042118.r24LIj5e008913@svn.freebsd.org> In-Reply-To: <201303042118.r24LIj5e008913@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 22:27:33 -0000 Ken, By the time ctl_init is called, it looks like enough of the vm is there such that you could probe for physmem. (I may be wrong and apologize if so) Look at kern_mib.c: > sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) > { > u_long val; > > val = ctob(physmem); > return (sysctl_handle_long(oidp, &val, 0, req)); > } > > SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD, > 0, 0, sysctl_hw_physmem, "LU", ""); Then the logic could be: IF (set(tunable_ctl_onoff)) ctl_onoff = tunable_ctl_onoff; ELSE ctl_onoff = physmem > ctl_threshold; This would get you much more people testing the code and the best out of the box experience for people downloading. Hope this helps. -Alfred On 3/4/13 1:18 PM, Kenneth D. Merry wrote: > Author: ken > Date: Mon Mar 4 21:18:45 2013 > New Revision: 247814 > URL: http://svnweb.freebsd.org/changeset/base/247814 > > Log: > Re-enable CTL in GENERIC on i386 and amd64, but turn on the CTL disable > tunable by default. > > This will allow GENERIC configurations to boot on small memory boxes, but > not require end users who want to use CTL to recompile their kernel. They > can simply set kern.cam.ctl.disable=0 in loader.conf. > > The eventual solution to the memory usage problem is to change the way > CTL allocates memory to be more configurable, but this should fix things > for small memory situations in the mean time. > > UPDATING: Explain the change in the CTL configuration, and > how users can enable CTL if they would like to use > it. > > sys/conf/options: Add a new option, CTL_DISABLE, that prevents CTL > from initializing. > > ctl.c: If CTL_DISABLE is turned on, don't initialize. > > i386/conf/GENERIC, > amd64/conf/GENERIC: Re-enable device ctl, and add the CTL_DISABLE > option. > > Modified: > head/UPDATING > head/sys/amd64/conf/GENERIC > head/sys/cam/ctl/ctl.c > head/sys/conf/options > head/sys/i386/conf/GENERIC > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Mon Mar 4 21:09:22 2013 (r247813) > +++ head/UPDATING Mon Mar 4 21:18:45 2013 (r247814) > @@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20130304: > + The ctl device has been re-enabled in GENERIC for i386 and amd64, > + but does not initialize by default (because of the new CTL_DISABLE > + option) to save memory. To re-enable it, remove the CTL_DISABLE > + option from the kernel config file or set kern.cam.ctl.disable=0 > + in /boot/loader.conf. > + > 20130301: > The ctl device has been disabled in GENERIC for i386 and amd64. > This was done due to the extra memory being allocated at system > > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERIC Mon Mar 4 21:09:22 2013 (r247813) > +++ head/sys/amd64/conf/GENERIC Mon Mar 4 21:18:45 2013 (r247814) > @@ -138,7 +138,10 @@ device sa # Sequential Access (tape et > device cd # CD > device pass # Passthrough device (direct ATA/SCSI access) > device ses # Enclosure Services (SES and SAF-TE) > -#device ctl # CAM Target Layer > +device ctl # CAM Target Layer > +options CTL_DISABLE # Disable CTL by default to save memory. > + # Re-enable with kern.cam.ctl.disable=0 in > + # /boot/loader.conf > > # RAID controllers interfaced to the SCSI subsystem > device amr # AMI MegaRAID > > Modified: head/sys/cam/ctl/ctl.c > ============================================================================== > --- head/sys/cam/ctl/ctl.c Mon Mar 4 21:09:22 2013 (r247813) > +++ head/sys/cam/ctl/ctl.c Mon Mar 4 21:18:45 2013 (r247814) > @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include "opt_ctl.h" > + > struct ctl_softc *control_softc = NULL; > > /* > @@ -317,7 +319,11 @@ static int persis_offset; > static uint8_t ctl_pause_rtr; > static int ctl_is_single; > static int index_to_aps_page; > +#ifdef CTL_DISABLE > +int ctl_disable = 1; > +#else > int ctl_disable = 0; > +#endif > > SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); > SYSCTL_INT(_kern_cam_ctl, OID_AUTO, disable, CTLFLAG_RDTUN, &ctl_disable, 0, > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Mon Mar 4 21:09:22 2013 (r247813) > +++ head/sys/conf/options Mon Mar 4 21:18:45 2013 (r247814) > @@ -329,6 +329,9 @@ SCSI_PT_DEFAULT_TIMEOUT opt_pt.h > # Options used only in cam/scsi/scsi_ses.c > SES_ENABLE_PASSTHROUGH opt_ses.h > > +# Options used only in cam/ctl > +CTL_DISABLE opt_ctl.h > + > # Options used in dev/sym/ (Symbios SCSI driver). > SYM_SETUP_LP_PROBE_MAP opt_sym.h #-Low Priority Probe Map (bits) > # Allows the ncr to take precedence > > Modified: head/sys/i386/conf/GENERIC > ============================================================================== > --- head/sys/i386/conf/GENERIC Mon Mar 4 21:09:22 2013 (r247813) > +++ head/sys/i386/conf/GENERIC Mon Mar 4 21:18:45 2013 (r247814) > @@ -146,7 +146,10 @@ device sa # Sequential Access (tape et > device cd # CD > device pass # Passthrough device (direct ATA/SCSI access) > device ses # Enclosure Services (SES and SAF-TE) > -#device ctl # CAM Target Layer > +device ctl # CAM Target Layer > +options CTL_DISABLE # Disable CTL by default to save memory. > + # Re-enable with kern.cam.ctl.disable=0 in > + # /boot/loader.conf > > # RAID controllers interfaced to the SCSI subsystem > device amr # AMI MegaRAID > From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 22:41:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 05A67A83; Mon, 4 Mar 2013 22:41:50 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC8C4B0; Mon, 4 Mar 2013 22:41:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24MfnNv096735; Mon, 4 Mar 2013 22:41:49 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24MfnD2096733; Mon, 4 Mar 2013 22:41:49 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303042241.r24MfnD2096733@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 22:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247821 - in head: . sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 22:41:50 -0000 Author: davide Date: Mon Mar 4 22:41:49 2013 New Revision: 247821 URL: http://svnweb.freebsd.org/changeset/base/247821 Log: - Bump __FreeBSD_version after recent callout(9) changes. - Add an entry in UPDATING to notice users about breakages. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Mar 4 22:07:36 2013 (r247820) +++ head/UPDATING Mon Mar 4 22:41:49 2013 (r247821) @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20130304: + Recent commits to callout(9) changed the size of struct callout, + so the KBI is probably heavily disturbed. Also, some functions + in callout(9)/sleep(9)/sleepqueue(9)/condvar(9) KPIs were replaced + by macros. Every kernel module using it won't load, so rebuild + is requested. + The ctl device has been re-enabled in GENERIC for i386 and amd64, but does not initialize by default (because of the new CTL_DISABLE option) to save memory. To re-enable it, remove the CTL_DISABLE Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Mar 4 22:07:36 2013 (r247820) +++ head/sys/sys/param.h Mon Mar 4 22:41:49 2013 (r247821) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000028 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000029 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 23:07:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0A7E28F; Mon, 4 Mar 2013 23:07:41 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C739F1A3; Mon, 4 Mar 2013 23:07:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r24N7fId028108; Mon, 4 Mar 2013 23:07:41 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24N7eMs028100; Mon, 4 Mar 2013 23:07:40 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201303042307.r24N7eMs028100@svn.freebsd.org> From: Jack F Vogel Date: Mon, 4 Mar 2013 23:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247822 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:07:41 -0000 Author: jfv Date: Mon Mar 4 23:07:40 2013 New Revision: 247822 URL: http://svnweb.freebsd.org/changeset/base/247822 Log: First, sync to internal shared code, and then Fixes: - flow control - don't override user value on re-init - fix to make 1G optics work correctly - change to interrupt enabling - some bits were incorrect for certain hardware. - certain stats fixes, remove a duplicate increment of ierror, thanks to Scott Long for pointing these out. - shared code link interface changed, requiring some core code changes to accomodate this. - add an m_adj() to ETHER_ALIGN on the recieve side, this was requested by Mike Karels, thanks Mike. - Multicast code corrections also thanks to Mike Karels. Modified: head/sys/dev/ixgbe/LICENSE head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe_82598.c head/sys/dev/ixgbe/ixgbe_82599.c head/sys/dev/ixgbe/ixgbe_82599.h head/sys/dev/ixgbe/ixgbe_api.c head/sys/dev/ixgbe/ixgbe_api.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_common.h head/sys/dev/ixgbe/ixgbe_mbx.h head/sys/dev/ixgbe/ixgbe_osdep.h head/sys/dev/ixgbe/ixgbe_phy.c head/sys/dev/ixgbe/ixgbe_phy.h head/sys/dev/ixgbe/ixgbe_type.h head/sys/dev/ixgbe/ixgbe_vf.c head/sys/dev/ixgbe/ixgbe_vf.h head/sys/dev/ixgbe/ixgbe_x540.c head/sys/dev/ixgbe/ixgbe_x540.h head/sys/dev/ixgbe/ixv.c Modified: head/sys/dev/ixgbe/LICENSE ============================================================================== --- head/sys/dev/ixgbe/LICENSE Mon Mar 4 22:41:49 2013 (r247821) +++ head/sys/dev/ixgbe/LICENSE Mon Mar 4 23:07:40 2013 (r247822) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Mar 4 22:41:49 2013 (r247821) +++ head/sys/dev/ixgbe/ixgbe.c Mon Mar 4 23:07:40 2013 (r247822) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.0"; +char ixgbe_driver_version[] = "2.5.7 - HEAD"; /********************************************************************* * PCI Device ID Table @@ -83,7 +83,7 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} @@ -216,7 +216,6 @@ static device_method_t ixgbe_methods[] = DEVMETHOD(device_attach, ixgbe_attach), DEVMETHOD(device_detach, ixgbe_detach), DEVMETHOD(device_shutdown, ixgbe_shutdown), - DEVMETHOD_END }; @@ -596,6 +595,9 @@ ixgbe_attach(device_t dev) "PCIE, or x4 PCIE 2 slot is required.\n"); } + /* Set an initial default flow control value */ + adapter->fc = ixgbe_fc_full; + /* let hardware know driver is loaded */ ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); ctrl_ext |= IXGBE_CTRL_EXT_DRV_LOAD; @@ -1310,7 +1312,7 @@ ixgbe_init_locked(struct adapter *adapte tmp = IXGBE_LOW_DV(frame); hw->fc.low_water[0] = IXGBE_BT2KB(tmp); - adapter->fc = hw->fc.requested_mode = ixgbe_fc_full; + hw->fc.requested_mode = adapter->fc; hw->fc.pause_time = IXGBE_FC_PAUSE; hw->fc.send_xon = TRUE; } @@ -1680,7 +1682,7 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_active |= IFM_100_TX | IFM_FDX; break; case IXGBE_LINK_SPEED_1GB_FULL: - ifmr->ifm_active |= adapter->optics | IFM_FDX; + ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; break; case IXGBE_LINK_SPEED_10GB_FULL: ifmr->ifm_active |= adapter->optics | IFM_FDX; @@ -1932,18 +1934,6 @@ ixgbe_set_multi(struct adapter *adapter) bzero(mta, sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * MAX_NUM_MULTICAST_ADDRESSES); - fctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); - fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); - if (ifp->if_flags & IFF_PROMISC) - fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); - else if (ifp->if_flags & IFF_ALLMULTI) { - fctrl |= IXGBE_FCTRL_MPE; - fctrl &= ~IXGBE_FCTRL_UPE; - } else - fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); - - IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); - #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); #else @@ -1952,6 +1942,8 @@ ixgbe_set_multi(struct adapter *adapter) TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), &mta[mcnt * IXGBE_ETH_LENGTH_OF_ADDRESS], IXGBE_ETH_LENGTH_OF_ADDRESS); @@ -1963,9 +1955,24 @@ ixgbe_set_multi(struct adapter *adapter) if_maddr_runlock(ifp); #endif - update_ptr = mta; - ixgbe_update_mc_addr_list(&adapter->hw, - update_ptr, mcnt, ixgbe_mc_array_itr, TRUE); + fctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); + fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); + if (ifp->if_flags & IFF_PROMISC) + fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); + else if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES || + ifp->if_flags & IFF_ALLMULTI) { + fctrl |= IXGBE_FCTRL_MPE; + fctrl &= ~IXGBE_FCTRL_UPE; + } else + fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); + + IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); + + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) { + update_ptr = mta; + ixgbe_update_mc_addr_list(&adapter->hw, + update_ptr, mcnt, ixgbe_mc_array_itr, TRUE); + } return; } @@ -2172,7 +2179,7 @@ ixgbe_setup_optics(struct adapter *adapt { struct ixgbe_hw *hw = &adapter->hw; int layer; - + layer = ixgbe_get_supported_physical_layer(hw); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) { @@ -2651,7 +2658,7 @@ ixgbe_config_link(struct adapter *adapte taskqueue_enqueue(adapter->tq, &adapter->mod_task); } else { if (hw->mac.ops.check_link) - err = ixgbe_check_link(hw, &autoneg, + err = ixgbe_check_link(hw, &adapter->link_speed, &adapter->link_up, FALSE); if (err) goto out; @@ -2662,8 +2669,8 @@ ixgbe_config_link(struct adapter *adapte if (err) goto out; if (hw->mac.ops.setup_link) - err = hw->mac.ops.setup_link(hw, autoneg, - negotiate, adapter->link_up); + err = hw->mac.ops.setup_link(hw, + autoneg, adapter->link_up); } out: return; @@ -3713,6 +3720,8 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, M_PKTHDR, rxr->mbuf_sz); if (mp == NULL) goto update; + if (adapter->max_frame_size <= (MCLBYTES - ETHER_ALIGN)) + m_adj(mp, ETHER_ALIGN); } else mp = rxbuf->buf; @@ -4408,7 +4417,6 @@ ixgbe_rxeof(struct ix_queue *que) /* Make sure bad packets are discarded */ if (((staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) || (rxr->discard)) { - ifp->if_ierrors++; rxr->rx_discarded++; if (eop) rxr->discard = FALSE; @@ -4734,14 +4742,25 @@ ixgbe_enable_intr(struct adapter *adapte /* Enable Fan Failure detection */ if (hw->device_id == IXGBE_DEV_ID_82598AT) mask |= IXGBE_EIMS_GPI_SDP1; - else { - mask |= IXGBE_EIMS_ECC; - mask |= IXGBE_EIMS_GPI_SDP0; - mask |= IXGBE_EIMS_GPI_SDP1; - mask |= IXGBE_EIMS_GPI_SDP2; + + switch (adapter->hw.mac.type) { + case ixgbe_mac_82599EB: + mask |= IXGBE_EIMS_ECC; + mask |= IXGBE_EIMS_GPI_SDP0; + mask |= IXGBE_EIMS_GPI_SDP1; + mask |= IXGBE_EIMS_GPI_SDP2; +#ifdef IXGBE_FDIR + mask |= IXGBE_EIMS_FLOW_DIR; +#endif + break; + case ixgbe_mac_X540: + mask |= IXGBE_EIMS_ECC; #ifdef IXGBE_FDIR - mask |= IXGBE_EIMS_FLOW_DIR; + mask |= IXGBE_EIMS_FLOW_DIR; #endif + /* falls through */ + default: + break; } IXGBE_WRITE_REG(hw, IXGBE_EIMS, mask); @@ -4969,7 +4988,7 @@ ixgbe_handle_msf(void *context, int pend if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (hw->mac.ops.setup_link) - hw->mac.ops.setup_link(hw, autoneg, negotiate, TRUE); + hw->mac.ops.setup_link(hw, autoneg, TRUE); return; } @@ -5013,6 +5032,11 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.errbc += IXGBE_READ_REG(hw, IXGBE_ERRBC); adapter->stats.mspdc += IXGBE_READ_REG(hw, IXGBE_MSPDC); + /* + ** Note: these are for the 8 possible traffic classes, + ** which in current implementation is unused, + ** therefore only 0 should read real data. + */ for (int i = 0; i < 8; i++) { u32 mp; mp = IXGBE_READ_REG(hw, IXGBE_MPC(i)); @@ -5022,13 +5046,20 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.mpc[i] += mp; /* Running comprehensive total for stats display */ total_missed_rx += adapter->stats.mpc[i]; - if (hw->mac.type == ixgbe_mac_82598EB) + if (hw->mac.type == ixgbe_mac_82598EB) { adapter->stats.rnbc[i] += IXGBE_READ_REG(hw, IXGBE_RNBC(i)); + adapter->stats.qbtc[i] += + IXGBE_READ_REG(hw, IXGBE_QBTC(i)); + adapter->stats.qbrc[i] += + IXGBE_READ_REG(hw, IXGBE_QBRC(i)); + adapter->stats.pxonrxc[i] += + IXGBE_READ_REG(hw, IXGBE_PXONRXC(i)); + } else + adapter->stats.pxonrxc[i] += + IXGBE_READ_REG(hw, IXGBE_PXONRXCNT(i)); adapter->stats.pxontxc[i] += IXGBE_READ_REG(hw, IXGBE_PXONTXC(i)); - adapter->stats.pxonrxc[i] += - IXGBE_READ_REG(hw, IXGBE_PXONRXC(i)); adapter->stats.pxofftxc[i] += IXGBE_READ_REG(hw, IXGBE_PXOFFTXC(i)); adapter->stats.pxoffrxc[i] += @@ -5039,12 +5070,6 @@ ixgbe_update_stats_counters(struct adapt for (int i = 0; i < 16; i++) { adapter->stats.qprc[i] += IXGBE_READ_REG(hw, IXGBE_QPRC(i)); adapter->stats.qptc[i] += IXGBE_READ_REG(hw, IXGBE_QPTC(i)); - adapter->stats.qbrc[i] += IXGBE_READ_REG(hw, IXGBE_QBRC(i)); - adapter->stats.qbrc[i] += - ((u64)IXGBE_READ_REG(hw, IXGBE_QBRC(i)) << 32); - adapter->stats.qbtc[i] += IXGBE_READ_REG(hw, IXGBE_QBTC(i)); - adapter->stats.qbtc[i] += - ((u64)IXGBE_READ_REG(hw, IXGBE_QBTC(i)) << 32); adapter->stats.qprdc[i] += IXGBE_READ_REG(hw, IXGBE_QPRDC(i)); } adapter->stats.mlfc += IXGBE_READ_REG(hw, IXGBE_MLFC); @@ -5141,8 +5166,8 @@ ixgbe_update_stats_counters(struct adapt ifp->if_collisions = 0; /* Rx Errors */ - ifp->if_ierrors = total_missed_rx + adapter->stats.crcerrs + - adapter->stats.rlec; + ifp->if_iqdrops = total_missed_rx; + ifp->if_ierrors = adapter->stats.crcerrs + adapter->stats.rlec; } /** ixgbe_sysctl_tdh_handler - Handler function @@ -5528,10 +5553,13 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) ixgbe_disable_rx_drop(adapter); break; case ixgbe_fc_none: - default: adapter->hw.fc.requested_mode = ixgbe_fc_none; if (adapter->num_queues > 1) ixgbe_enable_rx_drop(adapter); + break; + default: + adapter->fc = last; + return (EINVAL); } /* Don't autoneg if forcing a value */ adapter->hw.fc.disable_fc_autoneg = TRUE; @@ -5560,7 +5588,7 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) last = adapter->advertise; error = sysctl_handle_int(oidp, &adapter->advertise, 0, req); - if ((error) || (adapter->advertise == -1)) + if ((error) || (req->newptr == NULL)) return (error); if (adapter->advertise == last) /* no change */ @@ -5568,11 +5596,11 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) if (!((hw->phy.media_type == ixgbe_media_type_copper) || (hw->phy.multispeed_fiber))) - return (error); + return (EINVAL); if ((adapter->advertise == 2) && (hw->mac.type != ixgbe_mac_X540)) { device_printf(dev, "Set Advertise: 100Mb on X540 only\n"); - return (error); + return (EINVAL); } if (adapter->advertise == 1) @@ -5582,11 +5610,13 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) else if (adapter->advertise == 3) speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_10GB_FULL; - else /* bogus value */ - return (error); + else { /* bogus value */ + adapter->advertise = last; + return (EINVAL); + } hw->mac.autotry_restart = TRUE; - hw->mac.ops.setup_link(hw, speed, TRUE, TRUE); + hw->mac.ops.setup_link(hw, speed, TRUE); return (error); } Modified: head/sys/dev/ixgbe/ixgbe_82598.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82598.c Mon Mar 4 22:41:49 2013 (r247821) +++ head/sys/dev/ixgbe/ixgbe_82598.c Mon Mar 4 23:07:40 2013 (r247822) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -49,18 +49,17 @@ static s32 ixgbe_check_mac_link_82598(st bool link_up_wait_to_complete); static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, - bool autoneg, bool autoneg_wait_to_complete); static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, - bool autoneg, bool autoneg_wait_to_complete); static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw); static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq); static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw); static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, u32 headroom, int strategy); - +static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, + u8 *sff8472_data); /** * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout * @hw: pointer to the HW structure @@ -155,6 +154,7 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw /* SFP+ Module */ phy->ops.read_i2c_eeprom = &ixgbe_read_i2c_eeprom_82598; + phy->ops.read_i2c_sff8472 = &ixgbe_read_i2c_sff8472_82598; /* Link */ mac->ops.check_link = &ixgbe_check_mac_link_82598; @@ -712,15 +712,15 @@ out: * ixgbe_setup_mac_link_82598 - Set MAC link speed * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg: TRUE if autonegotiation enabled * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Set the link speed in the AUTOC register and restarts link. **/ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, - ixgbe_link_speed speed, bool autoneg, + ixgbe_link_speed speed, bool autoneg_wait_to_complete) { + bool autoneg = FALSE; s32 status = IXGBE_SUCCESS; ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN; u32 curr_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); @@ -766,14 +766,12 @@ static s32 ixgbe_setup_mac_link_82598(st * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg: TRUE if autonegotiation enabled * @autoneg_wait_to_complete: TRUE if waiting is needed to complete * * Sets the link speed in the AUTOC register in the MAC and restarts link. **/ static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, - bool autoneg, bool autoneg_wait_to_complete) { s32 status; @@ -781,7 +779,7 @@ static s32 ixgbe_setup_copper_link_82598 DEBUGFUNC("ixgbe_setup_copper_link_82598"); /* Setup the PHY according to input speed */ - status = hw->phy.ops.setup_link_speed(hw, speed, autoneg, + status = hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete); /* Set up MAC */ ixgbe_start_mac_link_82598(hw, autoneg_wait_to_complete); @@ -1102,15 +1100,16 @@ s32 ixgbe_write_analog_reg8_82598(struct } /** - * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface. + * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface. * @hw: pointer to hardware structure - * @byte_offset: EEPROM byte offset to read + * @dev_addr: address to read from + * @byte_offset: byte offset to read from dev_addr * @eeprom_data: value read * * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. **/ -s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, - u8 *eeprom_data) +static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, + u8 byte_offset, u8 *eeprom_data) { s32 status = IXGBE_SUCCESS; u16 sfp_addr = 0; @@ -1118,7 +1117,7 @@ s32 ixgbe_read_i2c_eeprom_82598(struct i u16 sfp_stat = 0; u32 i; - DEBUGFUNC("ixgbe_read_i2c_eeprom_82598"); + DEBUGFUNC("ixgbe_read_i2c_phy_82598"); if (hw->phy.type == ixgbe_phy_nl) { /* @@ -1126,7 +1125,7 @@ s32 ixgbe_read_i2c_eeprom_82598(struct i * 0xC30D. These registers are used to talk to the SFP+ * module's EEPROM through the SDA/SCL (I2C) interface. */ - sfp_addr = (IXGBE_I2C_EEPROM_DEV_ADDR << 8) + byte_offset; + sfp_addr = (dev_addr << 8) + byte_offset; sfp_addr = (sfp_addr | IXGBE_I2C_EEPROM_READ_MASK); hw->phy.ops.write_reg(hw, IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR, @@ -1158,7 +1157,6 @@ s32 ixgbe_read_i2c_eeprom_82598(struct i *eeprom_data = (u8)(sfp_data >> 8); } else { status = IXGBE_ERR_PHY; - goto out; } out: @@ -1166,6 +1164,36 @@ out: } /** + * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @byte_offset: EEPROM byte offset to read + * @eeprom_data: value read + * + * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. + **/ +s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, + u8 *eeprom_data) +{ + return ixgbe_read_i2c_phy_82598(hw, IXGBE_I2C_EEPROM_DEV_ADDR, + byte_offset, eeprom_data); +} + +/** + * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @byte_offset: byte offset at address 0xA2 + * @eeprom_data: value read + * + * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C + **/ +static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, + u8 *sff8472_data) +{ + return ixgbe_read_i2c_phy_82598(hw, IXGBE_I2C_EEPROM_DEV_ADDR2, + byte_offset, sff8472_data); +} + +/** * ixgbe_get_supported_physical_layer_82598 - Returns physical layer type * @hw: pointer to hardware structure * Modified: head/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82599.c Mon Mar 4 22:41:49 2013 (r247821) +++ head/sys/dev/ixgbe/ixgbe_82599.c Mon Mar 4 23:07:40 2013 (r247822) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -40,7 +40,6 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed, - bool autoneg, bool autoneg_wait_to_complete); static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); static s32 ixgbe_read_eeprom_82599(struct ixgbe_hw *hw, @@ -48,14 +47,37 @@ static s32 ixgbe_read_eeprom_82599(struc static s32 ixgbe_read_eeprom_buffer_82599(struct ixgbe_hw *hw, u16 offset, u16 words, u16 *data); +static bool ixgbe_mng_enabled(struct ixgbe_hw *hw) +{ + u32 fwsm, manc, factps; + + fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM); + if ((fwsm & IXGBE_FWSM_MODE_MASK) != IXGBE_FWSM_FW_MODE_PT) + return FALSE; + + manc = IXGBE_READ_REG(hw, IXGBE_MANC); + if (!(manc & IXGBE_MANC_RCV_TCO_EN)) + return FALSE; + + factps = IXGBE_READ_REG(hw, IXGBE_FACTPS); + if (factps & IXGBE_FACTPS_MNGCG) + return FALSE; + + return TRUE; +} + void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) { struct ixgbe_mac_info *mac = &hw->mac; DEBUGFUNC("ixgbe_init_mac_link_ops_82599"); - /* enable the laser control functions for SFP+ fiber */ - if (mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) { + /* + * enable the laser control functions for SFP+ fiber + * and MNG not enabled + */ + if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) && + !(ixgbe_mng_enabled(hw))) { mac->ops.disable_tx_laser = &ixgbe_disable_tx_laser_multispeed_fiber; mac->ops.enable_tx_laser = @@ -135,9 +157,8 @@ init_phy_ops_out: s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) { s32 ret_val = IXGBE_SUCCESS; - u32 reg_anlp1 = 0; - u32 i = 0; u16 list_offset, data_offset, data_value; + bool got_lock = FALSE; DEBUGFUNC("ixgbe_setup_sfp_modules_82599"); @@ -171,28 +192,39 @@ s32 ixgbe_setup_sfp_modules_82599(struct /* Delay obtaining semaphore again to allow FW access */ msec_delay(hw->eeprom.semaphore_delay); - /* Now restart DSP by setting Restart_AN and clearing LMS */ - IXGBE_WRITE_REG(hw, IXGBE_AUTOC, ((IXGBE_READ_REG(hw, - IXGBE_AUTOC) & ~IXGBE_AUTOC_LMS_MASK) | - IXGBE_AUTOC_AN_RESTART)); - - /* Wait for AN to leave state 0 */ - for (i = 0; i < 10; i++) { - msec_delay(4); - reg_anlp1 = IXGBE_READ_REG(hw, IXGBE_ANLP1); - if (reg_anlp1 & IXGBE_ANLP1_AN_STATE_MASK) - break; + /* Need SW/FW semaphore around AUTOC writes if LESM on, + * likewise reset_pipeline requires lock as it also writes + * AUTOC. + */ + if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { + ret_val = hw->mac.ops.acquire_swfw_sync(hw, + IXGBE_GSSR_MAC_CSR_SM); + if (ret_val != IXGBE_SUCCESS) { + ret_val = IXGBE_ERR_SWFW_SYNC; + goto setup_sfp_out; + } + + got_lock = TRUE; + } + + /* Restart DSP and set SFI mode */ + IXGBE_WRITE_REG(hw, IXGBE_AUTOC, ((hw->mac.orig_autoc) | + IXGBE_AUTOC_LMS_10G_SERIAL)); + hw->mac.cached_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); + ret_val = ixgbe_reset_pipeline_82599(hw); + + if (got_lock) { + hw->mac.ops.release_swfw_sync(hw, + IXGBE_GSSR_MAC_CSR_SM); + got_lock = FALSE; } - if (!(reg_anlp1 & IXGBE_ANLP1_AN_STATE_MASK)) { + + if (ret_val) { DEBUGOUT("sfp module setup not complete\n"); ret_val = IXGBE_ERR_SFP_SETUP_NOT_COMPLETE; goto setup_sfp_out; } - /* Restart DSP by setting Restart_AN and return to SFI mode */ - IXGBE_WRITE_REG(hw, IXGBE_AUTOC, (IXGBE_READ_REG(hw, - IXGBE_AUTOC) | IXGBE_AUTOC_LMS_10G_SERIAL | - IXGBE_AUTOC_AN_RESTART)); } setup_sfp_out: @@ -216,7 +248,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw DEBUGFUNC("ixgbe_init_ops_82599"); - ret_val = ixgbe_init_phy_ops_generic(hw); + ixgbe_init_phy_ops_generic(hw); ret_val = ixgbe_init_ops_generic(hw); /* PHY */ @@ -289,13 +321,13 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw * ixgbe_get_link_capabilities_82599 - Determines link capabilities * @hw: pointer to hardware structure * @speed: pointer to link speed - * @negotiation: TRUE when autoneg or autotry is enabled + * @autoneg: TRUE when autoneg or autotry is enabled * * Determines the link capabilities by reading the AUTOC register. **/ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed, - bool *negotiation) + bool *autoneg) { s32 status = IXGBE_SUCCESS; u32 autoc = 0; @@ -309,7 +341,7 @@ s32 ixgbe_get_link_capabilities_82599(st hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) { *speed = IXGBE_LINK_SPEED_1GB_FULL; - *negotiation = TRUE; + *autoneg = TRUE; goto out; } @@ -326,22 +358,22 @@ s32 ixgbe_get_link_capabilities_82599(st switch (autoc & IXGBE_AUTOC_LMS_MASK) { case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *negotiation = FALSE; + *autoneg = FALSE; break; case IXGBE_AUTOC_LMS_10G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *negotiation = FALSE; + *autoneg = FALSE; break; case IXGBE_AUTOC_LMS_1G_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *negotiation = TRUE; + *autoneg = TRUE; break; case IXGBE_AUTOC_LMS_10G_SERIAL: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *negotiation = FALSE; + *autoneg = FALSE; break; case IXGBE_AUTOC_LMS_KX4_KX_KR: @@ -353,7 +385,7 @@ s32 ixgbe_get_link_capabilities_82599(st *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *negotiation = TRUE; + *autoneg = TRUE; break; case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII: @@ -364,12 +396,12 @@ s32 ixgbe_get_link_capabilities_82599(st *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *negotiation = TRUE; + *autoneg = TRUE; break; case IXGBE_AUTOC_LMS_SGMII_1G_100M: *speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL; - *negotiation = FALSE; + *autoneg = FALSE; break; default: @@ -381,7 +413,7 @@ s32 ixgbe_get_link_capabilities_82599(st if (hw->phy.multispeed_fiber) { *speed |= IXGBE_LINK_SPEED_10GB_FULL | IXGBE_LINK_SPEED_1GB_FULL; - *negotiation = TRUE; + *autoneg = TRUE; } out: @@ -424,6 +456,7 @@ enum ixgbe_media_type ixgbe_get_media_ty case IXGBE_DEV_ID_82599_SFP_FCOE: case IXGBE_DEV_ID_82599_SFP_EM: case IXGBE_DEV_ID_82599_SFP_SF2: + case IXGBE_DEV_ID_82599_SFP_SF_QP: case IXGBE_DEV_ID_82599EN_SFP: media_type = ixgbe_media_type_fiber; break; @@ -433,6 +466,10 @@ enum ixgbe_media_type ixgbe_get_media_ty case IXGBE_DEV_ID_82599_T3_LOM: media_type = ixgbe_media_type_copper; break; + case IXGBE_DEV_ID_82599_BYPASS: + media_type = ixgbe_media_type_fiber_fixed; + hw->phy.multispeed_fiber = TRUE; + break; default: media_type = ixgbe_media_type_unknown; break; @@ -456,17 +493,32 @@ s32 ixgbe_start_mac_link_82599(struct ix u32 links_reg; u32 i; s32 status = IXGBE_SUCCESS; + bool got_lock = FALSE; DEBUGFUNC("ixgbe_start_mac_link_82599"); + /* reset_pipeline requires us to hold this lock as it writes to + * AUTOC. + */ + if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { + status = hw->mac.ops.acquire_swfw_sync(hw, + IXGBE_GSSR_MAC_CSR_SM); + if (status != IXGBE_SUCCESS) + goto out; + + got_lock = TRUE; + } + /* Restart link */ - autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); - autoc_reg |= IXGBE_AUTOC_AN_RESTART; - IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); + ixgbe_reset_pipeline_82599(hw); + + if (got_lock) + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); /* Only poll for autoneg to complete if specified to do so */ if (autoneg_wait_to_complete) { + autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) == IXGBE_AUTOC_LMS_KX4_KX_KR || (autoc_reg & IXGBE_AUTOC_LMS_MASK) == @@ -490,6 +542,7 @@ s32 ixgbe_start_mac_link_82599(struct ix /* Add delay to filter out noises during initial link setup */ msec_delay(50); +out: return status; } @@ -555,16 +608,84 @@ void ixgbe_flap_tx_laser_multispeed_fibe } /** + * ixgbe_set_fiber_fixed_speed - Set module link speed for fixed fiber + * @hw: pointer to hardware structure + * @speed: link speed to set + * + * We set the module speed differently for fixed fiber. For other + * multi-speed devices we don't have an error value so here if we + * detect an error we just log it and exit. + */ +static void ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, + ixgbe_link_speed speed) +{ + s32 status; + u8 rs, eeprom_data; + + switch (speed) { + case IXGBE_LINK_SPEED_10GB_FULL: + /* one bit mask same as setting on */ + rs = IXGBE_SFF_SOFT_RS_SELECT_10G; + break; + case IXGBE_LINK_SPEED_1GB_FULL: + rs = IXGBE_SFF_SOFT_RS_SELECT_1G; + break; + default: + DEBUGOUT("Invalid fixed module speed\n"); + return; + } + + /* Set RS0 */ + status = hw->phy.ops.read_i2c_byte(hw, IXGBE_SFF_SFF_8472_OSCB, + IXGBE_I2C_EEPROM_DEV_ADDR2, + &eeprom_data); + if (status) { + DEBUGOUT("Failed to read Rx Rate Select RS0\n"); + goto out; + } + + eeprom_data = (eeprom_data & ~IXGBE_SFF_SOFT_RS_SELECT_MASK) & rs; + + status = hw->phy.ops.write_i2c_byte(hw, IXGBE_SFF_SFF_8472_OSCB, + IXGBE_I2C_EEPROM_DEV_ADDR2, + eeprom_data); + if (status) { + DEBUGOUT("Failed to write Rx Rate Select RS0\n"); + goto out; + } + + /* Set RS1 */ + status = hw->phy.ops.read_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB, + IXGBE_I2C_EEPROM_DEV_ADDR2, + &eeprom_data); + if (status) { + DEBUGOUT("Failed to read Rx Rate Select RS1\n"); + goto out; + } + + eeprom_data = (eeprom_data & ~IXGBE_SFF_SOFT_RS_SELECT_MASK) & rs; + + status = hw->phy.ops.write_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB, + IXGBE_I2C_EEPROM_DEV_ADDR2, + eeprom_data); + if (status) { + DEBUGOUT("Failed to write Rx Rate Select RS1\n"); + goto out; + } +out: + return; +} + +/** * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg: TRUE if autonegotiation enabled * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Set the link speed in the AUTOC register and restarts link. **/ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, - ixgbe_link_speed speed, bool autoneg, + ixgbe_link_speed speed, bool autoneg_wait_to_complete) { s32 status = IXGBE_SUCCESS; @@ -573,13 +694,12 @@ s32 ixgbe_setup_mac_link_multispeed_fibe u32 speedcnt = 0; u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); u32 i = 0; - bool link_up = FALSE; - bool negotiation; + bool autoneg, link_up = FALSE; DEBUGFUNC("ixgbe_setup_mac_link_multispeed_fiber"); /* Mask off requested but non-supported speeds */ - status = ixgbe_get_link_capabilities(hw, &link_speed, &negotiation); + status = ixgbe_get_link_capabilities(hw, &link_speed, &autoneg); if (status != IXGBE_SUCCESS) return status; @@ -602,16 +722,20 @@ s32 ixgbe_setup_mac_link_multispeed_fibe goto out; /* Set the module link speed */ - esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5); - IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); - IXGBE_WRITE_FLUSH(hw); + if (hw->phy.media_type == ixgbe_media_type_fiber_fixed) { + ixgbe_set_fiber_fixed_speed(hw, + IXGBE_LINK_SPEED_10GB_FULL); + } else { + esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5); + IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); + IXGBE_WRITE_FLUSH(hw); + } /* Allow module to change analog characteristics (1G->10G) */ msec_delay(40); status = ixgbe_setup_mac_link_82599(hw, IXGBE_LINK_SPEED_10GB_FULL, - autoneg, autoneg_wait_to_complete); if (status != IXGBE_SUCCESS) return status; @@ -653,17 +777,21 @@ s32 ixgbe_setup_mac_link_multispeed_fibe goto out; /* Set the module link speed */ - esdp_reg &= ~IXGBE_ESDP_SDP5; - esdp_reg |= IXGBE_ESDP_SDP5_DIR; - IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); - IXGBE_WRITE_FLUSH(hw); + if (hw->phy.media_type == ixgbe_media_type_fiber_fixed) { + ixgbe_set_fiber_fixed_speed(hw, + IXGBE_LINK_SPEED_1GB_FULL); + } else { + esdp_reg &= ~IXGBE_ESDP_SDP5; + esdp_reg |= IXGBE_ESDP_SDP5_DIR; + IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); + IXGBE_WRITE_FLUSH(hw); + } /* Allow module to change analog characteristics (10G->1G) */ msec_delay(40); status = ixgbe_setup_mac_link_82599(hw, IXGBE_LINK_SPEED_1GB_FULL, - autoneg, autoneg_wait_to_complete); if (status != IXGBE_SUCCESS) return status; @@ -690,7 +818,7 @@ s32 ixgbe_setup_mac_link_multispeed_fibe */ if (speedcnt > 1) status = ixgbe_setup_mac_link_multispeed_fiber(hw, - highest_link_speed, autoneg, autoneg_wait_to_complete); + highest_link_speed, autoneg_wait_to_complete); out: /* Set autoneg_advertised value based on input link speed */ @@ -709,13 +837,12 @@ out: * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg: TRUE if autonegotiation enabled * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Implements the Intel SmartSpeed algorithm. **/ s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw, - ixgbe_link_speed speed, bool autoneg, + ixgbe_link_speed speed, bool autoneg_wait_to_complete) { s32 status = IXGBE_SUCCESS; @@ -748,7 +875,7 @@ s32 ixgbe_setup_mac_link_smartspeed(stru /* First, try to get link with full advertisement */ hw->phy.smart_speed_active = FALSE; for (j = 0; j < IXGBE_SMARTSPEED_MAX_RETRIES; j++) { - status = ixgbe_setup_mac_link_82599(hw, speed, autoneg, + status = ixgbe_setup_mac_link_82599(hw, speed, autoneg_wait_to_complete); if (status != IXGBE_SUCCESS) goto out; @@ -783,7 +910,7 @@ s32 ixgbe_setup_mac_link_smartspeed(stru /* Turn SmartSpeed on to disable KR support */ hw->phy.smart_speed_active = TRUE; - status = ixgbe_setup_mac_link_82599(hw, speed, autoneg, + status = ixgbe_setup_mac_link_82599(hw, speed, autoneg_wait_to_complete); if (status != IXGBE_SUCCESS) goto out; @@ -808,7 +935,7 @@ s32 ixgbe_setup_mac_link_smartspeed(stru /* We didn't get link. Turn SmartSpeed back off. */ hw->phy.smart_speed_active = FALSE; - status = ixgbe_setup_mac_link_82599(hw, speed, autoneg, + status = ixgbe_setup_mac_link_82599(hw, speed, autoneg_wait_to_complete); out: @@ -822,32 +949,30 @@ out: * ixgbe_setup_mac_link_82599 - Set MAC link speed * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg: TRUE if autonegotiation enabled * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Set the link speed in the AUTOC register and restarts link. **/ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, - ixgbe_link_speed speed, bool autoneg, + ixgbe_link_speed speed, bool autoneg_wait_to_complete) { + bool autoneg = FALSE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 23:15:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4B739471; Mon, 4 Mar 2013 23:15:08 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D15B1DC; Mon, 4 Mar 2013 23:15:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r24NF8u4030773; Mon, 4 Mar 2013 23:15:08 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24NF8rG030772; Mon, 4 Mar 2013 23:15:08 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201303042315.r24NF8rG030772@svn.freebsd.org> From: Jack F Vogel Date: Mon, 4 Mar 2013 23:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247823 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:15:08 -0000 Author: jfv Date: Mon Mar 4 23:15:07 2013 New Revision: 247823 URL: http://svnweb.freebsd.org/changeset/base/247823 Log: Fix a small, but important bug, a task drain was mistakenly being compiled only when setting LEGACY_TX, this means you would not get the drain when needed on detach!! Thanks to Bryan Venteicher (bryanv@freebsd.org) for catching this little gremlin!! :) Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Mar 4 23:07:40 2013 (r247822) +++ head/sys/dev/ixgbe/ixgbe.c Mon Mar 4 23:15:07 2013 (r247823) @@ -654,7 +654,7 @@ ixgbe_detach(device_t dev) for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { if (que->tq) { -#ifdef IXGBE_LEGACY_TX +#ifndef IXGBE_LEGACY_TX taskqueue_drain(que->tq, &txr->txq_task); #endif taskqueue_drain(que->tq, &que->que_task); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 23:15:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB8385E2; Mon, 4 Mar 2013 23:15:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DBF21E2; Mon, 4 Mar 2013 23:15:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r24NFQdN030849; Mon, 4 Mar 2013 23:15:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24NFQDI030847; Mon, 4 Mar 2013 23:15:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201303042315.r24NFQDI030847@svn.freebsd.org> From: Ian Lepore Date: Mon, 4 Mar 2013 23:15:26 +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: r247824 - stable/8/sbin/devd 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:15:26 -0000 Author: ian Date: Mon Mar 4 23:15:25 2013 New Revision: 247824 URL: http://svnweb.freebsd.org/changeset/base/247824 Log: MFC ... r210609 - remove unused string r210610 - avoid copy ctors by using prefix operators r213646 - allow spacey things (liberal whitespace parsing) r236388 - libc++ compatibility (add :: prefix to bind() call) r240823 - use O_CLOEXEC for open instead of separate fcntl(2) call r243932 - prefer init expression to assignment in ctor r209583 ... Expand system into my_system, and add the necessary tidyness that we need. Close the pidfile. Then close all descriptors >= 3 to avoid information leakage to children. This solves the problem of not being able to restart devd when you have, for example, a dhclient forked to configure your network... Modified: stable/8/sbin/devd/devd.cc stable/8/sbin/devd/devd.hh Directory Properties: stable/8/sbin/devd/ (props changed) Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Mon Mar 4 23:15:07 2013 (r247823) +++ stable/8/sbin/devd/devd.cc Mon Mar 4 23:15:25 2013 (r247824) @@ -249,10 +249,8 @@ action::do_action(config &c) } match::match(config &c, const char *var, const char *re) - : _var(var) + : _var(var), _re("^") { - string pattern = re; - _re = "^"; if (!c.expand_string(string(re)).empty() && c.expand_string(string(re)).at(0) == '!') { _re.append(c.expand_string(string(re)).substr(1)); @@ -273,7 +271,7 @@ match::~match() bool match::do_match(config &c) { - string value = c.get_variable(_var); + const string &value = c.get_variable(_var); bool retval; if (Dflag) @@ -590,7 +588,7 @@ void config::expand_one(const char *&src, string &dst) { int count; - string buffer, varstr; + string buffer; src++; // $$ -> $ @@ -628,8 +626,7 @@ config::expand_one(const char *&src, str buffer.append(src++, 1); } while (is_id_char(*src)); buffer.append("", 1); - varstr = get_variable(buffer.c_str()); - dst.append(varstr); + dst.append(get_variable(buffer.c_str())); } const string @@ -763,9 +760,13 @@ process_event(char *buffer) if (sp == NULL) return; /* Can't happen? */ *sp++ = '\0'; + while (isspace(*sp)) + sp++; if (strncmp(sp, "at ", 3) == 0) sp += 3; sp = cfg.set_vars(sp); + while (isspace(*sp)) + sp++; if (strncmp(sp, "on ", 3) == 0) cfg.set_variable("bus", sp + 3); break; @@ -776,9 +777,13 @@ process_event(char *buffer) return; /* Can't happen? */ *sp++ = '\0'; cfg.set_variable("device-name", buffer); + while (isspace(*sp)) + sp++; if (strncmp(sp, "at ", 3) == 0) sp += 3; sp = cfg.set_vars(sp); + while (isspace(*sp)) + sp++; if (strncmp(sp, "on ", 3) == 0) cfg.set_variable("bus", sp + 3); break; @@ -803,7 +808,7 @@ create_socket(const char *name) unlink(name); if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) err(1, "fcntl"); - if (bind(fd, (struct sockaddr *) & sun, slen) < 0) + if (::bind(fd, (struct sockaddr *) & sun, slen) < 0) err(1, "bind"); listen(fd, 4); chown(name, 0, 0); /* XXX - root.wheel */ Modified: stable/8/sbin/devd/devd.hh ============================================================================== --- stable/8/sbin/devd/devd.hh Mon Mar 4 23:15:07 2013 (r247823) +++ stable/8/sbin/devd/devd.hh Mon Mar 4 23:15:25 2013 (r247824) @@ -144,7 +144,7 @@ private: class config { public: - config() { _pidfile = ""; push_var_table(); } + config() : _pidfile("") { push_var_table(); } virtual ~config() { reset(); } void add_attach(int, event_proc *); void add_detach(int, event_proc *); From owner-svn-src-all@FreeBSD.ORG Mon Mar 4 23:22:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 60746862; Mon, 4 Mar 2013 23:22:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A97623F; Mon, 4 Mar 2013 23:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r24NMbqC033417; Mon, 4 Mar 2013 23:22:37 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24NMbea033415; Mon, 4 Mar 2013 23:22:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201303042322.r24NMbea033415@svn.freebsd.org> From: Ian Lepore Date: Mon, 4 Mar 2013 23:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247825 - stable/8/sbin/devd 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:22:38 -0000 Author: ian Date: Mon Mar 4 23:22:37 2013 New Revision: 247825 URL: http://svnweb.freebsd.org/changeset/base/247825 Log: MFC r246134 ... Improve devd startup time, by tweaking some string handling routines that are heavily used when parsing config files. Mostly these changes avoid making temporary copies of the strings, and avoid doing byte at a time append operations, on the most-used code path. Modified: stable/8/sbin/devd/devd.cc stable/8/sbin/devd/devd.hh Directory Properties: stable/8/sbin/devd/ (props changed) Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Mon Mar 4 23:15:25 2013 (r247824) +++ stable/8/sbin/devd/devd.cc Mon Mar 4 23:22:37 2013 (r247825) @@ -137,7 +137,7 @@ config cfg; event_proc::event_proc() : _prio(-1) { - // nothing + _epsvec.reserve(4); } event_proc::~event_proc() @@ -241,25 +241,18 @@ my_system(const char *command) bool action::do_action(config &c) { - string s = c.expand_string(_cmd); + string s = c.expand_string(_cmd.c_str()); if (Dflag) fprintf(stderr, "Executing '%s'\n", s.c_str()); my_system(s.c_str()); return (true); } -match::match(config &c, const char *var, const char *re) - : _var(var), _re("^") +match::match(config &c, const char *var, const char *re) : + _inv(re[0] == '!'), + _var(var), + _re(c.expand_string(_inv ? re + 1 : re, "^", "$")) { - if (!c.expand_string(string(re)).empty() && - c.expand_string(string(re)).at(0) == '!') { - _re.append(c.expand_string(string(re)).substr(1)); - _inv = 1; - } else { - _re.append(c.expand_string(string(re))); - _inv = 0; - } - _re.append("$"); regcomp(&_regex, _re.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE); } @@ -625,24 +618,37 @@ config::expand_one(const char *&src, str do { buffer.append(src++, 1); } while (is_id_char(*src)); - buffer.append("", 1); dst.append(get_variable(buffer.c_str())); } const string -config::expand_string(const string &s) +config::expand_string(const char *src, const char *prepend, const char *append) { - const char *src; + const char *var_at; string dst; - src = s.c_str(); - while (*src) { - if (*src == '$') - expand_one(src, dst); - else - dst.append(src++, 1); + /* + * 128 bytes is enough for 2427 of 2438 expansions that happen + * while parsing config files, as tested on 2013-01-30. + */ + dst.reserve(128); + + if (prepend != NULL) + dst = prepend; + + for (;;) { + var_at = strchr(src, '$'); + if (var_at == NULL) { + dst.append(src); + break; + } + dst.append(src, var_at - src); + src = var_at; + expand_one(src, dst); } - dst.append("", 1); + + if (append != NULL) + dst.append(append); return (dst); } Modified: stable/8/sbin/devd/devd.hh ============================================================================== --- stable/8/sbin/devd/devd.hh Mon Mar 4 23:15:25 2013 (r247824) +++ stable/8/sbin/devd/devd.hh Mon Mar 4 23:22:37 2013 (r247825) @@ -90,9 +90,9 @@ public: virtual bool do_match(config &); virtual bool do_action(config &) { return true; } private: + bool _inv; std::string _var; std::string _re; - bool _inv; regex_t _regex; }; @@ -162,7 +162,8 @@ public: void pop_var_table(); void set_variable(const char *var, const char *val); const std::string &get_variable(const std::string &var); - const std::string expand_string(const std::string &var); + const std::string expand_string(const char * var, + const char * prepend = NULL, const char * append = NULL); char *set_vars(char *); void find_and_execute(char); protected: From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 06:41:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 64C934A1; Tue, 5 Mar 2013 06:41:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49CFE331; Tue, 5 Mar 2013 06:41:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r256fe3b064691; Tue, 5 Mar 2013 06:41:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r256fdl2064685; Tue, 5 Mar 2013 06:41:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303050641.r256fdl2064685@svn.freebsd.org> From: Xin LI Date: Tue, 5 Mar 2013 06:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247827 - in stable: 8/share/man/man4 8/sys/dev/arcmsr 9/share/man/man4 9/sys/dev/arcmsr 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:41:40 -0000 Author: delphij Date: Tue Mar 5 06:41:39 2013 New Revision: 247827 URL: http://svnweb.freebsd.org/changeset/base/247827 Log: MFC r247443: Refresh vendor driver version which adds ARC-1224 support. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/9/share/man/man4/arcmsr.4 stable/9/sys/dev/arcmsr/arcmsr.c stable/9/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/8/share/man/man4/arcmsr.4 stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/arcmsr/ (props changed) Modified: stable/9/share/man/man4/arcmsr.4 ============================================================================== --- stable/9/share/man/man4/arcmsr.4 Tue Mar 5 00:52:14 2013 (r247826) +++ stable/9/share/man/man4/arcmsr.4 Tue Mar 5 06:41:39 2013 (r247827) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2012 +.Dd February 27, 2013 .Dt ARCMSR 4 .Os .Sh NAME @@ -108,6 +108,8 @@ ARC-1222 .It ARC-1223 .It +ARC-1224 +.It ARC-1230 .It ARC-1231 Modified: stable/9/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.c Tue Mar 5 00:52:14 2013 (r247826) +++ stable/9/sys/dev/arcmsr/arcmsr.c Tue Mar 5 06:41:39 2013 (r247827) @@ -1,16 +1,15 @@ /* -***************************************************************************************** -** O.S : FreeBSD +******************************************************************************** +** OS : FreeBSD ** FILE NAME : arcmsr.c ** BY : Erich Chen, Ching Huang ** Description: SCSI RAID Device Driver for -** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) SATA/SAS RAID HOST Adapter -** ARCMSR RAID Host adapter -** [RAID controller:INTEL 331(PCI-X) 341(PCI-EXPRESS) chip set] -****************************************************************************************** -************************************************************************ +** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) +** SATA/SAS RAID HOST Adapter +******************************************************************************** +******************************************************************************** ** -** Copyright (C) 2002 - 2010, Areca Technology Corporation All rights reserved. +** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved. ** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions @@ -33,7 +32,7 @@ ** 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. -************************************************************************** +******************************************************************************** ** History ** ** REV# DATE NAME DESCRIPTION @@ -73,7 +72,7 @@ ** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command ** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition ** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter -** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214 +** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224 ****************************************************************************************** */ @@ -145,7 +144,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2012-12-14" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2013-01-08" #include /* ************************************************************************** @@ -168,7 +167,7 @@ static void arcmsr_stop_adapter_bgrb(str static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb); static void arcmsr_iop_init(struct AdapterControlBlock *acb); static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb); -static void arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer); +static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer); static void arcmsr_Write_data_2iop_wqbuffer(struct AdapterControlBlock *acb); static void arcmsr_abort_allcmd(struct AdapterControlBlock *acb); static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag); @@ -212,7 +211,11 @@ static device_method_t arcmsr_methods[]= DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), +#if __FreeBSD_version >= 803000 DEVMETHOD_END +#else + { 0, 0 } +#endif }; static driver_t arcmsr_driver={ @@ -1381,13 +1384,61 @@ static void arcmsr_poll(struct cam_sim * ************************************************************************** ************************************************************************** */ -static void arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, +static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb, + struct QBUFFER *prbuffer) { + + u_int8_t *pQbuffer; + u_int8_t *buf1 = 0; + u_int32_t *iop_data, *buf2 = 0; + u_int32_t iop_len, data_len; + + iop_data = (u_int32_t *)prbuffer->data; + iop_len = (u_int32_t)prbuffer->data_len; + if ( iop_len > 0 ) + { + buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO); + buf2 = (u_int32_t *)buf1; + if( buf1 == NULL) + return (0); + data_len = iop_len; + while(data_len >= 4) + { + *buf2++ = *iop_data++; + data_len -= 4; + } + if(data_len) + *buf2 = *iop_data; + buf2 = (u_int32_t *)buf1; + } + while (iop_len > 0) { + pQbuffer = &acb->rqbuffer[acb->rqbuf_lastindex]; + *pQbuffer = *buf1; + acb->rqbuf_lastindex++; + /* if last, index number set it to 0 */ + acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; + buf1++; + iop_len--; + } + if(buf2) + free( (u_int8_t *)buf2, M_DEVBUF); + /* let IOP know data has been read */ + arcmsr_iop_message_read(acb); + return (1); +} +/* +************************************************************************** +************************************************************************** +*/ +static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer) { u_int8_t *pQbuffer; u_int8_t *iop_data; u_int32_t iop_len; + if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); + } iop_data = (u_int8_t *)prbuffer->data; iop_len = (u_int32_t)prbuffer->data_len; while (iop_len > 0) { @@ -1401,6 +1452,7 @@ static void arcmsr_Read_iop_rqbuffer_dat } /* let IOP know data has been read */ arcmsr_iop_message_read(acb); + return (1); } /* ************************************************************************** @@ -1417,7 +1469,8 @@ static void arcmsr_iop2drv_data_wrote_ha my_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex - 1) & (ARCMSR_MAX_QBUFFER-1); if(my_empty_len >= prbuffer->data_len) { - arcmsr_Read_iop_rqbuffer_data(acb, prbuffer); + if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) + acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; } else { acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; } @@ -1427,6 +1480,50 @@ static void arcmsr_iop2drv_data_wrote_ha ********************************************************************** ********************************************************************** */ +static void arcmsr_Write_data_2iop_wqbuffer_D(struct AdapterControlBlock *acb) +{ + u_int8_t *pQbuffer; + struct QBUFFER *pwbuffer; + u_int8_t *buf1 = 0; + u_int32_t *iop_data, *buf2 = 0; + u_int32_t allxfer_len = 0, data_len; + + if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) { + buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO); + buf2 = (u_int32_t *)buf1; + if( buf1 == NULL) + return; + + acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READ); + pwbuffer = arcmsr_get_iop_wqbuffer(acb); + iop_data = (u_int32_t *)pwbuffer->data; + while((acb->wqbuf_firstindex != acb->wqbuf_lastindex) + && (allxfer_len < 124)) { + pQbuffer = &acb->wqbuffer[acb->wqbuf_firstindex]; + *buf1 = *pQbuffer; + acb->wqbuf_firstindex++; + acb->wqbuf_firstindex %= ARCMSR_MAX_QBUFFER; + buf1++; + allxfer_len++; + } + pwbuffer->data_len = allxfer_len; + data_len = allxfer_len; + buf1 = (u_int8_t *)buf2; + while(data_len >= 4) + { + *iop_data++ = *buf2++; + data_len -= 4; + } + if(data_len) + *iop_data = *buf2; + free( buf1, M_DEVBUF); + arcmsr_iop_message_wrote(acb); + } +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_Write_data_2iop_wqbuffer(struct AdapterControlBlock *acb) { u_int8_t *pQbuffer; @@ -1434,6 +1531,10 @@ static void arcmsr_Write_data_2iop_wqbuf u_int8_t *iop_data; int32_t allxfer_len=0; + if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + arcmsr_Write_data_2iop_wqbuffer_D(acb); + return; + } if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) { acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READ); pwbuffer = arcmsr_get_iop_wqbuffer(acb); @@ -2153,7 +2254,8 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; prbuffer = arcmsr_get_iop_rqbuffer(acb); - arcmsr_Read_iop_rqbuffer_data(acb, prbuffer); + if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) + acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; } pcmdmessagefld->cmdmessage.Length = allxfer_len; pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK; @@ -2374,7 +2476,8 @@ static int arcmsr_iop_message_xfer(struc acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; prbuffer = arcmsr_get_iop_rqbuffer(acb); - arcmsr_Read_iop_rqbuffer_data(acb, prbuffer); + if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) + acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; } pcmdmessagefld->cmdmessage.Length = allxfer_len; pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK; Modified: stable/9/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.h Tue Mar 5 00:52:14 2013 (r247826) +++ stable/9/sys/dev/arcmsr/arcmsr.h Tue Mar 5 06:41:39 2013 (r247827) @@ -1,17 +1,14 @@ /* -*********************************************************************************************** -** O.S : FreeBSD +******************************************************************************** +** OS : FreeBSD ** FILE NAME : arcmsr.h ** BY : Erich Chen, Ching Huang ** Description: SCSI RAID Device Driver for -** ARECA SATA/SAS RAID HOST Adapter -** [RAID controller:INTEL 331(PCI-X) 341(PCI-EXPRESS) chip set] -*********************************************************************************************** -************************************************************************ -** Copyright (C) 2002 - 2010, Areca Technology Corporation All rights reserved. -** -** Web site: www.areca.com.tw -** E-mail: erich@areca.com.tw; ching2048@areca.com.tw +** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) +** SATA/SAS RAID HOST Adapter +******************************************************************************** +******************************************************************************** +** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved. ** ** Redistribution and use in source and binary forms,with or without ** modification,are permitted provided that the following conditions From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 06:41:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 213F74A2; Tue, 5 Mar 2013 06:41:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06931332; Tue, 5 Mar 2013 06:41:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r256feO9064699; Tue, 5 Mar 2013 06:41:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r256fenc064696; Tue, 5 Mar 2013 06:41:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303050641.r256fenc064696@svn.freebsd.org> From: Xin LI Date: Tue, 5 Mar 2013 06:41:40 +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: r247827 - in stable: 8/share/man/man4 8/sys/dev/arcmsr 9/share/man/man4 9/sys/dev/arcmsr 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:41:41 -0000 Author: delphij Date: Tue Mar 5 06:41:39 2013 New Revision: 247827 URL: http://svnweb.freebsd.org/changeset/base/247827 Log: MFC r247443: Refresh vendor driver version which adds ARC-1224 support. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/8/share/man/man4/arcmsr.4 stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/arcmsr/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man4/arcmsr.4 stable/9/sys/dev/arcmsr/arcmsr.c stable/9/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/8/share/man/man4/arcmsr.4 ============================================================================== --- stable/8/share/man/man4/arcmsr.4 Tue Mar 5 00:52:14 2013 (r247826) +++ stable/8/share/man/man4/arcmsr.4 Tue Mar 5 06:41:39 2013 (r247827) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2012 +.Dd February 27, 2013 .Dt ARCMSR 4 .Os .Sh NAME @@ -108,6 +108,8 @@ ARC-1222 .It ARC-1223 .It +ARC-1224 +.It ARC-1230 .It ARC-1231 Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Tue Mar 5 00:52:14 2013 (r247826) +++ stable/8/sys/dev/arcmsr/arcmsr.c Tue Mar 5 06:41:39 2013 (r247827) @@ -1,16 +1,15 @@ /* -***************************************************************************************** -** O.S : FreeBSD +******************************************************************************** +** OS : FreeBSD ** FILE NAME : arcmsr.c ** BY : Erich Chen, Ching Huang ** Description: SCSI RAID Device Driver for -** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) SATA/SAS RAID HOST Adapter -** ARCMSR RAID Host adapter -** [RAID controller:INTEL 331(PCI-X) 341(PCI-EXPRESS) chip set] -****************************************************************************************** -************************************************************************ +** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) +** SATA/SAS RAID HOST Adapter +******************************************************************************** +******************************************************************************** ** -** Copyright (C) 2002 - 2010, Areca Technology Corporation All rights reserved. +** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved. ** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions @@ -33,7 +32,7 @@ ** 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. -************************************************************************** +******************************************************************************** ** History ** ** REV# DATE NAME DESCRIPTION @@ -73,7 +72,7 @@ ** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command ** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition ** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter -** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214 +** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224 ****************************************************************************************** */ @@ -145,7 +144,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2012-12-14" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2013-01-08" #include /* ************************************************************************** @@ -168,7 +167,7 @@ static void arcmsr_stop_adapter_bgrb(str static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb); static void arcmsr_iop_init(struct AdapterControlBlock *acb); static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb); -static void arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer); +static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer); static void arcmsr_Write_data_2iop_wqbuffer(struct AdapterControlBlock *acb); static void arcmsr_abort_allcmd(struct AdapterControlBlock *acb); static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag); @@ -212,7 +211,11 @@ static device_method_t arcmsr_methods[]= DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), +#if __FreeBSD_version >= 803000 DEVMETHOD_END +#else + { 0, 0 } +#endif }; static driver_t arcmsr_driver={ @@ -1381,13 +1384,61 @@ static void arcmsr_poll(struct cam_sim * ************************************************************************** ************************************************************************** */ -static void arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, +static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb, + struct QBUFFER *prbuffer) { + + u_int8_t *pQbuffer; + u_int8_t *buf1 = 0; + u_int32_t *iop_data, *buf2 = 0; + u_int32_t iop_len, data_len; + + iop_data = (u_int32_t *)prbuffer->data; + iop_len = (u_int32_t)prbuffer->data_len; + if ( iop_len > 0 ) + { + buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO); + buf2 = (u_int32_t *)buf1; + if( buf1 == NULL) + return (0); + data_len = iop_len; + while(data_len >= 4) + { + *buf2++ = *iop_data++; + data_len -= 4; + } + if(data_len) + *buf2 = *iop_data; + buf2 = (u_int32_t *)buf1; + } + while (iop_len > 0) { + pQbuffer = &acb->rqbuffer[acb->rqbuf_lastindex]; + *pQbuffer = *buf1; + acb->rqbuf_lastindex++; + /* if last, index number set it to 0 */ + acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; + buf1++; + iop_len--; + } + if(buf2) + free( (u_int8_t *)buf2, M_DEVBUF); + /* let IOP know data has been read */ + arcmsr_iop_message_read(acb); + return (1); +} +/* +************************************************************************** +************************************************************************** +*/ +static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer) { u_int8_t *pQbuffer; u_int8_t *iop_data; u_int32_t iop_len; + if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); + } iop_data = (u_int8_t *)prbuffer->data; iop_len = (u_int32_t)prbuffer->data_len; while (iop_len > 0) { @@ -1401,6 +1452,7 @@ static void arcmsr_Read_iop_rqbuffer_dat } /* let IOP know data has been read */ arcmsr_iop_message_read(acb); + return (1); } /* ************************************************************************** @@ -1417,7 +1469,8 @@ static void arcmsr_iop2drv_data_wrote_ha my_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex - 1) & (ARCMSR_MAX_QBUFFER-1); if(my_empty_len >= prbuffer->data_len) { - arcmsr_Read_iop_rqbuffer_data(acb, prbuffer); + if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) + acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; } else { acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; } @@ -1427,6 +1480,50 @@ static void arcmsr_iop2drv_data_wrote_ha ********************************************************************** ********************************************************************** */ +static void arcmsr_Write_data_2iop_wqbuffer_D(struct AdapterControlBlock *acb) +{ + u_int8_t *pQbuffer; + struct QBUFFER *pwbuffer; + u_int8_t *buf1 = 0; + u_int32_t *iop_data, *buf2 = 0; + u_int32_t allxfer_len = 0, data_len; + + if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) { + buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO); + buf2 = (u_int32_t *)buf1; + if( buf1 == NULL) + return; + + acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READ); + pwbuffer = arcmsr_get_iop_wqbuffer(acb); + iop_data = (u_int32_t *)pwbuffer->data; + while((acb->wqbuf_firstindex != acb->wqbuf_lastindex) + && (allxfer_len < 124)) { + pQbuffer = &acb->wqbuffer[acb->wqbuf_firstindex]; + *buf1 = *pQbuffer; + acb->wqbuf_firstindex++; + acb->wqbuf_firstindex %= ARCMSR_MAX_QBUFFER; + buf1++; + allxfer_len++; + } + pwbuffer->data_len = allxfer_len; + data_len = allxfer_len; + buf1 = (u_int8_t *)buf2; + while(data_len >= 4) + { + *iop_data++ = *buf2++; + data_len -= 4; + } + if(data_len) + *iop_data = *buf2; + free( buf1, M_DEVBUF); + arcmsr_iop_message_wrote(acb); + } +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_Write_data_2iop_wqbuffer(struct AdapterControlBlock *acb) { u_int8_t *pQbuffer; @@ -1434,6 +1531,10 @@ static void arcmsr_Write_data_2iop_wqbuf u_int8_t *iop_data; int32_t allxfer_len=0; + if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + arcmsr_Write_data_2iop_wqbuffer_D(acb); + return; + } if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) { acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READ); pwbuffer = arcmsr_get_iop_wqbuffer(acb); @@ -2153,7 +2254,8 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; prbuffer = arcmsr_get_iop_rqbuffer(acb); - arcmsr_Read_iop_rqbuffer_data(acb, prbuffer); + if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) + acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; } pcmdmessagefld->cmdmessage.Length = allxfer_len; pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK; @@ -2374,7 +2476,8 @@ static int arcmsr_iop_message_xfer(struc acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; prbuffer = arcmsr_get_iop_rqbuffer(acb); - arcmsr_Read_iop_rqbuffer_data(acb, prbuffer); + if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) + acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; } pcmdmessagefld->cmdmessage.Length = allxfer_len; pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK; Modified: stable/8/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.h Tue Mar 5 00:52:14 2013 (r247826) +++ stable/8/sys/dev/arcmsr/arcmsr.h Tue Mar 5 06:41:39 2013 (r247827) @@ -1,17 +1,14 @@ /* -*********************************************************************************************** -** O.S : FreeBSD +******************************************************************************** +** OS : FreeBSD ** FILE NAME : arcmsr.h ** BY : Erich Chen, Ching Huang ** Description: SCSI RAID Device Driver for -** ARECA SATA/SAS RAID HOST Adapter -** [RAID controller:INTEL 331(PCI-X) 341(PCI-EXPRESS) chip set] -*********************************************************************************************** -************************************************************************ -** Copyright (C) 2002 - 2010, Areca Technology Corporation All rights reserved. -** -** Web site: www.areca.com.tw -** E-mail: erich@areca.com.tw; ching2048@areca.com.tw +** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) +** SATA/SAS RAID HOST Adapter +******************************************************************************** +******************************************************************************** +** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved. ** ** Redistribution and use in source and binary forms,with or without ** modification,are permitted provided that the following conditions From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 06:43:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 928AA88B; Tue, 5 Mar 2013 06:43:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 84AFD352; Tue, 5 Mar 2013 06:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r256hsEY065119; Tue, 5 Mar 2013 06:43:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r256hsKQ065118; Tue, 5 Mar 2013 06:43:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303050643.r256hsKQ065118@svn.freebsd.org> From: Xin LI Date: Tue, 5 Mar 2013 06:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247828 - in stable: 8/sys/dev/mfi 9/sys/dev/mfi 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:43:54 -0000 Author: delphij Date: Tue Mar 5 06:43:54 2013 New Revision: 247828 URL: http://svnweb.freebsd.org/changeset/base/247828 Log: MFC r247594: Fix a typo in mfi_stp_cmd() that would give wrong assignment. Submitted by: Sascha Wildner Obtained from: DragonFly rev 0dc98fff2206d7bb78ce5e07ac34d6954e4bd96a Modified: stable/9/sys/dev/mfi/mfi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Tue Mar 5 06:41:39 2013 (r247827) +++ stable/9/sys/dev/mfi/mfi.c Tue Mar 5 06:43:54 2013 (r247828) @@ -2904,7 +2904,7 @@ mfi_stp_cmd(struct mfi_softc *sc, struct cm->cm_frame->stp.sgl.sg64[i].len = ioc->mfi_sgl[i].iov_len; } else { - cm->cm_frame->stp.sgl.sg32[i].len = + cm->cm_frame->stp.sgl.sg32[i].addr = kern_sge[i].phys_addr; cm->cm_frame->stp.sgl.sg32[i].len = ioc->mfi_sgl[i].iov_len; From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 06:43:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E710588C; Tue, 5 Mar 2013 06:43:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D9840353; Tue, 5 Mar 2013 06:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r256hsAd065125; Tue, 5 Mar 2013 06:43:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r256hsVF065124; Tue, 5 Mar 2013 06:43:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303050643.r256hsVF065124@svn.freebsd.org> From: Xin LI Date: Tue, 5 Mar 2013 06:43:54 +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: r247828 - in stable: 8/sys/dev/mfi 9/sys/dev/mfi 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:43:55 -0000 Author: delphij Date: Tue Mar 5 06:43:54 2013 New Revision: 247828 URL: http://svnweb.freebsd.org/changeset/base/247828 Log: MFC r247594: Fix a typo in mfi_stp_cmd() that would give wrong assignment. Submitted by: Sascha Wildner Obtained from: DragonFly rev 0dc98fff2206d7bb78ce5e07ac34d6954e4bd96a Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/mfi/mfi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Tue Mar 5 06:41:39 2013 (r247827) +++ stable/8/sys/dev/mfi/mfi.c Tue Mar 5 06:43:54 2013 (r247828) @@ -2904,7 +2904,7 @@ mfi_stp_cmd(struct mfi_softc *sc, struct cm->cm_frame->stp.sgl.sg64[i].len = ioc->mfi_sgl[i].iov_len; } else { - cm->cm_frame->stp.sgl.sg32[i].len = + cm->cm_frame->stp.sgl.sg32[i].addr = kern_sge[i].phys_addr; cm->cm_frame->stp.sgl.sg32[i].len = ioc->mfi_sgl[i].iov_len; From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 07:00:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 69BA8E13; Tue, 5 Mar 2013 07:00:06 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0BB5EE; Tue, 5 Mar 2013 07:00:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25706M2068979; Tue, 5 Mar 2013 07:00:06 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r257066g068978; Tue, 5 Mar 2013 07:00:06 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201303050700.r257066g068978@svn.freebsd.org> From: Bryan Venteicher Date: Tue, 5 Mar 2013 07:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247829 - head/sys/dev/virtio/block X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 07:00:06 -0000 Author: bryanv Date: Tue Mar 5 07:00:05 2013 New Revision: 247829 URL: http://svnweb.freebsd.org/changeset/base/247829 Log: Only set the barrier flag if the feature was negotiated When the VirtIO barrier feature is not negotiated, the driver must enforce the proper ordering for BIO_ORDERED BIOs. All the in-flight BIOs must complete before starting the BIO, and the ordered BIO must complete before subsequent BIOs can start. Also fix a few whitespace nits. Reported by: neel Approved by: grehan (mentor) MFC after: 3 days Modified: head/sys/dev/virtio/block/virtio_blk.c Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Tue Mar 5 06:43:54 2013 (r247828) +++ head/sys/dev/virtio/block/virtio_blk.c Tue Mar 5 07:00:05 2013 (r247829) @@ -72,6 +72,7 @@ struct vtblk_softc { #define VTBLK_FLAG_DETACH 0x0004 #define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_DUMPING 0x0010 +#define VTBLK_FLAG_BARRIER 0x0020 struct virtqueue *vtblk_vq; struct sglist *vtblk_sglist; @@ -81,7 +82,8 @@ struct vtblk_softc { TAILQ_HEAD(, vtblk_request) vtblk_req_free; TAILQ_HEAD(, vtblk_request) - vtblk_req_ready; + vtblk_req_ready; + struct vtblk_request *vtblk_req_ordered; struct taskqueue *vtblk_tq; struct task vtblk_intr_task; @@ -278,9 +280,10 @@ vtblk_attach(device_t dev) if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) sc->vtblk_flags |= VTBLK_FLAG_INDIRECT; - if (virtio_with_feature(dev, VIRTIO_BLK_F_RO)) sc->vtblk_flags |= VTBLK_FLAG_READONLY; + if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER)) + sc->vtblk_flags |= VTBLK_FLAG_BARRIER; /* Get local copy of config. */ virtio_read_device_config(dev, 0, &blkcfg, @@ -766,25 +769,45 @@ vtblk_bio_request(struct vtblk_softc *sc bp->bio_cmd); } - if (bp->bio_flags & BIO_ORDERED) - req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; - return (req); } static int vtblk_execute_request(struct vtblk_softc *sc, struct vtblk_request *req) { + struct virtqueue *vq; struct sglist *sg; struct bio *bp; - int readable, writable, error; + int ordered, readable, writable, error; + vq = sc->vtblk_vq; sg = sc->vtblk_sglist; bp = req->vbr_bp; + ordered = 0; writable = 0; VTBLK_LOCK_ASSERT(sc); + /* + * Wait until the ordered request completes before + * executing subsequent requests. + */ + if (sc->vtblk_req_ordered != NULL) + return (EBUSY); + + if (bp->bio_flags & BIO_ORDERED) { + if ((sc->vtblk_flags & VTBLK_FLAG_BARRIER) == 0) { + /* + * This request will be executed once all + * the in-flight requests are completed. + */ + if (!virtqueue_empty(vq)) + return (EBUSY); + ordered = 1; + } else + req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; + } + sglist_reset(sg); sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr)); @@ -802,10 +825,13 @@ vtblk_execute_request(struct vtblk_softc writable++; sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); - readable = sg->sg_nseg - writable; - return (virtqueue_enqueue(sc->vtblk_vq, req, sg, readable, writable)); + error = virtqueue_enqueue(vq, req, sg, readable, writable); + if (error == 0 && ordered) + sc->vtblk_req_ordered = req; + + return (error); } static int @@ -1013,6 +1039,12 @@ vtblk_finish_completed(struct vtblk_soft while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { bp = req->vbr_bp; + if (sc->vtblk_req_ordered != NULL) { + /* This should be the only outstanding request. */ + MPASS(sc->vtblk_req_ordered == req); + sc->vtblk_req_ordered = NULL; + } + error = vtblk_request_error(req); if (error) disk_err(bp, "hard error", -1, 1); @@ -1039,6 +1071,7 @@ vtblk_drain_vq(struct vtblk_softc *sc, i vtblk_enqueue_request(sc, req); } + sc->vtblk_req_ordered = NULL; KASSERT(virtqueue_empty(vq), ("virtqueue not empty")); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 07:20:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0AAFF302; Tue, 5 Mar 2013 07:20:05 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id C2A0B6A6; Tue, 5 Mar 2013 07:20:03 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 14C1D7300A; Tue, 5 Mar 2013 08:20:40 +0100 (CET) Date: Tue, 5 Mar 2013 08:20:40 +0100 From: Luigi Rizzo To: Alexander Motin Subject: Re: svn commit: r247792 - head/sys/dev/syscons Message-ID: <20130305072040.GB13187@onelab2.iet.unipi.it> References: <201303041400.r24E0xOo076175@svn.freebsd.org> <20130304144216.GA63659@onelab2.iet.unipi.it> <5134B5F5.7000204@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5134B5F5.7000204@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Davide Italiano , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 07:20:05 -0000 On Mon, Mar 04, 2013 at 04:55:49PM +0200, Alexander Motin wrote: > On 04.03.2013 16:42, Luigi Rizzo wrote: > > On Mon, Mar 04, 2013 at 02:00:59PM +0000, Davide Italiano wrote: ... > >> - Reduce syscons "refresh" rate to 1-2Hz when console is in graphics mode > >> and there is nothing to do except some polling for keyboard. Text mode > > > > just to understand, how does this 1-2Hz affect the respose to keypresses ? > > does it mean it takes 0.5..1s to see the keypress ? > > No, it is a polling for keyboard presence, and its rate already limited > to 1Hz by comparing kbd_time_stamp to time_uptime there. perfect, thanks for the clarification cheers luigi From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 08:08:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 75259FA0; Tue, 5 Mar 2013 08:08:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58D8D84F; Tue, 5 Mar 2013 08:08:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2588Hpi090234; Tue, 5 Mar 2013 08:08:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2588HYo090232; Tue, 5 Mar 2013 08:08:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201303050808.r2588HYo090232@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 5 Mar 2013 08:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247830 - head/sys/contrib/altq/altq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 08:08:17 -0000 Author: glebius Date: Tue Mar 5 08:08:16 2013 New Revision: 247830 URL: http://svnweb.freebsd.org/changeset/base/247830 Log: Simplify TAILQ usage and avoid additional memory allocations. Tested by: Eugene M. Zheganin Sponsored by: Nginx, Inc Modified: head/sys/contrib/altq/altq/altq_hfsc.c head/sys/contrib/altq/altq/altq_hfsc.h Modified: head/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Tue Mar 5 07:00:05 2013 (r247829) +++ head/sys/contrib/altq/altq/altq_hfsc.c Tue Mar 5 08:08:16 2013 (r247830) @@ -104,14 +104,10 @@ static void update_ed(struct hfsc_clas static void update_d(struct hfsc_class *, int); static void init_vf(struct hfsc_class *, int); static void update_vf(struct hfsc_class *, int, u_int64_t); -static ellist_t *ellist_alloc(void); -static void ellist_destroy(ellist_t *); static void ellist_insert(struct hfsc_class *); static void ellist_remove(struct hfsc_class *); static void ellist_update(struct hfsc_class *); -struct hfsc_class *ellist_get_mindl(ellist_t *, u_int64_t); -static actlist_t *actlist_alloc(void); -static void actlist_destroy(actlist_t *); +struct hfsc_class *hfsc_get_mindl(struct hfsc_if *, u_int64_t); static void actlist_insert(struct hfsc_class *); static void actlist_remove(struct hfsc_class *); static void actlist_update(struct hfsc_class *); @@ -204,12 +200,7 @@ hfsc_add_altq(struct pf_altq *a) if (hif == NULL) return (ENOMEM); - hif->hif_eligible = ellist_alloc(); - if (hif->hif_eligible == NULL) { - free(hif, M_DEVBUF); - return (ENOMEM); - } - + TAILQ_INIT(&hif->hif_eligible); hif->hif_ifq = &ifp->if_snd; /* keep the state in pf_altq */ @@ -230,8 +221,6 @@ hfsc_remove_altq(struct pf_altq *a) (void)hfsc_clear_interface(hif); (void)hfsc_class_destroy(hif->hif_rootclass); - ellist_destroy(hif->hif_eligible); - free(hif, M_DEVBUF); return (0); @@ -408,9 +397,7 @@ hfsc_class_create(struct hfsc_if *hif, s if (cl->cl_q == NULL) goto err_ret; - cl->cl_actc = actlist_alloc(); - if (cl->cl_actc == NULL) - goto err_ret; + TAILQ_INIT(&cl->cl_actc); if (qlimit == 0) qlimit = 50; /* use default */ @@ -544,8 +531,6 @@ hfsc_class_create(struct hfsc_if *hif, s return (cl); err_ret: - if (cl->cl_actc != NULL) - actlist_destroy(cl->cl_actc); if (cl->cl_red != NULL) { #ifdef ALTQ_RIO if (q_is_rio(cl->cl_q)) @@ -620,8 +605,6 @@ hfsc_class_destroy(struct hfsc_class *cl IFQ_UNLOCK(cl->cl_hif->hif_ifq); splx(s); - actlist_destroy(cl->cl_actc); - if (cl->cl_red != NULL) { #ifdef ALTQ_RIO if (q_is_rio(cl->cl_q)) @@ -774,7 +757,7 @@ hfsc_dequeue(struct ifaltq *ifq, int op) * find the class with the minimum deadline among * the eligible classes. */ - if ((cl = ellist_get_mindl(hif->hif_eligible, cur_time)) + if ((cl = hfsc_get_mindl(hif, cur_time)) != NULL) { realtime = 1; } else { @@ -994,7 +977,7 @@ init_vf(struct hfsc_class *cl, int len) go_active = 0; if (go_active) { - max_cl = actlist_last(cl->cl_parent->cl_actc); + max_cl = TAILQ_LAST(&cl->cl_parent->cl_actc, acthead); if (max_cl != NULL) { /* * set vt to the average of the min and max @@ -1159,12 +1142,12 @@ update_cfmin(struct hfsc_class *cl) struct hfsc_class *p; u_int64_t cfmin; - if (TAILQ_EMPTY(cl->cl_actc)) { + if (TAILQ_EMPTY(&cl->cl_actc)) { cl->cl_cfmin = 0; return; } cfmin = HT_INFINITY; - TAILQ_FOREACH(p, cl->cl_actc, cl_actlist) { + TAILQ_FOREACH(p, &cl->cl_actc, cl_actlist) { if (p->cl_f == 0) { cl->cl_cfmin = 0; return; @@ -1184,22 +1167,6 @@ update_cfmin(struct hfsc_class *cl) * there is one eligible list per interface. */ -static ellist_t * -ellist_alloc(void) -{ - ellist_t *head; - - head = malloc(sizeof(ellist_t), M_DEVBUF, M_WAITOK); - TAILQ_INIT(head); - return (head); -} - -static void -ellist_destroy(ellist_t *head) -{ - free(head, M_DEVBUF); -} - static void ellist_insert(struct hfsc_class *cl) { @@ -1207,13 +1174,13 @@ ellist_insert(struct hfsc_class *cl) struct hfsc_class *p; /* check the last entry first */ - if ((p = TAILQ_LAST(hif->hif_eligible, _eligible)) == NULL || + if ((p = TAILQ_LAST(&hif->hif_eligible, elighead)) == NULL || p->cl_e <= cl->cl_e) { - TAILQ_INSERT_TAIL(hif->hif_eligible, cl, cl_ellist); + TAILQ_INSERT_TAIL(&hif->hif_eligible, cl, cl_ellist); return; } - TAILQ_FOREACH(p, hif->hif_eligible, cl_ellist) { + TAILQ_FOREACH(p, &hif->hif_eligible, cl_ellist) { if (cl->cl_e < p->cl_e) { TAILQ_INSERT_BEFORE(p, cl, cl_ellist); return; @@ -1227,7 +1194,7 @@ ellist_remove(struct hfsc_class *cl) { struct hfsc_if *hif = cl->cl_hif; - TAILQ_REMOVE(hif->hif_eligible, cl, cl_ellist); + TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist); } static void @@ -1245,11 +1212,11 @@ ellist_update(struct hfsc_class *cl) return; /* check the last entry */ - last = TAILQ_LAST(hif->hif_eligible, _eligible); + last = TAILQ_LAST(&hif->hif_eligible, elighead); ASSERT(last != NULL); if (last->cl_e <= cl->cl_e) { - TAILQ_REMOVE(hif->hif_eligible, cl, cl_ellist); - TAILQ_INSERT_TAIL(hif->hif_eligible, cl, cl_ellist); + TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist); + TAILQ_INSERT_TAIL(&hif->hif_eligible, cl, cl_ellist); return; } @@ -1259,7 +1226,7 @@ ellist_update(struct hfsc_class *cl) */ while ((p = TAILQ_NEXT(p, cl_ellist)) != NULL) { if (cl->cl_e < p->cl_e) { - TAILQ_REMOVE(hif->hif_eligible, cl, cl_ellist); + TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist); TAILQ_INSERT_BEFORE(p, cl, cl_ellist); return; } @@ -1269,11 +1236,11 @@ ellist_update(struct hfsc_class *cl) /* find the class with the minimum deadline among the eligible classes */ struct hfsc_class * -ellist_get_mindl(ellist_t *head, u_int64_t cur_time) +hfsc_get_mindl(struct hfsc_if *hif, u_int64_t cur_time) { struct hfsc_class *p, *cl = NULL; - TAILQ_FOREACH(p, head, cl_ellist) { + TAILQ_FOREACH(p, &hif->hif_eligible, cl_ellist) { if (p->cl_e > cur_time) break; if (cl == NULL || p->cl_d < cl->cl_d) @@ -1287,34 +1254,20 @@ ellist_get_mindl(ellist_t *head, u_int64 * by their virtual time. * each intermediate class has one active children list. */ -static actlist_t * -actlist_alloc(void) -{ - actlist_t *head; - - head = malloc(sizeof(actlist_t), M_DEVBUF, M_WAITOK); - TAILQ_INIT(head); - return (head); -} static void -actlist_destroy(actlist_t *head) -{ - free(head, M_DEVBUF); -} -static void actlist_insert(struct hfsc_class *cl) { struct hfsc_class *p; /* check the last entry first */ - if ((p = TAILQ_LAST(cl->cl_parent->cl_actc, _active)) == NULL + if ((p = TAILQ_LAST(&cl->cl_parent->cl_actc, acthead)) == NULL || p->cl_vt <= cl->cl_vt) { - TAILQ_INSERT_TAIL(cl->cl_parent->cl_actc, cl, cl_actlist); + TAILQ_INSERT_TAIL(&cl->cl_parent->cl_actc, cl, cl_actlist); return; } - TAILQ_FOREACH(p, cl->cl_parent->cl_actc, cl_actlist) { + TAILQ_FOREACH(p, &cl->cl_parent->cl_actc, cl_actlist) { if (cl->cl_vt < p->cl_vt) { TAILQ_INSERT_BEFORE(p, cl, cl_actlist); return; @@ -1326,7 +1279,7 @@ actlist_insert(struct hfsc_class *cl) static void actlist_remove(struct hfsc_class *cl) { - TAILQ_REMOVE(cl->cl_parent->cl_actc, cl, cl_actlist); + TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist); } static void @@ -1344,11 +1297,11 @@ actlist_update(struct hfsc_class *cl) return; /* check the last entry */ - last = TAILQ_LAST(cl->cl_parent->cl_actc, _active); + last = TAILQ_LAST(&cl->cl_parent->cl_actc, acthead); ASSERT(last != NULL); if (last->cl_vt <= cl->cl_vt) { - TAILQ_REMOVE(cl->cl_parent->cl_actc, cl, cl_actlist); - TAILQ_INSERT_TAIL(cl->cl_parent->cl_actc, cl, cl_actlist); + TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist); + TAILQ_INSERT_TAIL(&cl->cl_parent->cl_actc, cl, cl_actlist); return; } @@ -1358,7 +1311,7 @@ actlist_update(struct hfsc_class *cl) */ while ((p = TAILQ_NEXT(p, cl_actlist)) != NULL) { if (cl->cl_vt < p->cl_vt) { - TAILQ_REMOVE(cl->cl_parent->cl_actc, cl, cl_actlist); + TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist); TAILQ_INSERT_BEFORE(p, cl, cl_actlist); return; } @@ -1371,7 +1324,7 @@ actlist_firstfit(struct hfsc_class *cl, { struct hfsc_class *p; - TAILQ_FOREACH(p, cl->cl_actc, cl_actlist) { + TAILQ_FOREACH(p, &cl->cl_actc, cl_actlist) { if (p->cl_f <= cur_time) return (p); } Modified: head/sys/contrib/altq/altq/altq_hfsc.h ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.h Tue Mar 5 07:00:05 2013 (r247829) +++ head/sys/contrib/altq/altq/altq_hfsc.h Tue Mar 5 08:08:16 2013 (r247830) @@ -218,16 +218,6 @@ struct runtime_sc { u_int64_t ism2; /* scaled inverse-slope of the 2nd segment */ }; -/* for TAILQ based ellist and actlist implementation */ -struct hfsc_class; -typedef TAILQ_HEAD(_eligible, hfsc_class) ellist_t; -typedef TAILQ_ENTRY(hfsc_class) elentry_t; -typedef TAILQ_HEAD(_active, hfsc_class) actlist_t; -typedef TAILQ_ENTRY(hfsc_class) actentry_t; -#define ellist_first(s) TAILQ_FIRST(s) -#define actlist_first(s) TAILQ_FIRST(s) -#define actlist_last(s) TAILQ_LAST(s, _active) - struct hfsc_class { u_int cl_id; /* class id (just for debug) */ u_int32_t cl_handle; /* class handle */ @@ -277,10 +267,10 @@ struct hfsc_class { u_int cl_vtperiod; /* vt period sequence no */ u_int cl_parentperiod; /* parent's vt period seqno */ int cl_nactive; /* number of active children */ - actlist_t *cl_actc; /* active children list */ - actentry_t cl_actlist; /* active children list entry */ - elentry_t cl_ellist; /* eligible list entry */ + TAILQ_HEAD(acthead, hfsc_class) cl_actc; /* active children list */ + TAILQ_ENTRY(hfsc_class) cl_actlist; /* active children list entry */ + TAILQ_ENTRY(hfsc_class) cl_ellist; /* eligible list entry */ struct { struct pktcntr xmit_cnt; @@ -304,7 +294,7 @@ struct hfsc_if { u_int hif_packets; /* # of packets in the tree */ u_int hif_classid; /* class id sequence number */ - ellist_t *hif_eligible; /* eligible list */ + TAILQ_HEAD(elighead, hfsc_class) hif_eligible; /* eligible list */ #ifdef ALTQ3_CLFIER_COMPAT struct acc_classifier hif_classifier; From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 09:07:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8553F12B; Tue, 5 Mar 2013 09:07:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73D81A7F; Tue, 5 Mar 2013 09:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25972rK008180; Tue, 5 Mar 2013 09:07:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25972JH008179; Tue, 5 Mar 2013 09:07:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303050907.r25972JH008179@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Mar 2013 09:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247832 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:07:02 -0000 Author: kib Date: Tue Mar 5 09:07:01 2013 New Revision: 247832 URL: http://svnweb.freebsd.org/changeset/base/247832 Log: Import the likely() compat macro. Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/dev/drm2/drmP.h Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Tue Mar 5 08:09:53 2013 (r247831) +++ head/sys/dev/drm2/drmP.h Tue Mar 5 09:07:01 2013 (r247832) @@ -228,6 +228,7 @@ typedef void irqreturn_t; #define IRQ_NONE /* nothing */ #define unlikely(x) __builtin_expect(!!(x), 0) +#define likely(x) __builtin_expect((x), 0) #define container_of(ptr, type, member) ({ \ __typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 09:07:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46DF5347; Tue, 5 Mar 2013 09:07:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17921A90; Tue, 5 Mar 2013 09:07:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2597wlm008375; Tue, 5 Mar 2013 09:07:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2597wbk008373; Tue, 5 Mar 2013 09:07:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303050907.r2597wbk008373@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Mar 2013 09:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247833 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:07:59 -0000 Author: kib Date: Tue Mar 5 09:07:58 2013 New Revision: 247833 URL: http://svnweb.freebsd.org/changeset/base/247833 Log: Import the drm_mm_debug_table() function. Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/dev/drm2/drm_mm.c head/sys/dev/drm2/drm_mm.h Modified: head/sys/dev/drm2/drm_mm.c ============================================================================== --- head/sys/dev/drm2/drm_mm.c Tue Mar 5 09:07:01 2013 (r247832) +++ head/sys/dev/drm2/drm_mm.c Tue Mar 5 09:07:58 2013 (r247833) @@ -561,3 +561,40 @@ void drm_mm_takedown(struct drm_mm * mm) KASSERT(mm->num_unused == 0, ("num_unused != 0")); } + +void drm_mm_debug_table(struct drm_mm *mm, const char *prefix) +{ + struct drm_mm_node *entry; + unsigned long total_used = 0, total_free = 0, total = 0; + unsigned long hole_start, hole_end, hole_size; + + hole_start = drm_mm_hole_node_start(&mm->head_node); + hole_end = drm_mm_hole_node_end(&mm->head_node); + hole_size = hole_end - hole_start; + if (hole_size) + printf("%s 0x%08lx-0x%08lx: %8lu: free\n", + prefix, hole_start, hole_end, + hole_size); + total_free += hole_size; + + drm_mm_for_each_node(entry, mm) { + printf("%s 0x%08lx-0x%08lx: %8lu: used\n", + prefix, entry->start, entry->start + entry->size, + entry->size); + total_used += entry->size; + + if (entry->hole_follows) { + hole_start = drm_mm_hole_node_start(entry); + hole_end = drm_mm_hole_node_end(entry); + hole_size = hole_end - hole_start; + printf("%s 0x%08lx-0x%08lx: %8lu: free\n", + prefix, hole_start, hole_end, + hole_size); + total_free += hole_size; + } + } + total = total_free + total_used; + + printf("%s total: %lu, used %lu free %lu\n", prefix, total, + total_used, total_free); +} Modified: head/sys/dev/drm2/drm_mm.h ============================================================================== --- head/sys/dev/drm2/drm_mm.h Tue Mar 5 09:07:01 2013 (r247832) +++ head/sys/dev/drm2/drm_mm.h Tue Mar 5 09:07:58 2013 (r247833) @@ -182,4 +182,6 @@ void drm_mm_init_scan_with_range(struct int drm_mm_scan_add_block(struct drm_mm_node *node); int drm_mm_scan_remove_block(struct drm_mm_node *node); +void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); + #endif From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 09:27:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 69C98DB7; Tue, 5 Mar 2013 09:27:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D2D7D9A; Tue, 5 Mar 2013 09:27:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r259RMhA014251; Tue, 5 Mar 2013 09:27:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r259RLDH014246; Tue, 5 Mar 2013 09:27:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303050927.r259RLDH014246@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Mar 2013 09:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247834 - in head/sys: dev/drm2 modules/drm2/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:27:22 -0000 Author: kib Date: Tue Mar 5 09:27:21 2013 New Revision: 247834 URL: http://svnweb.freebsd.org/changeset/base/247834 Log: Import the drm_global references helpers. Sponsored by: The FreeBSD Foundation MFC after: 1 month Added: head/sys/dev/drm2/drm_global.c (contents, props changed) head/sys/dev/drm2/drm_global.h (contents, props changed) Modified: head/sys/modules/drm2/drm2/Makefile Added: head/sys/dev/drm2/drm_global.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm_global.c Tue Mar 5 09:27:21 2013 (r247834) @@ -0,0 +1,109 @@ +/************************************************************************** + * + * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ +/* + * Authors: Thomas Hellstrom + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +MALLOC_DEFINE(M_DRM_GLOBAL, "drm_global", "DRM Global Items"); + +struct drm_global_item { + struct sx mutex; + void *object; + int refcount; +}; + +static struct drm_global_item glob[DRM_GLOBAL_NUM]; + +void drm_global_init(void) +{ + int i; + + for (i = 0; i < DRM_GLOBAL_NUM; ++i) { + struct drm_global_item *item = &glob[i]; + sx_init(&item->mutex, "drmgi"); + item->object = NULL; + item->refcount = 0; + } +} + +void drm_global_release(void) +{ + int i; + for (i = 0; i < DRM_GLOBAL_NUM; ++i) { + struct drm_global_item *item = &glob[i]; + MPASS(item->object == NULL); + MPASS(item->refcount == 0); + } +} + +int drm_global_item_ref(struct drm_global_reference *ref) +{ + int ret; + struct drm_global_item *item = &glob[ref->global_type]; + void *object; + + sx_xlock(&item->mutex); + if (item->refcount == 0) { + item->object = malloc(ref->size, M_DRM_GLOBAL, + M_WAITOK | M_ZERO); + + ref->object = item->object; + ret = ref->init(ref); + if (unlikely(ret != 0)) + goto out_err; + + } + ++item->refcount; + ref->object = item->object; + object = item->object; + sx_xunlock(&item->mutex); + return 0; +out_err: + sx_xunlock(&item->mutex); + item->object = NULL; + return ret; +} + +void drm_global_item_unref(struct drm_global_reference *ref) +{ + struct drm_global_item *item = &glob[ref->global_type]; + + sx_xlock(&item->mutex); + MPASS(item->refcount != 0); + MPASS(ref->object == item->object); + if (--item->refcount == 0) { + ref->release(ref); + item->object = NULL; + } + sx_xunlock(&item->mutex); +} Added: head/sys/dev/drm2/drm_global.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm_global.h Tue Mar 5 09:27:21 2013 (r247834) @@ -0,0 +1,56 @@ +/************************************************************************** + * + * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ +/* + * Authors: Thomas Hellstrom + */ +/* $FreeBSD$ */ + +#ifndef _DRM_GLOBAL_H_ +#define _DRM_GLOBAL_H_ +enum drm_global_types { + DRM_GLOBAL_TTM_MEM = 0, + DRM_GLOBAL_TTM_BO, + DRM_GLOBAL_TTM_OBJECT, + DRM_GLOBAL_NUM +}; + +struct drm_global_reference { + enum drm_global_types global_type; + size_t size; + void *object; + int (*init) (struct drm_global_reference *); + void (*release) (struct drm_global_reference *); +}; + +extern void drm_global_init(void); +extern void drm_global_release(void); +extern int drm_global_item_ref(struct drm_global_reference *ref); +extern void drm_global_item_unref(struct drm_global_reference *ref); + +MALLOC_DECLARE(M_DRM_GLOBAL); + +#endif Modified: head/sys/modules/drm2/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/drm2/Makefile Tue Mar 5 09:07:58 2013 (r247833) +++ head/sys/modules/drm2/drm2/Makefile Tue Mar 5 09:27:21 2013 (r247834) @@ -18,6 +18,7 @@ SRCS = \ drm_fops.c \ drm_gem.c \ drm_gem_names.c \ + drm_global.c \ drm_hashtab.c \ drm_ioctl.c \ drm_irq.c \ From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 09:49:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9CCF7BC4; Tue, 5 Mar 2013 09:49:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F5D111A; Tue, 5 Mar 2013 09:49:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r259nZ5X020427; Tue, 5 Mar 2013 09:49:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r259nYRn020421; Tue, 5 Mar 2013 09:49:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303050949.r259nYRn020421@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Mar 2013 09:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247835 - in head/sys: dev/drm2 dev/drm2/ttm modules/drm2/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:49:35 -0000 Author: kib Date: Tue Mar 5 09:49:34 2013 New Revision: 247835 URL: http://svnweb.freebsd.org/changeset/base/247835 Log: Import the preliminary port of the TTM. The early commit is done to facilitate the off-tree work on the porting of the Radeon driver. Sponsored by: The FreeBSD Foundation Debugged and tested by: dumbbell MFC after: 1 month Added: head/sys/dev/drm2/ttm/ head/sys/dev/drm2/ttm/ttm_agp_backend.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_bo.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_bo_api.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_bo_driver.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_bo_manager.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_bo_util.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_bo_vm.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_execbuf_util.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_execbuf_util.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_lock.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_lock.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_memory.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_memory.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_module.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_object.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_object.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_page_alloc.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_page_alloc.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_page_alloc_dma.c (contents, props changed) head/sys/dev/drm2/ttm/ttm_placement.h (contents, props changed) head/sys/dev/drm2/ttm/ttm_tt.c (contents, props changed) Modified: head/sys/dev/drm2/drmP.h head/sys/dev/drm2/drm_drv.c head/sys/dev/drm2/drm_gem.c head/sys/modules/drm2/drm2/Makefile Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Tue Mar 5 09:27:21 2013 (r247834) +++ head/sys/dev/drm2/drmP.h Tue Mar 5 09:49:34 2013 (r247835) @@ -906,6 +906,7 @@ struct drm_device { struct drm_minor *control; /**< Control node for card */ struct drm_minor *primary; /**< render type primary screen head */ + void *drm_ttm_bo; struct unrhdr *drw_unrhdr; /* RB tree of drawable infos */ RB_HEAD(drawable_tree, bsd_drm_drawable_info) drw_head; @@ -1302,10 +1303,14 @@ void drm_gem_release(struct drm_device * int drm_gem_create_mmap_offset(struct drm_gem_object *obj); void drm_gem_free_mmap_offset(struct drm_gem_object *obj); -int drm_gem_mmap_single(struct cdev *kdev, vm_ooffset_t *offset, vm_size_t size, - struct vm_object **obj_res, int nprot); +int drm_gem_mmap_single(struct drm_device *dev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **obj_res, int nprot); void drm_gem_pager_dtr(void *obj); +struct ttm_bo_device; +int ttm_bo_mmap_single(struct ttm_bo_device *bdev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **obj_res, int nprot); + void drm_device_lock_mtx(struct drm_device *dev); void drm_device_unlock_mtx(struct drm_device *dev); int drm_device_sleep_mtx(struct drm_device *dev, void *chan, int flags, Modified: head/sys/dev/drm2/drm_drv.c ============================================================================== --- head/sys/dev/drm2/drm_drv.c Tue Mar 5 09:27:21 2013 (r247834) +++ head/sys/dev/drm2/drm_drv.c Tue Mar 5 09:49:34 2013 (r247835) @@ -58,6 +58,8 @@ static int drm_load(struct drm_device *d static void drm_unload(struct drm_device *dev); static drm_pci_id_list_t *drm_find_description(int vendor, int device, drm_pci_id_list_t *idlist); +static int drm_mmap_single(struct cdev *kdev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **obj_res, int nprot); static int drm_modevent(module_t mod, int type, void *data) @@ -187,7 +189,7 @@ static struct cdevsw drm_cdevsw = { .d_ioctl = drm_ioctl, .d_poll = drm_poll, .d_mmap = drm_mmap, - .d_mmap_single = drm_gem_mmap_single, + .d_mmap_single = drm_mmap_single, .d_name = "drm", .d_flags = D_TRACKCLOSE }; @@ -955,6 +957,23 @@ drm_add_busid_modesetting(struct drm_dev return (0); } +static int +drm_mmap_single(struct cdev *kdev, vm_ooffset_t *offset, vm_size_t size, + struct vm_object **obj_res, int nprot) +{ + struct drm_device *dev; + + dev = drm_get_device_from_kdev(kdev); + if ((dev->driver->driver_features & DRIVER_GEM) != 0) { + return (drm_gem_mmap_single(dev, offset, size, obj_res, nprot)); + } else if (dev->drm_ttm_bo != NULL) { + return (ttm_bo_mmap_single(dev->drm_ttm_bo, offset, size, + obj_res, nprot)); + } else { + return (ENODEV); + } +} + #if DRM_LINUX #include Modified: head/sys/dev/drm2/drm_gem.c ============================================================================== --- head/sys/dev/drm2/drm_gem.c Tue Mar 5 09:27:21 2013 (r247834) +++ head/sys/dev/drm2/drm_gem.c Tue Mar 5 09:49:34 2013 (r247835) @@ -441,16 +441,12 @@ drm_gem_free_mmap_offset(struct drm_gem_ } int -drm_gem_mmap_single(struct cdev *kdev, vm_ooffset_t *offset, vm_size_t size, +drm_gem_mmap_single(struct drm_device *dev, vm_ooffset_t *offset, vm_size_t size, struct vm_object **obj_res, int nprot) { - struct drm_device *dev; struct drm_gem_object *gem_obj; struct vm_object *vm_obj; - dev = drm_get_device_from_kdev(kdev); - if ((dev->driver->driver_features & DRIVER_GEM) == 0) - return (ENODEV); DRM_LOCK(dev); gem_obj = drm_gem_object_from_offset(dev, *offset); if (gem_obj == NULL) { Added: head/sys/dev/drm2/ttm/ttm_agp_backend.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/ttm/ttm_agp_backend.c Tue Mar 5 09:49:34 2013 (r247835) @@ -0,0 +1,145 @@ +/************************************************************************** + * + * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ +/* + * Authors: Thomas Hellstrom + * Keith Packard. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#ifdef TTM_HAS_AGP +#include + +struct ttm_agp_backend { + struct ttm_tt ttm; + struct agp_memory *mem; + device_t bridge; +}; + +MALLOC_DEFINE(M_TTM_AGP, "ttm_agp", "TTM AGP Backend"); + +static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) +{ + struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); + struct drm_mm_node *node = bo_mem->mm_node; + struct agp_memory *mem; + int ret, cached = (bo_mem->placement & TTM_PL_FLAG_CACHED); + unsigned i; + + mem = agp_alloc_memory(agp_be->bridge, AGP_USER_MEMORY, ttm->num_pages); + if (unlikely(mem == NULL)) + return -ENOMEM; + + mem->page_count = 0; + for (i = 0; i < ttm->num_pages; i++) { + vm_page_t page = ttm->pages[i]; + + if (!page) + page = ttm->dummy_read_page; + + mem->pages[mem->page_count++] = page; + } + agp_be->mem = mem; + + mem->is_flushed = 1; + mem->type = (cached) ? AGP_USER_CACHED_MEMORY : AGP_USER_MEMORY; + + ret = agp_bind_memory(mem, node->start); + if (ret) + pr_err("AGP Bind memory failed\n"); + + return ret; +} + +static int ttm_agp_unbind(struct ttm_tt *ttm) +{ + struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); + + if (agp_be->mem) { + if (agp_be->mem->is_bound) + return agp_unbind_memory(agp_be->mem); + agp_free_memory(agp_be->mem); + agp_be->mem = NULL; + } + return 0; +} + +static void ttm_agp_destroy(struct ttm_tt *ttm) +{ + struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); + + if (agp_be->mem) + ttm_agp_unbind(ttm); + ttm_tt_fini(ttm); + free(agp_be, M_TTM_AGP); +} + +static struct ttm_backend_func ttm_agp_func = { + .bind = ttm_agp_bind, + .unbind = ttm_agp_unbind, + .destroy = ttm_agp_destroy, +}; + +struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, + device_t bridge, + unsigned long size, uint32_t page_flags, + vm_page_t dummy_read_page) +{ + struct ttm_agp_backend *agp_be; + + agp_be = malloc(sizeof(*agp_be), M_TTM_AGP, M_WAITOK | M_ZERO); + + agp_be->mem = NULL; + agp_be->bridge = bridge; + agp_be->ttm.func = &ttm_agp_func; + + if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) { + return NULL; + } + + return &agp_be->ttm; +} + +int ttm_agp_tt_populate(struct ttm_tt *ttm) +{ + if (ttm->state != tt_unpopulated) + return 0; + + return ttm_pool_populate(ttm); +} + +void ttm_agp_tt_unpopulate(struct ttm_tt *ttm) +{ + ttm_pool_unpopulate(ttm); +} + +#endif Added: head/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/ttm/ttm_bo.c Tue Mar 5 09:49:34 2013 (r247835) @@ -0,0 +1,1820 @@ +/************************************************************************** + * + * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ +/* + * Authors: Thomas Hellstrom + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#define TTM_ASSERT_LOCKED(param) +#define TTM_DEBUG(fmt, arg...) +#define TTM_BO_HASH_ORDER 13 + +static int ttm_bo_setup_vm(struct ttm_buffer_object *bo); +static int ttm_bo_swapout(struct ttm_mem_shrink *shrink); +static void ttm_bo_global_kobj_release(struct ttm_bo_global *glob); + +MALLOC_DEFINE(M_TTM_BO, "ttm_bo", "TTM Buffer Objects"); + +static inline int ttm_mem_type_from_flags(uint32_t flags, uint32_t *mem_type) +{ + int i; + + for (i = 0; i <= TTM_PL_PRIV5; i++) + if (flags & (1 << i)) { + *mem_type = i; + return 0; + } + return -EINVAL; +} + +static void ttm_mem_type_debug(struct ttm_bo_device *bdev, int mem_type) +{ + struct ttm_mem_type_manager *man = &bdev->man[mem_type]; + + printf(" has_type: %d\n", man->has_type); + printf(" use_type: %d\n", man->use_type); + printf(" flags: 0x%08X\n", man->flags); + printf(" gpu_offset: 0x%08lX\n", man->gpu_offset); + printf(" size: %ju\n", (uintmax_t)man->size); + printf(" available_caching: 0x%08X\n", man->available_caching); + printf(" default_caching: 0x%08X\n", man->default_caching); + if (mem_type != TTM_PL_SYSTEM) + (*man->func->debug)(man, TTM_PFX); +} + +static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo, + struct ttm_placement *placement) +{ + int i, ret, mem_type; + + printf("No space for %p (%lu pages, %luK, %luM)\n", + bo, bo->mem.num_pages, bo->mem.size >> 10, + bo->mem.size >> 20); + for (i = 0; i < placement->num_placement; i++) { + ret = ttm_mem_type_from_flags(placement->placement[i], + &mem_type); + if (ret) + return; + printf(" placement[%d]=0x%08X (%d)\n", + i, placement->placement[i], mem_type); + ttm_mem_type_debug(bo->bdev, mem_type); + } +} + +#if 0 +static ssize_t ttm_bo_global_show(struct ttm_bo_global *glob, + char *buffer) +{ + + return snprintf(buffer, PAGE_SIZE, "%lu\n", + (unsigned long) atomic_read(&glob->bo_count)); +} +#endif + +static inline uint32_t ttm_bo_type_flags(unsigned type) +{ + return 1 << (type); +} + +static void ttm_bo_release_list(struct ttm_buffer_object *bo) +{ + struct ttm_bo_device *bdev = bo->bdev; + size_t acc_size = bo->acc_size; + + MPASS(atomic_read(&bo->list_kref) == 0); + MPASS(atomic_read(&bo->kref) == 0); + MPASS(atomic_read(&bo->cpu_writers) == 0); + MPASS(bo->sync_obj == NULL); + MPASS(bo->mem.mm_node == NULL); + MPASS(list_empty(&bo->lru)); + MPASS(list_empty(&bo->ddestroy)); + + if (bo->ttm) + ttm_tt_destroy(bo->ttm); + atomic_dec(&bo->glob->bo_count); + if (bo->destroy) + bo->destroy(bo); + else { + free(bo, M_TTM_BO); + } + ttm_mem_global_free(bdev->glob->mem_glob, acc_size); +} + +int +ttm_bo_wait_unreserved_locked(struct ttm_buffer_object *bo, bool interruptible) +{ + const char *wmsg; + int flags, ret; + + ret = 0; + if (interruptible) { + flags = PCATCH; + wmsg = "ttbowi"; + } else { + flags = 0; + wmsg = "ttbowu"; + } + while (!ttm_bo_is_reserved(bo)) { + ret = -msleep(bo, &bo->glob->lru_lock, flags, wmsg, 0); + if (ret != 0) + break; + } + return (ret); +} + +void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) +{ + struct ttm_bo_device *bdev = bo->bdev; + struct ttm_mem_type_manager *man; + + MPASS(ttm_bo_is_reserved(bo)); + + if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) { + + MPASS(list_empty(&bo->lru)); + + man = &bdev->man[bo->mem.mem_type]; + list_add_tail(&bo->lru, &man->lru); + refcount_acquire(&bo->list_kref); + + if (bo->ttm != NULL) { + list_add_tail(&bo->swap, &bo->glob->swap_lru); + refcount_acquire(&bo->list_kref); + } + } +} + +int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) +{ + int put_count = 0; + + if (!list_empty(&bo->swap)) { + list_del_init(&bo->swap); + ++put_count; + } + if (!list_empty(&bo->lru)) { + list_del_init(&bo->lru); + ++put_count; + } + + /* + * TODO: Add a driver hook to delete from + * driver-specific LRU's here. + */ + + return put_count; +} + +int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, + bool interruptible, + bool no_wait, bool use_sequence, uint32_t sequence) +{ + int ret; + + while (unlikely(atomic_read(&bo->reserved) != 0)) { + /** + * Deadlock avoidance for multi-bo reserving. + */ + if (use_sequence && bo->seq_valid) { + /** + * We've already reserved this one. + */ + if (unlikely(sequence == bo->val_seq)) + return -EDEADLK; + /** + * Already reserved by a thread that will not back + * off for us. We need to back off. + */ + if (unlikely(sequence - bo->val_seq < (1 << 31))) + return -EAGAIN; + } + + if (no_wait) + return -EBUSY; + + ret = ttm_bo_wait_unreserved_locked(bo, interruptible); + if (unlikely(ret)) + return ret; + } + + atomic_set(&bo->reserved, 1); + if (use_sequence) { + /** + * Wake up waiters that may need to recheck for deadlock, + * if we decreased the sequence number. + */ + if (unlikely((bo->val_seq - sequence < (1 << 31)) + || !bo->seq_valid)) + wakeup(bo); + + bo->val_seq = sequence; + bo->seq_valid = true; + } else { + bo->seq_valid = false; + } + + return 0; +} + +void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, + bool never_free) +{ + u_int old; + + old = atomic_fetchadd_int(&bo->list_kref, -count); + if (old <= count) { + if (never_free) + panic("ttm_bo_ref_buf"); + ttm_bo_release_list(bo); + } +} + +int ttm_bo_reserve(struct ttm_buffer_object *bo, + bool interruptible, + bool no_wait, bool use_sequence, uint32_t sequence) +{ + struct ttm_bo_global *glob = bo->glob; + int put_count = 0; + int ret; + + mtx_lock(&glob->lru_lock); + ret = ttm_bo_reserve_locked(bo, interruptible, no_wait, use_sequence, + sequence); + if (likely(ret == 0)) + put_count = ttm_bo_del_from_lru(bo); + mtx_unlock(&glob->lru_lock); + + ttm_bo_list_ref_sub(bo, put_count, true); + + return ret; +} + +void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo) +{ + ttm_bo_add_to_lru(bo); + atomic_set(&bo->reserved, 0); + wakeup(bo); +} + +void ttm_bo_unreserve(struct ttm_buffer_object *bo) +{ + struct ttm_bo_global *glob = bo->glob; + + mtx_lock(&glob->lru_lock); + ttm_bo_unreserve_locked(bo); + mtx_unlock(&glob->lru_lock); +} + +/* + * Call bo->mutex locked. + */ +static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc) +{ + struct ttm_bo_device *bdev = bo->bdev; + struct ttm_bo_global *glob = bo->glob; + int ret = 0; + uint32_t page_flags = 0; + + TTM_ASSERT_LOCKED(&bo->mutex); + bo->ttm = NULL; + + if (bdev->need_dma32) + page_flags |= TTM_PAGE_FLAG_DMA32; + + switch (bo->type) { + case ttm_bo_type_device: + if (zero_alloc) + page_flags |= TTM_PAGE_FLAG_ZERO_ALLOC; + case ttm_bo_type_kernel: + bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT, + page_flags, glob->dummy_read_page); + if (unlikely(bo->ttm == NULL)) + ret = -ENOMEM; + break; + case ttm_bo_type_sg: + bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT, + page_flags | TTM_PAGE_FLAG_SG, + glob->dummy_read_page); + if (unlikely(bo->ttm == NULL)) { + ret = -ENOMEM; + break; + } + bo->ttm->sg = bo->sg; + break; + default: + printf("[TTM] Illegal buffer object type\n"); + ret = -EINVAL; + break; + } + + return ret; +} + +static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, + struct ttm_mem_reg *mem, + bool evict, bool interruptible, + bool no_wait_gpu) +{ + struct ttm_bo_device *bdev = bo->bdev; + bool old_is_pci = ttm_mem_reg_is_pci(bdev, &bo->mem); + bool new_is_pci = ttm_mem_reg_is_pci(bdev, mem); + struct ttm_mem_type_manager *old_man = &bdev->man[bo->mem.mem_type]; + struct ttm_mem_type_manager *new_man = &bdev->man[mem->mem_type]; + int ret = 0; + + if (old_is_pci || new_is_pci || + ((mem->placement & bo->mem.placement & TTM_PL_MASK_CACHING) == 0)) { + ret = ttm_mem_io_lock(old_man, true); + if (unlikely(ret != 0)) + goto out_err; + ttm_bo_unmap_virtual_locked(bo); + ttm_mem_io_unlock(old_man); + } + + /* + * Create and bind a ttm if required. + */ + + if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) { + if (bo->ttm == NULL) { + bool zero = !(old_man->flags & TTM_MEMTYPE_FLAG_FIXED); + ret = ttm_bo_add_ttm(bo, zero); + if (ret) + goto out_err; + } + + ret = ttm_tt_set_placement_caching(bo->ttm, mem->placement); + if (ret) + goto out_err; + + if (mem->mem_type != TTM_PL_SYSTEM) { + ret = ttm_tt_bind(bo->ttm, mem); + if (ret) + goto out_err; + } + + if (bo->mem.mem_type == TTM_PL_SYSTEM) { + if (bdev->driver->move_notify) + bdev->driver->move_notify(bo, mem); + bo->mem = *mem; + mem->mm_node = NULL; + goto moved; + } + } + + if (bdev->driver->move_notify) + bdev->driver->move_notify(bo, mem); + + if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) && + !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) + ret = ttm_bo_move_ttm(bo, evict, no_wait_gpu, mem); + else if (bdev->driver->move) + ret = bdev->driver->move(bo, evict, interruptible, + no_wait_gpu, mem); + else + ret = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, mem); + + if (ret) { + if (bdev->driver->move_notify) { + struct ttm_mem_reg tmp_mem = *mem; + *mem = bo->mem; + bo->mem = tmp_mem; + bdev->driver->move_notify(bo, mem); + bo->mem = *mem; + } + + goto out_err; + } + +moved: + if (bo->evicted) { + ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement); + if (ret) + printf("[TTM] Can not flush read caches\n"); + bo->evicted = false; + } + + if (bo->mem.mm_node) { + bo->offset = (bo->mem.start << PAGE_SHIFT) + + bdev->man[bo->mem.mem_type].gpu_offset; + bo->cur_placement = bo->mem.placement; + } else + bo->offset = 0; + + return 0; + +out_err: + new_man = &bdev->man[bo->mem.mem_type]; + if ((new_man->flags & TTM_MEMTYPE_FLAG_FIXED) && bo->ttm) { + ttm_tt_unbind(bo->ttm); + ttm_tt_destroy(bo->ttm); + bo->ttm = NULL; + } + + return ret; +} + +/** + * Call bo::reserved. + * Will release GPU memory type usage on destruction. + * This is the place to put in driver specific hooks to release + * driver private resources. + * Will release the bo::reserved lock. + */ + +static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo) +{ + if (bo->bdev->driver->move_notify) + bo->bdev->driver->move_notify(bo, NULL); + + if (bo->ttm) { + ttm_tt_unbind(bo->ttm); + ttm_tt_destroy(bo->ttm); + bo->ttm = NULL; + } + ttm_bo_mem_put(bo, &bo->mem); + + atomic_set(&bo->reserved, 0); + wakeup(&bo); + + /* + * Since the final reference to this bo may not be dropped by + * the current task we have to put a memory barrier here to make + * sure the changes done in this function are always visible. + * + * This function only needs protection against the final kref_put. + */ + mb(); +} + +static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) +{ + struct ttm_bo_device *bdev = bo->bdev; + struct ttm_bo_global *glob = bo->glob; + struct ttm_bo_driver *driver = bdev->driver; + void *sync_obj = NULL; + int put_count; + int ret; + + mtx_lock(&glob->lru_lock); + ret = ttm_bo_reserve_locked(bo, false, true, false, 0); + + mtx_lock(&bdev->fence_lock); + (void) ttm_bo_wait(bo, false, false, true); + if (!ret && !bo->sync_obj) { + mtx_unlock(&bdev->fence_lock); + put_count = ttm_bo_del_from_lru(bo); + + mtx_unlock(&glob->lru_lock); + ttm_bo_cleanup_memtype_use(bo); + + ttm_bo_list_ref_sub(bo, put_count, true); + + return; + } + if (bo->sync_obj) + sync_obj = driver->sync_obj_ref(bo->sync_obj); + mtx_unlock(&bdev->fence_lock); + + if (!ret) { + atomic_set(&bo->reserved, 0); + wakeup(bo); + } + + refcount_acquire(&bo->list_kref); + list_add_tail(&bo->ddestroy, &bdev->ddestroy); + mtx_unlock(&glob->lru_lock); + + if (sync_obj) { + driver->sync_obj_flush(sync_obj); + driver->sync_obj_unref(&sync_obj); + } + taskqueue_enqueue_timeout(taskqueue_thread, &bdev->wq, + ((hz / 100) < 1) ? 1 : hz / 100); +} + +/** + * function ttm_bo_cleanup_refs_and_unlock + * If bo idle, remove from delayed- and lru lists, and unref. + * If not idle, do nothing. + * + * Must be called with lru_lock and reservation held, this function + * will drop both before returning. + * + * @interruptible Any sleeps should occur interruptibly. + * @no_wait_gpu Never wait for gpu. Return -EBUSY instead. + */ + +static int ttm_bo_cleanup_refs_and_unlock(struct ttm_buffer_object *bo, + bool interruptible, + bool no_wait_gpu) +{ + struct ttm_bo_device *bdev = bo->bdev; + struct ttm_bo_driver *driver = bdev->driver; + struct ttm_bo_global *glob = bo->glob; + int put_count; + int ret; + + mtx_lock(&bdev->fence_lock); + ret = ttm_bo_wait(bo, false, false, true); + + if (ret && !no_wait_gpu) { + void *sync_obj; + + /* + * Take a reference to the fence and unreserve, + * at this point the buffer should be dead, so + * no new sync objects can be attached. + */ + sync_obj = driver->sync_obj_ref(bo->sync_obj); + mtx_unlock(&bdev->fence_lock); + + atomic_set(&bo->reserved, 0); + wakeup(bo); + mtx_unlock(&glob->lru_lock); + + ret = driver->sync_obj_wait(sync_obj, false, interruptible); + driver->sync_obj_unref(&sync_obj); + if (ret) + return ret; + + /* + * remove sync_obj with ttm_bo_wait, the wait should be + * finished, and no new wait object should have been added. + */ + mtx_lock(&bdev->fence_lock); + ret = ttm_bo_wait(bo, false, false, true); + mtx_unlock(&bdev->fence_lock); + if (ret) + return ret; + + mtx_lock(&glob->lru_lock); + ret = ttm_bo_reserve_locked(bo, false, true, false, 0); + + /* + * We raced, and lost, someone else holds the reservation now, + * and is probably busy in ttm_bo_cleanup_memtype_use. + * + * Even if it's not the case, because we finished waiting any + * delayed destruction would succeed, so just return success + * here. + */ + if (ret) { + mtx_unlock(&glob->lru_lock); + return 0; + } + } else + mtx_unlock(&bdev->fence_lock); + + if (ret || unlikely(list_empty(&bo->ddestroy))) { + atomic_set(&bo->reserved, 0); + wakeup(bo); + mtx_unlock(&glob->lru_lock); + return ret; + } + + put_count = ttm_bo_del_from_lru(bo); + list_del_init(&bo->ddestroy); + ++put_count; + + mtx_unlock(&glob->lru_lock); + ttm_bo_cleanup_memtype_use(bo); + + ttm_bo_list_ref_sub(bo, put_count, true); + + return 0; +} + +/** + * Traverse the delayed list, and call ttm_bo_cleanup_refs on all + * encountered buffers. + */ + +static int ttm_bo_delayed_delete(struct ttm_bo_device *bdev, bool remove_all) +{ + struct ttm_bo_global *glob = bdev->glob; + struct ttm_buffer_object *entry = NULL; + int ret = 0; + + mtx_lock(&glob->lru_lock); + if (list_empty(&bdev->ddestroy)) + goto out_unlock; + + entry = list_first_entry(&bdev->ddestroy, + struct ttm_buffer_object, ddestroy); + refcount_acquire(&entry->list_kref); + + for (;;) { + struct ttm_buffer_object *nentry = NULL; + + if (entry->ddestroy.next != &bdev->ddestroy) { + nentry = list_first_entry(&entry->ddestroy, + struct ttm_buffer_object, ddestroy); + refcount_acquire(&nentry->list_kref); + } + + ret = ttm_bo_reserve_locked(entry, false, !remove_all, false, 0); + if (!ret) + ret = ttm_bo_cleanup_refs_and_unlock(entry, false, + !remove_all); + else + mtx_unlock(&glob->lru_lock); + + if (refcount_release(&entry->list_kref)) + ttm_bo_release_list(entry); + entry = nentry; + + if (ret || !entry) + goto out; + + mtx_lock(&glob->lru_lock); + if (list_empty(&entry->ddestroy)) + break; + } + +out_unlock: + mtx_unlock(&glob->lru_lock); +out: + if (entry && refcount_release(&entry->list_kref)) + ttm_bo_release_list(entry); + return ret; +} + +static void ttm_bo_delayed_workqueue(void *arg, int pending __unused) +{ + struct ttm_bo_device *bdev = arg; + + if (ttm_bo_delayed_delete(bdev, false)) { + taskqueue_enqueue_timeout(taskqueue_thread, &bdev->wq, + ((hz / 100) < 1) ? 1 : hz / 100); + } +} + +static void ttm_bo_release(struct ttm_buffer_object *bo) +{ + struct ttm_bo_device *bdev = bo->bdev; + struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; + + rw_wlock(&bdev->vm_lock); + if (likely(bo->vm_node != NULL)) { + RB_REMOVE(ttm_bo_device_buffer_objects, + &bdev->addr_space_rb, bo); + drm_mm_put_block(bo->vm_node); + bo->vm_node = NULL; + } + rw_wunlock(&bdev->vm_lock); + ttm_mem_io_lock(man, false); + ttm_mem_io_free_vm(bo); + ttm_mem_io_unlock(man); + ttm_bo_cleanup_refs_or_queue(bo); + if (refcount_release(&bo->list_kref)) + ttm_bo_release_list(bo); +} + +void ttm_bo_unref(struct ttm_buffer_object **p_bo) +{ + struct ttm_buffer_object *bo = *p_bo; + + *p_bo = NULL; + if (refcount_release(&bo->kref)) + ttm_bo_release(bo); +} + +int ttm_bo_lock_delayed_workqueue(struct ttm_bo_device *bdev) +{ + int pending; + + taskqueue_cancel_timeout(taskqueue_thread, &bdev->wq, &pending); + if (pending) + taskqueue_drain_timeout(taskqueue_thread, &bdev->wq); + return (pending); +} + +void ttm_bo_unlock_delayed_workqueue(struct ttm_bo_device *bdev, int resched) +{ + if (resched) { + taskqueue_enqueue_timeout(taskqueue_thread, &bdev->wq, + ((hz / 100) < 1) ? 1 : hz / 100); + } +} + +static int ttm_bo_evict(struct ttm_buffer_object *bo, bool interruptible, + bool no_wait_gpu) +{ + struct ttm_bo_device *bdev = bo->bdev; + struct ttm_mem_reg evict_mem; + struct ttm_placement placement; + int ret = 0; + + mtx_lock(&bdev->fence_lock); + ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); + mtx_unlock(&bdev->fence_lock); + + if (unlikely(ret != 0)) { + if (ret != -ERESTART) { + printf("[TTM] Failed to expire sync object before buffer eviction\n"); + } + goto out; + } + + MPASS(ttm_bo_is_reserved(bo)); + + evict_mem = bo->mem; + evict_mem.mm_node = NULL; + evict_mem.bus.io_reserved_vm = false; + evict_mem.bus.io_reserved_count = 0; + + placement.fpfn = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 10:18:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6EE5A2D4; Tue, 5 Mar 2013 10:18:49 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5453F2C4; Tue, 5 Mar 2013 10:18:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25AIm2K029617; Tue, 5 Mar 2013 10:18:48 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25AIm8C029614; Tue, 5 Mar 2013 10:18:48 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201303051018.r25AIm8C029614@svn.freebsd.org> From: Fabien Thomas Date: Tue, 5 Mar 2013 10:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247836 - in head/sys: dev/hwpmc 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 10:18:49 -0000 Author: fabient Date: Tue Mar 5 10:18:48 2013 New Revision: 247836 URL: http://svnweb.freebsd.org/changeset/base/247836 Log: Add a generic way to call per event allocate / release function. Reviewed by: mav MFC after: 1 month Modified: head/sys/dev/hwpmc/hwpmc_soft.c head/sys/kern/kern_clock.c head/sys/sys/pmckern.h Modified: head/sys/dev/hwpmc/hwpmc_soft.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_soft.c Tue Mar 5 09:49:34 2013 (r247835) +++ head/sys/dev/hwpmc/hwpmc_soft.c Tue Mar 5 10:18:48 2013 (r247836) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #define SOFT_CAPS (PMC_CAP_READ | PMC_CAP_WRITE | PMC_CAP_INTERRUPT | \ PMC_CAP_USER | PMC_CAP_SYSTEM) -PMC_SOFT_DECLARE( , , clock, prof); - struct soft_descr { struct pmc_descr pm_descr; /* "base class" */ }; @@ -126,9 +124,10 @@ soft_allocate_pmc(int cpu, int ri, struc if (ps == NULL) return (EINVAL); pmc_soft_ev_release(ps); + /* Module unload is protected by pmc SX lock. */ + if (ps->ps_alloc != NULL) + ps->ps_alloc(); - if (ev == pmc___clock_prof.ps_ev.pm_ev_code) - cpu_startprofclock(); return (0); } @@ -315,6 +314,8 @@ static int soft_release_pmc(int cpu, int ri, struct pmc *pmc) { struct pmc_hw *phw; + enum pmc_event ev; + struct pmc_soft *ps; (void) pmc; @@ -328,8 +329,16 @@ soft_release_pmc(int cpu, int ri, struct KASSERT(phw->phw_pmc == NULL, ("[soft,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); - if (pmc->pm_event == pmc___clock_prof.ps_ev.pm_ev_code) - cpu_stopprofclock(); + ev = pmc->pm_event; + + /* Check if event is registered. */ + ps = pmc_soft_ev_acquire(ev); + KASSERT(ps != NULL, + ("[soft,%d] unregistered event %d", __LINE__, ev)); + pmc_soft_ev_release(ps); + /* Module unload is protected by pmc SX lock. */ + if (ps->ps_release != NULL) + ps->ps_release(); return (0); } Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Tue Mar 5 09:49:34 2013 (r247835) +++ head/sys/kern/kern_clock.c Tue Mar 5 10:18:48 2013 (r247836) @@ -78,7 +78,8 @@ __FBSDID("$FreeBSD$"); #include PMC_SOFT_DEFINE( , , clock, hard); PMC_SOFT_DEFINE( , , clock, stat); -PMC_SOFT_DEFINE( , , clock, prof); +PMC_SOFT_DEFINE_EX( , , clock, prof, \ + cpu_startprofclock, cpu_stopprofclock); #endif #ifdef DEVICE_POLLING Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Tue Mar 5 09:49:34 2013 (r247835) +++ head/sys/sys/pmckern.h Tue Mar 5 10:18:48 2013 (r247836) @@ -87,9 +87,9 @@ struct pmckern_soft { * Soft PMC. */ -#define PMC_SOFT_DEFINE(prov, mod, func, name) \ +#define PMC_SOFT_DEFINE_EX(prov, mod, func, name, alloc, release) \ struct pmc_soft pmc_##prov##_##mod##_##func##_##name = \ - { 0, { #prov "_" #mod "_" #func "." #name, 0 } }; \ + { 0, alloc, release, { #prov "_" #mod "_" #func "." #name, 0 } }; \ SYSINIT(pmc_##prov##_##mod##_##func##_##name##_init, SI_SUB_KDTRACE, \ SI_ORDER_SECOND + 1, pmc_soft_ev_register, \ &pmc_##prov##_##mod##_##func##_##name ); \ @@ -97,6 +97,9 @@ struct pmckern_soft { SI_SUB_KDTRACE, SI_ORDER_SECOND + 1, pmc_soft_ev_deregister, \ &pmc_##prov##_##mod##_##func##_##name ) +#define PMC_SOFT_DEFINE(prov, mod, func, name) \ + PMC_SOFT_DEFINE_EX(prov, mod, func, name, NULL, NULL) + #define PMC_SOFT_DECLARE(prov, mod, func, name) \ extern struct pmc_soft pmc_##prov##_##mod##_##func##_##name @@ -147,6 +150,8 @@ do { \ struct pmc_soft { int ps_running; + void (*ps_alloc)(void); + void (*ps_release)(void); struct pmc_dyn_event_descr ps_ev; }; From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 11:02:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9E67AE4C; Tue, 5 Mar 2013 11:02:05 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91F406FC; Tue, 5 Mar 2013 11:02:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25B25Di043600; Tue, 5 Mar 2013 11:02:05 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25B25Db043599; Tue, 5 Mar 2013 11:02:05 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201303051102.r25B25Db043599@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Tue, 5 Mar 2013 11:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247837 - head/sys/geom/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:02:05 -0000 Author: dumbbell Date: Tue Mar 5 11:02:05 2013 New Revision: 247837 URL: http://svnweb.freebsd.org/changeset/base/247837 Log: g_label_ntfs.c: Mark structures as __packed Without this, read data is mis-interpreted. This could trigger a panic, as was the case on one computer where computed "recsize" was zero, leading to a call to g_read_page() asking for 0 bytes. Modified: head/sys/geom/label/g_label_ntfs.c Modified: head/sys/geom/label/g_label_ntfs.c ============================================================================== --- head/sys/geom/label/g_label_ntfs.c Tue Mar 5 10:18:48 2013 (r247836) +++ head/sys/geom/label/g_label_ntfs.c Tue Mar 5 11:02:05 2013 (r247837) @@ -55,7 +55,7 @@ struct ntfs_attr { uint16_t reserved3; uint16_t a_dataoff; uint16_t a_indexed; -}; +} __packed; struct ntfs_filerec { uint32_t fr_hdrmagic; @@ -70,7 +70,7 @@ struct ntfs_filerec { uint32_t fr_allocated; uint64_t fr_mainrec; uint16_t fr_attrnum; -}; +} __packed; struct ntfs_bootfile { uint8_t reserved1[3]; @@ -89,7 +89,7 @@ struct ntfs_bootfile { uint8_t bf_mftrecsz; uint32_t bf_ibsz; uint32_t bf_volsn; -}; +} __packed; static void g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 11:02:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30805FC8; Tue, 5 Mar 2013 11:02:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2002570B; Tue, 5 Mar 2013 11:02:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25B2cCC043730; Tue, 5 Mar 2013 11:02:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25B2c6k043729; Tue, 5 Mar 2013 11:02:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303051102.r25B2c6k043729@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Mar 2013 11:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247838 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:02:39 -0000 Author: kib Date: Tue Mar 5 11:02:38 2013 New Revision: 247838 URL: http://svnweb.freebsd.org/changeset/base/247838 Log: Correct the r247832. Noted by: marius, rdivacky MFC after: 1 month Modified: head/sys/dev/drm2/drmP.h Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Tue Mar 5 11:02:05 2013 (r247837) +++ head/sys/dev/drm2/drmP.h Tue Mar 5 11:02:38 2013 (r247838) @@ -228,7 +228,7 @@ typedef void irqreturn_t; #define IRQ_NONE /* nothing */ #define unlikely(x) __builtin_expect(!!(x), 0) -#define likely(x) __builtin_expect((x), 0) +#define likely(x) __builtin_expect(!!(x), 1) #define container_of(ptr, type, member) ({ \ __typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 11:18:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 87D31873; Tue, 5 Mar 2013 11:18:58 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 762317CC; Tue, 5 Mar 2013 11:18:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25BIw8W048294; Tue, 5 Mar 2013 11:18:58 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25BIw9I048293; Tue, 5 Mar 2013 11:18:58 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201303051118.r25BIw9I048293@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Tue, 5 Mar 2013 11:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247839 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:18:58 -0000 Author: dumbbell Date: Tue Mar 5 11:18:57 2013 New Revision: 247839 URL: http://svnweb.freebsd.org/changeset/base/247839 Log: drm_global.c: Destroy sx in drm_global_release() This fixes a build error at the same time (unused variable "item"), if the kernel is compiled without INVARIANTS. Reported by: Hartmann, O. (build error) Reviewed by: Konstantin Belousov (kib@) Modified: head/sys/dev/drm2/drm_global.c Modified: head/sys/dev/drm2/drm_global.c ============================================================================== --- head/sys/dev/drm2/drm_global.c Tue Mar 5 11:02:38 2013 (r247838) +++ head/sys/dev/drm2/drm_global.c Tue Mar 5 11:18:57 2013 (r247839) @@ -63,6 +63,7 @@ void drm_global_release(void) struct drm_global_item *item = &glob[i]; MPASS(item->object == NULL); MPASS(item->refcount == 0); + sx_destroy(&item->mutex); } } From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 13:06:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A6456BD; Tue, 5 Mar 2013 13:06:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E86FD1B; Tue, 5 Mar 2013 13:06:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25D6e9G081103; Tue, 5 Mar 2013 13:06:40 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25D6eZo081100; Tue, 5 Mar 2013 13:06:40 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303051306.r25D6eZo081100@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 5 Mar 2013 13:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247840 - head/lib/libyaml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:06:41 -0000 Author: bapt Date: Tue Mar 5 13:06:40 2013 New Revision: 247840 URL: http://svnweb.freebsd.org/changeset/base/247840 Log: Add a stub manpage modeled over the libexpat one to explain to users not to use this library outside of base. Requested by: simon Added: head/lib/libyaml/libbsdyml.3 (contents, props changed) Modified: head/lib/libyaml/Makefile Modified: head/lib/libyaml/Makefile ============================================================================== --- head/lib/libyaml/Makefile Tue Mar 5 11:18:57 2013 (r247839) +++ head/lib/libyaml/Makefile Tue Mar 5 13:06:40 2013 (r247840) @@ -7,6 +7,7 @@ SHLIB_MAJOR= 0 INCS= bsdyml.h SRCS= api.c dumper.c emitter.c loader.c \ parser.c reader.c scanner.c writer.c +MAN= libbsdyml.3 .PATH: ${LIBYAML}/src ${LIBYAML}/include CLEANFILES= bsdyml.h Added: head/lib/libyaml/libbsdyml.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libyaml/libbsdyml.3 Tue Mar 5 13:06:40 2013 (r247840) @@ -0,0 +1,61 @@ +.\" Copyright (c) 2013 Baptiste Daroussin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 05, 2013 +.Dt LIBBSDYML 3 +.Os +.Sh NAME +.Nm libbsdyml +.Nd LibYAML library for parsing and emitting YAML +.Sh SYNOPSIS +.In bsdyml.h +.Sh DESCRIPTION +The +.Nm +library is a verbatim copy of the LibYAML version 0.1.4 +.Pp +The +.Nm +library is intended to be used within the +.Fx +base system only. +Use of the +.Nm +library for other purposes is not supported and discouraged. +.Pp +To avoid version and autoconfiguration issues, the library has been +renamed to +.Nm +rather than retain the original LibYAML library and include file names +to prevent confusion and autoconfiguration issues for 3rd party +software. +.Sh SEE ALSO +For full documentation, please see the LibYAML webpage at +.Pa http://pyyaml.org/wiki/LibYAML . +.Sh AUTHORS +.An -nosplit +The original LibYAML was written by +.An Kirill Simonov Aq xi@resolvent.net . From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 13:31:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 251BCDEA; Tue, 5 Mar 2013 13:31:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 08D77E79; Tue, 5 Mar 2013 13:31:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25DV80Q089484; Tue, 5 Mar 2013 13:31:08 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25DV7Km089479; Tue, 5 Mar 2013 13:31:07 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303051331.r25DV7Km089479@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 5 Mar 2013 13:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247841 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:31:08 -0000 Author: bapt Date: Tue Mar 5 13:31:06 2013 New Revision: 247841 URL: http://svnweb.freebsd.org/changeset/base/247841 Log: Add the ability to correctly read pkg.conf is exists. Only look for boostrap useful options: - PACKAGESITE - ABI - MIRROR_TYPE - ASSUME_ALWAYS_YES While here makes PACKAGESITE expand the ${ABI} variable. Allow to deactivate any SRV record look up (MIRROR_TYPE=none) Use the same mechanism as for pkgng itself: first get configuration out of environment variable and fallback on pkg.conf if exists. Reviewed by: bdrewery Added: head/usr.sbin/pkg/config.c (contents, props changed) head/usr.sbin/pkg/config.h (contents, props changed) Modified: head/usr.sbin/pkg/Makefile head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Tue Mar 5 13:06:40 2013 (r247840) +++ head/usr.sbin/pkg/Makefile Tue Mar 5 13:31:06 2013 (r247841) @@ -1,10 +1,10 @@ # $FreeBSD$ PROG= pkg -SRCS= pkg.c dns_utils.c +SRCS= pkg.c dns_utils.c config.c NO_MAN= yes -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} -LDADD= -larchive -lelf -lfetch +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBBSDYML} ${LIBSUBF} +LDADD= -larchive -lelf -lfetch -lbsdyml -lsbuf .include Added: head/usr.sbin/pkg/config.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pkg/config.c Tue Mar 5 13:31:06 2013 (r247841) @@ -0,0 +1,428 @@ +/*- + * Copyright (c) 2013 Baptiste Daroussin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "elf_tables.h" +#include "config.h" + +#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ + +struct config_entry { + uint8_t type; + const char *key; + const char *val; + char *value; + bool envset; +}; + +static struct config_entry c[] = { + [PACKAGESITE] = { + PKG_CONFIG_STRING, + "PACKAGESITE", + "http://pkg.FreeBSD.org/${ABI}/latest", + NULL, + false, + }, + [ABI] = { + PKG_CONFIG_STRING, + "ABI", + NULL, + NULL, + false, + }, + [MIRROR_TYPE] = { + PKG_CONFIG_STRING, + "MIRROR_TYPE", + "SRV", + NULL, + false, + }, + [ASSUME_ALWAYS_YES] = { + PKG_CONFIG_BOOL, + "ASSUME_ALWAYS_YES", + "NO", + NULL, + false, + } +}; + +static const char * +elf_corres_to_string(struct _elf_corres *m, int e) +{ + int i; + + for (i = 0; m[i].string != NULL; i++) + if (m[i].elf_nb == e) + return (m[i].string); + + return ("unknown"); +} + +static int +pkg_get_myabi(char *dest, size_t sz) +{ + Elf *elf; + Elf_Data *data; + Elf_Note note; + Elf_Scn *scn; + char *src, *osname; + const char *abi; + GElf_Ehdr elfhdr; + GElf_Shdr shdr; + int fd, i, ret; + uint32_t version; + + version = 0; + ret = -1; + scn = NULL; + abi = NULL; + + if (elf_version(EV_CURRENT) == EV_NONE) { + warnx("ELF library initialization failed: %s", + elf_errmsg(-1)); + return (-1); + } + + if ((fd = open(_PATH_BSHELL, O_RDONLY)) < 0) { + warn("open()"); + return (-1); + } + + if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + ret = -1; + warnx("elf_begin() failed: %s.", elf_errmsg(-1)); + goto cleanup; + } + + if (gelf_getehdr(elf, &elfhdr) == NULL) { + ret = -1; + warn("getehdr() failed: %s.", elf_errmsg(-1)); + goto cleanup; + } + while ((scn = elf_nextscn(elf, scn)) != NULL) { + if (gelf_getshdr(scn, &shdr) != &shdr) { + ret = -1; + warn("getshdr() failed: %s.", elf_errmsg(-1)); + goto cleanup; + } + + if (shdr.sh_type == SHT_NOTE) + break; + } + + if (scn == NULL) { + ret = -1; + warn("failed to get the note section"); + goto cleanup; + } + + data = elf_getdata(scn, NULL); + src = data->d_buf; + for (;;) { + memcpy(¬e, src, sizeof(Elf_Note)); + src += sizeof(Elf_Note); + if (note.n_type == NT_VERSION) + break; + src += note.n_namesz + note.n_descsz; + } + osname = src; + src += roundup2(note.n_namesz, 4); + if (elfhdr.e_ident[EI_DATA] == ELFDATA2MSB) + version = be32dec(src); + else + version = le32dec(src); + + for (i = 0; osname[i] != '\0'; i++) + osname[i] = (char)tolower(osname[i]); + + snprintf(dest, sz, "%s:%d:%s:%s", + osname, version / 100000, + elf_corres_to_string(mach_corres, (int)elfhdr.e_machine), + elf_corres_to_string(wordsize_corres, + (int)elfhdr.e_ident[EI_CLASS])); + + ret = 0; + + switch (elfhdr.e_machine) { + case EM_ARM: + snprintf(dest + strlen(dest), sz - strlen(dest), + ":%s:%s:%s", elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]), + (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? + "eabi" : "oabi", + (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? + "softfp" : "vfp"); + break; + case EM_MIPS: + /* + * this is taken from binutils sources: + * include/elf/mips.h + * mapping is figured out from binutils: + * gas/config/tc-mips.c + */ + switch (elfhdr.e_flags & EF_MIPS_ABI) { + case E_MIPS_ABI_O32: + abi = "o32"; + break; + case E_MIPS_ABI_N32: + abi = "n32"; + break; + default: + if (elfhdr.e_ident[EI_DATA] == + ELFCLASS32) + abi = "o32"; + else if (elfhdr.e_ident[EI_DATA] == + ELFCLASS64) + abi = "n64"; + break; + } + snprintf(dest + strlen(dest), sz - strlen(dest), + ":%s:%s", elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]), abi); + break; + } + +cleanup: + if (elf != NULL) + elf_end(elf); + + close(fd); + return (ret); +} + +static void +subst_packagesite(const char *abi) +{ + struct sbuf *newval; + const char *variable_string; + const char *oldval; + + if (c[PACKAGESITE].value != NULL) + oldval = c[PACKAGESITE].value; + else + oldval = c[PACKAGESITE].val; + + if ((variable_string = strstr(oldval, "${ABI}")) == NULL) + return; + + newval = sbuf_new_auto(); + sbuf_bcat(newval, oldval, variable_string - oldval); + sbuf_cat(newval, abi); + sbuf_cat(newval, variable_string + strlen("${ABI}")); + sbuf_finish(newval); + + free(c[PACKAGESITE].value); + c[PACKAGESITE].value = strdup(sbuf_data(newval)); +} + +static void +config_parse(yaml_document_t *doc, yaml_node_t *node) +{ + yaml_node_pair_t *pair; + yaml_node_t *key, *val; + struct sbuf *buf = sbuf_new_auto(); + int i; + size_t j; + + pair = node->data.mapping.pairs.start; + + while (pair < node->data.mapping.pairs.top) { + key = yaml_document_get_node(doc, pair->key); + val = yaml_document_get_node(doc, pair->value); + + /* + * ignoring silently empty keys can be empty lines + * or user mistakes + */ + if (key->data.scalar.length <= 0) { + ++pair; + continue; + } + + /* + * silently skip on purpose to allow user to leave + * empty lines without complaining + */ + if (val->type == YAML_NO_NODE || + (val->type == YAML_SCALAR_NODE && + val->data.scalar.length <= 0)) { + ++pair; + continue; + } + + sbuf_clear(buf); + for (j = 0; j < strlen(key->data.scalar.value); ++j) + sbuf_putc(buf, toupper(key->data.scalar.value[j])); + + sbuf_finish(buf); + for (i = 0; i < CONFIG_SIZE; i++) { + if (strcmp(sbuf_data(buf), c[i].key) == 0) + break; + } + + if (i == CONFIG_SIZE) { + ++pair; + continue; + } + + /* env has priority over config file */ + if (c[i].envset) { + ++pair; + continue; + } + + c[i].value = strdup(val->data.scalar.value); + ++pair; + } + + sbuf_delete(buf); +} + +int +config_init(void) +{ + FILE *fp; + yaml_parser_t parser; + yaml_document_t doc; + yaml_node_t *node; + const char *val; + int i; + const char *localbase; + char confpath[MAXPATHLEN]; + char abi[BUFSIZ]; + + for (i = 0; i < CONFIG_SIZE; i++) { + val = getenv(c[i].key); + if (val != NULL) { + c[i].val = val; + c[i].envset = true; + } + } + + localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE; + snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); + + if ((fp = fopen(confpath, "r")) == NULL) { + if (errno != ENOENT) + err(EXIT_FAILURE, "Unable to open configuration file %s", confpath); + /* no configuration present */ + goto finalize; + } + + yaml_parser_initialize(&parser); + yaml_parser_set_input_file(&parser, fp); + yaml_parser_load(&parser, &doc); + + node = yaml_document_get_root_node(&doc); + + if (node != NULL) { + if (node->type != YAML_MAPPING_NODE) + warnx("Invalid configuration format, ignoring the configuration file"); + else + config_parse(&doc, node); + } else { + warnx("Invalid configuration format, ignoring the configuration file"); + } + + yaml_document_delete(&doc); + yaml_parser_delete(&parser); + +finalize: + if (c[ABI].val == NULL && c[ABI].value == NULL) { + if (pkg_get_myabi(abi, BUFSIZ) != 0) + errx(EXIT_FAILURE, "Failed to determine the system ABI"); + c[ABI].val = abi; + } + + subst_packagesite(c[ABI].val); + + return (0); +} + +int +config_string(pkg_config_key k, const char **val) +{ + if (c[k].type != PKG_CONFIG_STRING) + return (-1); + + if (c[k].value != NULL) + *val = c[k].value; + else + *val = c[k].val; + + return (0); +} + +int +config_bool(pkg_config_key k, bool *val) +{ + const char *value; + + if (c[k].type != PKG_CONFIG_BOOL) + return (-1); + + *val = false; + + if (c[k].value != NULL) + value = c[k].value; + else + value = c[k].val; + + if (strcasecmp(value, "true") == 0 || + strcasecmp(value, "yes") == 0 || + strcasecmp(value, "on") == 0 || + *value == '1') + *val = true; + + return (0); +} + +void +config_finish(void) { + int i; + + for (i = 0; i < CONFIG_SIZE; i++) + free(c[i].value); +} Added: head/usr.sbin/pkg/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pkg/config.h Tue Mar 5 13:31:06 2013 (r247841) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2013 Baptiste Daroussin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _PKG_CONFIG_H +#define _PKG_CONFIG_H + +#define _LOCALBASE "/usr/local" + +typedef enum { + PACKAGESITE = 0, + ABI, + MIRROR_TYPE, + ASSUME_ALWAYS_YES, + CONFIG_SIZE +} pkg_config_key; + +typedef enum { + PKG_CONFIG_STRING=0, + PKG_CONFIG_BOOL, +} pkg_config_t; + +int config_init(void); +void config_finish(void); +int config_string(pkg_config_key, const char **); +int config_bool(pkg_config_key, bool *); + +#endif Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Tue Mar 5 13:06:40 2013 (r247840) +++ head/usr.sbin/pkg/pkg.c Tue Mar 5 13:31:06 2013 (r247841) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Baptiste Daroussin + * Copyright (c) 2012-2013 Baptiste Daroussin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,175 +28,23 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include #include #include -#include #include #include -#include #include -#include #include +#include #include #include #include #include #include -#include "elf_tables.h" #include "dns_utils.h" - -#define _LOCALBASE "/usr/local" -#define _PKGS_URL "http://pkg.FreeBSD.org" - -static const char * -elf_corres_to_string(struct _elf_corres *m, int e) -{ - int i; - - for (i = 0; m[i].string != NULL; i++) - if (m[i].elf_nb == e) - return (m[i].string); - - return ("unknown"); -} - -static int -pkg_get_myabi(char *dest, size_t sz) -{ - Elf *elf; - Elf_Data *data; - Elf_Note note; - Elf_Scn *scn; - char *src, *osname; - const char *abi; - GElf_Ehdr elfhdr; - GElf_Shdr shdr; - int fd, i, ret; - uint32_t version; - - version = 0; - ret = -1; - scn = NULL; - abi = NULL; - - if (elf_version(EV_CURRENT) == EV_NONE) { - warnx("ELF library initialization failed: %s", - elf_errmsg(-1)); - return (-1); - } - - if ((fd = open("/bin/sh", O_RDONLY)) < 0) { - warn("open()"); - return (-1); - } - - if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - ret = -1; - warnx("elf_begin() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } - - if (gelf_getehdr(elf, &elfhdr) == NULL) { - ret = -1; - warn("getehdr() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } - - while ((scn = elf_nextscn(elf, scn)) != NULL) { - if (gelf_getshdr(scn, &shdr) != &shdr) { - ret = -1; - warn("getshdr() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } - - if (shdr.sh_type == SHT_NOTE) - break; - } - - if (scn == NULL) { - ret = -1; - warn("failed to get the note section"); - goto cleanup; - } - - data = elf_getdata(scn, NULL); - src = data->d_buf; - for (;;) { - memcpy(¬e, src, sizeof(Elf_Note)); - src += sizeof(Elf_Note); - if (note.n_type == NT_VERSION) - break; - src += note.n_namesz + note.n_descsz; - } - osname = src; - src += note.n_namesz; - if (elfhdr.e_ident[EI_DATA] == ELFDATA2MSB) - version = be32dec(src); - else - version = le32dec(src); - - for (i = 0; osname[i] != '\0'; i++) - osname[i] = (char)tolower(osname[i]); - - snprintf(dest, sz, "%s:%d:%s:%s", - osname, version / 100000, - elf_corres_to_string(mach_corres, (int)elfhdr.e_machine), - elf_corres_to_string(wordsize_corres, - (int)elfhdr.e_ident[EI_CLASS])); - - ret = 0; - - switch (elfhdr.e_machine) { - case EM_ARM: - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s:%s", elf_corres_to_string(endian_corres, - (int)elfhdr.e_ident[EI_DATA]), - (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? - "eabi" : "oabi", - (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? - "softfp" : "vfp"); - break; - case EM_MIPS: - /* - * this is taken from binutils sources: - * include/elf/mips.h - * mapping is figured out from binutils: - * gas/config/tc-mips.c - */ - switch (elfhdr.e_flags & EF_MIPS_ABI) { - case E_MIPS_ABI_O32: - abi = "o32"; - break; - case E_MIPS_ABI_N32: - abi = "n32"; - break; - default: - if (elfhdr.e_ident[EI_DATA] == - ELFCLASS32) - abi = "o32"; - else if (elfhdr.e_ident[EI_DATA] == - ELFCLASS64) - abi = "n64"; - break; - } - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s", elf_corres_to_string(endian_corres, - (int)elfhdr.e_ident[EI_DATA]), abi); - break; - } - -cleanup: - if (elf != NULL) - elf_end(elf); - - close(fd); - return (ret); -} +#include "config.h" static int extract_pkg_static(int fd, char *p, int sz) @@ -291,8 +139,8 @@ bootstrap_pkg(void) char zone[MAXHOSTNAMELEN + 13]; char url[MAXPATHLEN]; char conf[MAXPATHLEN]; - char abi[BUFSIZ]; char tmppkg[MAXPATHLEN]; + const char *packagesite, *mirror_type; char buf[10240]; char pkgstatic[MAXPATHLEN]; int fd, retry, ret, max_retry; @@ -311,17 +159,15 @@ bootstrap_pkg(void) printf("Bootstrapping pkg please wait\n"); - if (pkg_get_myabi(abi, MAXPATHLEN) != 0) { - warnx("failed to determine the system ABI"); + if (config_string(PACKAGESITE, &packagesite) != 0) { + warnx("No PACKAGESITE defined"); return (-1); } - - if (getenv("PACKAGESITE") != NULL) - snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", getenv("PACKAGESITE")); - else - snprintf(url, MAXPATHLEN, "%s/%s/latest/Latest/pkg.txz", - getenv("PACKAGEROOT") ? getenv("PACKAGEROOT") : _PKGS_URL, - getenv("ABI") ? getenv("ABI") : abi); + if (config_string(MIRROR_TYPE, &mirror_type) != 0) { + warnx("No MIRROR_TYPE defined"); + return (-1); + } + snprintf(url, MAXPATHLEN, "%s/latest/Latest/pkg.txz", packagesite); snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); @@ -336,10 +182,10 @@ bootstrap_pkg(void) u = fetchParseURL(url); while (remote == NULL) { if (retry == max_retry) { - if (strcmp(u->scheme, "file") != 0) { + if (strcmp(u->scheme, "file") != 0 && + strcasecmp(mirror_type, "srv") == 0) { snprintf(zone, sizeof(zone), "_%s._tcp.%s", u->scheme, u->host); - printf("%s\n", zone); mirrors = dns_getsrvinfo(zone); current = mirrors; } @@ -449,6 +295,7 @@ int main(__unused int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; + bool yes = false; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); @@ -467,7 +314,9 @@ main(__unused int argc, char *argv[]) * not tty. Check the environment to see if user has answer * tucked in there already. */ - if (getenv("ASSUME_ALWAYS_YES") == NULL) { + config_init(); + config_bool(ASSUME_ALWAYS_YES, &yes); + if (!yes) { printf("%s", confirmation_message); if (!isatty(fileno(stdin))) exit(EXIT_FAILURE); @@ -477,6 +326,7 @@ main(__unused int argc, char *argv[]) } if (bootstrap_pkg() != 0) exit(EXIT_FAILURE); + config_finish(); } execv(pkgpath, argv); From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 13:38:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 63663139; Tue, 5 Mar 2013 13:38:46 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 564C8EF0; Tue, 5 Mar 2013 13:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25Dck4C090526; Tue, 5 Mar 2013 13:38:46 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25DckJE090525; Tue, 5 Mar 2013 13:38:46 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303051338.r25DckJE090525@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 5 Mar 2013 13:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247842 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:38:46 -0000 Author: melifaro Date: Tue Mar 5 13:38:45 2013 New Revision: 247842 URL: http://svnweb.freebsd.org/changeset/base/247842 Log: Write lock is not required for find&compare operation. MFC after: 2 weeks Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Mar 5 13:31:06 2013 (r247841) +++ head/sys/net/route.c Tue Mar 5 13:38:45 2013 (r247842) @@ -1498,7 +1498,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int if (rnh == NULL) /* this table doesn't exist but others might */ continue; - RADIX_NODE_HEAD_LOCK(rnh); + RADIX_NODE_HEAD_RLOCK(rnh); #ifdef RADIX_MPATH if (rn_mpath_capable(rnh)) { @@ -1527,7 +1527,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int (rn->rn_flags & RNF_ROOT) || RNTORT(rn)->rt_ifa != ifa || !sa_equal((struct sockaddr *)rn->rn_key, dst)); - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_RUNLOCK(rnh); if (error) { /* this is only an error if bad on ALL tables */ continue; From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 14:08:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF9748EE; Tue, 5 Mar 2013 14:08:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D73FB15F; Tue, 5 Mar 2013 14:08:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25E8aj5099755; Tue, 5 Mar 2013 14:08:36 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25E8awl099754; Tue, 5 Mar 2013 14:08:36 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303051408.r25E8awl099754@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 5 Mar 2013 14:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247843 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 14:08:37 -0000 Author: bapt Date: Tue Mar 5 14:08:36 2013 New Revision: 247843 URL: http://svnweb.freebsd.org/changeset/base/247843 Log: choose in priority the allocated ABI if any to do the ${ABI} substitution in PACKAGESITE Reviewed by: bdrewery Modified: head/usr.sbin/pkg/config.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Tue Mar 5 13:38:45 2013 (r247842) +++ head/usr.sbin/pkg/config.c Tue Mar 5 14:08:36 2013 (r247843) @@ -376,7 +376,7 @@ finalize: c[ABI].val = abi; } - subst_packagesite(c[ABI].val); + subst_packagesite(c[ABI].value != NULL ? c[ABI].value : c[ABI].val); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 15:33:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 32505657; Tue, 5 Mar 2013 15:33:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 226D58CB; Tue, 5 Mar 2013 15:33:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25FXUXs026227; Tue, 5 Mar 2013 15:33:30 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25FXSpk026214; Tue, 5 Mar 2013 15:33:28 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303051533.r25FXSpk026214@svn.freebsd.org> From: Martin Matuska Date: Tue, 5 Mar 2013 15:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247844 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/lib/libzpool/common vendor/illumos/dist/lib/libzpool/common/sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:33:30 -0000 Author: mm Date: Tue Mar 5 15:33:28 2013 New Revision: 247844 URL: http://svnweb.freebsd.org/changeset/base/247844 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13975:ef6409bc370f Illumos ZFS issues: 3582 zfs_delay() should support a variable resolution 3584 DTrace sdt probes for ZFS txg states Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Tue Mar 5 14:08:36 2013 (r247843) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Tue Mar 5 15:33:28 2013 (r247844) @@ -738,7 +738,8 @@ dsl_dir_tempreserve_space(dsl_dir_t *dd, err = dsl_pool_tempreserve_space(dd->dd_pool, asize, tx); } else { if (err == EAGAIN) { - txg_delay(dd->dd_pool, tx->tx_txg, 1); + txg_delay(dd->dd_pool, tx->tx_txg, + MSEC2NSEC(10), MSEC2NSEC(10)); err = ERESTART; } dsl_pool_memory_pressure(dd->dd_pool); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Tue Mar 5 14:08:36 2013 (r247843) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Tue Mar 5 15:33:28 2013 (r247844) @@ -58,6 +58,9 @@ kmutex_t zfs_write_limit_lock; static pgcnt_t old_physmem = 0; +hrtime_t zfs_throttle_delay = MSEC2NSEC(10); +hrtime_t zfs_throttle_resolution = MSEC2NSEC(10); + int dsl_pool_open_special_dir(dsl_pool_t *dp, const char *name, dsl_dir_t **ddp) { @@ -511,12 +514,13 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * Weight the throughput calculation towards the current value: * thru = 3/4 old_thru + 1/4 new_thru * - * Note: write_time is in nanosecs, so write_time/MICROSEC - * yields millisecs + * Note: write_time is in nanosecs while dp_throughput is expressed in + * bytes per millisecond. */ ASSERT(zfs_write_limit_min > 0); - if (data_written > zfs_write_limit_min / 8 && write_time > MICROSEC) { - uint64_t throughput = data_written / (write_time / MICROSEC); + if (data_written > zfs_write_limit_min / 8 && + write_time > MSEC2NSEC(1)) { + uint64_t throughput = data_written / NSEC2MSEC(write_time); if (dp->dp_throughput) dp->dp_throughput = throughput / 4 + @@ -614,8 +618,10 @@ dsl_pool_tempreserve_space(dsl_pool_t *d * the caller 1 clock tick. This will slow down the "fill" * rate until the sync process can catch up with us. */ - if (reserved && reserved > (write_limit - (write_limit >> 3))) - txg_delay(dp, tx->tx_txg, 1); + if (reserved && reserved > (write_limit - (write_limit >> 3))) { + txg_delay(dp, tx->tx_txg, zfs_throttle_delay, + zfs_throttle_resolution); + } return (0); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Tue Mar 5 14:08:36 2013 (r247843) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Tue Mar 5 15:33:28 2013 (r247844) @@ -403,7 +403,7 @@ dsl_scan_check_pause(dsl_scan_t *scn, co zfs_resilver_min_time_ms : zfs_scan_min_time_ms; elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; if (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || - (elapsed_nanosecs / MICROSEC > mintime && + (NSEC2MSEC(elapsed_nanosecs) > mintime && txg_sync_waiting(scn->scn_dp)) || spa_shutting_down(scn->scn_dp->dp_spa)) { if (zb) { @@ -1308,7 +1308,7 @@ dsl_scan_free_should_pause(dsl_scan_t *s elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || - (elapsed_nanosecs / MICROSEC > zfs_free_min_time_ms && + (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && txg_sync_waiting(scn->scn_dp)) || spa_shutting_down(scn->scn_dp->dp_spa)); } @@ -1433,7 +1433,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * "free_bpobj/bptree txg %llu", (longlong_t)scn->scn_visited_this_txg, (longlong_t) - (gethrtime() - scn->scn_sync_start_time) / MICROSEC, + NSEC2MSEC(gethrtime() - scn->scn_sync_start_time), (longlong_t)tx->tx_txg); scn->scn_visited_this_txg = 0; /* @@ -1481,7 +1481,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * zfs_dbgmsg("visited %llu blocks in %llums", (longlong_t)scn->scn_visited_this_txg, - (longlong_t)(gethrtime() - scn->scn_sync_start_time) / MICROSEC); + (longlong_t)NSEC2MSEC(gethrtime() - scn->scn_sync_start_time)); if (!scn->scn_pausing) { /* finished with scan. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Tue Mar 5 14:08:36 2013 (r247843) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Tue Mar 5 15:33:28 2013 (r247844) @@ -499,8 +499,8 @@ spa_add(const char *name, nvlist_t *conf hdlr.cyh_arg = spa; hdlr.cyh_level = CY_LOW_LEVEL; - spa->spa_deadman_synctime = zfs_deadman_synctime * - zfs_txg_synctime_ms * MICROSEC; + spa->spa_deadman_synctime = MSEC2NSEC(zfs_deadman_synctime * + zfs_txg_synctime_ms); /* * This determines how often we need to check for hung I/Os after @@ -508,7 +508,7 @@ spa_add(const char *name, nvlist_t *conf * an expensive operation we don't want to check too frequently. * Instead wait for 5 synctimes before checking again. */ - when.cyt_interval = 5ULL * zfs_txg_synctime_ms * MICROSEC; + when.cyt_interval = MSEC2NSEC(5 * zfs_txg_synctime_ms); when.cyt_when = CY_INFINITY; mutex_enter(&cpu_lock); spa->spa_deadman_cycid = cyclic_add(&hdlr, &when); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h Tue Mar 5 14:08:36 2013 (r247843) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h Tue Mar 5 15:33:28 2013 (r247844) @@ -74,13 +74,8 @@ extern void txg_rele_to_quiesce(txg_hand extern void txg_rele_to_sync(txg_handle_t *txghp); extern void txg_register_callbacks(txg_handle_t *txghp, list_t *tx_callbacks); -/* - * Delay the caller by the specified number of ticks or until - * the txg closes (whichever comes first). This is intended - * to be used to throttle writers when the system nears its - * capacity. - */ -extern void txg_delay(struct dsl_pool *dp, uint64_t txg, int ticks); +extern void txg_delay(struct dsl_pool *dp, uint64_t txg, hrtime_t delta, + hrtime_t resolution); /* * Wait until the given transaction group has finished syncing. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg_impl.h Tue Mar 5 14:08:36 2013 (r247843) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg_impl.h Tue Mar 5 15:33:28 2013 (r247844) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_TXG_IMPL_H #define _SYS_TXG_IMPL_H @@ -36,14 +40,14 @@ extern "C" { struct tx_cpu { kmutex_t tc_lock; kcondvar_t tc_cv[TXG_SIZE]; - uint64_t tc_count[TXG_SIZE]; + uint64_t tc_count[TXG_SIZE]; /* tx hold count on each txg */ list_t tc_callbacks[TXG_SIZE]; /* commit cb list */ - char tc_pad[16]; + char tc_pad[16]; /* pad to fill 3 cache lines */ }; typedef struct tx_state { - tx_cpu_t *tx_cpu; /* protects right to enter txg */ - kmutex_t tx_sync_lock; /* protects tx_state_t */ + tx_cpu_t *tx_cpu; /* protects access to tx_open_txg */ + kmutex_t tx_sync_lock; /* protects the rest of this struct */ uint64_t tx_open_txg; /* currently open txg id */ uint64_t tx_quiesced_txg; /* quiesced txg waiting for sync */ uint64_t tx_syncing_txg; /* currently syncing txg id */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Tue Mar 5 14:08:36 2013 (r247843) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Tue Mar 5 15:33:28 2013 (r247844) @@ -232,7 +232,7 @@ txg_thread_exit(tx_state_t *tx, callb_cp } static void -txg_thread_wait(tx_state_t *tx, callb_cpr_t *cpr, kcondvar_t *cv, uint64_t time) +txg_thread_wait(tx_state_t *tx, callb_cpr_t *cpr, kcondvar_t *cv, clock_t time) { CALLB_CPR_SAFE_BEGIN(cpr); @@ -353,6 +353,9 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg ASSERT(txg == tx->tx_open_txg); tx->tx_open_txg++; + DTRACE_PROBE2(txg__quiescing, dsl_pool_t *, dp, uint64_t, txg); + DTRACE_PROBE2(txg__opened, dsl_pool_t *, dp, uint64_t, tx->tx_open_txg); + /* * Now that we've incremented tx_open_txg, we can let threads * enter the next transaction group. @@ -475,6 +478,7 @@ txg_sync_thread(dsl_pool_t *dp) txg = tx->tx_quiesced_txg; tx->tx_quiesced_txg = 0; tx->tx_syncing_txg = txg; + DTRACE_PROBE2(txg__syncing, dsl_pool_t *, dp, uint64_t, txg); cv_broadcast(&tx->tx_quiesce_more_cv); dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n", @@ -488,6 +492,7 @@ txg_sync_thread(dsl_pool_t *dp) mutex_enter(&tx->tx_sync_lock); tx->tx_synced_txg = txg; tx->tx_syncing_txg = 0; + DTRACE_PROBE2(txg__synced, dsl_pool_t *, dp, uint64_t, txg); cv_broadcast(&tx->tx_sync_done_cv); /* @@ -536,21 +541,22 @@ txg_quiesce_thread(dsl_pool_t *dp) */ dprintf("quiesce done, handing off txg %llu\n", txg); tx->tx_quiesced_txg = txg; + DTRACE_PROBE2(txg__quiesced, dsl_pool_t *, dp, uint64_t, txg); cv_broadcast(&tx->tx_sync_more_cv); cv_broadcast(&tx->tx_quiesce_done_cv); } } /* - * Delay this thread by 'ticks' if we are still in the open transaction - * group and there is already a waiting txg quiesing or quiesced. Abort - * the delay if this txg stalls or enters the quiesing state. + * Delay this thread by delay nanoseconds if we are still in the open + * transaction group and there is already a waiting txg quiesing or quiesced. + * Abort the delay if this txg stalls or enters the quiesing state. */ void -txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) +txg_delay(dsl_pool_t *dp, uint64_t txg, hrtime_t delay, hrtime_t resolution) { tx_state_t *tx = &dp->dp_tx; - clock_t timeout = ddi_get_lbolt() + ticks; + hrtime_t start = gethrtime(); /* don't delay if this txg could transition to quiesing immediately */ if (tx->tx_open_txg > txg || @@ -563,10 +569,11 @@ txg_delay(dsl_pool_t *dp, uint64_t txg, return; } - while (ddi_get_lbolt() < timeout && - tx->tx_syncing_txg < txg-1 && !txg_stalled(dp)) - (void) cv_timedwait(&tx->tx_quiesce_more_cv, &tx->tx_sync_lock, - timeout); + while (gethrtime() - start < delay && + tx->tx_syncing_txg < txg-1 && !txg_stalled(dp)) { + (void) cv_timedwait_hires(&tx->tx_quiesce_more_cv, + &tx->tx_sync_lock, delay, resolution, 0); + } mutex_exit(&tx->tx_sync_lock); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 15:33:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA18F65A; Tue, 5 Mar 2013 15:33:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A32208CD; Tue, 5 Mar 2013 15:33:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25FXU6i026236; Tue, 5 Mar 2013 15:33:30 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25FXUn6026234; Tue, 5 Mar 2013 15:33:30 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303051533.r25FXUn6026234@svn.freebsd.org> From: Martin Matuska Date: Tue, 5 Mar 2013 15:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247844 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/lib/libzpool/common vendor/illumos/dist/lib/libzpool/common/sys 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:33:30 -0000 Author: mm Date: Tue Mar 5 15:33:28 2013 New Revision: 247844 URL: http://svnweb.freebsd.org/changeset/base/247844 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13975:ef6409bc370f Illumos ZFS issues: 3582 zfs_delay() should support a variable resolution 3584 DTrace sdt probes for ZFS txg states Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/kernel.c Tue Mar 5 14:08:36 2013 (r247843) +++ vendor/illumos/dist/lib/libzpool/common/kernel.c Tue Mar 5 15:33:28 2013 (r247844) @@ -329,6 +329,41 @@ top: return (1); } +/*ARGSUSED*/ +clock_t +cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res, + int flag) +{ + int error; + timestruc_t ts; + hrtime_t delta; + + ASSERT(flag == 0); + +top: + delta = tim - gethrtime(); + if (delta <= 0) + return (-1); + + ts.tv_sec = delta / NANOSEC; + ts.tv_nsec = delta % NANOSEC; + + ASSERT(mutex_owner(mp) == curthread); + mp->m_owner = NULL; + error = cond_reltimedwait(cv, &mp->m_lock, &ts); + mp->m_owner = curthread; + + if (error == ETIME) + return (-1); + + if (error == EINTR) + goto top; + + ASSERT(error == 0); + + return (1); +} + void cv_signal(kcondvar_t *cv) { Modified: vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Tue Mar 5 14:08:36 2013 (r247843) +++ vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Tue Mar 5 15:33:28 2013 (r247844) @@ -254,6 +254,8 @@ extern void cv_init(kcondvar_t *cv, char extern void cv_destroy(kcondvar_t *cv); extern void cv_wait(kcondvar_t *cv, kmutex_t *mp); extern clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime); +extern clock_t cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, + hrtime_t res, int flag); extern void cv_signal(kcondvar_t *cv); extern void cv_broadcast(kcondvar_t *cv); From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 15:35:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AFDACB48; Tue, 5 Mar 2013 15:35:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 88323913; Tue, 5 Mar 2013 15:35:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25FZwvG026602; Tue, 5 Mar 2013 15:35:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25FZwBg026599; Tue, 5 Mar 2013 15:35:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303051535.r25FZwBg026599@svn.freebsd.org> From: Martin Matuska Date: Tue, 5 Mar 2013 15:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247845 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:35:58 -0000 Author: mm Date: Tue Mar 5 15:35:57 2013 New Revision: 247845 URL: http://svnweb.freebsd.org/changeset/base/247845 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13977:af7f2603d4d7 Illumos ZFS issues: 3603 panic from bpobj_enqueue_subobj() 3604 zdb should print bpobjs more verbosely Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Tue Mar 5 15:33:28 2013 (r247844) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Tue Mar 5 15:35:57 2013 (r247845) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -418,6 +418,12 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 VERIFY3U(0, ==, dmu_buf_hold(bpo->bpo_os, subsubobjs, 0, FTAG, &subdb, 0)); + /* + * Make sure that we are not asking dmu_write() + * to write more data than we have in our buffer. + */ + VERIFY3U(subdb->db_size, >=, + numsubsub * sizeof (subobj)); dmu_write(bpo->bpo_os, bpo->bpo_phys->bpo_subobjs, bpo->bpo_phys->bpo_num_subobjs * sizeof (subobj), numsubsub * sizeof (subobj), subdb->db_data, tx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Tue Mar 5 15:33:28 2013 (r247844) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Tue Mar 5 15:35:57 2013 (r247845) @@ -1698,7 +1698,7 @@ dmu_object_info_from_dnode(dnode_t *dn, doi->doi_checksum = dn->dn_checksum; doi->doi_compress = dn->dn_compress; doi->doi_physical_blocks_512 = (DN_USED_BYTES(dnp) + 256) >> 9; - doi->doi_max_offset = (dnp->dn_maxblkid + 1) * dn->dn_datablksz; + doi->doi_max_offset = (dn->dn_maxblkid + 1) * dn->dn_datablksz; doi->doi_fill_count = 0; for (int i = 0; i < dnp->dn_nblkptr; i++) doi->doi_fill_count += dnp->dn_blkptr[i].blk_fill; From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 15:35:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F1D84B4A; Tue, 5 Mar 2013 15:35:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E4EC5915; Tue, 5 Mar 2013 15:35:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25FZwD6026611; Tue, 5 Mar 2013 15:35:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25FZwZ5026610; Tue, 5 Mar 2013 15:35:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303051535.r25FZwZ5026610@svn.freebsd.org> From: Martin Matuska Date: Tue, 5 Mar 2013 15:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247845 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:35:59 -0000 Author: mm Date: Tue Mar 5 15:35:57 2013 New Revision: 247845 URL: http://svnweb.freebsd.org/changeset/base/247845 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13977:af7f2603d4d7 Illumos ZFS issues: 3603 panic from bpobj_enqueue_subobj() 3604 zdb should print bpobjs more verbosely Modified: vendor/illumos/dist/cmd/zdb/zdb.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Tue Mar 5 15:33:28 2013 (r247844) +++ vendor/illumos/dist/cmd/zdb/zdb.c Tue Mar 5 15:35:57 2013 (r247845) @@ -1222,7 +1222,7 @@ dump_bpobj_cb(void *arg, const blkptr_t } static void -dump_bpobj(bpobj_t *bpo, char *name) +dump_bpobj(bpobj_t *bpo, char *name, int indent) { char bytes[32]; char comp[32]; @@ -1232,31 +1232,56 @@ dump_bpobj(bpobj_t *bpo, char *name) return; zdb_nicenum(bpo->bpo_phys->bpo_bytes, bytes); - if (bpo->bpo_havesubobj) { + if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) { zdb_nicenum(bpo->bpo_phys->bpo_comp, comp); zdb_nicenum(bpo->bpo_phys->bpo_uncomp, uncomp); - (void) printf("\n %s: %llu local blkptrs, %llu subobjs, " - "%s (%s/%s comp)\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + (void) printf(" %*s: object %llu, %llu local blkptrs, " + "%llu subobjs, %s (%s/%s comp)\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, (u_longlong_t)bpo->bpo_phys->bpo_num_subobjs, bytes, comp, uncomp); + + for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) { + uint64_t subobj; + bpobj_t subbpo; + int error; + VERIFY0(dmu_read(bpo->bpo_os, + bpo->bpo_phys->bpo_subobjs, + i * sizeof (subobj), sizeof (subobj), &subobj, 0)); + error = bpobj_open(&subbpo, bpo->bpo_os, subobj); + if (error != 0) { + (void) printf("ERROR %u while trying to open " + "subobj id %llu\n", + error, (u_longlong_t)subobj); + continue; + } + dump_bpobj(&subbpo, "subobj", indent + 1); + } } else { - (void) printf("\n %s: %llu blkptrs, %s\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, bytes); + (void) printf(" %*s: object %llu, %llu blkptrs, %s\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + bytes); } if (dump_opt['d'] < 5) return; - (void) printf("\n"); - (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + if (indent == 0) { + (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + (void) printf("\n"); + } } static void dump_deadlist(dsl_deadlist_t *dl) { dsl_deadlist_entry_t *dle; + uint64_t unused; char bytes[32]; char comp[32]; char uncomp[32]; @@ -1275,14 +1300,24 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("\n"); + /* force the tree to be loaded */ + dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); + for (dle = avl_first(&dl->dl_tree); dle; dle = AVL_NEXT(&dl->dl_tree, dle)) { - (void) printf(" mintxg %llu -> obj %llu\n", - (longlong_t)dle->dle_mintxg, - (longlong_t)dle->dle_bpobj.bpo_object); + if (dump_opt['d'] >= 5) { + char buf[128]; + (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); - if (dump_opt['d'] >= 5) - dump_bpobj(&dle->dle_bpobj, ""); + dump_bpobj(&dle->dle_bpobj, buf, 0); + } else { + (void) printf("mintxg %llu -> obj %llu\n", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); + + } } } @@ -1305,7 +1340,7 @@ fuid_table_destroy() * print uid or gid information. * For normal POSIX id just the id is printed in decimal format. * For CIFS files with FUID the fuid is printed in hex followed by - * the doman-rid string. + * the domain-rid string. */ static void print_idstr(uint64_t id, const char *id_type) @@ -2598,10 +2633,11 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { - dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); + dump_bpobj(&spa->spa_deferred_bpobj, + "Deferred frees", 0); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool snapshot frees"); + "Pool snapshot frees", 0); } if (spa_feature_is_active(spa, From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 15:45:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 85231FE8; Tue, 5 Mar 2013 15:45:09 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id 8ABBD996; Tue, 5 Mar 2013 15:45:08 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1UCu36-0006FC-1A; Tue, 05 Mar 2013 16:45:06 +0100 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1UCu35-0002ji-UZ; Tue, 05 Mar 2013 16:45:03 +0100 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Konstantin Belousov" Subject: Re: svn commit: r247835 - in head/sys: dev/drm2 dev/drm2/ttm modules/drm2/drm2 References: <201303050949.r259nYRn020421@svn.freebsd.org> Date: Tue, 05 Mar 2013 16:45:02 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201303050949.r259nYRn020421@svn.freebsd.org> User-Agent: Opera Mail/12.14 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: 0.8 X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.1 X-Scan-Signature: 4567a9210dc8a3ba2947d2777f3c295b X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:45:09 -0000 I know this is not done yet, but I appreciate the work very much. Regards, Ronald. On Tue, 05 Mar 2013 10:49:34 +0100, Konstantin Belousov wrote: > Author: kib > Date: Tue Mar 5 09:49:34 2013 > New Revision: 247835 > URL: http://svnweb.freebsd.org/changeset/base/247835 > > Log: > Import the preliminary port of the TTM. > The early commit is done to facilitate the off-tree work on the > porting of the Radeon driver. > Sponsored by: The FreeBSD Foundation > Debugged and tested by: dumbbell > MFC after: 1 month > > Added: > head/sys/dev/drm2/ttm/ > head/sys/dev/drm2/ttm/ttm_agp_backend.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_bo.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_bo_api.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_bo_driver.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_bo_manager.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_bo_util.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_bo_vm.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_execbuf_util.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_execbuf_util.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_lock.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_lock.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_memory.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_memory.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_module.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_object.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_object.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_page_alloc.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_page_alloc.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_page_alloc_dma.c (contents, props changed) > head/sys/dev/drm2/ttm/ttm_placement.h (contents, props changed) > head/sys/dev/drm2/ttm/ttm_tt.c (contents, props changed) > Modified: > head/sys/dev/drm2/drmP.h > head/sys/dev/drm2/drm_drv.c > head/sys/dev/drm2/drm_gem.c > head/sys/modules/drm2/drm2/Makefile > > Modified: head/sys/dev/drm2/drmP.h > ============================================================================== > --- head/sys/dev/drm2/drmP.h Tue Mar 5 09:27:21 2013 (r247834) > +++ head/sys/dev/drm2/drmP.h Tue Mar 5 09:49:34 2013 (r247835) > @@ -906,6 +906,7 @@ struct drm_device { > struct drm_minor *control; /**< Control node for card */ > struct drm_minor *primary; /**< render type primary screen head */ > + void *drm_ttm_bo; > struct unrhdr *drw_unrhdr; > /* RB tree of drawable infos */ > RB_HEAD(drawable_tree, bsd_drm_drawable_info) drw_head; > @@ -1302,10 +1303,14 @@ void drm_gem_release(struct drm_device * > int drm_gem_create_mmap_offset(struct drm_gem_object *obj); > void drm_gem_free_mmap_offset(struct drm_gem_object *obj); > -int drm_gem_mmap_single(struct cdev *kdev, vm_ooffset_t *offset, > vm_size_t size, > - struct vm_object **obj_res, int nprot); > +int drm_gem_mmap_single(struct drm_device *dev, vm_ooffset_t *offset, > + vm_size_t size, struct vm_object **obj_res, int nprot); > void drm_gem_pager_dtr(void *obj); > +struct ttm_bo_device; > +int ttm_bo_mmap_single(struct ttm_bo_device *bdev, vm_ooffset_t *offset, > + vm_size_t size, struct vm_object **obj_res, int nprot); > + > void drm_device_lock_mtx(struct drm_device *dev); > void drm_device_unlock_mtx(struct drm_device *dev); > int drm_device_sleep_mtx(struct drm_device *dev, void *chan, int flags, > > Modified: head/sys/dev/drm2/drm_drv.c > ============================================================================== > --- head/sys/dev/drm2/drm_drv.c Tue Mar 5 09:27:21 2013 (r247834) > +++ head/sys/dev/drm2/drm_drv.c Tue Mar 5 09:49:34 2013 (r247835) > @@ -58,6 +58,8 @@ static int drm_load(struct drm_device *d > static void drm_unload(struct drm_device *dev); > static drm_pci_id_list_t *drm_find_description(int vendor, int device, > drm_pci_id_list_t *idlist); > +static int drm_mmap_single(struct cdev *kdev, vm_ooffset_t *offset, > + vm_size_t size, struct vm_object **obj_res, int nprot); > static int > drm_modevent(module_t mod, int type, void *data) > @@ -187,7 +189,7 @@ static struct cdevsw drm_cdevsw = { > .d_ioctl = drm_ioctl, > .d_poll = drm_poll, > .d_mmap = drm_mmap, > - .d_mmap_single = drm_gem_mmap_single, > + .d_mmap_single = drm_mmap_single, > .d_name = "drm", > .d_flags = D_TRACKCLOSE > }; > @@ -955,6 +957,23 @@ drm_add_busid_modesetting(struct drm_dev > return (0); > } > +static int > +drm_mmap_single(struct cdev *kdev, vm_ooffset_t *offset, vm_size_t size, > + struct vm_object **obj_res, int nprot) > +{ > + struct drm_device *dev; > + > + dev = drm_get_device_from_kdev(kdev); > + if ((dev->driver->driver_features & DRIVER_GEM) != 0) { > + return (drm_gem_mmap_single(dev, offset, size, obj_res, nprot)); > + } else if (dev->drm_ttm_bo != NULL) { > + return (ttm_bo_mmap_single(dev->drm_ttm_bo, offset, size, > + obj_res, nprot)); > + } else { > + return (ENODEV); > + } > +} > + > #if DRM_LINUX > #include > > Modified: head/sys/dev/drm2/drm_gem.c > ============================================================================== > --- head/sys/dev/drm2/drm_gem.c Tue Mar 5 09:27:21 2013 (r247834) > +++ head/sys/dev/drm2/drm_gem.c Tue Mar 5 09:49:34 2013 (r247835) > @@ -441,16 +441,12 @@ drm_gem_free_mmap_offset(struct drm_gem_ > } > int > -drm_gem_mmap_single(struct cdev *kdev, vm_ooffset_t *offset, vm_size_t > size, > +drm_gem_mmap_single(struct drm_device *dev, vm_ooffset_t *offset, > vm_size_t size, > struct vm_object **obj_res, int nprot) > { > - struct drm_device *dev; > struct drm_gem_object *gem_obj; > struct vm_object *vm_obj; > - dev = drm_get_device_from_kdev(kdev); > - if ((dev->driver->driver_features & DRIVER_GEM) == 0) > - return (ENODEV); > DRM_LOCK(dev); > gem_obj = drm_gem_object_from_offset(dev, *offset); > if (gem_obj == NULL) { > > Added: head/sys/dev/drm2/ttm/ttm_agp_backend.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/drm2/ttm/ttm_agp_backend.c Tue Mar 5 09:49:34 > 2013 (r247835) > @@ -0,0 +1,145 @@ > +/************************************************************************** > + * > + * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA > + * All Rights Reserved. > + * > + * Permission is hereby granted, free of charge, to any person > obtaining a > + * copy of this software and associated documentation files (the > + * "Software"), to deal in the Software without restriction, including > + * without limitation the rights to use, copy, modify, merge, publish, > + * distribute, sub license, and/or sell copies of the Software, and to > + * permit persons to whom the Software is furnished to do so, subject to > + * the following conditions: > + * > + * The above copyright notice and this permission notice (including the > + * next paragraph) shall be included in all copies or substantial > portions > + * of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF > MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT > SHALL > + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR > ANY CLAIM, > + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR > + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE > OR THE > + * USE OR OTHER DEALINGS IN THE SOFTWARE. > + * > + > **************************************************************************/ > +/* > + * Authors: Thomas Hellstrom > + * Keith Packard. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#ifdef TTM_HAS_AGP > +#include > + > +struct ttm_agp_backend { > + struct ttm_tt ttm; > + struct agp_memory *mem; > + device_t bridge; > +}; > + > +MALLOC_DEFINE(M_TTM_AGP, "ttm_agp", "TTM AGP Backend"); > + > +static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) > +{ > + struct ttm_agp_backend *agp_be = container_of(ttm, struct > ttm_agp_backend, ttm); > + struct drm_mm_node *node = bo_mem->mm_node; > + struct agp_memory *mem; > + int ret, cached = (bo_mem->placement & TTM_PL_FLAG_CACHED); > + unsigned i; > + > + mem = agp_alloc_memory(agp_be->bridge, AGP_USER_MEMORY, > ttm->num_pages); > + if (unlikely(mem == NULL)) > + return -ENOMEM; > + > + mem->page_count = 0; > + for (i = 0; i < ttm->num_pages; i++) { > + vm_page_t page = ttm->pages[i]; > + > + if (!page) > + page = ttm->dummy_read_page; > + > + mem->pages[mem->page_count++] = page; > + } > + agp_be->mem = mem; > + > + mem->is_flushed = 1; > + mem->type = (cached) ? AGP_USER_CACHED_MEMORY : AGP_USER_MEMORY; > + > + ret = agp_bind_memory(mem, node->start); > + if (ret) > + pr_err("AGP Bind memory failed\n"); > + > + return ret; > +} > + > +static int ttm_agp_unbind(struct ttm_tt *ttm) > +{ > + struct ttm_agp_backend *agp_be = container_of(ttm, struct > ttm_agp_backend, ttm); > + > + if (agp_be->mem) { > + if (agp_be->mem->is_bound) > + return agp_unbind_memory(agp_be->mem); > + agp_free_memory(agp_be->mem); > + agp_be->mem = NULL; > + } > + return 0; > +} > + > +static void ttm_agp_destroy(struct ttm_tt *ttm) > +{ > + struct ttm_agp_backend *agp_be = container_of(ttm, struct > ttm_agp_backend, ttm); > + > + if (agp_be->mem) > + ttm_agp_unbind(ttm); > + ttm_tt_fini(ttm); > + free(agp_be, M_TTM_AGP); > +} > + > +static struct ttm_backend_func ttm_agp_func = { > + .bind = ttm_agp_bind, > + .unbind = ttm_agp_unbind, > + .destroy = ttm_agp_destroy, > +}; > + > +struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, > + device_t bridge, > + unsigned long size, uint32_t page_flags, > + vm_page_t dummy_read_page) > +{ > + struct ttm_agp_backend *agp_be; > + > + agp_be = malloc(sizeof(*agp_be), M_TTM_AGP, M_WAITOK | M_ZERO); > + > + agp_be->mem = NULL; > + agp_be->bridge = bridge; > + agp_be->ttm.func = &ttm_agp_func; > + > + if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, > dummy_read_page)) { > + return NULL; > + } > + > + return &agp_be->ttm; > +} > + > +int ttm_agp_tt_populate(struct ttm_tt *ttm) > +{ > + if (ttm->state != tt_unpopulated) > + return 0; > + > + return ttm_pool_populate(ttm); > +} > + > +void ttm_agp_tt_unpopulate(struct ttm_tt *ttm) > +{ > + ttm_pool_unpopulate(ttm); > +} > + > +#endif > > Added: head/sys/dev/drm2/ttm/ttm_bo.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/drm2/ttm/ttm_bo.c Tue Mar 5 09:49:34 2013 (r247835) > @@ -0,0 +1,1820 @@ > +/************************************************************************** > + * > + * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA > + * All Rights Reserved. > + * > + * Permission is hereby granted, free of charge, to any person > obtaining a > + * copy of this software and associated documentation files (the > + * "Software"), to deal in the Software without restriction, including > + * without limitation the rights to use, copy, modify, merge, publish, > + * distribute, sub license, and/or sell copies of the Software, and to > + * permit persons to whom the Software is furnished to do so, subject to > + * the following conditions: > + * > + * The above copyright notice and this permission notice (including the > + * next paragraph) shall be included in all copies or substantial > portions > + * of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF > MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT > SHALL > + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR > ANY CLAIM, > + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR > + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE > OR THE > + * USE OR OTHER DEALINGS IN THE SOFTWARE. > + * > + > **************************************************************************/ > +/* > + * Authors: Thomas Hellstrom > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > + > +#define TTM_ASSERT_LOCKED(param) > +#define TTM_DEBUG(fmt, arg...) > +#define TTM_BO_HASH_ORDER 13 > + > +static int ttm_bo_setup_vm(struct ttm_buffer_object *bo); > +static int ttm_bo_swapout(struct ttm_mem_shrink *shrink); > +static void ttm_bo_global_kobj_release(struct ttm_bo_global *glob); > + > +MALLOC_DEFINE(M_TTM_BO, "ttm_bo", "TTM Buffer Objects"); > + > +static inline int ttm_mem_type_from_flags(uint32_t flags, uint32_t > *mem_type) > +{ > + int i; > + > + for (i = 0; i <= TTM_PL_PRIV5; i++) > + if (flags & (1 << i)) { > + *mem_type = i; > + return 0; > + } > + return -EINVAL; > +} > + > +static void ttm_mem_type_debug(struct ttm_bo_device *bdev, int mem_type) > +{ > + struct ttm_mem_type_manager *man = &bdev->man[mem_type]; > + > + printf(" has_type: %d\n", man->has_type); > + printf(" use_type: %d\n", man->use_type); > + printf(" flags: 0x%08X\n", man->flags); > + printf(" gpu_offset: 0x%08lX\n", man->gpu_offset); > + printf(" size: %ju\n", (uintmax_t)man->size); > + printf(" available_caching: 0x%08X\n", man->available_caching); > + printf(" default_caching: 0x%08X\n", man->default_caching); > + if (mem_type != TTM_PL_SYSTEM) > + (*man->func->debug)(man, TTM_PFX); > +} > + > +static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo, > + struct ttm_placement *placement) > +{ > + int i, ret, mem_type; > + > + printf("No space for %p (%lu pages, %luK, %luM)\n", > + bo, bo->mem.num_pages, bo->mem.size >> 10, > + bo->mem.size >> 20); > + for (i = 0; i < placement->num_placement; i++) { > + ret = ttm_mem_type_from_flags(placement->placement[i], > + &mem_type); > + if (ret) > + return; > + printf(" placement[%d]=0x%08X (%d)\n", > + i, placement->placement[i], mem_type); > + ttm_mem_type_debug(bo->bdev, mem_type); > + } > +} > + > +#if 0 > +static ssize_t ttm_bo_global_show(struct ttm_bo_global *glob, > + char *buffer) > +{ > + > + return snprintf(buffer, PAGE_SIZE, "%lu\n", > + (unsigned long) atomic_read(&glob->bo_count)); > +} > +#endif > + > +static inline uint32_t ttm_bo_type_flags(unsigned type) > +{ > + return 1 << (type); > +} > + > +static void ttm_bo_release_list(struct ttm_buffer_object *bo) > +{ > + struct ttm_bo_device *bdev = bo->bdev; > + size_t acc_size = bo->acc_size; > + > + MPASS(atomic_read(&bo->list_kref) == 0); > + MPASS(atomic_read(&bo->kref) == 0); > + MPASS(atomic_read(&bo->cpu_writers) == 0); > + MPASS(bo->sync_obj == NULL); > + MPASS(bo->mem.mm_node == NULL); > + MPASS(list_empty(&bo->lru)); > + MPASS(list_empty(&bo->ddestroy)); > + > + if (bo->ttm) > + ttm_tt_destroy(bo->ttm); > + atomic_dec(&bo->glob->bo_count); > + if (bo->destroy) > + bo->destroy(bo); > + else { > + free(bo, M_TTM_BO); > + } > + ttm_mem_global_free(bdev->glob->mem_glob, acc_size); > +} > + > +int > +ttm_bo_wait_unreserved_locked(struct ttm_buffer_object *bo, bool > interruptible) > +{ > + const char *wmsg; > + int flags, ret; > + > + ret = 0; > + if (interruptible) { > + flags = PCATCH; > + wmsg = "ttbowi"; > + } else { > + flags = 0; > + wmsg = "ttbowu"; > + } > + while (!ttm_bo_is_reserved(bo)) { > + ret = -msleep(bo, &bo->glob->lru_lock, flags, wmsg, 0); > + if (ret != 0) > + break; > + } > + return (ret); > +} > + > +void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) > +{ > + struct ttm_bo_device *bdev = bo->bdev; > + struct ttm_mem_type_manager *man; > + > + MPASS(ttm_bo_is_reserved(bo)); > + > + if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) { > + > + MPASS(list_empty(&bo->lru)); > + > + man = &bdev->man[bo->mem.mem_type]; > + list_add_tail(&bo->lru, &man->lru); > + refcount_acquire(&bo->list_kref); > + > + if (bo->ttm != NULL) { > + list_add_tail(&bo->swap, &bo->glob->swap_lru); > + refcount_acquire(&bo->list_kref); > + } > + } > +} > + > +int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) > +{ > + int put_count = 0; > + > + if (!list_empty(&bo->swap)) { > + list_del_init(&bo->swap); > + ++put_count; > + } > + if (!list_empty(&bo->lru)) { > + list_del_init(&bo->lru); > + ++put_count; > + } > + > + /* > + * TODO: Add a driver hook to delete from > + * driver-specific LRU's here. > + */ > + > + return put_count; > +} > + > +int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, > + bool interruptible, > + bool no_wait, bool use_sequence, uint32_t sequence) > +{ > + int ret; > + > + while (unlikely(atomic_read(&bo->reserved) != 0)) { > + /** > + * Deadlock avoidance for multi-bo reserving. > + */ > + if (use_sequence && bo->seq_valid) { > + /** > + * We've already reserved this one. > + */ > + if (unlikely(sequence == bo->val_seq)) > + return -EDEADLK; > + /** > + * Already reserved by a thread that will not back > + * off for us. We need to back off. > + */ > + if (unlikely(sequence - bo->val_seq < (1 << 31))) > + return -EAGAIN; > + } > + > + if (no_wait) > + return -EBUSY; > + > + ret = ttm_bo_wait_unreserved_locked(bo, interruptible); > + if (unlikely(ret)) > + return ret; > + } > + > + atomic_set(&bo->reserved, 1); > + if (use_sequence) { > + /** > + * Wake up waiters that may need to recheck for deadlock, > + * if we decreased the sequence number. > + */ > + if (unlikely((bo->val_seq - sequence < (1 << 31)) > + || !bo->seq_valid)) > + wakeup(bo); > + > + bo->val_seq = sequence; > + bo->seq_valid = true; > + } else { > + bo->seq_valid = false; > + } > + > + return 0; > +} > + > +void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count, > + bool never_free) > +{ > + u_int old; > + > + old = atomic_fetchadd_int(&bo->list_kref, -count); > + if (old <= count) { > + if (never_free) > + panic("ttm_bo_ref_buf"); > + ttm_bo_release_list(bo); > + } > +} > + > +int ttm_bo_reserve(struct ttm_buffer_object *bo, > + bool interruptible, > + bool no_wait, bool use_sequence, uint32_t sequence) > +{ > + struct ttm_bo_global *glob = bo->glob; > + int put_count = 0; > + int ret; > + > + mtx_lock(&glob->lru_lock); > + ret = ttm_bo_reserve_locked(bo, interruptible, no_wait, use_sequence, > + sequence); > + if (likely(ret == 0)) > + put_count = ttm_bo_del_from_lru(bo); > + mtx_unlock(&glob->lru_lock); > + > + ttm_bo_list_ref_sub(bo, put_count, true); > + > + return ret; > +} > + > +void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo) > +{ > + ttm_bo_add_to_lru(bo); > + atomic_set(&bo->reserved, 0); > + wakeup(bo); > +} > + > +void ttm_bo_unreserve(struct ttm_buffer_object *bo) > +{ > + struct ttm_bo_global *glob = bo->glob; > + > + mtx_lock(&glob->lru_lock); > + ttm_bo_unreserve_locked(bo); > + mtx_unlock(&glob->lru_lock); > +} > + > +/* > + * Call bo->mutex locked. > + */ > +static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc) > +{ > + struct ttm_bo_device *bdev = bo->bdev; > + struct ttm_bo_global *glob = bo->glob; > + int ret = 0; > + uint32_t page_flags = 0; > + > + TTM_ASSERT_LOCKED(&bo->mutex); > + bo->ttm = NULL; > + > + if (bdev->need_dma32) > + page_flags |= TTM_PAGE_FLAG_DMA32; > + > + switch (bo->type) { > + case ttm_bo_type_device: > + if (zero_alloc) > + page_flags |= TTM_PAGE_FLAG_ZERO_ALLOC; > + case ttm_bo_type_kernel: > + bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << > PAGE_SHIFT, > + page_flags, glob->dummy_read_page); > + if (unlikely(bo->ttm == NULL)) > + ret = -ENOMEM; > + break; > + case ttm_bo_type_sg: > + bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << > PAGE_SHIFT, > + page_flags | TTM_PAGE_FLAG_SG, > + glob->dummy_read_page); > + if (unlikely(bo->ttm == NULL)) { > + ret = -ENOMEM; > + break; > + } > + bo->ttm->sg = bo->sg; > + break; > + default: > + printf("[TTM] Illegal buffer object type\n"); > + ret = -EINVAL; > + break; > + } > + > + return ret; > +} > + > +static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, > + struct ttm_mem_reg *mem, > + bool evict, bool interruptible, > + bool no_wait_gpu) > +{ > + struct ttm_bo_device *bdev = bo->bdev; > + bool old_is_pci = ttm_mem_reg_is_pci(bdev, &bo->mem); > + bool new_is_pci = ttm_mem_reg_is_pci(bdev, mem); > + struct ttm_mem_type_manager *old_man = &bdev->man[bo->mem.mem_type]; > + struct ttm_mem_type_manager *new_man = &bdev->man[mem->mem_type]; > + int ret = 0; > + > + if (old_is_pci || new_is_pci || > + ((mem->placement & bo->mem.placement & TTM_PL_MASK_CACHING) == 0)) > { > + ret = ttm_mem_io_lock(old_man, true); > + if (unlikely(ret != 0)) > + goto out_err; > + ttm_bo_unmap_virtual_locked(bo); > + ttm_mem_io_unlock(old_man); > + } > + > + /* > + * Create and bind a ttm if required. > + */ > + > + if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) { > + if (bo->ttm == NULL) { > + bool zero = !(old_man->flags & TTM_MEMTYPE_FLAG_FIXED); > + ret = ttm_bo_add_ttm(bo, zero); > + if (ret) > + goto out_err; > + } > + > + ret = ttm_tt_set_placement_caching(bo->ttm, mem->placement); > + if (ret) > + goto out_err; > + > + if (mem->mem_type != TTM_PL_SYSTEM) { > + ret = ttm_tt_bind(bo->ttm, mem); > + if (ret) > + goto out_err; > + } > + > + if (bo->mem.mem_type == TTM_PL_SYSTEM) { > + if (bdev->driver->move_notify) > + bdev->driver->move_notify(bo, mem); > + bo->mem = *mem; > + mem->mm_node = NULL; > + goto moved; > + } > + } > + > + if (bdev->driver->move_notify) > + bdev->driver->move_notify(bo, mem); > + > + if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) && > + !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) > + ret = ttm_bo_move_ttm(bo, evict, no_wait_gpu, mem); > + else if (bdev->driver->move) > + ret = bdev->driver->move(bo, evict, interruptible, > + no_wait_gpu, mem); > + else > + ret = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, mem); > + > + if (ret) { > + if (bdev->driver->move_notify) { > + struct ttm_mem_reg tmp_mem = *mem; > + *mem = bo->mem; > + bo->mem = tmp_mem; > + bdev->driver->move_notify(bo, mem); > + bo->mem = *mem; > + } > + > + goto out_err; > + } > + > +moved: > + if (bo->evicted) { > + ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement); > + if (ret) > + printf("[TTM] Can not flush read caches\n"); > + bo->evicted = false; > + } > + > + if (bo->mem.mm_node) { > + bo->offset = (bo->mem.start << PAGE_SHIFT) + > + bdev->man[bo->mem.mem_type].gpu_offset; > + bo->cur_placement = bo->mem.placement; > + } else > + bo->offset = 0; > + > + return 0; > + > +out_err: > + new_man = &bdev->man[bo->mem.mem_type]; > + if ((new_man->flags & TTM_MEMTYPE_FLAG_FIXED) && bo->ttm) { > + ttm_tt_unbind(bo->ttm); > + ttm_tt_destroy(bo->ttm); > + bo->ttm = NULL; > + } > + > + return ret; > +} > + > +/** > + * Call bo::reserved. > + * Will release GPU memory type usage on destruction. > + * This is the place to put in driver specific hooks to release > + * driver private resources. > + * Will release the bo::reserved lock. > + */ > + > +static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo) > +{ > + if (bo->bdev->driver->move_notify) > + bo->bdev->driver->move_notify(bo, NULL); > + > + if (bo->ttm) { > + ttm_tt_unbind(bo->ttm); > + ttm_tt_destroy(bo->ttm); > + bo->ttm = NULL; > + } > + ttm_bo_mem_put(bo, &bo->mem); > + > + atomic_set(&bo->reserved, 0); > + wakeup(&bo); > + > + /* > + * Since the final reference to this bo may not be dropped by > + * the current task we have to put a memory barrier here to make > + * sure the changes done in this function are always visible. > + * > + * This function only needs protection against the final kref_put. > + */ > + mb(); > +} > + > +static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) > +{ > + struct ttm_bo_device *bdev = bo->bdev; > + struct ttm_bo_global *glob = bo->glob; > + struct ttm_bo_driver *driver = bdev->driver; > + void *sync_obj = NULL; > + int put_count; > + int ret; > + > + mtx_lock(&glob->lru_lock); > + ret = ttm_bo_reserve_locked(bo, false, true, false, 0); > + > + mtx_lock(&bdev->fence_lock); > + (void) ttm_bo_wait(bo, false, false, true); > + if (!ret && !bo->sync_obj) { > + mtx_unlock(&bdev->fence_lock); > + put_count = ttm_bo_del_from_lru(bo); > + > + mtx_unlock(&glob->lru_lock); > + ttm_bo_cleanup_memtype_use(bo); > + > + ttm_bo_list_ref_sub(bo, put_count, true); > + > + return; > + } > + if (bo->sync_obj) > + sync_obj = driver->sync_obj_ref(bo->sync_obj); > + mtx_unlock(&bdev->fence_lock); > + > + if (!ret) { > + atomic_set(&bo->reserved, 0); > + wakeup(bo); > + } > + > + refcount_acquire(&bo->list_kref); > + list_add_tail(&bo->ddestroy, &bdev->ddestroy); > + mtx_unlock(&glob->lru_lock); > + > + if (sync_obj) { > + driver->sync_obj_flush(sync_obj); > + driver->sync_obj_unref(&sync_obj); > + } > + taskqueue_enqueue_timeout(taskqueue_thread, &bdev->wq, > + ((hz / 100) < 1) ? 1 : hz / 100); > +} > + > +/** > + * function ttm_bo_cleanup_refs_and_unlock > + * If bo idle, remove from delayed- and lru lists, and unref. > + * If not idle, do nothing. > + * > + * Must be called with lru_lock and reservation held, this function > + * will drop both before returning. > + * > + * @interruptible Any sleeps should occur interruptibly. > + * @no_wait_gpu Never wait for gpu. Return -EBUSY instead. > + */ > + > +static int ttm_bo_cleanup_refs_and_unlock(struct ttm_buffer_object *bo, > + bool interruptible, > + bool no_wait_gpu) > +{ > + struct ttm_bo_device *bdev = bo->bdev; > + struct ttm_bo_driver *driver = bdev->driver; > + struct ttm_bo_global *glob = bo->glob; > + int put_count; > + int ret; > + > + mtx_lock(&bdev->fence_lock); > + ret = ttm_bo_wait(bo, false, false, true); > + > + if (ret && !no_wait_gpu) { > + void *sync_obj; > + > + /* > + * Take a reference to the fence and unreserve, > + * at this point the buffer should be dead, so > + * no new sync objects can be attached. > + */ > + sync_obj = driver->sync_obj_ref(bo->sync_obj); > + mtx_unlock(&bdev->fence_lock); > + > + atomic_set(&bo->reserved, 0); > + wakeup(bo); > + mtx_unlock(&glob->lru_lock); > + > + ret = driver->sync_obj_wait(sync_obj, false, interruptible); > + driver->sync_obj_unref(&sync_obj); > + if (ret) > + return ret; > + > + /* > + * remove sync_obj with ttm_bo_wait, the wait should be > + * finished, and no new wait object should have been added. > + */ > + mtx_lock(&bdev->fence_lock); > + ret = ttm_bo_wait(bo, false, false, true); > + mtx_unlock(&bdev->fence_lock); > + if (ret) > + return ret; > + > + mtx_lock(&glob->lru_lock); > + ret = ttm_bo_reserve_locked(bo, false, true, false, 0); > + > + /* > + * We raced, and lost, someone else holds the reservation now, > + * and is probably busy in ttm_bo_cleanup_memtype_use. > + * > + * Even if it's not the case, because we finished waiting any > + * delayed destruction would succeed, so just return success > + * here. > + */ > + if (ret) { > + mtx_unlock(&glob->lru_lock); > + return 0; > + } > + } else > + mtx_unlock(&bdev->fence_lock); > + > + if (ret || unlikely(list_empty(&bo->ddestroy))) { > + atomic_set(&bo->reserved, 0); > + wakeup(bo); > + mtx_unlock(&glob->lru_lock); > + return ret; > + } > + > + put_count = ttm_bo_del_from_lru(bo); > + list_del_init(&bo->ddestroy); > + ++put_count; > + > + mtx_unlock(&glob->lru_lock); > + ttm_bo_cleanup_memtype_use(bo); > + > + ttm_bo_list_ref_sub(bo, put_count, true); > + > + return 0; > +} > + > +/** > + * Traverse the delayed list, and call ttm_bo_cleanup_refs on all > + * encountered buffers. > + */ > + > +static int ttm_bo_delayed_delete(struct ttm_bo_device *bdev, bool > remove_all) > +{ > + struct ttm_bo_global *glob = bdev->glob; > + struct ttm_buffer_object *entry = NULL; > + int ret = 0; > + > + mtx_lock(&glob->lru_lock); > + if (list_empty(&bdev->ddestroy)) > + goto out_unlock; > + > + entry = list_first_entry(&bdev->ddestroy, > + struct ttm_buffer_object, ddestroy); > + refcount_acquire(&entry->list_kref); > + > + for (;;) { > + struct ttm_buffer_object *nentry = NULL; > + > + if (entry->ddestroy.next != &bdev->ddestroy) { > + nentry = list_first_entry(&entry->ddestroy, > + struct ttm_buffer_object, ddestroy); > + refcount_acquire(&nentry->list_kref); > + } > + > + ret = ttm_bo_reserve_locked(entry, false, !remove_all, false, 0); > + if (!ret) > + ret = ttm_bo_cleanup_refs_and_unlock(entry, false, > + !remove_all); > + else > + mtx_unlock(&glob->lru_lock); > + > + if (refcount_release(&entry->list_kref)) > + ttm_bo_release_list(entry); > + entry = nentry; > + > + if (ret || !entry) > + goto out; > + > + mtx_lock(&glob->lru_lock); > + if (list_empty(&entry->ddestroy)) > + break; > + } > + > +out_unlock: > + mtx_unlock(&glob->lru_lock); > +out: > + if (entry && refcount_release(&entry->list_kref)) > + ttm_bo_release_list(entry); > + return ret; > +} > + > +static void ttm_bo_delayed_workqueue(void *arg, int pending __unused) > +{ > + struct ttm_bo_device *bdev = arg; > + > + if (ttm_bo_delayed_delete(bdev, false)) { > + taskqueue_enqueue_timeout(taskqueue_thread, &bdev->wq, > + ((hz / 100) < 1) ? 1 : hz / 100); > + } > +} > + > +static void ttm_bo_release(struct ttm_buffer_object *bo) > +{ > + struct ttm_bo_device *bdev = bo->bdev; > + struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; > + > + rw_wlock(&bdev->vm_lock); > + if (likely(bo->vm_node != NULL)) { > + RB_REMOVE(ttm_bo_device_buffer_objects, > + &bdev->addr_space_rb, bo); > + drm_mm_put_block(bo->vm_node); > + bo->vm_node = NULL; > + } > + rw_wunlock(&bdev->vm_lock); > + ttm_mem_io_lock(man, false); > + ttm_mem_io_free_vm(bo); > + ttm_mem_io_unlock(man); > + ttm_bo_cleanup_refs_or_queue(bo); > + if (refcount_release(&bo->list_kref)) > + ttm_bo_release_list(bo); > +} > + > +void ttm_bo_unref(struct ttm_buffer_object **p_bo) > +{ > + struct ttm_buffer_object *bo = *p_bo; > + > + *p_bo = NULL; > + if (refcount_release(&bo->kref)) > + ttm_bo_release(bo); > +} > + > +int ttm_bo_lock_delayed_workqueue(struct ttm_bo_device *bdev) > +{ > + int pending; > + > + taskqueue_cancel_timeout(taskqueue_thread, &bdev->wq, &pending); > + if (pending) > + taskqueue_drain_timeout(taskqueue_thread, &bdev->wq); > + return (pending); > +} > + > +void ttm_bo_unlock_delayed_workqueue(struct ttm_bo_device *bdev, int > resched) > +{ > + if (resched) { > + taskqueue_enqueue_timeout(taskqueue_thread, &bdev->wq, > + ((hz / 100) < 1) ? 1 : hz / 100); > + } > +} > + > +static int ttm_bo_evict(struct ttm_buffer_object *bo, bool > interruptible, > + bool no_wait_gpu) > +{ > + struct ttm_bo_device *bdev = bo->bdev; > + struct ttm_mem_reg evict_mem; > + struct ttm_placement placement; > + int ret = 0; > + > + mtx_lock(&bdev->fence_lock); > + ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); > + mtx_unlock(&bdev->fence_lock); > + > + if (unlikely(ret != 0)) { > + if (ret != -ERESTART) { > + printf("[TTM] Failed to expire sync object before buffer > eviction\n"); > + } > + goto out; > + } > + > + MPASS(ttm_bo_is_reserved(bo)); > + > + evict_mem = bo->mem; > + evict_mem.mm_node = NULL; > + evict_mem.bus.io_reserved_vm = false; > + evict_mem.bus.io_reserved_count = 0; > + > + placement.fpfn = 0; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > 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 Mar 5 16:04:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A9E4B993; Tue, 5 Mar 2013 16:04:07 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 917F6AA8; Tue, 5 Mar 2013 16:04:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25G47QJ035411; Tue, 5 Mar 2013 16:04:07 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25G47Ad035410; Tue, 5 Mar 2013 16:04:07 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201303051604.r25G47Ad035410@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 5 Mar 2013 16:04: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: r247846 - stable/9/libexec/rtld-elf 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:04:07 -0000 Author: tijl Date: Tue Mar 5 16:04:07 2013 New Revision: 247846 URL: http://svnweb.freebsd.org/changeset/base/247846 Log: MFC r247396: Map libraries linked with -Ttext-segment=base_addr at base_addr. Normal libraries have base address 0 and are unaffected by this change. PR: 176216 Submitted by: Damjan Jovanovic Reviewed by: kib Modified: stable/9/libexec/rtld-elf/map_object.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/map_object.c ============================================================================== --- stable/9/libexec/rtld-elf/map_object.c Tue Mar 5 15:35:57 2013 (r247845) +++ stable/9/libexec/rtld-elf/map_object.c Tue Mar 5 16:04:07 2013 (r247846) @@ -175,7 +175,7 @@ map_object(int fd, const char *path, con base_vaddr = trunc_page(segs[0]->p_vaddr); base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); mapsize = base_vlimit - base_vaddr; - base_addr = hdr->e_type == ET_EXEC ? (caddr_t) base_vaddr : NULL; + base_addr = (caddr_t) base_vaddr; mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_NOCORE, -1, 0); From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 16:04:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DC5E6B75; Tue, 5 Mar 2013 16:04:15 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF504AAA; Tue, 5 Mar 2013 16:04:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25G4FiU035472; Tue, 5 Mar 2013 16:04:15 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25G4FuS035471; Tue, 5 Mar 2013 16:04:15 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201303051604.r25G4FuS035471@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 5 Mar 2013 16:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247847 - stable/8/libexec/rtld-elf 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:04:15 -0000 Author: tijl Date: Tue Mar 5 16:04:15 2013 New Revision: 247847 URL: http://svnweb.freebsd.org/changeset/base/247847 Log: MFC r247396: Map libraries linked with -Ttext-segment=base_addr at base_addr. Normal libraries have base address 0 and are unaffected by this change. PR: 176216 Submitted by: Damjan Jovanovic Reviewed by: kib Modified: stable/8/libexec/rtld-elf/map_object.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/map_object.c ============================================================================== --- stable/8/libexec/rtld-elf/map_object.c Tue Mar 5 16:04:07 2013 (r247846) +++ stable/8/libexec/rtld-elf/map_object.c Tue Mar 5 16:04:15 2013 (r247847) @@ -148,7 +148,7 @@ map_object(int fd, const char *path, con base_vaddr = trunc_page(segs[0]->p_vaddr); base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); mapsize = base_vlimit - base_vaddr; - base_addr = hdr->e_type == ET_EXEC ? (caddr_t) base_vaddr : NULL; + base_addr = (caddr_t) base_vaddr; mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_NOCORE, -1, 0); From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 16:14:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 531CA1E3; Tue, 5 Mar 2013 16:14:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 45A72B61; Tue, 5 Mar 2013 16:14:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25GEuRU039046; Tue, 5 Mar 2013 16:14:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25GEumU039045; Tue, 5 Mar 2013 16:14:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303051614.r25GEumU039045@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Mar 2013 16:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247848 - head/sys/dev/drm2/ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:14:56 -0000 Author: kib Date: Tue Mar 5 16:14:55 2013 New Revision: 247848 URL: http://svnweb.freebsd.org/changeset/base/247848 Log: Fix build with gcc, remove redundand declarations. Reported and tested by: gjb MFC after: 1 month Modified: head/sys/dev/drm2/ttm/ttm_lock.h Modified: head/sys/dev/drm2/ttm/ttm_lock.h ============================================================================== --- head/sys/dev/drm2/ttm/ttm_lock.h Tue Mar 5 16:04:15 2013 (r247847) +++ head/sys/dev/drm2/ttm/ttm_lock.h Tue Mar 5 16:14:55 2013 (r247848) @@ -125,27 +125,6 @@ extern int ttm_read_lock(struct ttm_lock extern int ttm_read_trylock(struct ttm_lock *lock, bool interruptible); /** - * ttm_write_unlock - * - * @lock: Pointer to a struct ttm_lock - * - * Releases a write lock. - */ -extern void ttm_write_unlock(struct ttm_lock *lock); - -/** - * ttm_write_lock - * - * @lock: Pointer to a struct ttm_lock - * @interruptible: Interruptible sleeping while waiting for a lock. - * - * Takes the lock in write mode. - * Returns: - * -ERESTARTSYS If interrupted by a signal and interruptible is true. - */ -extern int ttm_write_lock(struct ttm_lock *lock, bool interruptible); - -/** * ttm_lock_downgrade * * @lock: Pointer to a struct ttm_lock From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 16:15:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8FB135B; Tue, 5 Mar 2013 16:15:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5AFEB6B; Tue, 5 Mar 2013 16:15:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25GFYjX039226; Tue, 5 Mar 2013 16:15:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25GFYv5039225; Tue, 5 Mar 2013 16:15:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303051615.r25GFYv5039225@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Mar 2013 16:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247849 - head/sys/dev/drm2/ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:15:34 -0000 Author: kib Date: Tue Mar 5 16:15:34 2013 New Revision: 247849 URL: http://svnweb.freebsd.org/changeset/base/247849 Log: Fix build with gcc, do not use unnamed union. Reported and tested by: gjb MFC after: 1 month Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_page_alloc.c Tue Mar 5 16:14:55 2013 (r247848) +++ head/sys/dev/drm2/ttm/ttm_page_alloc.c Tue Mar 5 16:15:34 2013 (r247849) @@ -113,16 +113,22 @@ struct ttm_pool_manager { struct ttm_pool_opts options; union { - struct ttm_page_pool pools[NUM_POOLS]; - struct { - struct ttm_page_pool wc_pool; - struct ttm_page_pool uc_pool; - struct ttm_page_pool wc_pool_dma32; - struct ttm_page_pool uc_pool_dma32; - } ; - }; + struct ttm_page_pool u_pools[NUM_POOLS]; + struct _utag { + struct ttm_page_pool u_wc_pool; + struct ttm_page_pool u_uc_pool; + struct ttm_page_pool u_wc_pool_dma32; + struct ttm_page_pool u_uc_pool_dma32; + } _ut; + } _u; }; +#define pools _u.u_pools +#define wc_pool _u._ut.u_wc_pool +#define uc_pool _u._ut.u_uc_pool +#define wc_pool_dma32 _u._ut.u_wc_pool_dma32 +#define uc_pool_dma32 _u._ut.u_uc_pool_dma32 + MALLOC_DEFINE(M_TTM_POOLMGR, "ttm_poolmgr", "TTM Pool Manager"); static void From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 16:37:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B5B67C60; Tue, 5 Mar 2013 16:37:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 990EEE42; Tue, 5 Mar 2013 16:37:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25GbKep045409; Tue, 5 Mar 2013 16:37:20 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25GbKmV045408; Tue, 5 Mar 2013 16:37:20 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201303051637.r25GbKmV045408@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 5 Mar 2013 16:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247850 - stable/9/sys/dev/mxge 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 16:37:20 -0000 Author: gallatin Date: Tue Mar 5 16:37:20 2013 New Revision: 247850 URL: http://svnweb.freebsd.org/changeset/base/247850 Log: MFC r247268: Several cleanups and fixes to mxge: - Remove vestigial null pointer tests after malloc(..., M_WAITOK). - Remove vestigal qualhack union - Use strlcpy() instead of the error-prone strncpy() when parsing EEPROM and copying strings - Check the MAC address in the EEPROM strings more strictly. - Expand the macro MXGE_NEXT_STRING() at its only user. Due to a typo, the macro was very confusing. - Remove unnecessary buffer limit check. The buffer is double-NUL terminated per construction. PR: kern/176369 Submitted by: Christoph Mallon Modified: stable/9/sys/dev/mxge/if_mxge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/9/sys/dev/mxge/if_mxge.c Tue Mar 5 16:15:34 2013 (r247849) +++ stable/9/sys/dev/mxge/if_mxge.c Tue Mar 5 16:37:20 2013 (r247850) @@ -287,42 +287,43 @@ mxge_dma_free(mxge_dma_t *dma) static int mxge_parse_strings(mxge_softc_t *sc) { -#define MXGE_NEXT_STRING(p) while(ptr < limit && *ptr++) - - char *ptr, *limit; + char *ptr; int i, found_mac, found_sn2; + char *endptr; ptr = sc->eeprom_strings; - limit = sc->eeprom_strings + MXGE_EEPROM_STRINGS_SIZE; found_mac = 0; found_sn2 = 0; - while (ptr < limit && *ptr != '\0') { - if (memcmp(ptr, "MAC=", 4) == 0) { - ptr += 1; - sc->mac_addr_string = ptr; - for (i = 0; i < 6; i++) { - ptr += 3; - if ((ptr + 2) > limit) + while (*ptr != '\0') { + if (strncmp(ptr, "MAC=", 4) == 0) { + ptr += 4; + for (i = 0;;) { + sc->mac_addr[i] = strtoul(ptr, &endptr, 16); + if (endptr - ptr != 2) + goto abort; + ptr = endptr; + if (++i == 6) + break; + if (*ptr++ != ':') goto abort; - sc->mac_addr[i] = strtoul(ptr, NULL, 16); - found_mac = 1; } - } else if (memcmp(ptr, "PC=", 3) == 0) { + found_mac = 1; + } else if (strncmp(ptr, "PC=", 3) == 0) { ptr += 3; - strncpy(sc->product_code_string, ptr, - sizeof (sc->product_code_string) - 1); - } else if (!found_sn2 && (memcmp(ptr, "SN=", 3) == 0)) { + strlcpy(sc->product_code_string, ptr, + sizeof(sc->product_code_string)); + } else if (!found_sn2 && (strncmp(ptr, "SN=", 3) == 0)) { ptr += 3; - strncpy(sc->serial_number_string, ptr, - sizeof (sc->serial_number_string) - 1); - } else if (memcmp(ptr, "SN2=", 4) == 0) { + strlcpy(sc->serial_number_string, ptr, + sizeof(sc->serial_number_string)); + } else if (strncmp(ptr, "SN2=", 4) == 0) { /* SN2 takes precedence over SN */ ptr += 4; found_sn2 = 1; - strncpy(sc->serial_number_string, ptr, - sizeof (sc->serial_number_string) - 1); + strlcpy(sc->serial_number_string, ptr, + sizeof(sc->serial_number_string)); } - MXGE_NEXT_STRING(ptr); + while (*ptr++ != '\0') {} } if (found_mac) @@ -648,12 +649,6 @@ abort: return (mxge_load_firmware(sc, 0)); } -union qualhack -{ - const char *ro_char; - char *rw_char; -}; - static int mxge_validate_firmware(mxge_softc_t *sc, const mcp_gen_header_t *hdr) { @@ -666,7 +661,7 @@ mxge_validate_firmware(mxge_softc_t *sc, } /* save firmware version for sysctl */ - strncpy(sc->fw_version, hdr->version, sizeof (sc->fw_version)); + strlcpy(sc->fw_version, hdr->version, sizeof(sc->fw_version)); if (mxge_verbose) device_printf(sc->dev, "firmware id: %s\n", hdr->version); @@ -3324,8 +3319,6 @@ mxge_alloc_slice_rings(struct mxge_slice size_t bytes; int err, i; - err = ENOMEM; - /* allocate per-slice receive resources */ ss->rx_small.mask = ss->rx_big.mask = rx_ring_entries - 1; @@ -3334,24 +3327,16 @@ mxge_alloc_slice_rings(struct mxge_slice /* allocate the rx shadow rings */ bytes = rx_ring_entries * sizeof (*ss->rx_small.shadow); ss->rx_small.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_small.shadow == NULL) - return err; bytes = rx_ring_entries * sizeof (*ss->rx_big.shadow); ss->rx_big.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_big.shadow == NULL) - return err; /* allocate the rx host info rings */ bytes = rx_ring_entries * sizeof (*ss->rx_small.info); ss->rx_small.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_small.info == NULL) - return err; bytes = rx_ring_entries * sizeof (*ss->rx_big.info); ss->rx_big.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_big.info == NULL) - return err; /* allocate the rx busdma resources */ err = bus_dma_tag_create(sc->parent_dmat, /* parent */ @@ -3448,8 +3433,6 @@ mxge_alloc_slice_rings(struct mxge_slice bytes = 8 + sizeof (*ss->tx.req_list) * (ss->tx.max_desc + 4); ss->tx.req_bytes = malloc(bytes, M_DEVBUF, M_WAITOK); - if (ss->tx.req_bytes == NULL) - return err; /* ensure req_list entries are aligned to 8 bytes */ ss->tx.req_list = (mcp_kreq_ether_send_t *) ((unsigned long)(ss->tx.req_bytes + 7) & ~7UL); @@ -3458,14 +3441,10 @@ mxge_alloc_slice_rings(struct mxge_slice bytes = sizeof (*ss->tx.seg_list) * ss->tx.max_desc; ss->tx.seg_list = (bus_dma_segment_t *) malloc(bytes, M_DEVBUF, M_WAITOK); - if (ss->tx.seg_list == NULL) - return err; /* allocate the tx host info ring */ bytes = tx_ring_entries * sizeof (*ss->tx.info); ss->tx.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->tx.info == NULL) - return err; /* allocate the tx busdma resources */ err = bus_dma_tag_create(sc->parent_dmat, /* parent */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 17:46:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4D122309; Tue, 5 Mar 2013 17:46:13 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E5C521B; Tue, 5 Mar 2013 17:46:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25HkCbN067357; Tue, 5 Mar 2013 17:46:12 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25HkCL9067356; Tue, 5 Mar 2013 17:46:12 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201303051746.r25HkCL9067356@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 5 Mar 2013 17:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247851 - stable/8/sys/dev/mxge 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 17:46:13 -0000 Author: gallatin Date: Tue Mar 5 17:46:12 2013 New Revision: 247851 URL: http://svnweb.freebsd.org/changeset/base/247851 Log: MFC r247159 Improvements for newer mxge nics: - Some mxge nics may store the serial number in the SN2 field of the EEPROM. These will also have an SN=0 field, so parse the SN2 field, and give it precedence. - Skip MXGEFW_CMD_UNALIGNED_TEST on mxge nics which do not require it. This saves roughly 10ms per port at device attach time. Modified: stable/8/sys/dev/mxge/if_mxge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mxge/ (props changed) Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Tue Mar 5 16:37:20 2013 (r247850) +++ stable/8/sys/dev/mxge/if_mxge.c Tue Mar 5 17:46:12 2013 (r247851) @@ -289,11 +289,12 @@ mxge_parse_strings(mxge_softc_t *sc) #define MXGE_NEXT_STRING(p) while(ptr < limit && *ptr++) char *ptr, *limit; - int i, found_mac; + int i, found_mac, found_sn2; ptr = sc->eeprom_strings; limit = sc->eeprom_strings + MXGE_EEPROM_STRINGS_SIZE; found_mac = 0; + found_sn2 = 0; while (ptr < limit && *ptr != '\0') { if (memcmp(ptr, "MAC=", 4) == 0) { ptr += 1; @@ -309,10 +310,16 @@ mxge_parse_strings(mxge_softc_t *sc) ptr += 3; strncpy(sc->product_code_string, ptr, sizeof (sc->product_code_string) - 1); - } else if (memcmp(ptr, "SN=", 3) == 0) { + } else if (!found_sn2 && (memcmp(ptr, "SN=", 3) == 0)) { ptr += 3; strncpy(sc->serial_number_string, ptr, sizeof (sc->serial_number_string) - 1); + } else if (memcmp(ptr, "SN2=", 4) == 0) { + /* SN2 takes precedence over SN */ + ptr += 4; + found_sn2 = 1; + strncpy(sc->serial_number_string, ptr, + sizeof (sc->serial_number_string) - 1); } MXGE_NEXT_STRING(ptr); } @@ -579,9 +586,10 @@ mxge_firmware_probe(mxge_softc_t *sc) /* * Run a DMA test which watches for unaligned completions and - * aborts on the first one seen. + * aborts on the first one seen. Not required on Z8ES or newer. */ - + if (pci_get_revid(sc->dev) >= MXGE_PCI_REV_Z8ES) + return 0; status = mxge_dma_test(sc, MXGEFW_CMD_UNALIGNED_TEST); if (status == 0) return 0; /* keep the aligned firmware */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 18:54:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ED32A3CB; Tue, 5 Mar 2013 18:54:42 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D9365779; Tue, 5 Mar 2013 18:54:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25Isg6O088340; Tue, 5 Mar 2013 18:54:42 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25Isfpi088335; Tue, 5 Mar 2013 18:54:41 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303051854.r25Isfpi088335@svn.freebsd.org> From: Martin Matuska Date: Tue, 5 Mar 2013 18:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247852 - in head: cddl/contrib/opensolaris/cmd/zdb 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:54:43 -0000 Author: mm Date: Tue Mar 5 18:54:41 2013 New Revision: 247852 URL: http://svnweb.freebsd.org/changeset/base/247852 Log: MFV r247845: Import ZFS bpobj bugfix from vendor. Illumos ZFS issues: 3603 panic from bpobj_enqueue_subobj() 3604 zdb should print bpobjs more verbosely References: https://www.illumos.org/issues/3603 https://www.illumos.org/issues/3604 MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Mar 5 17:46:12 2013 (r247851) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Mar 5 18:54:41 2013 (r247852) @@ -1189,7 +1189,7 @@ dump_bpobj_cb(void *arg, const blkptr_t } static void -dump_bpobj(bpobj_t *bpo, char *name) +dump_bpobj(bpobj_t *bpo, char *name, int indent) { char bytes[32]; char comp[32]; @@ -1199,31 +1199,56 @@ dump_bpobj(bpobj_t *bpo, char *name) return; zdb_nicenum(bpo->bpo_phys->bpo_bytes, bytes); - if (bpo->bpo_havesubobj) { + if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) { zdb_nicenum(bpo->bpo_phys->bpo_comp, comp); zdb_nicenum(bpo->bpo_phys->bpo_uncomp, uncomp); - (void) printf("\n %s: %llu local blkptrs, %llu subobjs, " - "%s (%s/%s comp)\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + (void) printf(" %*s: object %llu, %llu local blkptrs, " + "%llu subobjs, %s (%s/%s comp)\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, (u_longlong_t)bpo->bpo_phys->bpo_num_subobjs, bytes, comp, uncomp); + + for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) { + uint64_t subobj; + bpobj_t subbpo; + int error; + VERIFY0(dmu_read(bpo->bpo_os, + bpo->bpo_phys->bpo_subobjs, + i * sizeof (subobj), sizeof (subobj), &subobj, 0)); + error = bpobj_open(&subbpo, bpo->bpo_os, subobj); + if (error != 0) { + (void) printf("ERROR %u while trying to open " + "subobj id %llu\n", + error, (u_longlong_t)subobj); + continue; + } + dump_bpobj(&subbpo, "subobj", indent + 1); + } } else { - (void) printf("\n %s: %llu blkptrs, %s\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, bytes); + (void) printf(" %*s: object %llu, %llu blkptrs, %s\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + bytes); } if (dump_opt['d'] < 5) return; - (void) printf("\n"); - (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + if (indent == 0) { + (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + (void) printf("\n"); + } } static void dump_deadlist(dsl_deadlist_t *dl) { dsl_deadlist_entry_t *dle; + uint64_t unused; char bytes[32]; char comp[32]; char uncomp[32]; @@ -1242,14 +1267,24 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("\n"); + /* force the tree to be loaded */ + dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); + for (dle = avl_first(&dl->dl_tree); dle; dle = AVL_NEXT(&dl->dl_tree, dle)) { - (void) printf(" mintxg %llu -> obj %llu\n", - (longlong_t)dle->dle_mintxg, - (longlong_t)dle->dle_bpobj.bpo_object); + if (dump_opt['d'] >= 5) { + char buf[128]; + (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); - if (dump_opt['d'] >= 5) - dump_bpobj(&dle->dle_bpobj, ""); + dump_bpobj(&dle->dle_bpobj, buf, 0); + } else { + (void) printf("mintxg %llu -> obj %llu\n", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); + + } } } @@ -1272,7 +1307,7 @@ fuid_table_destroy() * print uid or gid information. * For normal POSIX id just the id is printed in decimal format. * For CIFS files with FUID the fuid is printed in hex followed by - * the doman-rid string. + * the domain-rid string. */ static void print_idstr(uint64_t id, const char *id_type) @@ -2529,10 +2564,11 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { - dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); + dump_bpobj(&spa->spa_deferred_bpobj, + "Deferred frees", 0); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool snapshot frees"); + "Pool snapshot frees", 0); } if (spa_feature_is_active(spa, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Tue Mar 5 17:46:12 2013 (r247851) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Tue Mar 5 18:54:41 2013 (r247852) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -414,6 +414,12 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 VERIFY3U(0, ==, dmu_buf_hold(bpo->bpo_os, subsubobjs, 0, FTAG, &subdb, 0)); + /* + * Make sure that we are not asking dmu_write() + * to write more data than we have in our buffer. + */ + VERIFY3U(subdb->db_size, >=, + numsubsub * sizeof (subobj)); dmu_write(bpo->bpo_os, bpo->bpo_phys->bpo_subobjs, bpo->bpo_phys->bpo_num_subobjs * sizeof (subobj), numsubsub * sizeof (subobj), subdb->db_data, tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Mar 5 17:46:12 2013 (r247851) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Mar 5 18:54:41 2013 (r247852) @@ -1711,7 +1711,7 @@ dmu_object_info_from_dnode(dnode_t *dn, doi->doi_checksum = dn->dn_checksum; doi->doi_compress = dn->dn_compress; doi->doi_physical_blocks_512 = (DN_USED_BYTES(dnp) + 256) >> 9; - doi->doi_max_offset = (dnp->dn_maxblkid + 1) * dn->dn_datablksz; + doi->doi_max_offset = (dn->dn_maxblkid + 1) * dn->dn_datablksz; doi->doi_fill_count = 0; for (int i = 0; i < dnp->dn_nblkptr; i++) doi->doi_fill_count += dnp->dn_blkptr[i].blk_fill; From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 19:20:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6CC2A8B0; Tue, 5 Mar 2013 19:20:35 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4FE3E86F; Tue, 5 Mar 2013 19:20:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25JKYMN095716; Tue, 5 Mar 2013 19:20:34 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25JKYma095715; Tue, 5 Mar 2013 19:20:34 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201303051920.r25JKYma095715@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 5 Mar 2013 19:20:34 +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: r247853 - stable/8/sys/dev/mxge 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 19:20:35 -0000 Author: gallatin Date: Tue Mar 5 19:20:34 2013 New Revision: 247853 URL: http://svnweb.freebsd.org/changeset/base/247853 Log: MFC r247268: Several cleanups and fixes to mxge: - Remove vestigial null pointer tests after malloc(..., M_WAITOK). - Remove vestigal qualhack union - Use strlcpy() instead of the error-prone strncpy() when parsing EEPROM and copying strings - Check the MAC address in the EEPROM strings more strictly. - Expand the macro MXGE_NEXT_STRING() at its only user. Due to a typo, the macro was very confusing. - Remove unnecessary buffer limit check. The buffer is double-NUL terminated per construction. PR: kern/176369 Submitted by: Christoph Mallon Modified: stable/8/sys/dev/mxge/if_mxge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mxge/ (props changed) Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Tue Mar 5 18:54:41 2013 (r247852) +++ stable/8/sys/dev/mxge/if_mxge.c Tue Mar 5 19:20:34 2013 (r247853) @@ -286,42 +286,43 @@ mxge_dma_free(mxge_dma_t *dma) static int mxge_parse_strings(mxge_softc_t *sc) { -#define MXGE_NEXT_STRING(p) while(ptr < limit && *ptr++) - - char *ptr, *limit; + char *ptr; int i, found_mac, found_sn2; + char *endptr; ptr = sc->eeprom_strings; - limit = sc->eeprom_strings + MXGE_EEPROM_STRINGS_SIZE; found_mac = 0; found_sn2 = 0; - while (ptr < limit && *ptr != '\0') { - if (memcmp(ptr, "MAC=", 4) == 0) { - ptr += 1; - sc->mac_addr_string = ptr; - for (i = 0; i < 6; i++) { - ptr += 3; - if ((ptr + 2) > limit) + while (*ptr != '\0') { + if (strncmp(ptr, "MAC=", 4) == 0) { + ptr += 4; + for (i = 0;;) { + sc->mac_addr[i] = strtoul(ptr, &endptr, 16); + if (endptr - ptr != 2) + goto abort; + ptr = endptr; + if (++i == 6) + break; + if (*ptr++ != ':') goto abort; - sc->mac_addr[i] = strtoul(ptr, NULL, 16); - found_mac = 1; } - } else if (memcmp(ptr, "PC=", 3) == 0) { + found_mac = 1; + } else if (strncmp(ptr, "PC=", 3) == 0) { ptr += 3; - strncpy(sc->product_code_string, ptr, - sizeof (sc->product_code_string) - 1); - } else if (!found_sn2 && (memcmp(ptr, "SN=", 3) == 0)) { + strlcpy(sc->product_code_string, ptr, + sizeof(sc->product_code_string)); + } else if (!found_sn2 && (strncmp(ptr, "SN=", 3) == 0)) { ptr += 3; - strncpy(sc->serial_number_string, ptr, - sizeof (sc->serial_number_string) - 1); - } else if (memcmp(ptr, "SN2=", 4) == 0) { + strlcpy(sc->serial_number_string, ptr, + sizeof(sc->serial_number_string)); + } else if (strncmp(ptr, "SN2=", 4) == 0) { /* SN2 takes precedence over SN */ ptr += 4; found_sn2 = 1; - strncpy(sc->serial_number_string, ptr, - sizeof (sc->serial_number_string) - 1); + strlcpy(sc->serial_number_string, ptr, + sizeof(sc->serial_number_string)); } - MXGE_NEXT_STRING(ptr); + while (*ptr++ != '\0') {} } if (found_mac) @@ -647,12 +648,6 @@ abort: return (mxge_load_firmware(sc, 0)); } -union qualhack -{ - const char *ro_char; - char *rw_char; -}; - static int mxge_validate_firmware(mxge_softc_t *sc, const mcp_gen_header_t *hdr) { @@ -665,7 +660,7 @@ mxge_validate_firmware(mxge_softc_t *sc, } /* save firmware version for sysctl */ - strncpy(sc->fw_version, hdr->version, sizeof (sc->fw_version)); + strlcpy(sc->fw_version, hdr->version, sizeof(sc->fw_version)); if (mxge_verbose) device_printf(sc->dev, "firmware id: %s\n", hdr->version); @@ -3212,8 +3207,6 @@ mxge_alloc_slice_rings(struct mxge_slice size_t bytes; int err, i; - err = ENOMEM; - /* allocate per-slice receive resources */ ss->rx_small.mask = ss->rx_big.mask = rx_ring_entries - 1; @@ -3222,24 +3215,16 @@ mxge_alloc_slice_rings(struct mxge_slice /* allocate the rx shadow rings */ bytes = rx_ring_entries * sizeof (*ss->rx_small.shadow); ss->rx_small.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_small.shadow == NULL) - return err; bytes = rx_ring_entries * sizeof (*ss->rx_big.shadow); ss->rx_big.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_big.shadow == NULL) - return err; /* allocate the rx host info rings */ bytes = rx_ring_entries * sizeof (*ss->rx_small.info); ss->rx_small.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_small.info == NULL) - return err; bytes = rx_ring_entries * sizeof (*ss->rx_big.info); ss->rx_big.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_big.info == NULL) - return err; /* allocate the rx busdma resources */ err = bus_dma_tag_create(sc->parent_dmat, /* parent */ @@ -3336,8 +3321,6 @@ mxge_alloc_slice_rings(struct mxge_slice bytes = 8 + sizeof (*ss->tx.req_list) * (ss->tx.max_desc + 4); ss->tx.req_bytes = malloc(bytes, M_DEVBUF, M_WAITOK); - if (ss->tx.req_bytes == NULL) - return err; /* ensure req_list entries are aligned to 8 bytes */ ss->tx.req_list = (mcp_kreq_ether_send_t *) ((unsigned long)(ss->tx.req_bytes + 7) & ~7UL); @@ -3346,14 +3329,10 @@ mxge_alloc_slice_rings(struct mxge_slice bytes = sizeof (*ss->tx.seg_list) * ss->tx.max_desc; ss->tx.seg_list = (bus_dma_segment_t *) malloc(bytes, M_DEVBUF, M_WAITOK); - if (ss->tx.seg_list == NULL) - return err; /* allocate the tx host info ring */ bytes = tx_ring_entries * sizeof (*ss->tx.info); ss->tx.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->tx.info == NULL) - return err; /* allocate the tx busdma resources */ err = bus_dma_tag_create(sc->parent_dmat, /* parent */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 19:37:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EBB95EFC; Tue, 5 Mar 2013 19:37:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D43E1948; Tue, 5 Mar 2013 19:37:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25JbThJ001119; Tue, 5 Mar 2013 19:37:29 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25JbTZh001118; Tue, 5 Mar 2013 19:37:29 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201303051937.r25JbTZh001118@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 5 Mar 2013 19:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247854 - head/tools/tools/cxgbetool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 19:37:30 -0000 Author: np Date: Tue Mar 5 19:37:29 2013 New Revision: 247854 URL: http://svnweb.freebsd.org/changeset/base/247854 Log: Fix compile warning by including ctype.h for isdigit(). MFC after: 1 day Modified: head/tools/tools/cxgbetool/cxgbetool.c Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Tue Mar 5 19:20:34 2013 (r247853) +++ head/tools/tools/cxgbetool/cxgbetool.c Tue Mar 5 19:37:29 2013 (r247854) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 20:00:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 36C2C70C; Tue, 5 Mar 2013 20:00:12 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 282C0A3C; Tue, 5 Mar 2013 20:00:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25K0Btm007619; Tue, 5 Mar 2013 20:00:11 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25K0BIn007618; Tue, 5 Mar 2013 20:00:11 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201303052000.r25K0BIn007618@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 5 Mar 2013 20:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247855 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 20:00:12 -0000 Author: gonzo Date: Tue Mar 5 20:00:11 2013 New Revision: 247855 URL: http://svnweb.freebsd.org/changeset/base/247855 Log: - Reset DMA channel if error occured - Initialize info field in bcm_dma_reset Submitted by: Daisuke Aoyama Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Tue Mar 5 19:37:29 2013 (r247854) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Tue Mar 5 20:00:11 2013 (r247855) @@ -199,6 +199,7 @@ bcm_dma_reset(device_t dev, int ch) /* Reset control block */ cb = sc->sc_dma_ch[ch].cb; bzero(cb, sizeof(cb)); + cb->info = INFO_WAIT_RESP; } static int @@ -615,6 +616,7 @@ bcm_dma_intr(void *arg) debug & DEBUG_ERROR_MASK, ch->ch); bus_write_4(sc->sc_mem, BCM_DMA_DEBUG(ch->ch), debug & DEBUG_ERROR_MASK); + bcm_dma_reset(sc->sc_dev, ch->ch); } if (cs & CS_INT) { From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 22:41:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 073175DB; Tue, 5 Mar 2013 22:41:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF18A153; Tue, 5 Mar 2013 22:41:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25MfbOA058376; Tue, 5 Mar 2013 22:41:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25MfaCp058364; Tue, 5 Mar 2013 22:41:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201303052241.r25MfaCp058364@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 5 Mar 2013 22:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247856 - in head/sbin: mount_cd9660 mount_msdosfs mount_nfs mount_nullfs mount_reiserfs mount_std mount_udf mount_unionfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 22:41:38 -0000 Author: jkim Date: Tue Mar 5 22:41:35 2013 New Revision: 247856 URL: http://svnweb.freebsd.org/changeset/base/247856 Log: GC unused variables. Prefer NULL over 0 for pointers. Modified: head/sbin/mount_cd9660/mount_cd9660.c head/sbin/mount_msdosfs/mount_msdosfs.c head/sbin/mount_nfs/mount_nfs.c head/sbin/mount_nullfs/mount_nullfs.c head/sbin/mount_reiserfs/mount_reiserfs.c head/sbin/mount_std/mount_std.c head/sbin/mount_udf/mount_udf.c head/sbin/mount_unionfs/mount_unionfs.c Modified: head/sbin/mount_cd9660/mount_cd9660.c ============================================================================== --- head/sbin/mount_cd9660/mount_cd9660.c Tue Mar 5 20:00:11 2013 (r247855) +++ head/sbin/mount_cd9660/mount_cd9660.c Tue Mar 5 22:41:35 2013 (r247856) @@ -83,7 +83,7 @@ main(int argc, char **argv) { struct iovec *iov; int iovlen; - int ch, mntflags, opts; + int ch, mntflags; char *dev, *dir, *p, *val, mntpath[MAXPATHLEN]; int verbose; int ssector; /* starting sector, 0 for 1st session */ @@ -91,7 +91,7 @@ main(int argc, char **argv) iov = NULL; iovlen = 0; - mntflags = opts = verbose = 0; + mntflags = verbose = 0; ssector = -1; while ((ch = getopt(argc, argv, "begjo:rs:vC:")) != -1) @@ -109,7 +109,7 @@ main(int argc, char **argv) build_iovec(&iov, &iovlen, "nojoliet", NULL, (size_t)-1); break; case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); p = strchr(optarg, '='); val = NULL; if (p != NULL) { Modified: head/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- head/sbin/mount_msdosfs/mount_msdosfs.c Tue Mar 5 20:00:11 2013 (r247855) +++ head/sbin/mount_msdosfs/mount_msdosfs.c Tue Mar 5 22:41:35 2013 (r247856) @@ -69,7 +69,7 @@ main(int argc, char **argv) struct iovec *iov = NULL; int iovlen = 0; struct stat sb; - int c, mntflags, set_gid, set_uid, set_mask, set_dirmask; + int c, set_gid, set_uid, set_mask, set_dirmask; char *dev, *dir, mntpath[MAXPATHLEN], *csp; char fstype[] = "msdosfs"; char errmsg[255] = {0}; @@ -78,9 +78,8 @@ main(int argc, char **argv) mode_t mask = 0, dirmask = 0; uid_t uid = 0; gid_t gid = 0; - getmnt_silent = 1; - mntflags = set_gid = set_uid = set_mask = set_dirmask = 0; + set_gid = set_uid = set_mask = set_dirmask = 0; while ((c = getopt(argc, argv, "sl9u:g:m:M:o:L:D:W:")) != -1) { switch (c) { @@ -219,7 +218,7 @@ main(int argc, char **argv) build_iovec_argf(&iov, &iovlen, "mask", "%u", mask); build_iovec_argf(&iov, &iovlen, "dirmask", "%u", dirmask); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0]) err(1, "%s: %s", dev, errmsg); else Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Tue Mar 5 20:00:11 2013 (r247855) +++ head/sbin/mount_nfs/mount_nfs.c Tue Mar 5 22:41:35 2013 (r247856) @@ -130,7 +130,7 @@ enum tryret { TRYRET_LOCALERR /* Local failure. */ }; -static int fallback_mount(struct iovec *iov, int iovlen, int mntflags); +static int fallback_mount(struct iovec *iov, int iovlen); static int sec_name_to_num(char *sec); static char *sec_num_to_name(int num); static int getnfsargs(char *, struct iovec **iov, int *iovlen); @@ -149,13 +149,12 @@ main(int argc, char *argv[]) { int c; struct iovec *iov; - int mntflags, num, iovlen; + int num, iovlen; int osversion; char *name, *p, *spec, *fstype; char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50]; - mntflags = 0; iov = NULL; iovlen = 0; memset(errmsg, 0, sizeof(errmsg)); @@ -427,10 +426,10 @@ main(int argc, char *argv[]) */ osversion = getosreldate(); if (osversion >= 702100) { - if (nmount(iov, iovlen, mntflags)) + if (nmount(iov, iovlen, 0)) err(1, "%s, %s", mntpath, errmsg); } else { - if (fallback_mount(iov, iovlen, mntflags)) + if (fallback_mount(iov, iovlen)) err(1, "%s, %s", mntpath, errmsg); } @@ -473,7 +472,7 @@ copyopt(struct iovec **newiov, int *newi * parameters. It should be eventually be removed. */ static int -fallback_mount(struct iovec *iov, int iovlen, int mntflags) +fallback_mount(struct iovec *iov, int iovlen) { struct nfs_args args = { .version = NFS_ARGSVERSION, @@ -663,7 +662,7 @@ fallback_mount(struct iovec *iov, int io copyopt(&newiov, &newiovlen, iov, iovlen, "fspath"); copyopt(&newiov, &newiovlen, iov, iovlen, "errmsg"); - return nmount(newiov, newiovlen, mntflags); + return nmount(newiov, newiovlen, 0); } static int Modified: head/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- head/sbin/mount_nullfs/mount_nullfs.c Tue Mar 5 20:00:11 2013 (r247855) +++ head/sbin/mount_nullfs/mount_nullfs.c Tue Mar 5 22:41:35 2013 (r247856) @@ -68,12 +68,11 @@ main(int argc, char *argv[]) char source[MAXPATHLEN]; char target[MAXPATHLEN]; char errmsg[255]; - int ch, mntflags, iovlen; + int ch, iovlen; char nullfs[] = "nullfs"; iov = NULL; iovlen = 0; - mntflags = 0; errmsg[0] = '\0'; while ((ch = getopt(argc, argv, "o:")) != -1) switch(ch) { @@ -111,7 +110,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); build_iovec(&iov, &iovlen, "target", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0] != 0) err(1, "%s: %s", source, errmsg); else Modified: head/sbin/mount_reiserfs/mount_reiserfs.c ============================================================================== --- head/sbin/mount_reiserfs/mount_reiserfs.c Tue Mar 5 20:00:11 2013 (r247855) +++ head/sbin/mount_reiserfs/mount_reiserfs.c Tue Mar 5 22:41:35 2013 (r247856) @@ -58,7 +58,7 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "o:")) != -1) { switch(ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, 0); + getmntopts(optarg, mopts, &mntflags, NULL); break; case '?': default: Modified: head/sbin/mount_std/mount_std.c ============================================================================== --- head/sbin/mount_std/mount_std.c Tue Mar 5 20:00:11 2013 (r247855) +++ head/sbin/mount_std/mount_std.c Tue Mar 5 22:41:35 2013 (r247856) @@ -99,7 +99,7 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "o:")) != -1) switch (ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, 0); + getmntopts(optarg, mopts, &mntflags, NULL); break; case '?': default: Modified: head/sbin/mount_udf/mount_udf.c ============================================================================== --- head/sbin/mount_udf/mount_udf.c Tue Mar 5 20:00:11 2013 (r247855) +++ head/sbin/mount_udf/mount_udf.c Tue Mar 5 22:41:35 2013 (r247856) @@ -74,17 +74,17 @@ int main(int argc, char **argv) { struct iovec iov[12]; - int ch, i, mntflags, opts, udf_flags; + int ch, i, mntflags, udf_flags; char *dev, *dir, mntpath[MAXPATHLEN]; char *cs_disk, *cs_local; int verbose; - i = mntflags = opts = udf_flags = verbose = 0; + i = mntflags = udf_flags = verbose = 0; cs_disk = cs_local = NULL; while ((ch = getopt(argc, argv, "o:vC:")) != -1) switch (ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); break; case 'v': verbose++; Modified: head/sbin/mount_unionfs/mount_unionfs.c ============================================================================== --- head/sbin/mount_unionfs/mount_unionfs.c Tue Mar 5 20:00:11 2013 (r247855) +++ head/sbin/mount_unionfs/mount_unionfs.c Tue Mar 5 22:41:35 2013 (r247856) @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) { struct iovec *iov; - int ch, mntflags, iovlen; + int ch, iovlen; char source [MAXPATHLEN], target[MAXPATHLEN], errmsg[255]; char uid_str[20], gid_str[20]; char fstype[] = "unionfs"; @@ -137,7 +137,6 @@ main(int argc, char *argv[]) iov = NULL; iovlen = 0; - mntflags = 0; memset(errmsg, 0, sizeof(errmsg)); while ((ch = getopt(argc, argv, "bo:")) != -1) { @@ -190,7 +189,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "from", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - if (nmount(iov, iovlen, mntflags)) + if (nmount(iov, iovlen, 0)) err(EX_OSERR, "%s: %s", source, errmsg); exit(0); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 23:05:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0270EB1; Tue, 5 Mar 2013 23:05:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A2F3F250; Tue, 5 Mar 2013 23:05:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25N5iWa065191; Tue, 5 Mar 2013 23:05:44 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25N5i3B065190; Tue, 5 Mar 2013 23:05:44 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201303052305.r25N5i3B065190@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 5 Mar 2013 23:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247859 - head/sbin/mount_cd9660 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:05:44 -0000 Author: jkim Date: Tue Mar 5 23:05:43 2013 New Revision: 247859 URL: http://svnweb.freebsd.org/changeset/base/247859 Log: Update the manual page to reflect reality. With r138509 and r152355, "nostrictjoliet" option for mount_cd9660(8) was completely replaced with "brokenjoliet" somehow. MFC after: 3 days Modified: head/sbin/mount_cd9660/mount_cd9660.8 Modified: head/sbin/mount_cd9660/mount_cd9660.8 ============================================================================== --- head/sbin/mount_cd9660/mount_cd9660.8 Tue Mar 5 22:58:53 2013 (r247858) +++ head/sbin/mount_cd9660/mount_cd9660.8 Tue Mar 5 23:05:43 2013 (r247859) @@ -32,7 +32,7 @@ .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" $FreeBSD$ .\" -.Dd October 3, 2005 +.Dd March 5, 2013 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -80,7 +80,7 @@ See the man page for possible options and their meanings. The following cd9660 specific options are available: .Pp -.Bl -tag -width "nostrictjoliet" -compact +.Bl -tag -width "brokenjoliet" -compact .It Cm extatt Same as .Fl e . @@ -93,7 +93,7 @@ Same as .It Cm norrip Same as .Fl r . -.It Cm nostrictjoliet +.It Cm brokenjoliet Same as .Fl b . .El From owner-svn-src-all@FreeBSD.ORG Tue Mar 5 23:53:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E61228A4; Tue, 5 Mar 2013 23:53:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D77C3CE; Tue, 5 Mar 2013 23:53:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25NrcKD079580; Tue, 5 Mar 2013 23:53:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25Nrcld079578; Tue, 5 Mar 2013 23:53:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201303052353.r25Nrcld079578@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 5 Mar 2013 23:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247860 - in head/sbin: mount_ext2fs mount_reiserfs mount_std X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:53:40 -0000 Author: jkim Date: Tue Mar 5 23:53:37 2013 New Revision: 247860 URL: http://svnweb.freebsd.org/changeset/base/247860 Log: GC unused mount_* directories. mount_reiserfs was disconnected from build with r158666. mount_ext2fs and mount_std were disconnected with r164527. Deleted: head/sbin/mount_ext2fs/ head/sbin/mount_reiserfs/ head/sbin/mount_std/ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 00:36:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49E7753C; Wed, 6 Mar 2013 00:36:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC726ED; Wed, 6 Mar 2013 00:36:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r260aXPi092631; Wed, 6 Mar 2013 00:36:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r260aXkA092627; Wed, 6 Mar 2013 00:36:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201303060036.r260aXkA092627@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 6 Mar 2013 00:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247861 - head/sbin/mount_udf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 00:36:34 -0000 Author: jkim Date: Wed Mar 6 00:36:33 2013 New Revision: 247861 URL: http://svnweb.freebsd.org/changeset/base/247861 Log: Use build_iovec() to make it less cryptic. This also fixes warnings. Modified: head/sbin/mount_udf/Makefile head/sbin/mount_udf/mount_udf.c Modified: head/sbin/mount_udf/Makefile ============================================================================== --- head/sbin/mount_udf/Makefile Tue Mar 5 23:53:37 2013 (r247860) +++ head/sbin/mount_udf/Makefile Wed Mar 6 00:36:33 2013 (r247861) @@ -9,7 +9,6 @@ LDADD= -lkiconv MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} -I${.CURDIR}/../../sys .PATH: ${MOUNT} -WARNS?= 1 # Needs to be dynamically linked for optional dlopen() access to # userland libiconv Modified: head/sbin/mount_udf/mount_udf.c ============================================================================== --- head/sbin/mount_udf/mount_udf.c Tue Mar 5 23:53:37 2013 (r247860) +++ head/sbin/mount_udf/mount_udf.c Wed Mar 6 00:36:33 2013 (r247861) @@ -73,14 +73,15 @@ void usage(void); int main(int argc, char **argv) { - struct iovec iov[12]; - int ch, i, mntflags, udf_flags; - char *dev, *dir, mntpath[MAXPATHLEN]; - char *cs_disk, *cs_local; - int verbose; + char mntpath[MAXPATHLEN]; + char fstype[] = "udf"; + struct iovec *iov; + char *cs_disk, *cs_local, *dev, *dir; + int ch, i, iovlen, mntflags, udf_flags, verbose; - i = mntflags = udf_flags = verbose = 0; + i = iovlen = mntflags = udf_flags = verbose = 0; cs_disk = cs_local = NULL; + iov = NULL; while ((ch = getopt(argc, argv, "o:vC:")) != -1) switch (ch) { case 'o': @@ -120,32 +121,13 @@ main(int argc, char **argv) */ mntflags |= MNT_RDONLY; - iov[i].iov_base = "fstype"; - iov[i++].iov_len = sizeof("fstype"); - iov[i].iov_base = "udf"; - iov[i].iov_len = strlen(iov[i].iov_base) + 1; - i++; - iov[i].iov_base = "fspath"; - iov[i++].iov_len = sizeof("fspath"); - iov[i].iov_base = mntpath; - iov[i++].iov_len = strlen(mntpath) + 1; - iov[i].iov_base = "from"; - iov[i++].iov_len = sizeof("from"); - iov[i].iov_base = dev; - iov[i++].iov_len = strlen(dev) + 1; - iov[i].iov_base = "flags"; - iov[i++].iov_len = sizeof("flags"); - iov[i].iov_base = &udf_flags; - iov[i++].iov_len = sizeof(udf_flags); + build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); + build_iovec(&iov, &iovlen, "from", dev, (size_t)-1); + build_iovec(&iov, &iovlen, "flags", &udf_flags, sizeof(udf_flags)); if (udf_flags & UDFMNT_KICONV) { - iov[i].iov_base = "cs_disk"; - iov[i++].iov_len = sizeof("cs_disk"); - iov[i].iov_base = cs_disk; - iov[i++].iov_len = strlen(cs_disk) + 1; - iov[i].iov_base = "cs_local"; - iov[i++].iov_len = sizeof("cs_local"); - iov[i].iov_base = cs_local; - iov[i++].iov_len = strlen(cs_local) + 1; + build_iovec(&iov, &iovlen, "cs_disk", cs_disk, (size_t)-1); + build_iovec(&iov, &iovlen, "cs_local", cs_local, (size_t)-1); } if (nmount(iov, i, mntflags) < 0) err(1, "%s", dev); From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 04:58:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 38534448; Wed, 6 Mar 2013 04:58:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 266D8D7; Wed, 6 Mar 2013 04:58:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r264wmgf072792; Wed, 6 Mar 2013 04:58:48 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r264wmDe072791; Wed, 6 Mar 2013 04:58:48 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201303060458.r264wmDe072791@svn.freebsd.org> From: Hiroki Sato Date: Wed, 6 Mar 2013 04:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247863 - head/usr.sbin/rtadvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 04:58:49 -0000 Author: hrs Date: Wed Mar 6 04:58:48 2013 New Revision: 247863 URL: http://svnweb.freebsd.org/changeset/base/247863 Log: Fix SIGSEGV when set_short_delay() is called when ifi->ifi_ra_timer is NULL. This can happen in a short period when a prefix is changed by a rtmsg and a new interface arrives. Modified: head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.c Wed Mar 6 01:21:56 2013 (r247862) +++ head/usr.sbin/rtadvd/rtadvd.c Wed Mar 6 04:58:48 2013 (r247863) @@ -1008,6 +1008,8 @@ set_short_delay(struct ifinfo *ifi) long delay; /* must not be greater than 1000000 */ struct timeval interval, now, min_delay, tm_tmp, *rest; + if (ifi->ifi_ra_timer == NULL) + return; /* * Compute a random delay. If the computed value * corresponds to a time later than the time the next From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 05:21:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6A5D8BD for ; Wed, 6 Mar 2013 05:21:04 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id 586BF168 for ; Wed, 6 Mar 2013 05:21:04 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id fs12so6830449lab.25 for ; Tue, 05 Mar 2013 21:21:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=FVxmpNg86SuFF5OuLbzxmV6Y7hLjw7cenydkNKqFq9s=; b=KP+wZVVm2RRPAuQaq8b8CLWg+P0obK1Xuxc2OWgRq8jc6UjawJtxRW0B8EutCbGwoT vOU5lI5BtkIaL4tsP+w81YBLR26vP2nhMFplijW9PeJUs354yANrlW1l2EsjheZfkG7T Imzhv1lVYGbuIla/pn/DDJ3nTM96MD0LaR/5009j4iMD4nE2kauz5/BMhLJ36PYiQ/xp jq5iEOiMpdHUMdGt2fKWGh15xCYm+sOs2/sxw063zCE8En3bmPnGXddKNkwdA3SKeAyL 6vGIPKuNQVRhHskw+V2PHmcWqIAn7SWusSsUwLizyN4vDYTpkDJ8Lzgn2Fi1PDsMkCSw O46A== X-Received: by 10.112.17.41 with SMTP id l9mr6766945lbd.91.1362547263221; Tue, 05 Mar 2013 21:21:03 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.133.196 with HTTP; Tue, 5 Mar 2013 21:20:43 -0800 (PST) In-Reply-To: <201303052353.r25Nrcld079578@svn.freebsd.org> References: <201303052353.r25Nrcld079578@svn.freebsd.org> From: Juli Mallett Date: Tue, 5 Mar 2013 21:20:43 -0800 X-Google-Sender-Auth: dJRayuclwG8PPvTJXBmER-76jT8 Message-ID: Subject: Re: svn commit: r247860 - in head/sbin: mount_ext2fs mount_reiserfs mount_std To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmA1EGq0nArw3sq6yMqkkSldSCVu828njG6BNqNNjHtNDTGcAreE2YyfGNL2LUzSgyh0mE8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 05:21:04 -0000 Thanks! On Tue, Mar 5, 2013 at 3:53 PM, Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 5 23:53:37 2013 > New Revision: 247860 > URL: http://svnweb.freebsd.org/changeset/base/247860 > > Log: > GC unused mount_* directories. mount_reiserfs was disconnected from build > with r158666. mount_ext2fs and mount_std were disconnected with r164527. > > Deleted: > head/sbin/mount_ext2fs/ > head/sbin/mount_reiserfs/ > head/sbin/mount_std/ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 06:19:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EF4D461; Wed, 6 Mar 2013 06:19:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 781F932A; Wed, 6 Mar 2013 06:19:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r266Jv38097214; Wed, 6 Mar 2013 06:19:57 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r266JuVA097211; Wed, 6 Mar 2013 06:19:56 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201303060619.r266JuVA097211@svn.freebsd.org> From: Andrew Turner Date: Wed, 6 Mar 2013 06:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247864 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:19:57 -0000 Author: andrew Date: Wed Mar 6 06:19:56 2013 New Revision: 247864 URL: http://svnweb.freebsd.org/changeset/base/247864 Log: Fix stack alignment in the kernel to be on an 8 byte boundary as required by AAPCS. Modified: head/sys/arm/arm/swtch.S head/sys/arm/arm/vm_machdep.c head/sys/arm/include/frame.h Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Wed Mar 6 04:58:48 2013 (r247863) +++ head/sys/arm/arm/swtch.S Wed Mar 6 06:19:56 2013 (r247864) @@ -211,10 +211,12 @@ ENTRY(cpu_throw) GET_PCPU(r6) str r7, [r6, #PC_CURPCB] + add sp, sp, #4; ldmfd sp!, {r4-r7, pc} ENTRY(cpu_switch) stmfd sp!, {r4-r7, lr} + sub sp, sp, #4; mov r6, r2 /* Save the mutex */ .Lswitch_resume: @@ -488,6 +490,7 @@ ENTRY(cpu_switch) * Pull the registers that got pushed when either savectx() or * cpu_switch() was called and return. */ + add sp, sp, #4; ldmfd sp!, {r4-r7, pc} #ifdef DIAGNOSTIC .Lswitch_bogons: @@ -501,6 +504,7 @@ ENTRY(cpu_switch) #endif ENTRY(savectx) stmfd sp!, {r4-r7, lr} + sub sp, sp, #4 /* * r0 = pcb */ @@ -528,6 +532,7 @@ ENTRY(savectx) bl _C_LABEL(vfp_store) 1: #endif /* ARM_VFP_SUPPORT */ + add sp, sp, #4; ldmfd sp!, {r4-r7, pc} ENTRY(fork_trampoline) Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Wed Mar 6 04:58:48 2013 (r247863) +++ head/sys/arm/arm/vm_machdep.c Wed Mar 6 06:19:56 2013 (r247864) @@ -73,6 +73,12 @@ __FBSDID("$FreeBSD$"); #include +/* + * struct switchframe must be a multiple of 8 for correct stack alignment + */ +CTASSERT(sizeof(struct switchframe) == 24); +CTASSERT(sizeof(struct trapframe) == 76); + #ifndef NSFBUFS #define NSFBUFS (512 + maxusers * 16) #endif @@ -131,8 +137,8 @@ cpu_fork(register struct thread *td1, re pcb2->un_32.pcb32_sp = td2->td_kstack + USPACE_SVC_STACK_TOP - sizeof(*pcb2); pmap_activate(td2); - td2->td_frame = tf = - (struct trapframe *)pcb2->un_32.pcb32_sp - 1; + td2->td_frame = tf = (struct trapframe *)STACKALIGN( + pcb2->un_32.pcb32_sp - sizeof(struct trapframe)); *tf = *td1->td_frame; sf = (struct switchframe *)tf - 1; sf->sf_r4 = (u_int)fork_return; @@ -142,6 +148,8 @@ cpu_fork(register struct thread *td1, re tf->tf_r0 = 0; tf->tf_r1 = 0; pcb2->un_32.pcb32_sp = (u_int)sf; + KASSERT((pcb2->un_32.pcb32_sp & 7) == 0, + ("cpu_fork: Incorrect stack alignment")); /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; @@ -345,6 +353,8 @@ cpu_set_upcall(struct thread *td, struct tf->tf_r0 = 0; td->td_pcb->un_32.pcb32_sp = (u_int)sf; td->td_pcb->un_32.pcb32_und_sp = td->td_kstack + USPACE_UNDEF_STACK_TOP; + KASSERT((td->td_pcb->un_32.pcb32_sp & 7) == 0, + ("cpu_set_upcall: Incorrect stack alignment")); /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; @@ -438,6 +448,8 @@ cpu_set_fork_handler(struct thread *td, sf->sf_r4 = (u_int)func; sf->sf_r5 = (u_int)arg; td->td_pcb->un_32.pcb32_sp = (u_int)sf; + KASSERT((td->td_pcb->un_32.pcb32_sp & 7) == 0, + ("cpu_set_fork_handler: Incorrect stack alignment")); } /* Modified: head/sys/arm/include/frame.h ============================================================================== --- head/sys/arm/include/frame.h Wed Mar 6 04:58:48 2013 (r247863) +++ head/sys/arm/include/frame.h Wed Mar 6 06:19:56 2013 (r247864) @@ -138,10 +138,14 @@ typedef struct irqframe { } irqframe_t; /* - * Switch frame + * Switch frame. + * + * It is important this is a multiple of 8 bytes so the stack is correctly + * aligned when we create new threads. */ struct switchframe { + u_int pad; /* Used to pad the struct to a multiple of 8-bytes */ u_int sf_r4; u_int sf_r5; u_int sf_r6; From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 06:24:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C75D2641; Wed, 6 Mar 2013 06:24:09 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A31F7350; Wed, 6 Mar 2013 06:24:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r266O9Zl099407; Wed, 6 Mar 2013 06:24:09 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r266O94q099406; Wed, 6 Mar 2013 06:24:09 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201303060624.r266O94q099406@svn.freebsd.org> From: Peter Grehan Date: Wed, 6 Mar 2013 06:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247865 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:24:09 -0000 Author: grehan Date: Wed Mar 6 06:24:09 2013 New Revision: 247865 URL: http://svnweb.freebsd.org/changeset/base/247865 Log: Reorder code to avoid the stat buffer being used uninitialized. Obtained from: NetApp Modified: head/usr.sbin/bhyve/acpi.c Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Wed Mar 6 06:19:56 2013 (r247864) +++ head/usr.sbin/bhyve/acpi.c Wed Mar 6 06:24:09 2013 (r247865) @@ -687,12 +687,16 @@ basl_load(int fd, uint64_t off) int err; err = 0; - gaddr = paddr_guest2host(basl_acpi_base + off, sb.st_size); - if (gaddr != NULL) { - if (fstat(fd, &sb) < 0 || read(fd, gaddr, sb.st_size) < 0) - err = errno; - } else - err = EFAULT; + if (fstat(fd, &sb) < 0) { + err = errno; + } else { + gaddr = paddr_guest2host(basl_acpi_base + off, sb.st_size); + if (gaddr != NULL) { + if (read(fd, gaddr, sb.st_size) < 0) + err = errno; + } else + err = EFAULT; + } return (err); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 06:57:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C5AC157; Wed, 6 Mar 2013 06:57:19 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6466165C; Wed, 6 Mar 2013 06:57:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r266vJpm008749; Wed, 6 Mar 2013 06:57:19 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r266vIdk008745; Wed, 6 Mar 2013 06:57:18 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201303060657.r266vIdk008745@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 6 Mar 2013 06:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247866 - stable/9/sbin/hastd 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:57:19 -0000 Author: trociny Date: Wed Mar 6 06:57:18 2013 New Revision: 247866 URL: http://svnweb.freebsd.org/changeset/base/247866 Log: MFC r247281: Add i/o error counters to hastd(8) and make hastctl(8) display them. This may be useful for detecting problems with HAST disks. Discussed with and reviewed by: pjd Modified: stable/9/sbin/hastd/control.c stable/9/sbin/hastd/hast.h stable/9/sbin/hastd/primary.c stable/9/sbin/hastd/secondary.c Directory Properties: stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastd/control.c ============================================================================== --- stable/9/sbin/hastd/control.c Wed Mar 6 06:24:09 2013 (r247865) +++ stable/9/sbin/hastd/control.c Wed Mar 6 06:57:18 2013 (r247866) @@ -207,6 +207,14 @@ control_status_worker(struct hast_resour "stat_flush%u", no); nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_activemap_update"), "stat_activemap_update%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_read_error"), + "stat_read_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_write_error"), + "stat_write_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_delete_error"), + "stat_delete_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_flush_error"), + "stat_flush_error%u", no); end: if (cnvin != NULL) nv_free(cnvin); @@ -459,6 +467,16 @@ ctrl_thread(void *arg) nv_add_uint64(nvout, res->hr_stat_flush, "stat_flush"); nv_add_uint64(nvout, res->hr_stat_activemap_update, "stat_activemap_update"); + nv_add_uint64(nvout, res->hr_stat_read_error, + "stat_read_error"); + nv_add_uint64(nvout, res->hr_stat_write_error + + res->hr_stat_activemap_write_error, + "stat_write_error"); + nv_add_uint64(nvout, res->hr_stat_delete_error, + "stat_delete_error"); + nv_add_uint64(nvout, res->hr_stat_flush_error + + res->hr_stat_activemap_flush_error, + "stat_flush_error"); nv_add_int16(nvout, 0, "error"); break; case CONTROL_RELOAD: Modified: stable/9/sbin/hastd/hast.h ============================================================================== --- stable/9/sbin/hastd/hast.h Wed Mar 6 06:24:09 2013 (r247865) +++ stable/9/sbin/hastd/hast.h Wed Mar 6 06:57:18 2013 (r247866) @@ -234,6 +234,18 @@ struct hast_resource { uint64_t hr_stat_flush; /* Number of activemap updates. */ uint64_t hr_stat_activemap_update; + /* Number of local read errors. */ + uint64_t hr_stat_read_error; + /* Number of local write errors. */ + uint64_t hr_stat_write_error; + /* Number of local delete errors. */ + uint64_t hr_stat_delete_error; + /* Number of flush errors. */ + uint64_t hr_stat_flush_error; + /* Number of activemap write errors. */ + uint64_t hr_stat_activemap_write_error; + /* Number of activemap flush errors. */ + uint64_t hr_stat_activemap_flush_error; /* Next resource. */ TAILQ_ENTRY(hast_resource) hr_next; Modified: stable/9/sbin/hastd/primary.c ============================================================================== --- stable/9/sbin/hastd/primary.c Wed Mar 6 06:24:09 2013 (r247865) +++ stable/9/sbin/hastd/primary.c Wed Mar 6 06:57:18 2013 (r247866) @@ -303,6 +303,7 @@ hast_activemap_flush(struct hast_resourc if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) != (ssize_t)size) { pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); + res->hr_stat_activemap_write_error++; return (-1); } if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) { @@ -313,6 +314,7 @@ hast_activemap_flush(struct hast_resourc } else { pjdlog_errno(LOG_ERR, "Unable to flush disk cache on activemap update"); + res->hr_stat_activemap_flush_error++; return (-1); } } @@ -1792,6 +1794,22 @@ ggate_send_thread(void *arg) "G_GATE_CMD_DONE failed"); } } + if (hio->hio_errors[0]) { + switch (ggio->gctl_cmd) { + case BIO_READ: + res->hr_stat_read_error++; + break; + case BIO_WRITE: + res->hr_stat_write_error++; + break; + case BIO_DELETE: + res->hr_stat_delete_error++; + break; + case BIO_FLUSH: + res->hr_stat_flush_error++; + break; + } + } pjdlog_debug(2, "ggate_send: (%p) Moving request to the free queue.", hio); QUEUE_INSERT2(hio, free); Modified: stable/9/sbin/hastd/secondary.c ============================================================================== --- stable/9/sbin/hastd/secondary.c Wed Mar 6 06:24:09 2013 (r247865) +++ stable/9/sbin/hastd/secondary.c Wed Mar 6 06:57:18 2013 (r247866) @@ -725,6 +725,7 @@ disk_thread(void *arg) pjdlog_errno(LOG_WARNING, "Unable to store cleared activemap"); free(map); + res->hr_stat_activemap_write_error++; break; } free(map); @@ -839,8 +840,23 @@ send_thread(void *arg) PJDLOG_ABORT("Unexpected command (cmd=%hhu).", hio->hio_cmd); } - if (hio->hio_error != 0) + if (hio->hio_error != 0) { + switch (hio->hio_cmd) { + case HIO_READ: + res->hr_stat_read_error++; + break; + case HIO_WRITE: + res->hr_stat_write_error++; + break; + case HIO_DELETE: + res->hr_stat_delete_error++; + break; + case HIO_FLUSH: + res->hr_stat_flush_error++; + break; + } nv_add_int16(nvout, hio->hio_error, "error"); + } if (hast_proto_send(res, res->hr_remoteout, nvout, data, length) == -1) { secondary_exit(EX_TEMPFAIL, "Unable to send reply"); From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 06:58:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0BD082C7; Wed, 6 Mar 2013 06:58:12 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C17B0666; Wed, 6 Mar 2013 06:58:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r266wB3e008901; Wed, 6 Mar 2013 06:58:11 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r266wB2k008900; Wed, 6 Mar 2013 06:58:11 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201303060658.r266wB2k008900@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 6 Mar 2013 06:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247867 - stable/9/sbin/hastctl 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:58:12 -0000 Author: trociny Date: Wed Mar 6 06:58:11 2013 New Revision: 247867 URL: http://svnweb.freebsd.org/changeset/base/247867 Log: MFC r247281, r247345: r247281: Add i/o error counters to hastd(8) and make hastctl(8) display them. This may be useful for detecting problems with HAST disks. Discussed with and reviewed by: pjd r247345: Fix casting. Modified: stable/9/sbin/hastctl/hastctl.c Directory Properties: stable/9/sbin/hastctl/ (props changed) Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Wed Mar 6 06:57:18 2013 (r247866) +++ stable/9/sbin/hastctl/hastctl.c Wed Mar 6 06:58:11 2013 (r247867) @@ -342,15 +342,21 @@ control_status(struct nv *nv) (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); printf(" statistics:\n"); printf(" reads: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_read%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_read%u", ii)); printf(" writes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_write%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_write%u", ii)); printf(" deletes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_delete%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_delete%u", ii)); printf(" flushes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_flush%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_flush%u", ii)); printf(" activemap updates: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_activemap_update%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_activemap_update%u", ii)); + printf(" local errors: " + "read: %ju, write: %ju, delete: %ju, flush: %ju\n", + (uintmax_t)nv_get_uint64(nv, "stat_read_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_write_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_delete_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_flush_error%u", ii)); } return (ret); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 06:59:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2ADE543E; Wed, 6 Mar 2013 06:59:12 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F16E67E; Wed, 6 Mar 2013 06:59:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r266xBG5009064; Wed, 6 Mar 2013 06:59:11 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r266xBva009060; Wed, 6 Mar 2013 06:59:11 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201303060659.r266xBva009060@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 6 Mar 2013 06:59:11 +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: r247868 - stable/8/sbin/hastd 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:59:12 -0000 Author: trociny Date: Wed Mar 6 06:59:10 2013 New Revision: 247868 URL: http://svnweb.freebsd.org/changeset/base/247868 Log: MFC r247281: Add i/o error counters to hastd(8) and make hastctl(8) display them. This may be useful for detecting problems with HAST disks. Discussed with and reviewed by: pjd Modified: stable/8/sbin/hastd/control.c stable/8/sbin/hastd/hast.h stable/8/sbin/hastd/primary.c stable/8/sbin/hastd/secondary.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/control.c ============================================================================== --- stable/8/sbin/hastd/control.c Wed Mar 6 06:58:11 2013 (r247867) +++ stable/8/sbin/hastd/control.c Wed Mar 6 06:59:10 2013 (r247868) @@ -207,6 +207,14 @@ control_status_worker(struct hast_resour "stat_flush%u", no); nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_activemap_update"), "stat_activemap_update%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_read_error"), + "stat_read_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_write_error"), + "stat_write_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_delete_error"), + "stat_delete_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_flush_error"), + "stat_flush_error%u", no); end: if (cnvin != NULL) nv_free(cnvin); @@ -459,6 +467,16 @@ ctrl_thread(void *arg) nv_add_uint64(nvout, res->hr_stat_flush, "stat_flush"); nv_add_uint64(nvout, res->hr_stat_activemap_update, "stat_activemap_update"); + nv_add_uint64(nvout, res->hr_stat_read_error, + "stat_read_error"); + nv_add_uint64(nvout, res->hr_stat_write_error + + res->hr_stat_activemap_write_error, + "stat_write_error"); + nv_add_uint64(nvout, res->hr_stat_delete_error, + "stat_delete_error"); + nv_add_uint64(nvout, res->hr_stat_flush_error + + res->hr_stat_activemap_flush_error, + "stat_flush_error"); nv_add_int16(nvout, 0, "error"); break; case CONTROL_RELOAD: Modified: stable/8/sbin/hastd/hast.h ============================================================================== --- stable/8/sbin/hastd/hast.h Wed Mar 6 06:58:11 2013 (r247867) +++ stable/8/sbin/hastd/hast.h Wed Mar 6 06:59:10 2013 (r247868) @@ -234,6 +234,18 @@ struct hast_resource { uint64_t hr_stat_flush; /* Number of activemap updates. */ uint64_t hr_stat_activemap_update; + /* Number of local read errors. */ + uint64_t hr_stat_read_error; + /* Number of local write errors. */ + uint64_t hr_stat_write_error; + /* Number of local delete errors. */ + uint64_t hr_stat_delete_error; + /* Number of flush errors. */ + uint64_t hr_stat_flush_error; + /* Number of activemap write errors. */ + uint64_t hr_stat_activemap_write_error; + /* Number of activemap flush errors. */ + uint64_t hr_stat_activemap_flush_error; /* Next resource. */ TAILQ_ENTRY(hast_resource) hr_next; Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Wed Mar 6 06:58:11 2013 (r247867) +++ stable/8/sbin/hastd/primary.c Wed Mar 6 06:59:10 2013 (r247868) @@ -303,6 +303,7 @@ hast_activemap_flush(struct hast_resourc if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) != (ssize_t)size) { pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); + res->hr_stat_activemap_write_error++; return (-1); } if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) { @@ -313,6 +314,7 @@ hast_activemap_flush(struct hast_resourc } else { pjdlog_errno(LOG_ERR, "Unable to flush disk cache on activemap update"); + res->hr_stat_activemap_flush_error++; return (-1); } } @@ -1792,6 +1794,22 @@ ggate_send_thread(void *arg) "G_GATE_CMD_DONE failed"); } } + if (hio->hio_errors[0]) { + switch (ggio->gctl_cmd) { + case BIO_READ: + res->hr_stat_read_error++; + break; + case BIO_WRITE: + res->hr_stat_write_error++; + break; + case BIO_DELETE: + res->hr_stat_delete_error++; + break; + case BIO_FLUSH: + res->hr_stat_flush_error++; + break; + } + } pjdlog_debug(2, "ggate_send: (%p) Moving request to the free queue.", hio); QUEUE_INSERT2(hio, free); Modified: stable/8/sbin/hastd/secondary.c ============================================================================== --- stable/8/sbin/hastd/secondary.c Wed Mar 6 06:58:11 2013 (r247867) +++ stable/8/sbin/hastd/secondary.c Wed Mar 6 06:59:10 2013 (r247868) @@ -725,6 +725,7 @@ disk_thread(void *arg) pjdlog_errno(LOG_WARNING, "Unable to store cleared activemap"); free(map); + res->hr_stat_activemap_write_error++; break; } free(map); @@ -839,8 +840,23 @@ send_thread(void *arg) PJDLOG_ABORT("Unexpected command (cmd=%hhu).", hio->hio_cmd); } - if (hio->hio_error != 0) + if (hio->hio_error != 0) { + switch (hio->hio_cmd) { + case HIO_READ: + res->hr_stat_read_error++; + break; + case HIO_WRITE: + res->hr_stat_write_error++; + break; + case HIO_DELETE: + res->hr_stat_delete_error++; + break; + case HIO_FLUSH: + res->hr_stat_flush_error++; + break; + } nv_add_int16(nvout, hio->hio_error, "error"); + } if (hast_proto_send(res, res->hr_remoteout, nvout, data, length) == -1) { secondary_exit(EX_TEMPFAIL, "Unable to send reply"); From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 06:59:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 74A2A5A6; Wed, 6 Mar 2013 06:59:43 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D377685; Wed, 6 Mar 2013 06:59:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r266xh8n009162; Wed, 6 Mar 2013 06:59:43 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r266xhiC009161; Wed, 6 Mar 2013 06:59:43 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201303060659.r266xhiC009161@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 6 Mar 2013 06:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247869 - stable/8/sbin/hastctl 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 06:59:43 -0000 Author: trociny Date: Wed Mar 6 06:59:42 2013 New Revision: 247869 URL: http://svnweb.freebsd.org/changeset/base/247869 Log: MFC r247281, r247345: r247281: Add i/o error counters to hastd(8) and make hastctl(8) display them. This may be useful for detecting problems with HAST disks. Discussed with and reviewed by: pjd r247345: Fix casting. Modified: stable/8/sbin/hastctl/hastctl.c Directory Properties: stable/8/sbin/hastctl/ (props changed) Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Wed Mar 6 06:59:10 2013 (r247868) +++ stable/8/sbin/hastctl/hastctl.c Wed Mar 6 06:59:42 2013 (r247869) @@ -342,15 +342,21 @@ control_status(struct nv *nv) (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); printf(" statistics:\n"); printf(" reads: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_read%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_read%u", ii)); printf(" writes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_write%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_write%u", ii)); printf(" deletes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_delete%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_delete%u", ii)); printf(" flushes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_flush%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_flush%u", ii)); printf(" activemap updates: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_activemap_update%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_activemap_update%u", ii)); + printf(" local errors: " + "read: %ju, write: %ju, delete: %ju, flush: %ju\n", + (uintmax_t)nv_get_uint64(nv, "stat_read_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_write_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_delete_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_flush_error%u", ii)); } return (ret); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 07:17:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 31DF5A06; Wed, 6 Mar 2013 07:17:55 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1928C70F; Wed, 6 Mar 2013 07:17:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r267HsRf015437; Wed, 6 Mar 2013 07:17:54 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r267Hsl8015433; Wed, 6 Mar 2013 07:17:54 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201303060717.r267Hsl8015433@svn.freebsd.org> From: Bryan Venteicher Date: Wed, 6 Mar 2013 07:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247870 - in head/sys: amd64/conf conf i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 07:17:55 -0000 Author: bryanv Date: Wed Mar 6 07:17:53 2013 New Revision: 247870 URL: http://svnweb.freebsd.org/changeset/base/247870 Log: Remove the virtio dependency entry for the VirtIO device drivers. This will prevent the kernel from linking if the device driver are included without the virtio module. Remove pci and scbus for the same reason. Also explain the relationship and necessity of the virtio and virtio_pci modules. Currently in FreeBSD, we only support VirtIO PCI, but it could be replaced with a different interface (like MMIO) and the device (network, block, etc) will still function. Requested by: luigi Approved by: grehan (mentor) MFC after: 3 days Modified: head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Wed Mar 6 06:59:42 2013 (r247869) +++ head/sys/amd64/conf/NOTES Wed Mar 6 07:17:53 2013 (r247870) @@ -442,6 +442,13 @@ options SAFE_RNDTEST # enable rndtest s # # VirtIO support +# +# The virtio entry provides a generic bus for use by the device drivers. +# It must be combined with an interface that communicates with the host. +# Multiple such interfaces defined by the VirtIO specification. FreeBSD +# only has support for PCI. Therefore, virtio_pci must be statically +# compiled in or loaded as a module for the device drivers to function. +# device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI Interface device vtnet # VirtIO Ethernet device Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Mar 6 06:59:42 2013 (r247869) +++ head/sys/conf/files.amd64 Wed Mar 6 07:17:53 2013 (r247870) @@ -393,11 +393,11 @@ dev/virtio/virtio.c optional virtio dev/virtio/virtqueue.c optional virtio dev/virtio/virtio_bus_if.m optional virtio dev/virtio/virtio_if.m optional virtio -dev/virtio/pci/virtio_pci.c optional virtio_pci virtio pci -dev/virtio/network/if_vtnet.c optional vtnet virtio -dev/virtio/block/virtio_blk.c optional virtio_blk virtio -dev/virtio/balloon/virtio_balloon.c optional virtio_balloon virtio -dev/virtio/scsi/virtio_scsi.c optional virtio_scsi virtio scbus +dev/virtio/pci/virtio_pci.c optional virtio_pci +dev/virtio/network/if_vtnet.c optional vtnet +dev/virtio/block/virtio_blk.c optional virtio_blk +dev/virtio/balloon/virtio_balloon.c optional virtio_balloon +dev/virtio/scsi/virtio_scsi.c optional virtio_scsi isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Mar 6 06:59:42 2013 (r247869) +++ head/sys/conf/files.i386 Wed Mar 6 07:17:53 2013 (r247870) @@ -374,11 +374,11 @@ dev/virtio/virtio.c optional virtio dev/virtio/virtqueue.c optional virtio dev/virtio/virtio_bus_if.m optional virtio dev/virtio/virtio_if.m optional virtio -dev/virtio/pci/virtio_pci.c optional virtio_pci virtio pci -dev/virtio/network/if_vtnet.c optional vtnet virtio -dev/virtio/block/virtio_blk.c optional virtio_blk virtio -dev/virtio/balloon/virtio_balloon.c optional virtio_balloon virtio -dev/virtio/scsi/virtio_scsi.c optional virtio_scsi virtio scbus +dev/virtio/pci/virtio_pci.c optional virtio_pci +dev/virtio/network/if_vtnet.c optional vtnet +dev/virtio/block/virtio_blk.c optional virtio_blk +dev/virtio/balloon/virtio_balloon.c optional virtio_balloon +dev/virtio/scsi/virtio_scsi.c optional virtio_scsi i386/acpica/acpi_machdep.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S assym.s" \ Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Mar 6 06:59:42 2013 (r247869) +++ head/sys/i386/conf/NOTES Wed Mar 6 07:17:53 2013 (r247870) @@ -773,6 +773,13 @@ device glxsb # AMD Geode LX Security B # # VirtIO support +# +# The virtio entry provides a generic bus for use by the device drivers. +# It must be combined with an interface that communicates with the host. +# Multiple such interfaces defined by the VirtIO specification. FreeBSD +# only has support for PCI. Therefore, virtio_pci must be statically +# compiled in or loaded as a module for the device drivers to function. +# device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI Interface device vtnet # VirtIO Ethernet device From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 07:28:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ED2A5D8D; Wed, 6 Mar 2013 07:28:20 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C74A1785; Wed, 6 Mar 2013 07:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r267SK7E018483; Wed, 6 Mar 2013 07:28:20 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r267SKP3018477; Wed, 6 Mar 2013 07:28:20 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201303060728.r267SKP3018477@svn.freebsd.org> From: Peter Grehan Date: Wed, 6 Mar 2013 07:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247871 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 07:28:21 -0000 Author: grehan Date: Wed Mar 6 07:28:20 2013 New Revision: 247871 URL: http://svnweb.freebsd.org/changeset/base/247871 Log: Simplify virtio ring num-available calculation. Submitted by: Chris Torek, torek at torek dot net Modified: head/usr.sbin/bhyve/pci_virtio_block.c head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Wed Mar 6 07:17:53 2013 (r247870) +++ head/usr.sbin/bhyve/pci_virtio_block.c Wed Mar 6 07:28:20 2013 (r247871) @@ -164,14 +164,19 @@ pci_vtblk_iosize(struct pci_devinst *pi) static int hq_num_avail(struct vring_hqueue *hq) { - int ndesc; + uint16_t ndesc; - if (*hq->hq_avail_idx >= hq->hq_cur_aidx) - ndesc = *hq->hq_avail_idx - hq->hq_cur_aidx; - else - ndesc = UINT16_MAX - hq->hq_cur_aidx + *hq->hq_avail_idx + 1; + /* + * We're just computing (a-b) in GF(216). + * + * The only glitch here is that in standard C, + * uint16_t promotes to (signed) int when int has + * more than 16 bits (pretty much always now), so + * we have to force it back to unsigned. + */ + ndesc = (unsigned)*hq->hq_avail_idx - (unsigned)hq->hq_cur_aidx; - assert(ndesc >= 0 && ndesc <= hq->hq_size); + assert(ndesc <= hq->hq_size); return (ndesc); } Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Wed Mar 6 07:17:53 2013 (r247870) +++ head/usr.sbin/bhyve/pci_virtio_net.c Wed Mar 6 07:28:20 2013 (r247871) @@ -172,12 +172,17 @@ hq_num_avail(struct vring_hqueue *hq) { int ndesc; - if (*hq->hq_avail_idx >= hq->hq_cur_aidx) - ndesc = *hq->hq_avail_idx - hq->hq_cur_aidx; - else - ndesc = UINT16_MAX - hq->hq_cur_aidx + *hq->hq_avail_idx + 1; + /* + * We're just computing (a-b) in GF(216). + * + * The only glitch here is that in standard C, + * uint16_t promotes to (signed) int when int has + * more than 16 bits (pretty much always now), so + * we have to force it back to unsigned. + */ + ndesc = (unsigned)*hq->hq_avail_idx - (unsigned)hq->hq_cur_aidx; - assert(ndesc >= 0 && ndesc <= hq->hq_size); + assert(ndesc <= hq->hq_size); return (ndesc); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 08:03:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 51F47545; Wed, 6 Mar 2013 08:03:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 445E48D8; Wed, 6 Mar 2013 08:03:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2683R3F029661; Wed, 6 Mar 2013 08:03:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2683RC0029658; Wed, 6 Mar 2013 08:03:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201303060803.r2683RC0029658@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Mar 2013 08:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247872 - stable/9/sys/dev/msk 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 08:03:27 -0000 Author: yongari Date: Wed Mar 6 08:03:26 2013 New Revision: 247872 URL: http://svnweb.freebsd.org/changeset/base/247872 Log: MFC r247382: RX checksum offloading on old Yukon controllers seem to cause more problems. Disable RX checksum offloading on controllers that don't use new descriptor format but give chance to enable it with ifconfig(8). Modified: stable/9/sys/dev/msk/if_msk.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/msk/if_msk.c ============================================================================== --- stable/9/sys/dev/msk/if_msk.c Wed Mar 6 07:28:20 2013 (r247871) +++ stable/9/sys/dev/msk/if_msk.c Wed Mar 6 08:03:26 2013 (r247872) @@ -1696,6 +1696,12 @@ msk_attach(device_t dev) ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } ifp->if_capenable = ifp->if_capabilities; + /* + * Disable RX checksum offloading on controllers that don't use + * new descriptor format but give chance to enable it. + */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0) + ifp->if_capenable &= ~IFCAP_RXCSUM; /* * Tell the upper layer(s) we support long frames. From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 08:04:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1A80C6BE; Wed, 6 Mar 2013 08:04:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0874C8E7; Wed, 6 Mar 2013 08:04:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2684iQV029932; Wed, 6 Mar 2013 08:04:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2684ill029930; Wed, 6 Mar 2013 08:04:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201303060804.r2684ill029930@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Mar 2013 08:04:44 +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: r247873 - stable/8/sys/dev/msk 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 08:04:45 -0000 Author: yongari Date: Wed Mar 6 08:04:44 2013 New Revision: 247873 URL: http://svnweb.freebsd.org/changeset/base/247873 Log: MFC r247382: RX checksum offloading on old Yukon controllers seem to cause more problems. Disable RX checksum offloading on controllers that don't use new descriptor format but give chance to enable it with ifconfig(8). Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/msk/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Wed Mar 6 08:03:26 2013 (r247872) +++ stable/8/sys/dev/msk/if_msk.c Wed Mar 6 08:04:44 2013 (r247873) @@ -1696,6 +1696,12 @@ msk_attach(device_t dev) ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } ifp->if_capenable = ifp->if_capabilities; + /* + * Disable RX checksum offloading on controllers that don't use + * new descriptor format but give chance to enable it. + */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0) + ifp->if_capenable &= ~IFCAP_RXCSUM; /* * Tell the upper layer(s) we support long frames. From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 09:12:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9969719; Wed, 6 Mar 2013 09:12:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ADC5ABEF; Wed, 6 Mar 2013 09:12:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r269Cd6s051097; Wed, 6 Mar 2013 09:12:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r269CcaU051092; Wed, 6 Mar 2013 09:12:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303060912.r269CcaU051092@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 09:12:38 +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: r247874 - in stable/9/sys: conf kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:12:39 -0000 Author: avg Date: Wed Mar 6 09:12:38 2013 New Revision: 247874 URL: http://svnweb.freebsd.org/changeset/base/247874 Log: MFC r246246,246254: print compiler version in the kernel banner Modified: stable/9/sys/conf/newvers.sh stable/9/sys/kern/init_main.c stable/9/sys/kern/kern_mib.c stable/9/sys/sys/systm.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/newvers.sh ============================================================================== --- stable/9/sys/conf/newvers.sh Wed Mar 6 08:04:44 2013 (r247873) +++ stable/9/sys/conf/newvers.sh Wed Mar 6 09:12:38 2013 (r247874) @@ -86,6 +86,7 @@ fi touch version v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` +compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version') for dir in /bin /usr/bin /usr/local/bin; do if [ -x "${dir}/svnversion" ] ; then @@ -141,6 +142,7 @@ $COPYRIGHT char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; +char compiler_version[] = "${compiler_v}"; char ostype[] = "${TYPE}"; char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; int osreldate = ${RELDATE}; Modified: stable/9/sys/kern/init_main.c ============================================================================== --- stable/9/sys/kern/init_main.c Wed Mar 6 08:04:44 2013 (r247873) +++ stable/9/sys/kern/init_main.c Wed Mar 6 09:12:38 2013 (r247874) @@ -325,6 +325,7 @@ print_version(void *data __unused) while (len > 0 && version[len - 1] == '\n') len--; printf("%.*s %s\n", len, version, machine); + printf("%s\n", compiler_version); } SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, Modified: stable/9/sys/kern/kern_mib.c ============================================================================== --- stable/9/sys/kern/kern_mib.c Wed Mar 6 08:04:44 2013 (r247873) +++ stable/9/sys/kern/kern_mib.c Wed Mar 6 09:12:38 2013 (r247874) @@ -99,6 +99,9 @@ SYSCTL_INT(_kern, KERN_OSREV, osrevision SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE, version, 0, "Kernel version"); +SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE, + compiler_version, 0, "Version of compiler used to compile kernel"); + SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE| CTLFLAG_CAPRD, ostype, 0, "Operating system type"); Modified: stable/9/sys/sys/systm.h ============================================================================== --- stable/9/sys/sys/systm.h Wed Mar 6 08:04:44 2013 (r247873) +++ stable/9/sys/sys/systm.h Wed Mar 6 09:12:38 2013 (r247874) @@ -49,6 +49,7 @@ extern int cold; /* nonzero if we are d extern int rebooting; /* kern_reboot() has been called. */ extern const char *panicstr; /* panic message */ extern char version[]; /* system version */ +extern char compiler_version[]; /* compiler version */ extern char copyright[]; /* system copyright */ extern int kstack_pages; /* number of kernel stack pages */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 09:16:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 78E65A6F; Wed, 6 Mar 2013 09:16:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D05BC39; Wed, 6 Mar 2013 09:16:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r269G2dD051664; Wed, 6 Mar 2013 09:16:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r269G1Ri051656; Wed, 6 Mar 2013 09:16:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303060916.r269G1Ri051656@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 09:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247875 - in stable/8/sys: conf kern sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:16:02 -0000 Author: avg Date: Wed Mar 6 09:16:01 2013 New Revision: 247875 URL: http://svnweb.freebsd.org/changeset/base/247875 Log: MFC r246246,246254: print compiler version in the kernel banner Modified: stable/8/sys/conf/newvers.sh stable/8/sys/kern/init_main.c stable/8/sys/kern/kern_mib.c stable/8/sys/sys/systm.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/conf/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/conf/newvers.sh ============================================================================== --- stable/8/sys/conf/newvers.sh Wed Mar 6 09:12:38 2013 (r247874) +++ stable/8/sys/conf/newvers.sh Wed Mar 6 09:16:01 2013 (r247875) @@ -86,6 +86,7 @@ fi touch version v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` +compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version') for dir in /bin /usr/bin /usr/local/bin; do if [ -x "${dir}/svnversion" ] ; then @@ -141,6 +142,7 @@ $COPYRIGHT char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; +char compiler_version[] = "${compiler_v}"; char ostype[] = "${TYPE}"; char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; int osreldate = ${RELDATE}; Modified: stable/8/sys/kern/init_main.c ============================================================================== --- stable/8/sys/kern/init_main.c Wed Mar 6 09:12:38 2013 (r247874) +++ stable/8/sys/kern/init_main.c Wed Mar 6 09:16:01 2013 (r247875) @@ -302,6 +302,7 @@ print_version(void *data __unused) while (len > 0 && version[len - 1] == '\n') len--; printf("%.*s %s\n", len, version, machine); + printf("%s\n", compiler_version); } SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, Modified: stable/8/sys/kern/kern_mib.c ============================================================================== --- stable/8/sys/kern/kern_mib.c Wed Mar 6 09:12:38 2013 (r247874) +++ stable/8/sys/kern/kern_mib.c Wed Mar 6 09:16:01 2013 (r247875) @@ -99,6 +99,9 @@ SYSCTL_INT(_kern, KERN_OSREV, osrevision SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE, version, 0, "Kernel version"); +SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE, + compiler_version, 0, "Version of compiler used to compile kernel"); + SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE, ostype, 0, "Operating system type"); Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Wed Mar 6 09:12:38 2013 (r247874) +++ stable/8/sys/sys/systm.h Wed Mar 6 09:16:01 2013 (r247875) @@ -49,6 +49,7 @@ extern int cold; /* nonzero if we are d extern int rebooting; /* boot() has been called. */ extern const char *panicstr; /* panic message */ extern char version[]; /* system version */ +extern char compiler_version[]; /* compiler version */ extern char copyright[]; /* system copyright */ extern int kstack_pages; /* number of kernel stack pages */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 09:22:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4994D23; Wed, 6 Mar 2013 09:22:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5A54CEC; Wed, 6 Mar 2013 09:22:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r269MBWU054138; Wed, 6 Mar 2013 09:22:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r269MAFr054133; Wed, 6 Mar 2013 09:22:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303060922.r269MAFr054133@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 09:22:10 +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: r247876 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/x86 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:22:11 -0000 Author: avg Date: Wed Mar 6 09:22:10 2013 New Revision: 247876 URL: http://svnweb.freebsd.org/changeset/base/247876 Log: MFC r246247: x86 suspend/resume: suspend pics and pseudo-pics in reverse order Modified: stable/8/sys/amd64/amd64/intr_machdep.c (contents, props changed) stable/8/sys/amd64/include/intr_machdep.h stable/8/sys/i386/i386/intr_machdep.c (contents, props changed) stable/8/sys/i386/include/intr_machdep.h stable/8/sys/x86/x86/local_apic.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/i386/ (props changed) stable/8/sys/x86/ (props changed) Modified: stable/8/sys/amd64/amd64/intr_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/intr_machdep.c Wed Mar 6 09:16:01 2013 (r247875) +++ stable/8/sys/amd64/amd64/intr_machdep.c Wed Mar 6 09:22:10 2013 (r247876) @@ -74,7 +74,7 @@ static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; static struct mtx intr_table_lock; static struct mtx intrcnt_lock; -static STAILQ_HEAD(, pic) pics; +static TAILQ_HEAD(pics_head, pic) pics; #ifdef SMP static int assign_cpu; @@ -93,7 +93,7 @@ intr_pic_registered(struct pic *pic) { struct pic *p; - STAILQ_FOREACH(p, &pics, pics) { + TAILQ_FOREACH(p, &pics, pics) { if (p == pic) return (1); } @@ -115,7 +115,7 @@ intr_register_pic(struct pic *pic) if (intr_pic_registered(pic)) error = EBUSY; else { - STAILQ_INSERT_TAIL(&pics, pic, pics); + TAILQ_INSERT_TAIL(&pics, pic, pics); error = 0; } mtx_unlock(&intr_table_lock); @@ -278,7 +278,7 @@ intr_resume(void) atpic_reset(); #endif mtx_lock(&intr_table_lock); - STAILQ_FOREACH(pic, &pics, pics) { + TAILQ_FOREACH(pic, &pics, pics) { if (pic->pic_resume != NULL) pic->pic_resume(pic); } @@ -291,7 +291,7 @@ intr_suspend(void) struct pic *pic; mtx_lock(&intr_table_lock); - STAILQ_FOREACH(pic, &pics, pics) { + TAILQ_FOREACH_REVERSE(pic, &pics, pics_head, pics) { if (pic->pic_suspend != NULL) pic->pic_suspend(pic); } @@ -372,7 +372,7 @@ intr_init(void *dummy __unused) intrcnt_setname("???", 0); intrcnt_index = 1; - STAILQ_INIT(&pics); + TAILQ_INIT(&pics); mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF); mtx_init(&intrcnt_lock, "intrcnt", NULL, MTX_SPIN); } Modified: stable/8/sys/amd64/include/intr_machdep.h ============================================================================== --- stable/8/sys/amd64/include/intr_machdep.h Wed Mar 6 09:16:01 2013 (r247875) +++ stable/8/sys/amd64/include/intr_machdep.h Wed Mar 6 09:22:10 2013 (r247876) @@ -94,7 +94,7 @@ struct pic { int (*pic_config_intr)(struct intsrc *, enum intr_trigger, enum intr_polarity); int (*pic_assign_cpu)(struct intsrc *, u_int apic_id); - STAILQ_ENTRY(pic) pics; + TAILQ_ENTRY(pic) pics; }; /* Flags for pic_disable_source() */ Modified: stable/8/sys/i386/i386/intr_machdep.c ============================================================================== --- stable/8/sys/i386/i386/intr_machdep.c Wed Mar 6 09:16:01 2013 (r247875) +++ stable/8/sys/i386/i386/intr_machdep.c Wed Mar 6 09:22:10 2013 (r247876) @@ -65,7 +65,7 @@ static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; static struct mtx intr_table_lock; static struct mtx intrcnt_lock; -static STAILQ_HEAD(, pic) pics; +static TAILQ_HEAD(pics_head, pic) pics; #ifdef SMP static int assign_cpu; @@ -84,7 +84,7 @@ intr_pic_registered(struct pic *pic) { struct pic *p; - STAILQ_FOREACH(p, &pics, pics) { + TAILQ_FOREACH(p, &pics, pics) { if (p == pic) return (1); } @@ -106,7 +106,7 @@ intr_register_pic(struct pic *pic) if (intr_pic_registered(pic)) error = EBUSY; else { - STAILQ_INSERT_TAIL(&pics, pic, pics); + TAILQ_INSERT_TAIL(&pics, pic, pics); error = 0; } mtx_unlock(&intr_table_lock); @@ -266,7 +266,7 @@ intr_resume(void) struct pic *pic; mtx_lock(&intr_table_lock); - STAILQ_FOREACH(pic, &pics, pics) { + TAILQ_FOREACH(pic, &pics, pics) { if (pic->pic_resume != NULL) pic->pic_resume(pic); } @@ -279,7 +279,7 @@ intr_suspend(void) struct pic *pic; mtx_lock(&intr_table_lock); - STAILQ_FOREACH(pic, &pics, pics) { + TAILQ_FOREACH_REVERSE(pic, &pics, pics_head, pics) { if (pic->pic_suspend != NULL) pic->pic_suspend(pic); } @@ -360,7 +360,7 @@ intr_init(void *dummy __unused) intrcnt_setname("???", 0); intrcnt_index = 1; - STAILQ_INIT(&pics); + TAILQ_INIT(&pics); mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF); mtx_init(&intrcnt_lock, "intrcnt", NULL, MTX_SPIN); } Modified: stable/8/sys/i386/include/intr_machdep.h ============================================================================== --- stable/8/sys/i386/include/intr_machdep.h Wed Mar 6 09:16:01 2013 (r247875) +++ stable/8/sys/i386/include/intr_machdep.h Wed Mar 6 09:22:10 2013 (r247876) @@ -94,7 +94,7 @@ struct pic { int (*pic_config_intr)(struct intsrc *, enum intr_trigger, enum intr_polarity); int (*pic_assign_cpu)(struct intsrc *, u_int apic_id); - STAILQ_ENTRY(pic) pics; + TAILQ_ENTRY(pic) pics; }; /* Flags for pic_disable_source() */ Modified: stable/8/sys/x86/x86/local_apic.c ============================================================================== --- stable/8/sys/x86/x86/local_apic.c Wed Mar 6 09:16:01 2013 (r247875) +++ stable/8/sys/x86/x86/local_apic.c Wed Mar 6 09:22:10 2013 (r247876) @@ -1366,11 +1366,19 @@ apic_setup_io(void *dummy __unused) if (best_enum == NULL) return; + + /* + * Local APIC must be registered before other PICs and pseudo PICs + * for proper suspend/resume order. + */ +#ifndef XEN + intr_register_pic(&lapic_pic); +#endif + retval = best_enum->apic_setup_io(); if (retval != 0) printf("%s: Failed to setup I/O APICs: returned %d\n", best_enum->apic_name, retval); - #ifdef XEN return; #endif @@ -1379,7 +1387,6 @@ apic_setup_io(void *dummy __unused) * properly program the LINT pins. */ lapic_setup(1); - intr_register_pic(&lapic_pic); if (bootverbose) lapic_dump("BSP"); From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 09:22:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9C3FE92; Wed, 6 Mar 2013 09:22:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D0B9ACF8; Wed, 6 Mar 2013 09:22:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r269Mk6L054247; Wed, 6 Mar 2013 09:22:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r269Mk6x054243; Wed, 6 Mar 2013 09:22:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303060922.r269Mk6x054243@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 09:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247877 - in stable/9/sys: amd64/include i386/include 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:22:47 -0000 Author: avg Date: Wed Mar 6 09:22:45 2013 New Revision: 247877 URL: http://svnweb.freebsd.org/changeset/base/247877 Log: MFC r246247: x86 suspend/resume: suspend pics and pseudo-pics in reverse order Modified: stable/9/sys/amd64/include/intr_machdep.h stable/9/sys/i386/include/intr_machdep.h stable/9/sys/x86/x86/intr_machdep.c stable/9/sys/x86/x86/local_apic.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/intr_machdep.h ============================================================================== --- stable/9/sys/amd64/include/intr_machdep.h Wed Mar 6 09:22:10 2013 (r247876) +++ stable/9/sys/amd64/include/intr_machdep.h Wed Mar 6 09:22:45 2013 (r247877) @@ -94,7 +94,7 @@ struct pic { int (*pic_config_intr)(struct intsrc *, enum intr_trigger, enum intr_polarity); int (*pic_assign_cpu)(struct intsrc *, u_int apic_id); - STAILQ_ENTRY(pic) pics; + TAILQ_ENTRY(pic) pics; }; /* Flags for pic_disable_source() */ Modified: stable/9/sys/i386/include/intr_machdep.h ============================================================================== --- stable/9/sys/i386/include/intr_machdep.h Wed Mar 6 09:22:10 2013 (r247876) +++ stable/9/sys/i386/include/intr_machdep.h Wed Mar 6 09:22:45 2013 (r247877) @@ -94,7 +94,7 @@ struct pic { int (*pic_config_intr)(struct intsrc *, enum intr_trigger, enum intr_polarity); int (*pic_assign_cpu)(struct intsrc *, u_int apic_id); - STAILQ_ENTRY(pic) pics; + TAILQ_ENTRY(pic) pics; }; /* Flags for pic_disable_source() */ Modified: stable/9/sys/x86/x86/intr_machdep.c ============================================================================== --- stable/9/sys/x86/x86/intr_machdep.c Wed Mar 6 09:22:10 2013 (r247876) +++ stable/9/sys/x86/x86/intr_machdep.c Wed Mar 6 09:22:45 2013 (r247877) @@ -78,7 +78,7 @@ static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; static struct mtx intr_table_lock; static struct mtx intrcnt_lock; -static STAILQ_HEAD(, pic) pics; +static TAILQ_HEAD(pics_head, pic) pics; #ifdef SMP static int assign_cpu; @@ -102,7 +102,7 @@ intr_pic_registered(struct pic *pic) { struct pic *p; - STAILQ_FOREACH(p, &pics, pics) { + TAILQ_FOREACH(p, &pics, pics) { if (p == pic) return (1); } @@ -124,7 +124,7 @@ intr_register_pic(struct pic *pic) if (intr_pic_registered(pic)) error = EBUSY; else { - STAILQ_INSERT_TAIL(&pics, pic, pics); + TAILQ_INSERT_TAIL(&pics, pic, pics); error = 0; } mtx_unlock(&intr_table_lock); @@ -287,7 +287,7 @@ intr_resume(void) atpic_reset(); #endif mtx_lock(&intr_table_lock); - STAILQ_FOREACH(pic, &pics, pics) { + TAILQ_FOREACH(pic, &pics, pics) { if (pic->pic_resume != NULL) pic->pic_resume(pic); } @@ -300,7 +300,7 @@ intr_suspend(void) struct pic *pic; mtx_lock(&intr_table_lock); - STAILQ_FOREACH(pic, &pics, pics) { + TAILQ_FOREACH_REVERSE(pic, &pics, pics_head, pics) { if (pic->pic_suspend != NULL) pic->pic_suspend(pic); } @@ -381,7 +381,7 @@ intr_init(void *dummy __unused) intrcnt_setname("???", 0); intrcnt_index = 1; - STAILQ_INIT(&pics); + TAILQ_INIT(&pics); mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF); mtx_init(&intrcnt_lock, "intrcnt", NULL, MTX_SPIN); } Modified: stable/9/sys/x86/x86/local_apic.c ============================================================================== --- stable/9/sys/x86/x86/local_apic.c Wed Mar 6 09:22:10 2013 (r247876) +++ stable/9/sys/x86/x86/local_apic.c Wed Mar 6 09:22:45 2013 (r247877) @@ -1346,11 +1346,19 @@ apic_setup_io(void *dummy __unused) if (best_enum == NULL) return; + + /* + * Local APIC must be registered before other PICs and pseudo PICs + * for proper suspend/resume order. + */ +#ifndef XEN + intr_register_pic(&lapic_pic); +#endif + retval = best_enum->apic_setup_io(); if (retval != 0) printf("%s: Failed to setup I/O APICs: returned %d\n", best_enum->apic_name, retval); - #ifdef XEN return; #endif @@ -1359,7 +1367,6 @@ apic_setup_io(void *dummy __unused) * properly program the LINT pins. */ lapic_setup(1); - intr_register_pic(&lapic_pic); if (bootverbose) lapic_dump("BSP"); From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 09:33:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB8E11AE; Wed, 6 Mar 2013 09:33:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96158D61; Wed, 6 Mar 2013 09:33:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r269X5JG057247; Wed, 6 Mar 2013 09:33:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r269X5Xo057245; Wed, 6 Mar 2013 09:33:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303060933.r269X5Xo057245@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 09:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247878 - in stable/9/sys: amd64/amd64 i386/i386 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:33:05 -0000 Author: avg Date: Wed Mar 6 09:33:04 2013 New Revision: 247878 URL: http://svnweb.freebsd.org/changeset/base/247878 Log: MFC r246248: cpususpend_handler: mark AP as resumed only after fully setting up lapic Modified: stable/9/sys/amd64/amd64/mp_machdep.c stable/9/sys/i386/i386/mp_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/mp_machdep.c Wed Mar 6 09:22:45 2013 (r247877) +++ stable/9/sys/amd64/amd64/mp_machdep.c Wed Mar 6 09:33:04 2013 (r247878) @@ -1430,12 +1430,12 @@ cpususpend_handler(void) while (!CPU_ISSET(cpu, &started_cpus)) ia32_pause(); - CPU_CLR_ATOMIC(cpu, &started_cpus); - CPU_CLR_ATOMIC(cpu, &stopped_cpus); - /* Resume MCA and local APIC */ mca_resume(); lapic_setup(0); + + CPU_CLR_ATOMIC(cpu, &started_cpus); + CPU_CLR_ATOMIC(cpu, &stopped_cpus); } /* Modified: stable/9/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/9/sys/i386/i386/mp_machdep.c Wed Mar 6 09:22:45 2013 (r247877) +++ stable/9/sys/i386/i386/mp_machdep.c Wed Mar 6 09:33:04 2013 (r247878) @@ -1533,12 +1533,12 @@ cpususpend_handler(void) while (!CPU_ISSET(cpu, &started_cpus)) ia32_pause(); - CPU_CLR_ATOMIC(cpu, &started_cpus); - CPU_CLR_ATOMIC(cpu, &stopped_cpus); - /* Resume MCA and local APIC */ mca_resume(); lapic_setup(0); + + CPU_CLR_ATOMIC(cpu, &started_cpus); + CPU_CLR_ATOMIC(cpu, &stopped_cpus); } /* * This is called once the rest of the system is up and running and we're From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 09:33:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 838712CB; Wed, 6 Mar 2013 09:33:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 769ACD64; Wed, 6 Mar 2013 09:33:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r269XH8v057308; Wed, 6 Mar 2013 09:33:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r269XHnE057307; Wed, 6 Mar 2013 09:33:17 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303060933.r269XHnE057307@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 09:33:17 +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: r247879 - stable/8/sys/amd64/amd64 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:33:17 -0000 Author: avg Date: Wed Mar 6 09:33:16 2013 New Revision: 247879 URL: http://svnweb.freebsd.org/changeset/base/247879 Log: MFC r246248: cpususpend_handler: mark AP as resumed only after fully setting up lapic Modified: stable/8/sys/amd64/amd64/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) Modified: stable/8/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/mp_machdep.c Wed Mar 6 09:33:04 2013 (r247878) +++ stable/8/sys/amd64/amd64/mp_machdep.c Wed Mar 6 09:33:16 2013 (r247879) @@ -1365,13 +1365,14 @@ cpususpend_handler(void) while (!(started_cpus & cpumask)) ia32_pause(); - atomic_clear_int(&started_cpus, cpumask); - atomic_clear_int(&stopped_cpus, cpumask); - /* Restore CR3 and enable interrupts */ load_cr3(cr3); mca_resume(); lapic_setup(0); + + atomic_clear_int(&started_cpus, cpumask); + atomic_clear_int(&stopped_cpus, cpumask); + intr_restore(rf); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 09:53:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 699F791F; Wed, 6 Mar 2013 09:53:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5C3DBE0D; Wed, 6 Mar 2013 09:53:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r269rdmS063293; Wed, 6 Mar 2013 09:53:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r269rcsF063284; Wed, 6 Mar 2013 09:53:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303060953.r269rcsF063284@svn.freebsd.org> From: Xin LI Date: Wed, 6 Mar 2013 09:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247880 - head/sys/dev/oce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 09:53:39 -0000 Author: delphij Date: Wed Mar 6 09:53:38 2013 New Revision: 247880 URL: http://svnweb.freebsd.org/changeset/base/247880 Log: Update driver to version 4.6.95.0. Submitted by: "Duvvuru,Venkat Kumar" MFC after: 3 days Modified: head/sys/dev/oce/oce_hw.c head/sys/dev/oce/oce_hw.h head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/oce/oce_mbox.c head/sys/dev/oce/oce_queue.c head/sys/dev/oce/oce_sysctl.c head/sys/dev/oce/oce_util.c Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Wed Mar 6 09:33:16 2013 (r247879) +++ head/sys/dev/oce/oce_hw.c Wed Mar 6 09:53:38 2013 (r247880) @@ -405,11 +405,6 @@ oce_create_nw_interface(POCE_SOFTC sc) sc->if_cap_flags = capab_en_flags; - /* Enable VLAN Promisc on HW */ - rc = oce_config_vlan(sc, (uint8_t) sc->if_id, NULL, 0, 1, 1); - if (rc) - goto error; - /* set default flow control */ rc = oce_set_flow_control(sc, sc->flow_control); if (rc) @@ -477,12 +472,9 @@ oce_hw_start(POCE_SOFTC sc) return 1; if (link.logical_link_status == NTWK_LOGICAL_LINK_UP) { - sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; sc->link_status = NTWK_LOGICAL_LINK_UP; if_link_state_change(sc->ifp, LINK_STATE_UP); } else { - sc->ifp->if_drv_flags &= - ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->link_status = NTWK_LOGICAL_LINK_DOWN; if_link_state_change(sc->ifp, LINK_STATE_DOWN); } Modified: head/sys/dev/oce/oce_hw.h ============================================================================== --- head/sys/dev/oce/oce_hw.h Wed Mar 6 09:33:16 2013 (r247879) +++ head/sys/dev/oce/oce_hw.h Wed Mar 6 09:53:38 2013 (r247880) @@ -38,6 +38,8 @@ /* $FreeBSD$ */ +/* $FreeBSD$ */ + #include #undef _BIG_ENDIAN /* TODO */ @@ -155,7 +157,10 @@ #define ASYNC_EVENT_LINK_UP 0x1 #define ASYNC_EVENT_LINK_DOWN 0x0 #define ASYNC_EVENT_GRP5 0x5 +#define ASYNC_EVENT_CODE_DEBUG 0x6 #define ASYNC_EVENT_PVID_STATE 0x3 +#define ASYNC_EVENT_DEBUG_QNQ 0x1 +#define ASYNC_EVENT_CODE_SLIPORT 0x11 #define VLAN_VID_MASK 0x0FFF /* port link_status */ @@ -707,6 +712,17 @@ struct oce_async_event_grp5_pvid_state { uint32_t code; }; +/* async event indicating outer VLAN tag in QnQ */ +struct oce_async_event_qnq { + uint8_t valid; /* Indicates if outer VLAN is valid */ + uint8_t rsvd0; + uint16_t vlan_tag; + uint32_t event_tag; + uint8_t rsvd1[4]; + uint32_t code; +} ; + + typedef union oce_mq_ext_ctx_u { uint32_t dw[6]; struct { @@ -750,6 +766,44 @@ typedef union oce_mq_ext_ctx_u { /* dw5 */ uint32_t dw8rsvd1; } v0; + struct { + #ifdef _BIG_ENDIAN + /* dw0 */ + uint32_t cq_id:16; + uint32_t num_pages:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t dw5rsvd2:12; + uint32_t ring_size:4; + uint32_t async_cq_id:16; + /* dw3 */ + uint32_t valid:1; + uint32_t dw6rsvd1:31; + /* dw4 */ + uint32_t dw7rsvd1:31; + uint32_t async_cq_valid:1; + #else + /* dw0 */ + uint32_t num_pages:16; + uint32_t cq_id:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t async_cq_id:16; + uint32_t ring_size:4; + uint32_t dw5rsvd2:12; + /* dw3 */ + uint32_t dw6rsvd1:31; + uint32_t valid:1; + /* dw4 */ + uint32_t async_cq_valid:1; + uint32_t dw7rsvd1:31; + #endif + /* dw5 */ + uint32_t dw8rsvd1; + } v1; + } oce_mq_ext_ctx_t; @@ -826,6 +880,7 @@ enum COMMON_SUBSYSTEM_OPCODES { OPCODE_COMMON_SET_BEACON_CONFIG = 69, OPCODE_COMMON_GET_BEACON_CONFIG = 70, OPCODE_COMMON_GET_PHYSICAL_LINK_CONFIG = 71, + OPCODE_COMMON_READ_TRANSRECEIVER_DATA = 73, OPCODE_COMMON_GET_OEM_ATTRIBUTES = 76, OPCODE_COMMON_GET_PORT_NAME = 77, OPCODE_COMMON_GET_CONFIG_SIGNATURE = 78, @@ -1724,6 +1779,12 @@ struct mbx_set_common_iface_rx_filter { } params; }; +struct be_set_eqd { + uint32_t eq_id; + uint32_t phase; + uint32_t dm; +}; + /* [41] OPCODE_COMMON_MODIFY_EQ_DELAY */ struct mbx_modify_common_eq_delay { struct mbx_hdr hdr; @@ -1743,6 +1804,76 @@ struct mbx_modify_common_eq_delay { } params; }; +/* [32] OPCODE_COMMON_GET_CNTL_ATTRIBUTES */ + +struct mgmt_hba_attr { + int8_t flashrom_ver_str[32]; + int8_t manufac_name[32]; + uint32_t supp_modes; + int8_t seeprom_ver_lo; + int8_t seeprom_ver_hi; + int8_t rsvd0[2]; + uint32_t ioctl_data_struct_ver; + uint32_t ep_fw_data_struct_ver; + uint8_t ncsi_ver_str[12]; + uint32_t def_ext_to; + int8_t cntl_mod_num[32]; + int8_t cntl_desc[64]; + int8_t cntl_ser_num[32]; + int8_t ip_ver_str[32]; + int8_t fw_ver_str[32]; + int8_t bios_ver_str[32]; + int8_t redboot_ver_str[32]; + int8_t drv_ver_str[32]; + int8_t fw_on_flash_ver_str[32]; + uint32_t funcs_supp; + uint16_t max_cdblen; + uint8_t asic_rev; + uint8_t gen_guid[16]; + uint8_t hba_port_count; + uint16_t default_link_down_timeout; + uint8_t iscsi_ver_min_max; + uint8_t multifunc_dev; + uint8_t cache_valid; + uint8_t hba_status; + uint8_t max_domains_supp; + uint8_t phy_port; + uint32_t fw_post_status; + uint32_t hba_mtu[8]; + uint8_t iSCSI_feat; + uint8_t asic_gen; + uint8_t future_u8[2]; + uint32_t future_u32[3]; +}; + +struct mgmt_cntl_attr { + struct mgmt_hba_attr hba_attr; + uint16_t pci_vendor_id; + uint16_t pci_device_id; + uint16_t pci_sub_vendor_id; + uint16_t pci_sub_system_id; + uint8_t pci_bus_num; + uint8_t pci_dev_num; + uint8_t pci_func_num; + uint8_t interface_type; + uint64_t unique_id; + uint8_t netfilters; + uint8_t rsvd0[3]; + uint32_t future_u32[4]; +}; + +struct mbx_common_get_cntl_attr { + struct mbx_hdr hdr; + union { + struct { + uint32_t rsvd0; + } req; + struct { + struct mgmt_cntl_attr cntl_attr_info; + } rsp; + } params; +}; + /* [59] OPCODE_ADD_COMMON_IFACE_MAC */ struct mbx_add_common_iface_mac { struct mbx_hdr hdr; @@ -1785,6 +1916,23 @@ struct ioctl_common_function_reset { struct mbx_hdr hdr; }; +/* [73] OPCODE_COMMON_READ_TRANSRECEIVER_DATA */ +struct mbx_read_common_transrecv_data { + struct mbx_hdr hdr; + union { + struct { + uint32_t page_num; + uint32_t port; + } req; + struct { + uint32_t page_num; + uint32_t port; + uint32_t page_data[32]; + } rsp; + } params; + +}; + /* [80] OPCODE_COMMON_FUNCTION_LINK_CONFIG */ struct mbx_common_func_link_cfg { struct mbx_hdr hdr; @@ -2110,7 +2258,9 @@ enum RSS_ENABLE_FLAGS { RSS_ENABLE_IPV4 = 0x1, /* (IPV4 HASH enabled ) */ RSS_ENABLE_TCP_IPV4 = 0x2, /* (TCP IPV4 Hash enabled) */ RSS_ENABLE_IPV6 = 0x4, /* (IPV6 HASH enabled) */ - RSS_ENABLE_TCP_IPV6 = 0x8 /* (TCP IPV6 HASH */ + RSS_ENABLE_TCP_IPV6 = 0x8, /* (TCP IPV6 HASH */ + RSS_ENABLE_UDP_IPV4 = 0x10, /* UDP IPV4 HASH */ + RSS_ENABLE_UDP_IPV6 = 0x20 /* UDP IPV6 HASH */ }; #define RSS_ENABLE (RSS_ENABLE_IPV4 | RSS_ENABLE_TCP_IPV4) #define RSS_DISABLE RSS_ENABLE_NONE Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Wed Mar 6 09:33:16 2013 (r247879) +++ head/sys/dev/oce/oce_if.c Wed Mar 6 09:53:38 2013 (r247880) @@ -36,6 +36,7 @@ * Costa Mesa, CA 92626 */ + /* $FreeBSD$ */ #include "opt_inet6.h" @@ -94,7 +95,8 @@ static void setup_max_queues_want(POCE_S static void update_queues_got(POCE_SOFTC sc); static void process_link_state(POCE_SOFTC sc, struct oce_async_cqe_link_state *acqe); - +static int oce_tx_asic_stall_verify(POCE_SOFTC sc, struct mbuf *m); +static struct mbuf *oce_insert_vlan_tag(POCE_SOFTC sc, struct mbuf *m, boolean_t *complete); /* IP specific */ #if defined(INET6) || defined(INET) @@ -266,8 +268,6 @@ oce_attach(device_t dev) rc = callout_reset(&sc->timer, 2 * hz, oce_local_timer, sc); if (rc) goto stats_free; -#ifdef DEV_NETMAP -#endif /* DEV_NETMAP */ return 0; @@ -485,7 +485,7 @@ oce_multiq_start(struct ifnet *ifp, stru struct oce_wq *wq = NULL; int queue_index = 0; int status = 0; - + if ((m->m_flags & M_FLOWID) != 0) queue_index = m->m_pkthdr.flowid % sc->nwqs; @@ -568,6 +568,7 @@ oce_intr(void *arg, int pending) eq_arm: oce_arm_eq(sc, eq->eq_id, 0, TRUE, FALSE); + return; } @@ -633,6 +634,8 @@ oce_fast_isr(void *arg) taskqueue_enqueue_fast(ii->tq, &ii->task); + ii->eq->intr++; + return FILTER_HANDLED; } @@ -780,6 +783,7 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct oce_nic_frag_wqe *nicfrag; int num_wqes; uint32_t reg_value; + boolean_t complete = TRUE; m = *mpp; if (!m) @@ -790,6 +794,15 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, goto free_ret; } + if(oce_tx_asic_stall_verify(sc, m)) { + m = oce_insert_vlan_tag(sc, m, &complete); + if(!m) { + device_printf(sc->dev, "Insertion unsuccessful\n"); + return 0; + } + + } + if (m->m_pkthdr.csum_flags & CSUM_TSO) { /* consolidate packet buffers for TSO/LSO segment offload */ #if defined(INET6) || defined(INET) @@ -837,15 +850,15 @@ retry: nichdr->u0.dw[2] = 0; nichdr->u0.dw[3] = 0; - nichdr->u0.s.complete = 1; + nichdr->u0.s.complete = complete; nichdr->u0.s.event = 1; nichdr->u0.s.crc = 1; nichdr->u0.s.forward = 0; nichdr->u0.s.ipcs = (m->m_pkthdr.csum_flags & CSUM_IP) ? 1 : 0; nichdr->u0.s.udpcs = - (m->m_pkthdr.csum_flags & CSUM_UDP) ? 1 : 0; + (m->m_pkthdr.csum_flags & CSUM_UDP) ? 1 : 0; nichdr->u0.s.tcpcs = - (m->m_pkthdr.csum_flags & CSUM_TCP) ? 1 : 0; + (m->m_pkthdr.csum_flags & CSUM_TCP) ? 1 : 0; nichdr->u0.s.num_wqe = num_wqes; nichdr->u0.s.total_length = m->m_pkthdr.len; if (m->m_flags & M_VLANTAG) { @@ -895,7 +908,7 @@ retry: wq->tx_stats.tx_wrbs += num_wqes; wq->tx_stats.tx_bytes += m->m_pkthdr.len; wq->tx_stats.tx_pkts++; - + bus_dmamap_sync(wq->ring->dma.tag, wq->ring->dma.map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); reg_value = (num_wqes << 16) | wq->wq_id; @@ -1081,6 +1094,9 @@ oce_start(struct ifnet *ifp) if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; + + if (!sc->link_status) + return; do { IF_DEQUEUE(&sc->ifp->if_snd, m); @@ -1303,7 +1319,6 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i #if defined(INET6) || defined(INET) /* Try to queue to LRO */ if (IF_LRO_ENABLED(sc) && - !(m->m_flags & M_VLANTAG) && (cqe->u0.s.ip_cksum_pass) && (cqe->u0.s.l4_cksum_pass) && (!cqe->u0.s.ip_ver) && @@ -1343,13 +1358,6 @@ oce_discard_rx_comp(struct oce_rq *rq, s POCE_SOFTC sc = (POCE_SOFTC) rq->parent; int num_frags = cqe->u0.s.num_fragments; - if (IS_XE201(sc) && cqe->u0.s.error) { - /* Lancer A0 workaround - * num_frags will be 1 more than actual in case of error - */ - if (num_frags) - num_frags -= 1; - } for (i = 0; i < num_frags; i++) { if (rq->packets_out == rq->packets_in) { device_printf(sc->dev, @@ -1458,7 +1466,7 @@ oce_free_lro(POCE_SOFTC sc) tcp_lro_free(lro); } } -#endif /* INET6 || INET */ +#endif int oce_alloc_rx_bufs(struct oce_rq *rq, int count) @@ -1471,7 +1479,7 @@ oce_alloc_rx_bufs(struct oce_rq *rq, int struct oce_nic_rqe *rqe; pd_rxulp_db_t rxdb_reg; - + bzero(&rxdb_reg, sizeof(pd_rxulp_db_t)); for (i = 0; i < count; i++) { in = rq->packets_in + 1; if (in == OCE_RQ_PACKET_ARRAY_SIZE) @@ -1512,14 +1520,12 @@ oce_alloc_rx_bufs(struct oce_rq *rq, int } if (added != 0) { for (i = added / OCE_MAX_RQ_POSTS; i > 0; i--) { - DELAY(1); rxdb_reg.bits.num_posted = OCE_MAX_RQ_POSTS; rxdb_reg.bits.qid = rq->rq_id; OCE_WRITE_REG32(sc, db, PD_RXULP_DB, rxdb_reg.dw0); added -= OCE_MAX_RQ_POSTS; } if (added > 0) { - DELAY(1); rxdb_reg.bits.qid = rq->rq_id; rxdb_reg.bits.num_posted = added; OCE_WRITE_REG32(sc, db, PD_RXULP_DB, rxdb_reg.dw0); @@ -1554,13 +1560,8 @@ oce_rq_handler(void *arg) } else { rq->rx_stats.rxcp_err++; sc->ifp->if_ierrors++; - if (IS_XE201(sc)) - /* Lancer A0 no buffer workaround */ - oce_discard_rx_comp(rq, cqe); - else - /* Post L3/L4 errors to stack.*/ - oce_rx(rq, cqe->u0.s.frag_index, cqe); - + /* Post L3/L4 errors to stack.*/ + oce_rx(rq, cqe->u0.s.frag_index, cqe); } rq->rx_stats.rx_compl++; cqe->u0.dw[2] = 0; @@ -1757,18 +1758,18 @@ oce_handle_passthrough(struct ifnet *ifp uint32_t req_size; struct mbx_hdr req; OCE_DMA_MEM dma_mem; - + struct mbx_common_get_cntl_attr *fw_cmd; if (copyin(priv_data, cookie, strlen(IOCTL_COOKIE))) return EFAULT; - + if (memcmp(cookie, IOCTL_COOKIE, strlen(IOCTL_COOKIE))) return EINVAL; - + ioctl_ptr = (char *)priv_data + strlen(IOCTL_COOKIE); if (copyin(ioctl_ptr, &req, sizeof(struct mbx_hdr))) return EFAULT; - + req_size = le32toh(req.u0.req.request_length); if (req_size > 65536) return EINVAL; @@ -1792,12 +1793,86 @@ oce_handle_passthrough(struct ifnet *ifp if (copyout(OCE_DMAPTR(&dma_mem,char), ioctl_ptr, req_size)) rc = EFAULT; + /* + firmware is filling all the attributes for this ioctl except + the driver version..so fill it + */ + if(req.u0.rsp.opcode == OPCODE_COMMON_GET_CNTL_ATTRIBUTES) { + fw_cmd = (struct mbx_common_get_cntl_attr *) ioctl_ptr; + strncpy(fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str, + COMPONENT_REVISION, strlen(COMPONENT_REVISION)); + } + dma_free: oce_dma_free(sc, &dma_mem); return rc; } +static void +oce_eqd_set_periodic(POCE_SOFTC sc) +{ + struct oce_set_eqd set_eqd[OCE_MAX_EQ]; + struct oce_aic_obj *aic; + struct oce_eq *eqo; + uint64_t now = 0, delta; + int eqd, i, num = 0; + uint32_t ips = 0; + int tps; + + for (i = 0 ; i < sc->neqs; i++) { + eqo = sc->eq[i]; + aic = &sc->aic_obj[i]; + /* When setting the static eq delay from the user space */ + if (!aic->enable) { + eqd = aic->et_eqd; + goto modify_eqd; + } + + now = ticks; + + /* Over flow check */ + if ((now < aic->ticks) || (eqo->intr < aic->intr_prev)) + goto done; + + delta = now - aic->ticks; + tps = delta/hz; + + /* Interrupt rate based on elapsed ticks */ + if(tps) + ips = (uint32_t)(eqo->intr - aic->intr_prev) / tps; + + if (ips > INTR_RATE_HWM) + eqd = aic->cur_eqd + 20; + else if (ips < INTR_RATE_LWM) + eqd = aic->cur_eqd / 2; + else + goto done; + + if (eqd < 10) + eqd = 0; + + /* Make sure that the eq delay is in the known range */ + eqd = min(eqd, aic->max_eqd); + eqd = max(eqd, aic->min_eqd); + +modify_eqd: + if (eqd != aic->cur_eqd) { + set_eqd[num].delay_multiplier = (eqd * 65)/100; + set_eqd[num].eq_id = eqo->eq_id; + aic->cur_eqd = eqd; + num++; + } +done: + aic->intr_prev = eqo->intr; + aic->ticks = now; + } + + /* Is there atleast one eq that needs to be modified? */ + if(num) + oce_mbox_eqd_modify_periodic(sc, set_eqd, num); + +} static void oce_local_timer(void *arg) @@ -1813,6 +1888,10 @@ oce_local_timer(void *arg) for (i = 0; i < sc->nwqs; i++) oce_tx_restart(sc, sc->wq[i]); + /* calculate and set the eq delay for optimal interrupt rate */ + if (IS_BE(sc)) + oce_eqd_set_periodic(sc); + callout_reset(&sc->timer, hz, oce_local_timer, sc); } @@ -1849,17 +1928,17 @@ oce_if_deactivate(POCE_SOFTC sc) /* Stop intrs and finish any bottom halves pending */ oce_hw_intr_disable(sc); - /* Since taskqueue_drain takes a Giant Lock, We should not acquire - any other lock. So unlock device lock and require after - completing taskqueue_drain. - */ - UNLOCK(&sc->dev_lock); + /* Since taskqueue_drain takes a Gaint Lock, We should not acquire + any other lock. So unlock device lock and require after + completing taskqueue_drain. + */ + UNLOCK(&sc->dev_lock); for (i = 0; i < sc->intr_count; i++) { if (sc->intrs[i].tq != NULL) { taskqueue_drain(sc->intrs[i].tq, &sc->intrs[i].task); } } - LOCK(&sc->dev_lock); + LOCK(&sc->dev_lock); /* Delete RX queue in card with flush param */ oce_stop_rx(sc); @@ -1874,7 +1953,7 @@ oce_if_deactivate(POCE_SOFTC sc) /* But still we need to get MCC aync events. So enable intrs and also arm first EQ - */ + */ oce_hw_intr_enable(sc); oce_arm_eq(sc, sc->eq[0]->eq_id, 0, TRUE, FALSE); @@ -1947,6 +2026,7 @@ oce_mq_handler(void *arg) struct oce_mq_cqe *cqe; struct oce_async_cqe_link_state *acqe; struct oce_async_event_grp5_pvid_state *gcqe; + struct oce_async_event_qnq *dbgcqe; bus_dmamap_sync(cq->ring->dma.tag, @@ -1973,6 +2053,14 @@ oce_mq_handler(void *arg) sc->pvid = 0; } + else if(evt_type == ASYNC_EVENT_CODE_DEBUG && + optype == ASYNC_EVENT_DEBUG_QNQ) { + dbgcqe = + (struct oce_async_event_qnq *)cqe; + if(dbgcqe->valid) + sc->qnqid = dbgcqe->vlan_tag; + sc->qnq_debug_event = TRUE; + } } cqe->u0.dw[3] = 0; RING_GET(cq->ring, 1); @@ -2032,3 +2120,79 @@ update_queues_got(POCE_SOFTC sc) } } +static int +oce_check_ipv6_ext_hdr(struct mbuf *m) +{ + struct ether_header *eh = mtod(m, struct ether_header *); + caddr_t m_datatemp = m->m_data; + + if (eh->ether_type == htons(ETHERTYPE_IPV6)) { + m->m_data += sizeof(struct ether_header); + struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + + if((ip6->ip6_nxt != IPPROTO_TCP) && \ + (ip6->ip6_nxt != IPPROTO_UDP)){ + struct ip6_ext *ip6e = NULL; + m->m_data += sizeof(struct ip6_hdr); + + ip6e = (struct ip6_ext *) mtod(m, struct ip6_ext *); + if(ip6e->ip6e_len == 0xff) { + m->m_data = m_datatemp; + return TRUE; + } + } + m->m_data = m_datatemp; + } + return FALSE; +} + +static int +is_be3_a1(POCE_SOFTC sc) +{ + if((sc->flags & OCE_FLAGS_BE3) && ((sc->asic_revision & 0xFF) < 2)) { + return TRUE; + } + return FALSE; +} + +static struct mbuf * +oce_insert_vlan_tag(POCE_SOFTC sc, struct mbuf *m, boolean_t *complete) +{ + uint16_t vlan_tag = 0; + + if(!M_WRITABLE(m)) + return NULL; + + /* Embed vlan tag in the packet if it is not part of it */ + if(m->m_flags & M_VLANTAG) { + vlan_tag = EVL_VLANOFTAG(m->m_pkthdr.ether_vtag); + m->m_flags &= ~M_VLANTAG; + } + + /* if UMC, ignore vlan tag insertion and instead insert pvid */ + if(sc->pvid) { + if(!vlan_tag) + vlan_tag = sc->pvid; + *complete = FALSE; + } + + if(vlan_tag) { + m = ether_vlanencap(m, vlan_tag); + } + + if(sc->qnqid) { + m = ether_vlanencap(m, sc->qnqid); + *complete = FALSE; + } + return m; +} + +static int +oce_tx_asic_stall_verify(POCE_SOFTC sc, struct mbuf *m) +{ + if(is_be3_a1(sc) && IS_QNQ_OR_UMC(sc) && \ + oce_check_ipv6_ext_hdr(m)) { + return TRUE; + } + return FALSE; +} Modified: head/sys/dev/oce/oce_if.h ============================================================================== --- head/sys/dev/oce/oce_if.h Wed Mar 6 09:33:16 2013 (r247879) +++ head/sys/dev/oce/oce_if.h Wed Mar 6 09:53:38 2013 (r247880) @@ -36,6 +36,7 @@ * Costa Mesa, CA 92626 */ + /* $FreeBSD$ */ #include @@ -87,9 +88,7 @@ #include "oce_hw.h" -/* OCE device driver module component revision informaiton */ -#define COMPONENT_REVISION "4.2.127.0" - +#define COMPONENT_REVISION "4.6.95.0" /* OCE devices supported by this driver */ #define PCI_VENDOR_EMULEX 0x10df /* Emulex */ @@ -132,7 +131,7 @@ extern int mp_ncpus; /* system's total #define OCE_RQ_BUF_SIZE 2048 #define OCE_LSO_MAX_SIZE (64 * 1024) #define LONG_TIMEOUT 30 -#define OCE_MAX_JUMBO_FRAME_SIZE 16360 +#define OCE_MAX_JUMBO_FRAME_SIZE 9018 #define OCE_MAX_MTU (OCE_MAX_JUMBO_FRAME_SIZE - \ ETHER_VLAN_ENCAP_LEN - \ ETHER_HDR_LEN) @@ -481,7 +480,27 @@ struct oce_drv_stats { } u0; }; +#define INTR_RATE_HWM 15000 +#define INTR_RATE_LWM 10000 + +#define OCE_MAX_EQD 128u +#define OCE_MIN_EQD 50u + +struct oce_set_eqd { + uint32_t eq_id; + uint32_t phase; + uint32_t delay_multiplier; +}; +struct oce_aic_obj { /* Adaptive interrupt coalescing (AIC) info */ + boolean_t enable; + uint32_t min_eqd; /* in usecs */ + uint32_t max_eqd; /* in usecs */ + uint32_t cur_eqd; /* in usecs */ + uint32_t et_eqd; /* configured value when aic is off */ + uint64_t ticks; + uint64_t intr_prev; +}; #define MAX_LOCK_DESC_LEN 32 struct oce_lock { @@ -565,6 +584,7 @@ struct oce_eq { int cq_valid; struct eq_config eq_cfg; int vector; + uint64_t intr; }; enum cq_len { @@ -827,6 +847,9 @@ typedef struct oce_softc { uint32_t flow_control; uint32_t promisc; + + struct oce_aic_obj aic_obj[OCE_MAX_EQ]; + /*Vlan Filtering related */ eventhandler_tag vlan_attach; eventhandler_tag vlan_detach; @@ -837,7 +860,9 @@ typedef struct oce_softc { struct oce_drv_stats oce_stats_info; struct callout timer; int8_t be3_native; - uint32_t pvid; + uint16_t qnq_debug_event; + uint16_t qnqid; + uint16_t pvid; } OCE_SOFTC, *POCE_SOFTC; @@ -996,6 +1021,9 @@ int oce_mbox_create_wq(struct oce_wq *wq int oce_mbox_create_eq(struct oce_eq *eq); int oce_mbox_cq_create(struct oce_cq *cq, uint32_t ncoalesce, uint32_t is_eventable); +int oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t page_num); +void oce_mbox_eqd_modify_periodic(POCE_SOFTC sc, struct oce_set_eqd *set_eqd, + int num); void mbx_common_req_hdr_init(struct mbx_hdr *hdr, uint8_t dom, uint8_t port, @@ -1076,3 +1104,12 @@ static inline uint32_t oce_highbit(uint3 return 0; } +#define TRANSCEIVER_DATA_NUM_ELE 64 +#define TRANSCEIVER_DATA_SIZE 256 +#define TRANSCEIVER_A0_SIZE 128 +#define TRANSCEIVER_A2_SIZE 128 +#define PAGE_NUM_A0 0xa0 +#define PAGE_NUM_A2 0xa2 +#define IS_QNQ_OR_UMC(sc) ((sc->pvid && (sc->function_mode & FNM_UMC_MODE ))\ + || (sc->qnqid && (sc->function_mode & FNM_FLEX10_MODE))) + Modified: head/sys/dev/oce/oce_mbox.c ============================================================================== --- head/sys/dev/oce/oce_mbox.c Wed Mar 6 09:33:16 2013 (r247879) +++ head/sys/dev/oce/oce_mbox.c Wed Mar 6 09:53:38 2013 (r247880) @@ -37,10 +37,12 @@ */ + /* $FreeBSD$ */ -#include "oce_if.h" +#include "oce_if.h" +extern uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE]; /** * @brief Reset (firmware) common function @@ -276,12 +278,17 @@ oce_get_fw_version(POCE_SOFTC sc) DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); ret = oce_mbox_post(sc, &mbx, NULL); - if (ret) - return ret; + if (!ret) + ret = fwcmd->hdr.u0.rsp.status; + if (ret) { + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, ret); + goto error; + } bcopy(fwcmd->params.rsp.fw_ver_str, sc->fw_version, 32); - - return 0; +error: + return ret; } @@ -428,15 +435,20 @@ oce_read_mac_addr(POCE_SOFTC sc, uint32_ DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); ret = oce_mbox_post(sc, &mbx, NULL); - if (ret) - return ret; + if (!ret) + ret = fwcmd->hdr.u0.rsp.status; + if (ret) { + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, ret); + goto error; + } /* copy the mac addres in the output parameter */ mac->size_of_struct = fwcmd->params.rsp.mac.size_of_struct; bcopy(&fwcmd->params.rsp.mac.mac_addr[0], &mac->mac_addr[0], mac->size_of_struct); - - return 0; +error: + return ret; } /** @@ -466,8 +478,13 @@ oce_get_fw_config(POCE_SOFTC sc) DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); ret = oce_mbox_post(sc, &mbx, NULL); - if (ret) - return ret; + if (!ret) + ret = fwcmd->hdr.u0.rsp.status; + if (ret) { + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, ret); + goto error; + } DW_SWAP(u32ptr(fwcmd), sizeof(struct mbx_common_query_fw_config)); @@ -485,7 +502,8 @@ oce_get_fw_config(POCE_SOFTC sc) sc->max_rx_rings = fwcmd->params.rsp.ulp[1].lro_rqid_tot; } - return 0; +error: + return ret; } @@ -540,15 +558,20 @@ oce_if_create(POCE_SOFTC sc, DW_SWAP(u32ptr(&mbx), OCE_BMBX_RHDR_SZ); rc = oce_mbox_post(sc, &mbx, NULL); - if (rc) - return rc; + if (!rc) + rc = fwcmd->hdr.u0.rsp.status; + if (rc) { + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, rc); + goto error; + } *if_id = LE_32(fwcmd->params.rsp.if_id); if (mac_addr != NULL) sc->pmac_id = LE_32(fwcmd->params.rsp.pmac_id); - - return 0; +error: + return rc; } /** @@ -581,6 +604,11 @@ oce_if_del(POCE_SOFTC sc, uint32_t if_id DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); rc = oce_mbox_post(sc, &mbx, NULL); + if (!rc) + rc = fwcmd->hdr.u0.rsp.status; + if (rc) + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, rc); return rc; } @@ -628,8 +656,12 @@ oce_config_vlan(POCE_SOFTC sc, DW_SWAP(u32ptr(&mbx), (OCE_BMBX_RHDR_SZ + mbx.payload_length)); rc = oce_mbox_post(sc, &mbx, NULL); - - return rc; + if (!rc) + rc = fwcmd->hdr.u0.rsp.status; + if (rc) + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, rc); + return 0; } @@ -667,7 +699,11 @@ oce_set_flow_control(POCE_SOFTC sc, uint DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); rc = oce_mbox_post(sc, &mbx, NULL); - + if (!rc) + rc = fwcmd->hdr.u0.rsp.status; + if (rc) + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, rc); return rc; } @@ -726,20 +762,28 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 struct oce_mbx mbx; struct mbx_config_nic_rss *fwcmd = (struct mbx_config_nic_rss *)&mbx.payload; + int version; bzero(&mbx, sizeof(struct oce_mbx)); + if (IS_XE201(sc)) { + version = OCE_MBX_VER_V1; + fwcmd->params.req.enable_rss = RSS_ENABLE_UDP_IPV4 | + RSS_ENABLE_UDP_IPV6; + } else + version = OCE_MBX_VER_V0; + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, MBX_SUBSYSTEM_NIC, NIC_CONFIG_RSS, MBX_TIMEOUT_SEC, sizeof(struct mbx_config_nic_rss), - OCE_MBX_VER_V0); + version); if (enable_rss) - fwcmd->params.req.enable_rss = (RSS_ENABLE_IPV4 | - RSS_ENABLE_TCP_IPV4 | - RSS_ENABLE_IPV6 | - RSS_ENABLE_TCP_IPV6); + fwcmd->params.req.enable_rss |= (RSS_ENABLE_IPV4 | + RSS_ENABLE_TCP_IPV4 | + RSS_ENABLE_IPV6 | + RSS_ENABLE_TCP_IPV6); fwcmd->params.req.flush = OCE_FLUSH; fwcmd->params.req.if_id = LE_32(if_id); @@ -753,9 +797,12 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); rc = oce_mbox_post(sc, &mbx, NULL); - + if (!rc) + rc = fwcmd->hdr.u0.rsp.status; + if (rc) + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, rc); } - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 10:23:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 602D042A; Wed, 6 Mar 2013 10:23:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37C68F6F; Wed, 6 Mar 2013 10:23:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26ANvEG072709; Wed, 6 Mar 2013 10:23:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26ANurj072701; Wed, 6 Mar 2013 10:23:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303061023.r26ANurj072701@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 10:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247881 - in stable/9/sys: amd64/acpica dev/acpica i386/acpica ia64/acpica 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 10:23:58 -0000 Author: avg Date: Wed Mar 6 10:23:56 2013 New Revision: 247881 URL: http://svnweb.freebsd.org/changeset/base/247881 Log: MFC r233579,236403,236408: make interrupt flags management closer to head r233579: Restore interrupt state after executing AcpiEnterSleepState(). r236403,236408: acpi_wakeup_machdep/acpi_sleep_machdep The merged changes are modified a bit to account for lots of missing acpi and acpica MFCs. For the same reason MFC to stable/8 is not practical. MFC slackers: iwasaki, jkim Modified: stable/9/sys/amd64/acpica/acpi_wakeup.c stable/9/sys/dev/acpica/acpi.c stable/9/sys/dev/acpica/acpivar.h stable/9/sys/i386/acpica/acpi_wakeup.c stable/9/sys/ia64/acpica/acpi_wakeup.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- stable/9/sys/amd64/acpica/acpi_wakeup.c Wed Mar 6 09:53:38 2013 (r247880) +++ stable/9/sys/amd64/acpica/acpi_wakeup.c Wed Mar 6 10:23:56 2013 (r247881) @@ -76,6 +76,10 @@ static struct pcb **susppcbs; static void **suspfpusave; #endif +#ifdef SMP +static cpuset_t suspcpus; +#endif + int acpi_restorecpu(uint64_t, vm_offset_t); static void *acpi_alloc_wakeup_handler(void); @@ -220,21 +224,14 @@ acpi_wakeup_cpus(struct acpi_softc *sc, int acpi_sleep_machdep(struct acpi_softc *sc, int state) { -#ifdef SMP - cpuset_t wakeup_cpus; -#endif - register_t rf; ACPI_STATUS status; - int ret; - - ret = -1; if (sc->acpi_wakeaddr == 0ul) - return (ret); + return (-1); /* couldn't alloc wake memory */ #ifdef SMP - wakeup_cpus = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); + suspcpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &suspcpus); #endif if (acpi_resume_beep != 0) @@ -242,16 +239,15 @@ acpi_sleep_machdep(struct acpi_softc *sc AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); - rf = intr_disable(); intr_suspend(); if (savectx(susppcbs[0])) { ctx_fpusave(suspfpusave[0]); #ifdef SMP - if (!CPU_EMPTY(&wakeup_cpus) && - suspend_cpus(wakeup_cpus) == 0) { + if (!CPU_EMPTY(&suspcpus) && + suspend_cpus(suspcpus) == 0) { device_printf(sc->acpi_dev, "Failed to suspend APs\n"); - goto out; + return (0); /* couldn't sleep */ } #endif @@ -276,41 +272,54 @@ acpi_sleep_machdep(struct acpi_softc *sc device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status)); - goto out; + return (0); /* couldn't sleep */ } for (;;) ia32_pause(); - } else { - pmap_init_pat(); - load_cr3(susppcbs[0]->pcb_cr3); - initializecpu(); - PCPU_SET(switchtime, 0); - PCPU_SET(switchticks, ticks); -#ifdef SMP - if (!CPU_EMPTY(&wakeup_cpus)) - acpi_wakeup_cpus(sc, &wakeup_cpus); -#endif - ret = 0; } -out: + return (1); /* wakeup successfully */ +} + +int +acpi_wakeup_machdep(struct acpi_softc *sc, int state, + int sleep_result, int intr_enabled) +{ + + if (sleep_result == -1) + return (sleep_result); + + if (intr_enabled == 0) { + /* Wakeup MD procedures in interrupt disabled context */ + if (sleep_result == 1) { + pmap_init_pat(); + load_cr3(susppcbs[0]->pcb_cr3); + initializecpu(); + PCPU_SET(switchtime, 0); + PCPU_SET(switchticks, ticks); #ifdef SMP - if (!CPU_EMPTY(&wakeup_cpus)) - restart_cpus(wakeup_cpus); + if (!CPU_EMPTY(&suspcpus)) + acpi_wakeup_cpus(sc, &suspcpus); #endif + } - mca_resume(); - intr_resume(); - intr_restore(rf); - - AcpiSetFirmwareWakingVector(0); +#ifdef SMP + if (!CPU_EMPTY(&suspcpus)) + restart_cpus(suspcpus); +#endif + mca_resume(); + intr_resume(); + } else { + /* Wakeup MD procedures in interrupt enabled context */ + AcpiSetFirmwareWakingVector(0); - if (ret == 0 && mem_range_softc.mr_op != NULL && - mem_range_softc.mr_op->reinit != NULL) - mem_range_softc.mr_op->reinit(&mem_range_softc); + if (sleep_result == 1 && mem_range_softc.mr_op != NULL && + mem_range_softc.mr_op->reinit != NULL) + mem_range_softc.mr_op->reinit(&mem_range_softc); + } - return (ret); + return (sleep_result); } static void * Modified: stable/9/sys/dev/acpica/acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi.c Wed Mar 6 09:53:38 2013 (r247880) +++ stable/9/sys/dev/acpica/acpi.c Wed Mar 6 10:23:56 2013 (r247881) @@ -1960,6 +1960,7 @@ static void acpi_shutdown_final(void *arg, int howto) { struct acpi_softc *sc = (struct acpi_softc *)arg; + register_t intr; ACPI_STATUS status; /* @@ -1975,13 +1976,15 @@ acpi_shutdown_final(void *arg, int howto return; } device_printf(sc->acpi_dev, "Powering system off\n"); - ACPI_DISABLE_IRQS(); + intr = intr_disable(); status = AcpiEnterSleepState(ACPI_STATE_S5); - if (ACPI_FAILURE(status)) + if (ACPI_FAILURE(status)) { + intr_restore(intr); device_printf(sc->acpi_dev, "power-off failed - %s\n", AcpiFormatException(status)); - else { + } else { DELAY(1000000); + intr_restore(intr); device_printf(sc->acpi_dev, "power-off failed - timeout\n"); } } else if ((howto & RB_HALT) == 0 && sc->acpi_handle_reboot) { @@ -2652,8 +2655,10 @@ enum acpi_sleep_state { static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state) { - ACPI_STATUS status; + register_t intr; + ACPI_STATUS status; enum acpi_sleep_state slp_state; + int sleep_result; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state); @@ -2733,15 +2738,24 @@ acpi_EnterSleepState(struct acpi_softc * if (sc->acpi_sleep_delay > 0) DELAY(sc->acpi_sleep_delay * 1000000); + intr = intr_disable(); if (state != ACPI_STATE_S1) { - acpi_sleep_machdep(sc, state); + sleep_result = acpi_sleep_machdep(sc, state); + acpi_wakeup_machdep(sc, state, sleep_result, 0); + intr_restore(intr); + + /* call acpi_wakeup_machdep() again with interrupt enabled */ + acpi_wakeup_machdep(sc, state, sleep_result, 1); + + if (sleep_result == -1) + goto backout; /* Re-enable ACPI hardware on wakeup from sleep state 4. */ if (state == ACPI_STATE_S4) AcpiEnable(); } else { - ACPI_DISABLE_IRQS(); status = AcpiEnterSleepState(state); + intr_restore(intr); if (ACPI_FAILURE(status)) { device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status)); Modified: stable/9/sys/dev/acpica/acpivar.h ============================================================================== --- stable/9/sys/dev/acpica/acpivar.h Wed Mar 6 09:53:38 2013 (r247880) +++ stable/9/sys/dev/acpica/acpivar.h Wed Mar 6 10:23:56 2013 (r247881) @@ -434,6 +434,8 @@ int acpi_disabled(char *subsys); int acpi_machdep_init(device_t dev); void acpi_install_wakeup_handler(struct acpi_softc *sc); int acpi_sleep_machdep(struct acpi_softc *sc, int state); +int acpi_wakeup_machdep(struct acpi_softc *sc, int state, + int sleep_result, int intr_enabled); int acpi_table_quirks(int *quirks); int acpi_machdep_quirks(int *quirks); Modified: stable/9/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- stable/9/sys/i386/acpica/acpi_wakeup.c Wed Mar 6 09:53:38 2013 (r247880) +++ stable/9/sys/i386/acpica/acpi_wakeup.c Wed Mar 6 10:23:56 2013 (r247881) @@ -74,6 +74,10 @@ extern struct pcb **susppcbs; static struct pcb **susppcbs; #endif +#ifdef SMP +static cpuset_t suspcpus; +#endif + static void *acpi_alloc_wakeup_handler(void); static void acpi_stop_beep(void *); @@ -212,22 +216,14 @@ acpi_wakeup_cpus(struct acpi_softc *sc, int acpi_sleep_machdep(struct acpi_softc *sc, int state) { -#ifdef SMP - cpuset_t wakeup_cpus; -#endif - register_t cr3, rf; ACPI_STATUS status; - struct pmap *pm; - int ret; - - ret = -1; if (sc->acpi_wakeaddr == 0ul) - return (ret); + return (-1); /* couldn't alloc wake memory */ #ifdef SMP - wakeup_cpus = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); + suspcpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &suspcpus); #endif if (acpi_resume_beep != 0) @@ -235,28 +231,14 @@ acpi_sleep_machdep(struct acpi_softc *sc AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); - rf = intr_disable(); intr_suspend(); - /* - * Temporarily switch to the kernel pmap because it provides - * an identity mapping (setup at boot) for the low physical - * memory region containing the wakeup code. - */ - pm = kernel_pmap; - cr3 = rcr3(); -#ifdef PAE - load_cr3(vtophys(pm->pm_pdpt)); -#else - load_cr3(vtophys(pm->pm_pdir)); -#endif - if (suspendctx(susppcbs[0])) { #ifdef SMP - if (!CPU_EMPTY(&wakeup_cpus) && - suspend_cpus(wakeup_cpus) == 0) { + if (!CPU_EMPTY(&suspcpus) && + suspend_cpus(suspcpus) == 0) { device_printf(sc->acpi_dev, "Failed to suspend APs\n"); - goto out; + return (0); /* couldn't sleep */ } #endif @@ -264,8 +246,6 @@ acpi_sleep_machdep(struct acpi_softc *sc WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); WAKECODE_FIXUP(wakeup_cr4, register_t, susppcbs[0]->pcb_cr4); - WAKECODE_FIXUP(wakeup_cr3, register_t, susppcbs[0]->pcb_cr3); - WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); /* Call ACPICA to enter the desired sleep state */ @@ -278,41 +258,54 @@ acpi_sleep_machdep(struct acpi_softc *sc device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status)); - goto out; + return (0); /* couldn't sleep */ } for (;;) ia32_pause(); - } else { - pmap_init_pat(); - initializecpu(); - PCPU_SET(switchtime, 0); - PCPU_SET(switchticks, ticks); + } + + return (1); /* wakeup successfully */ +} + +int +acpi_wakeup_machdep(struct acpi_softc *sc, int state, + int sleep_result, int intr_enabled) +{ + + if (sleep_result == -1) + return (sleep_result); + + if (intr_enabled == 0) { + /* Wakeup MD procedures in interrupt disabled context */ + if (sleep_result == 1) { + pmap_init_pat(); + load_cr3(susppcbs[0]->pcb_cr3); + initializecpu(); + PCPU_SET(switchtime, 0); + PCPU_SET(switchticks, ticks); #ifdef SMP - if (!CPU_EMPTY(&wakeup_cpus)) - acpi_wakeup_cpus(sc, &wakeup_cpus); + if (!CPU_EMPTY(&suspcpus)) + acpi_wakeup_cpus(sc, &suspcpus); #endif - ret = 0; - } + } -out: #ifdef SMP - if (!CPU_EMPTY(&wakeup_cpus)) - restart_cpus(wakeup_cpus); + if (!CPU_EMPTY(&suspcpus)) + restart_cpus(suspcpus); #endif + mca_resume(); + intr_resume(); + } else { + /* Wakeup MD procedures in interrupt enabled context */ + AcpiSetFirmwareWakingVector(0); - load_cr3(cr3); - mca_resume(); - intr_resume(); - intr_restore(rf); - - AcpiSetFirmwareWakingVector(0); - - if (ret == 0 && mem_range_softc.mr_op != NULL && - mem_range_softc.mr_op->reinit != NULL) - mem_range_softc.mr_op->reinit(&mem_range_softc); + if (sleep_result == 1 && mem_range_softc.mr_op != NULL && + mem_range_softc.mr_op->reinit != NULL) + mem_range_softc.mr_op->reinit(&mem_range_softc); + } - return (ret); + return (sleep_result); } static void * @@ -373,6 +366,16 @@ acpi_install_wakeup_handler(struct acpi_ /* Save pointers to some global data. */ WAKECODE_FIXUP(wakeup_ret, void *, resumectx); + /* + * Temporarily switch to the kernel pmap because it provides + * an identity mapping (setup at boot) for the low physical + * memory region containing the wakeup code. + */ +#ifdef PAE + WAKECODE_FIXUP(wakeup_cr3, register_t, vtophys(kernel_pmap->pm_pdpt)); +#else + WAKECODE_FIXUP(wakeup_cr3, register_t, vtophys(kernel_pmap->pm_pdir)); +#endif if (bootverbose) device_printf(sc->acpi_dev, "wakeup code va %#x pa %#jx\n", Modified: stable/9/sys/ia64/acpica/acpi_wakeup.c ============================================================================== --- stable/9/sys/ia64/acpica/acpi_wakeup.c Wed Mar 6 09:53:38 2013 (r247880) +++ stable/9/sys/ia64/acpica/acpi_wakeup.c Wed Mar 6 10:23:56 2013 (r247881) @@ -39,6 +39,13 @@ acpi_sleep_machdep(struct acpi_softc *sc return (0); } +int +acpi_wakeup_machdep(struct acpi_softc *sc, int state, + int sleep_result, int intr_enabled) +{ + return (0); +} + void acpi_install_wakeup_handler(struct acpi_softc *sc) { From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 10:45:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D01328DB; Wed, 6 Mar 2013 10:45:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C150ECD; Wed, 6 Mar 2013 10:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26AjkV9078842; Wed, 6 Mar 2013 10:45:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26Ajkaa078840; Wed, 6 Mar 2013 10:45:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303061045.r26Ajkaa078840@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 10:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247883 - stable/9/sys/dev/acpica 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 10:45:46 -0000 Author: avg Date: Wed Mar 6 10:45:46 2013 New Revision: 247883 URL: http://svnweb.freebsd.org/changeset/base/247883 Log: MFC r246250,246252: acpi: after wakeup from a state > S1 re-enable SCI_EN with a direct write Modified: stable/9/sys/dev/acpica/acpi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi.c Wed Mar 6 10:40:50 2013 (r247882) +++ stable/9/sys/dev/acpica/acpi.c Wed Mar 6 10:45:46 2013 (r247883) @@ -2742,6 +2742,19 @@ acpi_EnterSleepState(struct acpi_softc * if (state != ACPI_STATE_S1) { sleep_result = acpi_sleep_machdep(sc, state); acpi_wakeup_machdep(sc, state, sleep_result, 0); + + /* + * XXX According to ACPI specification SCI_EN bit should be restored + * by ACPI platform (BIOS, firmware) to its pre-sleep state. + * Unfortunately some BIOSes fail to do that and that leads to + * unexpected and serious consequences during wake up like a system + * getting stuck in SMI handlers. + * This hack is picked up from Linux, which claims that it follows + * Windows behavior. + */ + if (sleep_result == 1 && state != ACPI_STATE_S4) + AcpiWriteBitRegister(ACPI_BITREG_SCI_ENABLE, ACPI_ENABLE_EVENT); + intr_restore(intr); /* call acpi_wakeup_machdep() again with interrupt enabled */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 10:52:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A3A60E73; Wed, 6 Mar 2013 10:52:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D7B013A; Wed, 6 Mar 2013 10:52:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26Aq2DO081340; Wed, 6 Mar 2013 10:52:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26Aq2bM081339; Wed, 6 Mar 2013 10:52:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303061052.r26Aq2bM081339@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 10:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247884 - stable/9/sys/dev/acpica 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 10:52:02 -0000 Author: avg Date: Wed Mar 6 10:52:01 2013 New Revision: 247884 URL: http://svnweb.freebsd.org/changeset/base/247884 Log: MFC r246251: acpi: clear power button status bit after waking up Modified: stable/9/sys/dev/acpica/acpi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi.c Wed Mar 6 10:45:46 2013 (r247883) +++ stable/9/sys/dev/acpica/acpi.c Wed Mar 6 10:52:01 2013 (r247884) @@ -2657,6 +2657,7 @@ acpi_EnterSleepState(struct acpi_softc * { register_t intr; ACPI_STATUS status; + ACPI_EVENT_STATUS power_button_status; enum acpi_sleep_state slp_state; int sleep_result; @@ -2755,6 +2756,30 @@ acpi_EnterSleepState(struct acpi_softc * if (sleep_result == 1 && state != ACPI_STATE_S4) AcpiWriteBitRegister(ACPI_BITREG_SCI_ENABLE, ACPI_ENABLE_EVENT); + + if (sleep_result == 1 && state == ACPI_STATE_S3) { + /* + * Prevent mis-interpretation of the wakeup by power button + * as a request for power off. + * Ideally we should post an appropriate wakeup event, + * perhaps using acpi_event_power_button_wake or alike. + * + * Clearing of power button status after wakeup is mandated + * by ACPI specification in section "Fixed Power Button". + * + * XXX As of ACPICA 20121114 AcpiGetEventStatus provides + * status as 0/1 corressponding to inactive/active despite + * its type being ACPI_EVENT_STATUS. In other words, + * we should not test for ACPI_EVENT_FLAG_SET for time being. + */ + if (ACPI_SUCCESS(AcpiGetEventStatus(ACPI_EVENT_POWER_BUTTON, + &power_button_status)) && power_button_status != 0) { + AcpiClearEvent(ACPI_EVENT_POWER_BUTTON); + device_printf(sc->acpi_dev, + "cleared fixed power button status\n"); + } + } + intr_restore(intr); /* call acpi_wakeup_machdep() again with interrupt enabled */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 11:00:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 21ADC292; Wed, 6 Mar 2013 11:00:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EFD7C19C; Wed, 6 Mar 2013 11:00:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26B0lK9082807; Wed, 6 Mar 2013 11:00:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26B0l3x082806; Wed, 6 Mar 2013 11:00:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303061100.r26B0l3x082806@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 11:00:47 +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: r247885 - stable/8/sys/netgraph 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:00:48 -0000 Author: avg Date: Wed Mar 6 11:00:47 2013 New Revision: 247885 URL: http://svnweb.freebsd.org/changeset/base/247885 Log: MFC r246245,246324: ng_ether: track interface renaming Modified: stable/8/sys/netgraph/ng_ether.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netgraph/ (props changed) Modified: stable/8/sys/netgraph/ng_ether.c ============================================================================== --- stable/8/sys/netgraph/ng_ether.c Wed Mar 6 10:52:01 2013 (r247884) +++ stable/8/sys/netgraph/ng_ether.c Wed Mar 6 11:00:47 2013 (r247885) @@ -115,6 +115,8 @@ static ng_rcvdata_t ng_ether_rcvdata; static ng_disconnect_t ng_ether_disconnect; static int ng_ether_mod_event(module_t mod, int event, void *data); +static eventhandler_tag ng_ether_ifnet_arrival_cookie; + /* List of commands and how to convert arguments to/from ASCII */ static const struct ng_cmdlist ng_ether_cmdlist[] = { { @@ -212,6 +214,24 @@ static struct ng_type ng_ether_typestruc NETGRAPH_INIT(ether, &ng_ether_typestruct); /****************************************************************** + UTILITY FUNCTIONS +******************************************************************/ +static void +ng_ether_sanitize_ifname(const char *ifname, char *name) +{ + int i; + + for (i = 0; i < IFNAMSIZ; i++) { + if (ifname[i] == '.' || ifname[i] == ':') + name[i] = '_'; + else + name[i] = ifname[i]; + if (name[i] == '\0') + break; + } +} + +/****************************************************************** ETHERNET FUNCTION HOOKS ******************************************************************/ @@ -284,6 +304,7 @@ ng_ether_output(struct ifnet *ifp, struc static void ng_ether_attach(struct ifnet *ifp) { + char name[IFNAMSIZ]; priv_p priv; node_p node; @@ -321,10 +342,9 @@ ng_ether_attach(struct ifnet *ifp) priv->hwassist = ifp->if_hwassist; /* Try to give the node the same name as the interface */ - if (ng_name_node(node, ifp->if_xname) != 0) { - log(LOG_WARNING, "%s: can't name node %s\n", - __func__, ifp->if_xname); - } + ng_ether_sanitize_ifname(ifp->if_xname, name); + if (ng_name_node(node, name) != 0) + log(LOG_WARNING, "%s: can't name node %s\n", __func__, name); } /* @@ -380,6 +400,38 @@ ng_ether_link_state(struct ifnet *ifp, i } } +/* + * Interface arrival notification handler. + * The notification is produced in two cases: + * o a new interface arrives + * o an existing interface got renamed + * Currently the first case is handled by ng_ether_attach via special + * hook ng_ether_attach_p. + */ +static void +ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) +{ + char name[IFNAMSIZ]; + node_p node; + + /* Only ethernet interfaces are of interest. */ + if (ifp->if_type != IFT_ETHER + && ifp->if_type != IFT_L2VLAN) + return; + + /* + * Just return if it's a new interface without an ng_ether companion. + */ + node = IFP2NG(ifp); + if (node == NULL) + return; + + /* Try to give the node the same name as the new interface name */ + ng_ether_sanitize_ifname(ifp->if_xname, name); + if (ng_name_node(node, name) != 0) + log(LOG_WARNING, "%s: can't re-name node %s\n", __func__, name); +} + /****************************************************************** NETGRAPH NODE METHODS ******************************************************************/ @@ -779,6 +831,9 @@ ng_ether_mod_event(module_t mod, int eve ng_ether_input_orphan_p = ng_ether_input_orphan; ng_ether_link_state_p = ng_ether_link_state; + ng_ether_ifnet_arrival_cookie = + EVENTHANDLER_REGISTER(ifnet_arrival_event, + ng_ether_ifnet_arrival_event, NULL, EVENTHANDLER_PRI_ANY); break; case MOD_UNLOAD: @@ -791,6 +846,9 @@ ng_ether_mod_event(module_t mod, int eve * is MOD_UNLOAD, so there's no need to detach any nodes. */ + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, + ng_ether_ifnet_arrival_cookie); + /* Unregister function hooks */ ng_ether_attach_p = NULL; ng_ether_detach_p = NULL; From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 11:02:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B671940D; Wed, 6 Mar 2013 11:02:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8C131AC; Wed, 6 Mar 2013 11:02:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26B2iPD084597; Wed, 6 Mar 2013 11:02:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26B2iGI084596; Wed, 6 Mar 2013 11:02:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303061102.r26B2iGI084596@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 11:02: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: r247886 - stable/9/sys/netgraph 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:02:44 -0000 Author: avg Date: Wed Mar 6 11:02:44 2013 New Revision: 247886 URL: http://svnweb.freebsd.org/changeset/base/247886 Log: MFC r246245,246324: ng_ether: track interface renaming Modified: stable/9/sys/netgraph/ng_ether.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/ng_ether.c ============================================================================== --- stable/9/sys/netgraph/ng_ether.c Wed Mar 6 11:00:47 2013 (r247885) +++ stable/9/sys/netgraph/ng_ether.c Wed Mar 6 11:02:44 2013 (r247886) @@ -117,6 +117,8 @@ static ng_rcvdata_t ng_ether_rcvdata; static ng_disconnect_t ng_ether_disconnect; static int ng_ether_mod_event(module_t mod, int event, void *data); +static eventhandler_tag ng_ether_ifnet_arrival_cookie; + /* List of commands and how to convert arguments to/from ASCII */ static const struct ng_cmdlist ng_ether_cmdlist[] = { { @@ -214,6 +216,24 @@ static struct ng_type ng_ether_typestruc NETGRAPH_INIT(ether, &ng_ether_typestruct); /****************************************************************** + UTILITY FUNCTIONS +******************************************************************/ +static void +ng_ether_sanitize_ifname(const char *ifname, char *name) +{ + int i; + + for (i = 0; i < IFNAMSIZ; i++) { + if (ifname[i] == '.' || ifname[i] == ':') + name[i] = '_'; + else + name[i] = ifname[i]; + if (name[i] == '\0') + break; + } +} + +/****************************************************************** ETHERNET FUNCTION HOOKS ******************************************************************/ @@ -286,6 +306,7 @@ ng_ether_output(struct ifnet *ifp, struc static void ng_ether_attach(struct ifnet *ifp) { + char name[IFNAMSIZ]; priv_p priv; node_p node; @@ -323,10 +344,9 @@ ng_ether_attach(struct ifnet *ifp) priv->hwassist = ifp->if_hwassist; /* Try to give the node the same name as the interface */ - if (ng_name_node(node, ifp->if_xname) != 0) { - log(LOG_WARNING, "%s: can't name node %s\n", - __func__, ifp->if_xname); - } + ng_ether_sanitize_ifname(ifp->if_xname, name); + if (ng_name_node(node, name) != 0) + log(LOG_WARNING, "%s: can't name node %s\n", __func__, name); } /* @@ -382,6 +402,38 @@ ng_ether_link_state(struct ifnet *ifp, i } } +/* + * Interface arrival notification handler. + * The notification is produced in two cases: + * o a new interface arrives + * o an existing interface got renamed + * Currently the first case is handled by ng_ether_attach via special + * hook ng_ether_attach_p. + */ +static void +ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) +{ + char name[IFNAMSIZ]; + node_p node; + + /* Only ethernet interfaces are of interest. */ + if (ifp->if_type != IFT_ETHER + && ifp->if_type != IFT_L2VLAN) + return; + + /* + * Just return if it's a new interface without an ng_ether companion. + */ + node = IFP2NG(ifp); + if (node == NULL) + return; + + /* Try to give the node the same name as the new interface name */ + ng_ether_sanitize_ifname(ifp->if_xname, name); + if (ng_name_node(node, name) != 0) + log(LOG_WARNING, "%s: can't re-name node %s\n", __func__, name); +} + /****************************************************************** NETGRAPH NODE METHODS ******************************************************************/ @@ -777,6 +829,9 @@ ng_ether_mod_event(module_t mod, int eve ng_ether_input_orphan_p = ng_ether_input_orphan; ng_ether_link_state_p = ng_ether_link_state; + ng_ether_ifnet_arrival_cookie = + EVENTHANDLER_REGISTER(ifnet_arrival_event, + ng_ether_ifnet_arrival_event, NULL, EVENTHANDLER_PRI_ANY); break; case MOD_UNLOAD: @@ -789,6 +844,9 @@ ng_ether_mod_event(module_t mod, int eve * is MOD_UNLOAD, so there's no need to detach any nodes. */ + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, + ng_ether_ifnet_arrival_cookie); + /* Unregister function hooks */ ng_ether_attach_p = NULL; ng_ether_detach_p = NULL; From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 11:08:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 769A0921; Wed, 6 Mar 2013 11:08:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0EB215; Wed, 6 Mar 2013 11:08:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26B8075085681; Wed, 6 Mar 2013 11:08:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26B7x9m085663; Wed, 6 Mar 2013 11:07:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303061107.r26B7x9m085663@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 11:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247887 - stable/9/sys/dev/uart 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:08:00 -0000 Author: avg Date: Wed Mar 6 11:07:59 2013 New Revision: 247887 URL: http://svnweb.freebsd.org/changeset/base/247887 Log: MFC r246243: uart: add resume method and enable it for attachments on the most common x86 buses Modified: stable/9/sys/dev/uart/uart_bus.h stable/9/sys/dev/uart/uart_bus_acpi.c stable/9/sys/dev/uart/uart_bus_isa.c stable/9/sys/dev/uart/uart_bus_pci.c stable/9/sys/dev/uart/uart_core.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/uart/uart_bus.h ============================================================================== --- stable/9/sys/dev/uart/uart_bus.h Wed Mar 6 11:02:44 2013 (r247886) +++ stable/9/sys/dev/uart/uart_bus.h Wed Mar 6 11:07:59 2013 (r247887) @@ -137,6 +137,7 @@ extern char uart_driver_name[]; int uart_bus_attach(device_t dev); int uart_bus_detach(device_t dev); +int uart_bus_resume(device_t dev); serdev_intr_t *uart_bus_ihand(device_t dev, int ipend); int uart_bus_ipend(device_t dev); int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan); Modified: stable/9/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_acpi.c Wed Mar 6 11:02:44 2013 (r247886) +++ stable/9/sys/dev/uart/uart_bus_acpi.c Wed Mar 6 11:07:59 2013 (r247887) @@ -47,6 +47,7 @@ static device_method_t uart_acpi_methods DEVMETHOD(device_probe, uart_acpi_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: stable/9/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_isa.c Wed Mar 6 11:02:44 2013 (r247886) +++ stable/9/sys/dev/uart/uart_bus_isa.c Wed Mar 6 11:07:59 2013 (r247887) @@ -50,6 +50,7 @@ static device_method_t uart_isa_methods[ DEVMETHOD(device_probe, uart_isa_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: stable/9/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_pci.c Wed Mar 6 11:02:44 2013 (r247886) +++ stable/9/sys/dev/uart/uart_bus_pci.c Wed Mar 6 11:07:59 2013 (r247887) @@ -51,6 +51,7 @@ static device_method_t uart_pci_methods[ DEVMETHOD(device_probe, uart_pci_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), DEVMETHOD_END }; Modified: stable/9/sys/dev/uart/uart_core.c ============================================================================== --- stable/9/sys/dev/uart/uart_core.c Wed Mar 6 11:02:44 2013 (r247886) +++ stable/9/sys/dev/uart/uart_core.c Wed Mar 6 11:07:59 2013 (r247887) @@ -577,3 +577,12 @@ uart_bus_detach(device_t dev) return (0); } + +int +uart_bus_resume(device_t dev) +{ + struct uart_softc *sc; + + sc = device_get_softc(dev); + return (UART_ATTACH(sc)); +} From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 11:11:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5D795AC6; Wed, 6 Mar 2013 11:11:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36C1B234; Wed, 6 Mar 2013 11:11:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26BB3Xe087885; Wed, 6 Mar 2013 11:11:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26BB3X8087884; Wed, 6 Mar 2013 11:11:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303061111.r26BB3X8087884@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 11:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247888 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:11:03 -0000 Author: avg Date: Wed Mar 6 11:11:02 2013 New Revision: 247888 URL: http://svnweb.freebsd.org/changeset/base/247888 Log: MFC r246532: zfs_vget, zfs_fhtovp: properly handle the z_shares_dir object Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Mar 6 11:07:59 2013 (r247887) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Mar 6 11:11:02 2013 (r247888) @@ -2010,7 +2010,8 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla * .zfs/snapshot/ directories, that's why we return EOPNOTSUPP. * This will make NFS to switch to LOOKUP instead of using VGET. */ - if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR) + if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR || + (zfsvfs->z_shares_dir != 0 && ino == zfsvfs->z_shares_dir)) return (EOPNOTSUPP); ZFS_ENTER(zfsvfs); @@ -2102,14 +2103,22 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int return (EINVAL); } - /* A zero fid_gen means we are in the .zfs control directories */ - if (fid_gen == 0 && - (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) { + /* + * A zero fid_gen means we are in .zfs or the .zfs/snapshot + * directory tree. If the object == zfsvfs->z_shares_dir, then + * we are in the .zfs/shares directory tree. + */ + if ((fid_gen == 0 && + (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) || + (zfsvfs->z_shares_dir != 0 && object == zfsvfs->z_shares_dir)) { *vpp = zfsvfs->z_ctldir; ASSERT(*vpp != NULL); if (object == ZFSCTL_INO_SNAPDIR) { VERIFY(zfsctl_root_lookup(*vpp, "snapshot", vpp, NULL, 0, NULL, NULL, NULL, NULL, NULL) == 0); + } else if (object == zfsvfs->z_shares_dir) { + VERIFY(zfsctl_root_lookup(*vpp, "shares", vpp, NULL, + 0, NULL, NULL, NULL, NULL, NULL) == 0); } else { VN_HOLD(*vpp); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 11:11:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4F667C2C; Wed, 6 Mar 2013 11:11:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28F23239; Wed, 6 Mar 2013 11:11:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26BBJjQ087962; Wed, 6 Mar 2013 11:11:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26BBJ3K087961; Wed, 6 Mar 2013 11:11:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303061111.r26BBJ3K087961@svn.freebsd.org> From: Andriy Gapon Date: Wed, 6 Mar 2013 11:11:19 +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: r247889 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:11:19 -0000 Author: avg Date: Wed Mar 6 11:11:18 2013 New Revision: 247889 URL: http://svnweb.freebsd.org/changeset/base/247889 Log: MFC r246532: zfs_vget, zfs_fhtovp: properly handle the z_shares_dir object Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Mar 6 11:11:02 2013 (r247888) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Mar 6 11:11:18 2013 (r247889) @@ -2018,7 +2018,8 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla * .zfs/snapshot/ directories, that's why we return EOPNOTSUPP. * This will make NFS to switch to LOOKUP instead of using VGET. */ - if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR) + if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR || + (zfsvfs->z_shares_dir != 0 && ino == zfsvfs->z_shares_dir)) return (EOPNOTSUPP); ZFS_ENTER(zfsvfs); @@ -2108,14 +2109,22 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno return (EINVAL); } - /* A zero fid_gen means we are in the .zfs control directories */ - if (fid_gen == 0 && - (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) { + /* + * A zero fid_gen means we are in .zfs or the .zfs/snapshot + * directory tree. If the object == zfsvfs->z_shares_dir, then + * we are in the .zfs/shares directory tree. + */ + if ((fid_gen == 0 && + (object == ZFSCTL_INO_ROOT || object == ZFSCTL_INO_SNAPDIR)) || + (zfsvfs->z_shares_dir != 0 && object == zfsvfs->z_shares_dir)) { *vpp = zfsvfs->z_ctldir; ASSERT(*vpp != NULL); if (object == ZFSCTL_INO_SNAPDIR) { VERIFY(zfsctl_root_lookup(*vpp, "snapshot", vpp, NULL, 0, NULL, NULL, NULL, NULL, NULL) == 0); + } else if (object == zfsvfs->z_shares_dir) { + VERIFY(zfsctl_root_lookup(*vpp, "shares", vpp, NULL, + 0, NULL, NULL, NULL, NULL, NULL) == 0); } else { VN_HOLD(*vpp); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 11:44:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D75D0326; Wed, 6 Mar 2013 11:44:19 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9C84384; Wed, 6 Mar 2013 11:44:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26BiJgT097211; Wed, 6 Mar 2013 11:44:19 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26BiJnw097210; Wed, 6 Mar 2013 11:44:19 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201303061144.r26BiJnw097210@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 6 Mar 2013 11:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247891 - head/sys/modules/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 11:44:19 -0000 Author: uqs Date: Wed Mar 6 11:44:19 2013 New Revision: 247891 URL: http://svnweb.freebsd.org/changeset/base/247891 Log: Fix 'make depend' Modified: head/sys/modules/uart/Makefile Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Wed Mar 6 11:33:25 2013 (r247890) +++ head/sys/modules/uart/Makefile Wed Mar 6 11:44:19 2013 (r247891) @@ -26,6 +26,7 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} u SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \ power_if.h pccarddevs.h serdev_if.h +SRCS+= opt_platform.h MFILES= dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/ofw/ofw_bus_if.m dev/uart/uart_if.m isa/isa_if.m kern/bus_if.m \ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 13:20:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 09F558A4; Wed, 6 Mar 2013 13:20:55 +0000 (UTC) Date: Wed, 6 Mar 2013 13:20:55 +0000 From: Alexey Dokuchaev To: Andriy Gapon Subject: Re: svn commit: r247884 - stable/9/sys/dev/acpica Message-ID: <20130306132054.GA48880@FreeBSD.org> References: <201303061052.r26Aq2bM081339@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201303061052.r26Aq2bM081339@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:20:55 -0000 On Wed, Mar 06, 2013 at 10:52:02AM +0000, Andriy Gapon wrote: > New Revision: 247884 > URL: http://svnweb.freebsd.org/changeset/base/247884 > > Log: > MFC r246251: acpi: clear power button status bit after waking up > > Modified: > stable/9/sys/dev/acpica/acpi.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/dev/ (props changed) Did you have a chance to review/report back on my earlier email about MFCing it to 8-stable (with a patch)? ./danfe From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 13:38:09 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A4514D92; Wed, 6 Mar 2013 13:38:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 3052BAA6; Wed, 6 Mar 2013 13:38:07 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA07553; Wed, 06 Mar 2013 15:38:06 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <513746BE.7090102@FreeBSD.org> Date: Wed, 06 Mar 2013 15:38:06 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130220 Thunderbird/17.0.3 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r247884 - stable/9/sys/dev/acpica References: <201303061052.r26Aq2bM081339@svn.freebsd.org> <20130306132054.GA48880@FreeBSD.org> In-Reply-To: <20130306132054.GA48880@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:38:09 -0000 on 06/03/2013 15:20 Alexey Dokuchaev said the following: > On Wed, Mar 06, 2013 at 10:52:02AM +0000, Andriy Gapon wrote: >> New Revision: 247884 >> URL: http://svnweb.freebsd.org/changeset/base/247884 >> >> Log: >> MFC r246251: acpi: clear power button status bit after waking up >> >> Modified: >> stable/9/sys/dev/acpica/acpi.c >> Directory Properties: >> stable/9/sys/ (props changed) >> stable/9/sys/dev/ (props changed) > > Did you have a chance to review/report back on my earlier email about MFCing > it to 8-stable (with a patch)? Not yet. The change looked OK, but since the code is so different I need to properly examine the change. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 13:46:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 44AEF3BE; Wed, 6 Mar 2013 13:46:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2804DB44; Wed, 6 Mar 2013 13:46:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26DkLJO034462; Wed, 6 Mar 2013 13:46:21 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26DkKab034460; Wed, 6 Mar 2013 13:46:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201303061346.r26DkKab034460@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 6 Mar 2013 13:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247892 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:46:21 -0000 Author: des Date: Wed Mar 6 13:46:20 2013 New Revision: 247892 URL: http://svnweb.freebsd.org/changeset/base/247892 Log: Explicitly disable lastlog, utmp and wtmp. Modified: head/crypto/openssh/FREEBSD-upgrade head/crypto/openssh/config.h Modified: head/crypto/openssh/FREEBSD-upgrade ============================================================================== --- head/crypto/openssh/FREEBSD-upgrade Wed Mar 6 11:44:19 2013 (r247891) +++ head/crypto/openssh/FREEBSD-upgrade Wed Mar 6 13:46:20 2013 (r247892) @@ -43,6 +43,7 @@ 7) Run configure with the appropriate arguments: $ ./configure --prefix=/usr --sysconfdir=/etc/ssh \ + --disable-lastlog --disable-utmp --disable-wtmp \ --with-pam --with-tcp-wrappers --with-libedit \ --with-ssl-engine Modified: head/crypto/openssh/config.h ============================================================================== --- head/crypto/openssh/config.h Wed Mar 6 11:44:19 2013 (r247891) +++ head/crypto/openssh/config.h Wed Mar 6 13:46:20 2013 (r247892) @@ -17,6 +17,9 @@ /* Define if your resolver libs need this for getrrsetbyname */ /* #undef BIND_8_COMPAT */ +/* The system has incomplete BSM API */ +/* #undef BROKEN_BSM_API */ + /* Define if cmsg_type is not passed correctly */ /* #undef BROKEN_CMSG_TYPE */ @@ -97,7 +100,7 @@ /* #undef DISABLE_FD_PASSING */ /* Define if you don't want to use lastlog */ -/* #undef DISABLE_LASTLOG */ +#define DISABLE_LASTLOG 1 /* Define if you don't want to use your system's login() call */ /* #undef DISABLE_LOGIN */ @@ -307,7 +310,7 @@ #define HAVE_DECL__GETSHORT 0 /* Define if you have /dev/ptmx */ -#define HAVE_DEV_PTMX 1 +/* #undef HAVE_DEV_PTMX */ /* Define if you have /dev/ptc */ /* #undef HAVE_DEV_PTS_AND_PTC */ @@ -316,7 +319,7 @@ #define HAVE_DIRENT_H 1 /* Define to 1 if you have the `dirfd' function. */ -/* #undef HAVE_DIRFD */ +#define HAVE_DIRFD 1 /* Define to 1 if you have the `dirname' function. */ #define HAVE_DIRNAME 1 @@ -501,6 +504,9 @@ /* Define if HEADER.ad exists in arpa/nameser.h */ #define HAVE_HEADER_AD 1 +/* Define to 1 if you have the `HMAC_CTX_init' function. */ +#define HAVE_HMAC_CTX_INIT 1 + /* Define if you have ut_host in utmp.h */ /* #undef HAVE_HOST_IN_UTMP */ @@ -552,6 +558,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LASTLOG_H */ +/* Define if you want ldns support */ +/* #undef HAVE_LDNS */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBAUDIT_H */ @@ -594,10 +603,19 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_AUDIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_FILTER_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LINUX_IF_TUN_H */ -/* Define if your libraries define login() */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_SECCOMP_H */ + +/* Define to 1 if you have the `login' function. */ /* #undef HAVE_LOGIN */ /* Define to 1 if you have the header file. */ @@ -805,6 +823,9 @@ /* Define to 1 if you have the `setgroups' function. */ #define HAVE_SETGROUPS 1 +/* Define to 1 if you have the `setlinebuf' function. */ +#define HAVE_SETLINEBUF 1 + /* Define to 1 if you have the `setlogin' function. */ #define HAVE_SETLOGIN 1 @@ -931,8 +952,11 @@ /* Define to 1 if you have the `strmode' function. */ #define HAVE_STRMODE 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strnvis' function. */ -/* #undef HAVE_STRNVIS */ +#define HAVE_STRNVIS 1 /* Define to 1 if you have the `strptime' function. */ #define HAVE_STRPTIME 1 @@ -1351,15 +1375,21 @@ /* Sandbox using setrlimit(2) */ #define SANDBOX_RLIMIT 1 +/* Sandbox using seccomp filter */ +/* #undef SANDBOX_SECCOMP_FILTER */ + +/* setrlimit RLIMIT_FSIZE works */ +/* #undef SANDBOX_SKIP_RLIMIT_FSIZE */ + /* Sandbox using systrace(4) */ /* #undef SANDBOX_SYSTRACE */ +/* Specify the system call convention in use */ +/* #undef SECCOMP_AUDIT_ARCH */ + /* Define if your platform breaks doing a seteuid before a setuid */ /* #undef SETEUID_BREAKS_SETUID */ -/* The size of `char', as computed by sizeof. */ -#define SIZEOF_CHAR 1 - /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -1500,6 +1530,11 @@ /* Define if xauth is found in your path */ /* #undef XAUTH_PATH */ +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 13:48:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AC59055C; Wed, 6 Mar 2013 13:48:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FCE9B60; Wed, 6 Mar 2013 13:48:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26DmolE034830; Wed, 6 Mar 2013 13:48:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26Dmofl034829; Wed, 6 Mar 2013 13:48:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201303061348.r26Dmofl034829@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 6 Mar 2013 13:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247893 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 13:48:50 -0000 Author: des Date: Wed Mar 6 13:48:49 2013 New Revision: 247893 URL: http://svnweb.freebsd.org/changeset/base/247893 Log: Forced commit to note that this file had not been regenerated since 5.8 due to issues with the configure script incorrectly detecting utmp and lastlog despite the fact that FreeBSD 10 does not have them any more. Modified: head/crypto/openssh/config.h Modified: head/crypto/openssh/config.h ============================================================================== From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 15:01:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 089835D5; Wed, 6 Mar 2013 15:01:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 88F4EF70; Wed, 6 Mar 2013 15:01:43 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r26F1XpW062308; Wed, 6 Mar 2013 19:01:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r26F1X44062307; Wed, 6 Mar 2013 19:01:33 +0400 (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 Mar 2013 19:01:33 +0400 From: Gleb Smirnoff To: Jung-uk Kim Subject: Re: svn commit: r246856 - head/etc Message-ID: <20130306150133.GB48089@FreeBSD.org> References: <201302152258.r1FMwiQp033077@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201302152258.r1FMwiQp033077@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 15:01:45 -0000 Jung-uk, On Fri, Feb 15, 2013 at 10:58:44PM +0000, Jung-uk Kim wrote: J> Author: jkim J> Date: Fri Feb 15 22:58:44 2013 J> New Revision: 246856 J> URL: http://svnweb.freebsd.org/changeset/base/246856 J> J> Log: J> Revert r227528 and r227787. This hack is no longer necessary since r233580. I'm sorry, but it doesn't work. Mouse isn't working after resume for me on r247873. Please return the code back, and I'd appreciate if next time you back something out, you communicate with the person who added the code to give him a chance to confirm or decline whether code is still needed or not. Thanks. J> Modified: J> head/etc/rc.resume J> J> Modified: head/etc/rc.resume J> ============================================================================== J> --- head/etc/rc.resume Fri Feb 15 22:43:08 2013 (r246855) J> +++ head/etc/rc.resume Fri Feb 15 22:58:44 2013 (r246856) J> @@ -43,10 +43,6 @@ if [ -r /var/run/rc.suspend.pid ]; then J> echo 'rc.resume: killed rc.suspend that was still around' J> fi J> J> -if [ -r /var/run/moused.pid ]; then J> - pkill -HUP -F /var/run/moused.pid J> -fi J> - J> # Turns on a power supply of a card in the slot inactivated. J> # See also contrib/pccardq.c (only for PAO users). J> # pccardq | awk -F '~' '$5 == "inactive" \ -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 18:44:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45250A33; Wed, 6 Mar 2013 18:44:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 377FDE6A; Wed, 6 Mar 2013 18:44:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26IikMj028229; Wed, 6 Mar 2013 18:44:46 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26Iik3M028227; Wed, 6 Mar 2013 18:44:46 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201303061844.r26Iik3M028227@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 6 Mar 2013 18:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247896 - stable/9/tools/tools/cxgbetool 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:44:46 -0000 Author: np Date: Wed Mar 6 18:44:45 2013 New Revision: 247896 URL: http://svnweb.freebsd.org/changeset/base/247896 Log: MFC r247854: Fix compile warning by including ctype.h for isdigit(). Modified: stable/9/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/9/tools/tools/cxgbetool/ (props changed) Modified: stable/9/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- stable/9/tools/tools/cxgbetool/cxgbetool.c Wed Mar 6 18:39:40 2013 (r247895) +++ stable/9/tools/tools/cxgbetool/cxgbetool.c Wed Mar 6 18:44:45 2013 (r247896) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 18:45:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC304B56; Wed, 6 Mar 2013 18:45:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 28CEDE6D; Wed, 6 Mar 2013 18:45:01 +0000 (UTC) Message-ID: <51378E2E.4090709@FreeBSD.org> Date: Wed, 06 Mar 2013 13:42:54 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130220 Thunderbird/17.0.3 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r246856 - head/etc References: <201302152258.r1FMwiQp033077@svn.freebsd.org> <20130306150133.GB48089@FreeBSD.org> In-Reply-To: <20130306150133.GB48089@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:45:01 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2013-03-06 10:01:33 -0500, Gleb Smirnoff wrote: > Jung-uk, > > On Fri, Feb 15, 2013 at 10:58:44PM +0000, Jung-uk Kim wrote: J> > Author: jkim J> Date: Fri Feb 15 22:58:44 2013 J> New Revision: > 246856 J> URL: http://svnweb.freebsd.org/changeset/base/246856 J> > J> Log: J> Revert r227528 and r227787. This hack is no longer > necessary since r233580. > > I'm sorry, but it doesn't work. Mouse isn't working after resume > for me on r247873. > > Please return the code back, and I'd appreciate if next time you > back something out, you communicate with the person who added the > code to give him a chance to confirm or decline whether code is > still needed or not. > > Thanks. > > J> Modified: J> head/etc/rc.resume J> J> Modified: > head/etc/rc.resume J> > ============================================================================== > > J> --- head/etc/rc.resume Fri Feb 15 22:43:08 2013 (r246855) > J> +++ head/etc/rc.resume Fri Feb 15 22:58:44 2013 (r246856) J> @@ > -43,10 +43,6 @@ if [ -r /var/run/rc.suspend.pid ]; then J> echo > 'rc.resume: killed rc.suspend that was still around' J> fi J> J> > -if [ -r /var/run/moused.pid ]; then J> - pkill -HUP -F > /var/run/moused.pid J> -fi J> - J> # Turns on a power supply of a > card in the slot inactivated. J> # See also contrib/pccardq.c > (only for PAO users). J> # pccardq | awk -F '~' '$5 == "inactive" > \ > You know, I disagreed with the above change because this type of quirks can be easily handled by the driver. IMHO, /etc/rc.resume is the last place to put it. When I committed r233580 to fix resuming psm(4) and MFC'd it to stable/9 (r234713), we had an agreement to back it out if we hear no user complaints for enough time *without* merging your /etc/rc.resume changes. At least, that's what I remember. In fact, you never MFC'd your changes. So, I thought the agreement is still valid and it is safe to back out. I am sorry for not asking your confirmation, though. Now, please consider fixing psm. If you can't find a generic solution, it is okay to add your model-specific quirk in sys/dev/atkbdc/psm.c like this: http://svnweb.freebsd.org/base/head/sys/dev/atkbdc/psm.c?annotate=233580#l1441 Also, please mention it in the manual page, i.e., the CAVEATS section of psm(4). Thanks, Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBAgAGBQJRN44uAAoJECXpabHZMqHO1loH/3/lBVpM/mo+VhOJmK3u2qqk /8o7Lxyv6sLZ0Og9hCoyi1EKVFUAxuPoVWeyeydPFSs2NcbJZvP9E80T4ompCGX9 m6wOs3SqI1LBNwIpWWa7O6M0rGhkP4Y0uFUe7MLN5/8FW1OEEChcboo11iq2Ftex mzaElMFjefXbw3DDyknqZNyBbEWkSsPyhuMN1TpLXR0VVSM8/dzUsxwbYk1rrWrf TY4U9wzvJz0rgMkjAhB8SPJl/JO7NLQGMlnhLNzIR7EMbtO2EZ5OLxNFJsqZ4pjf XbRDFrtGT3N90UIKhpivBSG9+929hAwS+y29wn3xn5B8aUdmfcgT5mHH8LXY7DI= =KcJ+ -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 18:45:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E7E59CC0; Wed, 6 Mar 2013 18:45:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DAA37E73; Wed, 6 Mar 2013 18:45:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26IjBSa028355; Wed, 6 Mar 2013 18:45:11 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26IjBVv028354; Wed, 6 Mar 2013 18:45:11 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201303061845.r26IjBVv028354@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 6 Mar 2013 18:45:11 +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: r247897 - stable/8/tools/tools/cxgbetool 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:45:12 -0000 Author: np Date: Wed Mar 6 18:45:11 2013 New Revision: 247897 URL: http://svnweb.freebsd.org/changeset/base/247897 Log: MFC r247854: Fix compile warning by including ctype.h for isdigit(). Modified: stable/8/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/8/tools/tools/cxgbetool/ (props changed) Modified: stable/8/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- stable/8/tools/tools/cxgbetool/cxgbetool.c Wed Mar 6 18:44:45 2013 (r247896) +++ stable/8/tools/tools/cxgbetool/cxgbetool.c Wed Mar 6 18:45:11 2013 (r247897) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 18:47:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E00EEEA5 for ; Wed, 6 Mar 2013 18:47:36 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vb0-x22c.google.com (mail-vb0-x22c.google.com [IPv6:2607:f8b0:400c:c02::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DFEDE9B for ; Wed, 6 Mar 2013 18:47:36 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fr13so1847200vbb.3 for ; Wed, 06 Mar 2013 10:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=XybkFQiQVo+gyAjcMhyXBZJz5nZ/eiZ0VBfFJXLdDe4=; b=cyRr0nkfoEkl0cs4g7Owuu+gmPYzxp0TaZFLzTao4DgARZ4yOsVW1v7crDP07Tn8wz xhQYjy99pOt3haTCUACLmLoGkZZlOaiVaqDKRwlAnJ3DP0P9NdrtcfRB1EaHrqqPtZcY hYErqtX35hivjhA4E76gsWycvz8oEoFBXLeLA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding :x-gm-message-state; bh=XybkFQiQVo+gyAjcMhyXBZJz5nZ/eiZ0VBfFJXLdDe4=; b=QgSMGhZgr5cVeTvoo5oUEKae7WGhcg7L0jI9a1K32gOuZNQgEiP8I8CJ+Z0JGnaoOG ApGyzTVQqZWB1eFi4d1asbGPI/r2ULxdIMkQlgyz+o0Xhu0sb/tid9kPik2OkVLO+r6T CGrqNuCEAgFmjBcvhCu+PeWqdM0y31SQxZ7E691cAMZ2wC66++TSnkf2fBFnhpFzSXnL uBadLz7VaKS0g5LltZCc4jhV/AwcoBSXRtHvVFN73XV2rpfhP0hefYPsATO+TBAUS/eR az01Hw4SGwPDxJT9/8Oh9XyXipJorJfxyRKCNSUNAuwgJ8dc3GundIZ/6ypgRdeaItW+ GDQA== MIME-Version: 1.0 X-Received: by 10.52.72.137 with SMTP id d9mr10305346vdv.105.1362595655760; Wed, 06 Mar 2013 10:47:35 -0800 (PST) Received: by 10.221.11.72 with HTTP; Wed, 6 Mar 2013 10:47:35 -0800 (PST) In-Reply-To: <201303061346.r26DkKab034460@svn.freebsd.org> References: <201303061346.r26DkKab034460@svn.freebsd.org> Date: Wed, 6 Mar 2013 10:47:35 -0800 Message-ID: Subject: Re: svn commit: r247892 - head/crypto/openssh From: Peter Wemm To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkH3xcFyRGThFY6SMx38j9nADD1ob3SIPxcKzOE5XSE4EM6Ho+QI2tT4JpUPVv1tlg4iTJr Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:47:36 -0000 On Wed, Mar 6, 2013 at 5:46 AM, Dag-Erling Sm=F8rgrav wro= te: > @@ -931,8 +952,11 @@ > /* Define to 1 if you have the `strmode' function. */ > #define HAVE_STRMODE 1 > > +/* Define to 1 if you have the `strnlen' function. */ > +#define HAVE_STRNLEN 1 > + > /* Define to 1 if you have the `strnvis' function. */ > -/* #undef HAVE_STRNVIS */ > +#define HAVE_STRNVIS 1 We may have a derp moment here: =3D=3D=3D> secure/libexec/sftp-server (all) ... /usr/obj/scratch/src/tmp/usr/lib/libssh.so: undefined reference to `ssh_strnvis'^M cc: error: linker command failed with exit code 1 (use -v to see invocation= )^M ... --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 18:59:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A5DBD550 for ; Wed, 6 Mar 2013 18:59:57 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx1.freebsd.org (Postfix) with ESMTP id 4CCBDF22 for ; Wed, 6 Mar 2013 18:59:57 +0000 (UTC) Received: by mail-ve0-f179.google.com with SMTP id da11so6927886veb.38 for ; Wed, 06 Mar 2013 10:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=SnK12Sb4YyGEMd1QdKAwCtnOstU2RWvBkG87olUiAh0=; b=JbcF2PPRT/trhNm2VxVBqSG/DAKgiHTCIN14lQEdH+c+Rs3gtyUSIrZHS6sKH4L6Tc I+pyuhS0bsMobS8Ckc97Lu2h7mGpQSa7VkGnS4xigC57/9aSjMf44G6SWXfUlPt5Q0M/ iTA3E1ds6VqNgskscXYgwkSZZPQJ86wkwoBOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding :x-gm-message-state; bh=SnK12Sb4YyGEMd1QdKAwCtnOstU2RWvBkG87olUiAh0=; b=B3mv6ftCWNPccVCBqK2KFXElXCdrh0Jy1ozkZOX1wSP2Ji6xgCTTi7TdEXPfa/22S6 tEx2WjRJDlbd0X2valyH20z4016nQgnARM2SkdOSwVqqHQOLC4yo1hLvcwqCYK6kuPXy vyY2ikGXk82LyWERez9Q3UySkDGK8tusPlvgwAqmDzuoC85YnS85kEDGKW+E1dOgoBN4 7dzI0XpSt2aXlSN1IJdsVhLUvqWC8KOGwn52/kVoEYuQZknYd+J9CsAAoxlGCOOsohG7 3zItW3zi/cGpCy67KykIU34QP8jo5JklBhA/L2Ulm67yf6a90ka0BR066/BeT6tU0UaZ eKug== MIME-Version: 1.0 X-Received: by 10.52.31.103 with SMTP id z7mr10291736vdh.56.1362596396404; Wed, 06 Mar 2013 10:59:56 -0800 (PST) Received: by 10.221.11.72 with HTTP; Wed, 6 Mar 2013 10:59:56 -0800 (PST) In-Reply-To: References: <201303061346.r26DkKab034460@svn.freebsd.org> Date: Wed, 6 Mar 2013 10:59:56 -0800 Message-ID: Subject: Re: svn commit: r247892 - head/crypto/openssh From: Peter Wemm To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQknBl62aM/9m4Jxok2UEzMxes8zaIloXHgxoBEOmWXvGQ/sWp2d3dsQzRAAGfSpDye1ppci Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 18:59:57 -0000 On Wed, Mar 6, 2013 at 10:47 AM, Peter Wemm wrote: > On Wed, Mar 6, 2013 at 5:46 AM, Dag-Erling Sm=F8rgrav w= rote: > >> @@ -931,8 +952,11 @@ >> /* Define to 1 if you have the `strmode' function. */ >> #define HAVE_STRMODE 1 >> >> +/* Define to 1 if you have the `strnlen' function. */ >> +#define HAVE_STRNLEN 1 >> + >> /* Define to 1 if you have the `strnvis' function. */ >> -/* #undef HAVE_STRNVIS */ >> +#define HAVE_STRNVIS 1 > > > We may have a derp moment here: > =3D=3D=3D> secure/libexec/sftp-server (all) > ... > /usr/obj/scratch/src/tmp/usr/lib/libssh.so: undefined reference to > `ssh_strnvis'^M > cc: error: linker command failed with exit code 1 (use -v to see invocati= on)^M > ... Probably need to remove: * $FreeBSD: head/crypto/openssh/ssh_namespace.h 240075 2012-09-03 16:51:41Z des $ ... #define strnvis ssh_strnvis ... if the compat stub is being disabled. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV bitcoin:188ZjyYLFJiEheQZw4UtU27e2FMLmuRBUE From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 19:37:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D257AF6B; Wed, 6 Mar 2013 19:37:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C026B1B4; Wed, 6 Mar 2013 19:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26JbdKn044061; Wed, 6 Mar 2013 19:37:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26JbdNR044058; Wed, 6 Mar 2013 19:37:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303061937.r26JbdNR044058@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Mar 2013 19:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247898 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 19:37:39 -0000 Author: mav Date: Wed Mar 6 19:37:38 2013 New Revision: 247898 URL: http://svnweb.freebsd.org/changeset/base/247898 Log: Fix time math overflows and improve zero intervals handling in poll(), select(), nanosleep() and kevent() functions after calloutng changes. Reported by: bde Modified: head/sys/kern/kern_event.c head/sys/kern/kern_time.c head/sys/kern/sys_generic.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Mar 6 18:45:11 2013 (r247897) +++ head/sys/kern/kern_event.c Wed Mar 6 19:37:38 2013 (r247898) @@ -1329,11 +1329,16 @@ kqueue_scan(struct kqueue *kq, int maxev goto done_nl; } if (timespecisset(tsp)) { - rsbt = tstosbt(*tsp); - if (TIMESEL(&asbt, rsbt)) - asbt += tc_tick_sbt; - asbt += rsbt; - rsbt >>= tc_precexp; + if (tsp->tv_sec < INT32_MAX) { + rsbt = tstosbt(*tsp); + if (TIMESEL(&asbt, rsbt)) + asbt += tc_tick_sbt; + asbt += rsbt; + if (asbt < rsbt) + asbt = 0; + rsbt >>= tc_precexp; + } else + asbt = 0; } else asbt = -1; } else Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Wed Mar 6 18:45:11 2013 (r247897) +++ head/sys/kern/kern_time.c Wed Mar 6 19:37:38 2013 (r247898) @@ -484,13 +484,20 @@ kern_nanosleep(struct thread *td, struct { struct timespec ts; sbintime_t sbt, sbtt, prec, tmp; + time_t over; int error; if (rqt->tv_nsec < 0 || rqt->tv_nsec >= 1000000000) return (EINVAL); if (rqt->tv_sec < 0 || (rqt->tv_sec == 0 && rqt->tv_nsec == 0)) return (0); - tmp = tstosbt(*rqt); + ts = *rqt; + if (ts.tv_sec > INT32_MAX / 2) { + over = ts.tv_sec - INT32_MAX / 2; + ts.tv_sec -= over; + } else + over = 0; + tmp = tstosbt(ts); prec = tmp; prec >>= tc_precexp; if (TIMESEL(&sbt, tmp)) @@ -504,6 +511,7 @@ kern_nanosleep(struct thread *td, struct TIMESEL(&sbtt, tmp); if (rmt != NULL) { ts = sbttots(sbt - sbtt); + ts.tv_sec += over; if (ts.tv_sec < 0) timespecclear(&ts); *rmt = ts; Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Wed Mar 6 18:45:11 2013 (r247897) +++ head/sys/kern/sys_generic.c Wed Mar 6 19:37:38 2013 (r247898) @@ -1051,12 +1051,19 @@ kern_select(struct thread *td, int nd, f error = EINVAL; goto done; } - rsbt = tvtosbt(rtv); - precision = rsbt; - precision >>= tc_precexp; - if (TIMESEL(&asbt, rsbt)) - asbt += tc_tick_sbt; - asbt += rsbt; + if (rtv.tv_sec == 0 && rtv.tv_usec == 0) + asbt = 0; + else if (rtv.tv_sec < INT32_MAX) { + rsbt = tvtosbt(rtv); + precision = rsbt; + precision >>= tc_precexp; + if (TIMESEL(&asbt, rsbt)) + asbt += tc_tick_sbt; + asbt += rsbt; + if (asbt < rsbt) + asbt = -1; + } else + asbt = -1; } else asbt = -1; seltdinit(td); @@ -1295,12 +1302,16 @@ sys_poll(td, uap) error = EINVAL; goto done; } - rsbt = SBT_1MS * uap->timeout; - precision = rsbt; - precision >>= tc_precexp; - if (TIMESEL(&asbt, rsbt)) - asbt += tc_tick_sbt; - asbt += rsbt; + if (uap->timeout == 0) + asbt = 0; + else { + rsbt = SBT_1MS * uap->timeout; + precision = rsbt; + precision >>= tc_precexp; + if (TIMESEL(&asbt, rsbt)) + asbt += tc_tick_sbt; + asbt += rsbt; + } } else asbt = -1; seltdinit(td); From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 20:00:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 757695E5; Wed, 6 Mar 2013 20:00:31 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4553A2CB; Wed, 6 Mar 2013 20:00:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26K05rg048883; Wed, 6 Mar 2013 20:00:15 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26JxrBR048869; Wed, 6 Mar 2013 19:59:53 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201303061959.r26JxrBR048869@svn.freebsd.org> From: Niclas Zeising Date: Wed, 6 Mar 2013 19:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247899 - head/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 20:00:31 -0000 Author: zeising (doc,ports committer) Date: Wed Mar 6 19:59:42 2013 New Revision: 247899 URL: http://svnweb.freebsd.org/changeset/base/247899 Log: Create a symlink from strchrnul.3 to strchr.3. This was forgotten in the initial commit of strchrnul() Approved by: theraven Modified: head/lib/libc/string/Makefile.inc Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Wed Mar 6 19:37:38 2013 (r247898) +++ head/lib/libc/string/Makefile.inc Wed Mar 6 19:59:42 2013 (r247899) @@ -46,7 +46,8 @@ MLINKS+=strcasecmp.3 strncasecmp.3 \ strcasecmp.3 strcasecmp_l.3 \ strcasecmp.3 strncasecmp_l.3 MLINKS+=strcat.3 strncat.3 -MLINKS+=strchr.3 strrchr.3 +MLINKS+=strchr.3 strrchr.3 \ + strchr.3 strchrnul.3 MLINKS+=strcmp.3 strncmp.3 MLINKS+=strcoll.3 strcoll_l.3 MLINKS+=strcpy.3 stpcpy.3 \ From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 20:02:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E461681E; Wed, 6 Mar 2013 20:02:59 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D5B45303; Wed, 6 Mar 2013 20:02:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26K2bnk050875; Wed, 6 Mar 2013 20:02:47 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26K2PrL050857; Wed, 6 Mar 2013 20:02:25 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201303062002.r26K2PrL050857@svn.freebsd.org> From: Peter Holm Date: Wed, 6 Mar 2013 20:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247900 - stable/9/sbin/tunefs 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 20:03:00 -0000 Author: pho Date: Wed Mar 6 20:02:19 2013 New Revision: 247900 URL: http://svnweb.freebsd.org/changeset/base/247900 Log: MFC r247399: The .journal file needs to reside on the ROOTINO which must not extend beyond direct blocks. A typo caused this check to fail. Modified: stable/9/sbin/tunefs/tunefs.c Directory Properties: stable/9/sbin/tunefs/ (props changed) Modified: stable/9/sbin/tunefs/tunefs.c ============================================================================== --- stable/9/sbin/tunefs/tunefs.c Wed Mar 6 19:59:42 2013 (r247899) +++ stable/9/sbin/tunefs/tunefs.c Wed Mar 6 20:02:19 2013 (r247900) @@ -672,7 +672,7 @@ journal_findfile(void) return (ino); } } else { - if ((off_t)dp1->di_size >= lblktosize(&sblock, NDADDR)) { + if ((off_t)dp2->di_size >= lblktosize(&sblock, NDADDR)) { warnx("ROOTINO extends beyond direct blocks."); return (-1); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 21:30:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BBC7DB7; Wed, 6 Mar 2013 21:30:42 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ACCB69A2; Wed, 6 Mar 2013 21:30:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26LUgnw073889; Wed, 6 Mar 2013 21:30:42 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26LUgHn073888; Wed, 6 Mar 2013 21:30:42 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201303062130.r26LUgHn073888@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 6 Mar 2013 21:30:42 +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: r247901 - stable/8/tools/regression/bin/sh/builtins 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 21:30:42 -0000 Author: jilles Date: Wed Mar 6 21:30:42 2013 New Revision: 247901 URL: http://svnweb.freebsd.org/changeset/base/247901 Log: MFC r213713 by obrien: Correct regression test to not show a false positive when run as root. Modified: stable/8/tools/regression/bin/sh/builtins/cd1.0 Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Modified: stable/8/tools/regression/bin/sh/builtins/cd1.0 ============================================================================== --- stable/8/tools/regression/bin/sh/builtins/cd1.0 Wed Mar 6 20:02:19 2013 (r247900) +++ stable/8/tools/regression/bin/sh/builtins/cd1.0 Wed Mar 6 21:30:42 2013 (r247901) @@ -6,12 +6,15 @@ cd $P T=$(mktemp -d sh-test.XXXXXX) chmod 0 $T -cd -L $T 2>/dev/null && exit 1 -[ "$PWD" = "$P" ] -[ "$(pwd)" = "$P" ] -cd -P $T 2>/dev/null && exit 1 -[ "$PWD" = "$P" ] -[ "$(pwd)" = "$P" ] +if [ `id -u` -ne 0 ]; then + # Root can always cd, irregardless of directory permissions. + cd -L $T 2>/dev/null && exit 1 + [ "$PWD" = "$P" ] + [ "$(pwd)" = "$P" ] + cd -P $T 2>/dev/null && exit 1 + [ "$PWD" = "$P" ] + [ "$(pwd)" = "$P" ] +fi chmod 755 $T cd $T From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 22:12:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D1C0EE50; Wed, 6 Mar 2013 22:12:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B46E2B59; Wed, 6 Mar 2013 22:12:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26MCjCA086449; Wed, 6 Mar 2013 22:12:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26MCj0v086448; Wed, 6 Mar 2013 22:12:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201303062212.r26MCj0v086448@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 6 Mar 2013 22:12:45 +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: r247902 - stable/8/bin/sh 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 22:12:45 -0000 Author: jilles Date: Wed Mar 6 22:12:45 2013 New Revision: 247902 URL: http://svnweb.freebsd.org/changeset/base/247902 Log: MFC r246522: sh: Simplify mksyntax and make it fit for cross-compiling. Now it outputs fixed files, which use constants provided by the C standard library to determine appropriate values for the target machine. Before, mksyntax inspected the host machine which resulted in subtle breakage if e.g. char is signed on the host and unsigned on the target such as when cross-compiling on x86 for ARM. Tested by: ian (this patch) Submitted by: Christoph Mallon (patch for head) Modified: stable/8/bin/sh/mksyntax.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/mksyntax.c ============================================================================== --- stable/8/bin/sh/mksyntax.c Wed Mar 6 21:30:42 2013 (r247901) +++ stable/8/bin/sh/mksyntax.c Wed Mar 6 22:12:45 2013 (r247902) @@ -101,23 +101,16 @@ static char writer[] = "\ static FILE *cfile; static FILE *hfile; -static const char *syntax[513]; -static int base; -static int size; /* number of values which a char variable can have */ -static int nbits; /* number of bits in a character */ -static void filltable(const char *); -static void init(void); +static void add_default(void); +static void finish(void); +static void init(const char *); static void add(const char *, const char *); -static void print(const char *); static void output_type_macros(void); int main(int argc __unused, char **argv __unused) { - char c; - char d; - int sign; int i; char buf[80]; int pos; @@ -134,28 +127,9 @@ main(int argc __unused, char **argv __un fputs(writer, hfile); fputs(writer, cfile); - /* Determine the characteristics of chars. */ - c = -1; - sign = (c > 0) ? 0 : 1; - for (nbits = 1 ; ; nbits++) { - d = (1 << nbits) - 1; - if (d == c) - break; - } -#if 0 - printf("%s %d bit chars\n", sign? "signed" : "unsigned", nbits); -#endif - if (nbits > 9) { - fputs("Characters can't have more than 9 bits\n", stderr); - exit(2); - } - size = (1 << nbits) + 1; - base = 1; - if (sign) - base += 1 << (nbits - 1); - fputs("#include \n", hfile); fputs("#include \n", hfile); + fputs("#include \n\n", hfile); /* Generate the #define statements in the header file */ fputs("/* Syntax classes */\n", hfile); @@ -176,8 +150,8 @@ main(int argc __unused, char **argv __un fprintf(hfile, "/* %s */\n", is_entry[i].comment); } putc('\n', hfile); - fprintf(hfile, "#define SYNBASE %d\n", base); - fprintf(hfile, "#define PEOF %d\n\n", -base); + fputs("#define SYNBASE (1 - CHAR_MIN)\n", hfile); + fputs("#define PEOF -SYNBASE\n\n", hfile); putc('\n', hfile); fputs("#define BASESYNTAX (basesyntax + SYNBASE)\n", hfile); fputs("#define DQSYNTAX (dqsyntax + SYNBASE)\n", hfile); @@ -188,10 +162,13 @@ main(int argc __unused, char **argv __un putc('\n', hfile); /* Generate the syntax tables. */ + fputs("#include \"parser.h\"\n", cfile); fputs("#include \"shell.h\"\n", cfile); fputs("#include \"syntax.h\"\n\n", cfile); - init(); + fputs("/* syntax table used when not in quotes */\n", cfile); + init("basesyntax"); + add_default(); add("\n", "CNL"); add("\\", "CBACK"); add("'", "CSQUOTE"); @@ -200,9 +177,11 @@ main(int argc __unused, char **argv __un add("$", "CVAR"); add("}", "CENDVAR"); add("<>();&| \t", "CSPCL"); - print("basesyntax"); - init(); + finish(); + fputs("\n/* syntax table used when in double quotes */\n", cfile); + init("dqsyntax"); + add_default(); add("\n", "CNL"); add("\\", "CBACK"); add("\"", "CENDQUOTE"); @@ -211,16 +190,20 @@ main(int argc __unused, char **argv __un add("}", "CENDVAR"); /* ':/' for tilde expansion, '-' for [a\-x] pattern ranges */ add("!*?[=~:/-", "CCTL"); - print("dqsyntax"); - init(); + finish(); + fputs("\n/* syntax table used when in single quotes */\n", cfile); + init("sqsyntax"); + add_default(); add("\n", "CNL"); add("'", "CENDQUOTE"); /* ':/' for tilde expansion, '-' for [a\-x] pattern ranges */ add("!*?[=~:/-", "CCTL"); - print("sqsyntax"); - init(); + finish(); + fputs("\n/* syntax table used when in arithmetic */\n", cfile); + init("arisyntax"); + add_default(); add("\n", "CNL"); add("\\", "CBACK"); add("`", "CBQUOTE"); @@ -230,99 +213,94 @@ main(int argc __unused, char **argv __un add("}", "CENDVAR"); add("(", "CLP"); add(")", "CRP"); - print("arisyntax"); - filltable("0"); + finish(); + fputs("\n/* character classification table */\n", cfile); + init("is_type"); add("0123456789", "ISDIGIT"); add("abcdefghijklmnopqrstucvwxyz", "ISLOWER"); add("ABCDEFGHIJKLMNOPQRSTUCVWXYZ", "ISUPPER"); add("_", "ISUNDER"); add("#?$!-*@", "ISSPECL"); - print("is_type"); + finish(); + exit(0); } - /* - * Clear the syntax table. + * Output the header and declaration of a syntax table. */ static void -filltable(const char *dftval) +init(const char *name) { - int i; + fprintf(hfile, "extern const char %s[];\n", name); + fprintf(cfile, "const char %s[SYNBASE + CHAR_MAX + 1] = {\n", name); +} + - for (i = 0 ; i < size ; i++) - syntax[i] = dftval; +static void +add_one(const char *key, const char *type) +{ + fprintf(cfile, "\t[SYNBASE + %s] = %s,\n", key, type); } /* - * Initialize the syntax table with default values. + * Add default values to the syntax table. */ static void -init(void) +add_default(void) { - filltable("CWORD"); - syntax[0] = "CEOF"; - syntax[base + CTLESC] = "CCTL"; - syntax[base + CTLVAR] = "CCTL"; - syntax[base + CTLENDVAR] = "CCTL"; - syntax[base + CTLBACKQ] = "CCTL"; - syntax[base + CTLBACKQ + CTLQUOTE] = "CCTL"; - syntax[base + CTLARI] = "CCTL"; - syntax[base + CTLENDARI] = "CCTL"; - syntax[base + CTLQUOTEMARK] = "CCTL"; + add_one("PEOF", "CEOF"); + add_one("CTLESC", "CCTL"); + add_one("CTLVAR", "CCTL"); + add_one("CTLENDVAR", "CCTL"); + add_one("CTLBACKQ", "CCTL"); + add_one("CTLBACKQ + CTLQUOTE", "CCTL"); + add_one("CTLARI", "CCTL"); + add_one("CTLENDARI", "CCTL"); + add_one("CTLQUOTEMARK", "CCTL"); } /* - * Add entries to the syntax table. + * Output the footer of a syntax table. */ static void -add(const char *p, const char *type) +finish(void) { - while (*p) - syntax[*p++ + base] = type; + fputs("};\n", cfile); } - /* - * Output the syntax table. + * Add entries to the syntax table. */ static void -print(const char *name) +add(const char *p, const char *type) { - int i; - int col; - - fprintf(hfile, "extern const char %s[];\n", name); - fprintf(cfile, "const char %s[%d] = {\n", name, size); - col = 0; - for (i = 0 ; i < size ; i++) { - if (i == 0) { - fputs(" ", cfile); - } else if ((i & 03) == 0) { - fputs(",\n ", cfile); - col = 0; - } else { - putc(',', cfile); - while (++col < 9 * (i & 03)) - putc(' ', cfile); + for (; *p; ++p) { + char c = *p; + switch (c) { + case '\t': c = 't'; break; + case '\n': c = 'n'; break; + case '\'': c = '\''; break; + case '\\': c = '\\'; break; + + default: + fprintf(cfile, "\t[SYNBASE + '%c'] = %s,\n", c, type); + continue; } - fputs(syntax[i], cfile); - col += strlen(syntax[i]); + fprintf(cfile, "\t[SYNBASE + '\\%c'] = %s,\n", c, type); } - fputs("\n};\n", cfile); } - /* * Output character classification macros (e.g. is_digit). If digits are * contiguous, we can test for them quickly. From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 22:40:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BFE4F9BF; Wed, 6 Mar 2013 22:40:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1160D6F; Wed, 6 Mar 2013 22:40:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26MelrE095464; Wed, 6 Mar 2013 22:40:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26MelaH095463; Wed, 6 Mar 2013 22:40:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303062240.r26MelaH095463@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Mar 2013 22:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247903 - 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.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 22:40:47 -0000 Author: mav Date: Wed Mar 6 22:40:47 2013 New Revision: 247903 URL: http://svnweb.freebsd.org/changeset/base/247903 Log: Reduce minimal time intervals of setitimer(2) from 1/HZ to 1/(16*HZ) by using callout_reset_sbt() instead of callout_reset(). We can't remove lower limit completely in this case because of significant processing overhead, caused by unability to use direct callout execution due to using process mutex in callout handler for sending SEGALRM signal. With support of periodic events that would allow unprivileged user to abuse the system. Reviewed by: davide Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Wed Mar 6 22:12:45 2013 (r247902) +++ head/sys/kern/kern_time.c Wed Mar 6 22:40:47 2013 (r247903) @@ -691,7 +691,7 @@ kern_getitimer(struct thread *td, u_int *aitv = p->p_realtimer; PROC_UNLOCK(p); if (timevalisset(&aitv->it_value)) { - getmicrouptime(&ctv); + microuptime(&ctv); if (timevalcmp(&aitv->it_value, &ctv, <)) timevalclear(&aitv->it_value); else @@ -736,28 +736,33 @@ kern_setitimer(struct thread *td, u_int { struct proc *p = td->td_proc; struct timeval ctv; + sbintime_t sbt, pr; if (aitv == NULL) return (kern_getitimer(td, which, oitv)); if (which > ITIMER_PROF) return (EINVAL); - if (itimerfix(&aitv->it_value)) + if (itimerfix(&aitv->it_value) || + aitv->it_value.tv_sec > INT32_MAX / 2) return (EINVAL); if (!timevalisset(&aitv->it_value)) timevalclear(&aitv->it_interval); - else if (itimerfix(&aitv->it_interval)) + else if (itimerfix(&aitv->it_interval) || + aitv->it_interval.tv_sec > INT32_MAX / 2) return (EINVAL); if (which == ITIMER_REAL) { PROC_LOCK(p); if (timevalisset(&p->p_realtimer.it_value)) callout_stop(&p->p_itcallout); - getmicrouptime(&ctv); + microuptime(&ctv); if (timevalisset(&aitv->it_value)) { - callout_reset(&p->p_itcallout, tvtohz(&aitv->it_value), - realitexpire, p); + pr = tvtosbt(aitv->it_value) >> tc_precexp; timevaladd(&aitv->it_value, &ctv); + sbt = tvtosbt(aitv->it_value); + callout_reset_sbt(&p->p_itcallout, sbt, pr, + realitexpire, p, C_ABSOLUTE); } *oitv = p->p_realtimer; p->p_realtimer = *aitv; @@ -793,7 +798,8 @@ void realitexpire(void *arg) { struct proc *p; - struct timeval ctv, ntv; + struct timeval ctv; + sbintime_t isbt; p = (struct proc *)arg; kern_psignal(p, SIGALRM); @@ -803,19 +809,17 @@ realitexpire(void *arg) wakeup(&p->p_itcallout); return; } - for (;;) { + isbt = tvtosbt(p->p_realtimer.it_interval); + if (isbt >= sbt_timethreshold) + getmicrouptime(&ctv); + else + microuptime(&ctv); + do { timevaladd(&p->p_realtimer.it_value, &p->p_realtimer.it_interval); - getmicrouptime(&ctv); - if (timevalcmp(&p->p_realtimer.it_value, &ctv, >)) { - ntv = p->p_realtimer.it_value; - timevalsub(&ntv, &ctv); - callout_reset(&p->p_itcallout, tvtohz(&ntv) - 1, - realitexpire, p); - return; - } - } - /*NOTREACHED*/ + } while (timevalcmp(&p->p_realtimer.it_value, &ctv, <=)); + callout_reset_sbt(&p->p_itcallout, tvtosbt(p->p_realtimer.it_value), + isbt >> tc_precexp, realitexpire, p, C_ABSOLUTE); } /* @@ -830,8 +834,9 @@ itimerfix(struct timeval *tv) if (tv->tv_sec < 0 || tv->tv_usec < 0 || tv->tv_usec >= 1000000) return (EINVAL); - if (tv->tv_sec == 0 && tv->tv_usec != 0 && tv->tv_usec < tick) - tv->tv_usec = tick; + if (tv->tv_sec == 0 && tv->tv_usec != 0 && + tv->tv_usec < (u_int)tick / 16) + tv->tv_usec = (u_int)tick / 16; return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 23:16:18 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2ED5D8F7; Wed, 6 Mar 2013 23:16:18 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510b]) by mx1.freebsd.org (Postfix) with SMTP id 14BE8F56; Wed, 6 Mar 2013 23:16:16 +0000 (UTC) Received: from walton.maths.tcd.ie ([IPv6:2001:770:10:300::86e2:510a] helo=walton.maths.tcd.ie) by salmon.maths.tcd.ie with SMTP id ; 6 Mar 2013 23:16:14 +0000 (GMT) Received: by walton.maths.tcd.ie (Postfix, from userid 238) id 3769E7306E; Wed, 6 Mar 2013 23:16:13 +0000 (GMT) Date: Wed, 6 Mar 2013 23:16:13 +0000 From: David Malone To: Peter Grehan Subject: Re: svn commit: r247871 - head/usr.sbin/bhyve Message-ID: <20130306231613.GA5146@walton.maths.tcd.ie> References: <201303060728.r267SKP3018477@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201303060728.r267SKP3018477@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:16:18 -0000 > + /* > + * We're just computing (a-b) in GF(216). > + ndesc = (unsigned)*hq->hq_avail_idx - (unsigned)hq->hq_cur_aidx; I think the comment here is wrong? Subtraction (and addition) in GF(2^16) is just xor of 16 bit numbers. You seem to actually be working in Z(2^16), where subtraction is normal subtraction mod 65536. David. From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 23:20:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA07CC0E for ; Wed, 6 Mar 2013 23:20:48 +0000 (UTC) (envelope-from bounces+73574-8822-svn-src-all=freebsd.org@sendgrid.me) Received: from o3.shared.sendgrid.net (o3.shared.sendgrid.net [208.117.48.85]) by mx1.freebsd.org (Postfix) with SMTP id 48F6EF99 for ; Wed, 6 Mar 2013 23:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpapi; bh=X2op83wuBKEbem2TabqVUR /EwbI=; b=zlgbcVYyV1FPwXp32Mzaqc6UnytKC9rZiJ8+hx4OOjvVuxqutAEh9W NFFc/jc869/utj3E9xJjasD2cNw7zzN5EiX3SdwGibOeia62Sd9XJeqQwFhnFEr5 jfqa2dxNWd35TeLym1SeLpA8GAAtxV6+nHTQ21hp465ojWJVi6h64= Received: by 10.42.80.83 with SMTP id filter-017.14748.5137CF4F1 Wed, 06 Mar 2013 23:20:47 +0000 (UTC) Received: from mail.tarsnap.com (unknown [10.60.208.13]) by mi20 (SG) with ESMTP id 5137cf4e.7eb3.388e066 for ; Wed, 06 Mar 2013 17:20:46 -0600 (CST) Received: (qmail 17565 invoked from network); 6 Mar 2013 23:20:45 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 6 Mar 2013 23:20:45 -0000 Received: (qmail 3337 invoked from network); 6 Mar 2013 23:19:57 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 6 Mar 2013 23:19:57 -0000 Message-ID: <5137CF1D.3020506@freebsd.org> Date: Wed, 06 Mar 2013 15:19:57 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130131 Thunderbird/17.0.2 MIME-Version: 1.0 To: David Malone Subject: Re: svn commit: r247871 - head/usr.sbin/bhyve References: <201303060728.r267SKP3018477@svn.freebsd.org> <20130306231613.GA5146@walton.maths.tcd.ie> In-Reply-To: <20130306231613.GA5146@walton.maths.tcd.ie> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Sendgrid-EID: A6W2xSVPHetogaU8rnzccWwgBYtN+QvIzXyjfe/10PFt7odERcTzFE6iBL5iSTO1gstC0NgbSVKFVMqmB26W9pmJMEdBYmWzS6O5FcjCjBDM/gpvaGtmzcecp7rUVQBJ+SHRO3W8GVkIwyLcw75xSg== Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Peter Grehan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:20:48 -0000 On 03/06/13 15:16, David Malone wrote: >> + /* >> + * We're just computing (a-b) in GF(216). > >> + ndesc = (unsigned)*hq->hq_avail_idx - (unsigned)hq->hq_cur_aidx; > > I think the comment here is wrong? Subtraction (and addition) in > GF(2^16) is just xor of 16 bit numbers. You seem to actually be > working in Z(2^16), where subtraction is normal subtraction mod > 65536. Given that there's no such thing as GF(216) due to 216 = 2^3 * 3^3 not being a prime power, the comment is definitely wrong. ;-) -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 23:22:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AADA0F49; Wed, 6 Mar 2013 23:22:40 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5DFFB4; Wed, 6 Mar 2013 23:22:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26NMeBH009011; Wed, 6 Mar 2013 23:22:40 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26NMebp009010; Wed, 6 Mar 2013 23:22:40 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201303062322.r26NMebp009010@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 6 Mar 2013 23:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247904 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:22:40 -0000 Author: des Date: Wed Mar 6 23:22:40 2013 New Revision: 247904 URL: http://svnweb.freebsd.org/changeset/base/247904 Log: Remove strnvis(), strvis(), strvisx(). Modified: head/crypto/openssh/ssh_namespace.h Modified: head/crypto/openssh/ssh_namespace.h ============================================================================== --- head/crypto/openssh/ssh_namespace.h Wed Mar 6 22:40:47 2013 (r247903) +++ head/crypto/openssh/ssh_namespace.h Wed Mar 6 23:22:40 2013 (r247904) @@ -451,9 +451,6 @@ #define start_progress_meter ssh_start_progress_meter #define stop_progress_meter ssh_stop_progress_meter #define strdelim ssh_strdelim -#define strnvis ssh_strnvis -#define strvis ssh_strvis -#define strvisx ssh_strvisx #define sys_tun_open ssh_sys_tun_open #define temporarily_use_uid ssh_temporarily_use_uid #define tilde_expand_filename ssh_tilde_expand_filename From owner-svn-src-all@FreeBSD.ORG Wed Mar 6 23:33:02 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 99FA4434; Wed, 6 Mar 2013 23:33:02 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 12BB2102; Wed, 6 Mar 2013 23:33:02 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id CAC08122D0; Thu, 7 Mar 2013 09:33:00 +1000 (EST) Received: (from dommail.onthenet.com.au [67.190.11.104]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with HTTP/1.1 id BKL73109 (AUTH peterg@ptree32.com.au); Thu, 7 Mar 2013 09:33:00 +1000 (EST) From: Peter Grehan Subject: Re: svn commit: r247871 - head/usr.sbin/bhyve To: "Colin Percival" , "David Malone" X-Mailer: Mirapoint Webmail Direct 4.2.4-GA MIME-Version: 1.0 In-Reply-To: <5137CF1D.3020506@freebsd.org> References: <201303060728.r267SKP3018477@svn.freebsd.org> <20130306231613.GA5146@walton.maths.tcd.ie> <5137CF1D.3020506@freebsd.org> Message-Id: <201303062333.042821@dommail.onthenet.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 7 Mar 2013 09:33:00 +1000 (EST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for 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 Mar 2013 23:33:02 -0000 >On 03/06/13 15:16, David Malone wrote: >>> + /* >>> + * We're just computing (a-b) in GF(216). >> >>> + ndesc = (unsigned)*hq->hq_avail_idx - (unsigned)hq->hq_cur_aidx; >> >> I think the comment here is wrong? Subtraction (and addition) in >> GF(2^16) is just xor of 16 bit numbers. You seem to actually be >> working in Z(2^16), where subtraction is normal subtraction mod >> 65536. > >Given that there's no such thing as GF(216) due to 216 = 2^3 * 3^3 not >being a prime power, the comment is definitely wrong. ;-) Any suggestions for better wording ? I submitted the comment block unchanged from the patch. later, Peter. later, Peter. From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 02:28:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A463CE83; Thu, 7 Mar 2013 02:28:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 6B1D4946; Thu, 7 Mar 2013 02:28:41 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 0265E23F645; Wed, 6 Mar 2013 21:28:37 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.8.0 onyx.glenbarber.us 0265E23F645 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 6 Mar 2013 21:28:35 -0500 From: Glen Barber To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r247904 - head/crypto/openssh Message-ID: <20130307022835.GA1496@glenbarber.us> References: <201303062322.r26NMebp009010@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <201303062322.r26NMebp009010@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 02:28:41 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 06, 2013 at 11:22:40PM +0000, Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Wed Mar 6 23:22:40 2013 > New Revision: 247904 > URL: http://svnweb.freebsd.org/changeset/base/247904 >=20 > Log: > Remove strnvis(), strvis(), strvisx(). >=20 > Modified: > head/crypto/openssh/ssh_namespace.h >=20 This commit now causes ssh(1) to dump core. Glen --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRN/tTAAoJEFJPDDeguUaj4WQIAKeH+3sZWGPZD+TF8eqmhABh /uTQNoVXW5cbaZ0qjXEH5lYK19Bm+TKew04RlPD74i/2OVnd3zTW0RN4RNe1avRP EnBe8d+3deldzH51HuJP8McwUloZ/MmGlxMQapSeXt4fAKJDJhpmRSAgTQ+NDLk3 Mz0VmYp3aqE2/XzFVUC9osaiimgBqxmwYwhFec5FxbeqPmIlgj7vIwx4Egc9S0JR sXqxUT+IH2yDnw5CndfIocUt69vpt/fK6CzibUtun18ChEOsU2alTVzyjQDJDZT3 7kkegabu+OQar8mrrvkCmlA6luwWpmrnHjbAzWsM8kfQvnQX0I+YMedclZJlsks= =yBcm -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7-- From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 02:40:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A843F9; Thu, 7 Mar 2013 02:40:15 +0000 (UTC) (envelope-from seanwbruno@gmail.com) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx1.freebsd.org (Postfix) with ESMTP id B98B898A; Thu, 7 Mar 2013 02:40:14 +0000 (UTC) Received: by mail-pb0-f43.google.com with SMTP id md12so6948186pbc.16 for ; Wed, 06 Mar 2013 18:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:subject:from:reply-to:to:cc:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=FQdu/TR57rKlCphO75DInoYIFzdoYI50YLtxrAPiWx0=; b=SjtxICXHcP7RfQ3gSWGODHdb3vM7ssicayxJzZ/BsKkzjz42eheTruyV0XXO8pj3md R9bZ6KHDTLUhpGq2znqEpV/+bIPwIr0uptxy5aFlXZRj1QDSPMoaUIJbefjXgLy3tnop ALFAwnDJWnGwyL/1iyEDcA6AupDQY5/nX1QbyWtNwwEWYKDYP6FsMgD2oq/UuBwCCVTy GmaajXzPUr1GL3yh4k4hreL7ERH8GD5sNWCd4Htl0oJrt/ZwjAkvlBYDX4dD8+Nbk1A0 r8NNnODZjtREYLyLZ/o1Zmx6BtPUluLMgS7sowMDFO5O2FTH+MZSYD4AuqSfYl/pLDK4 UaBw== X-Received: by 10.66.116.104 with SMTP id jv8mr478846pab.136.1362624014094; Wed, 06 Mar 2013 18:40:14 -0800 (PST) Received: from [192.168.43.121] (10.sub-70-199-80.myvzw.com. [70.199.80.10]) by mx.google.com with ESMTPS id eg1sm22794945pbb.33.2013.03.06.18.40.11 (version=SSLv3 cipher=RC4-SHA bits=128/128); Wed, 06 Mar 2013 18:40:13 -0800 (PST) Subject: Re: svn commit: r247904 - head/crypto/openssh From: Sean Bruno To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= In-Reply-To: <201303062322.r26NMebp009010@svn.freebsd.org> References: <201303062322.r26NMebp009010@svn.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" Date: Wed, 06 Mar 2013 18:40:08 +0000 Message-ID: <1362595208.1429.1.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: sbruno@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 02:40:15 -0000 On Wed, 2013-03-06 at 23:22 +0000, Dag-Erling Smørgrav wrote: > Author: des > Date: Wed Mar 6 23:22:40 2013 > New Revision: 247904 > URL: http://svnweb.freebsd.org/changeset/base/247904 > > Log: > Remove strnvis(), strvis(), strvisx(). I don't think that this is the "right" solution as it results in a "derped" version of ssh. I've been running *without* r247904 and the following patch all day long without issue: Index: crypto/openssh/config.h =================================================================== --- crypto/openssh/config.h (revision 247893) +++ crypto/openssh/config.h (working copy) @@ -956,7 +956,7 @@ #define HAVE_STRNLEN 1 /* Define to 1 if you have the `strnvis' function. */ -#define HAVE_STRNVIS 1 +/* #undef HAVE_STRNVIS */ /* Define to 1 if you have the `strptime' function. */ #define HAVE_STRPTIME 1 Sean From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 02:53:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42C5734B; Thu, 7 Mar 2013 02:53:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04D649E8; Thu, 7 Mar 2013 02:53:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r272rT5t071791; Thu, 7 Mar 2013 02:53:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r272rTUr071790; Thu, 7 Mar 2013 02:53:29 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201303070253.r272rTUr071790@svn.freebsd.org> From: Ian Lepore Date: Thu, 7 Mar 2013 02:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247905 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 02:53:30 -0000 Author: ian Date: Thu Mar 7 02:53:29 2013 New Revision: 247905 URL: http://svnweb.freebsd.org/changeset/base/247905 Log: Call sched_prio() to immediately change the priority of the thread in response to an rtprio_thread() call, when the priority is different than the old priority, and either the old or the new priority class is not RTP_PRIO_NORMAL (timeshare). The reasoning for the second half of the test is that if it's a change in timeshare priority, then the scheduler is going to adjust that priority in a way that completely wipes out the requested change anyway, so what's the point? (If that's not true, then allowing a thread to change its own timeshare priority would subvert the scheduler's adjustments and let a cpu-bound thread monopolize the cpu; if allowed at all, that should require priveleges.) On the other hand, if either the old or new priority class is not timeshare, then the scheduler doesn't make automatic adjustments, so we should honor the request and make the priority change right away. The reason the old class gets caught up in this is the very reason for this change: when thread A changes the priority of its child thread B from idle back to timeshare, thread B never actually gets moved to a timeshare-range run queue unless there are some idle cycles available to allow it to first get scheduled again as an idle thread. Reviewed by: jhb@ Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Wed Mar 6 23:22:40 2013 (r247904) +++ head/sys/kern/kern_resource.c Thu Mar 7 02:53:29 2013 (r247905) @@ -469,8 +469,7 @@ sys_rtprio(td, uap) int rtp_to_pri(struct rtprio *rtp, struct thread *td) { - u_char newpri; - u_char oldpri; + u_char newpri, oldclass, oldpri; switch (RTP_PRIO_BASE(rtp->type)) { case RTP_PRIO_REALTIME: @@ -493,11 +492,12 @@ rtp_to_pri(struct rtprio *rtp, struct th } thread_lock(td); + oldclass = td->td_pri_class; sched_class(td, rtp->type); /* XXX fix */ oldpri = td->td_user_pri; sched_user_prio(td, newpri); - if (td->td_user_pri != oldpri && (td == curthread || - td->td_priority == oldpri || td->td_user_pri <= PRI_MAX_REALTIME)) + if (td->td_user_pri != oldpri && (oldclass != RTP_PRIO_NORMAL || + td->td_pri_class != RTP_PRIO_NORMAL)) sched_prio(td, td->td_user_pri); if (TD_ON_UPILOCK(td) && oldpri != newpri) { critical_enter(); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 04:42:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E385C307; Thu, 7 Mar 2013 04:42:20 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D2FD4E6D; Thu, 7 Mar 2013 04:42:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r274gK7E008464; Thu, 7 Mar 2013 04:42:20 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r274gKgW008463; Thu, 7 Mar 2013 04:42:20 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201303070442.r274gKgW008463@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 7 Mar 2013 04:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247906 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 04:42:21 -0000 Author: lstewart Date: Thu Mar 7 04:42:20 2013 New Revision: 247906 URL: http://svnweb.freebsd.org/changeset/base/247906 Log: The hashmask returned by hashinit() is a valid index in the returned hash array. Fix a siftr(4) potential memory leak and INVARIANTS triggered kernel panic in hashdestroy() by ensuring the last array index in the flow counter hash table is flushed of entries. MFC after: 3 days Modified: head/sys/netinet/siftr.c Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Thu Mar 7 02:53:29 2013 (r247905) +++ head/sys/netinet/siftr.c Thu Mar 7 04:42:20 2013 (r247906) @@ -1314,7 +1314,7 @@ siftr_manage_ops(uint8_t action) * flow seen and freeing any malloc'd memory. * The hash consists of an array of LISTs (man 3 queue). */ - for (i = 0; i < siftr_hashmask; i++) { + for (i = 0; i <= siftr_hashmask; i++) { LIST_FOREACH_SAFE(counter, counter_hash + i, nodes, tmp_counter) { key = counter->key; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 06:53:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7045476; Thu, 7 Mar 2013 06:53:27 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98ED4289; Thu, 7 Mar 2013 06:53:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r276rRsp047303; Thu, 7 Mar 2013 06:53:27 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r276rQdd047292; Thu, 7 Mar 2013 06:53:26 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201303070653.r276rQdd047292@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 7 Mar 2013 06:53:26 +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: r247907 - in stable/8/sys: dev/virtio dev/virtio/balloon dev/virtio/block dev/virtio/network dev/virtio/pci dev/virtio/scsi modules/virtio modules/virtio/scsi 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 06:53:27 -0000 Author: bryanv Date: Thu Mar 7 06:53:25 2013 New Revision: 247907 URL: http://svnweb.freebsd.org/changeset/base/247907 Log: MFC r238072,r238360,r240430,r241469,r241470,r241495,r244136,r244200 Sync VirtIO with HEAD. - r238072: Do not include in the local headers. - r238360: Various VirtIO improvements - r240430: No need to leak these into the includer's namespace. - r241469: virtqueue: Fix non-indirect virtqueues - r241470: Add Virtio SCSI driver - r241495: Fix build with PAE enabled - r244136: Remove duplicated lines - r244200: Start taskqueues threads after attach cannot fail Approved by: grehan (mentor) Added: stable/8/sys/dev/virtio/scsi/ - copied from r241470, head/sys/dev/virtio/scsi/ stable/8/sys/modules/virtio/scsi/ - copied from r241470, head/sys/modules/virtio/scsi/ Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.c stable/8/sys/dev/virtio/balloon/virtio_balloon.h stable/8/sys/dev/virtio/block/virtio_blk.c stable/8/sys/dev/virtio/block/virtio_blk.h stable/8/sys/dev/virtio/network/if_vtnet.c stable/8/sys/dev/virtio/network/virtio_net.h stable/8/sys/dev/virtio/pci/virtio_pci.c stable/8/sys/dev/virtio/pci/virtio_pci.h stable/8/sys/dev/virtio/scsi/virtio_scsi.c stable/8/sys/dev/virtio/virtio.c stable/8/sys/dev/virtio/virtio.h stable/8/sys/dev/virtio/virtio_ring.h stable/8/sys/dev/virtio/virtqueue.c stable/8/sys/dev/virtio/virtqueue.h stable/8/sys/modules/virtio/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/modules/ (props changed) Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- stable/8/sys/dev/virtio/balloon/virtio_balloon.c Thu Mar 7 04:42:20 2013 (r247906) +++ stable/8/sys/dev/virtio/balloon/virtio_balloon.c Thu Mar 7 06:53:25 2013 (r247907) @@ -412,7 +412,6 @@ vtballoon_send_page_frames(struct vtball * interrupt handler will wake us up. */ VTBALLOON_LOCK(sc); - while ((c = virtqueue_dequeue(vq, NULL)) == NULL) msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); VTBALLOON_UNLOCK(sc); Modified: stable/8/sys/dev/virtio/balloon/virtio_balloon.h ============================================================================== --- stable/8/sys/dev/virtio/balloon/virtio_balloon.h Thu Mar 7 04:42:20 2013 (r247906) +++ stable/8/sys/dev/virtio/balloon/virtio_balloon.h Thu Mar 7 06:53:25 2013 (r247907) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_BALLOON_H #define _VIRTIO_BALLOON_H -#include - /* Feature bits. */ #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0x1 /* Tell before reclaiming pages */ #define VIRTIO_BALLOON_F_STATS_VQ 0x2 /* Memory stats virtqueue */ Modified: stable/8/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/8/sys/dev/virtio/block/virtio_blk.c Thu Mar 7 04:42:20 2013 (r247906) +++ stable/8/sys/dev/virtio/block/virtio_blk.c Thu Mar 7 06:53:25 2013 (r247907) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -119,7 +118,7 @@ static int vtblk_shutdown(device_t); static int vtblk_open(struct disk *); static int vtblk_close(struct disk *); static int vtblk_ioctl(struct disk *, u_long, void *, int, - struct thread *); + struct thread *); static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); static void vtblk_strategy(struct bio *); @@ -193,7 +192,7 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ mtx_assert(VTBLK_MTX((_sc)), MA_NOTOWNED) #define VTBLK_DISK_NAME "vtbd" -#define VTBLK_QUIESCE_TIMEOUT (30 * hz) +#define VTBLK_QUIESCE_TIMEOUT (30 * hz) /* * Each block request uses at least two segments - one for the header @@ -201,8 +200,6 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ */ #define VTBLK_MIN_SEGMENTS 2 -static uma_zone_t vtblk_req_zone; - static device_method_t vtblk_methods[] = { /* Device methods. */ DEVMETHOD(device_probe, vtblk_probe), @@ -236,19 +233,8 @@ vtblk_modevent(module_t mod, int type, v switch (type) { case MOD_LOAD: - vtblk_req_zone = uma_zcreate("vtblk_request", - sizeof(struct vtblk_request), - NULL, NULL, NULL, NULL, 0, 0); - break; case MOD_QUIESCE: case MOD_UNLOAD: - if (uma_zone_get_cur(vtblk_req_zone) > 0) - error = EBUSY; - else if (type == MOD_UNLOAD) { - uma_zdestroy(vtblk_req_zone); - vtblk_req_zone = NULL; - } - break; case MOD_SHUTDOWN: break; default: @@ -316,7 +302,7 @@ vtblk_attach(device_t dev) } sc->vtblk_max_nsegs = vtblk_maximum_segments(sc, &blkcfg); - if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { + if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { error = EINVAL; device_printf(dev, "fewer than minimum number of segments " "allowed: %d\n", sc->vtblk_max_nsegs); @@ -352,8 +338,6 @@ vtblk_attach(device_t dev) device_printf(dev, "cannot allocate taskqueue\n"); goto fail; } - taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY); if (error) { @@ -361,6 +345,9 @@ vtblk_attach(device_t dev) goto fail; } + taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", + device_get_nameunit(dev)); + vtblk_create_disk(sc); virtqueue_enable_intr(sc->vtblk_vq); @@ -493,7 +480,6 @@ vtblk_dump(void *arg, void *virtual, vm_ int error; dp = arg; - error = 0; if ((sc = dp->d_drv1) == NULL) return (ENXIO); @@ -539,7 +525,7 @@ vtblk_strategy(struct bio *bp) return; } -#ifdef INVARIANTS +#ifdef INVARIANTS /* * Prevent read/write buffers spanning too many segments from * getting into the queue. This should only trip if d_maxsize @@ -547,13 +533,13 @@ vtblk_strategy(struct bio *bp) */ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { int nsegs, max_nsegs; - + nsegs = sglist_count(bp->bio_data, bp->bio_bcount); max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; KASSERT(nsegs <= max_nsegs, - ("bio spanned too many segments: %d, max: %d", - nsegs, max_nsegs)); + ("bio %p spanned too many segments: %d, max: %d", + bp, nsegs, max_nsegs)); } #endif @@ -800,27 +786,22 @@ vtblk_execute_request(struct vtblk_softc VTBLK_LOCK_ASSERT(sc); sglist_reset(sg); - error = sglist_append(sg, &req->vbr_hdr, - sizeof(struct virtio_blk_outhdr)); - KASSERT(error == 0, ("error adding header to sglist")); - KASSERT(sg->sg_nseg == 1, - ("header spanned multiple segments: %d", sg->sg_nseg)); + + sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr)); if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { error = sglist_append(sg, bp->bio_data, bp->bio_bcount); - KASSERT(error == 0, ("error adding buffer to sglist")); + if (error || sg->sg_nseg == sg->sg_maxseg) + panic("%s: data buffer too big bio:%p error:%d", + __FUNCTION__, bp, error); /* BIO_READ means the host writes into our buffer. */ if (bp->bio_cmd == BIO_READ) - writable += sg->sg_nseg - 1; + writable = sg->sg_nseg - 1; } - error = sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); - KASSERT(error == 0, ("error adding ack to sglist")); writable++; - - KASSERT(sg->sg_nseg >= VTBLK_MIN_SEGMENTS, - ("fewer than min segments: %d", sg->sg_nseg)); + sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); readable = sg->sg_nseg - writable; @@ -995,12 +976,10 @@ vtblk_flush_dump(struct vtblk_softc *sc) static int vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) { - device_t dev; struct virtqueue *vq; struct vtblk_request *r; int error; - dev = sc->vtblk_dev; vq = sc->vtblk_vq; if (!virtqueue_empty(vq)) @@ -1013,12 +992,12 @@ vtblk_poll_request(struct vtblk_softc *s virtqueue_notify(vq); r = virtqueue_poll(vq, NULL); - KASSERT(r == req, ("unexpected request response")); + KASSERT(r == req, ("unexpected request response: %p/%p", r, req)); error = vtblk_request_error(req); if (error && bootverbose) { - device_printf(dev, "vtblk_poll_request: IO error: %d\n", - error); + device_printf(sc->vtblk_dev, + "%s: IO error: %d\n", __FUNCTION__, error); } return (error); @@ -1090,6 +1069,20 @@ vtblk_drain(struct vtblk_softc *sc) vtblk_free_requests(sc); } +#ifdef INVARIANTS +static void +vtblk_request_invariants(struct vtblk_request *req) +{ + int hdr_nsegs, ack_nsegs; + + hdr_nsegs = sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)); + ack_nsegs = sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)); + + KASSERT(hdr_nsegs == 1, ("request header crossed page boundary")); + KASSERT(ack_nsegs == 1, ("request ack crossed page boundary")); +} +#endif + static int vtblk_alloc_requests(struct vtblk_softc *sc) { @@ -1107,10 +1100,14 @@ vtblk_alloc_requests(struct vtblk_softc nreqs /= VTBLK_MIN_SEGMENTS; for (i = 0; i < nreqs; i++) { - req = uma_zalloc(vtblk_req_zone, M_NOWAIT); + req = malloc(sizeof(struct vtblk_request), M_DEVBUF, M_NOWAIT); if (req == NULL) return (ENOMEM); +#ifdef INVARIANTS + vtblk_request_invariants(req); +#endif + sc->vtblk_request_count++; vtblk_enqueue_request(sc, req); } @@ -1128,10 +1125,11 @@ vtblk_free_requests(struct vtblk_softc * while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; - uma_zfree(vtblk_req_zone, req); + free(req, M_DEVBUF); } - KASSERT(sc->vtblk_request_count == 0, ("leaked requests")); + KASSERT(sc->vtblk_request_count == 0, + ("leaked requests: %d", sc->vtblk_request_count)); } static struct vtblk_request * Modified: stable/8/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- stable/8/sys/dev/virtio/block/virtio_blk.h Thu Mar 7 04:42:20 2013 (r247906) +++ stable/8/sys/dev/virtio/block/virtio_blk.h Thu Mar 7 06:53:25 2013 (r247907) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_BLK_H #define _VIRTIO_BLK_H -#include - /* Feature bits */ #define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ #define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ Modified: stable/8/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/8/sys/dev/virtio/network/if_vtnet.c Thu Mar 7 04:42:20 2013 (r247906) +++ stable/8/sys/dev/virtio/network/if_vtnet.c Thu Mar 7 06:53:25 2013 (r247907) @@ -439,18 +439,17 @@ vtnet_attach(device_t dev) ether_ifdetach(ifp); goto fail; } - taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_NET); if (error) { device_printf(dev, "cannot setup virtqueue interrupts\n"); - taskqueue_free(sc->vtnet_tq); - sc->vtnet_tq = NULL; ether_ifdetach(ifp); goto fail; } + taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(dev)); + /* * Device defaults to promiscuous mode for backwards * compatibility. Turn it off if possible. @@ -748,11 +747,9 @@ vtnet_is_link_up(struct vtnet_softc *sc) static void vtnet_update_link_status(struct vtnet_softc *sc) { - device_t dev; struct ifnet *ifp; int link; - dev = sc->vtnet_dev; ifp = sc->vtnet_ifp; link = vtnet_is_link_up(sc); Modified: stable/8/sys/dev/virtio/network/virtio_net.h ============================================================================== --- stable/8/sys/dev/virtio/network/virtio_net.h Thu Mar 7 04:42:20 2013 (r247906) +++ stable/8/sys/dev/virtio/network/virtio_net.h Thu Mar 7 06:53:25 2013 (r247907) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_NET_H #define _VIRTIO_NET_H -#include - /* The feature bitmap for virtio net */ #define VIRTIO_NET_F_CSUM 0x00001 /* Host handles pkts w/ partial csum */ #define VIRTIO_NET_F_GUEST_CSUM 0x00002 /* Guest handles pkts w/ partial csum*/ Modified: stable/8/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- stable/8/sys/dev/virtio/pci/virtio_pci.c Thu Mar 7 04:42:20 2013 (r247906) +++ stable/8/sys/dev/virtio/pci/virtio_pci.c Thu Mar 7 06:53:25 2013 (r247907) @@ -57,12 +57,15 @@ struct vtpci_softc { struct resource *vtpci_msix_res; uint64_t vtpci_features; uint32_t vtpci_flags; -#define VIRTIO_PCI_FLAG_NO_MSI 0x0001 -#define VIRTIO_PCI_FLAG_MSI 0x0002 -#define VIRTIO_PCI_FLAG_NO_MSIX 0x0010 -#define VIRTIO_PCI_FLAG_MSIX 0x0020 -#define VIRTIO_PCI_FLAG_SHARED_MSIX 0x0040 +#define VTPCI_FLAG_NO_MSI 0x0001 +#define VTPCI_FLAG_NO_MSIX 0x0002 +#define VTPCI_FLAG_LEGACY 0x1000 +#define VTPCI_FLAG_MSI 0x2000 +#define VTPCI_FLAG_MSIX 0x4000 +#define VTPCI_FLAG_SHARED_MSIX 0x8000 +#define VTPCI_FLAG_ITYPE_MASK 0xF000 + /* This "bus" will only ever have one child. */ device_t vtpci_child_dev; struct virtio_feature_desc *vtpci_child_feat_desc; @@ -80,7 +83,8 @@ struct vtpci_softc { int vtpci_nvqs; struct vtpci_virtqueue { struct virtqueue *vq; - + /* Device did not provide a callback for this virtqueue. */ + int no_intr; /* Index into vtpci_intr_res[] below. Unused, then -1. */ int ires_idx; } vtpci_vqx[VIRTIO_MAX_VIRTQUEUES]; @@ -130,24 +134,39 @@ static void vtpci_describe_features(stru uint64_t); static void vtpci_probe_and_attach_child(struct vtpci_softc *); -static int vtpci_alloc_interrupts(struct vtpci_softc *, int, int, - struct vq_alloc_info *); -static int vtpci_alloc_intr_resources(struct vtpci_softc *, int, - struct vq_alloc_info *); -static int vtpci_alloc_msi(struct vtpci_softc *); -static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_pervq(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_shared(struct vtpci_softc *); +static int vtpci_alloc_intr_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_legacy(struct vtpci_softc *); +static int vtpci_alloc_intr_resources(struct vtpci_softc *); + +static int vtpci_setup_legacy_interrupt(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_msix_interrupts(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_interrupts(struct vtpci_softc *, enum intr_type); + static int vtpci_register_msix_vector(struct vtpci_softc *, int, int); +static int vtpci_set_host_msix_vectors(struct vtpci_softc *); +static int vtpci_reinit_virtqueue(struct vtpci_softc *, int); static void vtpci_free_interrupts(struct vtpci_softc *); static void vtpci_free_virtqueues(struct vtpci_softc *); +static void vtpci_cleanup_setup_intr_attempt(struct vtpci_softc *); static void vtpci_release_child_resources(struct vtpci_softc *); static void vtpci_reset(struct vtpci_softc *); +static void vtpci_select_virtqueue(struct vtpci_softc *, int); + static int vtpci_legacy_intr(void *); static int vtpci_vq_shared_intr(void *); static int vtpci_vq_intr(void *); static int vtpci_config_intr(void *); +#define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt + /* * I/O port read/write wrappers. */ @@ -252,7 +271,7 @@ vtpci_attach(device_t dev) } if (pci_find_extcap(dev, PCIY_MSI, NULL) != 0) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSI; + sc->vtpci_flags |= VTPCI_FLAG_NO_MSI; if (pci_find_extcap(dev, PCIY_MSIX, NULL) == 0) { rid = PCIR_BAR(1); @@ -261,7 +280,7 @@ vtpci_attach(device_t dev) } if (sc->vtpci_msix_res == NULL) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSIX; + sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; vtpci_reset(sc); @@ -372,6 +391,16 @@ vtpci_read_ivar(device_t dev, device_t c switch (index) { case VIRTIO_IVAR_DEVTYPE: + case VIRTIO_IVAR_SUBDEVICE: + *result = pci_get_subdevice(dev); + break; + case VIRTIO_IVAR_VENDOR: + *result = pci_get_vendor(dev); + break; + case VIRTIO_IVAR_DEVICE: + *result = pci_get_device(dev); + break; + case VIRTIO_IVAR_SUBVENDOR: *result = pci_get_subdevice(dev); break; default: @@ -442,102 +471,97 @@ vtpci_alloc_virtqueues(device_t dev, int struct vq_alloc_info *vq_info) { struct vtpci_softc *sc; + struct virtqueue *vq; struct vtpci_virtqueue *vqx; struct vq_alloc_info *info; - int queue, error; - uint16_t vq_size; + int idx, error; + uint16_t size; sc = device_get_softc(dev); + error = 0; - if (sc->vtpci_nvqs != 0 || nvqs <= 0 || - nvqs > VIRTIO_MAX_VIRTQUEUES) + if (sc->vtpci_nvqs != 0) + return (EALREADY); + if (nvqs <= 0 || nvqs > VIRTIO_MAX_VIRTQUEUES) return (EINVAL); - error = vtpci_alloc_interrupts(sc, flags, nvqs, vq_info); - if (error) { - device_printf(dev, "cannot allocate interrupts\n"); - return (error); - } - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_CONFIG_VECTOR, 0); - if (error) - return (error); - } + if (flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX) + sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; - for (queue = 0; queue < nvqs; queue++) { - vqx = &sc->vtpci_vqx[queue]; - info = &vq_info[queue]; - - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, queue); - - vq_size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); - error = virtqueue_alloc(dev, queue, vq_size, - VIRTIO_PCI_VRING_ALIGN, 0xFFFFFFFFUL, info, &vqx->vq); - if (error) - return (error); - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_QUEUE_VECTOR, vqx->ires_idx); - if (error) - return (error); + for (idx = 0; idx < nvqs; idx++) { + vqx = &sc->vtpci_vqx[idx]; + info = &vq_info[idx]; + + vtpci_select_virtqueue(sc, idx); + size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); + + error = virtqueue_alloc(dev, idx, size, VIRTIO_PCI_VRING_ALIGN, + 0xFFFFFFFFUL, info, &vq); + if (error) { + device_printf(dev, + "cannot allocate virtqueue %d: %d\n", idx, error); + break; } vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, - virtqueue_paddr(vqx->vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); + virtqueue_paddr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); + + vqx->vq = *info->vqai_vq = vq; + vqx->no_intr = info->vqai_intr == NULL; - *info->vqai_vq = vqx->vq; sc->vtpci_nvqs++; } - return (0); + return (error); } static int vtpci_setup_intr(device_t dev, enum intr_type type) { struct vtpci_softc *sc; - struct vtpci_intr_resource *ires; - struct vtpci_virtqueue *vqx; - int i, flags, error; + int attempt, error; sc = device_get_softc(dev); - flags = type | INTR_MPSAFE; - ires = &sc->vtpci_intr_res[0]; - - if ((sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) == 0) { - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_legacy_intr, NULL, sc, &ires->intrhand); - return (error); - } - - error = bus_setup_intr(dev, ires->irq, flags, vtpci_config_intr, - NULL, sc, &ires->intrhand); - if (error) - return (error); + for (attempt = 0; attempt < 5; attempt++) { + /* + * Start with the most desirable interrupt configuration and + * fallback towards less desirable ones. + */ + switch (attempt) { + case 0: + error = vtpci_alloc_intr_msix_pervq(sc); + break; + case 1: + error = vtpci_alloc_intr_msix_shared(sc); + break; + case 2: + error = vtpci_alloc_intr_msi(sc); + break; + case 3: + error = vtpci_alloc_intr_legacy(sc); + break; + default: + device_printf(dev, + "exhausted all interrupt allocation attempts\n"); + return (ENXIO); + } - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) { - ires = &sc->vtpci_intr_res[1]; - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); + if (error == 0 && vtpci_setup_interrupts(sc, type) == 0) + break; - return (error); + vtpci_cleanup_setup_intr_attempt(sc); } - /* Setup an interrupt handler for each virtqueue. */ - for (i = 0; i < sc->vtpci_nvqs; i++) { - vqx = &sc->vtpci_vqx[i]; - if (vqx->ires_idx < 1) - continue; - - ires = &sc->vtpci_intr_res[vqx->ires_idx]; - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); - if (error) - return (error); + if (bootverbose) { + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + device_printf(dev, "using legacy interrupt\n"); + else if (sc->vtpci_flags & VTPCI_FLAG_MSI) + device_printf(dev, "using MSI interrupt\n"); + else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) + device_printf(dev, "using shared MSIX interrupts\n"); + else + device_printf(dev, "using per VQ MSIX interrupts\n"); } return (0); @@ -554,20 +578,19 @@ static int vtpci_reinit(device_t dev, uint64_t features) { struct vtpci_softc *sc; - struct vtpci_virtqueue *vqx; - struct virtqueue *vq; - int queue, error; - uint16_t vq_size; + int idx, error; sc = device_get_softc(dev); /* - * Redrive the device initialization. This is a bit of an abuse - * of the specification, but both VirtualBox and QEMU/KVM seem - * to play nice. We do not allow the host device to change from - * what was originally negotiated beyond what the guest driver - * changed (MSIX state should not change, number of virtqueues - * and their size remain the same, etc). + * Redrive the device initialization. This is a bit of an abuse of + * the specification, but VirtualBox, QEMU/KVM, and BHyVe seem to + * play nice. + * + * We do not allow the host device to change from what was originally + * negotiated beyond what the guest driver changed. MSIX state should + * not change, number of virtqueues and their size remain the same, etc. + * This will need to be rethought when we want to support migration. */ if (vtpci_get_status(dev) != VIRTIO_CONFIG_STATUS_RESET) @@ -582,34 +605,16 @@ vtpci_reinit(device_t dev, uint64_t feat vtpci_negotiate_features(dev, features); - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_CONFIG_VECTOR, 0); + for (idx = 0; idx < sc->vtpci_nvqs; idx++) { + error = vtpci_reinit_virtqueue(sc, idx); if (error) return (error); } - for (queue = 0; queue < sc->vtpci_nvqs; queue++) { - vqx = &sc->vtpci_vqx[queue]; - vq = vqx->vq; - - KASSERT(vq != NULL, ("vq %d not allocated", queue)); - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, queue); - - vq_size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); - error = virtqueue_reinit(vq, vq_size); + if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { + error = vtpci_set_host_msix_vectors(sc); if (error) return (error); - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_QUEUE_VECTOR, vqx->ires_idx); - if (error) - return (error); - } - - vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, - virtqueue_paddr(vqx->vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); } return (0); @@ -744,7 +749,6 @@ vtpci_probe_and_attach_child(struct vtpc vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_FAILED); vtpci_reset(sc); vtpci_release_child_resources(sc); - /* Reset status for future attempt. */ vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_ACK); } else @@ -752,42 +756,126 @@ vtpci_probe_and_attach_child(struct vtpc } static int -vtpci_alloc_interrupts(struct vtpci_softc *sc, int flags, int nvqs, - struct vq_alloc_info *vq_info) +vtpci_alloc_msix(struct vtpci_softc *sc, int nvectors) +{ + device_t dev; + int nmsix, cnt, required; + + dev = sc->vtpci_dev; + + /* Allocate an additional vector for the config changes. */ + required = nvectors + 1; + + nmsix = pci_msix_count(dev); + if (nmsix < required) + return (1); + + cnt = required; + if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { + sc->vtpci_nintr_res = required; + return (0); + } + + pci_release_msi(dev); + + return (1); +} + +static int +vtpci_alloc_msi(struct vtpci_softc *sc) +{ + device_t dev; + int nmsi, cnt, required; + + dev = sc->vtpci_dev; + required = 1; + + nmsi = pci_msi_count(dev); + if (nmsi < required) + return (1); + + cnt = required; + if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) { + sc->vtpci_nintr_res = required; + return (0); + } + + pci_release_msi(dev); + + return (1); +} + +static int +vtpci_alloc_intr_msix_pervq(struct vtpci_softc *sc) { int i, nvectors, error; - /* - * Only allocate a vector for virtqueues that are actually - * expecting an interrupt. - */ - for (nvectors = 0, i = 0; i < nvqs; i++) - if (vq_info[i].vqai_intr != NULL) + if (vtpci_disable_msix != 0 || + sc->vtpci_flags & VTPCI_FLAG_NO_MSIX) + return (ENOTSUP); + + for (nvectors = 0, i = 0; i < sc->vtpci_nvqs; i++) { + if (sc->vtpci_vqx[i].no_intr == 0) nvectors++; + } + + error = vtpci_alloc_msix(sc, nvectors); + if (error) + return (error); + + sc->vtpci_flags |= VTPCI_FLAG_MSIX; + + return (0); +} + +static int +vtpci_alloc_intr_msix_shared(struct vtpci_softc *sc) +{ + int error; if (vtpci_disable_msix != 0 || - sc->vtpci_flags & VIRTIO_PCI_FLAG_NO_MSIX || - flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX || - vtpci_alloc_msix(sc, nvectors) != 0) { - /* - * Use MSI interrupts if available. Otherwise, we fallback - * to legacy interrupts. - */ - if ((sc->vtpci_flags & VIRTIO_PCI_FLAG_NO_MSI) == 0 && - vtpci_alloc_msi(sc) == 0) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_MSI; + sc->vtpci_flags & VTPCI_FLAG_NO_MSIX) + return (ENOTSUP); - sc->vtpci_nintr_res = 1; - } + error = vtpci_alloc_msix(sc, 1); + if (error) + return (error); - error = vtpci_alloc_intr_resources(sc, nvqs, vq_info); + sc->vtpci_flags |= VTPCI_FLAG_MSIX | VTPCI_FLAG_SHARED_MSIX; - return (error); + return (0); } static int -vtpci_alloc_intr_resources(struct vtpci_softc *sc, int nvqs, - struct vq_alloc_info *vq_info) +vtpci_alloc_intr_msi(struct vtpci_softc *sc) +{ + int error; + + /* Only BHyVe supports MSI. */ + if (sc->vtpci_flags & VTPCI_FLAG_NO_MSI) + return (ENOTSUP); + + error = vtpci_alloc_msi(sc); + if (error) + return (error); + + sc->vtpci_flags |= VTPCI_FLAG_MSI; + + return (0); +} + +static int +vtpci_alloc_intr_legacy(struct vtpci_softc *sc) +{ + + sc->vtpci_flags |= VTPCI_FLAG_LEGACY; + sc->vtpci_nintr_res = 1; + + return (0); +} + +static int +vtpci_alloc_intr_resources(struct vtpci_softc *sc) { device_t dev; struct resource *irq; @@ -795,14 +883,14 @@ vtpci_alloc_intr_resources(struct vtpci_ int i, rid, flags, res_idx; dev = sc->vtpci_dev; - flags = RF_ACTIVE; - if ((sc->vtpci_flags & - (VIRTIO_PCI_FLAG_MSI | VIRTIO_PCI_FLAG_MSIX)) == 0) { + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) { rid = 0; - flags |= RF_SHAREABLE; - } else + flags = RF_ACTIVE | RF_SHAREABLE; + } else { rid = 1; + flags = RF_ACTIVE; + } for (i = 0; i < sc->vtpci_nintr_res; i++) { irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, flags); @@ -814,16 +902,16 @@ vtpci_alloc_intr_resources(struct vtpci_ } /* - * Map the virtqueue into the correct index in vq_intr_res[]. Note the - * first index is reserved for configuration changes notifications. + * Map the virtqueue into the correct index in vq_intr_res[]. The + * first index is reserved for configuration changed notifications. */ - for (i = 0, res_idx = 1; i < nvqs; i++) { + for (i = 0, res_idx = 1; i < sc->vtpci_nvqs; i++) { vqx = &sc->vtpci_vqx[i]; - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - if (vq_info[i].vqai_intr == NULL) + if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { + if (vqx->no_intr != 0) vqx->ires_idx = -1; - else if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) + else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) vqx->ires_idx = res_idx; else vqx->ires_idx = res_idx++; @@ -835,110 +923,180 @@ vtpci_alloc_intr_resources(struct vtpci_ } static int -vtpci_alloc_msi(struct vtpci_softc *sc) +vtpci_setup_legacy_interrupt(struct vtpci_softc *sc, enum intr_type type) { device_t dev; - int nmsi, cnt; + struct vtpci_intr_resource *ires; + int error; dev = sc->vtpci_dev; - nmsi = pci_msi_count(dev); - - if (nmsi < 1) - return (1); - cnt = 1; - if (pci_alloc_msi(dev, &cnt) == 0 && cnt == 1) - return (0); + ires = &sc->vtpci_intr_res[0]; + error = bus_setup_intr(dev, ires->irq, type, vtpci_legacy_intr, NULL, + sc, &ires->intrhand); - return (1); + return (error); } static int -vtpci_alloc_msix(struct vtpci_softc *sc, int nvectors) +vtpci_setup_msix_interrupts(struct vtpci_softc *sc, enum intr_type type) { device_t dev; - int nmsix, cnt, required; + struct vtpci_intr_resource *ires; + struct vtpci_virtqueue *vqx; + int i, error; dev = sc->vtpci_dev; - nmsix = pci_msix_count(dev); - if (nmsix < 1) - return (1); + /* + * The first resource is used for configuration changed interrupts. + */ + ires = &sc->vtpci_intr_res[0]; + error = bus_setup_intr(dev, ires->irq, type, vtpci_config_intr, + NULL, sc, &ires->intrhand); + if (error) + return (error); - /* An additional vector is needed for the config changes. */ - required = nvectors + 1; - if (nmsix >= required) { - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) - goto out; + if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) { + ires = &sc->vtpci_intr_res[1]; - pci_release_msi(dev); + error = bus_setup_intr(dev, ires->irq, type, + vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); + if (error) + return (error); + } else { + /* + * Each remaining resource is assigned to a specific virtqueue. + */ + for (i = 0; i < sc->vtpci_nvqs; i++) { + vqx = &sc->vtpci_vqx[i]; + if (vqx->ires_idx < 1) + continue; + + ires = &sc->vtpci_intr_res[vqx->ires_idx]; + error = bus_setup_intr(dev, ires->irq, type, + vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); + if (error) + return (error); + } } - /* Attempt shared MSIX configuration. */ - required = 2; - if (nmsix >= required) { - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { - sc->vtpci_flags |= VIRTIO_PCI_FLAG_SHARED_MSIX; - goto out; - } + error = vtpci_set_host_msix_vectors(sc); + if (error) + return (error); - pci_release_msi(dev); - } + return (0); +} - return (1); +static int +vtpci_setup_interrupts(struct vtpci_softc *sc, enum intr_type type) +{ + int error; -out: - sc->vtpci_nintr_res = required; - sc->vtpci_flags |= VIRTIO_PCI_FLAG_MSIX; + type |= INTR_MPSAFE; + KASSERT(sc->vtpci_flags & VTPCI_FLAG_ITYPE_MASK, + ("no interrupt type selected: %#x", sc->vtpci_flags)); - if (bootverbose) { - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) - device_printf(dev, "using shared virtqueue MSIX\n"); - else - device_printf(dev, "using per virtqueue MSIX\n"); - } + error = vtpci_alloc_intr_resources(sc); + if (error) + return (error); - return (0); + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + error = vtpci_setup_legacy_interrupt(sc, type); + else if (sc->vtpci_flags & VTPCI_FLAG_MSI) + error = vtpci_setup_msi_interrupt(sc, type); + else + error = vtpci_setup_msix_interrupts(sc, type); + + return (error); } static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 07:02:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B344841; Thu, 7 Mar 2013 07:02:33 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1E02FA; Thu, 7 Mar 2013 07:02:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2772Xgu050342; Thu, 7 Mar 2013 07:02:33 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2772WqR050333; Thu, 7 Mar 2013 07:02:32 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201303070702.r2772WqR050333@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 7 Mar 2013 07:02:32 +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: r247908 - stable/8/share/man/man4 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 07:02:33 -0000 Author: bryanv Date: Thu Mar 7 07:02:31 2013 New Revision: 247908 URL: http://svnweb.freebsd.org/changeset/base/247908 Log: MFC r227652,r230450,r230461,r241470 Include/update the VirtIO man pages. -r227652: Initial import -r230450: General cleanup -r230461: Connect VirtIO-related manpages to the build -r241470: Virtio SCSI driver man page Approved by: grehan (mentor) Added: stable/8/share/man/man4/virtio.4 - copied, changed from r227652, head/share/man/man4/virtio.4 stable/8/share/man/man4/virtio_balloon.4 - copied, changed from r227652, head/share/man/man4/virtio_balloon.4 stable/8/share/man/man4/virtio_blk.4 - copied, changed from r227652, head/share/man/man4/virtio_blk.4 stable/8/share/man/man4/virtio_scsi.4 - copied unchanged from r241470, head/share/man/man4/virtio_scsi.4 stable/8/share/man/man4/vtnet.4 - copied, changed from r227652, head/share/man/man4/vtnet.4 Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Thu Mar 7 06:53:25 2013 (r247907) +++ stable/8/share/man/man4/Makefile Thu Mar 7 07:02:31 2013 (r247908) @@ -490,11 +490,16 @@ MAN= aac.4 \ viapm.4 \ ${_viawd.4} \ vinum.4 \ + ${_virtio.4} \ + ${_virtio_balloon.4} \ + ${_virtio_blk.4} \ + ${_virtio_scsi.4} \ vkbd.4 \ vlan.4 \ vpo.4 \ vr.4 \ vte.4 \ + ${_vtnet.4} \ watchdog.4 \ wb.4 \ wi.4 \ @@ -642,6 +647,7 @@ MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 +MLINKS+=${_vtnet.4} ${_if_vtnet.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 MLINKS+=wb.4 if_wb.4 MLINKS+=wi.4 if_wi.4 @@ -680,6 +686,7 @@ _if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _if_nxge.4= if_nxge.4 _if_urtw.4= if_urtw.4 +_if_vtnet.4= if_vtnet.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _io.4= io.4 @@ -691,6 +698,11 @@ _nfsmb.4= nfsmb.4 _nve.4= nve.4 _nvram.4= nvram.4 _nxge.4= nxge.4 +_virtio.4= virtio.4 +_virtio_balloon.4=virtio_balloon.4 +_virtio_blk.4= virtio_blk.4 +_virtio_scsi.4= virtio_scsi.4 +_vtnet.4= vtnet.4 _padlock.4= padlock.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 Copied and modified: stable/8/share/man/man4/virtio.4 (from r227652, head/share/man/man4/virtio.4) ============================================================================== --- head/share/man/man4/virtio.4 Fri Nov 18 05:43:43 2011 (r227652, copy source) +++ stable/8/share/man/man4/virtio.4 Thu Mar 7 07:02:31 2013 (r247908) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd January 22, 2012 .Dt VIRTIO 4 .Os .Sh NAME @@ -48,29 +48,34 @@ virtio_pci_load="YES" .Sh DESCRIPTION VirtIO is a specification for para-virtualized I/O in a virtual machine (VM). Traditionally, the hypervisor emulated real devices such as an Ethernet -interface or disk controller to provide the VM with I/O. This emulation is -often inefficient. +interface or disk controller to provide the VM with I/O. +This emulation is often inefficient. .Pp VirtIO defines an interface for efficient I/O between the hypervisor and VM. -The -.Xr virtio 4 +The +.Xr virtio 4 module provides a shared memory transport called a virtqueue. The .Xr virtio_pci 4 device driver represents an emulated PCI device that the hypervisor makes -available to the VM. This device provides the probing, configuration, and -interrupt notifications need to interact with the hypervisor. +available to the VM. +This device provides the probing, configuration, and +interrupt notifications needed to interact with the hypervisor. .Fx supports the following VirtIO devices: .Bl -hang -offset indent -width xxxxxxxx .It Nm Ethernet An emulated Ethernet device is provided by the -.Xr if_vtnet 4 +.Xr vtnet 4 device driver. .It Nm Block An emulated disk controller is provided by the .Xr virtio_blk 4 device driver. +.It Nm SCSI +An emulated SCSI HBA is provided by the +.Xr virtio_scsi 4 +device driver. .It Nm Balloon A pseudo-device to allow the VM to release memory back to the hypervisor is provided by the @@ -78,9 +83,10 @@ provided by the device driver. .El .Sh SEE ALSO -.Xr if_vtnet 4 , +.Xr virtio_balloon 4 , .Xr virtio_blk 4 , -.Xr virtio_balloon 4 +.Xr virtio_scsi 4 , +.Xr vtnet 4 .Sh HISTORY Support for VirtIO first appeared in .Fx 9.0 . Copied and modified: stable/8/share/man/man4/virtio_balloon.4 (from r227652, head/share/man/man4/virtio_balloon.4) ============================================================================== --- head/share/man/man4/virtio_balloon.4 Fri Nov 18 05:43:43 2011 (r227652, copy source) +++ stable/8/share/man/man4/virtio_balloon.4 Thu Mar 7 07:02:31 2013 (r247908) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd January 22, 2012 .Dt VIRTIO_BALLOON 4 .Os .Sh NAME @@ -51,8 +51,8 @@ device driver provides support for VirtI .Pp The memory balloon allows the guest to, at the request of the hypervisor, return memory allocated to the hypervisor so it can -be made available to other guests. The hypervisor can later -signal the balloon to return the memory. +be made available to other guests. +The hypervisor can later signal the balloon to return the memory. .Sh SEE ALSO .Xr virtio 4 .Sh HISTORY Copied and modified: stable/8/share/man/man4/virtio_blk.4 (from r227652, head/share/man/man4/virtio_blk.4) ============================================================================== --- head/share/man/man4/virtio_blk.4 Fri Nov 18 05:43:43 2011 (r227652, copy source) +++ stable/8/share/man/man4/virtio_blk.4 Thu Mar 7 07:02:31 2013 (r247908) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd January 22, 2012 .Dt VIRTIO_BLK 4 .Os .Sh NAME @@ -48,7 +48,6 @@ virtio_blk_load="YES" The .Nm device driver provides support for VirtIO block devices. -.Pp .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 @@ -57,7 +56,8 @@ prompt before booting the kernel or stor .Bl -tag -width "xxxxxx" .It Va hw.vtblk.no_ident This tunable disables retrieving the device identification string -from the hypervisor. The default value is 0. +from the hypervisor. +The default value is 0. .El .Sh SEE ALSO .Xr virtio 4 Copied: stable/8/share/man/man4/virtio_scsi.4 (from r241470, head/share/man/man4/virtio_scsi.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/virtio_scsi.4 Thu Mar 7 07:02:31 2013 (r247908, copy of r241470, head/share/man/man4/virtio_scsi.4) @@ -0,0 +1,92 @@ +.\" Copyright (c) 2012 Bryan Venteicher +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 24, 2012 +.Dt VIRTIO_SCSI 4 +.Os +.Sh NAME +.Nm virtio_scsi +.Nd VirtIO SCSI driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device virtio_scsi" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_scsi_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for VirtIO SCSI devices. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vtscsi.bus_reset_disable +In the initial QEMU release with VirtIO SCSI support, in-flight +operations were not aborted when stopping the device, rendering +bus reset ineffective. This tunable disables attempts to issue +reset bus commands. The default value is 1. +.El +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.vtscsi.X.debug_level +.Ed +.Pp +variable, where X is the adapter number, either in +.Xr loader.conf 5 +or via +.Xr sysctl 8 . +The following bits have the described effects: +.Bl -tag -width 6n -offset indent +.It 0x01 +Enable informational prints. +.It 0x02 +Enable prints for driver errors. +.It 0x04 +Enable tracing prints. +.El +.Sh SEE ALSO +.Xr virtio 4 +.Sh HISTORY +The +.Nm +driver was written by +.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +It first appeared in +.Fx 10.0 . Copied and modified: stable/8/share/man/man4/vtnet.4 (from r227652, head/share/man/man4/vtnet.4) ============================================================================== --- head/share/man/man4/vtnet.4 Fri Nov 18 05:43:43 2011 (r227652, copy source) +++ stable/8/share/man/man4/vtnet.4 Thu Mar 7 07:02:31 2013 (r247908) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd January 22, 2012 .Dt VTNET 4 .Os .Sh NAME @@ -62,7 +62,6 @@ utility configures the adapter to receiv .Pp For more information on configuring this device, see .Xr ifconfig 8 . -.El .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 @@ -70,19 +69,21 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" .It Va hw.vtnet.csum_disable -This tunable disables receive and send checksum offload. The default -value is 0. +This tunable disables receive and send checksum offload. +The default value is 0. .It Va hw.vtnet.tso_disable -This tunable disables TSO. The default value is 0. +This tunable disables TSO. +The default value is 0. .It Va hw.vtnet.lro_disable -This tunable disables LRO. The default value is 0. +This tunable disables LRO. +The default value is 0. .El .Sh SEE ALSO .Xr arp 4 , .Xr netintro 4 , .Xr ng_ether 4 , -.Xr vlan 4 , .Xr virtio 4 , +.Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 07:28:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83BDFCBB; Thu, 7 Mar 2013 07:28:07 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 671153E7; Thu, 7 Mar 2013 07:28:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r277S7MG057252; Thu, 7 Mar 2013 07:28:07 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r277S69a057240; Thu, 7 Mar 2013 07:28:06 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201303070728.r277S69a057240@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 7 Mar 2013 07:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247909 - in stable/8/sys: amd64/conf conf i386/conf 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 07:28:07 -0000 Author: bryanv Date: Thu Mar 7 07:28:05 2013 New Revision: 247909 URL: http://svnweb.freebsd.org/changeset/base/247909 Log: MFC r245362 Add VirtIO to i386 and amd64 GENERIC Approved by: grehan (mentor) Modified: stable/8/sys/amd64/conf/GENERIC stable/8/sys/amd64/conf/NOTES stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/i386/conf/GENERIC stable/8/sys/i386/conf/NOTES Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/conf/ (props changed) stable/8/sys/i386/ (props changed) Modified: stable/8/sys/amd64/conf/GENERIC ============================================================================== --- stable/8/sys/amd64/conf/GENERIC Thu Mar 7 07:02:31 2013 (r247908) +++ stable/8/sys/amd64/conf/GENERIC Thu Mar 7 07:28:05 2013 (r247909) @@ -331,3 +331,11 @@ device fwe # Ethernet over FireWire (n device fwip # IP over FireWire (RFC 2734,3146) device dcons # Dumb console driver device dcons_crom # Configuration ROM for dcons + +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Thu Mar 7 07:02:31 2013 (r247908) +++ stable/8/sys/amd64/conf/NOTES Thu Mar 7 07:28:05 2013 (r247909) @@ -422,6 +422,15 @@ device safe # SafeNet 1141 options SAFE_DEBUG # enable debugging support: hw.safe.debug options SAFE_RNDTEST # enable rndtest support +# +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI Interface +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device + ##################################################################### # Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Thu Mar 7 07:02:31 2013 (r247908) +++ stable/8/sys/conf/files.amd64 Thu Mar 7 07:28:05 2013 (r247909) @@ -353,6 +353,15 @@ dev/isci/scil/scif_sas_task_request.c dev/isci/scil/scif_sas_task_request_state_handlers.c optional isci dev/isci/scil/scif_sas_task_request_states.c optional isci dev/isci/scil/scif_sas_timer.c optional isci +dev/virtio/virtio.c optional virtio +dev/virtio/virtqueue.c optional virtio +dev/virtio/virtio_bus_if.m optional virtio +dev/virtio/virtio_if.m optional virtio +dev/virtio/pci/virtio_pci.c optional virtio_pci virtio pci +dev/virtio/network/if_vtnet.c optional vtnet virtio +dev/virtio/block/virtio_blk.c optional virtio_blk virtio +dev/virtio/balloon/virtio_balloon.c optional virtio_balloon virtio +dev/virtio/scsi/virtio_scsi.c optional virtio_scsi virtio scbus isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/link_elf_obj.c standard Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Thu Mar 7 07:02:31 2013 (r247908) +++ stable/8/sys/conf/files.i386 Thu Mar 7 07:28:05 2013 (r247909) @@ -358,6 +358,15 @@ dev/isci/scil/scif_sas_task_request.c dev/isci/scil/scif_sas_task_request_state_handlers.c optional isci dev/isci/scil/scif_sas_task_request_states.c optional isci dev/isci/scil/scif_sas_timer.c optional isci +dev/virtio/virtio.c optional virtio +dev/virtio/virtqueue.c optional virtio +dev/virtio/virtio_bus_if.m optional virtio +dev/virtio/virtio_if.m optional virtio +dev/virtio/pci/virtio_pci.c optional virtio_pci virtio pci +dev/virtio/network/if_vtnet.c optional vtnet virtio +dev/virtio/block/virtio_blk.c optional virtio_blk virtio +dev/virtio/balloon/virtio_balloon.c optional virtio_balloon virtio +dev/virtio/scsi/virtio_scsi.c optional virtio_scsi virtio scbus i386/acpica/OsdEnvironment.c optional acpi i386/acpica/acpi_machdep.c optional acpi i386/acpica/acpi_wakeup.c optional acpi Modified: stable/8/sys/i386/conf/GENERIC ============================================================================== --- stable/8/sys/i386/conf/GENERIC Thu Mar 7 07:02:31 2013 (r247908) +++ stable/8/sys/i386/conf/GENERIC Thu Mar 7 07:28:05 2013 (r247909) @@ -345,3 +345,11 @@ device fwe # Ethernet over FireWire (n device fwip # IP over FireWire (RFC 2734,3146) device dcons # Dumb console driver device dcons_crom # Configuration ROM for dcons + +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Thu Mar 7 07:02:31 2013 (r247908) +++ stable/8/sys/i386/conf/NOTES Thu Mar 7 07:28:05 2013 (r247909) @@ -764,6 +764,15 @@ options SAFE_RNDTEST # enable rndtest s # device glxsb # AMD Geode LX Security Block +# +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI Interface +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device + ##################################################################### # From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 07:54:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A7B1D34B; Thu, 7 Mar 2013 07:54:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8FA096A9; Thu, 7 Mar 2013 07:54:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r277sofI065604; Thu, 7 Mar 2013 07:54:50 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r277soET065603; Thu, 7 Mar 2013 07:54:50 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201303070754.r277soET065603@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 7 Mar 2013 07:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247910 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 07:54:50 -0000 Author: glebius Date: Thu Mar 7 07:54:50 2013 New Revision: 247910 URL: http://svnweb.freebsd.org/changeset/base/247910 Log: Plug a memory leak. Reviewed by: mav Sponsored by: Nginx, Inc. Modified: head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Thu Mar 7 07:28:05 2013 (r247909) +++ head/sys/dev/sound/pci/hda/hdacc.c Thu Mar 7 07:54:50 2013 (r247910) @@ -460,8 +460,12 @@ hdacc_attach(device_t dev) static int hdacc_detach(device_t dev) { + struct hdacc_softc *codec = device_get_softc(dev); + int error; - return (device_delete_children(dev)); + error = device_delete_children(dev); + free(codec->fgs, M_HDACC); + return (error); } static int From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 08:00:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 471395B4; Thu, 7 Mar 2013 08:00:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21BCC6D2; Thu, 7 Mar 2013 08:00:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27805n8066466; Thu, 7 Mar 2013 08:00:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27804kJ066462; Thu, 7 Mar 2013 08:00:04 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201303070800.r27804kJ066462@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 7 Mar 2013 08:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247911 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 08:00:05 -0000 Author: glebius Date: Thu Mar 7 08:00:04 2013 New Revision: 247911 URL: http://svnweb.freebsd.org/changeset/base/247911 Log: Add quirks to enable headphones redirection on number of Lenovo laptops, namely X1, X1 Carbon, T420, T520. PR: misc/176656 Submitted by: Hiren Panchasar Tested by: glebius, X1 Carbon Tested by: osa, X1 Tested by: Hiren Panchasar, T420 Tested by: sbruno, T520 Reviewed by: mav Sponsored by: Nginx, Inc. Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Thu Mar 7 07:54:50 2013 (r247910) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Thu Mar 7 08:00:04 2013 (r247911) @@ -334,12 +334,22 @@ hdac_pin_patch(struct hdaa_widget *w) break; } } else if (id == HDA_CODEC_CX20590 && - subid == LENOVO_X220_SUBVENDOR) { + (subid == LENOVO_X1_SUBVENDOR || + subid == LENOVO_X220_SUBVENDOR || + subid == LENOVO_T420_SUBVENDOR || + subid == LENOVO_T520_SUBVENDOR)) { switch (nid) { case 25: patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_ALC269 && + subid == LENOVO_X1CRBN_SUBVENDOR) { + switch (nid) { + case 21: + patch = "as=1 seq=15"; + break; + } } if (patch != NULL) Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Thu Mar 7 07:54:50 2013 (r247910) +++ head/sys/dev/sound/pci/hda/hdac.h Thu Mar 7 08:00:04 2013 (r247911) @@ -220,8 +220,12 @@ #define LENOVO_3KN200_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_B450_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3a0d) #define LENOVO_TCA55_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x1015) +#define LENOVO_X1_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21e8) +#define LENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9) #define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da) #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) +#define LENOVO_T420_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce) +#define LENOVO_T520_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21cf) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 08:19:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5CD5F9C7; Thu, 7 Mar 2013 08:19:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id B2EAA788; Thu, 7 Mar 2013 08:19:09 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r278J728066383; Thu, 7 Mar 2013 12:19:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r278J7NX066382; Thu, 7 Mar 2013 12:19:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 7 Mar 2013 12:19:07 +0400 From: Gleb Smirnoff To: Jung-uk Kim Subject: Re: svn commit: r246856 - head/etc Message-ID: <20130307081907.GF48089@glebius.int.ru> References: <201302152258.r1FMwiQp033077@svn.freebsd.org> <20130306150133.GB48089@FreeBSD.org> <51378E2E.4090709@FreeBSD.org> <20130307080756.GE48089@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130307080756.GE48089@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 08:19:11 -0000 On Thu, Mar 07, 2013 at 12:07:56PM +0400, Gleb Smirnoff wrote: T> On Wed, Mar 06, 2013 at 01:42:54PM -0500, Jung-uk Kim wrote: T> J> You know, I disagreed with the above change because this type of T> J> quirks can be easily handled by the driver. IMHO, /etc/rc.resume is T> J> the last place to put it. When I committed r233580 to fix resuming T> J> psm(4) and MFC'd it to stable/9 (r234713), we had an agreement to back T> J> it out if we hear no user complaints for enough time *without* merging T> J> your /etc/rc.resume changes. At least, that's what I remember. In T> J> fact, you never MFC'd your changes. So, I thought the agreement is T> J> still valid and it is safe to back out. I am sorry for not asking T> J> your confirmation, though. T> J> T> J> Now, please consider fixing psm. If you can't find a generic T> J> solution, it is okay to add your model-specific quirk in T> J> sys/dev/atkbdc/psm.c like this: T> J> T> J> http://svnweb.freebsd.org/base/head/sys/dev/atkbdc/psm.c?annotate=233580#l1441 T> J> T> J> Also, please mention it in the manual page, i.e., the CAVEATS section of T> J> psm(4). T> T> On my laptop the psm(4) is a generic mouse: T> T> psm0: irq 12 on atkbdc0 T> psm0: [GIANT-LOCKED] T> psm0: model Generic PS/2 mouse, device ID 0 T> T> Do you suggest to add PSM_CONFIG_INITAFTERSUSPEND flag for all generic mice? P.S. I've tested this and it works. Index: psm.c =================================================================== --- psm.c (revision 247911) +++ psm.c (working copy) @@ -1449,6 +1449,7 @@ case MOUSE_MODEL_SYNAPTICS: case MOUSE_MODEL_GLIDEPOINT: case MOUSE_MODEL_VERSAPAD: + case MOUSE_MODEL_GENERIC: sc->config |= PSM_CONFIG_INITAFTERSUSPEND; break; default: -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 08:42:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0251F56A; Thu, 7 Mar 2013 08:42:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 613FAB1C; Thu, 7 Mar 2013 08:42:19 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r2787urN066298; Thu, 7 Mar 2013 12:07:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r2787uwB066297; Thu, 7 Mar 2013 12:07:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 7 Mar 2013 12:07:56 +0400 From: Gleb Smirnoff To: Jung-uk Kim Subject: Re: svn commit: r246856 - head/etc Message-ID: <20130307080756.GE48089@FreeBSD.org> References: <201302152258.r1FMwiQp033077@svn.freebsd.org> <20130306150133.GB48089@FreeBSD.org> <51378E2E.4090709@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <51378E2E.4090709@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 08:42:21 -0000 Jung-uk, On Wed, Mar 06, 2013 at 01:42:54PM -0500, Jung-uk Kim wrote: J> You know, I disagreed with the above change because this type of J> quirks can be easily handled by the driver. IMHO, /etc/rc.resume is J> the last place to put it. When I committed r233580 to fix resuming J> psm(4) and MFC'd it to stable/9 (r234713), we had an agreement to back J> it out if we hear no user complaints for enough time *without* merging J> your /etc/rc.resume changes. At least, that's what I remember. In J> fact, you never MFC'd your changes. So, I thought the agreement is J> still valid and it is safe to back out. I am sorry for not asking J> your confirmation, though. J> J> Now, please consider fixing psm. If you can't find a generic J> solution, it is okay to add your model-specific quirk in J> sys/dev/atkbdc/psm.c like this: J> J> http://svnweb.freebsd.org/base/head/sys/dev/atkbdc/psm.c?annotate=233580#l1441 J> J> Also, please mention it in the manual page, i.e., the CAVEATS section of J> psm(4). On my laptop the psm(4) is a generic mouse: psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model Generic PS/2 mouse, device ID 0 Do you suggest to add PSM_CONFIG_INITAFTERSUSPEND flag for all generic mice? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 09:18:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C119A2A; Thu, 7 Mar 2013 09:18:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8EC2ED08; Thu, 7 Mar 2013 09:18:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r279IrKO090550; Thu, 7 Mar 2013 09:18:53 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r279IrCC090549; Thu, 7 Mar 2013 09:18:53 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201303070918.r279IrCC090549@svn.freebsd.org> From: Andrew Turner Date: Thu, 7 Mar 2013 09:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247912 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 09:18:53 -0000 Author: andrew Date: Thu Mar 7 09:18:52 2013 New Revision: 247912 URL: http://svnweb.freebsd.org/changeset/base/247912 Log: Add __clzsi2 and ctzsi2. They are required on ARMv4 and ARMv5 to implement a number of builtin functions. Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Thu Mar 7 08:00:04 2013 (r247911) +++ head/lib/libstand/Makefile Thu Mar 7 09:18:52 2013 (r247912) @@ -67,6 +67,9 @@ SRCS+= divsi3.S .else # Compiler support functions .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 10:29:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C4E9394B; Thu, 7 Mar 2013 10:29:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 88B58FCE; Thu, 7 Mar 2013 10:29:57 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a] (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1D4325C43; Thu, 7 Mar 2013 11:29:54 +0100 (CET) Message-ID: <51386C23.2020600@FreeBSD.org> Date: Thu, 07 Mar 2013 11:29:55 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Glen Barber , =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= Subject: Re: svn commit: r247904 - head/crypto/openssh References: <201303062322.r26NMebp009010@svn.freebsd.org> <20130307022835.GA1496@glenbarber.us> In-Reply-To: <20130307022835.GA1496@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 10:29:57 -0000 On 2013-03-07 03:28, Glen Barber wrote: > On Wed, Mar 06, 2013 at 11:22:40PM +0000, Dag-Erling Sm=F8rgrav wrote: >> Author: des >> Date: Wed Mar 6 23:22:40 2013 >> New Revision: 247904 >> URL: http://svnweb.freebsd.org/changeset/base/247904 >> >> Log: >> Remove strnvis(), strvis(), strvisx(). >> >> Modified: >> head/crypto/openssh/ssh_namespace.h >> > > This commit now causes ssh(1) to dump core. Indeed, it will be the same problem that was reported many times on ports@; our strnvis() is not compatible with OpenBSD's strnvis(). :( From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 11:54:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4C3F8FB5; Thu, 7 Mar 2013 11:54:37 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0ECF8384; Thu, 7 Mar 2013 11:54:36 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id A5B7AC000; Thu, 7 Mar 2013 11:54:29 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 6F1F59940; Thu, 7 Mar 2013 12:54:29 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Dimitry Andric Subject: Re: svn commit: r247904 - head/crypto/openssh References: <201303062322.r26NMebp009010@svn.freebsd.org> <20130307022835.GA1496@glenbarber.us> <51386C23.2020600@FreeBSD.org> Date: Thu, 07 Mar 2013 12:54:29 +0100 In-Reply-To: <51386C23.2020600@FreeBSD.org> (Dimitry Andric's message of "Thu, 07 Mar 2013 11:29:55 +0100") Message-ID: <86txonqvbe.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, Sean Bruno X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 11:54:37 -0000 Dimitry Andric writes: > Glen Barber writes: > > This commit now causes ssh(1) to dump core. > Indeed, it will be the same problem that was reported many times on > ports@; our strnvis() is not compatible with OpenBSD's strnvis(). :( Thank you, and my apologies for the string of f*ups. I am currently testing a patch based on Dimitry's and Sean's suggestions. I've been working like a dog on OpenPAM and OpenSSH the last couple of weeks and made a few too many assumptions... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 12:27:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B30CCBED; Thu, 7 Mar 2013 12:27:59 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510b]) by mx1.freebsd.org (Postfix) with SMTP id 577E1730; Thu, 7 Mar 2013 12:27:58 +0000 (UTC) Received: from walton.maths.tcd.ie ([134.226.81.10] helo=walton.maths.tcd.ie) by salmon.maths.tcd.ie with SMTP id ; 7 Mar 2013 12:27:57 +0000 (GMT) Received: from maths.tcd.ie (localhost [127.0.0.1]) by walton.maths.tcd.ie (Postfix) with ESMTP id 2A5AD7306D; Thu, 7 Mar 2013 12:27:57 +0000 (GMT) To: Peter Grehan Subject: Re: svn commit: r247871 - head/usr.sbin/bhyve In-reply-to: Your message of "Thu, 07 Mar 2013 09:33:00 +1000." <201303062333.042821@dommail.onthenet.com.au> Date: Thu, 07 Mar 2013 12:27:56 +0000 From: David Malone Message-Id: <20130307122757.2A5AD7306D@walton.maths.tcd.ie> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 12:27:59 -0000 > Any suggestions for better wording ? I submitted the comment block unchanged I think you could probably replace it with "Z(2^16)" or "mod 65536". In the code, it might be worth checking with bde@ to see what is the least amount of casting required to get the right answer. David. From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 13:24:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 47231BF9; Thu, 7 Mar 2013 13:24:17 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37F6598E; Thu, 7 Mar 2013 13:24:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27DOHNl066225; Thu, 7 Mar 2013 13:24:17 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27DOHXB066224; Thu, 7 Mar 2013 13:24:17 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201303071324.r27DOHXB066224@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 7 Mar 2013 13:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247913 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 13:24:17 -0000 Author: gavin Date: Thu Mar 7 13:24:16 2013 New Revision: 247913 URL: http://svnweb.freebsd.org/changeset/base/247913 Log: Suggest using the https: protocol not the svn: protocol to retrieve the various repositories. Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Thu Mar 7 09:18:52 2013 (r247912) +++ head/share/man/man7/development.7 Thu Mar 7 13:24:16 2013 (r247913) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2012 +.Dd March 7, 2013 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -109,9 +109,9 @@ your clients automatically pick up the c .Bd -literal -offset 4n mkdir /FreeBSD cd /FreeBSD -svn co svn://svn.freebsd.org/ports/head ports -svn co svn://svn.freebsd.org/doc/head doc -svn co svn://svn.freebsd.org/base/head src +svn co https://svn.freebsd.org/ports/head ports +svn co https://svn.freebsd.org/doc/head doc +svn co https://svn.freebsd.org/base/head src cd /usr rm -rf src ln -s /FreeBSD/src src From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 13:24:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 05BC9D73; Thu, 7 Mar 2013 13:24:50 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EAFF899C; Thu, 7 Mar 2013 13:24:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27DOnR9066327; Thu, 7 Mar 2013 13:24:49 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27DOnXJ066326; Thu, 7 Mar 2013 13:24:49 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201303071324.r27DOnXJ066326@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 7 Mar 2013 13:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247914 - head/sys/sparc64/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 13:24:50 -0000 Author: gavin Date: Thu Mar 7 13:24:49 2013 New Revision: 247914 URL: http://svnweb.freebsd.org/changeset/base/247914 Log: Correct two spelling mistakes in a comment. Modified: head/sys/sparc64/pci/psycho.c Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Thu Mar 7 13:24:16 2013 (r247913) +++ head/sys/sparc64/pci/psycho.c Thu Mar 7 13:24:49 2013 (r247914) @@ -200,7 +200,7 @@ struct psycho_icarg { * "Sabre" is the UltraSPARC IIi onboard UPA to PCI bridge. It manages a * single PCI bus and does not have a streaming buffer. It often has an APB * (advanced PCI bridge) connected to it, which was designed specifically for - * the IIi. The APB let's the IIi handle two independednt PCI buses, and + * the IIi. The APB lets the IIi handle two independent PCI buses, and * appears as two "Simba"'s underneath the Sabre. * * "Hummingbird" is the UltraSPARC IIe onboard UPA to PCI bridge. It's From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 13:26:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F297F07; Thu, 7 Mar 2013 13:26:55 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 51C0A9B4; Thu, 7 Mar 2013 13:26:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27DQtQ3066660; Thu, 7 Mar 2013 13:26:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27DQt6l066659; Thu, 7 Mar 2013 13:26:55 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201303071326.r27DQt6l066659@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 7 Mar 2013 13:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247915 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 13:26:55 -0000 Author: gavin Date: Thu Mar 7 13:26:54 2013 New Revision: 247915 URL: http://svnweb.freebsd.org/changeset/base/247915 Log: The ZyXEL ZyAIR G-202 is also supported by zyd(4) MFC after: 1 week Modified: head/share/man/man4/zyd.4 Modified: head/share/man/man4/zyd.4 ============================================================================== --- head/share/man/man4/zyd.4 Thu Mar 7 13:24:49 2013 (r247914) +++ head/share/man/man4/zyd.4 Thu Mar 7 13:26:54 2013 (r247915) @@ -32,7 +32,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 2, 2009 +.Dd March 7, 2013 .Dt ZYD 4 .Os .Sh NAME @@ -121,6 +121,7 @@ driver: .It X-Micro XWL-11GUZX .It Yakumo QuickWLAN USB .It Zonet ZEW2501 +.It ZyXEL ZyAIR G-202 .It ZyXEL ZyAIR G-220 .El .Sh EXAMPLES From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 14:38:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD838917; Thu, 7 Mar 2013 14:38:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5D48E71; Thu, 7 Mar 2013 14:38:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27EciXw088586; Thu, 7 Mar 2013 14:38:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27EciLY088584; Thu, 7 Mar 2013 14:38:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201303071438.r27EciLY088584@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 7 Mar 2013 14:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247916 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 14:38:44 -0000 Author: des Date: Thu Mar 7 14:38:43 2013 New Revision: 247916 URL: http://svnweb.freebsd.org/changeset/base/247916 Log: Partially revert r247892 and r247904 since our strnvis() does not behave the way OpenSSH expects. Modified: head/crypto/openssh/config.h head/crypto/openssh/ssh_namespace.h Modified: head/crypto/openssh/config.h ============================================================================== --- head/crypto/openssh/config.h Thu Mar 7 13:26:54 2013 (r247915) +++ head/crypto/openssh/config.h Thu Mar 7 14:38:43 2013 (r247916) @@ -956,7 +956,7 @@ #define HAVE_STRNLEN 1 /* Define to 1 if you have the `strnvis' function. */ -#define HAVE_STRNVIS 1 +/* #undef HAVE_STRNVIS */ /* Define to 1 if you have the `strptime' function. */ #define HAVE_STRPTIME 1 @@ -1196,7 +1196,7 @@ /* #undef HAVE_VHANGUP */ /* Define to 1 if you have the header file. */ -#define HAVE_VIS_H 1 +/* #undef HAVE_VIS_H */ /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 Modified: head/crypto/openssh/ssh_namespace.h ============================================================================== --- head/crypto/openssh/ssh_namespace.h Thu Mar 7 13:26:54 2013 (r247915) +++ head/crypto/openssh/ssh_namespace.h Thu Mar 7 14:38:43 2013 (r247916) @@ -451,6 +451,9 @@ #define start_progress_meter ssh_start_progress_meter #define stop_progress_meter ssh_stop_progress_meter #define strdelim ssh_strdelim +#define strnvis ssh_strnvis +#define strvis ssh_strvis +#define strvisx ssh_strvisx #define sys_tun_open ssh_sys_tun_open #define temporarily_use_uid ssh_temporarily_use_uid #define tilde_expand_filename ssh_tilde_expand_filename From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 15:00:28 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A42F24F9; Thu, 7 Mar 2013 15:00:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id 3C295F89; Thu, 7 Mar 2013 15:00:27 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r27F0HdK016105 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Mar 2013 02:00:18 +1100 Date: Fri, 8 Mar 2013 02:00:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Colin Percival Subject: Re: svn commit: r247871 - head/usr.sbin/bhyve In-Reply-To: <5137CF1D.3020506@freebsd.org> Message-ID: <20130308004634.W1510@besplex.bde.org> References: <201303060728.r267SKP3018477@svn.freebsd.org> <20130306231613.GA5146@walton.maths.tcd.ie> <5137CF1D.3020506@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=D4sfsYtj c=1 sm=1 a=Elr93avQcp4A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=QQmxuq8U6XYA:10 a=BcfssYsZeSQLbLEJ4oIA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: David Malone , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Peter Grehan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 15:00:28 -0000 On Wed, 6 Mar 2013, Colin Percival wrote: > On 03/06/13 15:16, David Malone wrote: >>> + /* >>> + * We're just computing (a-b) in GF(216). >> >>> + ndesc = (unsigned)*hq->hq_avail_idx - (unsigned)hq->hq_cur_aidx; >> >> I think the comment here is wrong? Subtraction (and addition) in >> GF(2^16) is just xor of 16 bit numbers. You seem to actually be >> working in Z(2^16), where subtraction is normal subtraction mod >> 65536. > > Given that there's no such thing as GF(216) due to 216 = 2^3 * 3^3 not > being a prime power, the comment is definitely wrong. ;-) 216 looks like a typo for 2**16, but 2**16 is even more obviously not a prime :-). 2^16 looks like way of writing 2**16 in non-C contexts where '^' isn't the xor operator. The `unsigned' casts seem to be wrong too: - 'unsigned' is spelled u_int in KNF, and bhyve used the latter everywhere else in the directory. (However, it only spelled 'unsigned char' as u_char in 12 out of 15 instances.) - they don't actually work to give subtraction mod 2**16. Assume a result that carries (this was the complicated case in the old code). Say first term = 1 and second term = 3. These promote to int, thanks to C90's broken "value-preserving" promotion rules. The result with uncast ints would be -2. Assigning this to "int ndesc;" doesn't change the value. With the ints cast to unsigned, the result is 1U - 3U = -2U. Assigning this to "int ndesc;" gives an implementation-defined result that is usually -2. Not what we want. We want (uint16_t)-2 = 0xFFFE. The casts of the terms make no difference except to give implementation- defined behaviour. The cast of the result of the expression has the same defined behaviour of adding 1 more than UINT16_MAX that was coded explicitly for the case that carries in the old version. The broken promotion rules actually help here, by avoiding the implementation-defined behaviour provided int is larger than uint16_t. However, ndesc shouild be u_int to avoid the immplementation-defined behaviour from assigning large u_ints to it, or better uint16_t to discard the top bits without a cast. The general method that works here is: u_int result, t1, t2; result = t1 - t2; or uintN_t result, t1, t2; result = t1 - t2; where uintN_t has promotion rank higher than u_int. Using a uintN_t that has promotion rank smaller than u_int gives promotions to int, or using int directly, give a morass of sign extension problems. However, when promotion occurs, it prevents overflow of the signed int expression, and the result of that is usable of you convert it back to uintN_t before really using it. That is not done here -- the next use is an assert() that will fail when ndesc = -2, or, if ndesc is changed to u_int, then it will fail when ndesc = -2U ~= infinity. The code seems to be quite broken apart from this. Maybe just the assert() in it. Wrap probably doesn't give numbers like 1-3 (mod 2**16) = 65534, but more like 1-63 (mod 2**16) = 65536-62 = 65474. Here the magic 63 is the queue size - 1. We want a difference of 2, and would get that by evaluating mod the queue size, but we evaluate modulo 2**16 modulo bugs. 65474 exceeds the queue size so the assertion fails. The modulo by 2**16 can be done a bit faster, at least if ints are 16 bits, but the critical uses of the indexes seem to mostly do a slow runtime modulo (uidx % hq->hq_size), so they will be slow but will work if the indexes are taken mod 2**16 or even mod 2**(number of bits in u_int). Calculating the difference with a sloppy modulo might work too. But not when we assert that it gives a small value. Also, if the indexes are allowed to exceed the queue size, then even the non-carry case may give a large value. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 16:50:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C936529B; Thu, 7 Mar 2013 16:50:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC3B86C8; Thu, 7 Mar 2013 16:50:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Go8xS028745; Thu, 7 Mar 2013 16:50:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Go8KE028744; Thu, 7 Mar 2013 16:50:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303071650.r27Go8KE028744@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Mar 2013 16:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247917 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 16:50:08 -0000 Author: mav Date: Thu Mar 7 16:50:07 2013 New Revision: 247917 URL: http://svnweb.freebsd.org/changeset/base/247917 Log: Fix off-by-one error in nanoseconds validation. Submitted by: bde Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Mar 7 14:38:43 2013 (r247916) +++ head/sys/kern/kern_event.c Thu Mar 7 16:50:07 2013 (r247917) @@ -1324,7 +1324,7 @@ kqueue_scan(struct kqueue *kq, int maxev rsbt = 0; if (tsp != NULL) { if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 || - tsp->tv_nsec > 1000000000) { + tsp->tv_nsec >= 1000000000) { error = EINVAL; goto done_nl; } From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 18:55:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5E1A3A36; Thu, 7 Mar 2013 18:55:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5114FCE5; Thu, 7 Mar 2013 18:55:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27ItbAX067581; Thu, 7 Mar 2013 18:55:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27ItbM9067580; Thu, 7 Mar 2013 18:55:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303071855.r27ItbM9067580@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Mar 2013 18:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247918 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 18:55:38 -0000 Author: mav Date: Thu Mar 7 18:55:37 2013 New Revision: 247918 URL: http://svnweb.freebsd.org/changeset/base/247918 Log: Fix panic when Secondary_Element_Count == 1 and Secondary_Element_Seq is not set (255). Reported by: sbruno MFC after: 1 week Modified: head/sys/geom/raid/md_ddf.c Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Thu Mar 7 16:50:07 2013 (r247917) +++ head/sys/geom/raid/md_ddf.c Thu Mar 7 18:55:37 2013 (r247918) @@ -881,7 +881,10 @@ ddf_vol_meta_update(struct ddf_vol_meta hdr = src->hdr; vde = &src->vdr->entry[ddf_meta_find_vd(src, GUID)]; vdc = ddf_meta_find_vdc(src, GUID); - bvd = GET8D(src, vdc->Secondary_Element_Seq); + if (GET8D(src, vdc->Secondary_Element_Count) == 1) + bvd = 0; + else + bvd = GET8D(src, vdc->Secondary_Element_Seq); size = GET16(src, hdr->Configuration_Record_Length) * src->sectorsize; if (dst->vdc == NULL || From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 19:00:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EE16BD23; Thu, 7 Mar 2013 19:00:00 +0000 (UTC) (envelope-from db@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D228ED30; Thu, 7 Mar 2013 19:00:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27J00uM068248; Thu, 7 Mar 2013 19:00:00 GMT (envelope-from db@svn.freebsd.org) Received: (from db@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27J006A068238; Thu, 7 Mar 2013 19:00:00 GMT (envelope-from db@svn.freebsd.org) Message-Id: <201303071900.r27J006A068238@svn.freebsd.org> From: Diane Bruce Date: Thu, 7 Mar 2013 19:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247919 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 19:00:01 -0000 Author: db (ports committer) Date: Thu Mar 7 19:00:00 2013 New Revision: 247919 URL: http://svnweb.freebsd.org/changeset/base/247919 Log: Cleanup gr_add() so it does not leak mem This is part of ongoing work on sbin/pw M libutil.h M gr_util.c Approved by: theraven Modified: head/lib/libutil/gr_util.c head/lib/libutil/libutil.h Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Thu Mar 7 18:55:37 2013 (r247918) +++ head/lib/libutil/gr_util.c Thu Mar 7 19:00:00 2013 (r247919) @@ -49,6 +49,8 @@ static char group_dir[PATH_MAX]; static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; +static size_t grmemlen(const struct group *, const char *, int *); +static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx); /* * Initialize statics @@ -429,90 +431,121 @@ gr_make(const struct group *gr) struct group * gr_dup(const struct group *gr) { + return (gr_add(gr, NULL)); +} +/* + * Add a new member name to a struct group. + */ +struct group * +gr_add(const struct group *gr, const char *newmember) +{ struct group *newgr; - char *dst; size_t len; - int ndx; int num_mem; - /* Calculate size of the group. */ - len = sizeof(*newgr); - if (gr->gr_name != NULL) - len += strlen(gr->gr_name) + 1; - if (gr->gr_passwd != NULL) - len += strlen(gr->gr_passwd) + 1; - if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) - len += strlen(gr->gr_mem[num_mem]) + 1; - len += (num_mem + 1) * sizeof(*gr->gr_mem); - } else - num_mem = -1; + num_mem = 0; + len = grmemlen(gr, newmember, &num_mem); /* Create new group and copy old group into it. */ if ((newgr = malloc(len)) == NULL) return (NULL); - /* point new gr_mem to end of struct + 1 */ - if (gr->gr_mem != NULL) + return (grcopy(gr, newgr, newmember, num_mem)); +} + +/* It is safer to walk the pointers given at gr_mem since there is no + * guarantee the gr_mem + strings are continguous in the given struct group + * but compact the new group into the following form. + * + * The new struct is laid out like this in memory. The example given is + * for a group with two members only. + * + * { + * (char *name) + * (char *passwd) + * (int gid) + * (gr_mem * newgrp + sizeof(struct group) + sizeof(**)) points to gr_mem area + * gr_mem area + * (member1 *) + * (member2 *) + * (NULL) + * (name string) + * (passwd string) + * (member1 string) + * (member2 string) + * } + */ +/* + * Copy the guts of a group plus given name to a preallocated group struct + */ +static struct group * +grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx) +{ + char *dst; + int i; + + if (name != NULL) + ndx++; + /* point new gr_mem to end of struct + 1 if there are names */ + if (ndx != 0) newgr->gr_mem = (char **)(newgr + 1); else newgr->gr_mem = NULL; /* point dst after the end of all the gr_mem pointers in newgr */ - dst = (char *)&newgr->gr_mem[num_mem + 1]; + dst = (char *)&newgr->gr_mem[ndx + 1]; if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; - } else { + } else newgr->gr_name = NULL; - } if (gr->gr_passwd != NULL) { newgr->gr_passwd = dst; dst = stpcpy(dst, gr->gr_passwd) + 1; - } else { + } else newgr->gr_passwd = NULL; - } newgr->gr_gid = gr->gr_gid; - if (gr->gr_mem != NULL) { - for (ndx = 0; ndx < num_mem; ndx++) { - newgr->gr_mem[ndx] = dst; - dst = stpcpy(dst, gr->gr_mem[ndx]) + 1; + if (ndx != 0) { + for (i = 0; gr->gr_mem[i] != NULL; i++) { + newgr->gr_mem[i] = dst; + dst = stpcpy(dst, gr->gr_mem[i]) + 1; + } + if (name != NULL) { + newgr->gr_mem[i++] = dst; + dst = stpcpy(dst, name) + 1; } - newgr->gr_mem[ndx] = NULL; + newgr->gr_mem[i] = NULL; } return (newgr); } /* - * Add a new member name to a struct group. + * Calculate length of a struct group + given name */ -struct group * -gr_add(struct group *gr, char *newmember) +static size_t +grmemlen(const struct group *gr, const char *name, int *num_mem) { - size_t mlen; - int num_mem=0; - char **members; - struct group *newgr; - - if (newmember == NULL) - return(gr_dup(gr)); + size_t len; + int i; + if (gr == NULL) + return (0); + /* Calculate size of the group. */ + len = sizeof(*gr); + if (gr->gr_name != NULL) + len += strlen(gr->gr_name) + 1; + if (gr->gr_passwd != NULL) + len += strlen(gr->gr_passwd) + 1; if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) { - if (strcmp(gr->gr_mem[num_mem], newmember) == 0) { - errno = EEXIST; - return (NULL); - } + for (len = i = 0; gr->gr_mem[i] != NULL; i++) { + len += strlen(gr->gr_mem[i]) + 1; + len += sizeof(*gr->gr_mem); } + *num_mem = i; } - /* Allocate enough for current pointers + 1 more and NULL marker */ - mlen = (num_mem + 2) * sizeof(*gr->gr_mem); - if ((members = malloc(mlen)) == NULL) - return (NULL); - memcpy(members, gr->gr_mem, num_mem * sizeof(*gr->gr_mem)); - members[num_mem++] = newmember; - members[num_mem] = NULL; - gr->gr_mem = members; - newgr = gr_dup(gr); - free(members); - return (newgr); + if (name != NULL) { + len += strlen(name) + 1; + if (gr->gr_mem == NULL) + len += sizeof(*gr->gr_mem); + } + return(len); } /* Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Mar 7 18:55:37 2013 (r247918) +++ head/lib/libutil/libutil.h Thu Mar 7 19:00:00 2013 (r247919) @@ -167,7 +167,7 @@ int gr_copy(int __ffd, int _tfd, const struct group * gr_dup(const struct group *_gr); struct group * - gr_add(struct group *_gr, char *_newmember); + gr_add(const struct group *_gr, const char *_newmember); int gr_equal(const struct group *_gr1, const struct group *_gr2); void gr_fini(void); int gr_init(const char *_dir, const char *_master); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 19:16:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 943A9436; Thu, 7 Mar 2013 19:16:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 24085DEA; Thu, 7 Mar 2013 19:16:57 +0000 (UTC) Message-ID: <5138E729.6070309@FreeBSD.org> Date: Thu, 07 Mar 2013 14:14:49 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130220 Thunderbird/17.0.3 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r246856 - head/etc References: <201302152258.r1FMwiQp033077@svn.freebsd.org> <20130306150133.GB48089@FreeBSD.org> <51378E2E.4090709@FreeBSD.org> <20130307080756.GE48089@FreeBSD.org> <20130307081907.GF48089@glebius.int.ru> In-Reply-To: <20130307081907.GF48089@glebius.int.ru> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 19:16:57 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2013-03-07 03:19:07 -0500, Gleb Smirnoff wrote: > On Thu, Mar 07, 2013 at 12:07:56PM +0400, Gleb Smirnoff wrote: T> > On Wed, Mar 06, 2013 at 01:42:54PM -0500, Jung-uk Kim wrote: T> J> > You know, I disagreed with the above change because this type of T> > J> quirks can be easily handled by the driver. IMHO, > /etc/rc.resume is T> J> the last place to put it. When I committed > r233580 to fix resuming T> J> psm(4) and MFC'd it to stable/9 > (r234713), we had an agreement to back T> J> it out if we hear no > user complaints for enough time *without* merging T> J> your > /etc/rc.resume changes. At least, that's what I remember. In T> > J> fact, you never MFC'd your changes. So, I thought the agreement > is T> J> still valid and it is safe to back out. I am sorry for > not asking T> J> your confirmation, though. T> J> T> J> Now, please > consider fixing psm. If you can't find a generic T> J> solution, > it is okay to add your model-specific quirk in T> J> > sys/dev/atkbdc/psm.c like this: T> J> T> J> > http://svnweb.freebsd.org/base/head/sys/dev/atkbdc/psm.c?annotate=233580#l1441 > > T> J> > T> J> Also, please mention it in the manual page, i.e., the CAVEATS > section of T> J> psm(4). T> T> On my laptop the psm(4) is a generic > mouse: T> T> psm0: irq 12 on atkbdc0 T> psm0: > [GIANT-LOCKED] T> psm0: model Generic PS/2 mouse, device ID 0 T> T> > Do you suggest to add PSM_CONFIG_INITAFTERSUSPEND flag for all > generic mice? > > P.S. I've tested this and it works. > > Index: psm.c > =================================================================== > > - --- psm.c (revision 247911) > +++ psm.c (working copy) @@ -1449,6 +1449,7 @@ case > MOUSE_MODEL_SYNAPTICS: case MOUSE_MODEL_GLIDEPOINT: case > MOUSE_MODEL_VERSAPAD: + case MOUSE_MODEL_GENERIC: sc->config > |= PSM_CONFIG_INITAFTERSUSPEND; break; default: > If we really have no other choice, it should be added to GENERIC.hints. Index: sys/amd64/conf/GENERIC.hints =================================================================== - --- sys/amd64/conf/GENERIC.hints (revision 247917) +++ sys/amd64/conf/GENERIC.hints (working copy) @@ -12,6 +12,7 @@ hint.atkbdc.0.port="0x060" hint.atkbd.0.at="atkbdc" hint.atkbd.0.irq="1" hint.psm.0.at="atkbdc" +hint.psm.0.flags="0x6000" hint.psm.0.irq="12" hint.sc.0.at="isa" hint.sc.0.flags="0x100" Index: sys/i386/conf/GENERIC.hints =================================================================== - --- sys/i386/conf/GENERIC.hints (revision 247917) +++ sys/i386/conf/GENERIC.hints (working copy) @@ -18,6 +18,7 @@ hint.atkbdc.0.port="0x060" hint.atkbd.0.at="atkbdc" hint.atkbd.0.irq="1" hint.psm.0.at="atkbdc" +hint.psm.0.flags="0x6000" hint.psm.0.irq="12" hint.sc.0.at="isa" hint.sc.0.flags="0x100" Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBAgAGBQJROOcpAAoJECXpabHZMqHO8VAIAIqogDH/140qIZSkql7UtFPt zCBsNw2Td5XiHx8dOQ5F9X6bneahxN2PhPQ6uvVgBbIj6z9mDfRZMWXJb7IqugqX 5o0tJCCRGc2RH9/Qq/H68VFKCPj3d1SX+29yeV1Oj3ORPboZ5h4tSq5kaidv7CrD kEGUNUYQzgnXiycWx8Bd6D5A2tll8TxtK4WB0zzJ94gU3wGJfo/SBzDRaJv/m622 4gzzt8WmP5ObqWL1gYvfP+/81bF709OrDfUsmHNN0bByc/VVd3ebvrTAxLNtZNa+ T0zoABdE0FpnlBam5yNniHzGpWdwStaCKY5zi19bu4EqN9m4nfl94HLMoU47V7k= =ouzq -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 19:27:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A90E074F; Thu, 7 Mar 2013 19:27:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8DB42E3D; Thu, 7 Mar 2013 19:27:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27JRJhh077178; Thu, 7 Mar 2013 19:27:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27JRHwV077165; Thu, 7 Mar 2013 19:27:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303071927.r27JRHwV077165@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 19:27:17 +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: r247920 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 19:27:19 -0000 Author: tuexen Date: Thu Mar 7 19:27:17 2013 New Revision: 247920 URL: http://svnweb.freebsd.org/changeset/base/247920 Log: MFC r235360: Provide in the association change notification the received ABORT chunk if case of SCTP_COMM_LOST or SCTP_CANT_STR_ASSOC as required by RFC 6458. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 19:27:17 2013 (r247920) @@ -1789,8 +1789,7 @@ sctp_handle_asconf_ack(struct mbuf *m, i */ if (serial_num == (asoc->asconf_seq_out + 1)) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); - sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_CAUSE_ILLEGAL_ASCONF_ACK, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, NULL, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; return; } Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 19:27:17 2013 (r247920) @@ -607,9 +607,7 @@ protocol_error: *ippp = ((control->sinfo_stream << 16) | control->sinfo_ssn); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_1; - sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; @@ -892,8 +890,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; - sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if (asoc->fragmented_delivery_inprogress && (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) == SCTP_DATA_FIRST_FRAG) { @@ -924,8 +921,7 @@ sctp_queue_data_for_reasm(struct sctp_tc *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; - sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if (asoc->fragmented_delivery_inprogress) { /* @@ -961,8 +957,7 @@ sctp_queue_data_for_reasm(struct sctp_tc *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_4; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if ((asoc->fragment_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && @@ -995,8 +990,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_5; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } } @@ -1090,8 +1084,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_6; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1127,9 +1120,7 @@ sctp_queue_data_for_reasm(struct sctp_tc *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_7; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1166,9 +1157,7 @@ sctp_queue_data_for_reasm(struct sctp_tc *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_8; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1202,9 +1191,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_9; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1247,9 +1234,7 @@ sctp_queue_data_for_reasm(struct sctp_tc *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_10; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1289,9 +1274,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_11; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1328,9 +1311,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_12; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1367,9 +1348,7 @@ sctp_queue_data_for_reasm(struct sctp_tc *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_13; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1531,7 +1510,7 @@ sctp_process_a_data_chunk(struct sctp_tc struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_an_association(stcb->sctp_ep, stcb, 0, op_err, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -1678,8 +1657,7 @@ sctp_process_a_data_chunk(struct sctp_tc } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_14; - sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -1942,9 +1920,7 @@ failed_pdapi_express_del: *ippp = ((strmno << 16) | strmseq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; - sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } else { @@ -1980,9 +1956,7 @@ failed_pdapi_express_del: *ippp = ((strmno << 16) | strmseq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -2027,9 +2001,7 @@ failed_pdapi_express_del: *ippp = ((strmno << 16) | strmseq); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; - sctp_abort_an_association(stcb->sctp_ep, - stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); - + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -3878,7 +3850,7 @@ sctp_express_handle_sack(struct sctp_tcb *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_25); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; - sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); return; #endif } @@ -4240,7 +4212,7 @@ again: *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_24); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; - sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_RESPONSE_TO_USER_REQ, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); } else { struct sctp_nets *netp; @@ -4463,7 +4435,7 @@ sctp_handle_sack(struct mbuf *m, int off *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_25); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; - sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); return; } } @@ -4966,7 +4938,7 @@ sctp_handle_sack(struct mbuf *m, int off *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_31); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_31; - sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_RESPONSE_TO_USER_REQ, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); return; } else { struct sctp_nets *netp; @@ -5421,8 +5393,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *ippp = new_cum_tsn; } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_33; - sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_PEER_FAULTY, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); return; } SCTP_STAT_INCR(sctps_fwdtsn_map_over); Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:27:17 2013 (r247920) @@ -428,7 +428,7 @@ sctp_process_init_ack(struct mbuf *m, in &abort_flag, (struct sctp_chunkhdr *)cp, &nat_friendly); if (abort_flag) { /* Send an abort and notify peer */ - sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_CAUSE_PROTOCOL_VIOLATION, op_err, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; return (-1); } @@ -739,7 +739,7 @@ sctp_handle_nat_missing_state(struct sct static void -sctp_handle_abort(struct sctp_abort_chunk *cp, +sctp_handle_abort(struct sctp_abort_chunk *abort, struct sctp_tcb *stcb, struct sctp_nets *net) { #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -747,43 +747,42 @@ sctp_handle_abort(struct sctp_abort_chun #endif uint16_t len; + uint16_t error; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: handling ABORT\n"); if (stcb == NULL) return; - len = ntohs(cp->ch.chunk_length); + len = ntohs(abort->ch.chunk_length); if (len > sizeof(struct sctp_chunkhdr)) { /* * Need to check the cause codes for our two magic nat * aborts which don't kill the assoc necessarily. */ - struct sctp_abort_chunk *cpnext; struct sctp_missing_nat_state *natc; - uint16_t cause; - cpnext = cp; - cpnext++; - natc = (struct sctp_missing_nat_state *)cpnext; - cause = ntohs(natc->cause); - if (cause == SCTP_CAUSE_NAT_COLLIDING_STATE) { + natc = (struct sctp_missing_nat_state *)(abort + 1); + error = ntohs(natc->cause); + if (error == SCTP_CAUSE_NAT_COLLIDING_STATE) { SCTPDBG(SCTP_DEBUG_INPUT2, "Received Colliding state abort flags:%x\n", - cp->ch.chunk_flags); + abort->ch.chunk_flags); if (sctp_handle_nat_colliding_state(stcb)) { return; } - } else if (cause == SCTP_CAUSE_NAT_MISSING_STATE) { + } else if (error == SCTP_CAUSE_NAT_MISSING_STATE) { SCTPDBG(SCTP_DEBUG_INPUT2, "Received missing state abort flags:%x\n", - cp->ch.chunk_flags); + abort->ch.chunk_flags); if (sctp_handle_nat_missing_state(stcb, net)) { return; } } + } else { + error = 0; } /* stop any receive timers */ sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_6); /* notify user of the abort and clean up... */ - sctp_abort_notification(stcb, 0, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, error, abort, SCTP_SO_NOT_LOCKED); /* free the tcb */ SCTP_STAT_INCR_COUNTER32(sctps_aborted); if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || @@ -1174,7 +1173,7 @@ sctp_handle_error(struct sctp_chunkhdr * asoc->stale_cookie_count++; if (asoc->stale_cookie_count > asoc->max_init_times) { - sctp_abort_notification(stcb, 0, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); /* now free the asoc */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 19:27:17 2013 (r247920) @@ -6573,9 +6573,7 @@ sctp_sendall_iterator(struct sctp_inpcb * dis-appearing on us. */ atomic_add_int(&stcb->asoc.refcnt, 1); - sctp_abort_an_association(inp, stcb, - SCTP_RESPONSE_TO_USER_REQ, - m, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(inp, stcb, m, SCTP_SO_NOT_LOCKED); /* * sctp_abort_an_association calls sctp_free_asoc() * free association will NOT free it since we @@ -6669,7 +6667,6 @@ sctp_sendall_iterator(struct sctp_inpcb abort_anyway: atomic_add_int(&stcb->asoc.refcnt, 1); sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_RESPONSE_TO_USER_REQ, NULL, SCTP_SO_NOT_LOCKED); atomic_add_int(&stcb->asoc.refcnt, -1); goto no_chunk_output; @@ -9504,7 +9501,7 @@ sctp_chunk_retransmission(struct sctp_in chk->snd_count, SCTP_BASE_SYSCTL(sctp_max_retran_chunk)); atomic_add_int(&stcb->asoc.refcnt, 1); - sctp_abort_an_association(stcb->sctp_ep, stcb, 0, NULL, so_locked); + sctp_abort_an_association(stcb->sctp_ep, stcb, NULL, so_locked); SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); return (SCTP_RETRAN_EXIT); @@ -13138,9 +13135,7 @@ sctp_lower_sosend(struct socket *so, atomic_add_int(&stcb->asoc.refcnt, -1); free_cnt_applied = 0; /* release this lock, otherwise we hang on ourselves */ - sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_RESPONSE_TO_USER_REQ, - mm, SCTP_SO_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, mm, SCTP_SO_LOCKED); /* now relock the stcb so everything is sane */ hold_tcblock = 0; stcb = NULL; @@ -13695,7 +13690,6 @@ dataless_eof: free_cnt_applied = 0; } sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_RESPONSE_TO_USER_REQ, NULL, SCTP_SO_LOCKED); /* * now relock the stcb so everything Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 19:27:17 2013 (r247920) @@ -6344,7 +6344,7 @@ sctp_load_addresses_from_init(struct sct * abort this guy */ sctp_abort_an_association(stcb_tmp->sctp_ep, - stcb_tmp, 1, NULL, 0); + stcb_tmp, NULL, SCTP_SO_NOT_LOCKED); goto add_it_now; } SCTP_TCB_UNLOCK(stcb_tmp); @@ -6435,7 +6435,7 @@ sctp_load_addresses_from_init(struct sct * abort this guy */ sctp_abort_an_association(stcb_tmp->sctp_ep, - stcb_tmp, 1, NULL, 0); + stcb_tmp, NULL, SCTP_SO_NOT_LOCKED); goto add_it_now6; } SCTP_TCB_UNLOCK(stcb_tmp); Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctp_timer.c Thu Mar 7 19:27:17 2013 (r247920) @@ -167,7 +167,7 @@ sctp_threshold_management(struct sctp_in *ippp = htonl(SCTP_FROM_SCTP_TIMER + SCTP_LOC_1); } inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_1; - sctp_abort_an_association(inp, stcb, SCTP_FAILED_THRESHOLD, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(inp, stcb, oper, SCTP_SO_NOT_LOCKED); return (1); } return (0); @@ -1066,8 +1066,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp *ippp = htonl(SCTP_FROM_SCTP_TIMER + SCTP_LOC_3); } inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_4; - sctp_abort_an_association(inp, stcb, SCTP_INTERNAL_ERROR, - oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(inp, stcb, oper, SCTP_SO_NOT_LOCKED); } else { #ifdef INVARIANTS panic("Cookie timer expires in wrong state?"); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 19:27:17 2013 (r247920) @@ -229,11 +229,9 @@ sctp_notify(struct sctp_inpcb *inp, struct socket *so; #endif - /* protection */ - int reason; struct icmp *icmph; - + /* protection */ if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (sh == NULL) || (to == NULL)) { if (stcb) @@ -285,8 +283,7 @@ sctp_notify(struct sctp_inpcb *inp, * now is dead. In either case treat it like a OOTB abort * with no TCB */ - reason = SCTP_PEER_FAULTY; - sctp_abort_notification(stcb, reason, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -1098,7 +1095,6 @@ sctp_shutdown(struct socket *so) } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6; sctp_abort_an_association(stcb->sctp_ep, stcb, - SCTP_RESPONSE_TO_USER_REQ, op_err, SCTP_SO_LOCKED); goto skip_unlock; } else { Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 19:27:17 2013 (r247920) @@ -1725,8 +1725,7 @@ sctp_timeout_handler(void *t) break; } SCTP_STAT_INCR(sctps_timoshutdownguard); - sctp_abort_an_association(inp, stcb, - SCTP_SHUTDOWN_GUARD_EXPIRES, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(inp, stcb, NULL, SCTP_SO_NOT_LOCKED); /* no need to unlock on tcb its gone */ goto out_decr; @@ -2593,7 +2592,7 @@ sctp_pad_lastmbuf(struct mbuf *m, int pa static void sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, - uint16_t error, int so_locked + uint16_t error, struct sctp_abort_chunk *abort, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -2602,7 +2601,7 @@ sctp_notify_assoc_change(uint16_t state, struct mbuf *m_notify; struct sctp_assoc_change *sac; struct sctp_queued_to_read *control; - size_t len; + size_t notif_len, abort_len; unsigned int i; #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -2652,16 +2651,27 @@ sctp_notify_assoc_change(uint16_t state, /* event not enabled */ return; } - len = sizeof(struct sctp_assoc_change); + notif_len = sizeof(struct sctp_assoc_change); + if (abort != NULL) { + abort_len = htons(abort->ch.chunk_length); + } else { + abort_len = 0; + } if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { - len += SCTP_ASSOC_SUPPORTS_MAX; + notif_len += SCTP_ASSOC_SUPPORTS_MAX; + } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { + notif_len += abort_len; } - m_notify = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); - if (m_notify == NULL) - /* no space left */ - return; - SCTP_BUF_LEN(m_notify) = 0; - + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + /* Retry with smaller value. */ + notif_len = sizeof(struct sctp_assoc_change); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + return; + } + } + SCTP_BUF_NEXT(m_notify) = NULL; sac = mtod(m_notify, struct sctp_assoc_change *); sac->sac_type = SCTP_ASSOC_CHANGE; sac->sac_flags = 0; @@ -2672,25 +2682,29 @@ sctp_notify_assoc_change(uint16_t state, sac->sac_outbound_streams = stcb->asoc.streamoutcnt; sac->sac_inbound_streams = stcb->asoc.streamincnt; sac->sac_assoc_id = sctp_get_associd(stcb); - if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { - i = 0; - if (stcb->asoc.peer_supports_prsctp) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR; - } - if (stcb->asoc.peer_supports_auth) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH; + if (notif_len > sizeof(struct sctp_assoc_change)) { + if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { + i = 0; + if (stcb->asoc.peer_supports_prsctp) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR; + } + if (stcb->asoc.peer_supports_auth) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH; + } + if (stcb->asoc.peer_supports_asconf) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; + } + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; + if (stcb->asoc.peer_supports_strreset) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; + } + sac->sac_length += i; + } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { + memcpy(sac->sac_info, abort, abort_len); + sac->sac_length += abort_len; } - if (stcb->asoc.peer_supports_asconf) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; - } - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; - if (stcb->asoc.peer_supports_strreset) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; - } - sac->sac_length += i; } SCTP_BUF_LEN(m_notify) = sac->sac_length; - SCTP_BUF_NEXT(m_notify) = NULL; control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, 0, 0, stcb->asoc.context, 0, 0, 0, m_notify); @@ -3500,7 +3514,7 @@ sctp_ulp_notify(uint32_t notification, s switch (notification) { case SCTP_NOTIFY_ASSOC_UP: if (stcb->asoc.assoc_up_sent == 0) { - sctp_notify_assoc_change(SCTP_COMM_UP, stcb, error, so_locked); + sctp_notify_assoc_change(SCTP_COMM_UP, stcb, error, NULL, so_locked); stcb->asoc.assoc_up_sent = 1; } if (stcb->asoc.adaptation_needed && (stcb->asoc.adaptation_sent == 0)) { @@ -3512,7 +3526,7 @@ sctp_ulp_notify(uint32_t notification, s } break; case SCTP_NOTIFY_ASSOC_DOWN: - sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, so_locked); + sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, NULL, so_locked); break; case SCTP_NOTIFY_INTERFACE_DOWN: { @@ -3563,9 +3577,9 @@ sctp_ulp_notify(uint32_t notification, s case SCTP_NOTIFY_ASSOC_ABORTED: if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { - sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, so_locked); + sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, so_locked); } else { - sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, so_locked); + sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, so_locked); } break; case SCTP_NOTIFY_PEER_OPENED_STREAM: @@ -3573,7 +3587,7 @@ sctp_ulp_notify(uint32_t notification, s case SCTP_NOTIFY_STREAM_OPENED_OK: break; case SCTP_NOTIFY_ASSOC_RESTART: - sctp_notify_assoc_change(SCTP_RESTART, stcb, error, so_locked); + sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, so_locked); if (stcb->asoc.peer_supports_auth == 0) { sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); @@ -3742,7 +3756,8 @@ sctp_report_all_outbound(struct sctp_tcb } void -sctp_abort_notification(struct sctp_tcb *stcb, int error, int so_locked +sctp_abort_notification(struct sctp_tcb *stcb, uint16_t error, + struct sctp_abort_chunk *abort, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -3763,7 +3778,7 @@ sctp_abort_notification(struct sctp_tcb } /* Tell them we lost the asoc */ sctp_report_all_outbound(stcb, 1, so_locked); - sctp_ulp_notify(SCTP_NOTIFY_ASSOC_ABORTED, stcb, error, NULL, so_locked); + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_ABORTED, stcb, error, abort, so_locked); } void @@ -3782,7 +3797,7 @@ sctp_abort_association(struct sctp_inpcb if (stcb != NULL) { /* We have a TCB to abort, send notification too */ vtag = stcb->asoc.peer_vtag; - sctp_abort_notification(stcb, 0, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); /* get the assoc vrf id and table id */ vrf_id = stcb->asoc.vrf_id; stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; @@ -3876,7 +3891,7 @@ none_in: void sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - int error, struct mbuf *op_err, + struct mbuf *op_err, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED @@ -3904,8 +3919,9 @@ sctp_abort_an_association(struct sctp_in stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } /* notify the ulp */ - if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) - sctp_abort_notification(stcb, error, so_locked); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { + sctp_abort_notification(stcb, 0, NULL, so_locked); + } /* notify the peer */ sctp_send_abort_tcb(stcb, op_err, so_locked); SCTP_STAT_INCR_COUNTER32(sctps_aborted); Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet/sctputil.h Thu Mar 7 19:27:17 2013 (r247920) @@ -179,7 +179,8 @@ sctp_report_all_outbound(struct sctp_tcb int sctp_expand_mapping_array(struct sctp_association *, uint32_t); void -sctp_abort_notification(struct sctp_tcb *, int, int +sctp_abort_notification(struct sctp_tcb *, uint16_t, + struct sctp_abort_chunk *, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -193,7 +194,7 @@ sctp_abort_association(struct sctp_inpcb /* We choose to abort via user input */ void -sctp_abort_an_association(struct sctp_inpcb *, struct sctp_tcb *, int, +sctp_abort_an_association(struct sctp_inpcb *, struct sctp_tcb *, struct mbuf *, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 19:00:00 2013 (r247919) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 19:27:17 2013 (r247920) @@ -388,10 +388,8 @@ sctp6_notify(struct sctp_inpcb *inp, struct socket *so; #endif - /* protection */ - int reason; - + /* protection */ if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (sh == NULL) || (to == NULL)) { if (stcb) @@ -441,8 +439,7 @@ sctp6_notify(struct sctp_inpcb *inp, * now is dead. In either case treat it like a OOTB abort * with no TCB */ - reason = SCTP_PEER_FAULTY; - sctp_abort_notification(stcb, reason, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 19:30:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 991D09A8; Thu, 7 Mar 2013 19:30:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 71DA8E6C; Thu, 7 Mar 2013 19:30:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27JUZK9077681; Thu, 7 Mar 2013 19:30:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27JUZUk077680; Thu, 7 Mar 2013 19:30:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303071930.r27JUZUk077680@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 19:30:35 +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: r247921 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 19:30:35 -0000 Author: tuexen Date: Thu Mar 7 19:30:34 2013 New Revision: 247921 URL: http://svnweb.freebsd.org/changeset/base/247921 Log: MFC r235402: Ensure the user can read COMM_LOST notifications on 1-to-1 style sockets. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 19:27:17 2013 (r247920) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 19:30:34 2013 (r247921) @@ -2609,10 +2609,82 @@ sctp_notify_assoc_change(uint16_t state, #endif + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { + notif_len = sizeof(struct sctp_assoc_change); + if (abort != NULL) { + abort_len = htons(abort->ch.chunk_length); + } else { + abort_len = 0; + } + if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { + notif_len += SCTP_ASSOC_SUPPORTS_MAX; + } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { + notif_len += abort_len; + } + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + /* Retry with smaller value. */ + notif_len = sizeof(struct sctp_assoc_change); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + goto set_error; + } + } + SCTP_BUF_NEXT(m_notify) = NULL; + sac = mtod(m_notify, struct sctp_assoc_change *); + sac->sac_type = SCTP_ASSOC_CHANGE; + sac->sac_flags = 0; + sac->sac_length = sizeof(struct sctp_assoc_change); + sac->sac_state = state; + sac->sac_error = error; + /* XXX verify these stream counts */ + sac->sac_outbound_streams = stcb->asoc.streamoutcnt; + sac->sac_inbound_streams = stcb->asoc.streamincnt; + sac->sac_assoc_id = sctp_get_associd(stcb); + if (notif_len > sizeof(struct sctp_assoc_change)) { + if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { + i = 0; + if (stcb->asoc.peer_supports_prsctp) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR; + } + if (stcb->asoc.peer_supports_auth) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH; + } + if (stcb->asoc.peer_supports_asconf) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; + } + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; + if (stcb->asoc.peer_supports_strreset) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; + } + sac->sac_length += i; + } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { + memcpy(sac->sac_info, abort, abort_len); + sac->sac_length += abort_len; + } + } + SCTP_BUF_LEN(m_notify) = sac->sac_length; + control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, + 0, 0, stcb->asoc.context, 0, 0, 0, + m_notify); + if (control != NULL) { + control->length = SCTP_BUF_LEN(m_notify); + /* not that we need this */ + control->tail_mbuf = m_notify; + control->spec_flags = M_NOTIFICATION; + sctp_add_to_readq(stcb->sctp_ep, stcb, + control, + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, + so_locked); + } else { + sctp_m_freem(m_notify); + } + } /* - * For TCP model AND UDP connected sockets we will send an error up - * when an ABORT comes in. + * For 1-to-1 style sockets, we send up and error when an ABORT + * comes in. */ +set_error: if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { @@ -2623,127 +2695,34 @@ sctp_notify_assoc_change(uint16_t state, SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); stcb->sctp_socket->so_error = ECONNRESET; } - /* Wake ANY sleepers */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - if (!so_locked) { - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } - } -#endif - socantrcvmore(stcb->sctp_socket); - sorwakeup(stcb->sctp_socket); - sowwakeup(stcb->sctp_socket); + } + /* Wake ANY sleepers */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if (!so_locked) { + so = SCTP_INP_SO(stcb->sctp_ep); + if (!so_locked) { + atomic_add_int(&stcb->asoc.refcnt, 1); + SCTP_TCB_UNLOCK(stcb); + SCTP_SOCKET_LOCK(so, 1); + SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); + if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { SCTP_SOCKET_UNLOCK(so, 1); - } -#endif - } - if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { - /* event not enabled */ - return; - } - notif_len = sizeof(struct sctp_assoc_change); - if (abort != NULL) { - abort_len = htons(abort->ch.chunk_length); - } else { - abort_len = 0; - } - if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { - notif_len += SCTP_ASSOC_SUPPORTS_MAX; - } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { - notif_len += abort_len; - } - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); - if (m_notify == NULL) { - /* Retry with smaller value. */ - notif_len = sizeof(struct sctp_assoc_change); - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); - if (m_notify == NULL) { return; } } - SCTP_BUF_NEXT(m_notify) = NULL; - sac = mtod(m_notify, struct sctp_assoc_change *); - sac->sac_type = SCTP_ASSOC_CHANGE; - sac->sac_flags = 0; - sac->sac_length = sizeof(struct sctp_assoc_change); - sac->sac_state = state; - sac->sac_error = error; - /* XXX verify these stream counts */ - sac->sac_outbound_streams = stcb->asoc.streamoutcnt; - sac->sac_inbound_streams = stcb->asoc.streamincnt; - sac->sac_assoc_id = sctp_get_associd(stcb); - if (notif_len > sizeof(struct sctp_assoc_change)) { - if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { - i = 0; - if (stcb->asoc.peer_supports_prsctp) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR; - } - if (stcb->asoc.peer_supports_auth) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH; - } - if (stcb->asoc.peer_supports_asconf) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; - } - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; - if (stcb->asoc.peer_supports_strreset) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; - } - sac->sac_length += i; - } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { - memcpy(sac->sac_info, abort, abort_len); - sac->sac_length += abort_len; - } - } - SCTP_BUF_LEN(m_notify) = sac->sac_length; - control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, - 0, 0, stcb->asoc.context, 0, 0, 0, - m_notify); - if (control == NULL) { - /* no memory */ - sctp_m_freem(m_notify); - return; - } - control->length = SCTP_BUF_LEN(m_notify); - /* not that we need this */ - control->tail_mbuf = m_notify; - control->spec_flags = M_NOTIFICATION; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, - so_locked); - if (state == SCTP_COMM_LOST) { - /* Wake up any sleeper */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - if (!so_locked) { - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } - } #endif - sctp_sowwakeup(stcb->sctp_ep, stcb->sctp_socket); + if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && + ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { + socantrcvmore(stcb->sctp_socket); + } + sorwakeup(stcb->sctp_socket); + sowwakeup(stcb->sctp_socket); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if (!so_locked) { - SCTP_SOCKET_UNLOCK(so, 1); - } -#endif + if (!so_locked) { + SCTP_SOCKET_UNLOCK(so, 1); } +#endif } static void @@ -5220,7 +5199,7 @@ restart_nosblocks: (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { goto out; } - if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_cc == 0)) { if (so->so_error) { error = so->so_error; if ((in_flags & MSG_PEEK) == 0) @@ -5228,7 +5207,6 @@ restart_nosblocks: goto out; } else { if (so->so_rcv.sb_cc == 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); /* indicate EOF */ error = 0; goto out; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 19:32:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 59337C3A; Thu, 7 Mar 2013 19:32:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3CA5BE8D; Thu, 7 Mar 2013 19:32:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27JWuNY079591; Thu, 7 Mar 2013 19:32:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27JWtN9079579; Thu, 7 Mar 2013 19:32:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303071932.r27JWtN9079579@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 19:32:55 +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: r247922 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 19:32:56 -0000 Author: tuexen Date: Thu Mar 7 19:32:54 2013 New Revision: 247922 URL: http://svnweb.freebsd.org/changeset/base/247922 Log: MFC r235403: Use ECONNABORTED in cases where the ABORT was sent to the peer. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Thu Mar 7 19:30:34 2013 (r247921) +++ stable/8/sys/netinet/sctp_constants.h Thu Mar 7 19:32:54 2013 (r247922) @@ -757,7 +757,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_INTERFACE_UP 4 #define SCTP_NOTIFY_DG_FAIL 5 #define SCTP_NOTIFY_STRDATA_ERR 6 -#define SCTP_NOTIFY_ASSOC_ABORTED 7 +#define SCTP_NOTIFY_ASSOC_LOC_ABORTED 7 #define SCTP_NOTIFY_PEER_OPENED_STREAM 8 #define SCTP_NOTIFY_STREAM_OPENED_OK 9 #define SCTP_NOTIFY_ASSOC_RESTART 10 @@ -781,7 +781,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_SENDER_DRY 29 #define SCTP_NOTIFY_STR_RESET_DENIED_OUT 30 #define SCTP_NOTIFY_STR_RESET_DENIED_IN 31 -#define SCTP_NOTIFY_MAX 31 +#define SCTP_NOTIFY_ASSOC_REM_ABORTED 32 +#define SCTP_NOTIFY_MAX 32 /* This is the value for messages that are NOT completely Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:30:34 2013 (r247921) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:32:54 2013 (r247922) @@ -782,7 +782,7 @@ sctp_handle_abort(struct sctp_abort_chun /* stop any receive timers */ sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_6); /* notify user of the abort and clean up... */ - sctp_abort_notification(stcb, error, abort, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 1, error, abort, SCTP_SO_NOT_LOCKED); /* free the tcb */ SCTP_STAT_INCR_COUNTER32(sctps_aborted); if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || @@ -1173,7 +1173,7 @@ sctp_handle_error(struct sctp_chunkhdr * asoc->stale_cookie_count++; if (asoc->stale_cookie_count > asoc->max_init_times) { - sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* now free the asoc */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 19:30:34 2013 (r247921) +++ stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 19:32:54 2013 (r247922) @@ -283,7 +283,7 @@ sctp_notify(struct sctp_inpcb *inp, * now is dead. In either case treat it like a OOTB abort * with no TCB */ - sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 19:30:34 2013 (r247921) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 19:32:54 2013 (r247922) @@ -2592,7 +2592,7 @@ sctp_pad_lastmbuf(struct mbuf *m, int pa static void sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, - uint16_t error, struct sctp_abort_chunk *abort, int so_locked + uint16_t error, struct sctp_abort_chunk *abort, uint8_t from_peer, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -2688,12 +2688,17 @@ set_error: if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNREFUSED); - stcb->sctp_socket->so_error = ECONNREFUSED; + if (from_peer) { + if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNREFUSED); + stcb->sctp_socket->so_error = ECONNREFUSED; + } else { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); + stcb->sctp_socket->so_error = ECONNRESET; + } } else { - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); - stcb->sctp_socket->so_error = ECONNRESET; + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNABORTED); + stcb->sctp_socket->so_error = ECONNABORTED; } } /* Wake ANY sleepers */ @@ -3493,7 +3498,7 @@ sctp_ulp_notify(uint32_t notification, s switch (notification) { case SCTP_NOTIFY_ASSOC_UP: if (stcb->asoc.assoc_up_sent == 0) { - sctp_notify_assoc_change(SCTP_COMM_UP, stcb, error, NULL, so_locked); + sctp_notify_assoc_change(SCTP_COMM_UP, stcb, error, NULL, 0, so_locked); stcb->asoc.assoc_up_sent = 1; } if (stcb->asoc.adaptation_needed && (stcb->asoc.adaptation_sent == 0)) { @@ -3505,7 +3510,7 @@ sctp_ulp_notify(uint32_t notification, s } break; case SCTP_NOTIFY_ASSOC_DOWN: - sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, NULL, so_locked); + sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, NULL, 0, so_locked); break; case SCTP_NOTIFY_INTERFACE_DOWN: { @@ -3553,12 +3558,20 @@ sctp_ulp_notify(uint32_t notification, s } case SCTP_NOTIFY_STRDATA_ERR: break; - case SCTP_NOTIFY_ASSOC_ABORTED: + case SCTP_NOTIFY_ASSOC_LOC_ABORTED: if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { - sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, so_locked); + sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 0, so_locked); } else { - sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, so_locked); + sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 0, so_locked); + } + break; + case SCTP_NOTIFY_ASSOC_REM_ABORTED: + if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 1, so_locked); + } else { + sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); } break; case SCTP_NOTIFY_PEER_OPENED_STREAM: @@ -3566,7 +3579,7 @@ sctp_ulp_notify(uint32_t notification, s case SCTP_NOTIFY_STREAM_OPENED_OK: break; case SCTP_NOTIFY_ASSOC_RESTART: - sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, so_locked); + sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, 0, so_locked); if (stcb->asoc.peer_supports_auth == 0) { sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); @@ -3735,7 +3748,7 @@ sctp_report_all_outbound(struct sctp_tcb } void -sctp_abort_notification(struct sctp_tcb *stcb, uint16_t error, +sctp_abort_notification(struct sctp_tcb *stcb, uint8_t from_peer, uint16_t error, struct sctp_abort_chunk *abort, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED @@ -3757,7 +3770,11 @@ sctp_abort_notification(struct sctp_tcb } /* Tell them we lost the asoc */ sctp_report_all_outbound(stcb, 1, so_locked); - sctp_ulp_notify(SCTP_NOTIFY_ASSOC_ABORTED, stcb, error, abort, so_locked); + if (from_peer) { + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_REM_ABORTED, stcb, error, abort, so_locked); + } else { + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_LOC_ABORTED, stcb, error, abort, so_locked); + } } void @@ -3776,7 +3793,7 @@ sctp_abort_association(struct sctp_inpcb if (stcb != NULL) { /* We have a TCB to abort, send notification too */ vtag = stcb->asoc.peer_vtag; - sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* get the assoc vrf id and table id */ vrf_id = stcb->asoc.vrf_id; stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; @@ -3899,7 +3916,7 @@ sctp_abort_an_association(struct sctp_in } /* notify the ulp */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { - sctp_abort_notification(stcb, 0, NULL, so_locked); + sctp_abort_notification(stcb, 0, 0, NULL, so_locked); } /* notify the peer */ sctp_send_abort_tcb(stcb, op_err, so_locked); Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Thu Mar 7 19:30:34 2013 (r247921) +++ stable/8/sys/netinet/sctputil.h Thu Mar 7 19:32:54 2013 (r247922) @@ -179,7 +179,7 @@ sctp_report_all_outbound(struct sctp_tcb int sctp_expand_mapping_array(struct sctp_association *, uint32_t); void -sctp_abort_notification(struct sctp_tcb *, uint16_t, +sctp_abort_notification(struct sctp_tcb *, uint8_t, uint16_t, struct sctp_abort_chunk *, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 19:30:34 2013 (r247921) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 19:32:54 2013 (r247922) @@ -439,7 +439,7 @@ sctp6_notify(struct sctp_inpcb *inp, * now is dead. In either case treat it like a OOTB abort * with no TCB */ - sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 19:34:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A9B4DC2; Thu, 7 Mar 2013 19:34:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1AEEA1; Thu, 7 Mar 2013 19:34:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27JYv9k079933; Thu, 7 Mar 2013 19:34:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27JYvXN079931; Thu, 7 Mar 2013 19:34:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303071934.r27JYvXN079931@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 19:34:57 +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: r247923 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 19:34:57 -0000 Author: tuexen Date: Thu Mar 7 19:34:56 2013 New Revision: 247923 URL: http://svnweb.freebsd.org/changeset/base/247923 Log: MFC r235412: Remove unused constants. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Thu Mar 7 19:32:54 2013 (r247922) +++ stable/8/sys/netinet/sctp_constants.h Thu Mar 7 19:34:56 2013 (r247923) @@ -756,34 +756,26 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_INTERFACE_DOWN 3 #define SCTP_NOTIFY_INTERFACE_UP 4 #define SCTP_NOTIFY_DG_FAIL 5 -#define SCTP_NOTIFY_STRDATA_ERR 6 +#define SCTP_NOTIFY_SPECIAL_SP_FAIL 6 #define SCTP_NOTIFY_ASSOC_LOC_ABORTED 7 -#define SCTP_NOTIFY_PEER_OPENED_STREAM 8 -#define SCTP_NOTIFY_STREAM_OPENED_OK 9 -#define SCTP_NOTIFY_ASSOC_RESTART 10 -#define SCTP_NOTIFY_HB_RESP 11 -#define SCTP_NOTIFY_ASCONF_SUCCESS 12 -#define SCTP_NOTIFY_ASCONF_FAILED 13 -#define SCTP_NOTIFY_PEER_SHUTDOWN 14 -#define SCTP_NOTIFY_ASCONF_ADD_IP 15 -#define SCTP_NOTIFY_ASCONF_DELETE_IP 16 -#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 17 -#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 18 -#define SCTP_NOTIFY_INTERFACE_CONFIRMED 20 -#define SCTP_NOTIFY_STR_RESET_RECV 21 -#define SCTP_NOTIFY_STR_RESET_SEND 22 -#define SCTP_NOTIFY_STR_RESET_FAILED_OUT 23 -#define SCTP_NOTIFY_STR_RESET_FAILED_IN 24 -#define SCTP_NOTIFY_AUTH_NEW_KEY 25 -#define SCTP_NOTIFY_AUTH_FREE_KEY 26 -#define SCTP_NOTIFY_SPECIAL_SP_FAIL 27 -#define SCTP_NOTIFY_NO_PEER_AUTH 28 -#define SCTP_NOTIFY_SENDER_DRY 29 -#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 30 -#define SCTP_NOTIFY_STR_RESET_DENIED_IN 31 -#define SCTP_NOTIFY_ASSOC_REM_ABORTED 32 -#define SCTP_NOTIFY_MAX 32 - +#define SCTP_NOTIFY_ASSOC_REM_ABORTED 8 +#define SCTP_NOTIFY_ASSOC_RESTART 9 +#define SCTP_NOTIFY_PEER_SHUTDOWN 10 +#define SCTP_NOTIFY_ASCONF_ADD_IP 11 +#define SCTP_NOTIFY_ASCONF_DELETE_IP 12 +#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 13 +#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 14 +#define SCTP_NOTIFY_INTERFACE_CONFIRMED 15 +#define SCTP_NOTIFY_STR_RESET_RECV 16 +#define SCTP_NOTIFY_STR_RESET_SEND 17 +#define SCTP_NOTIFY_STR_RESET_FAILED_OUT 18 +#define SCTP_NOTIFY_STR_RESET_FAILED_IN 19 +#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 20 +#define SCTP_NOTIFY_STR_RESET_DENIED_IN 21 +#define SCTP_NOTIFY_AUTH_NEW_KEY 22 +#define SCTP_NOTIFY_AUTH_FREE_KEY 23 +#define SCTP_NOTIFY_NO_PEER_AUTH 24 +#define SCTP_NOTIFY_SENDER_DRY 25 /* This is the value for messages that are NOT completely * copied down where we will start to split the message. Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 19:32:54 2013 (r247922) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 19:34:56 2013 (r247923) @@ -3556,8 +3556,6 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_partial_delivery_indication(stcb, error, val, so_locked); break; } - case SCTP_NOTIFY_STRDATA_ERR: - break; case SCTP_NOTIFY_ASSOC_LOC_ABORTED: if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { @@ -3574,10 +3572,6 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); } break; - case SCTP_NOTIFY_PEER_OPENED_STREAM: - break; - case SCTP_NOTIFY_STREAM_OPENED_OK: - break; case SCTP_NOTIFY_ASSOC_RESTART: sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, 0, so_locked); if (stcb->asoc.peer_supports_auth == 0) { @@ -3585,8 +3579,6 @@ sctp_ulp_notify(uint32_t notification, s NULL, so_locked); } break; - case SCTP_NOTIFY_HB_RESP: - break; case SCTP_NOTIFY_STR_RESET_SEND: sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), SCTP_STREAM_RESET_OUTGOING_SSN); break; @@ -3621,10 +3613,6 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_peer_addr_change(stcb, SCTP_ADDR_MADE_PRIM, data, error); break; - case SCTP_NOTIFY_ASCONF_SUCCESS: - break; - case SCTP_NOTIFY_ASCONF_FAILED: - break; case SCTP_NOTIFY_PEER_SHUTDOWN: sctp_notify_shutdown_event(stcb); break; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 19:38:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9C7DCE5; Thu, 7 Mar 2013 19:38:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F97BEC8; Thu, 7 Mar 2013 19:38:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Jc60q080422; Thu, 7 Mar 2013 19:38:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Jc5l9080416; Thu, 7 Mar 2013 19:38:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303071938.r27Jc5l9080416@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 19:38:05 +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: r247924 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 19:38:06 -0000 Author: tuexen Date: Thu Mar 7 19:38:04 2013 New Revision: 247924 URL: http://svnweb.freebsd.org/changeset/base/247924 Log: MFC r235414,r235415: Provide the error code in SCTP_PEER_ADDR_CHANGE notifications as specified in RFC 6458. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 19:34:56 2013 (r247923) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 19:38:04 2013 (r247924) @@ -4024,7 +4024,7 @@ sctp_express_handle_sack(struct sctp_tcb /* addr came good */ net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + 0, (void *)net, SCTP_SO_NOT_LOCKED); } if (net == stcb->asoc.primary_destination) { if (stcb->asoc.alternate) { @@ -4831,7 +4831,7 @@ sctp_handle_sack(struct mbuf *m, int off /* addr came good */ net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + 0, (void *)net, SCTP_SO_NOT_LOCKED); } if (net == stcb->asoc.primary_destination) { if (stcb->asoc.alternate) { Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:34:56 2013 (r247923) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:38:04 2013 (r247924) @@ -632,7 +632,7 @@ sctp_handle_heartbeat_ack(struct sctp_he if (!(r_net->dest_state & SCTP_ADDR_REACHABLE)) { r_net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_HEARTBEAT_SUCCESS, (void *)r_net, SCTP_SO_NOT_LOCKED); + 0, (void *)r_net, SCTP_SO_NOT_LOCKED); } if (r_net->dest_state & SCTP_ADDR_PF) { r_net->dest_state &= ~SCTP_ADDR_PF; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 19:34:56 2013 (r247923) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 19:38:04 2013 (r247924) @@ -3815,8 +3815,7 @@ sctp_handle_no_route(struct sctp_tcb *st if ((net->dest_state & SCTP_ADDR_REACHABLE) && stcb) { SCTPDBG(SCTP_DEBUG_OUTPUT1, "no route takes interface %p down\n", net); sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, - stcb, - SCTP_FAILED_THRESHOLD, + stcb, 0, (void *)net, so_locked); net->dest_state &= ~SCTP_ADDR_REACHABLE; Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Thu Mar 7 19:34:56 2013 (r247923) +++ stable/8/sys/netinet/sctp_timer.c Thu Mar 7 19:38:04 2013 (r247924) @@ -101,8 +101,7 @@ sctp_threshold_management(struct sctp_in net->dest_state &= ~SCTP_ADDR_REQ_PRIMARY; net->dest_state &= ~SCTP_ADDR_PF; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, - stcb, - SCTP_FAILED_THRESHOLD, + stcb, 0, (void *)net, SCTP_SO_NOT_LOCKED); } } else if ((net->pf_threshold < net->failure_threshold) && Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 19:34:56 2013 (r247923) +++ stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 19:38:04 2013 (r247924) @@ -270,7 +270,7 @@ sctp_notify(struct sctp_inpcb *inp, net->dest_state &= ~SCTP_ADDR_REACHABLE; net->dest_state &= ~SCTP_ADDR_PF; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, - stcb, SCTP_FAILED_THRESHOLD, + stcb, 0, (void *)net, SCTP_SO_NOT_LOCKED); } SCTP_TCB_UNLOCK(stcb); @@ -4794,12 +4794,12 @@ sctp_setopt(struct socket *so, int optna if (net->dest_state & SCTP_ADDR_REACHABLE) { if (net->error_count > paddrp->spp_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { if (net->error_count <= paddrp->spp_pathmaxrxt) { net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } net->failure_threshold = paddrp->spp_pathmaxrxt; @@ -4837,12 +4837,12 @@ sctp_setopt(struct socket *so, int optna if (net->dest_state & SCTP_ADDR_REACHABLE) { if (net->error_count > paddrp->spp_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { if (net->error_count <= paddrp->spp_pathmaxrxt) { net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } net->failure_threshold = paddrp->spp_pathmaxrxt; @@ -5648,12 +5648,12 @@ sctp_setopt(struct socket *so, int optna if (net->dest_state & SCTP_ADDR_REACHABLE) { if (net->failure_threshold > thlds->spt_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { if (net->failure_threshold <= thlds->spt_pathmaxrxt) { net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } net->failure_threshold = thlds->spt_pathmaxrxt; @@ -5677,12 +5677,12 @@ sctp_setopt(struct socket *so, int optna if (net->dest_state & SCTP_ADDR_REACHABLE) { if (net->failure_threshold > thlds->spt_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { if (net->failure_threshold <= thlds->spt_pathmaxrxt) { net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } net->failure_threshold = thlds->spt_pathmaxrxt; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 19:34:56 2013 (r247923) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 19:38:04 2013 (r247924) @@ -426,8 +426,7 @@ sctp6_notify(struct sctp_inpcb *inp, net->dest_state &= ~SCTP_ADDR_REACHABLE; net->dest_state &= ~SCTP_ADDR_PF; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, - stcb, SCTP_FAILED_THRESHOLD, - (void *)net, SCTP_SO_NOT_LOCKED); + stcb, 0, (void *)net, SCTP_SO_NOT_LOCKED); } SCTP_TCB_UNLOCK(stcb); } else if ((icmph->icmp6_code == ICMP_UNREACH_PROTOCOL) || From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 19:40:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46D14272; Thu, 7 Mar 2013 19:40:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2AE94EE0; Thu, 7 Mar 2013 19:40:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27JeGHr082190; Thu, 7 Mar 2013 19:40:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27JeECj082179; Thu, 7 Mar 2013 19:40:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303071940.r27JeECj082179@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 19:40:14 +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: r247925 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 19:40:16 -0000 Author: tuexen Date: Thu Mar 7 19:40:14 2013 New Revision: 247925 URL: http://svnweb.freebsd.org/changeset/base/247925 Log: MFC r235416: Provide in the SCTP_SEND_FAILED and SCTP_SEND_FAILED_EVENT notifications the correct ssf_error or ssfe_error as required by RFC 6458. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Thu Mar 7 19:38:04 2013 (r247924) +++ stable/8/sys/netinet/sctp_constants.h Thu Mar 7 19:40:14 2013 (r247925) @@ -460,18 +460,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_HAS_NAT_SUPPORT 0xc007 #define SCTP_NAT_VTAGS 0xc008 -/* Notification error codes */ -#define SCTP_NOTIFY_DATAGRAM_UNSENT 0x0001 -#define SCTP_NOTIFY_DATAGRAM_SENT 0x0002 -#define SCTP_FAILED_THRESHOLD 0x0004 -#define SCTP_HEARTBEAT_SUCCESS 0x0008 -#define SCTP_RESPONSE_TO_USER_REQ 0x0010 -#define SCTP_INTERNAL_ERROR 0x0020 -#define SCTP_SHUTDOWN_GUARD_EXPIRES 0x0040 -#define SCTP_RECEIVED_SACK 0x0080 -#define SCTP_PEER_FAULTY 0x0100 -#define SCTP_ICMP_REFUSED 0x0200 - /* bits for TOS field */ #define SCTP_ECT0_BIT 0x02 #define SCTP_ECT1_BIT 0x01 @@ -755,27 +743,28 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_ASSOC_DOWN 2 #define SCTP_NOTIFY_INTERFACE_DOWN 3 #define SCTP_NOTIFY_INTERFACE_UP 4 -#define SCTP_NOTIFY_DG_FAIL 5 -#define SCTP_NOTIFY_SPECIAL_SP_FAIL 6 -#define SCTP_NOTIFY_ASSOC_LOC_ABORTED 7 -#define SCTP_NOTIFY_ASSOC_REM_ABORTED 8 -#define SCTP_NOTIFY_ASSOC_RESTART 9 -#define SCTP_NOTIFY_PEER_SHUTDOWN 10 -#define SCTP_NOTIFY_ASCONF_ADD_IP 11 -#define SCTP_NOTIFY_ASCONF_DELETE_IP 12 -#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 13 -#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 14 -#define SCTP_NOTIFY_INTERFACE_CONFIRMED 15 -#define SCTP_NOTIFY_STR_RESET_RECV 16 -#define SCTP_NOTIFY_STR_RESET_SEND 17 -#define SCTP_NOTIFY_STR_RESET_FAILED_OUT 18 -#define SCTP_NOTIFY_STR_RESET_FAILED_IN 19 -#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 20 -#define SCTP_NOTIFY_STR_RESET_DENIED_IN 21 -#define SCTP_NOTIFY_AUTH_NEW_KEY 22 -#define SCTP_NOTIFY_AUTH_FREE_KEY 23 -#define SCTP_NOTIFY_NO_PEER_AUTH 24 -#define SCTP_NOTIFY_SENDER_DRY 25 +#define SCTP_NOTIFY_SENT_DG_FAIL 5 +#define SCTP_NOTIFY_UNSENT_DG_FAIL 6 +#define SCTP_NOTIFY_SPECIAL_SP_FAIL 7 +#define SCTP_NOTIFY_ASSOC_LOC_ABORTED 8 +#define SCTP_NOTIFY_ASSOC_REM_ABORTED 9 +#define SCTP_NOTIFY_ASSOC_RESTART 10 +#define SCTP_NOTIFY_PEER_SHUTDOWN 11 +#define SCTP_NOTIFY_ASCONF_ADD_IP 12 +#define SCTP_NOTIFY_ASCONF_DELETE_IP 13 +#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 14 +#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 15 +#define SCTP_NOTIFY_INTERFACE_CONFIRMED 16 +#define SCTP_NOTIFY_STR_RESET_RECV 17 +#define SCTP_NOTIFY_STR_RESET_SEND 18 +#define SCTP_NOTIFY_STR_RESET_FAILED_OUT 19 +#define SCTP_NOTIFY_STR_RESET_FAILED_IN 20 +#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 21 +#define SCTP_NOTIFY_STR_RESET_DENIED_IN 22 +#define SCTP_NOTIFY_AUTH_NEW_KEY 23 +#define SCTP_NOTIFY_AUTH_FREE_KEY 24 +#define SCTP_NOTIFY_NO_PEER_AUTH 25 +#define SCTP_NOTIFY_SENDER_DRY 26 /* This is the value for messages that are NOT completely * copied down where we will start to split the message. Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 19:38:04 2013 (r247924) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 19:40:14 2013 (r247925) @@ -3194,8 +3194,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (timevalcmp(&now, &tp1->rec.data.timetodrop, >)) { /* Yes so drop it */ if (tp1->data != NULL) { - (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + (void)sctp_release_pr_sctp_chunk(stcb, tp1, 1, SCTP_SO_NOT_LOCKED); } continue; @@ -3452,8 +3451,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { /* Yes, so drop it */ if (tp1->data != NULL) { - (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + (void)sctp_release_pr_sctp_chunk(stcb, tp1, 1, SCTP_SO_NOT_LOCKED); } /* Make sure to flag we had a FR */ @@ -3632,8 +3630,7 @@ sctp_try_advance_peer_ack_point(struct s /* Yes so drop it */ if (tp1->data) { (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), - SCTP_SO_NOT_LOCKED); + 1, SCTP_SO_NOT_LOCKED); } } else { /* Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:38:04 2013 (r247924) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:40:14 2013 (r247925) @@ -300,8 +300,8 @@ sctp_process_init(struct sctp_init_chunk asoc->send_queue_cnt--; if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, + 0, chk, SCTP_SO_NOT_LOCKED); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; @@ -318,8 +318,7 @@ sctp_process_init(struct sctp_init_chunk TAILQ_REMOVE(&outs->outqueue, sp, next); asoc->stream_queue_cnt--; sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, - stcb, SCTP_NOTIFY_DATAGRAM_UNSENT, - sp, SCTP_SO_NOT_LOCKED); + stcb, 0, sp, SCTP_SO_NOT_LOCKED); if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; @@ -1006,7 +1005,7 @@ sctp_handle_shutdown_ack(struct sctp_shu if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); } /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9); @@ -1889,7 +1888,7 @@ sctp_process_cookie_existing(struct mbuf /* send up all the data */ SCTP_TCB_SEND_LOCK(stcb); - sctp_report_all_outbound(stcb, 1, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].next_sequence_sent = 0; @@ -3176,7 +3175,7 @@ sctp_handle_shutdown_complete(struct sct if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); } } /* stop the timer */ Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 19:38:04 2013 (r247924) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 19:40:14 2013 (r247925) @@ -6091,14 +6091,14 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, * if the mbuf is here */ int ret_spc; - int cause; + uint8_t sent; if (chk->sent > SCTP_DATAGRAM_UNSENT) - cause = SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT; + sent = 1; else - cause = SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_UNSENT; + sent = 0; ret_spc = sctp_release_pr_sctp_chunk(stcb, chk, - cause, + sent, SCTP_SO_LOCKED); freed_spc += ret_spc; if (freed_spc >= dataout) { @@ -6121,8 +6121,7 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, int ret_spc; ret_spc = sctp_release_pr_sctp_chunk(stcb, chk, - SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_UNSENT, - SCTP_SO_LOCKED); + 0, SCTP_SO_LOCKED); freed_spc += ret_spc; if (freed_spc >= dataout) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 19:38:04 2013 (r247924) +++ stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 19:40:14 2013 (r247925) @@ -4987,8 +4987,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (so) { /* Still an open socket - report */ sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, - (void *)sp, SCTP_SO_LOCKED); + 0, (void *)sp, SCTP_SO_LOCKED); } if (sp->data) { sctp_m_freem(sp->data); @@ -5048,8 +5047,8 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (chk->data) { if (so) { /* Still a socket? */ - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, + 0, chk, SCTP_SO_LOCKED); } if (chk->data) { sctp_m_freem(chk->data); @@ -5072,8 +5071,8 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (chk->data) { if (so) { /* Still a socket? */ - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_SENT, chk, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, + 0, chk, SCTP_SO_LOCKED); } if (chk->data) { sctp_m_freem(chk->data); Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Thu Mar 7 19:38:04 2013 (r247924) +++ stable/8/sys/netinet/sctp_timer.c Thu Mar 7 19:40:14 2013 (r247925) @@ -614,7 +614,7 @@ start_again: if (chk->data) { (void)sctp_release_pr_sctp_chunk(stcb, chk, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + 1, SCTP_SO_NOT_LOCKED); cnt_abandoned++; } @@ -627,7 +627,7 @@ start_again: if (chk->data) { (void)sctp_release_pr_sctp_chunk(stcb, chk, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + 1, SCTP_SO_NOT_LOCKED); cnt_abandoned++; } Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 19:38:04 2013 (r247924) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 19:40:14 2013 (r247925) @@ -2810,7 +2810,7 @@ sctp_notify_peer_addr_change(struct sctp static void -sctp_notify_send_failed(struct sctp_tcb *stcb, uint32_t error, +sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error, struct sctp_tmit_chunk *chk, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED @@ -2844,10 +2844,11 @@ sctp_notify_send_failed(struct sctp_tcb if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssfe->ssfe_flags = SCTP_DATA_UNSENT; - else + if (sent) { ssfe->ssfe_flags = SCTP_DATA_SENT; + } else { + ssfe->ssfe_flags = SCTP_DATA_UNSENT; + } ssfe->ssfe_length = length; ssfe->ssfe_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -2862,10 +2863,11 @@ sctp_notify_send_failed(struct sctp_tcb } else { ssf = mtod(m_notify, struct sctp_send_failed *); ssf->ssf_type = SCTP_SEND_FAILED; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssf->ssf_flags = SCTP_DATA_UNSENT; - else + if (sent) { ssf->ssf_flags = SCTP_DATA_SENT; + } else { + ssf->ssf_flags = SCTP_DATA_UNSENT; + } ssf->ssf_length = length; ssf->ssf_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -2954,10 +2956,7 @@ sctp_notify_send_failed2(struct sctp_tcb if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); ssfe->ssfe_type = SCTP_SEND_FAILED; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssfe->ssfe_flags = SCTP_DATA_UNSENT; - else - ssfe->ssfe_flags = SCTP_DATA_SENT; + ssfe->ssfe_flags = SCTP_DATA_UNSENT; ssfe->ssfe_length = length; ssfe->ssfe_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -2976,10 +2975,7 @@ sctp_notify_send_failed2(struct sctp_tcb } else { ssf = mtod(m_notify, struct sctp_send_failed *); ssf->ssf_type = SCTP_SEND_FAILED; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssf->ssf_flags = SCTP_DATA_UNSENT; - else - ssf->ssf_flags = SCTP_DATA_SENT; + ssf->ssf_flags = SCTP_DATA_UNSENT; ssf->ssf_length = length; ssf->ssf_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -3543,8 +3539,12 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_send_failed2(stcb, error, (struct sctp_stream_queue_pending *)data, so_locked); break; - case SCTP_NOTIFY_DG_FAIL: - sctp_notify_send_failed(stcb, error, + case SCTP_NOTIFY_SENT_DG_FAIL: + sctp_notify_send_failed(stcb, 1, error, + (struct sctp_tmit_chunk *)data, so_locked); + break; + case SCTP_NOTIFY_UNSENT_DG_FAIL: + sctp_notify_send_failed(stcb, 0, error, (struct sctp_tmit_chunk *)data, so_locked); break; case SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION: @@ -3642,7 +3642,7 @@ sctp_ulp_notify(uint32_t notification, s } void -sctp_report_all_outbound(struct sctp_tcb *stcb, int holds_lock, int so_locked +sctp_report_all_outbound(struct sctp_tcb *stcb, uint16_t error, int holds_lock, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -3677,8 +3677,8 @@ sctp_report_all_outbound(struct sctp_tcb asoc->sent_queue_cnt--; if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_SENT, chk, so_locked); + sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, + error, chk, so_locked); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; @@ -3693,8 +3693,8 @@ sctp_report_all_outbound(struct sctp_tcb asoc->send_queue_cnt--; if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, so_locked); + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, + error, chk, so_locked); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; @@ -3714,7 +3714,7 @@ sctp_report_all_outbound(struct sctp_tcb sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, (void *)sp, so_locked); + error, (void *)sp, so_locked); if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; @@ -3757,7 +3757,7 @@ sctp_abort_notification(struct sctp_tcb return; } /* Tell them we lost the asoc */ - sctp_report_all_outbound(stcb, 1, so_locked); + sctp_report_all_outbound(stcb, error, 1, so_locked); if (from_peer) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_REM_ABORTED, stcb, error, abort, so_locked); } else { @@ -4655,7 +4655,7 @@ sctp_free_bufspace(struct sctp_tcb *stcb int sctp_release_pr_sctp_chunk(struct sctp_tcb *stcb, struct sctp_tmit_chunk *tp1, - int reason, int so_locked + uint8_t sent, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -4682,7 +4682,11 @@ sctp_release_pr_sctp_chunk(struct sctp_t sctp_free_bufspace(stcb, &stcb->asoc, tp1, 1); stcb->asoc.peers_rwnd += tp1->send_size; stcb->asoc.peers_rwnd += SCTP_BASE_SYSCTL(sctp_peer_chunk_oh); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, reason, tp1, so_locked); + if (sent) { + sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, 0, tp1, so_locked); + } else { + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, 0, tp1, so_locked); + } if (tp1->data) { sctp_m_freem(tp1->data); tp1->data = NULL; @@ -4729,7 +4733,11 @@ sctp_release_pr_sctp_chunk(struct sctp_t chk = tp1; ret_sz += tp1->book_size; sctp_free_bufspace(stcb, &stcb->asoc, tp1, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, reason, tp1, so_locked); + if (sent) { + sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, 0, tp1, so_locked); + } else { + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, 0, tp1, so_locked); + } if (tp1->data) { sctp_m_freem(tp1->data); tp1->data = NULL; Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Thu Mar 7 19:38:04 2013 (r247924) +++ stable/8/sys/netinet/sctputil.h Thu Mar 7 19:40:14 2013 (r247925) @@ -170,7 +170,7 @@ sctp_pull_off_control_to_new_inp(struct void sctp_stop_timers_for_shutdown(struct sctp_tcb *); void -sctp_report_all_outbound(struct sctp_tcb *, int, int +sctp_report_all_outbound(struct sctp_tcb *, uint16_t, int, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -244,7 +244,7 @@ void sctp_print_address_pkt(struct ip *, int sctp_release_pr_sctp_chunk(struct sctp_tcb *, struct sctp_tmit_chunk *, - int, int + uint8_t, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:04:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4ADF7735; Thu, 7 Mar 2013 20:04:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E78DFA4; Thu, 7 Mar 2013 20:04:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27K45An088833; Thu, 7 Mar 2013 20:04:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27K45Or088830; Thu, 7 Mar 2013 20:04:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072004.r27K45Or088830@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:04:05 +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: r247926 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:04:06 -0000 Author: tuexen Date: Thu Mar 7 20:04:05 2013 New Revision: 247926 URL: http://svnweb.freebsd.org/changeset/base/247926 Log: MFC r235418: Support SCTP_REMOTE_ERROR notification. ` Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Thu Mar 7 19:40:14 2013 (r247925) +++ stable/8/sys/netinet/sctp_constants.h Thu Mar 7 20:04:05 2013 (r247926) @@ -765,6 +765,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_AUTH_FREE_KEY 24 #define SCTP_NOTIFY_NO_PEER_AUTH 25 #define SCTP_NOTIFY_SENDER_DRY 26 +#define SCTP_NOTIFY_REMOTE_ERROR 27 /* This is the value for messages that are NOT completely * copied down where we will start to split the message. Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 19:40:14 2013 (r247925) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 20:04:05 2013 (r247926) @@ -1111,7 +1111,7 @@ sctp_handle_error(struct sctp_chunkhdr * { int chklen; struct sctp_paramhdr *phdr; - uint16_t error_type; + uint16_t error, error_type; uint16_t error_len; struct sctp_association *asoc; int adjust; @@ -1126,6 +1126,7 @@ sctp_handle_error(struct sctp_chunkhdr * phdr = (struct sctp_paramhdr *)((caddr_t)ch + sizeof(struct sctp_chunkhdr)); chklen = ntohs(ch->chunk_length) - sizeof(struct sctp_chunkhdr); + error = 0; while ((size_t)chklen >= sizeof(struct sctp_paramhdr)) { /* Process an Error Cause */ error_type = ntohs(phdr->param_type); @@ -1136,6 +1137,10 @@ sctp_handle_error(struct sctp_chunkhdr * chklen, error_len); return (0); } + if (error == 0) { + /* report the first error cause */ + error = error_type; + } switch (error_type) { case SCTP_CAUSE_INVALID_STREAM: case SCTP_CAUSE_MISSING_PARAM: @@ -1252,6 +1257,7 @@ sctp_handle_error(struct sctp_chunkhdr * chklen -= adjust; phdr = (struct sctp_paramhdr *)((caddr_t)phdr + adjust); } + sctp_ulp_notify(SCTP_NOTIFY_REMOTE_ERROR, stcb, error, ch, SCTP_SO_NOT_LOCKED); return (0); } Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 19:40:14 2013 (r247925) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 20:04:05 2013 (r247926) @@ -3464,6 +3464,63 @@ sctp_notify_stream_reset(struct sctp_tcb } +static void +sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct sctp_error_chunk *chunk) +{ + struct mbuf *m_notify; + struct sctp_remote_error *sre; + struct sctp_queued_to_read *control; + size_t notif_len, chunk_len; + + if ((stcb == NULL) || + sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVPEERERR)) { + return; + } + if (chunk != NULL) { + chunk_len = htons(chunk->ch.chunk_length); + } else { + chunk_len = 0; + } + notif_len = sizeof(struct sctp_remote_error) + chunk_len; + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + /* Retry with smaller value. */ + notif_len = sizeof(struct sctp_remote_error); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + return; + } + } + SCTP_BUF_NEXT(m_notify) = NULL; + sre = mtod(m_notify, struct sctp_remote_error *); + sre->sre_type = SCTP_REMOTE_ERROR; + sre->sre_flags = 0; + sre->sre_length = sizeof(struct sctp_remote_error); + sre->sre_error = error; + sre->sre_assoc_id = sctp_get_associd(stcb); + if (notif_len > sizeof(struct sctp_remote_error)) { + memcpy(sre->sre_data, chunk, chunk_len); + sre->sre_length += chunk_len; + } + SCTP_BUF_LEN(m_notify) = sre->sre_length; + control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, + 0, 0, stcb->asoc.context, 0, 0, 0, + m_notify); + if (control != NULL) { + control->length = SCTP_BUF_LEN(m_notify); + /* not that we need this */ + control->tail_mbuf = m_notify; + control->spec_flags = M_NOTIFICATION; + sctp_add_to_readq(stcb->sctp_ep, stcb, + control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + } else { + sctp_m_freem(m_notify); + } +} + + void sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked @@ -3634,6 +3691,9 @@ sctp_ulp_notify(uint32_t notification, s case SCTP_NOTIFY_SENDER_DRY: sctp_notify_sender_dry_event(stcb, so_locked); break; + case SCTP_NOTIFY_REMOTE_ERROR: + sctp_notify_remote_error(stcb, error, data); + break; default: SCTPDBG(SCTP_DEBUG_UTIL1, "%s: unknown notification %xh (%u)\n", __FUNCTION__, notification, notification); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:06:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2DA7D9A5; Thu, 7 Mar 2013 20:06:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15A29FC7; Thu, 7 Mar 2013 20:06:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27K6RWb089400; Thu, 7 Mar 2013 20:06:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27K6RNq089399; Thu, 7 Mar 2013 20:06:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072006.r27K6RNq089399@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:06:27 +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: r247927 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:06:28 -0000 Author: tuexen Date: Thu Mar 7 20:06:27 2013 New Revision: 247927 URL: http://svnweb.freebsd.org/changeset/base/247927 Log: MFC r235554: Support SCTP_EOF also for 1-to-1 style sockets. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:04:05 2013 (r247926) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:06:27 2013 (r247927) @@ -13610,8 +13610,7 @@ skip_preblock: dataless_eof: /* EOF thing ? */ if ((srcv->sinfo_flags & SCTP_EOF) && - (got_all_of_the_send == 1) && - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE)) { + (got_all_of_the_send == 1)) { int cnt; SCTP_STAT_INCR(sctps_sends_with_eof); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:08:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C4A78B34; Thu, 7 Mar 2013 20:08:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E251FDD; Thu, 7 Mar 2013 20:08:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27K8Z9g089792; Thu, 7 Mar 2013 20:08:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27K8Zmk089789; Thu, 7 Mar 2013 20:08:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072008.r27K8Zmk089789@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:08:35 +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: r247928 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:08:35 -0000 Author: tuexen Date: Thu Mar 7 20:08:34 2013 New Revision: 247928 URL: http://svnweb.freebsd.org/changeset/base/247928 Log: MFC r235557: Use a default for max_burst of 4 and l2var of 2. This was discussed with rrs@. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Thu Mar 7 20:06:27 2013 (r247927) +++ stable/8/sys/netinet/sctp_constants.h Thu Mar 7 20:08:34 2013 (r247928) @@ -348,7 +348,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_NO_FR_UNLESS_SEGMENT_SMALLER 1 /* default max I can burst out after a fast retransmit, 0 disables it */ -#define SCTP_DEF_MAX_BURST 0 +#define SCTP_DEF_MAX_BURST 4 #define SCTP_DEF_HBMAX_BURST 4 #define SCTP_DEF_FRMAX_BURST 4 Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Thu Mar 7 20:06:27 2013 (r247927) +++ stable/8/sys/netinet/sctp_sysctl.h Thu Mar 7 20:08:34 2013 (r247928) @@ -377,7 +377,7 @@ struct sctp_sysctl { #define SCTPCTL_ABC_L_VAR_DESC "SCTP ABC max increase per SACK (L)" #define SCTPCTL_ABC_L_VAR_MIN 0 #define SCTPCTL_ABC_L_VAR_MAX 0xFFFFFFFF -#define SCTPCTL_ABC_L_VAR_DEFAULT 1 +#define SCTPCTL_ABC_L_VAR_DEFAULT 2 /* max_chained_mbufs: Default max number of small mbufs on a chain */ #define SCTPCTL_MAX_CHAINED_MBUFS_DESC "Default max number of small mbufs on a chain" From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:12:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23F4FCDF; Thu, 7 Mar 2013 20:12:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14748A2; Thu, 7 Mar 2013 20:12:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KCeRt092209; Thu, 7 Mar 2013 20:12:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KCWN6092152; Thu, 7 Mar 2013 20:12:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072012.r27KCWN6092152@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:12:32 +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: r247929 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:12:40 -0000 Author: tuexen Date: Thu Mar 7 20:12:31 2013 New Revision: 247929 URL: http://svnweb.freebsd.org/changeset/base/247929 Log: MFC r235828: Use consistent text at the begining of the files. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_asconf.h stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_auth.h stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_bsd_addr.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_crc32.c stable/8/sys/netinet/sctp_crc32.h stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_lock_bsd.h stable/8/sys/netinet/sctp_os.h stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_peeloff.c stable/8/sys/netinet/sctp_peeloff.h stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_timer.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c stable/8/sys/netinet6/sctp6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,7 +29,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp.h,v 1.18 2005/03/06 16:04:16 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); @@ -37,6 +36,7 @@ __FBSDID("$FreeBSD$"); #ifndef _NETINET_SCTP_H_ #define _NETINET_SCTP_H_ + #include Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,10 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_asconf.c,v 1.24 2005/03/06 16:04:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: stable/8/sys/netinet/sctp_asconf.h ============================================================================== --- stable/8/sys/netinet/sctp_asconf.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_asconf.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_asconf.h,v 1.8 2005/03/06 16:04:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_auth.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_auth.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __SCTP_AUTH_H__ -#define __SCTP_AUTH_H__ +#ifndef _NETINET_SCTP_AUTH_H_ +#define _NETINET_SCTP_AUTH_H_ /* digest lengths */ Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_bsd_addr.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_bsd_addr.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,9 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_bsd_addr_h__ -#define __sctp_bsd_addr_h__ +#ifndef _NETINET_SCTP_BSD_ADDR_H_ +#define _NETINET_SCTP_BSD_ADDR_H_ + #include #if defined(_KERNEL) || defined(__Userspace__) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_cc_functions.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,6 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -44,8 +47,6 @@ #include #include #include -#include -__FBSDID("$FreeBSD$"); #define SHIFT_MPTCP_MULTI_N 40 #define SHIFT_MPTCP_MULTI_Z 16 Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_constants.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_constants.h,v 1.17 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_constants_h__ -#define __sctp_constants_h__ +#ifndef _NETINET_SCTP_CONSTANTS_H_ +#define _NETINET_SCTP_CONSTANTS_H_ /* IANA assigned port number for SCTP over UDP encapsulation */ /* For freebsd we cannot bind the port at Modified: stable/8/sys/netinet/sctp_crc32.c ============================================================================== --- stable/8/sys/netinet/sctp_crc32.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_crc32.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,9 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $ */ - - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctp_crc32.h ============================================================================== --- stable/8/sys/netinet/sctp_crc32.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_crc32.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_crc32.h,v 1.5 2004/08/17 04:06:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __crc32c_h__ -#define __crc32c_h__ +#ifndef _NETINET_SCTP_CRC32_H_ +#define _NETINET_SCTP_CRC32_H_ #if defined(_KERNEL) #if !defined(SCTP_WITH_NO_CSUM) Modified: stable/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,9 +28,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_dtrace_declare_h__ + +#ifndef _NETINET_SCTP_DTRACE_DECLARE_H_ +#define _NETINET_SCTP_DTRACE_DECLARE_H_ + #include "opt_kdtrace.h" #include #include Modified: stable/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_dtrace_define.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,9 +28,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_dtrace_define_h__ + +#ifndef _NETINET_SCTP_DTRACE_DEFINE_H_ +#define _NETINET_SCTP_DTRACE_DEFINE_H_ + #include "opt_kdtrace.h" #include #include Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_header.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_header.h,v 1.14 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_header_h__ -#define __sctp_header_h__ +#ifndef _NETINET_SCTP_HEADER_H_ +#define _NETINET_SCTP_HEADER_H_ #include #include Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_indata.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_indata.h,v 1.9 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_indata_h__ -#define __sctp_indata_h__ +#ifndef _NETINET_SCTP_INDATA_H_ +#define _NETINET_SCTP_INDATA_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_input.c,v 1.27 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_input.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_input.h,v 1.6 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_input_h__ -#define __sctp_input_h__ +#ifndef _NETINET_SCTP_INPUT_H_ +#define _NETINET_SCTP_INPUT_H_ #if defined(_KERNEL) || defined(__Userspace__) void Modified: stable/8/sys/netinet/sctp_lock_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_lock_bsd.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_lock_bsd.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,9 +1,7 @@ -#ifndef __sctp_lock_bsd_h__ -#define __sctp_lock_bsd_h__ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,6 +30,12 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + +#ifndef _NETINET_SCTP_LOCK_BSD_H_ +#define _NETINET_SCTP_LOCK_BSD_H_ + /* * General locking concepts: The goal of our locking is to of course provide * consistency and yet minimize overhead. We will attempt to use @@ -70,9 +74,6 @@ * SCTP_INP_INFO_RLOCK() and then when we want to add a new association to * the SCTP_BASE_INFO() list's we will do a SCTP_INP_INFO_WLOCK(). */ -#include -__FBSDID("$FreeBSD$"); - extern struct sctp_foo_stuff sctp_logoff[]; extern int sctp_logoff_stuff; Modified: stable/8/sys/netinet/sctp_os.h ============================================================================== --- stable/8/sys/netinet/sctp_os.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_os.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,10 +29,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_os_h__ -#define __sctp_os_h__ + +#ifndef _NETINET_SCTP_OS_H_ +#define _NETINET_SCTP_OS_H_ /* * General kernel memory allocation: Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_os_bsd.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,10 +29,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_os_bsd_h__ -#define __sctp_os_bsd_h__ + +#ifndef _NETINET_SCTP_OS_BSD_H_ +#define _NETINET_SCTP_OS_BSD_H_ /* * includes */ Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_output.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.h,v 1.14 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_output_h__ -#define __sctp_output_h__ +#ifndef _NETINET_SCTP_OUTPUT_H_ +#define _NETINET_SCTP_OUTPUT_H_ #include Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_pcb.c,v 1.38 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_pcb.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -29,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_pcb.h,v 1.21 2005/07/16 01:18:47 suz Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_pcb_h__ -#define __sctp_pcb_h__ +#ifndef _NETINET_SCTP_PCB_H_ +#define _NETINET_SCTP_PCB_H_ #include #include Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_peeloff.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,11 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ - -/* $KAME: sctp_peeloff.c,v 1.13 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: stable/8/sys/netinet/sctp_peeloff.h ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_peeloff.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_peeloff.h,v 1.6 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_peeloff_h__ -#define __sctp_peeloff_h__ +#ifndef _NETINET_SCTP_PEELOFF_H_ +#define _NETINET_SCTP_PEELOFF_H_ Modified: stable/8/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_ss_functions.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_ss_functions.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- - * Copyright (c) 2010-2011, by Michael Tuexen. All rights reserved. - * Copyright (c) 2010-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2010-2011, by Robin Seggelmann. All rights reserved. + * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved. + * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2010-2012, by Robin Seggelmann. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_structs.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_structs.h,v 1.13 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_structs_h__ -#define __sctp_structs_h__ +#ifndef _NETINET_SCTP_STRUCTS_H_ +#define _NETINET_SCTP_STRUCTS_H_ #include #include Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_sysctl.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_sysctl.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_sysctl_h__ -#define __sctp_sysctl_h__ +#ifndef _NETINET_SCTP_SYSCTL_H_ +#define _NETINET_SCTP_SYSCTL_H_ #include #include Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_timer.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_timer.c,v 1.29 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctp_timer.h ============================================================================== --- stable/8/sys/netinet/sctp_timer.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_timer.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,12 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_timer.h,v 1.6 2005/03/06 16:04:18 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_timer_h__ -#define __sctp_timer_h__ +#ifndef _NETINET_SCTP_TIMER_H_ +#define _NETINET_SCTP_TIMER_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_uio.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,12 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_uio.h,v 1.11 2005/03/06 16:04:18 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_uio_h__ -#define __sctp_uio_h__ +#ifndef _NETINET_SCTP_UIO_H_ +#define _NETINET_SCTP_UIO_H_ #if ! defined(_KERNEL) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,10 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_usrreq.c,v 1.48 2005/03/07 23:26:08 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: stable/8/sys/netinet/sctp_var.h ============================================================================== --- stable/8/sys/netinet/sctp_var.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctp_var.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_var.h,v 1.24 2005/03/06 16:04:19 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctputil.c,v 1.37 2005/03/07 23:26:09 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet/sctputil.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,14 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ - -/* $KAME: sctputil.h,v 1.15 2005/03/06 16:04:19 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctputil_h__ -#define __sctputil_h__ +#ifndef _NETINET_SCTP_UTIL_H_ +#define _NETINET_SCTP_UTIL_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,7 +29,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */ #include __FBSDID("$FreeBSD$"); Modified: stable/8/sys/netinet6/sctp6_var.h ============================================================================== --- stable/8/sys/netinet6/sctp6_var.h Thu Mar 7 20:08:34 2013 (r247928) +++ stable/8/sys/netinet6/sctp6_var.h Thu Mar 7 20:12:31 2013 (r247929) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,14 +29,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp6_var.h,v 1.7 2004/08/17 04:06:22 itojun Exp $ */ - -#ifndef _NETINET6_SCTP6_VAR_H_ -#define _NETINET6_SCTP6_VAR_H_ #include __FBSDID("$FreeBSD$"); +#ifndef _NETINET6_SCTP6_VAR_H_ +#define _NETINET6_SCTP6_VAR_H_ + #if defined(_KERNEL) SYSCTL_DECL(_net_inet6_sctp6); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:14:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71434E65; Thu, 7 Mar 2013 20:14:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58BA9B9; Thu, 7 Mar 2013 20:14:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KEuTV092603; Thu, 7 Mar 2013 20:14:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KEuf3092602; Thu, 7 Mar 2013 20:14:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072014.r27KEuf3092602@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:14:56 +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: r247930 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:14:56 -0000 Author: tuexen Date: Thu Mar 7 20:14:55 2013 New Revision: 247930 URL: http://svnweb.freebsd.org/changeset/base/247930 Log: MFC r235903: Add sn_send_failed_event to sctp_notification. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Thu Mar 7 20:12:31 2013 (r247929) +++ stable/8/sys/netinet/sctp_uio.h Thu Mar 7 20:14:55 2013 (r247930) @@ -523,10 +523,10 @@ union sctp_notification { struct sctp_pdapi_event sn_pdapi_event; struct sctp_authkey_event sn_auth_event; struct sctp_sender_dry_event sn_sender_dry_event; + struct sctp_send_failed_event sn_send_failed_event; struct sctp_stream_reset_event sn_strreset_event; struct sctp_assoc_reset_event sn_assocreset_event; struct sctp_stream_change_event sn_strchange_event; - }; /* notification types */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:17:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8B41FFE3; Thu, 7 Mar 2013 20:17:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D8D7CC; Thu, 7 Mar 2013 20:17:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KHVTW093007; Thu, 7 Mar 2013 20:17:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KHVL2093006; Thu, 7 Mar 2013 20:17:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072017.r27KHVL2093006@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:17:31 +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: r247931 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:17:31 -0000 Author: tuexen Date: Thu Mar 7 20:17:30 2013 New Revision: 247931 URL: http://svnweb.freebsd.org/changeset/base/247931 Log: MFC r235990: Undefine SCTP_PACKED before including sctp_uio.h, which doesn't use it. Spotted by Irene Ruengeler. Modified: stable/8/sys/netinet/sctp.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Thu Mar 7 20:14:55 2013 (r247930) +++ stable/8/sys/netinet/sctp.h Thu Mar 7 20:17:30 2013 (r247931) @@ -556,6 +556,8 @@ struct sctp_error_unrecognized_chunk { #define SCTP_SMALLEST_PMTU 512 /* smallest pmtu allowed when disabling PMTU * discovery */ +#undef SCTP_PACKED + #include /* This dictates the size of the packet @@ -607,7 +609,4 @@ struct sctp_error_unrecognized_chunk { #define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 #define SCTP_LOG_TRY_ADVANCE 0x10000000 - -#undef SCTP_PACKED - #endif /* !_NETINET_SCTP_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:24:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43C02345; Thu, 7 Mar 2013 20:24:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2589A10A; Thu, 7 Mar 2013 20:24:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KOFVs095672; Thu, 7 Mar 2013 20:24:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KOEkK095668; Thu, 7 Mar 2013 20:24:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072024.r27KOEkK095668@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:24:14 +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: r247932 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:24:15 -0000 Author: tuexen Date: Thu Mar 7 20:24:14 2013 New Revision: 247932 URL: http://svnweb.freebsd.org/changeset/base/247932 Log: MFC r236087: Get rid of SCTP specific code to avoid CRC32C computations on loopback. Just use offloading. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:17:30 2013 (r247931) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:24:14 2013 (r247932) @@ -4116,14 +4116,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if (V_udp_cksum) { SCTP_ENABLE_UDP_CSUM(o_pak); @@ -4474,14 +4468,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Thu Mar 7 20:17:30 2013 (r247931) +++ stable/8/sys/netinet/sctp_sysctl.c Thu Mar 7 20:24:14 2013 (r247932) @@ -55,9 +55,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; -#if !defined(SCTP_WITH_NO_CSUM) - SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; -#endif SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -604,9 +601,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); -#if !defined(SCTP_WITH_NO_CSUM) - RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -870,11 +864,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); -#if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", - SCTPCTL_LOOPBACK_NOCSUM_DESC); -#endif SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Thu Mar 7 20:17:30 2013 (r247931) +++ stable/8/sys/netinet/sctp_sysctl.h Thu Mar 7 20:24:14 2013 (r247932) @@ -47,9 +47,6 @@ struct sctp_sysctl { uint32_t sctp_ecn_enable; uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; -#if !defined(SCTP_WITH_NO_CSUM) - uint32_t sctp_no_csum_on_loopback; -#endif uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 20:17:30 2013 (r247931) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 20:24:14 2013 (r247932) @@ -150,11 +150,6 @@ sctp6_input(struct mbuf **i_pak, int *of goto sctp_skip_csum; } check = sh->checksum; /* save incoming checksum */ - if ((check == 0) && (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback)) && - (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &ip6->ip6_dst))) { - SCTP_STAT_INCR(sctps_recvnocrc); - goto sctp_skip_csum; - } sh->checksum = 0; /* prepare for calc */ calc_check = sctp_calculate_cksum(m, iphlen); SCTP_STAT_INCR(sctps_recvswcrc); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:26:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE19A717; Thu, 7 Mar 2013 20:26:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1518136; Thu, 7 Mar 2013 20:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KQqL4096216; Thu, 7 Mar 2013 20:26:52 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KQqkN096211; Thu, 7 Mar 2013 20:26:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072026.r27KQqkN096211@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:26:52 +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: r247933 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:26:52 -0000 Author: tuexen Date: Thu Mar 7 20:26:51 2013 New Revision: 247933 URL: http://svnweb.freebsd.org/changeset/base/247933 Log: MFC r236391: Small cleanups. No functional change. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 20:24:14 2013 (r247932) +++ stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 20:26:51 2013 (r247933) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); * SCTP_DEBUG_ASCONF1: protocol info, general info and errors * SCTP_DEBUG_ASCONF2: detailed info */ -#ifdef SCTP_DEBUG -#endif /* SCTP_DEBUG */ static void Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Thu Mar 7 20:24:14 2013 (r247932) +++ stable/8/sys/netinet/sctputil.h Thu Mar 7 20:26:51 2013 (r247933) @@ -381,7 +381,5 @@ sctp_auditing(int, struct sctp_inpcb *, void sctp_audit_log(uint8_t, uint8_t); #endif - - #endif /* _KERNEL */ #endif From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:29:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1098A9CB; Thu, 7 Mar 2013 20:29:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03344154; Thu, 7 Mar 2013 20:29:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KTsPP096738; Thu, 7 Mar 2013 20:29:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KTsee096733; Thu, 7 Mar 2013 20:29:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072029.r27KTsee096733@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:29:54 +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: r247934 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:29:55 -0000 Author: tuexen Date: Thu Mar 7 20:29:54 2013 New Revision: 247934 URL: http://svnweb.freebsd.org/changeset/base/247934 Log: MFC r236450: Remove an unused parameter. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 20:26:51 2013 (r247933) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 20:29:54 2013 (r247934) @@ -4516,7 +4516,7 @@ __attribute__((noinline)) } if (stcb == NULL) { /* no association, so it's out of the blue... */ - sctp_handle_ootb(m, iphlen, *offset, sh, inp, NULL, + sctp_handle_ootb(m, iphlen, *offset, sh, inp, vrf_id, port); *offset = length; if (locked_tcb) { @@ -4554,7 +4554,7 @@ __attribute__((noinline)) SCTP_TCB_UNLOCK(locked_tcb); } sctp_handle_ootb(m, iphlen, *offset, sh, inp, - NULL, vrf_id, port); + vrf_id, port); return (NULL); } } else { @@ -5586,7 +5586,7 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); - sctp_handle_ootb(m, iphlen, offset, sh, inp, NULL, + sctp_handle_ootb(m, iphlen, offset, sh, inp, vrf_id, port); goto out_now; } @@ -5630,7 +5630,7 @@ sctp_common_input_processing(struct mbuf } if (stcb == NULL) { /* out of the blue DATA chunk */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, NULL, + sctp_handle_ootb(m, iphlen, offset, sh, inp, vrf_id, port); goto out_now; } @@ -5699,7 +5699,7 @@ sctp_common_input_processing(struct mbuf /* * We consider OOTB any data sent during asoc setup. */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, NULL, + sctp_handle_ootb(m, iphlen, offset, sh, inp, vrf_id, port); SCTP_TCB_UNLOCK(stcb); goto out_now; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 20:26:51 2013 (r247933) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 20:29:54 2013 (r247934) @@ -3994,7 +3994,7 @@ sctp_abort_an_association(struct sctp_in void sctp_handle_ootb(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, - struct sctp_inpcb *inp, struct mbuf *op_err, uint32_t vrf_id, uint16_t port) + struct sctp_inpcb *inp, uint32_t vrf_id, uint16_t port) { struct sctp_chunkhdr *ch, chunk_buf; unsigned int chk_length; @@ -4049,7 +4049,7 @@ sctp_handle_ootb(struct mbuf *m, int iph if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (contains_init_chunk == 0))) { - sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); } } Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Thu Mar 7 20:26:51 2013 (r247933) +++ stable/8/sys/netinet/sctputil.h Thu Mar 7 20:29:54 2013 (r247934) @@ -200,7 +200,7 @@ sctp_abort_an_association(struct sctp_in void sctp_handle_ootb(struct mbuf *, int, int, struct sctphdr *, - struct sctp_inpcb *, struct mbuf *, uint32_t, uint16_t); + struct sctp_inpcb *, uint32_t, uint16_t); int sctp_connectx_helper_add(struct sctp_tcb *stcb, struct sockaddr *addr, From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:32:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EF5EC22; Thu, 7 Mar 2013 20:32:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63F8C16C; Thu, 7 Mar 2013 20:32:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KWVRo098828; Thu, 7 Mar 2013 20:32:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KWVLa098827; Thu, 7 Mar 2013 20:32:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072032.r27KWVLa098827@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:32:31 +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: r247935 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:32:31 -0000 Author: tuexen Date: Thu Mar 7 20:32:30 2013 New Revision: 247935 URL: http://svnweb.freebsd.org/changeset/base/247935 Log: MFC r236492: Don't request data from the IPv6 layer, which is not used. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:29:54 2013 (r247934) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:32:30 2013 (r247935) @@ -11047,11 +11047,8 @@ sctp_send_shutdown_complete2(struct mbuf #endif #ifdef INET6 if (ip6_out != NULL) { - struct route_in6 ro; int ret; - struct ifnet *ifp = NULL; - bzero(&ro, sizeof(ro)); mlen = SCTP_BUF_LEN(mout); #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) @@ -11077,11 +11074,7 @@ sctp_send_shutdown_complete2(struct mbuf SCTP_STAT_INCR(sctps_sendhwcrc); #endif } - SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id); - - /* Free the route if we got one back */ - if (ro.ro_rt) - RTFREE(ro.ro_rt); + SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); } #endif SCTP_STAT_INCR(sctps_sendpackets); @@ -12148,12 +12141,8 @@ sctp_send_abort(struct mbuf *m, int iphl #endif #ifdef INET6 if (ip6_out != NULL) { - struct route_in6 ro; int ret; - struct ifnet *ifp = NULL; - /* zap the stack pointer to the route */ - bzero(&ro, sizeof(ro)); if (port) { udp->uh_ulen = htons(len - sizeof(struct ip6_hdr)); } @@ -12184,11 +12173,7 @@ sctp_send_abort(struct mbuf *m, int iphl SCTP_STAT_INCR(sctps_sendhwcrc); #endif } - SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id); - - /* Free the route if we got one back */ - if (ro.ro_rt) - RTFREE(ro.ro_rt); + SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); } #endif SCTP_STAT_INCR(sctps_sendpackets); @@ -12414,12 +12399,8 @@ sctp_send_operr_to(struct mbuf *m, int i #endif #ifdef INET6 if (ip6_out != NULL) { - struct route_in6 ro; int ret; - struct ifnet *ifp = NULL; - /* zap the stack pointer to the route */ - bzero(&ro, sizeof(ro)); if (port) { udp->uh_ulen = htons(len - sizeof(struct ip6_hdr)); } @@ -12448,11 +12429,7 @@ sctp_send_operr_to(struct mbuf *m, int i SCTP_STAT_INCR(sctps_sendhwcrc); #endif } - SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id); - - /* Free the route if we got one back */ - if (ro.ro_rt) - RTFREE(ro.ro_rt); + SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); } #endif SCTP_STAT_INCR(sctps_sendpackets); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:34:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6161DDA7; Thu, 7 Mar 2013 20:34:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53A70182; Thu, 7 Mar 2013 20:34:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KYVwJ099177; Thu, 7 Mar 2013 20:34:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KYVMI099176; Thu, 7 Mar 2013 20:34:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072034.r27KYVMI099176@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:34:31 +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: r247936 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:34:31 -0000 Author: tuexen Date: Thu Mar 7 20:34:30 2013 New Revision: 247936 URL: http://svnweb.freebsd.org/changeset/base/247936 Log: MFC r236493: Honor sysctl for TTL. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:32:30 2013 (r247935) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:34:30 2013 (r247936) @@ -10923,7 +10923,7 @@ sctp_send_shutdown_complete2(struct mbuf iph_out->ip_tos = (u_char)0; iph_out->ip_id = 0; iph_out->ip_off = 0; - iph_out->ip_ttl = MAXTTL; + iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); if (port) { iph_out->ip_p = IPPROTO_UDP; } else { @@ -11992,7 +11992,7 @@ sctp_send_abort(struct mbuf *m, int iphl iph_out->ip_tos = (u_char)0; iph_out->ip_id = 0; iph_out->ip_off = 0; - iph_out->ip_ttl = MAXTTL; + iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); if (port) { iph_out->ip_p = IPPROTO_UDP; } else { @@ -12255,7 +12255,7 @@ sctp_send_operr_to(struct mbuf *m, int i iph_out->ip_tos = (u_char)0; iph_out->ip_id = 0; iph_out->ip_off = 0; - iph_out->ip_ttl = MAXTTL; + iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); if (port) { iph_out->ip_p = IPPROTO_UDP; } else { From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:36:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 115FFF2A; Thu, 7 Mar 2013 20:36:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E418F198; Thu, 7 Mar 2013 20:36:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KaHGX099462; Thu, 7 Mar 2013 20:36:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KaHFK099461; Thu, 7 Mar 2013 20:36:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072036.r27KaHFK099461@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:36:17 +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: r247937 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:36:18 -0000 Author: tuexen Date: Thu Mar 7 20:36:17 2013 New Revision: 247937 URL: http://svnweb.freebsd.org/changeset/base/247937 Log: MFC r236515: Use an existing function to get the source address. Modified: stable/8/sys/netinet/sctp_asconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 20:34:30 2013 (r247936) +++ stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 20:36:17 2013 (r247937) @@ -856,70 +856,20 @@ send_reply: * this could happen if the source address was just newly * added */ - struct ip *iph; - struct sctphdr *sh; - struct sockaddr_storage from_store; - struct sockaddr *from = (struct sockaddr *)&from_store; + struct sockaddr_storage addr; + struct sockaddr *src = (struct sockaddr *)&addr; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n"); - /* pullup already done, IP options already stripped */ - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - struct sockaddr_in *from4; - - sh = (struct sctphdr *)((caddr_t)iph + sizeof(*iph)); - from4 = (struct sockaddr_in *)&from_store; - bzero(from4, sizeof(*from4)); - from4->sin_family = AF_INET; - from4->sin_len = sizeof(struct sockaddr_in); - from4->sin_addr.s_addr = iph->ip_src.s_addr; - from4->sin_port = sh->src_port; - break; - } -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - { - struct ip6_hdr *ip6; - struct sockaddr_in6 *from6; - - ip6 = mtod(m, struct ip6_hdr *); - sh = (struct sctphdr *)((caddr_t)ip6 + sizeof(*ip6)); - from6 = (struct sockaddr_in6 *)&from_store; - bzero(from6, sizeof(*from6)); - from6->sin6_family = AF_INET6; - from6->sin6_len = sizeof(struct sockaddr_in6); - from6->sin6_addr = ip6->ip6_src; - from6->sin6_port = sh->src_port; - /* - * Get the scopes in properly to the sin6 - * addr's - */ - /* we probably don't need these operations */ - (void)sa6_recoverscope(from6); - sa6_embedscope(from6, - MODULE_GLOBAL(ip6_use_defzone)); - - break; - } -#endif - default: - /* unknown address type */ - from = NULL; - } - if (from != NULL) { - SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, from); - /* look up the from address */ - stcb->asoc.last_control_chunk_from = sctp_findnet(stcb, from); + sctp_asconf_get_source_ip(m, src); + SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: "); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); + /* look up the from address */ + stcb->asoc.last_control_chunk_from = sctp_findnet(stcb, src); #ifdef SCTP_DEBUG - if (stcb->asoc.last_control_chunk_from == NULL) - SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: IP source address not found?!\n"); -#endif + if (stcb->asoc.last_control_chunk_from == NULL) { + SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: IP source address not found?!\n"); } +#endif } } From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:37:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C69EB1C0; Thu, 7 Mar 2013 20:37:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B7D611B2; Thu, 7 Mar 2013 20:37:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KbvSi099715; Thu, 7 Mar 2013 20:37:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Kbvn6099713; Thu, 7 Mar 2013 20:37:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072037.r27Kbvn6099713@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:37:57 +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: r247938 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:37:57 -0000 Author: tuexen Date: Thu Mar 7 20:37:57 2013 New Revision: 247938 URL: http://svnweb.freebsd.org/changeset/base/247938 Log: MFC r236522: Remove code which is not needed. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 20:36:17 2013 (r247937) +++ stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 20:37:57 2013 (r247938) @@ -2185,8 +2185,6 @@ sctp_findassociation_addr(struct mbuf *m from6->sin6_addr = ip6->ip6_src; from6->sin6_port = sh->src_port; /* Get the scopes in properly to the sin6 addr's */ - /* we probably don't need these operations */ - (void)sa6_recoverscope(from6); sa6_embedscope(from6, MODULE_GLOBAL(ip6_use_defzone)); break; } @@ -2228,8 +2226,6 @@ sctp_findassociation_addr(struct mbuf *m to6->sin6_addr = ip6->ip6_dst; to6->sin6_port = sh->dest_port; /* Get the scopes in properly to the sin6 addr's */ - /* we probably don't need these operations */ - (void)sa6_recoverscope(to6); sa6_embedscope(to6, MODULE_GLOBAL(ip6_use_defzone)); break; } From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:41:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B21937D; Thu, 7 Mar 2013 20:41:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DD4B1CF; Thu, 7 Mar 2013 20:41:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KfaGP001929; Thu, 7 Mar 2013 20:41:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KfaWE001928; Thu, 7 Mar 2013 20:41:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072041.r27KfaWE001928@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 20:41:36 +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: r247939 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:41:37 -0000 Author: tuexen Date: Thu Mar 7 20:41:36 2013 New Revision: 247939 URL: http://svnweb.freebsd.org/changeset/base/247939 Log: MFC r236949: Small cleanup. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 20:37:57 2013 (r247938) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 20:41:36 2013 (r247939) @@ -2573,15 +2573,13 @@ sctp_pad_lastmbuf(struct mbuf *m, int pa /* find the last mbuf in chain and pad it */ struct mbuf *m_at; - m_at = m; if (last_mbuf) { return (sctp_add_pad_tombuf(last_mbuf, padval)); } else { - while (m_at) { + for (m_at = m; m_at; m_at = SCTP_BUF_NEXT(m_at)) { if (SCTP_BUF_NEXT(m_at) == NULL) { return (sctp_add_pad_tombuf(m_at, padval)); } - m_at = SCTP_BUF_NEXT(m_at); } } SCTP_LTRACE_ERR_RET_PKT(m, NULL, NULL, NULL, SCTP_FROM_SCTPUTIL, EFAULT); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 20:48:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 90282624; Thu, 7 Mar 2013 20:48:37 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C84F20B; Thu, 7 Mar 2013 20:48:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27KmbW3002902; Thu, 7 Mar 2013 20:48:37 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27KmbcK002901; Thu, 7 Mar 2013 20:48:37 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201303072048.r27KmbcK002901@svn.freebsd.org> From: Colin Percival Date: Thu, 7 Mar 2013 20:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247940 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 20:48:37 -0000 Author: cperciva Date: Thu Mar 7 20:48:36 2013 New Revision: 247940 URL: http://svnweb.freebsd.org/changeset/base/247940 Log: Now that stable/7 is EOL, stop building INDEX-7. MFC after: 1 week Modified: head/etc/portsnap.conf Modified: head/etc/portsnap.conf ============================================================================== --- head/etc/portsnap.conf Thu Mar 7 20:41:36 2013 (r247939) +++ head/etc/portsnap.conf Thu Mar 7 20:48:36 2013 (r247940) @@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-7 DESCRIBE.7 INDEX INDEX-8 DESCRIBE.8 INDEX INDEX-9 DESCRIBE.9 From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:08:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E307CBC1; Thu, 7 Mar 2013 21:08:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BBD662EB; Thu, 7 Mar 2013 21:08:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27L8KKG009065; Thu, 7 Mar 2013 21:08:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27L8K0E009062; Thu, 7 Mar 2013 21:08:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072108.r27L8K0E009062@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:08:20 +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: r247941 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:08:21 -0000 Author: tuexen Date: Thu Mar 7 21:08:19 2013 New Revision: 247941 URL: http://svnweb.freebsd.org/changeset/base/247941 Log: MFC r236956: Unify the sending of ABORT, SHUTDOWN-COMPLETE and ERROR chunks. While there: Fix also some minor bugs and prepare for SCTP/DTLS. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 20:48:36 2013 (r247940) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:08:19 2013 (r247941) @@ -1442,7 +1442,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_COOKIE_IN_SHUTDOWN); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_operr_to(m, iphlen, op_err, cookie->peers_vtag, + sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 2; @@ -2570,7 +2570,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (tim == 0) tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); - sctp_send_operr_to(m, iphlen, op_err, cookie->peers_vtag, + sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, vrf_id, port); return (NULL); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 20:48:36 2013 (r247940) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:08:19 2013 (r247941) @@ -10854,19 +10854,20 @@ sctp_send_shutdown_complete(struct sctp_ return; } -void -sctp_send_shutdown_complete2(struct mbuf *m, struct sctphdr *sh, - uint32_t vrf_id, uint16_t port) +static void +sctp_send_resp_msg(struct mbuf *m, struct sctphdr *sh, uint32_t vtag, + uint8_t type, struct mbuf *cause, uint32_t vrf_id, uint16_t port) { - /* formulate and SEND a SHUTDOWN-COMPLETE */ struct mbuf *o_pak; struct mbuf *mout; + struct sctphdr *shout; + struct sctp_chunkhdr *ch; struct ip *iph; - struct udphdr *udp = NULL; - int offset_out, len, mlen; - struct sctp_shutdown_complete_msg *comp_cp; + struct udphdr *udp; + int len, cause_len, padding_len, ret; #ifdef INET + sctp_route_t ro; struct ip *iph_out; #endif @@ -10875,31 +10876,59 @@ sctp_send_shutdown_complete2(struct mbuf #endif + /* Compute the length of the cause and add final padding. */ + cause_len = 0; + if (cause != NULL) { + struct mbuf *m_at, *m_last = NULL; + + for (m_at = cause; m_at; m_at = SCTP_BUF_NEXT(m_at)) { + if (SCTP_BUF_NEXT(m_at) == NULL) + m_last = m_at; + cause_len += SCTP_BUF_LEN(m_at); + } + padding_len = cause_len % 4; + if (padding_len != 0) { + padding_len = 4 - padding_len; + } + if (padding_len != 0) { + if (sctp_add_pad_tombuf(m_last, padding_len)) { + sctp_m_freem(cause); + return; + } + } + } else { + padding_len = 0; + } + /* Get an mbuf for the header. */ + len = sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); iph = mtod(m, struct ip *); switch (iph->ip_v) { #ifdef INET case IPVERSION: - len = (sizeof(struct ip) + sizeof(struct sctp_shutdown_complete_msg)); + len += sizeof(struct ip); break; #endif #ifdef INET6 case IPV6_VERSION >> 4: - len = (sizeof(struct ip6_hdr) + sizeof(struct sctp_shutdown_complete_msg)); + len += sizeof(struct ip6_hdr); break; #endif default: - return; + break; } if (port) { len += sizeof(struct udphdr); } mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_DONTWAIT, 1, MT_DATA); if (mout == NULL) { + if (cause) { + sctp_m_freem(cause); + } return; } SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; - SCTP_BUF_NEXT(mout) = NULL; + SCTP_BUF_NEXT(mout) = cause; if (m->m_flags & M_FLOWID) { mout->m_pkthdr.flowid = m->m_pkthdr.flowid; mout->m_flags |= M_FLOWID; @@ -10910,18 +10939,14 @@ sctp_send_shutdown_complete2(struct mbuf #ifdef INET6 ip6_out = NULL; #endif - offset_out = 0; - switch (iph->ip_v) { #ifdef INET case IPVERSION: iph_out = mtod(mout, struct ip *); - - /* Fill in the IP header for the ABORT */ iph_out->ip_v = IPVERSION; - iph_out->ip_hl = (sizeof(struct ip) / 4); - iph_out->ip_tos = (u_char)0; - iph_out->ip_id = 0; + iph_out->ip_hl = (sizeof(struct ip) >> 2); + iph_out->ip_tos = 0; + iph_out->ip_id = ip_newid(); iph_out->ip_off = 0; iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); if (port) { @@ -10931,21 +10956,19 @@ sctp_send_shutdown_complete2(struct mbuf } iph_out->ip_src.s_addr = iph->ip_dst.s_addr; iph_out->ip_dst.s_addr = iph->ip_src.s_addr; - - /* let IP layer calculate this */ iph_out->ip_sum = 0; - offset_out += sizeof(*iph_out); - comp_cp = (struct sctp_shutdown_complete_msg *)( - (caddr_t)iph_out + offset_out); + len = sizeof(struct ip); + shout = (struct sctphdr *)((caddr_t)iph_out + len); break; #endif #ifdef INET6 case IPV6_VERSION >> 4: ip6 = (struct ip6_hdr *)iph; ip6_out = mtod(mout, struct ip6_hdr *); - - /* Fill in the IPv6 header for the ABORT */ - ip6_out->ip6_flow = ip6->ip6_flow; + ip6_out->ip6_flow = htonl(0x60000000); + if (V_ip6_auto_flowlabel) { + ip6_out->ip6_flow |= (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK); + } ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); if (port) { ip6_out->ip6_nxt = IPPROTO_UDP; @@ -10954,78 +10977,84 @@ sctp_send_shutdown_complete2(struct mbuf } ip6_out->ip6_src = ip6->ip6_dst; ip6_out->ip6_dst = ip6->ip6_src; - /* - * ?? The old code had both the iph len + payload, I think - * this is wrong and would never have worked - */ - ip6_out->ip6_plen = sizeof(struct sctp_shutdown_complete_msg); - offset_out += sizeof(*ip6_out); - comp_cp = (struct sctp_shutdown_complete_msg *)( - (caddr_t)ip6_out + offset_out); + len = sizeof(struct ip6_hdr); + shout = (struct sctphdr *)((caddr_t)ip6_out + len); break; -#endif /* INET6 */ +#endif default: - /* Currently not supported. */ - sctp_m_freem(mout); - return; + len = 0; + shout = mtod(mout, struct sctphdr *); + break; } if (port) { if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { sctp_m_freem(mout); return; } - udp = (struct udphdr *)comp_cp; + udp = (struct udphdr *)shout; udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; - udp->uh_ulen = htons(sizeof(struct sctp_shutdown_complete_msg) + sizeof(struct udphdr)); -#ifdef INET - if (iph_out) { - if (V_udp_cksum) { - udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); - } else { - udp->uh_sum = 0; - } - } -#endif - offset_out += sizeof(struct udphdr); - comp_cp = (struct sctp_shutdown_complete_msg *)((caddr_t)comp_cp + sizeof(struct udphdr)); + udp->uh_sum = 0; + udp->uh_ulen = htons(sizeof(struct udphdr) + + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + cause_len + padding_len); + len += sizeof(struct udphdr); + shout = (struct sctphdr *)((caddr_t)shout + sizeof(struct udphdr)); + } else { + udp = NULL; } + shout->src_port = sh->dest_port; + shout->dest_port = sh->src_port; + shout->checksum = 0; + if (vtag) { + shout->v_tag = htonl(vtag); + } else { + shout->v_tag = sh->v_tag; + } + len += sizeof(struct sctphdr); + ch = (struct sctp_chunkhdr *)((caddr_t)shout + sizeof(struct sctphdr)); + ch->chunk_type = type; + if (vtag) { + ch->chunk_flags = 0; + } else { + ch->chunk_flags = SCTP_HAD_NO_TCB; + } + ch->chunk_length = htons(sizeof(struct sctp_chunkhdr) + cause_len); + len += sizeof(struct sctp_chunkhdr); + len += cause_len + padding_len; + if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { - /* no mbuf's */ sctp_m_freem(mout); return; } - /* Now copy in and fill in the ABORT tags etc. */ - comp_cp->sh.src_port = sh->dest_port; - comp_cp->sh.dest_port = sh->src_port; - comp_cp->sh.checksum = 0; - comp_cp->sh.v_tag = sh->v_tag; - comp_cp->shut_cmp.ch.chunk_flags = SCTP_HAD_NO_TCB; - comp_cp->shut_cmp.ch.chunk_type = SCTP_SHUTDOWN_COMPLETE; - comp_cp->shut_cmp.ch.chunk_length = htons(sizeof(struct sctp_shutdown_complete_chunk)); - + SCTP_ATTACH_CHAIN(o_pak, mout, len); #ifdef INET if (iph_out != NULL) { - sctp_route_t ro; - int ret; - - mlen = SCTP_BUF_LEN(mout); - bzero(&ro, sizeof ro); - /* set IPv4 length */ - iph_out->ip_len = mlen; -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, mlen); + /* zap the stack pointer to the route */ + bzero(&ro, sizeof(sctp_route_t)); + if (port) { + if (V_udp_cksum) { + udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); + } else { + udp->uh_sum = 0; + } + } + iph_out->ip_len = len; +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(mout, len); + } #endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - comp_cp->sh.checksum = sctp_calculate_cksum(mout, offset_out); + shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); #endif if (V_udp_cksum) { - SCTP_ENABLE_UDP_CSUM(mout); + SCTP_ENABLE_UDP_CSUM(o_pak); } } else { #if defined(SCTP_WITH_NO_CSUM) @@ -11036,33 +11065,29 @@ sctp_send_shutdown_complete2(struct mbuf SCTP_STAT_INCR(sctps_sendhwcrc); #endif } - SCTP_ATTACH_CHAIN(o_pak, mout, mlen); - /* out it goes */ SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); - /* Free the route if we got one back */ - if (ro.ro_rt) + if (ro.ro_rt) { RTFREE(ro.ro_rt); + } } #endif #ifdef INET6 if (ip6_out != NULL) { - int ret; - - mlen = SCTP_BUF_LEN(mout); + ip6_out->ip6_plen = len - sizeof(struct ip6_hdr); #ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, mlen); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(mout, len); + } #endif - SCTP_ATTACH_CHAIN(o_pak, mout, mlen); if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - comp_cp->sh.checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); + shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); #endif - if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), mlen - sizeof(struct ip6_hdr))) == 0) { + if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; } } else { @@ -11081,7 +11106,13 @@ sctp_send_shutdown_complete2(struct mbuf SCTP_STAT_INCR_COUNTER64(sctps_outpackets); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; +} +void +sctp_send_shutdown_complete2(struct mbuf *m, struct sctphdr *sh, + uint32_t vrf_id, uint16_t port) +{ + sctp_send_resp_msg(m, sh, 0, SCTP_SHUTDOWN_COMPLETE, NULL, vrf_id, port); } void @@ -11913,528 +11944,24 @@ skip_stuff: void sctp_send_abort(struct mbuf *m, int iphlen, struct sctphdr *sh, uint32_t vtag, - struct mbuf *err_cause, uint32_t vrf_id, uint16_t port) + struct mbuf *cause, uint32_t vrf_id, uint16_t port) { - /*- - * Formulate the abort message, and send it back down. - */ - struct mbuf *o_pak; - struct mbuf *mout; - struct sctp_abort_msg *abm; - struct ip *iph; - struct udphdr *udp; - int iphlen_out, len; - -#ifdef INET - struct ip *iph_out; - -#endif -#ifdef INET6 - struct ip6_hdr *ip6, *ip6_out; - -#endif - - /* don't respond to ABORT with ABORT */ + /* Don't respond to an ABORT with an ABORT. */ if (sctp_is_there_an_abort_here(m, iphlen, &vtag)) { - if (err_cause) - sctp_m_freem(err_cause); - return; - } - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - len = (sizeof(struct ip) + sizeof(struct sctp_abort_msg)); - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - len = (sizeof(struct ip6_hdr) + sizeof(struct sctp_abort_msg)); - break; -#endif - default: - if (err_cause) { - sctp_m_freem(err_cause); - } - return; - } - if (port) { - len += sizeof(struct udphdr); - } - mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_DONTWAIT, 1, MT_DATA); - if (mout == NULL) { - if (err_cause) { - sctp_m_freem(err_cause); - } + if (cause) + sctp_m_freem(cause); return; } - SCTP_BUF_RESV_UF(mout, max_linkhdr); - SCTP_BUF_LEN(mout) = len; - SCTP_BUF_NEXT(mout) = err_cause; - if (m->m_flags & M_FLOWID) { - mout->m_pkthdr.flowid = m->m_pkthdr.flowid; - mout->m_flags |= M_FLOWID; - } -#ifdef INET - iph_out = NULL; -#endif -#ifdef INET6 - ip6_out = NULL; -#endif - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - iph_out = mtod(mout, struct ip *); - - /* Fill in the IP header for the ABORT */ - iph_out->ip_v = IPVERSION; - iph_out->ip_hl = (sizeof(struct ip) / 4); - iph_out->ip_tos = (u_char)0; - iph_out->ip_id = 0; - iph_out->ip_off = 0; - iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); - if (port) { - iph_out->ip_p = IPPROTO_UDP; - } else { - iph_out->ip_p = IPPROTO_SCTP; - } - iph_out->ip_src.s_addr = iph->ip_dst.s_addr; - iph_out->ip_dst.s_addr = iph->ip_src.s_addr; - /* let IP layer calculate this */ - iph_out->ip_sum = 0; - - iphlen_out = sizeof(*iph_out); - abm = (struct sctp_abort_msg *)((caddr_t)iph_out + iphlen_out); - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - ip6 = (struct ip6_hdr *)iph; - ip6_out = mtod(mout, struct ip6_hdr *); - - /* Fill in the IP6 header for the ABORT */ - ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); - if (port) { - ip6_out->ip6_nxt = IPPROTO_UDP; - } else { - ip6_out->ip6_nxt = IPPROTO_SCTP; - } - ip6_out->ip6_src = ip6->ip6_dst; - ip6_out->ip6_dst = ip6->ip6_src; - - iphlen_out = sizeof(*ip6_out); - abm = (struct sctp_abort_msg *)((caddr_t)ip6_out + iphlen_out); - break; -#endif /* INET6 */ - default: - /* Currently not supported */ - sctp_m_freem(mout); - return; - } - - udp = (struct udphdr *)abm; - if (port) { - if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { - sctp_m_freem(mout); - return; - } - udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); - udp->uh_dport = port; - /* set udp->uh_ulen later */ - udp->uh_sum = 0; - iphlen_out += sizeof(struct udphdr); - abm = (struct sctp_abort_msg *)((caddr_t)abm + sizeof(struct udphdr)); - } - abm->sh.src_port = sh->dest_port; - abm->sh.dest_port = sh->src_port; - abm->sh.checksum = 0; - if (vtag == 0) { - abm->sh.v_tag = sh->v_tag; - abm->msg.ch.chunk_flags = SCTP_HAD_NO_TCB; - } else { - abm->sh.v_tag = htonl(vtag); - abm->msg.ch.chunk_flags = 0; - } - abm->msg.ch.chunk_type = SCTP_ABORT_ASSOCIATION; - - if (err_cause) { - struct mbuf *m_tmp = err_cause; - int err_len = 0; - - /* get length of the err_cause chain */ - while (m_tmp != NULL) { - err_len += SCTP_BUF_LEN(m_tmp); - m_tmp = SCTP_BUF_NEXT(m_tmp); - } - len = SCTP_BUF_LEN(mout) + err_len; - if (err_len % 4) { - /* need pad at end of chunk */ - uint32_t cpthis = 0; - int padlen; - - padlen = 4 - (len % 4); - m_copyback(mout, len, padlen, (caddr_t)&cpthis); - len += padlen; - } - abm->msg.ch.chunk_length = htons(sizeof(abm->msg.ch) + err_len); - } else { - len = SCTP_BUF_LEN(mout); - abm->msg.ch.chunk_length = htons(sizeof(abm->msg.ch)); - } - - if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { - /* no mbuf's */ - sctp_m_freem(mout); - return; - } -#ifdef INET - if (iph_out != NULL) { - sctp_route_t ro; - int ret; - - /* zap the stack pointer to the route */ - bzero(&ro, sizeof ro); - if (port) { - udp->uh_ulen = htons(len - sizeof(struct ip)); - if (V_udp_cksum) { - udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); - } else { - udp->uh_sum = 0; - } - } - SCTPDBG(SCTP_DEBUG_OUTPUT2, "sctp_send_abort calling ip_output:\n"); - SCTPDBG_PKT(SCTP_DEBUG_OUTPUT2, iph_out, &abm->sh); - /* set IPv4 length */ - iph_out->ip_len = len; - /* out it goes */ -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, len); -#endif - SCTP_ATTACH_CHAIN(o_pak, mout, len); - if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - abm->sh.checksum = sctp_calculate_cksum(mout, iphlen_out); - SCTP_STAT_INCR(sctps_sendswcrc); -#endif - if (V_udp_cksum) { - SCTP_ENABLE_UDP_CSUM(o_pak); - } - } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - mout->m_pkthdr.csum_flags = CSUM_SCTP; - mout->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); -#endif - } - SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); - - /* Free the route if we got one back */ - if (ro.ro_rt) - RTFREE(ro.ro_rt); - } -#endif -#ifdef INET6 - if (ip6_out != NULL) { - int ret; - - if (port) { - udp->uh_ulen = htons(len - sizeof(struct ip6_hdr)); - } - SCTPDBG(SCTP_DEBUG_OUTPUT2, "sctp_send_abort calling ip6_output:\n"); - SCTPDBG_PKT(SCTP_DEBUG_OUTPUT2, (struct ip *)ip6_out, &abm->sh); - ip6_out->ip6_plen = len - sizeof(*ip6_out); -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, len); -#endif - SCTP_ATTACH_CHAIN(o_pak, mout, len); - if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - abm->sh.checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); -#endif - if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) { - udp->uh_sum = 0xffff; - } - } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - mout->m_pkthdr.csum_flags = CSUM_SCTP; - mout->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); -#endif - } - SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); - } -#endif - SCTP_STAT_INCR(sctps_sendpackets); - SCTP_STAT_INCR_COUNTER64(sctps_outpackets); - SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); + sctp_send_resp_msg(m, sh, vtag, SCTP_ABORT_ASSOCIATION, cause, vrf_id, port); + return; } void -sctp_send_operr_to(struct mbuf *m, int iphlen, struct mbuf *scm, uint32_t vtag, - uint32_t vrf_id, uint16_t port) +sctp_send_operr_to(struct mbuf *m, struct sctphdr *sh, uint32_t vtag, + struct mbuf *cause, uint32_t vrf_id, uint16_t port) { - struct mbuf *o_pak; - struct sctphdr *sh, *sh_out; - struct sctp_chunkhdr *ch; - struct ip *iph; - struct udphdr *udp = NULL; - struct mbuf *mout; - int iphlen_out, len; - -#ifdef INET - struct ip *iph_out; - -#endif -#ifdef INET6 - struct ip6_hdr *ip6, *ip6_out; - -#endif - - iph = mtod(m, struct ip *); - sh = (struct sctphdr *)((caddr_t)iph + iphlen); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - len = (sizeof(struct ip) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr)); - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - len = (sizeof(struct ip6_hdr) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr)); - break; -#endif - default: - if (scm) { - sctp_m_freem(scm); - } - return; - } - if (port) { - len += sizeof(struct udphdr); - } - mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_DONTWAIT, 1, MT_DATA); - if (mout == NULL) { - if (scm) { - sctp_m_freem(scm); - } - return; - } - SCTP_BUF_RESV_UF(mout, max_linkhdr); - SCTP_BUF_LEN(mout) = len; - SCTP_BUF_NEXT(mout) = scm; - if (m->m_flags & M_FLOWID) { - mout->m_pkthdr.flowid = m->m_pkthdr.flowid; - mout->m_flags |= M_FLOWID; - } -#ifdef INET - iph_out = NULL; -#endif -#ifdef INET6 - ip6_out = NULL; -#endif - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - iph_out = mtod(mout, struct ip *); - - /* Fill in the IP header for the ABORT */ - iph_out->ip_v = IPVERSION; - iph_out->ip_hl = (sizeof(struct ip) / 4); - iph_out->ip_tos = (u_char)0; - iph_out->ip_id = 0; - iph_out->ip_off = 0; - iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); - if (port) { - iph_out->ip_p = IPPROTO_UDP; - } else { - iph_out->ip_p = IPPROTO_SCTP; - } - iph_out->ip_src.s_addr = iph->ip_dst.s_addr; - iph_out->ip_dst.s_addr = iph->ip_src.s_addr; - /* let IP layer calculate this */ - iph_out->ip_sum = 0; - - iphlen_out = sizeof(struct ip); - sh_out = (struct sctphdr *)((caddr_t)iph_out + iphlen_out); - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - ip6 = (struct ip6_hdr *)iph; - ip6_out = mtod(mout, struct ip6_hdr *); - - /* Fill in the IP6 header for the ABORT */ - ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); - if (port) { - ip6_out->ip6_nxt = IPPROTO_UDP; - } else { - ip6_out->ip6_nxt = IPPROTO_SCTP; - } - ip6_out->ip6_src = ip6->ip6_dst; - ip6_out->ip6_dst = ip6->ip6_src; - - iphlen_out = sizeof(struct ip6_hdr); - sh_out = (struct sctphdr *)((caddr_t)ip6_out + iphlen_out); - break; -#endif /* INET6 */ - default: - /* Currently not supported */ - sctp_m_freem(mout); - return; - } - - udp = (struct udphdr *)sh_out; - if (port) { - if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { - sctp_m_freem(mout); - return; - } - udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); - udp->uh_dport = port; - /* set udp->uh_ulen later */ - udp->uh_sum = 0; - iphlen_out += sizeof(struct udphdr); - sh_out = (struct sctphdr *)((caddr_t)udp + sizeof(struct udphdr)); - } - sh_out->src_port = sh->dest_port; - sh_out->dest_port = sh->src_port; - sh_out->v_tag = vtag; - sh_out->checksum = 0; - - ch = (struct sctp_chunkhdr *)((caddr_t)sh_out + sizeof(struct sctphdr)); - ch->chunk_type = SCTP_OPERATION_ERROR; - ch->chunk_flags = 0; - - if (scm) { - struct mbuf *m_tmp = scm; - int cause_len = 0; - - /* get length of the err_cause chain */ - while (m_tmp != NULL) { - cause_len += SCTP_BUF_LEN(m_tmp); - m_tmp = SCTP_BUF_NEXT(m_tmp); - } - len = SCTP_BUF_LEN(mout) + cause_len; - if (cause_len % 4) { - /* need pad at end of chunk */ - uint32_t cpthis = 0; - int padlen; - - padlen = 4 - (len % 4); - m_copyback(mout, len, padlen, (caddr_t)&cpthis); - len += padlen; - } - ch->chunk_length = htons(sizeof(struct sctp_chunkhdr) + cause_len); - } else { - len = SCTP_BUF_LEN(mout); - ch->chunk_length = htons(sizeof(struct sctp_chunkhdr)); - } - - if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { - /* no mbuf's */ - sctp_m_freem(mout); - return; - } -#ifdef INET - if (iph_out != NULL) { - sctp_route_t ro; - int ret; - - /* zap the stack pointer to the route */ - bzero(&ro, sizeof ro); - if (port) { - udp->uh_ulen = htons(len - sizeof(struct ip)); - if (V_udp_cksum) { - udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); - } else { - udp->uh_sum = 0; - } - } - /* set IPv4 length */ - iph_out->ip_len = len; - /* out it goes */ -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, len); -#endif - SCTP_ATTACH_CHAIN(o_pak, mout, len); - if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - sh_out->checksum = sctp_calculate_cksum(mout, iphlen_out); - SCTP_STAT_INCR(sctps_sendswcrc); -#endif - if (V_udp_cksum) { - SCTP_ENABLE_UDP_CSUM(o_pak); - } - } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - mout->m_pkthdr.csum_flags = CSUM_SCTP; - mout->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); -#endif - } - SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); - - /* Free the route if we got one back */ - if (ro.ro_rt) - RTFREE(ro.ro_rt); - } -#endif -#ifdef INET6 - if (ip6_out != NULL) { - int ret; - - if (port) { - udp->uh_ulen = htons(len - sizeof(struct ip6_hdr)); - } - ip6_out->ip6_plen = len - sizeof(*ip6_out); -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, len); -#endif - SCTP_ATTACH_CHAIN(o_pak, mout, len); - if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - sh_out->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); -#endif - if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) { - udp->uh_sum = 0xffff; - } - } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - mout->m_pkthdr.csum_flags = CSUM_SCTP; - mout->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); -#endif - } - SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); - } -#endif - SCTP_STAT_INCR(sctps_sendpackets); - SCTP_STAT_INCR_COUNTER64(sctps_outpackets); - SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); + sctp_send_resp_msg(m, sh, vtag, SCTP_OPERATION_ERROR, cause, vrf_id, port); + return; } static struct mbuf * Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Thu Mar 7 20:48:36 2013 (r247940) +++ stable/8/sys/netinet/sctp_output.h Thu Mar 7 21:08:19 2013 (r247941) @@ -204,7 +204,9 @@ void sctp_send_abort(struct mbuf *, int, struct sctphdr *, uint32_t, struct mbuf *, uint32_t, uint16_t); -void sctp_send_operr_to(struct mbuf *, int, struct mbuf *, uint32_t, uint32_t, uint16_t); +void +sctp_send_operr_to(struct mbuf *, struct sctphdr *, uint32_t, + struct mbuf *, uint32_t, uint16_t); #endif /* _KERNEL || __Userspace__ */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:10:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9ACAAD66; Thu, 7 Mar 2013 21:10:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2BA303; Thu, 7 Mar 2013 21:10:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LAoQx011122; Thu, 7 Mar 2013 21:10:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LAocV011121; Thu, 7 Mar 2013 21:10:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303072110.r27LAocV011121@svn.freebsd.org> From: Xin LI Date: Thu, 7 Mar 2013 21:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247942 - vendor-crypto/openssl/dist-0.9.8 X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:10:50 -0000 Author: delphij Date: Thu Mar 7 21:10:49 2013 New Revision: 247942 URL: http://svnweb.freebsd.org/changeset/base/247942 Log: Copy over r237653 to create new vendor branch for OpenSSL 0.9.8 maintenance. Added: vendor-crypto/openssl/dist-0.9.8/ - copied from r237653, vendor-crypto/openssl/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:11:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9968CECA; Thu, 7 Mar 2013 21:11:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BACB30D; Thu, 7 Mar 2013 21:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LBGSP011294; Thu, 7 Mar 2013 21:11:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LBGIq011293; Thu, 7 Mar 2013 21:11:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072111.r27LBGIq011293@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:11:16 +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: r247943 - stable/8/sys/netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:11:16 -0000 Author: tuexen Date: Thu Mar 7 21:11:16 2013 New Revision: 247943 URL: http://svnweb.freebsd.org/changeset/base/247943 Log: MFC r236958: Deliver IPV6_TCLASS, IPV6_HOPLIMIT and IPV6_PKTINFO cmsgs (if requested) on IPV6 sockets, which have been marked to be not IPV6_V6ONLY, for each received IPV4 packet. Modified: stable/8/sys/netinet6/ip6_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet6/ip6_input.c ============================================================================== --- stable/8/sys/netinet6/ip6_input.c Thu Mar 7 21:10:49 2013 (r247942) +++ stable/8/sys/netinet6/ip6_input.c Thu Mar 7 21:11:16 2013 (r247943) @@ -1236,19 +1236,28 @@ ip6_savecontrol_v4(struct inpcb *inp, st } #endif - if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { - if (v4only != NULL) - *v4only = 1; - return (mp); - } - #define IS2292(inp, x, y) (((inp)->inp_flags & IN6P_RFC2292) ? (x) : (y)) /* RFC 2292 sec. 5 */ if ((inp->inp_flags & IN6P_PKTINFO) != 0) { struct in6_pktinfo pi6; - bcopy(&ip6->ip6_dst, &pi6.ipi6_addr, sizeof(struct in6_addr)); - in6_clearscope(&pi6.ipi6_addr); /* XXX */ + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { +#ifdef INET + struct ip *ip; + + ip = mtod(m, struct ip *); + pi6.ipi6_addr.s6_addr32[0] = 0; + pi6.ipi6_addr.s6_addr32[1] = 0; + pi6.ipi6_addr.s6_addr32[2] = IPV6_ADDR_INT32_SMP; + pi6.ipi6_addr.s6_addr32[3] = ip->ip_dst.s_addr; +#else + /* We won't hit this code */ + bzero(&pi6.ipi6_addr, sizeof(struct in6_addr)); +#endif + } else { + bcopy(&ip6->ip6_dst, &pi6.ipi6_addr, sizeof(struct in6_addr)); + in6_clearscope(&pi6.ipi6_addr); /* XXX */ + } pi6.ipi6_ifindex = (m && m->m_pkthdr.rcvif) ? m->m_pkthdr.rcvif->if_index : 0; @@ -1260,8 +1269,21 @@ ip6_savecontrol_v4(struct inpcb *inp, st } if ((inp->inp_flags & IN6P_HOPLIMIT) != 0) { - int hlim = ip6->ip6_hlim & 0xff; + int hlim; + + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { +#ifdef INET + struct ip *ip; + ip = mtod(m, struct ip *); + hlim = ip->ip_ttl; +#else + /* We won't hit this code */ + hlim = 0; +#endif + } else { + hlim = ip6->ip6_hlim & 0xff; + } *mp = sbcreatecontrol((caddr_t) &hlim, sizeof(int), IS2292(inp, IPV6_2292HOPLIMIT, IPV6_HOPLIMIT), IPPROTO_IPV6); @@ -1269,8 +1291,40 @@ ip6_savecontrol_v4(struct inpcb *inp, st mp = &(*mp)->m_next; } - if (v4only != NULL) - *v4only = 0; + if ((inp->inp_flags & IN6P_TCLASS) != 0) { + int tclass; + + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { +#ifdef INET + struct ip *ip; + + ip = mtod(m, struct ip *); + tclass = ip->ip_tos; +#else + /* We won't hit this code */ + tclass = 0; +#endif + } else { + u_int32_t flowinfo; + + flowinfo = (u_int32_t)ntohl(ip6->ip6_flow & IPV6_FLOWINFO_MASK); + flowinfo >>= 20; + tclass = flowinfo & 0xff; + } + *mp = sbcreatecontrol((caddr_t) &tclass, sizeof(int), + IPV6_TCLASS, IPPROTO_IPV6); + if (*mp) + mp = &(*mp)->m_next; + } + + if (v4only != NULL) { + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { + *v4only = 1; + } else { + *v4only = 0; + } + } + return (mp); } @@ -1284,20 +1338,6 @@ ip6_savecontrol(struct inpcb *in6p, stru if (v4only) return; - if ((in6p->inp_flags & IN6P_TCLASS) != 0) { - u_int32_t flowinfo; - int tclass; - - flowinfo = (u_int32_t)ntohl(ip6->ip6_flow & IPV6_FLOWINFO_MASK); - flowinfo >>= 20; - - tclass = flowinfo & 0xff; - *mp = sbcreatecontrol((caddr_t) &tclass, sizeof(tclass), - IPV6_TCLASS, IPPROTO_IPV6); - if (*mp) - mp = &(*mp)->m_next; - } - /* * IPV6_HOPOPTS socket option. Recall that we required super-user * privilege for the option (see ip6_ctloutput), but it might be too From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:17:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D952F100; Thu, 7 Mar 2013 21:17:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0830339; Thu, 7 Mar 2013 21:17:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LHdGf012269; Thu, 7 Mar 2013 21:17:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LHcj4012260; Thu, 7 Mar 2013 21:17:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072117.r27LHcj4012260@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:17:38 +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: r247944 - in stable/8: lib/libc/net share/man/man4 sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:17:39 -0000 Author: tuexen Date: Thu Mar 7 21:17:37 2013 New Revision: 247944 URL: http://svnweb.freebsd.org/changeset/base/247944 Log: MFC r236959: Add a IP_RECVTOS socket option to receive for received UDP/IPv4 packets a cmsg of type IP_RECVTOS which contains the TOS byte. Much like IP_RECVTTL does for TTL. This allows to implement a protocol on top of UDP and implementing ECN. Modified: stable/8/lib/libc/net/sctp_sys_calls.c stable/8/share/man/man4/ip.4 stable/8/sys/netinet/in.h stable/8/sys/netinet/in_pcb.c stable/8/sys/netinet/in_pcb.h stable/8/sys/netinet/ip_input.c stable/8/sys/netinet/ip_output.c Directory Properties: stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) stable/8/share/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Thu Mar 7 21:11:16 2013 (r247943) +++ stable/8/lib/libc/net/sctp_sys_calls.c Thu Mar 7 21:17:37 2013 (r247944) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: stable/8/share/man/man4/ip.4 ============================================================================== --- stable/8/share/man/man4/ip.4 Thu Mar 7 21:11:16 2013 (r247943) +++ stable/8/share/man/man4/ip.4 Thu Mar 7 21:17:37 2013 (r247944) @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd June 1, 2009 +.Dd June 12, 2012 .Dt IP 4 .Os .Sh NAME @@ -165,7 +165,7 @@ The .Vt cmsghdr fields have the following values: .Bd -literal -cmsg_len = sizeof(struct in_addr) +cmsg_len = CMSG_LEN(sizeof(struct in_addr)) cmsg_level = IPPROTO_IP cmsg_type = IP_RECVDSTADDR .Ed @@ -184,7 +184,7 @@ structure followed by the address. The cmsghdr fields should have the following values: .Bd -literal -cmsg_len = sizeof(struct in_addr) +cmsg_len = CMSG_LEN(sizeof(struct in_addr)) cmsg_level = IPPROTO_IP cmsg_type = IP_SENDSRCADDR .Ed @@ -279,13 +279,36 @@ that contains a cmsghdr structure follow .Tn TTL . The cmsghdr fields have the following values: .Bd -literal -cmsg_len = sizeof(u_char) +cmsg_len = CMSG_LEN(sizeof(u_char)) cmsg_level = IPPROTO_IP cmsg_type = IP_RECVTTL .Ed .\" .Pp If the +.Dv IP_RECVTOS +option is enabled on a +.Dv SOCK_DGRAM +socket, the +.Xr recvmsg 2 +call will return the +.Tn IP +.Tn TOS +(type of service) field for a +.Tn UDP +datagram. +The msg_control field in the msghdr structure points to a buffer +that contains a cmsghdr structure followed by the +.Tn TOS . +The cmsghdr fields have the following values: +.Bd -literal +cmsg_len = CMSG_LEN(sizeof(u_char)) +cmsg_level = IPPROTO_IP +cmsg_type = IP_RECVTOS +.Ed +.\" +.Pp +If the .Dv IP_RECVIF option is enabled on a .Dv SOCK_DGRAM @@ -307,7 +330,7 @@ The .Vt cmsghdr fields have the following values: .Bd -literal -cmsg_len = sizeof(struct sockaddr_dl) +cmsg_len = CMSG_LEN(sizeof(struct sockaddr_dl)) cmsg_level = IPPROTO_IP cmsg_type = IP_RECVIF .Ed Modified: stable/8/sys/netinet/in.h ============================================================================== --- stable/8/sys/netinet/in.h Thu Mar 7 21:11:16 2013 (r247943) +++ stable/8/sys/netinet/in.h Thu Mar 7 21:17:37 2013 (r247944) @@ -477,6 +477,7 @@ __END_DECLS #define IP_RECVTTL 65 /* bool; receive IP TTL w/dgram */ #define IP_MINTTL 66 /* minimum TTL for packet or drop */ #define IP_DONTFRAG 67 /* don't fragment packet */ +#define IP_RECVTOS 68 /* bool; receive IP TOS w/dgram */ /* IPv4 Source Filter Multicast API [RFC3678] */ #define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ Modified: stable/8/sys/netinet/in_pcb.c ============================================================================== --- stable/8/sys/netinet/in_pcb.c Thu Mar 7 21:11:16 2013 (r247943) +++ stable/8/sys/netinet/in_pcb.c Thu Mar 7 21:17:37 2013 (r247944) @@ -1863,6 +1863,10 @@ db_print_inpflags(int inp_flags) db_printf("%sINP_DONTFRAG", comma ? ", " : ""); comma = 1; } + if (inp_flags & INP_RECVTOS) { + db_printf("%sINP_RECVTOS", comma ? ", " : ""); + comma = 1; + } if (inp_flags & IN6P_IPV6_V6ONLY) { db_printf("%sIN6P_IPV6_V6ONLY", comma ? ", " : ""); comma = 1; Modified: stable/8/sys/netinet/in_pcb.h ============================================================================== --- stable/8/sys/netinet/in_pcb.h Thu Mar 7 21:11:16 2013 (r247943) +++ stable/8/sys/netinet/in_pcb.h Thu Mar 7 21:17:37 2013 (r247944) @@ -413,6 +413,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_DONTFRAG 0x00000800 /* don't fragment packet */ #define INP_BINDANY 0x00001000 /* allow bind to any address */ #define INP_INHASHLIST 0x00002000 /* in_pcbinshash() has been called */ +#define INP_RECVTOS 0x00004000 /* receive incoming IP TOS */ #define IN6P_IPV6_V6ONLY 0x00008000 /* restrict AF_INET6 socket for v6 */ #define IN6P_PKTINFO 0x00010000 /* receive IP6 dst and I/F */ #define IN6P_HOPLIMIT 0x00020000 /* receive hoplimit */ @@ -432,7 +433,7 @@ void inp_4tuple_get(struct inpcb *inp, #define IN6P_MTU 0x80000000 /* receive path MTU */ #define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\ - INP_RECVIF|INP_RECVTTL|\ + INP_RECVIF|INP_RECVTTL|INP_RECVTOS|\ IN6P_PKTINFO|IN6P_HOPLIMIT|IN6P_HOPOPTS|\ IN6P_DSTOPTS|IN6P_RTHDR|IN6P_RTHDRDSTOPTS|\ IN6P_TCLASS|IN6P_AUTOFLOWLABEL|IN6P_RFC2292|\ Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Thu Mar 7 21:11:16 2013 (r247943) +++ stable/8/sys/netinet/ip_input.c Thu Mar 7 21:17:37 2013 (r247944) @@ -1711,6 +1711,12 @@ makedummy: if (*mp) mp = &(*mp)->m_next; } + if (inp->inp_flags & INP_RECVTOS) { + *mp = sbcreatecontrol((caddr_t) &ip->ip_tos, + sizeof(u_char), IP_RECVTOS, IPPROTO_IP); + if (*mp) + mp = &(*mp)->m_next; + } } /* Modified: stable/8/sys/netinet/ip_output.c ============================================================================== --- stable/8/sys/netinet/ip_output.c Thu Mar 7 21:11:16 2013 (r247943) +++ stable/8/sys/netinet/ip_output.c Thu Mar 7 21:17:37 2013 (r247944) @@ -956,6 +956,7 @@ ip_ctloutput(struct socket *so, struct s case IP_FAITH: case IP_ONESBCAST: case IP_DONTFRAG: + case IP_RECVTOS: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -1019,6 +1020,9 @@ ip_ctloutput(struct socket *so, struct s case IP_BINDANY: OPTSET(INP_BINDANY); break; + case IP_RECVTOS: + OPTSET(INP_RECVTOS); + break; } break; #undef OPTSET @@ -1128,6 +1132,7 @@ ip_ctloutput(struct socket *so, struct s case IP_ONESBCAST: case IP_DONTFRAG: case IP_BINDANY: + case IP_RECVTOS: switch (sopt->sopt_name) { case IP_TOS: @@ -1186,6 +1191,9 @@ ip_ctloutput(struct socket *so, struct s case IP_BINDANY: optval = OPTBIT(INP_BINDANY); break; + case IP_RECVTOS: + optval = OPTBIT(INP_RECVTOS); + break; } error = sooptcopyout(sopt, &optval, sizeof optval); break; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:22:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46EA8311; Thu, 7 Mar 2013 21:22:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21CF8365; Thu, 7 Mar 2013 21:22:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LM8YR014556; Thu, 7 Mar 2013 21:22:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LM86f014555; Thu, 7 Mar 2013 21:22:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072122.r27LM86f014555@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:22:07 +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: r247945 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:22:08 -0000 Author: tuexen Date: Thu Mar 7 21:22:07 2013 New Revision: 247945 URL: http://svnweb.freebsd.org/changeset/base/247945 Log: MFC r236961: Add a cmsg of type IP_TOS for UDP/IPv4 sockets to specify the TOS byte. Modified: stable/8/sys/netinet/udp_usrreq.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/udp_usrreq.c ============================================================================== --- stable/8/sys/netinet/udp_usrreq.c Thu Mar 7 21:17:37 2013 (r247944) +++ stable/8/sys/netinet/udp_usrreq.c Thu Mar 7 21:22:07 2013 (r247945) @@ -970,6 +970,7 @@ udp_output(struct inpcb *inp, struct mbu int ipflags; u_short fport, lport; int unlock_udbinfo; + u_char tos; /* * udp_output() may need to temporarily bind or connect the current @@ -985,6 +986,7 @@ udp_output(struct inpcb *inp, struct mbu } src.sin_family = 0; + tos = inp->inp_ip_tos; if (control != NULL) { /* * XXX: Currently, we assume all the optional information is @@ -1022,6 +1024,14 @@ udp_output(struct inpcb *inp, struct mbu *(struct in_addr *)CMSG_DATA(cm); break; + case IP_TOS: + if (cm->cmsg_len != CMSG_LEN(sizeof(u_char))) { + error = EINVAL; + break; + } + tos = *(u_char *)CMSG_DATA(cm); + break; + default: error = ENOPROTOOPT; break; @@ -1239,7 +1249,7 @@ udp_output(struct inpcb *inp, struct mbu ui->ui_sum = 0; ((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len; ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */ - ((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */ + ((struct ip *)ui)->ip_tos = tos; /* XXX */ UDPSTAT_INC(udps_opackets); if (unlock_udbinfo == 2) From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:24:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A78649E; Thu, 7 Mar 2013 21:24:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5014037E; Thu, 7 Mar 2013 21:24:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LOhQ7014946; Thu, 7 Mar 2013 21:24:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LOf17014937; Thu, 7 Mar 2013 21:24:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072124.r27LOf17014937@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:24:41 +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: r247946 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:24:43 -0000 Author: tuexen Date: Thu Mar 7 21:24:41 2013 New Revision: 247946 URL: http://svnweb.freebsd.org/changeset/base/247946 Log: MFC r237049: Pass flowid explicitly through the stack instead of taking it from the mbuf chain at different places. While there: Fix several bugs related to VRFs. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 21:22:07 2013 (r247945) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 21:24:41 2013 (r247946) @@ -2516,8 +2516,10 @@ doit_again: int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, - struct sctphdr *sh, struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, uint32_t * high_tsn) + struct sctphdr *sh, struct sctp_inpcb *inp, + struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_data_chunk *ch, chunk_buf; struct sctp_association *asoc; @@ -2625,7 +2627,9 @@ sctp_process_data(struct mbuf **mm, int } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; sctp_abort_association(inp, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, port); return (2); } #ifdef SCTP_AUDITING_ENABLED @@ -2689,7 +2693,11 @@ sctp_process_data(struct mbuf **mm, int struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_PROTOCOL_VIOLATION); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, 0, net->port); + sctp_abort_association(inp, stcb, + m, iphlen, + sh, op_err, + use_mflowid, mflowid, + vrf_id, port); return (2); } break; Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Thu Mar 7 21:22:07 2013 (r247945) +++ stable/8/sys/netinet/sctp_indata.h Thu Mar 7 21:24:41 2013 (r247946) @@ -113,7 +113,9 @@ void int sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint32_t *); + struct sctp_nets *, uint32_t *, + uint8_t, uint32_t, + uint32_t, uint16_t); void sctp_slide_mapping_arrays(struct sctp_tcb *stcb); Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:22:07 2013 (r247945) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:24:41 2013 (r247946) @@ -81,8 +81,10 @@ sctp_stop_all_cookie_timers(struct sctp_ /* INIT handler */ static void sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, - struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, - int *abort_no_unlock, uint32_t vrf_id, uint16_t port) + struct sctp_init_chunk *cp, struct sctp_inpcb *inp, + struct sctp_tcb *stcb, int *abort_no_unlock, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_init *init; struct mbuf *op_err; @@ -96,6 +98,7 @@ sctp_handle_init(struct mbuf *m, int iph if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -107,6 +110,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -116,6 +120,7 @@ sctp_handle_init(struct mbuf *m, int iph /* invalid parameter... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -125,6 +130,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -134,6 +140,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -142,7 +149,9 @@ sctp_handle_init(struct mbuf *m, int iph if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); + sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + use_mflowid, mflowid, + vrf_id, port); if (stcb) *abort_no_unlock = 1; goto outnow; @@ -169,7 +178,9 @@ sctp_handle_init(struct mbuf *m, int iph * state :-) */ if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); } goto outnow; } @@ -180,7 +191,9 @@ sctp_handle_init(struct mbuf *m, int iph sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } else { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, + use_mflowid, mflowid, + vrf_id, port, ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); } outnow: @@ -406,9 +419,11 @@ sctp_process_init(struct sctp_init_chunk * INIT-ACK message processing/consumption returns value < 0 on error */ static int -sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, - struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, - struct sctp_nets *net, int *abort_no_unlock, uint32_t vrf_id) +sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, + struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, + struct sctp_nets *net, int *abort_no_unlock, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id) { struct sctp_association *asoc; struct mbuf *op_err; @@ -445,8 +460,9 @@ sctp_process_init_ack(struct mbuf *m, in SCTPDBG(SCTP_DEBUG_INPUT1, "Load addresses from INIT causes an abort %d\n", retval); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - NULL, 0, net->port); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, NULL, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -520,7 +536,9 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, vrf_id, net->port); + sh, op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; } return (retval); @@ -1260,9 +1278,11 @@ sctp_handle_error(struct sctp_chunkhdr * } static int -sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, - struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, - struct sctp_nets *net, int *abort_no_unlock, uint32_t vrf_id) +sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, + struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, + struct sctp_nets *net, int *abort_no_unlock, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id) { struct sctp_init_ack *init_ack; struct mbuf *op_err; @@ -1279,7 +1299,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1289,7 +1311,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1297,7 +1321,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1305,7 +1331,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1313,7 +1341,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1336,7 +1366,9 @@ sctp_handle_init_ack(struct mbuf *m, int stcb, 0, (void *)stcb->asoc.primary_destination, SCTP_SO_NOT_LOCKED); } if (sctp_process_init_ack(m, iphlen, offset, sh, cp, stcb, - net, abort_no_unlock, vrf_id) < 0) { + net, abort_no_unlock, + use_mflowid, mflowid, + vrf_id) < 0) { /* error in parsing parameters */ return (-1); } @@ -1391,6 +1423,7 @@ sctp_process_cookie_new(struct mbuf *m, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port); @@ -1405,7 +1438,9 @@ sctp_process_cookie_existing(struct mbuf struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, - uint32_t vrf_id, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, uint16_t port) + int auth_skipped, uint32_t auth_offset, uint32_t auth_len, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_association *asoc; struct sctp_init_chunk *init_cp, init_buf; @@ -1443,6 +1478,7 @@ sctp_process_cookie_existing(struct mbuf ph->param_type = htons(SCTP_CAUSE_COOKIE_IN_SHUTDOWN); ph->param_length = htons(sizeof(struct sctp_paramhdr)); sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + use_mflowid, mflowid, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 2; @@ -1667,7 +1703,9 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_NAT_COLLIDING_STATE); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, op_err, + use_mflowid, mflowid, + vrf_id, port); return (NULL); } if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && @@ -1832,6 +1870,7 @@ sctp_process_cookie_existing(struct mbuf return (sctp_process_cookie_new(m, iphlen, offset, sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, + use_mflowid, mflowid, vrf_id, port)); } /* @@ -1962,12 +2001,13 @@ sctp_process_cookie_existing(struct mbuf * cookie-echo chunk length: length of the cookie chunk to: where the init * was from returns a new TCB */ -struct sctp_tcb * +static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_tcb *stcb; @@ -2062,7 +2102,9 @@ sctp_process_cookie_new(struct mbuf *m, op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, vrf_id, port); + sh, op_err, + use_mflowid, mflowid, + vrf_id, port); return (NULL); } /* get the correct sctp_nets */ @@ -2088,7 +2130,9 @@ sctp_process_cookie_new(struct mbuf *m, atomic_add_int(&stcb->asoc.refcnt, 1); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, vrf_id, port); + sh, op_err, + use_mflowid, mflowid, + vrf_id, port); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -2335,7 +2379,9 @@ sctp_handle_cookie_echo(struct mbuf *m, struct sctphdr *sh, struct sctp_cookie_echo_chunk *cp, struct sctp_inpcb **inp_p, struct sctp_tcb **stcb, struct sctp_nets **netp, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, - struct sctp_tcb **locked_tcb, uint32_t vrf_id, uint16_t port) + struct sctp_tcb **locked_tcb, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_state_cookie *cookie; struct sctp_tcb *l_stcb = *stcb; @@ -2571,6 +2617,7 @@ sctp_handle_cookie_echo(struct mbuf *m, tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + use_mflowid, mflowid, vrf_id, port); return (NULL); } @@ -2658,21 +2705,25 @@ sctp_handle_cookie_echo(struct mbuf *m, /* this is the "normal" case... get a new TCB */ *stcb = sctp_process_cookie_new(m, iphlen, offset, sh, cookie, cookie_len, *inp_p, netp, to, ¬ification, - auth_skipped, auth_offset, auth_len, vrf_id, port); + auth_skipped, auth_offset, auth_len, + use_mflowid, mflowid, + vrf_id, port); } else { /* this is abnormal... cookie-echo on existing TCB */ had_a_existing_tcb = 1; *stcb = sctp_process_cookie_existing(m, iphlen, offset, sh, cookie, cookie_len, *inp_p, *stcb, netp, to, - ¬ification, vrf_id, auth_skipped, auth_offset, auth_len, port); + ¬ification, auth_skipped, auth_offset, auth_len, + use_mflowid, mflowid, + vrf_id, port); } if (*stcb == NULL) { /* still no TCB... must be bad cookie-echo */ return (NULL); } - if ((*netp != NULL) && (m->m_flags & M_FLOWID)) { - (*netp)->flowid = m->m_pkthdr.flowid; + if ((*netp != NULL) && (use_mflowid != 0)) { + (*netp)->flowid = mflowid; #ifdef INVARIANTS (*netp)->flowidset = 1; #endif @@ -2745,7 +2796,9 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: no room for another socket!\n"); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(*inp_p, NULL, m, iphlen, - sh, op_err, vrf_id, port); + sh, op_err, + use_mflowid, mflowid, + vrf_id, port); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) pcb_so = SCTP_INP_SO(*inp_p); atomic_add_int(&(*stcb)->asoc.refcnt, 1); @@ -4361,6 +4414,7 @@ __attribute__((noinline)) sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_association *asoc; @@ -4517,6 +4571,7 @@ __attribute__((noinline)) if (stcb == NULL) { /* no association, so it's out of the blue... */ sctp_handle_ootb(m, iphlen, *offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); *offset = length; if (locked_tcb) { @@ -4554,6 +4609,7 @@ __attribute__((noinline)) SCTP_TCB_UNLOCK(locked_tcb); } sctp_handle_ootb(m, iphlen, *offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); return (NULL); } @@ -4695,7 +4751,9 @@ process_control_chunks: if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { sctp_abort_association(inp, stcb, m, - iphlen, sh, NULL, vrf_id, port); + iphlen, sh, NULL, + use_mflowid, mflowid, + vrf_id, port); *offset = length; return (NULL); } @@ -4705,13 +4763,17 @@ process_control_chunks: op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, vrf_id, port); + iphlen, sh, op_err, + use_mflowid, mflowid, + vrf_id, port); *offset = length; return (NULL); } sctp_handle_init(m, iphlen, *offset, sh, (struct sctp_init_chunk *)ch, inp, - stcb, &abort_no_unlock, vrf_id, port); + stcb, &abort_no_unlock, + use_mflowid, mflowid, + vrf_id, port); *offset = length; if ((!abort_no_unlock) && (locked_tcb)) { SCTP_TCB_UNLOCK(locked_tcb); @@ -4760,7 +4822,11 @@ process_control_chunks: } if ((netp) && (*netp)) { ret = sctp_handle_init_ack(m, iphlen, *offset, sh, - (struct sctp_init_ack_chunk *)ch, stcb, *netp, &abort_no_unlock, vrf_id); + (struct sctp_init_ack_chunk *)ch, + stcb, *netp, + &abort_no_unlock, + use_mflowid, mflowid, + vrf_id); } else { ret = -1; } @@ -5066,7 +5132,9 @@ process_control_chunks: op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, vrf_id, port); + iphlen, sh, op_err, + use_mflowid, mflowid, + vrf_id, port); } *offset = length; return (NULL); @@ -5098,6 +5166,8 @@ process_control_chunks: auth_offset, auth_len, &locked_tcb, + use_mflowid, + mflowid, vrf_id, port); } else { @@ -5550,8 +5620,10 @@ __attribute__((noinline)) void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, - struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, - uint8_t ecn_bits, uint32_t vrf_id, uint16_t port) + struct sctp_inpcb *inp, struct sctp_tcb *stcb, + struct sctp_nets *net, uint8_t ecn_bits, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { /* * Control chunk processing @@ -5587,6 +5659,7 @@ sctp_common_input_processing(struct mbuf */ SCTP_TCB_UNLOCK(stcb); sctp_handle_ootb(m, iphlen, offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); goto out_now; } @@ -5595,7 +5668,9 @@ sctp_common_input_processing(struct mbuf /* process the control portion of the SCTP packet */ /* sa_ignore NO_NULL_CHK */ stcb = sctp_process_control(m, iphlen, &offset, length, sh, ch, - inp, stcb, &net, &fwd_tsn_seen, vrf_id, port); + inp, stcb, &net, &fwd_tsn_seen, + use_mflowid, mflowid, + vrf_id, port); if (stcb) { /* * This covers us if the cookie-echo was there and @@ -5631,6 +5706,7 @@ sctp_common_input_processing(struct mbuf if (stcb == NULL) { /* out of the blue DATA chunk */ sctp_handle_ootb(m, iphlen, offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); goto out_now; } @@ -5700,6 +5776,7 @@ sctp_common_input_processing(struct mbuf * We consider OOTB any data sent during asoc setup. */ sctp_handle_ootb(m, iphlen, offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); SCTP_TCB_UNLOCK(stcb); goto out_now; @@ -5720,7 +5797,9 @@ sctp_common_input_processing(struct mbuf } /* plow through the data chunks while length > offset */ retval = sctp_process_data(mm, iphlen, &offset, length, sh, - inp, stcb, net, &high_tsn); + inp, stcb, net, &high_tsn, + use_mflowid, mflowid, + vrf_id, port); if (retval == 2) { /* * The association aborted, NO UNLOCK needed since @@ -5820,6 +5899,8 @@ sctp_input_with_port(struct mbuf *i_pak, struct sctp_chunkhdr *ch; int refcount_up = 0; int length, mlen, offset; + uint32_t mflowid; + uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) uint32_t check, calc_check; @@ -5855,6 +5936,13 @@ sctp_input_with_port(struct mbuf *i_pak, if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) sctp_packet_log(m, mlen); #endif + if (m->m_flags & M_FLOWID) { + mflowid = m->m_pkthdr.flowid; + use_mflowid = 1; + } else { + mflowid = 0; + use_mflowid = 0; + } /* * Must take out the iphlen, since mlen expects this (only effect lb * case) @@ -5926,8 +6014,8 @@ sctp_input_with_port(struct mbuf *i_pak, } net->port = port; } - if ((net != NULL) && (m->m_flags & M_FLOWID)) { - net->flowid = m->m_pkthdr.flowid; + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; #ifdef INVARIANTS net->flowidset = 1; #endif @@ -5961,8 +6049,8 @@ sctp_skip_csum_4: } net->port = port; } - if ((net != NULL) && (m->m_flags & M_FLOWID)) { - net->flowid = m->m_pkthdr.flowid; + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; #ifdef INVARIANTS net->flowidset = 1; #endif @@ -5996,7 +6084,9 @@ sctp_skip_csum_4: sh->v_tag = init_chk->init.initiate_tag; } if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2(m, sh, vrf_id, port); + sctp_send_shutdown_complete2(m, sh, + use_mflowid, mflowid, + vrf_id, port); goto bad; } if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { @@ -6006,7 +6096,9 @@ sctp_skip_csum_4: if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); } } goto bad; @@ -6035,7 +6127,9 @@ sctp_skip_csum_4: /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - inp, stcb, net, ecn_bits, vrf_id, port); + inp, stcb, net, ecn_bits, + use_mflowid, mflowid, + vrf_id, port); /* inp's ref-count reduced && stcb unlocked */ if (m) { sctp_m_freem(m); Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Thu Mar 7 21:22:07 2013 (r247945) +++ stable/8/sys/netinet/sctp_input.h Thu Mar 7 21:24:41 2013 (r247946) @@ -39,8 +39,11 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) void sctp_common_input_processing(struct mbuf **, int, int, int, - struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb *, - struct sctp_tcb *, struct sctp_nets *, uint8_t, uint32_t, uint16_t); + struct sctphdr *, struct sctp_chunkhdr *, + struct sctp_inpcb *, struct sctp_tcb *, + struct sctp_nets *, uint8_t, + uint8_t, uint32_t, + uint32_t, uint16_t); struct sctp_stream_reset_out_request * sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:22:07 2013 (r247945) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:24:41 2013 (r247946) @@ -3859,13 +3859,13 @@ sctp_lowlevel_chunk_output(struct sctp_i uint16_t dest_port, uint32_t v_tag, uint16_t port, + union sctp_sockstore *over_addr, + uint8_t use_mflowid, uint32_t mflowid, #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) - int so_locked SCTP_UNUSED, + int so_locked SCTP_UNUSED #else - int so_locked, + int so_locked #endif - union sctp_sockstore *over_addr, - struct mbuf *init ) /* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { @@ -3951,8 +3951,8 @@ sctp_lowlevel_chunk_output(struct sctp_i m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { - if ((init != NULL) && (init->m_flags & M_FLOWID)) { - m->m_pkthdr.flowid = init->m_pkthdr.flowid; + if (use_mflowid != 0) { + m->m_pkthdr.flowid = mflowid; m->m_flags |= M_FLOWID; } } @@ -4243,8 +4243,8 @@ sctp_lowlevel_chunk_output(struct sctp_i m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { - if ((init != NULL) && (init->m_flags & M_FLOWID)) { - m->m_pkthdr.flowid = init->m_pkthdr.flowid; + if (use_mflowid != 0) { + m->m_pkthdr.flowid = mflowid; m->m_flags |= M_FLOWID; } } @@ -4841,7 +4841,9 @@ sctp_send_initiate(struct sctp_inpcb *in (struct sockaddr *)&net->ro._l_addr, m, 0, NULL, 0, 0, 0, 0, inp->sctp_lport, stcb->rport, htonl(0), - net->port, so_locked, NULL, NULL); + net->port, NULL, + 0, 0, + so_locked); SCTPDBG(SCTP_DEBUG_OUTPUT4, "lowlevel_output - %d\n", ret); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); @@ -5370,8 +5372,10 @@ sctp_are_there_new_addresses(struct sctp */ void sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct mbuf *init_pkt, int iphlen, int offset, struct sctphdr *sh, - struct sctp_init_chunk *init_chk, uint32_t vrf_id, uint16_t port, int hold_inp_lock) + struct mbuf *init_pkt, int iphlen, int offset, + struct sctphdr *sh, struct sctp_init_chunk *init_chk, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port, int hold_inp_lock) { struct sctp_association *asoc; struct mbuf *m, *m_at, *m_tmp, *m_cookie, *op_err, *mp_last; @@ -5422,7 +5426,9 @@ sctp_send_initiate_ack(struct sctp_inpcb * though we even set the T bit and copy in the 0 tag.. this * looks no different than if no listener was present. */ - sctp_send_abort(init_pkt, iphlen, sh, 0, NULL, vrf_id, port); + sctp_send_abort(init_pkt, iphlen, sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); return; } abort_flag = 0; @@ -5432,7 +5438,9 @@ sctp_send_initiate_ack(struct sctp_inpcb if (abort_flag) { do_a_abort: sctp_send_abort(init_pkt, iphlen, sh, - init_chk->init.initiate_tag, op_err, vrf_id, port); + init_chk->init.initiate_tag, op_err, + use_mflowid, mflowid, + vrf_id, port); return; } m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); @@ -6034,7 +6042,9 @@ do_a_abort: (void)sctp_lowlevel_chunk_output(inp, NULL, NULL, to, m, 0, NULL, 0, 0, 0, 0, inp->sctp_lport, sh->src_port, init_chk->init.initiate_tag, - port, SCTP_SO_NOT_LOCKED, over_addr, init_pkt); + port, over_addr, + use_mflowid, mflowid, + SCTP_SO_NOT_LOCKED); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -8116,7 +8126,9 @@ again_one_more_time: no_fragmentflg, 0, asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL, NULL))) { + net->port, NULL, + 0, 0, + so_locked))) { if (error == ENOBUFS) { asoc->ifp_had_enobuf = 1; SCTP_STAT_INCR(sctps_lowlevelerr); @@ -8388,7 +8400,9 @@ again_one_more_time: no_fragmentflg, 0, asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL, NULL))) { + net->port, NULL, + 0, 0, + so_locked))) { if (error == ENOBUFS) { asoc->ifp_had_enobuf = 1; SCTP_STAT_INCR(sctps_lowlevelerr); @@ -8727,7 +8741,9 @@ no_data_fill: asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL, NULL))) { + net->port, NULL, + 0, 0, + so_locked))) { /* error, we could not output */ if (error == ENOBUFS) { SCTP_STAT_INCR(sctps_lowlevelerr); @@ -9429,7 +9445,9 @@ sctp_chunk_retransmission(struct sctp_in auth_offset, auth, stcb->asoc.authinfo.active_keyid, no_fragmentflg, 0, 0, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - chk->whoTo->port, so_locked, NULL, NULL))) { + chk->whoTo->port, NULL, + 0, 0, + so_locked))) { SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } @@ -9694,7 +9712,9 @@ one_chunk_around: auth_offset, auth, auth_keyid, no_fragmentflg, 0, 0, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL, NULL))) { + net->port, NULL, + 0, 0, + so_locked))) { /* error, we could not output */ SCTP_STAT_INCR(sctps_lowlevelerr); return (error); @@ -10812,7 +10832,9 @@ sctp_send_abort_tcb(struct sctp_tcb *stc (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - stcb->asoc.primary_destination->port, so_locked, NULL, NULL); + stcb->asoc.primary_destination->port, NULL, + 0, 0, + so_locked); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -10849,14 +10871,18 @@ sctp_send_shutdown_complete(struct sctp_ m_shutdown_comp, 0, NULL, 0, 1, 0, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), - net->port, SCTP_SO_NOT_LOCKED, NULL, NULL); + net->port, NULL, + 0, 0, + SCTP_SO_NOT_LOCKED); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; } static void sctp_send_resp_msg(struct mbuf *m, struct sctphdr *sh, uint32_t vtag, - uint8_t type, struct mbuf *cause, uint32_t vrf_id, uint16_t port) + uint8_t type, struct mbuf *cause, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct mbuf *o_pak; struct mbuf *mout; @@ -10929,8 +10955,8 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = cause; - if (m->m_flags & M_FLOWID) { - mout->m_pkthdr.flowid = m->m_pkthdr.flowid; + if (use_mflowid != 0) { + mout->m_pkthdr.flowid = mflowid; mout->m_flags |= M_FLOWID; } #ifdef INET @@ -11110,9 +11136,12 @@ sctp_send_resp_msg(struct mbuf *m, struc void sctp_send_shutdown_complete2(struct mbuf *m, struct sctphdr *sh, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { - sctp_send_resp_msg(m, sh, 0, SCTP_SHUTDOWN_COMPLETE, NULL, vrf_id, port); + sctp_send_resp_msg(m, sh, 0, SCTP_SHUTDOWN_COMPLETE, NULL, + use_mflowid, mflowid, + vrf_id, port); } void @@ -11944,7 +11973,9 @@ skip_stuff: void sctp_send_abort(struct mbuf *m, int iphlen, struct sctphdr *sh, uint32_t vtag, - struct mbuf *cause, uint32_t vrf_id, uint16_t port) + struct mbuf *cause, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { /* Don't respond to an ABORT with an ABORT. */ if (sctp_is_there_an_abort_here(m, iphlen, &vtag)) { @@ -11952,15 +11983,21 @@ sctp_send_abort(struct mbuf *m, int iphl sctp_m_freem(cause); return; } - sctp_send_resp_msg(m, sh, vtag, SCTP_ABORT_ASSOCIATION, cause, vrf_id, port); + sctp_send_resp_msg(m, sh, vtag, SCTP_ABORT_ASSOCIATION, cause, + use_mflowid, mflowid, + vrf_id, port); return; } void sctp_send_operr_to(struct mbuf *m, struct sctphdr *sh, uint32_t vtag, - struct mbuf *cause, uint32_t vrf_id, uint16_t port) + struct mbuf *cause, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { - sctp_send_resp_msg(m, sh, vtag, SCTP_OPERATION_ERROR, cause, vrf_id, port); + sctp_send_resp_msg(m, sh, vtag, SCTP_OPERATION_ERROR, cause, + use_mflowid, mflowid, + vrf_id, port); return; } Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Thu Mar 7 21:22:07 2013 (r247945) +++ stable/8/sys/netinet/sctp_output.h Thu Mar 7 21:24:41 2013 (r247946) @@ -83,8 +83,9 @@ sctp_send_initiate(struct sctp_inpcb *, ); void -sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, - struct mbuf *, int, int, struct sctphdr *, struct sctp_init_chunk *, +sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, struct mbuf *, + int, int, struct sctphdr *, struct sctp_init_chunk *, + uint8_t, uint32_t, uint32_t, uint16_t, int); struct mbuf * @@ -116,6 +117,7 @@ void sctp_send_shutdown_complete(struct void sctp_send_shutdown_complete2(struct mbuf *, struct sctphdr *, + uint8_t, uint32_t, uint32_t, uint16_t); void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked); @@ -202,15 +204,19 @@ sctp_send_str_reset_req(struct sctp_tcb void sctp_send_abort(struct mbuf *, int, struct sctphdr *, uint32_t, - struct mbuf *, uint32_t, uint16_t); + struct mbuf *, + uint8_t, uint32_t, + uint32_t, uint16_t); void sctp_send_operr_to(struct mbuf *, struct sctphdr *, uint32_t, - struct mbuf *, uint32_t, uint16_t); + struct mbuf *, + uint8_t, uint32_t, + uint32_t, uint16_t); #endif /* _KERNEL || __Userspace__ */ -#if defined(_KERNEL) || defined (__Userspace__) +#if defined(_KERNEL) || defined(__Userspace__) int sctp_sosend(struct socket *so, struct sockaddr *addr, Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 21:22:07 2013 (r247945) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 21:24:41 2013 (r247946) @@ -3823,7 +3823,9 @@ sctp_abort_notification(struct sctp_tcb void sctp_abort_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct mbuf *m, int iphlen, struct sctphdr *sh, struct mbuf *op_err, + struct mbuf *m, int iphlen, struct sctphdr *sh, + struct mbuf *op_err, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { uint32_t vtag; @@ -3842,7 +3844,9 @@ sctp_abort_association(struct sctp_inpcb vrf_id = stcb->asoc.vrf_id; stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } - sctp_send_abort(m, iphlen, sh, vtag, op_err, vrf_id, port); + sctp_send_abort(m, iphlen, sh, vtag, op_err, + use_mflowid, mflowid, + vrf_id, port); if (stcb != NULL) { /* Ok, now lets free it */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -3992,7 +3996,9 @@ sctp_abort_an_association(struct sctp_in void sctp_handle_ootb(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, - struct sctp_inpcb *inp, uint32_t vrf_id, uint16_t port) + struct sctp_inpcb *inp, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_chunkhdr *ch, chunk_buf; unsigned int chk_length; @@ -4035,7 +4041,9 @@ sctp_handle_ootb(struct mbuf *m, int iph */ return; case SCTP_SHUTDOWN_ACK: - sctp_send_shutdown_complete2(m, sh, vrf_id, port); + sctp_send_shutdown_complete2(m, sh, + use_mflowid, mflowid, + vrf_id, port); return; default: break; @@ -4047,7 +4055,9 @@ sctp_handle_ootb(struct mbuf *m, int iph if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (contains_init_chunk == 0))) { - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); } } Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Thu Mar 7 21:22:07 2013 (r247945) +++ stable/8/sys/netinet/sctputil.h Thu Mar 7 21:24:41 2013 (r247946) @@ -185,8 +185,10 @@ sctp_abort_notification(struct sctp_tcb /* We abort responding to an IP packet for some reason */ void -sctp_abort_association(struct sctp_inpcb *, struct sctp_tcb *, - struct mbuf *, int, struct sctphdr *, struct mbuf *, uint32_t, uint16_t); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:27:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0F3936B7; Thu, 7 Mar 2013 21:27:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E709239C; Thu, 7 Mar 2013 21:27:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LRF6L015350; Thu, 7 Mar 2013 21:27:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LRFUl015349; Thu, 7 Mar 2013 21:27:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072127.r27LRFUl015349@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247947 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:27:16 -0000 Author: tuexen Date: Thu Mar 7 21:27:15 2013 New Revision: 247947 URL: http://svnweb.freebsd.org/changeset/base/247947 Log: MFC r237229: Cleanup the UDP decapsulation code. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 21:24:41 2013 (r247946) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 21:27:15 2013 (r247947) @@ -6837,83 +6837,61 @@ sctp_recv_udp_tunneled_packet(struct mbu struct ip *iph; struct mbuf *sp, *last; struct udphdr *uhdr; - uint16_t port = 0; - int header_size = sizeof(struct udphdr) + sizeof(struct sctphdr); + uint16_t port; - /* - * Split out the mbuf chain. Leave the IP header in m, place the - * rest in the sp. - */ if ((m->m_flags & M_PKTHDR) == 0) { /* Can't handle one that is not a pkt hdr */ goto out; } - /* pull the src port */ + /* Pull the src port */ iph = mtod(m, struct ip *); uhdr = (struct udphdr *)((caddr_t)iph + off); - port = uhdr->uh_sport; + /* + * Split out the mbuf chain. Leave the IP header in m, place the + * rest in the sp. + */ sp = m_split(m, off, M_DONTWAIT); if (sp == NULL) { /* Gak, drop packet, we can't do a split */ goto out; } - if (sp->m_pkthdr.len < header_size) { - /* Gak, packet can't have an SCTP header in it - to small */ + if (sp->m_pkthdr.len < sizeof(struct udphdr) + sizeof(struct sctphdr)) { + /* Gak, packet can't have an SCTP header in it - too small */ m_freem(sp); goto out; } - /* ok now pull up the UDP header and SCTP header together */ - sp = m_pullup(sp, header_size); + /* Now pull up the UDP header and SCTP header together */ + sp = m_pullup(sp, sizeof(struct udphdr) + sizeof(struct sctphdr)); if (sp == NULL) { /* Gak pullup failed */ goto out; } - /* trim out the UDP header */ + /* Trim out the UDP header */ m_adj(sp, sizeof(struct udphdr)); /* Now reconstruct the mbuf chain */ - /* 1) find last one */ - last = m; - while (last->m_next != NULL) { - last = last->m_next; - } + for (last = m; last->m_next; last = last->m_next); last->m_next = sp; m->m_pkthdr.len += sp->m_pkthdr.len; - last = m; - while (last != NULL) { - last = last->m_next; - } - /* Now its ready for sctp_input or sctp6_input */ iph = mtod(m, struct ip *); switch (iph->ip_v) { #ifdef INET case IPVERSION: - { - uint16_t len; - - /* its IPv4 */ - len = SCTP_GET_IPV4_LENGTH(iph); - len -= sizeof(struct udphdr); - SCTP_GET_IPV4_LENGTH(iph) = len; - sctp_input_with_port(m, off, port); - break; - } + iph->ip_len -= sizeof(struct udphdr); + sctp_input_with_port(m, off, port); + break; #endif #ifdef INET6 case IPV6_VERSION >> 4: - { - /* its IPv6 - NOT supported */ - goto out; - break; + /* Not yet supported. */ + goto out; + break; - } #endif default: - { - m_freem(m); - break; - } + goto out; + break; } return; out: From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:29:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E731855; Thu, 7 Mar 2013 21:29:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 379CB3D4; Thu, 7 Mar 2013 21:29:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LThZJ015714; Thu, 7 Mar 2013 21:29:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LTgnf015709; Thu, 7 Mar 2013 21:29:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072129.r27LTgnf015709@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:29:42 +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: r247948 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:29:43 -0000 Author: tuexen Date: Thu Mar 7 21:29:42 2013 New Revision: 247948 URL: http://svnweb.freebsd.org/changeset/base/247948 Log: MFC r237230: Add rate limitation for SCTP OOTB responses. Modified: stable/8/sys/netinet/icmp_var.h stable/8/sys/netinet/ip_icmp.c stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/icmp_var.h ============================================================================== --- stable/8/sys/netinet/icmp_var.h Thu Mar 7 21:27:15 2013 (r247947) +++ stable/8/sys/netinet/icmp_var.h Thu Mar 7 21:29:42 2013 (r247948) @@ -102,7 +102,8 @@ extern int badport_bandlim(int); #define BANDLIM_RST_CLOSEDPORT 3 /* No connection, and no listeners */ #define BANDLIM_RST_OPENPORT 4 /* No connection, listener */ #define BANDLIM_ICMP6_UNREACH 5 -#define BANDLIM_MAX 5 +#define BANDLIM_SCTP_OOTB 6 +#define BANDLIM_MAX 6 #endif #endif Modified: stable/8/sys/netinet/ip_icmp.c ============================================================================== --- stable/8/sys/netinet/ip_icmp.c Thu Mar 7 21:27:15 2013 (r247947) +++ stable/8/sys/netinet/ip_icmp.c Thu Mar 7 21:29:42 2013 (r247948) @@ -987,7 +987,8 @@ badport_bandlim(int which) { "icmp tstamp response" }, { "closed port RST response" }, { "open port RST response" }, - { "icmp6 unreach response" } + { "icmp6 unreach response" }, + { "sctp ootb response" } }; /* Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:27:15 2013 (r247947) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:29:42 2013 (r247948) @@ -6060,15 +6060,8 @@ sctp_skip_csum_4: struct sctp_init_chunk *init_chk, chunk_buf; SCTP_STAT_INCR(sctps_noport); -#ifdef ICMP_BANDLIM - /* - * we use the bandwidth limiting to protect against sending - * too many ABORTS all at once. In this case these count the - * same as an ICMP message. - */ - if (badport_bandlim(0) < 0) + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; -#endif /* ICMP_BANDLIM */ SCTPDBG(SCTP_DEBUG_INPUT1, "Sending a ABORT from packet entry!\n"); if (ch->chunk_type == SCTP_INITIATION) { From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:31:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6EEB39D9; Thu, 7 Mar 2013 21:31:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A0B63E9; Thu, 7 Mar 2013 21:31:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LVki0017651; Thu, 7 Mar 2013 21:31:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LVk9x017650; Thu, 7 Mar 2013 21:31:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072131.r27LVk9x017650@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:31:46 +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: r247949 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:31:46 -0000 Author: tuexen Date: Thu Mar 7 21:31:45 2013 New Revision: 247949 URL: http://svnweb.freebsd.org/changeset/base/247949 Log: MFC r237392: Remove redundant #ifdef. Reported by gnn@. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 21:29:42 2013 (r247948) +++ stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 21:31:45 2013 (r247949) @@ -6444,7 +6444,6 @@ sctp_peeraddr(struct socket *so, struct return (0); } -#ifdef INET struct pr_usrreqs sctp_usrreqs = { .pru_abort = sctp_abort, .pru_accept = sctp_accept, @@ -6467,4 +6466,3 @@ struct pr_usrreqs sctp_usrreqs = { }; #endif -#endif From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:34:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E09A6B5B; Thu, 7 Mar 2013 21:34:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D2426400; Thu, 7 Mar 2013 21:34:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LY532018045; Thu, 7 Mar 2013 21:34:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LY4ok018038; Thu, 7 Mar 2013 21:34:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072134.r27LY4ok018038@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:34:04 +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: r247950 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:34:06 -0000 Author: tuexen Date: Thu Mar 7 21:34:04 2013 New Revision: 247950 URL: http://svnweb.freebsd.org/changeset/base/247950 Log: MFC r237540: Do packet logging in a consistent way. Modified: stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_bsd_addr.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Thu Mar 7 21:31:45 2013 (r247949) +++ stable/8/sys/netinet/sctp_bsd_addr.c Thu Mar 7 21:34:04 2013 (r247950) @@ -422,11 +422,12 @@ sctp_get_mbuf_for_msg(unsigned int space #ifdef SCTP_PACKET_LOGGING void -sctp_packet_log(struct mbuf *m, int length) +sctp_packet_log(struct mbuf *m) { int *lenat, thisone; void *copyto; uint32_t *tick_tock; + int length; int total_len; int grabbed_lock = 0; int value, newval, thisend, thisbegin; @@ -436,6 +437,7 @@ sctp_packet_log(struct mbuf *m, int leng * (value) -ticks of log (ticks) o -ip packet o -as logged - * where this started (thisbegin) x <--end points here */ + length = SCTP_HEADER_LEN(m); total_len = SCTP_SIZE32((length + (4 * sizeof(int)))); /* Log a packet to the buffer. */ if (total_len > SCTP_PACKET_LOG_SIZE) { Modified: stable/8/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.h Thu Mar 7 21:31:45 2013 (r247949) +++ stable/8/sys/netinet/sctp_bsd_addr.h Thu Mar 7 21:34:04 2013 (r247950) @@ -53,7 +53,7 @@ void sctp_gather_internal_ifa_flags(stru #ifdef SCTP_PACKET_LOGGING -void sctp_packet_log(struct mbuf *m, int length); +void sctp_packet_log(struct mbuf *m); int sctp_copy_out_packet_log(uint8_t * target, int length); #endif Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:31:45 2013 (r247949) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:34:04 2013 (r247950) @@ -5932,9 +5932,9 @@ sctp_input_with_port(struct mbuf *i_pak, } } #endif -#ifdef SCTP_PACKET_LOGGING +#ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, mlen); + sctp_packet_log(m); #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Thu Mar 7 21:31:45 2013 (r247949) +++ stable/8/sys/netinet/sctp_os_bsd.h Thu Mar 7 21:34:04 2013 (r247950) @@ -365,7 +365,7 @@ typedef struct callout sctp_os_timer_t; */ #define SCTP_HEADER_TO_CHAIN(m) (m) #define SCTP_DETACH_HEADER_FROM_CHAIN(m) -#define SCTP_HEADER_LEN(m) (m->m_pkthdr.len) +#define SCTP_HEADER_LEN(m) ((m)->m_pkthdr.len) #define SCTP_GET_HEADER_FOR_OUTPUT(o_pak) 0 #define SCTP_RELEASE_HEADER(m) #define SCTP_RELEASE_PKT(m) sctp_m_freem(m) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:31:45 2013 (r247949) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:34:04 2013 (r247950) @@ -4107,10 +4107,6 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_m_freem(m); return (ENOMEM); } -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, packet_length); -#endif SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -4131,6 +4127,10 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + sctp_packet_log(o_pak); +#endif /* send it out. table id is taken from stcb */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { @@ -4459,10 +4459,6 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, packet_length); -#endif SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -4490,6 +4486,10 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_SOCKET_UNLOCK(so, 0); } #endif +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + sctp_packet_log(o_pak); +#endif SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { @@ -11067,11 +11067,6 @@ sctp_send_resp_msg(struct mbuf *m, struc } } iph_out->ip_len = len; -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { - sctp_packet_log(mout, len); - } -#endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11091,6 +11086,11 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(o_pak); + } +#endif SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); /* Free the route if we got one back */ if (ro.ro_rt) { @@ -11101,11 +11101,6 @@ sctp_send_resp_msg(struct mbuf *m, struc #ifdef INET6 if (ip6_out != NULL) { ip6_out->ip6_plen = len - sizeof(struct ip6_hdr); -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { - sctp_packet_log(mout, len); - } -#endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11125,6 +11120,11 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(o_pak); + } +#endif SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); } #endif Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:31:45 2013 (r247949) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:34:04 2013 (r247950) @@ -100,10 +100,12 @@ sctp6_input(struct mbuf **i_pak, int *of return (-1); } m = SCTP_HEADER_TO_CHAIN(*i_pak); - pkt_len = SCTP_HEADER_LEN((*i_pak)); + pkt_len = SCTP_HEADER_LEN(*i_pak); -#ifdef SCTP_PACKET_LOGGING - sctp_packet_log(m, pkt_len); +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(m); + } #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:34:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 02C22C6D; Thu, 7 Mar 2013 21:34:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EA1C6402; Thu, 7 Mar 2013 21:34:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LYGNE018109; Thu, 7 Mar 2013 21:34:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LYGbA018108; Thu, 7 Mar 2013 21:34:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201303072134.r27LYGbA018108@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Mar 2013 21:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247951 - head/usr.bin/c89 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:34:17 -0000 Author: dim Date: Thu Mar 7 21:34:16 2013 New Revision: 247951 URL: http://svnweb.freebsd.org/changeset/base/247951 Log: Make c89(1) invoke /usr/bin/cc with argv[0] also set to /usr/bin/cc, similar to what c99(1) does, to prevent "c89: illegal option -- 1" messages, when clang is /usr/bin/cc. Reported by: tijl MFC after: 3 days Modified: head/usr.bin/c89/c89.c Modified: head/usr.bin/c89/c89.c ============================================================================== --- head/usr.bin/c89/c89.c Thu Mar 7 21:34:04 2013 (r247950) +++ head/usr.bin/c89/c89.c Thu Mar 7 21:34:16 2013 (r247951) @@ -72,7 +72,7 @@ main(int argc, char **argv) Argv.a = malloc((argc + 1 + N_ARGS_PREPENDED) * sizeof *Argv.a); if (Argv.a == NULL) err(1, "malloc"); - Argv.a[Argc++] = argv[0]; + Argv.a[Argc++] = CC; for (j = 0; j < N_ARGS_PREPENDED; ++j) Argv.a[Argc++] = args_prepended[j]; while ((i = getopt(argc, argv, "cD:EgI:l:L:o:OsU:")) != -1) { From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:36:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 41CD0E46; Thu, 7 Mar 2013 21:36:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03D6D5EF; Thu, 7 Mar 2013 21:36:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27La42U018426; Thu, 7 Mar 2013 21:36:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27La4LE018425; Thu, 7 Mar 2013 21:36:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072136.r27La4LE018425@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:36:04 +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: r247952 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:36:05 -0000 Author: tuexen Date: Thu Mar 7 21:36:04 2013 New Revision: 247952 URL: http://svnweb.freebsd.org/changeset/base/247952 Log: MFC r237541: Remove redundant check. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:34:16 2013 (r247951) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:36:04 2013 (r247952) @@ -2392,7 +2392,7 @@ sctp_handle_cookie_echo(struct mbuf *m, uint8_t calc_sig[SCTP_SIGNATURE_SIZE], tmp_sig[SCTP_SIGNATURE_SIZE]; uint8_t *sig; uint8_t cookie_ok = 0; - unsigned int size_of_pkt, sig_offset, cookie_offset; + unsigned int sig_offset, cookie_offset; unsigned int cookie_len; struct timeval now; struct timeval time_expires; @@ -2434,7 +2434,6 @@ sctp_handle_cookie_echo(struct mbuf *m, lsin->sin_len = sizeof(*lsin); lsin->sin_port = sh->dest_port; lsin->sin_addr.s_addr = iph->ip_dst.s_addr; - size_of_pkt = SCTP_GET_IPV4_LENGTH(iph); break; } #endif @@ -2452,7 +2451,6 @@ sctp_handle_cookie_echo(struct mbuf *m, ip6 = mtod(m, struct ip6_hdr *); lsin6->sin6_port = sh->dest_port; lsin6->sin6_addr = ip6->ip6_dst; - size_of_pkt = SCTP_GET_IPV6_LENGTH(ip6) + iphlen; break; } #endif @@ -2476,11 +2474,10 @@ sctp_handle_cookie_echo(struct mbuf *m, */ return (NULL); } - if (cookie_len > size_of_pkt || - cookie_len < sizeof(struct sctp_cookie_echo_chunk) + + if (cookie_len < sizeof(struct sctp_cookie_echo_chunk) + sizeof(struct sctp_init_chunk) + sizeof(struct sctp_init_ack_chunk) + SCTP_SIGNATURE_SIZE) { - /* cookie too long! or too small */ + /* cookie too small */ return (NULL); } /* @@ -2488,11 +2485,6 @@ sctp_handle_cookie_echo(struct mbuf *m, * calculated in the sctp_hmac_m() call). */ sig_offset = offset + cookie_len - SCTP_SIGNATURE_SIZE; - if (sig_offset > size_of_pkt) { - /* packet not correct size! */ - /* XXX this may already be accounted for earlier... */ - return (NULL); - } m_sig = m_split(m, sig_offset, M_DONTWAIT); if (m_sig == NULL) { /* out of memory or ?? */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:37:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1D484FDD; Thu, 7 Mar 2013 21:37:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04DB0600; Thu, 7 Mar 2013 21:37:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LbNCi018641; Thu, 7 Mar 2013 21:37:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LbNBC018640; Thu, 7 Mar 2013 21:37:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201303072137.r27LbNBC018640@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Mar 2013 21:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247953 - head/usr.bin/c99 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:37:24 -0000 Author: dim Date: Thu Mar 7 21:37:23 2013 New Revision: 247953 URL: http://svnweb.freebsd.org/changeset/base/247953 Log: Make c99(1) invoke /usr/bin/cc with argv[0] set to "/usr/bin/cc" instead of just "cc", since there is no reason to cause additional path searches in this case. MFC after: 3 days Modified: head/usr.bin/c99/c99.c Modified: head/usr.bin/c99/c99.c ============================================================================== --- head/usr.bin/c99/c99.c Thu Mar 7 21:36:04 2013 (r247952) +++ head/usr.bin/c99/c99.c Thu Mar 7 21:37:23 2013 (r247953) @@ -70,7 +70,7 @@ main(int argc, char *argv[]) usage(); } - addarg("cc"); + addarg("/usr/bin/cc"); addarg("-std=iso9899:1999"); addarg("-pedantic"); for (i = 1; i < optind; i++) From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:38:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6C6D61FB; Thu, 7 Mar 2013 21:38:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 574E5616; Thu, 7 Mar 2013 21:38:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Lcjp9018852; Thu, 7 Mar 2013 21:38:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LcipM018845; Thu, 7 Mar 2013 21:38:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072138.r27LcipM018845@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:38:44 +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: r247954 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:38:45 -0000 Author: tuexen Date: Thu Mar 7 21:38:43 2013 New Revision: 247954 URL: http://svnweb.freebsd.org/changeset/base/247954 Log: MFC r237542: Pass the packet length explicitly around. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 21:38:43 2013 (r247954) @@ -2762,7 +2762,7 @@ sctp_process_data(struct mbuf **mm, int /* * we need to report rwnd overrun drops. */ - sctp_send_packet_dropped(stcb, net, *mm, iphlen, 0); + sctp_send_packet_dropped(stcb, net, *mm, length, iphlen, 0); } if (num_chunks) { /* Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:38:43 2013 (r247954) @@ -6013,7 +6013,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:38:43 2013 (r247954) @@ -11312,21 +11312,15 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb void sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, - struct mbuf *m, int iphlen, int bad_crc) + struct mbuf *m, int len, int iphlen, int bad_crc) { struct sctp_association *asoc; struct sctp_pktdrop_chunk *drp; struct sctp_tmit_chunk *chk; uint8_t *datap; - int len; int was_trunc = 0; struct ip *iph; - -#ifdef INET6 - struct ip6_hdr *ip6h; - -#endif - int fullsz = 0, extra = 0; + int fullsz = 0; long spc; int offset; struct sctp_chunkhdr *ch, chunk_buf; @@ -11356,23 +11350,8 @@ sctp_send_packet_dropped(struct sctp_tcb sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - /* IPv4 */ - len = chk->send_size = iph->ip_len; - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - /* IPv6 */ - ip6h = mtod(m, struct ip6_hdr *); - len = chk->send_size = htons(ip6h->ip6_plen); - break; -#endif - default: - return; - } + len -= iphlen; + chk->send_size = len; /* Validate that we do not have an ABORT in here. */ offset = iphlen + sizeof(struct sctphdr); ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, @@ -11408,7 +11387,7 @@ sctp_send_packet_dropped(struct sctp_tcb /* * only send 1 mtu worth, trim off the excess on the end. */ - fullsz = len - extra; + fullsz = len; len = min(stcb->asoc.smallest_mtu, MCLBYTES) - SCTP_MAX_OVERHEAD; was_trunc = 1; } Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet/sctp_output.h Thu Mar 7 21:38:43 2013 (r247954) @@ -162,7 +162,7 @@ void sctp_send_ecn_echo(struct sctp_tcb void sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, - int, int); + int, int, int); Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:37:23 2013 (r247953) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:38:43 2013 (r247954) @@ -183,7 +183,7 @@ sctp6_input(struct mbuf **i_pak, int *of } /* in6p's ref-count increased && stcb locked */ if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((in6p != NULL) && (stcb == NULL)) { refcount_up = 1; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:41:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 880043B1; Thu, 7 Mar 2013 21:41:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79E1B638; Thu, 7 Mar 2013 21:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Lf4W1020805; Thu, 7 Mar 2013 21:41:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Lf28i020791; Thu, 7 Mar 2013 21:41:02 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072141.r27Lf28i020791@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:41:02 +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: r247955 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:41:04 -0000 Author: tuexen Date: Thu Mar 7 21:41:02 2013 New Revision: 247955 URL: http://svnweb.freebsd.org/changeset/base/247955 Log: MFC r237565: Whitespace cleanup. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 21:38:43 2013 (r247954) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 21:41:02 2013 (r247955) @@ -1529,7 +1529,7 @@ sctp_process_a_data_chunk(struct sctp_tc */ if (stcb->sctp_socket->so_rcv.sb_cc) { /* some to read, wake-up */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -1545,7 +1545,7 @@ sctp_process_a_data_chunk(struct sctp_tc } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3982,7 +3982,7 @@ sctp_express_handle_sack(struct sctp_tcb } /* sa_ignore NO_NULL_CHK */ if (stcb->sctp_socket) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3991,7 +3991,7 @@ sctp_express_handle_sack(struct sctp_tcb /* sa_ignore NO_NULL_CHK */ sctp_wakeup_log(stcb, 1, SCTP_WAKESND_FROM_SACK); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4005,7 +4005,7 @@ sctp_express_handle_sack(struct sctp_tcb } #endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else { @@ -4734,7 +4734,7 @@ sctp_handle_sack(struct mbuf *m, int off } /* sa_ignore NO_NULL_CHK */ if ((wake_him) && (stcb->sctp_socket)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -4742,7 +4742,7 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { sctp_wakeup_log(stcb, wake_him, SCTP_WAKESND_FROM_SACK); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4756,7 +4756,7 @@ sctp_handle_sack(struct mbuf *m, int off } #endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else { Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:38:43 2013 (r247954) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:41:02 2013 (r247955) @@ -757,7 +757,7 @@ static void sctp_handle_abort(struct sctp_abort_chunk *abort, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -807,7 +807,7 @@ sctp_handle_abort(struct sctp_abort_chun #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -818,7 +818,7 @@ sctp_handle_abort(struct sctp_abort_chun stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_6); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: finished\n"); @@ -860,7 +860,7 @@ sctp_handle_shutdown(struct sctp_shutdow struct sctp_association *asoc; int some_on_streamwheel; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -892,7 +892,7 @@ sctp_handle_shutdown(struct sctp_shutdow asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -906,7 +906,7 @@ sctp_handle_shutdown(struct sctp_shutdow } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -966,7 +966,7 @@ sctp_handle_shutdown_ack(struct sctp_shu { struct sctp_association *asoc; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -1000,7 +1000,7 @@ sctp_handle_shutdown_ack(struct sctp_shu asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -1013,7 +1013,7 @@ sctp_handle_shutdown_ack(struct sctp_shu } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1037,7 +1037,7 @@ sctp_handle_shutdown_ack(struct sctp_shu } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -1046,7 +1046,7 @@ sctp_handle_shutdown_ack(struct sctp_shu #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_10); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1132,7 +1132,7 @@ sctp_handle_error(struct sctp_chunkhdr * struct sctp_association *asoc; int adjust; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1195,7 +1195,7 @@ sctp_handle_error(struct sctp_chunkhdr * asoc->max_init_times) { sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* now free the asoc */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1205,7 +1205,7 @@ sctp_handle_error(struct sctp_chunkhdr * #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_11); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif return (-1); @@ -1580,7 +1580,7 @@ sctp_process_cookie_existing(struct mbuf (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (inp->sctp_socket->so_qlimit == 0) ) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1592,7 +1592,7 @@ sctp_process_cookie_existing(struct mbuf */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1605,7 +1605,7 @@ sctp_process_cookie_existing(struct mbuf } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1798,13 +1798,13 @@ sctp_process_cookie_existing(struct mbuf if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (inp->sctp_socket->so_qlimit == 0)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1817,7 +1817,7 @@ sctp_process_cookie_existing(struct mbuf } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -2029,7 +2029,7 @@ sctp_process_cookie_new(struct mbuf *m, struct sockaddr_in6 *sin6; #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -2133,14 +2133,14 @@ sctp_process_cookie_new(struct mbuf *m, sh, op_err, use_mflowid, mflowid, vrf_id, port); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2165,13 +2165,13 @@ sctp_process_cookie_new(struct mbuf *m, retval = 0; if (retval < 0) { atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2182,13 +2182,13 @@ sctp_process_cookie_new(struct mbuf *m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_17); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2211,13 +2211,13 @@ sctp_process_cookie_new(struct mbuf *m, SCTPDBG(SCTP_DEBUG_AUTH1, "COOKIE-ECHO: AUTH failed\n"); atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_18); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2274,13 +2274,13 @@ sctp_process_cookie_new(struct mbuf *m, #endif default: atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2301,7 +2301,7 @@ sctp_process_cookie_new(struct mbuf *m, * a bit of protection is worth having.. */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -2313,7 +2313,7 @@ sctp_process_cookie_new(struct mbuf *m, } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && @@ -2780,7 +2780,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (so == NULL) { struct mbuf *op_err; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *pcb_so; #endif @@ -2791,7 +2791,7 @@ sctp_handle_cookie_echo(struct mbuf *m, sh, op_err, use_mflowid, mflowid, vrf_id, port); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) pcb_so = SCTP_INP_SO(*inp_p); atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); @@ -2800,7 +2800,7 @@ sctp_handle_cookie_echo(struct mbuf *m, atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); #endif (void)sctp_free_assoc(*inp_p, *stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(pcb_so, 1); #endif return (NULL); @@ -2890,13 +2890,13 @@ sctp_handle_cookie_echo(struct mbuf *m, * Pull it from the incomplete queue and wake the * guy */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); SCTP_SOCKET_LOCK(so, 1); #endif soisconnected(so); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_LOCK((*stcb)); atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); SCTP_SOCKET_UNLOCK(so, 1); @@ -2954,12 +2954,12 @@ sctp_handle_cookie_ack(struct sctp_cooki sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -2970,7 +2970,7 @@ sctp_handle_cookie_ack(struct sctp_cooki if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { soisconnected(stcb->sctp_socket); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3198,7 +3198,7 @@ sctp_handle_shutdown_complete(struct sct { struct sctp_association *asoc; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3233,7 +3233,7 @@ sctp_handle_shutdown_complete(struct sct /* free the TCB */ SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_complete: calls free-asoc\n"); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3242,7 +3242,7 @@ sctp_handle_shutdown_complete(struct sct atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_23); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif return; @@ -4429,7 +4429,7 @@ __attribute__((noinline)) int auth_skipped = 0; int asconf_cnt = 0; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -4787,7 +4787,7 @@ process_control_chunks: } *offset = length; if (stcb) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4796,7 +4796,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -5207,7 +5207,7 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else if (stcb) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5216,7 +5216,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; @@ -5370,7 +5370,7 @@ process_control_chunks: *fwd_tsn_seen = 1; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5379,7 +5379,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_29); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; @@ -5415,7 +5415,7 @@ process_control_chunks: } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5424,7 +5424,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:38:43 2013 (r247954) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:41:02 2013 (r247955) @@ -3892,7 +3892,7 @@ sctp_lowlevel_chunk_output(struct sctp_i struct udphdr *udp = NULL; uint8_t tos_value; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so = NULL; #endif @@ -4132,14 +4132,14 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_packet_log(o_pak); #endif /* send it out. table id is taken from stcb */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { so = SCTP_INP_SO(inp); SCTP_SOCKET_UNLOCK(so, 0); } #endif SCTP_IP_OUTPUT(ret, o_pak, ro, stcb, vrf_id); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4480,7 +4480,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #endif } /* send it out. table id is taken from stcb */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { so = SCTP_INP_SO(inp); SCTP_SOCKET_UNLOCK(so, 0); @@ -4491,7 +4491,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_packet_log(o_pak); #endif SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Thu Mar 7 21:38:43 2013 (r247954) +++ stable/8/sys/netinet/sctp_sysctl.c Thu Mar 7 21:41:02 2013 (r247955) @@ -665,7 +665,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); #endif } @@ -1125,7 +1125,7 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Thu Mar 7 21:38:43 2013 (r247954) +++ stable/8/sys/netinet/sctp_sysctl.h Thu Mar 7 21:41:02 2013 (r247955) @@ -531,7 +531,7 @@ struct sctp_sysctl { #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) #define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP." #define SCTPCTL_OUTPUT_UNLOCKED_MIN 0 #define SCTPCTL_OUTPUT_UNLOCKED_MAX 1 Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 21:38:43 2013 (r247954) +++ stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 21:41:02 2013 (r247955) @@ -224,7 +224,7 @@ sctp_notify(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -283,7 +283,7 @@ sctp_notify(struct sctp_inpcb *inp, * with no TCB */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -292,7 +292,7 @@ sctp_notify(struct sctp_inpcb *inp, atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif @@ -5810,7 +5810,7 @@ sctp_ctloutput(struct socket *so, struct if (INP_CHECK_SOCKAF(so, AF_INET6)) error = ip6_ctloutput(so, sopt); #endif /* INET6 */ -#if defined(INET) && defined (INET6) +#if defined(INET) && defined(INET6) else #endif #ifdef INET Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 21:38:43 2013 (r247954) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 21:41:02 2013 (r247955) @@ -1412,7 +1412,7 @@ sctp_timeout_handler(void *t) struct sctp_nets *net; struct sctp_timer *tmr; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1777,7 +1777,7 @@ sctp_timeout_handler(void *t) /* Can we free it yet? */ SCTP_INP_DECR_REF(inp); sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1786,7 +1786,7 @@ sctp_timeout_handler(void *t) atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif /* @@ -2600,7 +2600,7 @@ sctp_notify_assoc_change(uint16_t state, size_t notif_len, abort_len; unsigned int i; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -2698,7 +2698,7 @@ set_error: } } /* Wake ANY sleepers */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); if (!so_locked) { atomic_add_int(&stcb->asoc.refcnt, 1); @@ -2719,7 +2719,7 @@ set_error: } sorwakeup(stcb->sctp_socket); sowwakeup(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -3134,7 +3134,7 @@ sctp_notify_partial_delivery_indication( } if (stcb->sctp_ep && stcb->sctp_socket) { /* This should always be the case */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -3151,7 +3151,7 @@ sctp_notify_partial_delivery_indication( } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -3173,7 +3173,7 @@ sctp_notify_shutdown_event(struct sctp_t if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* mark socket closed for read/write and wakeup! */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -3188,7 +3188,7 @@ sctp_notify_shutdown_event(struct sctp_t } #endif socantsendmore(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3830,7 +3830,7 @@ sctp_abort_association(struct sctp_inpcb { uint32_t vtag; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3849,7 +3849,7 @@ sctp_abort_association(struct sctp_inpcb vrf_id, port); if (stcb != NULL) { /* Ok, now lets free it */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3863,7 +3863,7 @@ sctp_abort_association(struct sctp_inpcb SCTP_STAT_DECR_GAUGE32(sctps_currestab); } (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_4); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3942,12 +3942,12 @@ sctp_abort_an_association(struct sctp_in #endif ) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); #endif if (stcb == NULL) { @@ -3977,7 +3977,7 @@ sctp_abort_an_association(struct sctp_in #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3987,7 +3987,7 @@ sctp_abort_an_association(struct sctp_in } #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_5); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -4475,7 +4475,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -4496,7 +4496,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp } #endif sctp_sorwakeup(inp, inp->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -4629,7 +4629,7 @@ get_out: if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -4648,7 +4648,7 @@ get_out: } #endif sctp_sorwakeup(inp, inp->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -4905,7 +4905,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t SCTP_TCB_SEND_UNLOCK(stcb); } if (do_wakeup_routine) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -4923,7 +4923,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t } #endif sctp_sowwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:38:43 2013 (r247954) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:41:02 2013 (r247955) @@ -395,7 +395,7 @@ sctp6_notify(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -450,7 +450,7 @@ sctp6_notify(struct sctp_inpcb *inp, * with no TCB */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -459,7 +459,7 @@ sctp6_notify(struct sctp_inpcb *inp, atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:43:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71942661; Thu, 7 Mar 2013 21:43:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62E96661; Thu, 7 Mar 2013 21:43:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LhMgH021128; Thu, 7 Mar 2013 21:43:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LhMuF021126; Thu, 7 Mar 2013 21:43:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072143.r27LhMuF021126@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 21:43:22 +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: r247956 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:43:22 -0000 Author: tuexen Date: Thu Mar 7 21:43:21 2013 New Revision: 247956 URL: http://svnweb.freebsd.org/changeset/base/247956 Log: MFC r237569: Unify sctp_input() and sctp6_input(). Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:41:02 2013 (r247955) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 21:43:21 2013 (r247956) @@ -5885,12 +5885,12 @@ sctp_input_with_port(struct mbuf *i_pak, uint8_t ecn_bits; struct ip *ip; struct sctphdr *sh; + struct sctp_chunkhdr *ch; struct sctp_inpcb *inp = NULL; - struct sctp_nets *net; struct sctp_tcb *stcb = NULL; - struct sctp_chunkhdr *ch; + struct sctp_nets *net = NULL; int refcount_up = 0; - int length, mlen, offset; + int length, offset; uint32_t mflowid; uint8_t use_mflowid; @@ -5899,19 +5899,12 @@ sctp_input_with_port(struct mbuf *i_pak, #endif + iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { SCTP_RELEASE_PKT(i_pak); return; } - mlen = SCTP_HEADER_LEN(i_pak); - iphlen = off; m = SCTP_HEADER_TO_CHAIN(i_pak); - - net = NULL; - SCTP_STAT_INCR(sctps_recvpackets); - SCTP_STAT_INCR_COUNTER64(sctps_inpackets); - - #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { @@ -5925,8 +5918,9 @@ sctp_input_with_port(struct mbuf *i_pak, } #endif #ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { sctp_packet_log(m); + } #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; @@ -5935,17 +5929,11 @@ sctp_input_with_port(struct mbuf *i_pak, mflowid = 0; use_mflowid = 0; } - /* - * Must take out the iphlen, since mlen expects this (only effect lb - * case) - */ - mlen -= iphlen; - - /* - * Get IP, SCTP, and first chunk header together in first mbuf. - */ + SCTP_STAT_INCR(sctps_recvpackets); + SCTP_STAT_INCR_COUNTER64(sctps_inpackets); + /* Get IP, SCTP, and first chunk header together in the first mbuf. */ ip = mtod(m, struct ip *); - offset = iphlen + sizeof(*sh) + sizeof(*ch); + offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); if (SCTP_BUF_LEN(m) < offset) { if ((m = m_pullup(m, offset)) == 0) { SCTP_STAT_INCR(sctps_hdrops); @@ -5953,28 +5941,26 @@ sctp_input_with_port(struct mbuf *i_pak, } ip = mtod(m, struct ip *); } - /* validate mbuf chain length with IP payload length */ - if (mlen < (SCTP_GET_IPV4_LENGTH(ip) - iphlen)) { + sh = (struct sctphdr *)((caddr_t)ip + iphlen); + ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); + offset -= sizeof(struct sctp_chunkhdr); + length = ip->ip_len + iphlen; + /* Validate mbuf chain length with IP payload length. */ + if (SCTP_HEADER_LEN(i_pak) != length) { + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(i_pak)); SCTP_STAT_INCR(sctps_hdrops); goto bad; } - sh = (struct sctphdr *)((caddr_t)ip + iphlen); - ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(*sh)); - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d iphlen:%d\n", mlen, iphlen); - /* SCTP does not allow broadcasts or multicasts */ if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { goto bad; } if (SCTP_IS_IT_BROADCAST(ip->ip_dst, m)) { - /* - * We only look at broadcast if its a front state, All - * others we will not have a tcb for anyway. - */ goto bad; } - /* validate SCTP checksum */ + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp_input() length:%d iphlen:%d\n", length, iphlen); SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", m->m_pkthdr.len, @@ -5985,21 +5971,18 @@ sctp_input_with_port(struct mbuf *i_pak, #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum_4; + goto sctp_skip_csum; } - check = sh->checksum; /* save incoming checksum */ - sh->checksum = 0; /* prepare for calc */ + check = sh->checksum; + sh->checksum = 0; calc_check = sctp_calculate_cksum(m, iphlen); sh->checksum = check; SCTP_STAT_INCR(sctps_recvswcrc); if (calc_check != check) { SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, mlen, iphlen); - - stcb = sctp_findassociation_addr(m, - offset - sizeof(*ch), - sh, ch, &inp, &net, - vrf_id); + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -6013,7 +5996,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; @@ -6022,18 +6005,14 @@ sctp_input_with_port(struct mbuf *i_pak, SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); goto bad; } -sctp_skip_csum_4: +sctp_skip_csum: #endif /* destination port of 0 is illegal, based on RFC2960. */ if (sh->dest_port == 0) { SCTP_STAT_INCR(sctps_hdrops); goto bad; } - /* - * Locate pcb and tcb for datagram sctp_findassociation_addr() wants - * IP/SCTP/first chunk header... - */ - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), + stcb = sctp_findassociation_addr(m, offset, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6047,27 +6026,10 @@ sctp_skip_csum_4: net->flowidset = 1; #endif } - /* inp's ref-count increased && stcb locked */ if (inp == NULL) { - struct sctp_init_chunk *init_chk, chunk_buf; - SCTP_STAT_INCR(sctps_noport); if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; - SCTPDBG(SCTP_DEBUG_INPUT1, - "Sending a ABORT from packet entry!\n"); - if (ch->chunk_type == SCTP_INITIATION) { - /* - * we do a trick here to get the INIT tag, dig in - * and get the tag from the INIT and put it in the - * common header. - */ - init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - iphlen + sizeof(*sh), sizeof(*init_chk), - (uint8_t *) & chunk_buf); - if (init_chk != NULL) - sh->v_tag = init_chk->init.initiate_tag; - } if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(m, sh, use_mflowid, mflowid, @@ -6091,7 +6053,7 @@ sctp_skip_csum_4: refcount_up = 1; } #ifdef IPSEC - /* + /*- * I very much doubt any of the IPSEC stuff will work but I have no * idea, so I will leave it in place. */ @@ -6100,28 +6062,22 @@ sctp_skip_csum_4: SCTP_STAT_INCR(sctps_hdrops); goto bad; } -#endif /* IPSEC */ - - /* - * common chunk processing - */ - length = ip->ip_len + iphlen; - offset -= sizeof(struct sctp_chunkhdr); +#endif ecn_bits = ip->ip_tos; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); - /* inp's ref-count reduced && stcb unlocked */ if (m) { sctp_m_freem(m); } if ((inp) && (refcount_up)) { /* reduce ref-count */ + SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } return; bad: @@ -6130,7 +6086,9 @@ bad: } if ((inp) && (refcount_up)) { /* reduce ref-count */ + SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } if (m) { sctp_m_freem(m); Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:41:02 2013 (r247955) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 21:43:21 2013 (r247956) @@ -68,22 +68,17 @@ int sctp6_input(struct mbuf **i_pak, int *offp, int proto) { struct mbuf *m; + int iphlen; + uint32_t vrf_id = 0; + uint8_t ecn_bits; struct ip6_hdr *ip6; struct sctphdr *sh; - struct sctp_inpcb *in6p = NULL; - struct sctp_nets *net; - int refcount_up = 0; - uint32_t vrf_id = 0; - -#ifdef IPSEC - struct inpcb *in6p_ip; - -#endif struct sctp_chunkhdr *ch; - int length, offset, iphlen; - uint8_t ecn_bits; + struct sctp_inpcb *inp = NULL; struct sctp_tcb *stcb = NULL; - int pkt_len = 0; + struct sctp_nets *net = NULL; + int refcount_up = 0; + int length, offset; uint32_t mflowid; uint8_t use_mflowid; @@ -91,17 +86,26 @@ sctp6_input(struct mbuf **i_pak, int *of uint32_t check, calc_check; #endif - int off = *offp; uint16_t port = 0; - /* get the VRF and table id's */ + iphlen = *offp; if (SCTP_GET_PKT_VRFID(*i_pak, vrf_id)) { SCTP_RELEASE_PKT(*i_pak); - return (-1); + return (IPPROTO_DONE); } m = SCTP_HEADER_TO_CHAIN(*i_pak); - pkt_len = SCTP_HEADER_LEN(*i_pak); - +#ifdef SCTP_MBUF_LOGGING + /* Log in any input mbufs */ + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { + struct mbuf *mat; + + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { + if (SCTP_BUF_IS_EXTENDED(mat)) { + sctp_log_mb(mat, SCTP_MBUF_INPUT); + } + } + } +#endif #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { sctp_packet_log(m); @@ -114,42 +118,38 @@ sctp6_input(struct mbuf **i_pak, int *of mflowid = 0; use_mflowid = 0; } + SCTP_STAT_INCR(sctps_recvpackets); + SCTP_STAT_INCR_COUNTER64(sctps_inpackets); + /* Get IP, SCTP, and first chunk header together in the first mbuf. */ ip6 = mtod(m, struct ip6_hdr *); - /* Ensure that (sctphdr + sctp_chunkhdr) in a row. */ - IP6_EXTHDR_GET(sh, struct sctphdr *, m, off, - (int)(sizeof(*sh) + sizeof(*ch))); + offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + IP6_EXTHDR_GET(sh, struct sctphdr *, m, iphlen, + (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); if (sh == NULL) { SCTP_STAT_INCR(sctps_hdrops); return (IPPROTO_DONE); } ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); - iphlen = off; - offset = iphlen + sizeof(*sh) + sizeof(*ch); - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d iphlen:%d\n", pkt_len, iphlen); - - -#if defined(NFAITH) && NFAITH > 0 - + offset -= sizeof(struct sctp_chunkhdr); if (faithprefix_p != NULL && (*faithprefix_p) (&ip6->ip6_dst)) { /* XXX send icmp6 host/port unreach? */ goto bad; } -#endif /* NFAITH defined and > 0 */ - SCTP_STAT_INCR(sctps_recvpackets); - SCTP_STAT_INCR_COUNTER64(sctps_inpackets); - SCTPDBG(SCTP_DEBUG_INPUT1, "V6 input gets a packet iphlen:%d pktlen:%d\n", - iphlen, pkt_len); - if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - /* No multi-cast support in SCTP */ + length = ntohs(ip6->ip6_plen) + iphlen; + /* Validate mbuf chain length with IP payload length. */ + if (SCTP_HEADER_LEN(*i_pak) != length) { + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(*i_pak)); + SCTP_STAT_INCR(sctps_hdrops); goto bad; } - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { goto bad; - + } + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp6_input() length:%d iphlen:%d\n", length, iphlen); SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", m->m_pkthdr.len, if_name(m->m_pkthdr.rcvif), m->m_pkthdr.csum_flags); @@ -160,15 +160,16 @@ sctp6_input(struct mbuf **i_pak, int *of SCTP_STAT_INCR(sctps_recvhwcrc); goto sctp_skip_csum; } - check = sh->checksum; /* save incoming checksum */ - sh->checksum = 0; /* prepare for calc */ + check = sh->checksum; + sh->checksum = 0; calc_check = sctp_calculate_cksum(m, iphlen); + sh->checksum = check; SCTP_STAT_INCR(sctps_recvswcrc); if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p phlen:%d\n", - calc_check, check, m, iphlen); - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), - sh, ch, &in6p, &net, vrf_id); + SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -181,28 +182,25 @@ sctp6_input(struct mbuf **i_pak, int *of net->flowidset = 1; #endif } - /* in6p's ref-count increased && stcb locked */ - if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); - sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((in6p != NULL) && (stcb == NULL)) { + if ((inp) && (stcb)) { + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); + } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; } SCTP_STAT_INCR(sctps_badsum); SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); goto bad; } - sh->checksum = calc_check; - sctp_skip_csum: #endif - net = NULL; - /* - * Locate pcb and tcb for datagram sctp_findassociation_addr() wants - * IP/SCTP/first chunk header... - */ - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), - sh, ch, &in6p, &net, vrf_id); + /* destination port of 0 is illegal, based on RFC2960. */ + if (sh->dest_port == 0) { + SCTP_STAT_INCR(sctps_hdrops); + goto bad; + } + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -215,25 +213,10 @@ sctp_skip_csum: net->flowidset = 1; #endif } - /* in6p's ref-count increased */ - if (in6p == NULL) { - struct sctp_init_chunk *init_chk, chunk_buf; - + if (inp == NULL) { SCTP_STAT_INCR(sctps_noport); - if (ch->chunk_type == SCTP_INITIATION) { - /* - * we do a trick here to get the INIT tag, dig in - * and get the tag from the INIT and put it in the - * common header. - */ - init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - iphlen + sizeof(*sh), sizeof(*init_chk), - (uint8_t *) & chunk_buf); - if (init_chk) - sh->v_tag = init_chk->init.initiate_tag; - else - sh->v_tag = 0; - } + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) + goto bad; if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(m, sh, use_mflowid, mflowid, @@ -257,55 +240,46 @@ sctp_skip_csum: refcount_up = 1; } #ifdef IPSEC - /* - * Check AH/ESP integrity. + /*- + * I very much doubt any of the IPSEC stuff will work but I have no + * idea, so I will leave it in place. */ - in6p_ip = (struct inpcb *)in6p; - if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) { -/* XXX */ + if (inp && ipsec6_in_reject(m, &inp->ip_inp.inp)) { MODULE_GLOBAL(ipsec6stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); goto bad; } -#endif /* IPSEC */ +#endif - /* - * CONTROL chunk processing - */ - offset -= sizeof(*ch); ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); - - /* Length now holds the total packet length payload + iphlen */ - length = ntohs(ip6->ip6_plen) + iphlen; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - in6p, stcb, net, ecn_bits, + inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); - /* inp's ref-count reduced && stcb unlocked */ - /* XXX this stuff below gets moved to appropriate parts later... */ - if (m) + if (m) { sctp_m_freem(m); - if ((in6p) && refcount_up) { + } + if ((inp) && (refcount_up)) { /* reduce ref-count */ - SCTP_INP_WLOCK(in6p); - SCTP_INP_DECR_REF(in6p); - SCTP_INP_WUNLOCK(in6p); + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } return (IPPROTO_DONE); - bad: if (stcb) { SCTP_TCB_UNLOCK(stcb); } - if ((in6p) && refcount_up) { + if ((inp) && (refcount_up)) { /* reduce ref-count */ - SCTP_INP_WLOCK(in6p); - SCTP_INP_DECR_REF(in6p); - SCTP_INP_WUNLOCK(in6p); + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } - if (m) + if (m) { sctp_m_freem(m); + } return (IPPROTO_DONE); } From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:47:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5296890; Thu, 7 Mar 2013 21:47:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B71DF690; Thu, 7 Mar 2013 21:47:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27LlFZF021729; Thu, 7 Mar 2013 21:47:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27LlEqL021717; Thu, 7 Mar 2013 21:47:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303072147.r27LlEqL021717@svn.freebsd.org> From: Xin LI Date: Thu, 7 Mar 2013 21:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247957 - in vendor-crypto/openssl/dist-0.9.8: . apps crypto crypto/asn1 crypto/bn crypto/ec crypto/ecdh crypto/ecdsa crypto/ocsp crypto/rsa doc/apps engines ssl test util X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:47:16 -0000 Author: delphij Date: Thu Mar 7 21:47:13 2013 New Revision: 247957 URL: http://svnweb.freebsd.org/changeset/base/247957 Log: Import OpenSSL 0.9.8y. Added: vendor-crypto/openssl/dist-0.9.8/ssl/s3_cbc.c (contents, props changed) vendor-crypto/openssl/dist-0.9.8/test/srptest.c (contents, props changed) vendor-crypto/openssl/dist-0.9.8/test/wp_test.c (contents, props changed) Modified: vendor-crypto/openssl/dist-0.9.8/CHANGES vendor-crypto/openssl/dist-0.9.8/Configure vendor-crypto/openssl/dist-0.9.8/FAQ vendor-crypto/openssl/dist-0.9.8/FREEBSD-upgrade vendor-crypto/openssl/dist-0.9.8/Makefile vendor-crypto/openssl/dist-0.9.8/NEWS vendor-crypto/openssl/dist-0.9.8/README vendor-crypto/openssl/dist-0.9.8/apps/Makefile vendor-crypto/openssl/dist-0.9.8/apps/apps.c vendor-crypto/openssl/dist-0.9.8/apps/dhparam.c vendor-crypto/openssl/dist-0.9.8/apps/s_server.c vendor-crypto/openssl/dist-0.9.8/crypto/asn1/a_strex.c vendor-crypto/openssl/dist-0.9.8/crypto/asn1/a_verify.c vendor-crypto/openssl/dist-0.9.8/crypto/asn1/x_pubkey.c vendor-crypto/openssl/dist-0.9.8/crypto/bn/bn_word.c vendor-crypto/openssl/dist-0.9.8/crypto/cryptlib.c vendor-crypto/openssl/dist-0.9.8/crypto/crypto.h vendor-crypto/openssl/dist-0.9.8/crypto/ec/ec.h vendor-crypto/openssl/dist-0.9.8/crypto/ec/ec_key.c vendor-crypto/openssl/dist-0.9.8/crypto/ecdh/ech_lib.c vendor-crypto/openssl/dist-0.9.8/crypto/ecdsa/ecs_lib.c vendor-crypto/openssl/dist-0.9.8/crypto/o_init.c vendor-crypto/openssl/dist-0.9.8/crypto/ocsp/ocsp_vfy.c vendor-crypto/openssl/dist-0.9.8/crypto/opensslv.h vendor-crypto/openssl/dist-0.9.8/crypto/rsa/rsa_oaep.c vendor-crypto/openssl/dist-0.9.8/crypto/symhacks.h vendor-crypto/openssl/dist-0.9.8/doc/apps/CA.pl.pod vendor-crypto/openssl/dist-0.9.8/engines/e_capi.c vendor-crypto/openssl/dist-0.9.8/openssl.spec vendor-crypto/openssl/dist-0.9.8/ssl/Makefile vendor-crypto/openssl/dist-0.9.8/ssl/d1_enc.c vendor-crypto/openssl/dist-0.9.8/ssl/d1_pkt.c vendor-crypto/openssl/dist-0.9.8/ssl/s2_clnt.c vendor-crypto/openssl/dist-0.9.8/ssl/s2_pkt.c vendor-crypto/openssl/dist-0.9.8/ssl/s3_both.c vendor-crypto/openssl/dist-0.9.8/ssl/s3_clnt.c vendor-crypto/openssl/dist-0.9.8/ssl/s3_enc.c vendor-crypto/openssl/dist-0.9.8/ssl/s3_pkt.c vendor-crypto/openssl/dist-0.9.8/ssl/s3_srvr.c vendor-crypto/openssl/dist-0.9.8/ssl/ssl.h vendor-crypto/openssl/dist-0.9.8/ssl/ssl3.h vendor-crypto/openssl/dist-0.9.8/ssl/ssl_err.c vendor-crypto/openssl/dist-0.9.8/ssl/ssl_lib.c vendor-crypto/openssl/dist-0.9.8/ssl/ssl_locl.h vendor-crypto/openssl/dist-0.9.8/ssl/t1_enc.c vendor-crypto/openssl/dist-0.9.8/ssl/t1_lib.c vendor-crypto/openssl/dist-0.9.8/test/mdc2test.c vendor-crypto/openssl/dist-0.9.8/util/libeay.num Modified: vendor-crypto/openssl/dist-0.9.8/CHANGES ============================================================================== --- vendor-crypto/openssl/dist-0.9.8/CHANGES Thu Mar 7 21:43:21 2013 (r247956) +++ vendor-crypto/openssl/dist-0.9.8/CHANGES Thu Mar 7 21:47:13 2013 (r247957) @@ -2,6 +2,35 @@ OpenSSL CHANGES _______________ + Changes between 0.9.8x and 0.9.8y [5 Feb 2013] + + *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time. + + This addresses the flaw in CBC record processing discovered by + Nadhem Alfardan and Kenny Paterson. Details of this attack can be found + at: http://www.isg.rhul.ac.uk/tls/ + + Thanks go to Nadhem Alfardan and Kenny Paterson of the Information + Security Group at Royal Holloway, University of London + (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and + Emilia Käsper for the initial patch. + (CVE-2013-0169) + [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson] + + *) Return an error when checking OCSP signatures when key is NULL. + This fixes a DoS attack. (CVE-2013-0166) + [Steve Henson] + + *) Call OCSP Stapling callback after ciphersuite has been chosen, so + the right response is stapled. Also change SSL_get_certificate() + so it returns the certificate actually sent. + See http://rt.openssl.org/Ticket/Display.html?id=2836. + (This is a backport) + [Rob Stradling ] + + *) Fix possible deadlock when decoding public keys. + [Steve Henson] + Changes between 0.9.8w and 0.9.8x [10 May 2012] *) Sanity check record length before skipping explicit IV in DTLS Modified: vendor-crypto/openssl/dist-0.9.8/Configure ============================================================================== --- vendor-crypto/openssl/dist-0.9.8/Configure Thu Mar 7 21:43:21 2013 (r247956) +++ vendor-crypto/openssl/dist-0.9.8/Configure Thu Mar 7 21:47:13 2013 (r247957) @@ -162,6 +162,7 @@ my %table=( "debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", "debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", "debug-ben-debug", "gcc:$gcc_devteam_warn -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -ggdb3 -O2 -pipe::(unknown)::::::", +"debug-ben-debug-64", "gcc:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-ben-debug-noopt", "gcc:$gcc_devteam_warn -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -ggdb3 -pipe::(unknown)::::::", "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", @@ -172,10 +173,10 @@ my %table=( "debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -m32 -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", "debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT:${no_asm}:dlfcn:linux-shared", -"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-geoff","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", "debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", @@ -428,8 +429,8 @@ my %table=( "aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64", # Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE # at build time. $OBJECT_MODE is respected at ./config stage! -"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", -"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", +"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", +"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", # # Cray T90 and similar (SDSC) Modified: vendor-crypto/openssl/dist-0.9.8/FAQ ============================================================================== --- vendor-crypto/openssl/dist-0.9.8/FAQ Thu Mar 7 21:43:21 2013 (r247956) +++ vendor-crypto/openssl/dist-0.9.8/FAQ Thu Mar 7 21:47:13 2013 (r247957) @@ -83,7 +83,7 @@ OpenSSL - Frequently Asked Questions * Which is the current version of OpenSSL? The current version is available from . -OpenSSL 1.0.1c was released on May 10th, 2012. +OpenSSL 1.0.1d was released on Feb 5th, 2013. In addition to the current stable release, you can also access daily snapshots of the OpenSSL development version at ../old cd ../openssl-${OSSLVER} find . -type f -or -type l | cut -c 3- | sort >../new @@ -35,20 +35,20 @@ comm -23 old new # See that files to add makes sense comm -13 old new -tar -cf - -C openssl-${OSSLVER} . | tar xf - -C dist -cd dist +tar -cf - -C openssl-${OSSLVER} . | tar xf - -C dist-0.9.8 +cd dist-0.9.8 comm -23 ../old ../new | xargs svn rm comm -13 ../old ../new | xargs svn --parents add svn stat svn ci -svn cp $FSVN/vendor-crypto/openssl/dist $FSVN/vendor-crypto/openssl/$OSSLVER +svn cp $FSVN/vendor-crypto/openssl/dist-0.9.8 $FSVN/vendor-crypto/openssl/$OSSLVER # Merge to head mkdir ../head cd ../head svn co $FSVN/head/crypto/openssl crypto/openssl -svn merge $FSVN/vendor-crypto/openssl/dist crypto/openssl +svn merge $FSVN/vendor-crypto/openssl/dist-0.9.8 crypto/openssl # Resolve conflicts manually Modified: vendor-crypto/openssl/dist-0.9.8/Makefile ============================================================================== --- vendor-crypto/openssl/dist-0.9.8/Makefile Thu Mar 7 21:43:21 2013 (r247956) +++ vendor-crypto/openssl/dist-0.9.8/Makefile Thu Mar 7 21:47:13 2013 (r247957) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=0.9.8x +VERSION=0.9.8y MAJOR=0 MINOR=9.8 SHLIB_VERSION_NUMBER=0.9.8 Modified: vendor-crypto/openssl/dist-0.9.8/NEWS ============================================================================== --- vendor-crypto/openssl/dist-0.9.8/NEWS Thu Mar 7 21:43:21 2013 (r247956) +++ vendor-crypto/openssl/dist-0.9.8/NEWS Thu Mar 7 21:47:13 2013 (r247957) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 0.9.8x and OpenSSL 0.9.8y: + + o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169 + o Fix OCSP bad key DoS attack CVE-2013-0166 + Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x: o Fix DTLS record length checking bug CVE-2012-2333 Modified: vendor-crypto/openssl/dist-0.9.8/README ============================================================================== --- vendor-crypto/openssl/dist-0.9.8/README Thu Mar 7 21:43:21 2013 (r247956) +++ vendor-crypto/openssl/dist-0.9.8/README Thu Mar 7 21:47:13 2013 (r247957) @@ -1,5 +1,5 @@ - OpenSSL 0.9.8x 10 May 2012 + OpenSSL 0.9.8y 5 Feb 2013 Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: vendor-crypto/openssl/dist-0.9.8/apps/Makefile ============================================================================== --- vendor-crypto/openssl/dist-0.9.8/apps/Makefile Thu Mar 7 21:43:21 2013 (r247956) +++ vendor-crypto/openssl/dist-0.9.8/apps/Makefile Thu Mar 7 21:47:13 2013 (r247957) @@ -176,703 +176,720 @@ progs.h: progs.pl app_rand.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h app_rand.o: ../include/openssl/buffer.h ../include/openssl/conf.h app_rand.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -app_rand.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -app_rand.o: ../include/openssl/engine.h ../include/openssl/evp.h -app_rand.o: ../include/openssl/fips.h ../include/openssl/lhash.h -app_rand.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -app_rand.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -app_rand.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -app_rand.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h -app_rand.o: ../include/openssl/safestack.h ../include/openssl/sha.h -app_rand.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -app_rand.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -app_rand.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h -app_rand.o: app_rand.c apps.h +app_rand.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +app_rand.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +app_rand.o: ../include/openssl/evp.h ../include/openssl/fips.h +app_rand.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +app_rand.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +app_rand.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +app_rand.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h +app_rand.o: ../include/openssl/rand.h ../include/openssl/safestack.h +app_rand.o: ../include/openssl/sha.h ../include/openssl/stack.h +app_rand.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +app_rand.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +app_rand.o: ../include/openssl/x509v3.h app_rand.c apps.h apps.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h apps.o: ../include/openssl/bn.h ../include/openssl/buffer.h apps.o: ../include/openssl/conf.h ../include/openssl/crypto.h apps.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -apps.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -apps.o: ../include/openssl/err.h ../include/openssl/evp.h -apps.o: ../include/openssl/fips.h ../include/openssl/lhash.h -apps.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -apps.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -apps.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -apps.o: ../include/openssl/pem.h ../include/openssl/pem2.h -apps.o: ../include/openssl/pkcs12.h ../include/openssl/pkcs7.h -apps.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -apps.o: ../include/openssl/sha.h ../include/openssl/stack.h -apps.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -apps.o: ../include/openssl/ui.h ../include/openssl/x509.h -apps.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.c apps.h +apps.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +apps.o: ../include/openssl/engine.h ../include/openssl/err.h +apps.o: ../include/openssl/evp.h ../include/openssl/fips.h +apps.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +apps.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +apps.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +apps.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +apps.o: ../include/openssl/pem2.h ../include/openssl/pkcs12.h +apps.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h +apps.o: ../include/openssl/safestack.h ../include/openssl/sha.h +apps.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +apps.o: ../include/openssl/txt_db.h ../include/openssl/ui.h +apps.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +apps.o: ../include/openssl/x509v3.h apps.c apps.h asn1pars.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h asn1pars.o: ../include/openssl/buffer.h ../include/openssl/conf.h asn1pars.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -asn1pars.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -asn1pars.o: ../include/openssl/engine.h ../include/openssl/err.h -asn1pars.o: ../include/openssl/evp.h ../include/openssl/fips.h -asn1pars.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -asn1pars.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -asn1pars.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -asn1pars.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -asn1pars.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -asn1pars.o: ../include/openssl/safestack.h ../include/openssl/sha.h -asn1pars.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -asn1pars.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -asn1pars.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -asn1pars.o: asn1pars.c +asn1pars.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +asn1pars.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +asn1pars.o: ../include/openssl/err.h ../include/openssl/evp.h +asn1pars.o: ../include/openssl/fips.h ../include/openssl/lhash.h +asn1pars.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +asn1pars.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +asn1pars.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +asn1pars.o: ../include/openssl/pem.h ../include/openssl/pem2.h +asn1pars.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +asn1pars.o: ../include/openssl/sha.h ../include/openssl/stack.h +asn1pars.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +asn1pars.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +asn1pars.o: ../include/openssl/x509v3.h apps.h asn1pars.c ca.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ca.o: ../include/openssl/bn.h ../include/openssl/buffer.h ca.o: ../include/openssl/conf.h ../include/openssl/crypto.h ca.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ca.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ca.o: ../include/openssl/err.h ../include/openssl/evp.h -ca.o: ../include/openssl/fips.h ../include/openssl/lhash.h -ca.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ca.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -ca.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ca.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ca.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -ca.o: ../include/openssl/sha.h ../include/openssl/stack.h -ca.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -ca.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ca.o: ../include/openssl/x509v3.h apps.h ca.c +ca.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ca.o: ../include/openssl/engine.h ../include/openssl/err.h +ca.o: ../include/openssl/evp.h ../include/openssl/fips.h +ca.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ca.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +ca.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ca.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ca.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ca.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ca.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ca.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +ca.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ca.c ciphers.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ciphers.o: ../include/openssl/bn.h ../include/openssl/buffer.h ciphers.o: ../include/openssl/comp.h ../include/openssl/conf.h ciphers.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h ciphers.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ciphers.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ciphers.o: ../include/openssl/err.h ../include/openssl/evp.h -ciphers.o: ../include/openssl/fips.h ../include/openssl/hmac.h -ciphers.o: ../include/openssl/kssl.h ../include/openssl/lhash.h -ciphers.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ciphers.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -ciphers.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ciphers.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ciphers.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h -ciphers.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h -ciphers.o: ../include/openssl/sha.h ../include/openssl/ssl.h -ciphers.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h -ciphers.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ciphers.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ciphers.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -ciphers.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -ciphers.o: ciphers.c +ciphers.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ciphers.o: ../include/openssl/engine.h ../include/openssl/err.h +ciphers.o: ../include/openssl/evp.h ../include/openssl/fips.h +ciphers.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +ciphers.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ciphers.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +ciphers.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ciphers.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ciphers.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ciphers.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h +ciphers.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ciphers.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +ciphers.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h +ciphers.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ciphers.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h +ciphers.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ciphers.o: ../include/openssl/x509v3.h apps.h ciphers.c cms.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h cms.o: ../include/openssl/buffer.h ../include/openssl/conf.h cms.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -cms.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -cms.o: ../include/openssl/engine.h ../include/openssl/evp.h -cms.o: ../include/openssl/fips.h ../include/openssl/lhash.h -cms.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -cms.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -cms.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -cms.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -cms.o: ../include/openssl/sha.h ../include/openssl/stack.h -cms.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -cms.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -cms.o: ../include/openssl/x509v3.h apps.h cms.c +cms.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +cms.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +cms.o: ../include/openssl/evp.h ../include/openssl/fips.h +cms.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +cms.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +cms.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +cms.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h +cms.o: ../include/openssl/safestack.h ../include/openssl/sha.h +cms.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +cms.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +cms.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h cms.c crl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h crl.o: ../include/openssl/buffer.h ../include/openssl/conf.h crl.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -crl.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -crl.o: ../include/openssl/engine.h ../include/openssl/err.h -crl.o: ../include/openssl/evp.h ../include/openssl/fips.h -crl.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -crl.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -crl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -crl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -crl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -crl.o: ../include/openssl/safestack.h ../include/openssl/sha.h -crl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -crl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -crl.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h crl.c +crl.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +crl.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +crl.o: ../include/openssl/err.h ../include/openssl/evp.h +crl.o: ../include/openssl/fips.h ../include/openssl/lhash.h +crl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +crl.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +crl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +crl.o: ../include/openssl/pem.h ../include/openssl/pem2.h +crl.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +crl.o: ../include/openssl/sha.h ../include/openssl/stack.h +crl.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +crl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +crl.o: ../include/openssl/x509v3.h apps.h crl.c crl2p7.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h crl2p7.o: ../include/openssl/buffer.h ../include/openssl/conf.h crl2p7.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -crl2p7.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -crl2p7.o: ../include/openssl/engine.h ../include/openssl/err.h -crl2p7.o: ../include/openssl/evp.h ../include/openssl/fips.h -crl2p7.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -crl2p7.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -crl2p7.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -crl2p7.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -crl2p7.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -crl2p7.o: ../include/openssl/safestack.h ../include/openssl/sha.h -crl2p7.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -crl2p7.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -crl2p7.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -crl2p7.o: crl2p7.c +crl2p7.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +crl2p7.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +crl2p7.o: ../include/openssl/err.h ../include/openssl/evp.h +crl2p7.o: ../include/openssl/fips.h ../include/openssl/lhash.h +crl2p7.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +crl2p7.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +crl2p7.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +crl2p7.o: ../include/openssl/pem.h ../include/openssl/pem2.h +crl2p7.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +crl2p7.o: ../include/openssl/sha.h ../include/openssl/stack.h +crl2p7.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +crl2p7.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +crl2p7.o: ../include/openssl/x509v3.h apps.h crl2p7.c dgst.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dgst.o: ../include/openssl/buffer.h ../include/openssl/conf.h dgst.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -dgst.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -dgst.o: ../include/openssl/engine.h ../include/openssl/err.h -dgst.o: ../include/openssl/evp.h ../include/openssl/fips.h -dgst.o: ../include/openssl/hmac.h ../include/openssl/lhash.h -dgst.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -dgst.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -dgst.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -dgst.o: ../include/openssl/pem.h ../include/openssl/pem2.h -dgst.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -dgst.o: ../include/openssl/sha.h ../include/openssl/stack.h -dgst.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -dgst.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -dgst.o: ../include/openssl/x509v3.h apps.h dgst.c +dgst.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +dgst.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +dgst.o: ../include/openssl/err.h ../include/openssl/evp.h +dgst.o: ../include/openssl/fips.h ../include/openssl/hmac.h +dgst.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +dgst.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +dgst.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dgst.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +dgst.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +dgst.o: ../include/openssl/safestack.h ../include/openssl/sha.h +dgst.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +dgst.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +dgst.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dgst.c dh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dh.o: ../include/openssl/bn.h ../include/openssl/buffer.h dh.o: ../include/openssl/conf.h ../include/openssl/crypto.h dh.o: ../include/openssl/dh.h ../include/openssl/e_os2.h -dh.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -dh.o: ../include/openssl/engine.h ../include/openssl/err.h -dh.o: ../include/openssl/evp.h ../include/openssl/fips.h -dh.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -dh.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -dh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -dh.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -dh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -dh.o: ../include/openssl/safestack.h ../include/openssl/sha.h -dh.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -dh.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -dh.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dh.c +dh.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +dh.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +dh.o: ../include/openssl/err.h ../include/openssl/evp.h +dh.o: ../include/openssl/fips.h ../include/openssl/lhash.h +dh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +dh.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +dh.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +dh.o: ../include/openssl/pem.h ../include/openssl/pem2.h +dh.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +dh.o: ../include/openssl/sha.h ../include/openssl/stack.h +dh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +dh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +dh.o: ../include/openssl/x509v3.h apps.h dh.c dsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h dsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h dsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h -dsa.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -dsa.o: ../include/openssl/engine.h ../include/openssl/err.h -dsa.o: ../include/openssl/evp.h ../include/openssl/fips.h -dsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -dsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -dsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -dsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -dsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -dsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h -dsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -dsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -dsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h dsa.c +dsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +dsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +dsa.o: ../include/openssl/err.h ../include/openssl/evp.h +dsa.o: ../include/openssl/fips.h ../include/openssl/lhash.h +dsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +dsa.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +dsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +dsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h +dsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +dsa.o: ../include/openssl/sha.h ../include/openssl/stack.h +dsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +dsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +dsa.o: ../include/openssl/x509v3.h apps.h dsa.c dsaparam.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h dsaparam.o: ../include/openssl/bn.h ../include/openssl/buffer.h dsaparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h dsaparam.o: ../include/openssl/dh.h ../include/openssl/dsa.h dsaparam.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -dsaparam.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -dsaparam.o: ../include/openssl/err.h ../include/openssl/evp.h -dsaparam.o: ../include/openssl/fips.h ../include/openssl/lhash.h -dsaparam.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -dsaparam.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -dsaparam.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -dsaparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h -dsaparam.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h -dsaparam.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -dsaparam.o: ../include/openssl/sha.h ../include/openssl/stack.h -dsaparam.o: ../include/openssl/store.h ../include/openssl/symhacks.h -dsaparam.o: ../include/openssl/txt_db.h ../include/openssl/ui.h -dsaparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -dsaparam.o: ../include/openssl/x509v3.h apps.h dsaparam.c +dsaparam.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +dsaparam.o: ../include/openssl/engine.h ../include/openssl/err.h +dsaparam.o: ../include/openssl/evp.h ../include/openssl/fips.h +dsaparam.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +dsaparam.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +dsaparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dsaparam.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +dsaparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +dsaparam.o: ../include/openssl/rand.h ../include/openssl/rsa.h +dsaparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h +dsaparam.o: ../include/openssl/stack.h ../include/openssl/store.h +dsaparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +dsaparam.o: ../include/openssl/ui.h ../include/openssl/x509.h +dsaparam.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +dsaparam.o: dsaparam.c ec.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ec.o: ../include/openssl/buffer.h ../include/openssl/conf.h ec.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -ec.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -ec.o: ../include/openssl/engine.h ../include/openssl/err.h -ec.o: ../include/openssl/evp.h ../include/openssl/fips.h -ec.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ec.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -ec.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ec.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ec.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ec.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ec.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ec.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -ec.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ec.c +ec.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +ec.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +ec.o: ../include/openssl/err.h ../include/openssl/evp.h +ec.o: ../include/openssl/fips.h ../include/openssl/lhash.h +ec.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ec.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +ec.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ec.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ec.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +ec.o: ../include/openssl/sha.h ../include/openssl/stack.h +ec.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +ec.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ec.o: ../include/openssl/x509v3.h apps.h ec.c ecparam.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ecparam.o: ../include/openssl/bn.h ../include/openssl/buffer.h ecparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h ecparam.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ecparam.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ecparam.o: ../include/openssl/err.h ../include/openssl/evp.h -ecparam.o: ../include/openssl/fips.h ../include/openssl/lhash.h -ecparam.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ecparam.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -ecparam.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ecparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ecparam.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -ecparam.o: ../include/openssl/sha.h ../include/openssl/stack.h -ecparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -ecparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ecparam.o: ../include/openssl/x509v3.h apps.h ecparam.c +ecparam.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ecparam.o: ../include/openssl/engine.h ../include/openssl/err.h +ecparam.o: ../include/openssl/evp.h ../include/openssl/fips.h +ecparam.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ecparam.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +ecparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ecparam.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ecparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ecparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ecparam.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ecparam.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +ecparam.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +ecparam.o: ecparam.c enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h enc.o: ../include/openssl/buffer.h ../include/openssl/conf.h enc.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -enc.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -enc.o: ../include/openssl/engine.h ../include/openssl/err.h -enc.o: ../include/openssl/evp.h ../include/openssl/fips.h -enc.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -enc.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -enc.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -enc.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -enc.o: ../include/openssl/rand.h ../include/openssl/safestack.h -enc.o: ../include/openssl/sha.h ../include/openssl/stack.h -enc.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -enc.o: ../include/openssl/x509v3.h apps.h enc.c +enc.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +enc.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +enc.o: ../include/openssl/err.h ../include/openssl/evp.h +enc.o: ../include/openssl/fips.h ../include/openssl/lhash.h +enc.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +enc.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +enc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h +enc.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h +enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +enc.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +enc.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h enc.c engine.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h engine.o: ../include/openssl/bn.h ../include/openssl/buffer.h engine.o: ../include/openssl/comp.h ../include/openssl/conf.h engine.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h engine.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -engine.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -engine.o: ../include/openssl/err.h ../include/openssl/evp.h -engine.o: ../include/openssl/fips.h ../include/openssl/hmac.h -engine.o: ../include/openssl/kssl.h ../include/openssl/lhash.h -engine.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -engine.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -engine.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -engine.o: ../include/openssl/pem.h ../include/openssl/pem2.h -engine.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h -engine.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h -engine.o: ../include/openssl/sha.h ../include/openssl/ssl.h -engine.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h -engine.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -engine.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -engine.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -engine.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -engine.o: engine.c +engine.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +engine.o: ../include/openssl/engine.h ../include/openssl/err.h +engine.o: ../include/openssl/evp.h ../include/openssl/fips.h +engine.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +engine.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +engine.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +engine.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +engine.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +engine.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +engine.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h +engine.o: ../include/openssl/safestack.h ../include/openssl/sha.h +engine.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +engine.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h +engine.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +engine.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h +engine.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +engine.o: ../include/openssl/x509v3.h apps.h engine.c errstr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h errstr.o: ../include/openssl/bn.h ../include/openssl/buffer.h errstr.o: ../include/openssl/comp.h ../include/openssl/conf.h errstr.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h errstr.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -errstr.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -errstr.o: ../include/openssl/err.h ../include/openssl/evp.h -errstr.o: ../include/openssl/fips.h ../include/openssl/hmac.h -errstr.o: ../include/openssl/kssl.h ../include/openssl/lhash.h -errstr.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -errstr.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -errstr.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -errstr.o: ../include/openssl/pem.h ../include/openssl/pem2.h -errstr.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h -errstr.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h -errstr.o: ../include/openssl/sha.h ../include/openssl/ssl.h -errstr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h -errstr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -errstr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -errstr.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -errstr.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -errstr.o: errstr.c +errstr.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +errstr.o: ../include/openssl/engine.h ../include/openssl/err.h +errstr.o: ../include/openssl/evp.h ../include/openssl/fips.h +errstr.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +errstr.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +errstr.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +errstr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +errstr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +errstr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +errstr.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h +errstr.o: ../include/openssl/safestack.h ../include/openssl/sha.h +errstr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +errstr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h +errstr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +errstr.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h +errstr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +errstr.o: ../include/openssl/x509v3.h apps.h errstr.c gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h gendh.o: ../include/openssl/dh.h ../include/openssl/dsa.h gendh.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -gendh.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -gendh.o: ../include/openssl/err.h ../include/openssl/evp.h -gendh.o: ../include/openssl/fips.h ../include/openssl/lhash.h -gendh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -gendh.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -gendh.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -gendh.o: ../include/openssl/pem.h ../include/openssl/pem2.h -gendh.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h -gendh.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -gendh.o: ../include/openssl/sha.h ../include/openssl/stack.h -gendh.o: ../include/openssl/store.h ../include/openssl/symhacks.h -gendh.o: ../include/openssl/txt_db.h ../include/openssl/ui.h -gendh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -gendh.o: ../include/openssl/x509v3.h apps.h gendh.c +gendh.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +gendh.o: ../include/openssl/engine.h ../include/openssl/err.h +gendh.o: ../include/openssl/evp.h ../include/openssl/fips.h +gendh.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +gendh.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +gendh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +gendh.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +gendh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +gendh.o: ../include/openssl/rand.h ../include/openssl/rsa.h +gendh.o: ../include/openssl/safestack.h ../include/openssl/sha.h +gendh.o: ../include/openssl/stack.h ../include/openssl/store.h +gendh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +gendh.o: ../include/openssl/ui.h ../include/openssl/x509.h +gendh.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +gendh.o: gendh.c gendsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h gendsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h gendsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h gendsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h -gendsa.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -gendsa.o: ../include/openssl/engine.h ../include/openssl/err.h -gendsa.o: ../include/openssl/evp.h ../include/openssl/fips.h -gendsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -gendsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -gendsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -gendsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -gendsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -gendsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h -gendsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -gendsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -gendsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -gendsa.o: gendsa.c +gendsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +gendsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +gendsa.o: ../include/openssl/err.h ../include/openssl/evp.h +gendsa.o: ../include/openssl/fips.h ../include/openssl/lhash.h +gendsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +gendsa.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +gendsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +gendsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h +gendsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +gendsa.o: ../include/openssl/sha.h ../include/openssl/stack.h +gendsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +gendsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +gendsa.o: ../include/openssl/x509v3.h apps.h gendsa.c genrsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h genrsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h genrsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h genrsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h genrsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -genrsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -genrsa.o: ../include/openssl/err.h ../include/openssl/evp.h -genrsa.o: ../include/openssl/fips.h ../include/openssl/lhash.h -genrsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -genrsa.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -genrsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -genrsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h -genrsa.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h -genrsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -genrsa.o: ../include/openssl/sha.h ../include/openssl/stack.h -genrsa.o: ../include/openssl/store.h ../include/openssl/symhacks.h -genrsa.o: ../include/openssl/txt_db.h ../include/openssl/ui.h -genrsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -genrsa.o: ../include/openssl/x509v3.h apps.h genrsa.c +genrsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +genrsa.o: ../include/openssl/engine.h ../include/openssl/err.h +genrsa.o: ../include/openssl/evp.h ../include/openssl/fips.h +genrsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +genrsa.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +genrsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +genrsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +genrsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +genrsa.o: ../include/openssl/rand.h ../include/openssl/rsa.h +genrsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h +genrsa.o: ../include/openssl/stack.h ../include/openssl/store.h +genrsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +genrsa.o: ../include/openssl/ui.h ../include/openssl/x509.h +genrsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +genrsa.o: genrsa.c nseq.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h nseq.o: ../include/openssl/buffer.h ../include/openssl/conf.h nseq.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -nseq.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -nseq.o: ../include/openssl/engine.h ../include/openssl/err.h -nseq.o: ../include/openssl/evp.h ../include/openssl/fips.h -nseq.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -nseq.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -nseq.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -nseq.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -nseq.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -nseq.o: ../include/openssl/safestack.h ../include/openssl/sha.h -nseq.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -nseq.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -nseq.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h nseq.c +nseq.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +nseq.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +nseq.o: ../include/openssl/err.h ../include/openssl/evp.h +nseq.o: ../include/openssl/fips.h ../include/openssl/lhash.h +nseq.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +nseq.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +nseq.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +nseq.o: ../include/openssl/pem.h ../include/openssl/pem2.h +nseq.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +nseq.o: ../include/openssl/sha.h ../include/openssl/stack.h +nseq.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +nseq.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +nseq.o: ../include/openssl/x509v3.h apps.h nseq.c ocsp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ocsp.o: ../include/openssl/bn.h ../include/openssl/buffer.h ocsp.o: ../include/openssl/comp.h ../include/openssl/conf.h ocsp.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h ocsp.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ocsp.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ocsp.o: ../include/openssl/err.h ../include/openssl/evp.h -ocsp.o: ../include/openssl/fips.h ../include/openssl/hmac.h -ocsp.o: ../include/openssl/kssl.h ../include/openssl/lhash.h -ocsp.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ocsp.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -ocsp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ocsp.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ocsp.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h -ocsp.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h -ocsp.o: ../include/openssl/sha.h ../include/openssl/ssl.h -ocsp.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h -ocsp.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ocsp.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ocsp.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -ocsp.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ocsp.c +ocsp.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ocsp.o: ../include/openssl/engine.h ../include/openssl/err.h +ocsp.o: ../include/openssl/evp.h ../include/openssl/fips.h +ocsp.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +ocsp.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ocsp.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +ocsp.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ocsp.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ocsp.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ocsp.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h +ocsp.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ocsp.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +ocsp.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h +ocsp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ocsp.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h +ocsp.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ocsp.o: ../include/openssl/x509v3.h apps.h ocsp.c openssl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h openssl.o: ../include/openssl/bn.h ../include/openssl/buffer.h openssl.o: ../include/openssl/comp.h ../include/openssl/conf.h openssl.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h openssl.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -openssl.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -openssl.o: ../include/openssl/err.h ../include/openssl/evp.h -openssl.o: ../include/openssl/fips.h ../include/openssl/hmac.h -openssl.o: ../include/openssl/kssl.h ../include/openssl/lhash.h -openssl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -openssl.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -openssl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -openssl.o: ../include/openssl/pem.h ../include/openssl/pem2.h -openssl.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h -openssl.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h -openssl.o: ../include/openssl/sha.h ../include/openssl/ssl.h -openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h -openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -openssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -openssl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -openssl.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -openssl.o: openssl.c progs.h s_apps.h +openssl.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +openssl.o: ../include/openssl/engine.h ../include/openssl/err.h +openssl.o: ../include/openssl/evp.h ../include/openssl/fips.h +openssl.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +openssl.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +openssl.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +openssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +openssl.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h +openssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h +openssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +openssl.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h +openssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +openssl.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h +openssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +openssl.o: ../include/openssl/x509v3.h apps.h openssl.c progs.h s_apps.h passwd.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h passwd.o: ../include/openssl/buffer.h ../include/openssl/conf.h passwd.o: ../include/openssl/crypto.h ../include/openssl/des.h passwd.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h -passwd.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -passwd.o: ../include/openssl/engine.h ../include/openssl/err.h -passwd.o: ../include/openssl/evp.h ../include/openssl/fips.h -passwd.o: ../include/openssl/lhash.h ../include/openssl/md5.h -passwd.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -passwd.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -passwd.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -passwd.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h -passwd.o: ../include/openssl/safestack.h ../include/openssl/sha.h -passwd.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -passwd.o: ../include/openssl/txt_db.h ../include/openssl/ui.h -passwd.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h -passwd.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -passwd.o: passwd.c +passwd.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +passwd.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +passwd.o: ../include/openssl/err.h ../include/openssl/evp.h +passwd.o: ../include/openssl/fips.h ../include/openssl/lhash.h +passwd.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h +passwd.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +passwd.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +passwd.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h +passwd.o: ../include/openssl/rand.h ../include/openssl/safestack.h +passwd.o: ../include/openssl/sha.h ../include/openssl/stack.h +passwd.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +passwd.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h +passwd.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +passwd.o: ../include/openssl/x509v3.h apps.h passwd.c pkcs12.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h pkcs12.o: ../include/openssl/buffer.h ../include/openssl/conf.h pkcs12.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -pkcs12.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -pkcs12.o: ../include/openssl/engine.h ../include/openssl/err.h -pkcs12.o: ../include/openssl/evp.h ../include/openssl/fips.h -pkcs12.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -pkcs12.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -pkcs12.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -pkcs12.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -pkcs12.o: ../include/openssl/pem2.h ../include/openssl/pkcs12.h -pkcs12.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -pkcs12.o: ../include/openssl/sha.h ../include/openssl/stack.h -pkcs12.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h -pkcs12.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -pkcs12.o: ../include/openssl/x509v3.h apps.h pkcs12.c +pkcs12.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +pkcs12.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +pkcs12.o: ../include/openssl/err.h ../include/openssl/evp.h +pkcs12.o: ../include/openssl/fips.h ../include/openssl/lhash.h +pkcs12.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +pkcs12.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +pkcs12.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +pkcs12.o: ../include/openssl/pem.h ../include/openssl/pem2.h +pkcs12.o: ../include/openssl/pkcs12.h ../include/openssl/pkcs7.h +pkcs12.o: ../include/openssl/safestack.h ../include/openssl/sha.h +pkcs12.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +pkcs12.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +pkcs12.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +pkcs12.o: pkcs12.c pkcs7.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h pkcs7.o: ../include/openssl/buffer.h ../include/openssl/conf.h pkcs7.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -pkcs7.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -pkcs7.o: ../include/openssl/engine.h ../include/openssl/err.h -pkcs7.o: ../include/openssl/evp.h ../include/openssl/fips.h -pkcs7.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -pkcs7.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -pkcs7.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -pkcs7.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -pkcs7.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -pkcs7.o: ../include/openssl/safestack.h ../include/openssl/sha.h -pkcs7.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -pkcs7.o: ../include/openssl/txt_db.h ../include/openssl/x509.h -pkcs7.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h -pkcs7.o: pkcs7.c +pkcs7.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +pkcs7.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +pkcs7.o: ../include/openssl/err.h ../include/openssl/evp.h +pkcs7.o: ../include/openssl/fips.h ../include/openssl/lhash.h +pkcs7.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +pkcs7.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +pkcs7.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +pkcs7.o: ../include/openssl/pem.h ../include/openssl/pem2.h +pkcs7.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +pkcs7.o: ../include/openssl/sha.h ../include/openssl/stack.h +pkcs7.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +pkcs7.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +pkcs7.o: ../include/openssl/x509v3.h apps.h pkcs7.c pkcs8.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h pkcs8.o: ../include/openssl/buffer.h ../include/openssl/conf.h pkcs8.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -pkcs8.o: ../include/openssl/ec.h ../include/openssl/ecdsa.h -pkcs8.o: ../include/openssl/engine.h ../include/openssl/err.h -pkcs8.o: ../include/openssl/evp.h ../include/openssl/fips.h -pkcs8.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -pkcs8.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -pkcs8.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -pkcs8.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -pkcs8.o: ../include/openssl/pem2.h ../include/openssl/pkcs12.h -pkcs8.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 21:48:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C71C59F6; Thu, 7 Mar 2013 21:48:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 894E769B; Thu, 7 Mar 2013 21:48:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Lm5nl021873; Thu, 7 Mar 2013 21:48:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Lm5Ha021872; Thu, 7 Mar 2013 21:48:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303072148.r27Lm5Ha021872@svn.freebsd.org> From: Xin LI Date: Thu, 7 Mar 2013 21:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247958 - vendor-crypto/openssl/0.9.8y X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 21:48:05 -0000 Author: delphij Date: Thu Mar 7 21:48:05 2013 New Revision: 247958 URL: http://svnweb.freebsd.org/changeset/base/247958 Log: Tag OpenSSL 0.9.8y. Added: vendor-crypto/openssl/0.9.8y/ - copied from r247957, vendor-crypto/openssl/dist-0.9.8/ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 22:05:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 99295E27; Thu, 7 Mar 2013 22:05:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7414C741; Thu, 7 Mar 2013 22:05:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27M5SHr027640; Thu, 7 Mar 2013 22:05:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27M5SFK027638; Thu, 7 Mar 2013 22:05:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072205.r27M5SFK027638@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 22:05: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: r247959 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 22:05:28 -0000 Author: tuexen Date: Thu Mar 7 22:05:27 2013 New Revision: 247959 URL: http://svnweb.freebsd.org/changeset/base/247959 Log: MFC r238002: Remove dead code (on FreeBSD) as suggested by glebius@. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 21:48:05 2013 (r247958) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 22:05:27 2013 (r247959) @@ -10893,7 +10893,6 @@ sctp_send_resp_msg(struct mbuf *m, struc int len, cause_len, padding_len, ret; #ifdef INET - sctp_route_t ro; struct ip *iph_out; #endif @@ -11057,8 +11056,6 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_ATTACH_CHAIN(o_pak, mout, len); #ifdef INET if (iph_out != NULL) { - /* zap the stack pointer to the route */ - bzero(&ro, sizeof(sctp_route_t)); if (port) { if (V_udp_cksum) { udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); @@ -11091,11 +11088,7 @@ sctp_send_resp_msg(struct mbuf *m, struc sctp_packet_log(o_pak); } #endif - SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); - /* Free the route if we got one back */ - if (ro.ro_rt) { - RTFREE(ro.ro_rt); - } + SCTP_IP_OUTPUT(ret, o_pak, NULL, NULL, vrf_id); } #endif #ifdef INET6 From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 22:16:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73F0617F; Thu, 7 Mar 2013 22:16:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 653D07B0; Thu, 7 Mar 2013 22:16:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27MGaAf031062; Thu, 7 Mar 2013 22:16:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27MGZ1b031061; Thu, 7 Mar 2013 22:16:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201303072216.r27MGZ1b031061@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Mar 2013 22:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247960 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 22:16:36 -0000 Author: dim Date: Thu Mar 7 22:16:35 2013 New Revision: 247960 URL: http://svnweb.freebsd.org/changeset/base/247960 Log: Make ctfconvert work correctly on clang-compiled object files. Clang puts the full original source filename in the STT_FILE entry of the ELF symbol table, while gcc saves only the basename. Since the DWARF DW_AT_name attribute contains the full source filename, both for clang and gcc, ctfconvert takes just the basename of it, for matching with the STT_FILE entry. So when attempting to match with such an entry, use its basename, if necessary. Reported by: avg MFC after: 1 week Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 22:05:27 2013 (r247959) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 22:16:35 2013 (r247960) @@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, for (i = 0; i < nent; i++) { GElf_Sym sym; + char *bname; iidesc_t **tolist; GElf_Sym ssym; iidesc_match_t smatch; @@ -377,6 +378,8 @@ sort_iidescs(Elf *elf, const char *file, switch (GELF_ST_TYPE(sym.st_info)) { case STT_FILE: + bname = strrchr(match.iim_name, '/'); + bname = bname == NULL ? match.iim_name : bname + 1; match.iim_file = match.iim_name; continue; case STT_OBJECT: From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 22:29:38 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 003204DC; Thu, 7 Mar 2013 22:29:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8DFD681B; Thu, 7 Mar 2013 22:29:36 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA23343; Fri, 08 Mar 2013 00:29:28 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UDjJY-000AsI-1j; Fri, 08 Mar 2013 00:29:28 +0200 Message-ID: <513914C4.4010001@FreeBSD.org> Date: Fri, 08 Mar 2013 00:29:24 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130220 Thunderbird/17.0.3 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r247960 - head/cddl/contrib/opensolaris/tools/ctf/cvt References: <201303072216.r27MGZ1b031061@svn.freebsd.org> In-Reply-To: <201303072216.r27MGZ1b031061@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 22:29:38 -0000 on 08/03/2013 00:16 Dimitry Andric said the following: > Author: dim > Date: Thu Mar 7 22:16:35 2013 > New Revision: 247960 > URL: http://svnweb.freebsd.org/changeset/base/247960 > > Log: > Make ctfconvert work correctly on clang-compiled object files. Clang > puts the full original source filename in the STT_FILE entry of the ELF > symbol table, while gcc saves only the basename. > > Since the DWARF DW_AT_name attribute contains the full source filename, > both for clang and gcc, ctfconvert takes just the basename of it, for > matching with the STT_FILE entry. So when attempting to match with such > an entry, use its basename, if necessary. I was not really kidding when I said that this change, as is, is a nop: > Reported by: avg > MFC after: 1 week > > Modified: > head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c > ============================================================================== > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 22:05:27 2013 (r247959) > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 22:16:35 2013 (r247960) > @@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, > > for (i = 0; i < nent; i++) { > GElf_Sym sym; > + char *bname; > iidesc_t **tolist; > GElf_Sym ssym; > iidesc_match_t smatch; > @@ -377,6 +378,8 @@ sort_iidescs(Elf *elf, const char *file, > > switch (GELF_ST_TYPE(sym.st_info)) { > case STT_FILE: > + bname = strrchr(match.iim_name, '/'); > + bname = bname == NULL ? match.iim_name : bname + 1; It would probably make sense to make use of bname after going to through all the trouble of calculating it: > match.iim_file = match.iim_name; Should be match.iim_file = bname ? Surprised that clang hasn't warned you about this one :-) > continue; > case STT_OBJECT: > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 22:32:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 24C46675; Thu, 7 Mar 2013 22:32:43 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E873C837; Thu, 7 Mar 2013 22:32:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27MWgAq036406; Thu, 7 Mar 2013 22:32:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27MWgFN036402; Thu, 7 Mar 2013 22:32:42 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201303072232.r27MWgFN036402@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 7 Mar 2013 22:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247961 - in head/sys: geom/part 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 22:32:43 -0000 Author: gavin Date: Thu Mar 7 22:32:41 2013 New Revision: 247961 URL: http://svnweb.freebsd.org/changeset/base/247961 Log: Support the FAT16 partition type in gpart(8) PR: kern/174714 Submitted by: 4721 at hushmail dot com MFC after: 1 week Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Thu Mar 7 22:16:35 2013 (r247960) +++ head/sys/geom/part/g_part.c Thu Mar 7 22:32:41 2013 (r247961) @@ -80,6 +80,7 @@ struct g_part_alias_list { { "bios-boot", G_PART_ALIAS_BIOS_BOOT }, { "ebr", G_PART_ALIAS_EBR }, { "efi", G_PART_ALIAS_EFI }, + { "fat16", G_PART_ALIAS_MS_FAT16 }, { "fat32", G_PART_ALIAS_MS_FAT32 }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Thu Mar 7 22:16:35 2013 (r247960) +++ head/sys/geom/part/g_part.h Thu Mar 7 22:32:41 2013 (r247961) @@ -68,6 +68,7 @@ enum g_part_alias { G_PART_ALIAS_NETBSD_SWAP, /* A NetBSD swap partition entry. */ G_PART_ALIAS_NETBSD_LFS, /* A NetBSD LFS partition entry. */ G_PART_ALIAS_EBR, /* A EBR partition entry. */ + G_PART_ALIAS_MS_FAT16, /* A Microsoft FAT16 partition entry. */ G_PART_ALIAS_MS_FAT32, /* A Microsoft FAT32 partition entry. */ G_PART_ALIAS_BIOS_BOOT, /* A GRUB 2 boot partition entry. */ G_PART_ALIAS_VMFS, /* A VMware VMFS partition entry */ Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Thu Mar 7 22:16:35 2013 (r247960) +++ head/sys/geom/part/g_part_mbr.c Thu Mar 7 22:32:41 2013 (r247961) @@ -118,6 +118,7 @@ static struct g_part_mbr_alias { { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, { DOSPTYP_EXT, G_PART_ALIAS_EBR }, { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, + { DOSPTYP_FAT16, G_PART_ALIAS_MS_FAT16 }, { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, { DOSPTYP_EXTLBA, G_PART_ALIAS_EBR }, { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Thu Mar 7 22:16:35 2013 (r247960) +++ head/sys/sys/diskmbr.h Thu Mar 7 22:32:41 2013 (r247961) @@ -45,6 +45,7 @@ #define DOSMAGIC 0xAA55 #define DOSPTYP_EXT 0x05 /* DOS extended partition */ +#define DOSPTYP_FAT16 0x06 /* FAT16 partition */ #define DOSPTYP_NTFS 0x07 /* NTFS partition */ #define DOSPTYP_FAT32 0x0b /* FAT32 partition */ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 22:43:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 708A7927; Thu, 7 Mar 2013 22:43:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58ECD8AF; Thu, 7 Mar 2013 22:43:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Mhov4039450; Thu, 7 Mar 2013 22:43:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Mhopv039449; Thu, 7 Mar 2013 22:43:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201303072243.r27Mhopv039449@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Mar 2013 22:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247962 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 22:43:51 -0000 Author: dim Date: Thu Mar 7 22:43:50 2013 New Revision: 247962 URL: http://svnweb.freebsd.org/changeset/base/247962 Log: Fix error in r247960: actually assign the basename to match.iim_file. Pointed out by: avg Pointy hat to: dim MFC after: 1 week X-MFC-With: r247960 Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 22:32:41 2013 (r247961) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 22:43:50 2013 (r247962) @@ -379,8 +379,7 @@ sort_iidescs(Elf *elf, const char *file, switch (GELF_ST_TYPE(sym.st_info)) { case STT_FILE: bname = strrchr(match.iim_name, '/'); - bname = bname == NULL ? match.iim_name : bname + 1; - match.iim_file = match.iim_name; + match.iim_file = bname == NULL ? match.iim_name : bname + 1; continue; case STT_OBJECT: tolist = iiburst->iib_objts; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 22:54:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C99AD76; Thu, 7 Mar 2013 22:54:29 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DC0A927; Thu, 7 Mar 2013 22:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27MsSDm042528; Thu, 7 Mar 2013 22:54:29 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27MsSMl042526; Thu, 7 Mar 2013 22:54:28 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201303072254.r27MsSMl042526@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 7 Mar 2013 22:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247963 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 22:54:29 -0000 Author: obrien Date: Thu Mar 7 22:54:28 2013 New Revision: 247963 URL: http://svnweb.freebsd.org/changeset/base/247963 Log: Fix GCC build: /usr/src/sys/modules/nvme/../../dev/nvme/nvme.c:211: warning: format '%qx' expects type 'long unsigned int', but argument 9 has type 'long long unsigned int' [-Wformat] Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Mar 7 22:43:50 2013 (r247962) +++ head/sys/dev/nvme/nvme.c Thu Mar 7 22:54:28 2013 (r247963) @@ -200,13 +200,11 @@ nvme_modevent(module_t mod, int type, vo void nvme_dump_command(struct nvme_command *cmd) { - printf("opc:%x f:%x r1:%x cid:%x nsid:%x r2:%x r3:%x " - "mptr:%qx prp1:%qx prp2:%qx cdw:%x %x %x %x %x %x\n", + printf( +"opc:%x f:%x r1:%x cid:%x nsid:%x r2:%x r3:%x mptr:%jx prp1:%jx prp2:%jx cdw:%x %x %x %x %x %x\n", cmd->opc, cmd->fuse, cmd->rsvd1, cmd->cid, cmd->nsid, cmd->rsvd2, cmd->rsvd3, - (long long unsigned int)cmd->mptr, - (long long unsigned int)cmd->prp1, - (long long unsigned int)cmd->prp2, + (uintmax_t)cmd->mptr, (uintmax_t)cmd->prp1, (uintmax_t)cmd->prp2, cmd->cdw10, cmd->cdw11, cmd->cdw12, cmd->cdw13, cmd->cdw14, cmd->cdw15); } Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Mar 7 22:43:50 2013 (r247962) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Mar 7 22:54:28 2013 (r247963) @@ -131,8 +131,8 @@ nvme_ctrlr_setup_chatham(struct nvme_con ctrlr->chatham_lbas = chatham_read_4(ctrlr, 0x8068) - 0x110; ctrlr->chatham_size = ctrlr->chatham_lbas * 512; - device_printf(ctrlr->dev, "Chatham size: %lld\n", - (long long)ctrlr->chatham_size); + device_printf(ctrlr->dev, "Chatham size: %jd\n", + (intmax_t)ctrlr->chatham_size); reg1 = reg2 = reg3 = ctrlr->chatham_size - 1; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:00:52 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ED05CF48; Thu, 7 Mar 2013 23:00:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id AD0A495C; Thu, 7 Mar 2013 23:00:52 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a] (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9B5655C44; Fri, 8 Mar 2013 00:00:45 +0100 (CET) Message-ID: <51391C1E.5030905@FreeBSD.org> Date: Fri, 08 Mar 2013 00:00:46 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r247960 - head/cddl/contrib/opensolaris/tools/ctf/cvt References: <201303072216.r27MGZ1b031061@svn.freebsd.org> <513914C4.4010001@FreeBSD.org> In-Reply-To: <513914C4.4010001@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:00:53 -0000 On 2013-03-07 23:29, Andriy Gapon wrote: ... > I was not really kidding when I said that this change, as is, is a nop: ... >> + bname = strrchr(match.iim_name, '/'); >> + bname = bname == NULL ? match.iim_name : bname + 1; > > It would probably make sense to make use of bname after going to through all the > trouble of calculating it: > >> match.iim_file = match.iim_name; > > Should be match.iim_file = bname ? Yes, I actually had this in my test code, and committed the wrong diff by accident. :( Fixed in r247962, in any case. > Surprised that clang hasn't warned you about this one :-) Clang currently does not have the -Wunused-but-set-variable warning; it is apparently available in the static analyzer. On the other hand, that warning is one of the most annoying ones that newer gcc's have. :-) From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:18:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 61E07690; Thu, 7 Mar 2013 23:18:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48CF7A14; Thu, 7 Mar 2013 23:18:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NIa6A049504; Thu, 7 Mar 2013 23:18:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NIZLj049502; Thu, 7 Mar 2013 23:18:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072318.r27NIZLj049502@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:18:35 +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: r247964 - stable/8/sys/netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:18:36 -0000 Author: tuexen Date: Thu Mar 7 23:18:35 2013 New Revision: 247964 URL: http://svnweb.freebsd.org/changeset/base/247964 Log: MFC r235916: Introduce in6_getscope() to allow more effective checksum computations without the need to copy the address to clear the scope. Modified: stable/8/sys/netinet6/scope6.c stable/8/sys/netinet6/scope6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet6/scope6.c ============================================================================== --- stable/8/sys/netinet6/scope6.c Thu Mar 7 22:54:28 2013 (r247963) +++ stable/8/sys/netinet6/scope6.c Thu Mar 7 23:18:35 2013 (r247964) @@ -486,3 +486,16 @@ in6_clearscope(struct in6_addr *in6) return (modified); } + +/* + * Return the scope identifier or zero. + */ +uint16_t +in6_getscope(struct in6_addr *in6) +{ + + if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) + return (in6->s6_addr16[1]); + + return (0); +} Modified: stable/8/sys/netinet6/scope6_var.h ============================================================================== --- stable/8/sys/netinet6/scope6_var.h Thu Mar 7 22:54:28 2013 (r247963) +++ stable/8/sys/netinet6/scope6_var.h Thu Mar 7 23:18:35 2013 (r247964) @@ -54,6 +54,7 @@ int sa6_embedscope __P((struct sockaddr_ int sa6_recoverscope __P((struct sockaddr_in6 *)); int in6_setscope __P((struct in6_addr *, struct ifnet *, u_int32_t *)); int in6_clearscope __P((struct in6_addr *)); +uint16_t in6_getscope(struct in6_addr *); #endif /* _KERNEL */ #endif /* _NETINET6_SCOPE6_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:23:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 47B0C88D; Thu, 7 Mar 2013 23:23:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3248AA4B; Thu, 7 Mar 2013 23:23:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NNRGD051806; Thu, 7 Mar 2013 23:23:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NNPJx051792; Thu, 7 Mar 2013 23:23:25 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072323.r27NNPJx051792@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:23:25 +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: r247965 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:23:27 -0000 Author: tuexen Date: Thu Mar 7 23:23:25 2013 New Revision: 247965 URL: http://svnweb.freebsd.org/changeset/base/247965 Log: MFC r237715,r238294: Pass the src and dst address of a received packet explicitly around. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_asconf.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 23:18:35 2013 (r247964) +++ stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 23:23:25 2013 (r247965) @@ -50,59 +50,8 @@ __FBSDID("$FreeBSD$"); */ -static void -sctp_asconf_get_source_ip(struct mbuf *m, struct sockaddr *sa) -{ - struct ip *iph; - -#ifdef INET - struct sockaddr_in *sin; - -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6; - -#endif - - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - /* IPv4 source */ - sin = (struct sockaddr_in *)sa; - bzero(sin, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(struct sockaddr_in); - sin->sin_port = 0; - sin->sin_addr.s_addr = iph->ip_src.s_addr; - break; - } -#endif -#ifdef INET6 - case (IPV6_VERSION >> 4): - { - /* IPv6 source */ - struct ip6_hdr *ip6; - - sin6 = (struct sockaddr_in6 *)sa; - bzero(sin6, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(struct sockaddr_in6); - sin6->sin6_port = 0; - ip6 = mtod(m, struct ip6_hdr *); - sin6->sin6_addr = ip6->ip6_src; - break; - } -#endif /* INET6 */ - default: - break; - } - return; -} - /* - * draft-ietf-tsvwg-addip-sctp + * RFC 5061 * * An ASCONF parameter queue exists per asoc which holds the pending address * operations. Lists are updated upon receipt of ASCONF-ACK. @@ -194,12 +143,12 @@ sctp_asconf_error_response(uint32_t id, } static struct mbuf * -sctp_process_asconf_add_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, +sctp_process_asconf_add_ip(struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int send_hb, int response_required) { struct sctp_nets *net; struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -279,11 +228,10 @@ sctp_process_asconf_add_ip(struct mbuf * /* if 0.0.0.0/::0, add the source address instead */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - sa = (struct sockaddr *)&sa_source; - sctp_asconf_get_source_ip(m, sa); + sa = src; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: using source addr "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } /* add the address */ if (bad_address) { @@ -343,11 +291,12 @@ sctp_asconf_del_remote_addrs_except(stru } static struct mbuf * -sctp_process_asconf_delete_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, +sctp_process_asconf_delete_ip(struct sockaddr *src, + struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -365,9 +314,6 @@ sctp_process_asconf_delete_ip(struct mbu #endif - /* get the source IP address for src and 0.0.0.0/::0 delete checks */ - sctp_asconf_get_source_ip(m, (struct sockaddr *)&sa_source); - aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); @@ -424,7 +370,7 @@ sctp_process_asconf_delete_ip(struct mbu } /* make sure the source address is not being deleted */ - if (sctp_cmpaddr(sa, (struct sockaddr *)&sa_source)) { + if (sctp_cmpaddr(sa, src)) { /* trying to delete the source address! */ SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete source addr\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, @@ -434,8 +380,7 @@ sctp_process_asconf_delete_ip(struct mbu } /* if deleting 0.0.0.0/::0, delete all addresses except src addr */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - result = sctp_asconf_del_remote_addrs_except(stcb, - (struct sockaddr *)&sa_source); + result = sctp_asconf_del_remote_addrs_except(stcb, src); if (result) { /* src address did not exist? */ @@ -475,12 +420,12 @@ sctp_process_asconf_delete_ip(struct mbu } static struct mbuf * -sctp_process_asconf_set_primary(struct mbuf *m, +sctp_process_asconf_set_primary(struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -550,11 +495,10 @@ sctp_process_asconf_set_primary(struct m /* if 0.0.0.0/::0, use the source address instead */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - sa = (struct sockaddr *)&sa_source; - sctp_asconf_get_source_ip(m, sa); + sa = src; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: using source addr "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } /* set the primary address */ if (sctp_set_primary_addr(stcb, sa, NULL) == 0) { @@ -626,6 +570,7 @@ sctp_process_asconf_set_primary(struct m */ void sctp_handle_asconf(struct mbuf *m, unsigned int offset, + struct sockaddr *src, struct sctp_asconf_chunk *cp, struct sctp_tcb *stcb, int first) { @@ -762,13 +707,13 @@ sctp_handle_asconf(struct mbuf *m, unsig switch (param_type) { case SCTP_ADD_IP_ADDRESS: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_add_ip(m, aph, stcb, + m_result = sctp_process_asconf_add_ip(src, aph, stcb, (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error); cnt++; break; case SCTP_DEL_IP_ADDRESS: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_delete_ip(m, aph, stcb, + m_result = sctp_process_asconf_delete_ip(src, aph, stcb, error); break; case SCTP_ERROR_CAUSE_IND: @@ -776,7 +721,7 @@ sctp_handle_asconf(struct mbuf *m, unsig break; case SCTP_SET_PRIM_ADDR: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_set_primary(m, aph, + m_result = sctp_process_asconf_set_primary(src, aph, stcb, error); break; case SCTP_NAT_VTAGS: @@ -856,11 +801,7 @@ send_reply: * this could happen if the source address was just newly * added */ - struct sockaddr_storage addr; - struct sockaddr *src = (struct sockaddr *)&addr; - SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n"); - sctp_asconf_get_source_ip(m, src); SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); /* look up the from address */ Modified: stable/8/sys/netinet/sctp_asconf.h ============================================================================== --- stable/8/sys/netinet/sctp_asconf.h Thu Mar 7 23:18:35 2013 (r247964) +++ stable/8/sys/netinet/sctp_asconf.h Thu Mar 7 23:23:25 2013 (r247965) @@ -46,8 +46,8 @@ extern void sctp_asconf_cleanup(struct s extern struct mbuf *sctp_compose_asconf(struct sctp_tcb *, int *, int); extern void -sctp_handle_asconf(struct mbuf *, unsigned int, struct sctp_asconf_chunk *, - struct sctp_tcb *, int i); +sctp_handle_asconf(struct mbuf *, unsigned int, struct sockaddr *, + struct sctp_asconf_chunk *, struct sctp_tcb *, int); extern void sctp_handle_asconf_ack(struct mbuf *, int, struct sctp_asconf_ack_chunk *, Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Thu Mar 7 23:18:35 2013 (r247964) +++ stable/8/sys/netinet/sctp_indata.c Thu Mar 7 23:23:25 2013 (r247965) @@ -2516,6 +2516,7 @@ doit_again: int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, uint8_t use_mflowid, uint32_t mflowid, @@ -2626,8 +2627,8 @@ sctp_process_data(struct mbuf **mm, int } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; - sctp_abort_association(inp, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); return (2); @@ -2695,6 +2696,7 @@ sctp_process_data(struct mbuf **mm, int op_err = sctp_generate_invmanparam(SCTP_CAUSE_PROTOCOL_VIOLATION); sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Thu Mar 7 23:18:35 2013 (r247964) +++ stable/8/sys/netinet/sctp_indata.h Thu Mar 7 23:23:25 2013 (r247965) @@ -111,7 +111,9 @@ void sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, int *); int -sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, +sctp_process_data(struct mbuf **, int, int *, int, + struct sockaddr *src, struct sockaddr *dst, + struct sctphdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint32_t *, uint8_t, uint32_t, Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 23:18:35 2013 (r247964) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 23:23:25 2013 (r247965) @@ -80,7 +80,8 @@ sctp_stop_all_cookie_timers(struct sctp_ /* INIT handler */ static void -sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_handle_init(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -97,7 +98,7 @@ sctp_handle_init(struct mbuf *m, int iph /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -109,7 +110,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->initiate_tag == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -119,7 +120,7 @@ sctp_handle_init(struct mbuf *m, int iph if (ntohl(init->a_rwnd) < SCTP_MIN_RWND) { /* invalid parameter... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -129,7 +130,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->num_inbound_streams == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -139,7 +140,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->num_outbound_streams == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -149,7 +150,7 @@ sctp_handle_init(struct mbuf *m, int iph if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -178,7 +179,7 @@ sctp_handle_init(struct mbuf *m, int iph * state :-) */ if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { - sctp_send_abort(m, iphlen, sh, 0, NULL, + sctp_send_abort(m, iphlen, src, dst, sh, 0, NULL, use_mflowid, mflowid, vrf_id, port); } @@ -191,7 +192,8 @@ sctp_handle_init(struct mbuf *m, int iph sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } else { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, src, dst, + sh, cp, use_mflowid, mflowid, vrf_id, port, ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); @@ -419,7 +421,8 @@ sctp_process_init(struct sctp_init_chunk * INIT-ACK message processing/consumption returns value < 0 on error */ static int -sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -454,13 +457,14 @@ sctp_process_init_ack(struct mbuf *m, in initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ if ((retval = sctp_load_addresses_from_init(stcb, m, - (offset + sizeof(struct sctp_init_chunk)), initack_limit, sh, - NULL))) { + (offset + sizeof(struct sctp_init_chunk)), initack_limit, + src, dst, NULL))) { /* Huh, we should abort */ SCTPDBG(SCTP_DEBUG_INPUT1, "Load addresses from INIT causes an abort %d\n", retval); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, NULL, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -536,7 +540,7 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1278,7 +1282,8 @@ sctp_handle_error(struct sctp_chunkhdr * } static int -sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -1298,8 +1303,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_ack_chunk)) { /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1310,8 +1315,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->initiate_tag == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1320,8 +1325,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1330,8 +1335,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->num_inbound_streams == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1340,8 +1345,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->num_outbound_streams == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1365,7 +1370,7 @@ sctp_handle_init_ack(struct mbuf *m, int sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, stcb, 0, (void *)stcb->asoc.primary_destination, SCTP_SO_NOT_LOCKED); } - if (sctp_process_init_ack(m, iphlen, offset, sh, cp, stcb, + if (sctp_process_init_ack(m, iphlen, offset, src, dst, sh, cp, stcb, net, abort_no_unlock, use_mflowid, mflowid, vrf_id) < 0) { @@ -1419,6 +1424,7 @@ sctp_handle_init_ack(struct mbuf *m, int static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -1435,6 +1441,7 @@ sctp_process_cookie_new(struct mbuf *m, */ static struct sctp_tcb * sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -1477,7 +1484,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_COOKIE_IN_SHUTDOWN); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, use_mflowid, mflowid, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) @@ -1642,7 +1649,7 @@ sctp_process_cookie_existing(struct mbuf */ if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 4; return (NULL); @@ -1703,7 +1710,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_NAT_COLLIDING_STATE); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_abort(m, iphlen, sh, 0, op_err, + sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -1786,7 +1793,7 @@ sctp_process_cookie_existing(struct mbuf } if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 10; return (NULL); @@ -1867,7 +1874,8 @@ sctp_process_cookie_existing(struct mbuf * cookie_new code since we are allowing a duplicate * association. I hope this works... */ - return (sctp_process_cookie_new(m, iphlen, offset, sh, cookie, cookie_len, + return (sctp_process_cookie_new(m, iphlen, offset, src, dst, + sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, @@ -1972,7 +1980,7 @@ sctp_process_cookie_existing(struct mbuf if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 14; @@ -2003,6 +2011,7 @@ sctp_process_cookie_existing(struct mbuf */ static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -2102,7 +2111,7 @@ sctp_process_cookie_new(struct mbuf *m, op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -2130,7 +2139,7 @@ sctp_process_cookie_new(struct mbuf *m, atomic_add_int(&stcb->asoc.refcnt, 1); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -2179,8 +2188,8 @@ sctp_process_cookie_new(struct mbuf *m, } /* load all addresses */ if (sctp_load_addresses_from_init(stcb, m, - init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, - init_src)) { + init_offset + sizeof(struct sctp_init_chunk), initack_offset, + src, dst, init_src)) { atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); @@ -2376,6 +2385,7 @@ sctp_process_cookie_new(struct mbuf *m, */ static struct mbuf * sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_cookie_echo_chunk *cp, struct sctp_inpcb **inp_p, struct sctp_tcb **stcb, struct sctp_nets **netp, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, @@ -2396,9 +2406,6 @@ sctp_handle_cookie_echo(struct mbuf *m, unsigned int cookie_len; struct timeval now; struct timeval time_expires; - struct sockaddr_storage dest_store; - struct sockaddr *localep_sa = (struct sockaddr *)&dest_store; - struct ip *iph; int notification = 0; struct sctp_nets *netl; int had_a_existing_tcb = 0; @@ -2419,45 +2426,6 @@ sctp_handle_cookie_echo(struct mbuf *m, if (inp_p == NULL) { return (NULL); } - /* First get the destination address setup too. */ - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - /* its IPv4 */ - struct sockaddr_in *lsin; - - lsin = (struct sockaddr_in *)(localep_sa); - memset(lsin, 0, sizeof(*lsin)); - lsin->sin_family = AF_INET; - lsin->sin_len = sizeof(*lsin); - lsin->sin_port = sh->dest_port; - lsin->sin_addr.s_addr = iph->ip_dst.s_addr; - break; - } -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - { - /* its IPv6 */ - struct ip6_hdr *ip6; - struct sockaddr_in6 *lsin6; - - lsin6 = (struct sockaddr_in6 *)(localep_sa); - memset(lsin6, 0, sizeof(*lsin6)); - lsin6->sin6_family = AF_INET6; - lsin6->sin6_len = sizeof(struct sockaddr_in6); - ip6 = mtod(m, struct ip6_hdr *); - lsin6->sin6_port = sh->dest_port; - lsin6->sin6_addr = ip6->ip6_dst; - break; - } -#endif - default: - return (NULL); - } - cookie = &cp->cookie; cookie_offset = offset + sizeof(struct sctp_chunkhdr); cookie_len = ntohs(cp->ch.chunk_length); @@ -2608,7 +2576,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (tim == 0) tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); - sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -2652,7 +2620,7 @@ sctp_handle_cookie_echo(struct mbuf *m, } if ((*stcb == NULL) && to) { /* Yep, lets check */ - *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, localep_sa, NULL); + *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, dst, NULL); if (*stcb == NULL) { /* * We should have only got back the same inp. If we @@ -2695,15 +2663,17 @@ sctp_handle_cookie_echo(struct mbuf *m, cookie_len -= SCTP_SIGNATURE_SIZE; if (*stcb == NULL) { /* this is the "normal" case... get a new TCB */ - *stcb = sctp_process_cookie_new(m, iphlen, offset, sh, cookie, - cookie_len, *inp_p, netp, to, ¬ification, + *stcb = sctp_process_cookie_new(m, iphlen, offset, src, dst, sh, + cookie, cookie_len, *inp_p, + netp, to, ¬ification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, vrf_id, port); } else { /* this is abnormal... cookie-echo on existing TCB */ had_a_existing_tcb = 1; - *stcb = sctp_process_cookie_existing(m, iphlen, offset, sh, + *stcb = sctp_process_cookie_existing(m, iphlen, offset, + src, dst, sh, cookie, cookie_len, *inp_p, *stcb, netp, to, ¬ification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, @@ -2788,7 +2758,7 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: no room for another socket!\n"); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(*inp_p, NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -4404,6 +4374,7 @@ __attribute__((noinline)) #endif static struct sctp_tcb * sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, uint8_t use_mflowid, uint32_t mflowid, @@ -4520,7 +4491,9 @@ __attribute__((noinline)) if (asconf_len < sizeof(struct sctp_asconf_paramhdr)) break; stcb = sctp_findassociation_ep_asconf(m, - *offset, sh, &inp, netp, vrf_id); + *offset, + dst, + sh, &inp, netp, vrf_id); if (stcb != NULL) break; asconf_offset += SCTP_SIZE32(asconf_len); @@ -4562,7 +4535,7 @@ __attribute__((noinline)) } if (stcb == NULL) { /* no association, so it's out of the blue... */ - sctp_handle_ootb(m, iphlen, *offset, sh, inp, + sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); *offset = length; @@ -4600,7 +4573,8 @@ __attribute__((noinline)) if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); } - sctp_handle_ootb(m, iphlen, *offset, sh, inp, + sctp_handle_ootb(m, iphlen, *offset, src, dst, + sh, inp, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -4742,8 +4716,8 @@ process_control_chunks: /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { - sctp_abort_association(inp, stcb, m, - iphlen, sh, NULL, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, port); *offset = length; @@ -4754,14 +4728,14 @@ process_control_chunks: struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); *offset = length; return (NULL); } - sctp_handle_init(m, iphlen, *offset, sh, + sctp_handle_init(m, iphlen, *offset, src, dst, sh, (struct sctp_init_chunk *)ch, inp, stcb, &abort_no_unlock, use_mflowid, mflowid, @@ -4813,7 +4787,8 @@ process_control_chunks: return (NULL); } if ((netp) && (*netp)) { - ret = sctp_handle_init_ack(m, iphlen, *offset, sh, + ret = sctp_handle_init_ack(m, iphlen, *offset, + src, dst, sh, (struct sctp_init_ack_chunk *)ch, stcb, *netp, &abort_no_unlock, @@ -5123,8 +5098,8 @@ process_control_chunks: struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); } @@ -5151,7 +5126,9 @@ process_control_chunks: if (netp) { ret_buf = sctp_handle_cookie_echo(m, iphlen, - *offset, sh, + *offset, + src, dst, + sh, (struct sctp_cookie_echo_chunk *)ch, &inp, &stcb, netp, auth_skipped, @@ -5314,7 +5291,7 @@ process_control_chunks: __LINE__); } stcb->asoc.overall_error_count = 0; - sctp_handle_asconf(m, *offset, + sctp_handle_asconf(m, *offset, src, (struct sctp_asconf_chunk *)ch, stcb, asconf_cnt == 0); asconf_cnt++; } @@ -5610,8 +5587,9 @@ __attribute__((noinline)) * common input chunk processing (v4 and v6) */ void -sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, - int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, +sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, + struct sockaddr *src, struct sockaddr *dst, + struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint8_t ecn_bits, uint8_t use_mflowid, uint32_t mflowid, @@ -5650,7 +5628,7 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); goto out_now; @@ -5659,7 +5637,8 @@ sctp_common_input_processing(struct mbuf if (IS_SCTP_CONTROL(ch)) { /* process the control portion of the SCTP packet */ /* sa_ignore NO_NULL_CHK */ - stcb = sctp_process_control(m, iphlen, &offset, length, sh, ch, + stcb = sctp_process_control(m, iphlen, &offset, length, + src, dst, sh, ch, inp, stcb, &net, &fwd_tsn_seen, use_mflowid, mflowid, vrf_id, port); @@ -5697,7 +5676,7 @@ sctp_common_input_processing(struct mbuf } if (stcb == NULL) { /* out of the blue DATA chunk */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); goto out_now; @@ -5767,7 +5746,7 @@ sctp_common_input_processing(struct mbuf /* * We consider OOTB any data sent during asoc setup. */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); SCTP_TCB_UNLOCK(stcb); @@ -5788,7 +5767,8 @@ sctp_common_input_processing(struct mbuf break; } /* plow through the data chunks while length > offset */ - retval = sctp_process_data(mm, iphlen, &offset, length, sh, + retval = sctp_process_data(mm, iphlen, &offset, length, + src, dst, sh, inp, stcb, net, &high_tsn, use_mflowid, mflowid, vrf_id, port); @@ -5883,6 +5863,7 @@ sctp_input_with_port(struct mbuf *i_pak, int iphlen; uint32_t vrf_id = 0; uint8_t ecn_bits; + struct sockaddr_in src, dst; struct ip *ip; struct sctphdr *sh; struct sctp_chunkhdr *ch; @@ -5932,18 +5913,27 @@ sctp_input_with_port(struct mbuf *i_pak, SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ - ip = mtod(m, struct ip *); offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { SCTP_STAT_INCR(sctps_hdrops); return; } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); sh = (struct sctphdr *)((caddr_t)ip + iphlen); ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); offset -= sizeof(struct sctp_chunkhdr); + memset(&src, 0, sizeof(struct sockaddr_in)); + src.sin_family = AF_INET; + src.sin_len = sizeof(struct sockaddr_in); + src.sin_port = sh->src_port; + src.sin_addr = ip->ip_src; + memset(&dst, 0, sizeof(struct sockaddr_in)); + dst.sin_family = AF_INET; + dst.sin_len = sizeof(struct sockaddr_in); + dst.sin_port = sh->dest_port; + dst.sin_addr = ip->ip_dst; length = ip->ip_len + iphlen; /* Validate mbuf chain length with IP payload length. */ if (SCTP_HEADER_LEN(i_pak) != length) { @@ -5953,10 +5943,10 @@ sctp_input_with_port(struct mbuf *i_pak, goto bad; } /* SCTP does not allow broadcasts or multicasts */ - if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { + if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) { goto bad; } - if (SCTP_IS_IT_BROADCAST(ip->ip_dst, m)) { + if (SCTP_IS_IT_BROADCAST(dst.sin_addr, m)) { goto bad; } SCTPDBG(SCTP_DEBUG_INPUT1, @@ -5982,6 +5972,8 @@ sctp_input_with_port(struct mbuf *i_pak, SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", calc_check, check, m, length, iphlen); stcb = sctp_findassociation_addr(m, offset, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6013,6 +6005,8 @@ sctp_skip_csum: goto bad; } stcb = sctp_findassociation_addr(m, offset, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6031,7 +6025,9 @@ sctp_skip_csum: if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2(m, sh, + sctp_send_shutdown_complete2((struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, use_mflowid, mflowid, vrf_id, port); goto bad; @@ -6043,7 +6039,10 @@ sctp_skip_csum: if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, sh, 0, NULL, + sctp_send_abort(m, iphlen, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, 0, NULL, use_mflowid, mflowid, vrf_id, port); } @@ -6066,8 +6065,10 @@ sctp_skip_csum: ecn_bits = ip->ip_tos; /* sa_ignore NO_NULL_CHK */ - sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - inp, stcb, net, ecn_bits, + sctp_common_input_processing(&m, iphlen, offset, length, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, ch, inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); if (m) { @@ -6119,15 +6120,14 @@ sctp_input(struct mbuf *m, int off) * No flow id built by lower layers fix it so we * create one. */ - ip = mtod(m, struct ip *); - offset = off + sizeof(*sh); + offset = off + sizeof(struct sctphdr); if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { SCTP_STAT_INCR(sctps_hdrops); return; } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); sh = (struct sctphdr *)((caddr_t)ip + off); tag = htonl(sh->v_tag); flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Thu Mar 7 23:18:35 2013 (r247964) +++ stable/8/sys/netinet/sctp_input.h Thu Mar 7 23:23:25 2013 (r247965) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) void sctp_common_input_processing(struct mbuf **, int, int, int, + struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint8_t, Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Thu Mar 7 23:18:35 2013 (r247964) +++ stable/8/sys/netinet/sctp_os_bsd.h Thu Mar 7 23:23:25 2013 (r247965) @@ -177,18 +177,9 @@ MALLOC_DECLARE(SCTP_M_MCORE); } \ } while (0); \ } -#define SCTPDBG_PKT(level, iph, sh) \ -{ \ - do { \ - if (SCTP_BASE_SYSCTL(sctp_debug_on) & level) { \ - sctp_print_address_pkt(iph, sh); \ - } \ - } while (0); \ -} #else #define SCTPDBG(level, params...) #define SCTPDBG_ADDR(level, addr) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:28:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A01CA3B; Thu, 7 Mar 2013 23:28:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE1BA73; Thu, 7 Mar 2013 23:28:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NS9PN052453; Thu, 7 Mar 2013 23:28:09 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NS878052450; Thu, 7 Mar 2013 23:28:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072328.r27NS878052450@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:28:08 +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: r247966 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:28:09 -0000 Author: tuexen Date: Thu Mar 7 23:28:08 2013 New Revision: 247966 URL: http://svnweb.freebsd.org/changeset/base/247966 Log: MFC r238003,r239091: Move common code parts to sctp_common_input_processing(). Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 23:23:25 2013 (r247965) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 23:28:08 2013 (r247966) @@ -5590,26 +5590,141 @@ void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, - struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, uint8_t ecn_bits, +#if !defined(SCTP_WITH_NO_CSUM) + uint8_t compute_crc, +#endif + uint8_t ecn_bits, uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { - /* - * Control chunk processing - */ uint32_t high_tsn; int fwd_tsn_seen = 0, data_processed = 0; struct mbuf *m = *mm; int un_sent; int cnt_ctrl_ready = 0; + struct sctp_inpcb *inp = NULL, *inp_decr = NULL; + struct sctp_tcb *stcb = NULL; + struct sctp_nets *net; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED sctp_audit_log(0xE0, 1); sctp_auditing(0, inp, stcb, net); #endif +#if !defined(SCTP_WITH_NO_CSUM) + if (compute_crc != 0) { + uint32_t check, calc_check; + check = sh->checksum; + sh->checksum = 0; + calc_check = sctp_calculate_cksum(m, iphlen); + sh->checksum = check; + if (calc_check != check) { + SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, src, dst, + sh, ch, &inp, &net, vrf_id); + if ((net != NULL) && (port != 0)) { + if (net->port == 0) { + sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + } + net->port = port; + } + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } + if ((inp != NULL) && (stcb != NULL)) { + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); + } else if ((inp != NULL) && (stcb == NULL)) { + inp_decr = inp; + } + SCTP_STAT_INCR(sctps_badsum); + SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); + goto out; + } + } +#endif + /* Destination port of 0 is illegal, based on RFC4960. */ + if (sh->dest_port == 0) { + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + stcb = sctp_findassociation_addr(m, offset, src, dst, + sh, ch, &inp, &net, vrf_id); + if ((net != NULL) && (port != 0)) { + if (net->port == 0) { + sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + } + net->port = port; + } + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } + if (inp == NULL) { + SCTP_STAT_INCR(sctps_noport); + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) { + goto out; + } + if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { + sctp_send_shutdown_complete2(src, dst, sh, + use_mflowid, mflowid, + vrf_id, port); + goto out; + } + if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { + goto out; + } + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, src, dst, + sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); + } + } + goto out; + } else if (stcb == NULL) { + inp_decr = inp; + } +#ifdef IPSEC + /*- + * I very much doubt any of the IPSEC stuff will work but I have no + * idea, so I will leave it in place. + */ + if (inp != NULL) { + switch (dst->sa_family) { +#ifdef INET + case AF_INET: + if (ipsec4_in_reject(m, &inp->ip_inp.inp)) { + MODULE_GLOBAL(ipsec4stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (ipsec6_in_reject(m, &inp->ip_inp.inp)) { + MODULE_GLOBAL(ipsec6stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + break; +#endif + default: + break; + } + } +#endif SCTPDBG(SCTP_DEBUG_INPUT1, "Ok, Common input processing called, m:%p iphlen:%d offset:%d length:%d stcb:%p\n", m, iphlen, offset, length, stcb); if (stcb) { @@ -5628,10 +5743,11 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); + stcb = NULL; sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - goto out_now; + goto out; } } if (IS_SCTP_CONTROL(ch)) { @@ -5671,21 +5787,19 @@ sctp_common_input_processing(struct mbuf sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) { /* "silently" ignore */ SCTP_STAT_INCR(sctps_recvauthmissing); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; } if (stcb == NULL) { /* out of the blue DATA chunk */ sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - goto out_now; + goto out; } if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) { /* v_tag mismatch! */ SCTP_STAT_INCR(sctps_badvtag); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; } } @@ -5695,7 +5809,7 @@ sctp_common_input_processing(struct mbuf * packet while processing control, or we're done with this * packet (done or skip rest of data), so we drop it... */ - goto out_now; + goto out; } /* * DATA chunk processing @@ -5749,8 +5863,7 @@ sctp_common_input_processing(struct mbuf sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; /* sa_ignore NOTREACHED */ break; case SCTP_STATE_EMPTY: /* should not happen */ @@ -5758,8 +5871,7 @@ sctp_common_input_processing(struct mbuf case SCTP_STATE_SHUTDOWN_RECEIVED: /* This is a peer error */ case SCTP_STATE_SHUTDOWN_ACK_SENT: default: - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; /* sa_ignore NOTREACHED */ break; case SCTP_STATE_OPEN: @@ -5777,7 +5889,8 @@ sctp_common_input_processing(struct mbuf * The association aborted, NO UNLOCK needed since * the association is destroyed. */ - goto out_now; + stcb = NULL; + goto out; } data_processed = 1; /* @@ -5834,10 +5947,20 @@ trigger_send: sctp_audit_log(0xE0, 3); sctp_auditing(2, inp, stcb, net); #endif - SCTP_TCB_UNLOCK(stcb); -out_now: +out: + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + if (inp_decr != NULL) { + /* reduce ref-count */ + SCTP_INP_WLOCK(inp_decr); + SCTP_INP_DECR_REF(inp_decr); + SCTP_INP_WUNLOCK(inp_decr); + } #ifdef INVARIANTS - sctp_validate_no_locks(inp); + if (inp != NULL) { + sctp_validate_no_locks(inp); + } #endif return; } @@ -5867,18 +5990,14 @@ sctp_input_with_port(struct mbuf *i_pak, struct ip *ip; struct sctphdr *sh; struct sctp_chunkhdr *ch; - struct sctp_inpcb *inp = NULL; - struct sctp_tcb *stcb = NULL; - struct sctp_nets *net = NULL; - int refcount_up = 0; int length, offset; - uint32_t mflowid; - uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) - uint32_t check, calc_check; + uint8_t compute_crc; #endif + uint32_t mflowid; + uint8_t use_mflowid; iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { @@ -5903,6 +6022,11 @@ sctp_input_with_port(struct mbuf *i_pak, sctp_packet_log(m); } #endif + SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, + "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + m->m_pkthdr.len, + if_name(m->m_pkthdr.rcvif), + m->m_pkthdr.csum_flags); if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; use_mflowid = 1; @@ -5936,161 +6060,42 @@ sctp_input_with_port(struct mbuf *i_pak, dst.sin_addr = ip->ip_dst; length = ip->ip_len + iphlen; /* Validate mbuf chain length with IP payload length. */ - if (SCTP_HEADER_LEN(i_pak) != length) { + if (SCTP_HEADER_LEN(m) != length) { SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(i_pak)); + "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(m)); SCTP_STAT_INCR(sctps_hdrops); - goto bad; + goto out; } /* SCTP does not allow broadcasts or multicasts */ if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) { - goto bad; + goto out; } if (SCTP_IS_IT_BROADCAST(dst.sin_addr, m)) { - goto bad; + goto out; } - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d iphlen:%d\n", length, iphlen); - SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", - m->m_pkthdr.len, - if_name(m->m_pkthdr.rcvif), - m->m_pkthdr.csum_flags); + ecn_bits = ip->ip_tos; #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_recvnocrc); #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum; - } - check = sh->checksum; - sh->checksum = 0; - calc_check = sctp_calculate_cksum(m, iphlen); - sh->checksum = check; - SCTP_STAT_INCR(sctps_recvswcrc); - if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((inp != NULL) && (stcb == NULL)) { - refcount_up = 1; - } - SCTP_STAT_INCR(sctps_badsum); - SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); - goto bad; - } -sctp_skip_csum: -#endif - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto bad; - } - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if (inp == NULL) { - SCTP_STAT_INCR(sctps_noport); - if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) - goto bad; - if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2((struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, - use_mflowid, mflowid, - vrf_id, port); - goto bad; - } - if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { - goto bad; - } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { - if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || - ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && - (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, 0, NULL, - use_mflowid, mflowid, - vrf_id, port); - } - } - goto bad; - } else if (stcb == NULL) { - refcount_up = 1; - } -#ifdef IPSEC - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp && ipsec4_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(ipsec4stat).in_polvio++; - SCTP_STAT_INCR(sctps_hdrops); - goto bad; + compute_crc = 0; + } else { + SCTP_STAT_INCR(sctps_recvswcrc); + compute_crc = 1; } #endif - - ecn_bits = ip->ip_tos; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, - sh, ch, inp, stcb, net, ecn_bits, + sh, ch, +#if !defined(SCTP_WITH_NO_CSUM) + compute_crc, +#endif + ecn_bits, use_mflowid, mflowid, vrf_id, port); - if (m) { - sctp_m_freem(m); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } - return; -bad: - if (stcb) { - SCTP_TCB_UNLOCK(stcb); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } +out: if (m) { sctp_m_freem(m); } Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Thu Mar 7 23:23:25 2013 (r247965) +++ stable/8/sys/netinet/sctp_input.h Thu Mar 7 23:28:08 2013 (r247966) @@ -41,8 +41,10 @@ void sctp_common_input_processing(struct mbuf **, int, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, - struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint8_t, +#if !defined(SCTP_WITH_NO_CSUM) + uint8_t, +#endif + uint8_t, uint8_t, uint32_t, uint32_t, uint16_t); Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 23:23:25 2013 (r247965) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 23:28:08 2013 (r247966) @@ -69,24 +69,20 @@ sctp6_input(struct mbuf **i_pak, int *of { struct mbuf *m; int iphlen; - uint32_t vrf_id = 0; + uint32_t vrf_id; uint8_t ecn_bits; struct sockaddr_in6 src, dst; struct ip6_hdr *ip6; struct sctphdr *sh; struct sctp_chunkhdr *ch; - struct sctp_inpcb *inp = NULL; - struct sctp_tcb *stcb = NULL; - struct sctp_nets *net = NULL; - int refcount_up = 0; int length, offset; - uint32_t mflowid; - uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) - uint32_t check, calc_check; + uint8_t compute_crc; #endif + uint32_t mflowid; + uint8_t use_mflowid; uint16_t port = 0; iphlen = *offp; @@ -112,6 +108,11 @@ sctp6_input(struct mbuf **i_pak, int *of sctp_packet_log(m); } #endif + SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, + "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + m->m_pkthdr.len, + if_name(m->m_pkthdr.rcvif), + m->m_pkthdr.csum_flags); if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; use_mflowid = 1; @@ -122,8 +123,8 @@ sctp6_input(struct mbuf **i_pak, int *of SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ - ip6 = mtod(m, struct ip6_hdr *); offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + ip6 = mtod(m, struct ip6_hdr *); IP6_EXTHDR_GET(sh, struct sctphdr *, m, iphlen, (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); if (sh == NULL) { @@ -138,7 +139,7 @@ sctp6_input(struct mbuf **i_pak, int *of src.sin6_port = sh->src_port; src.sin6_addr = ip6->ip6_src; if (in6_setscope(&src.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { - goto bad; + goto out; } memset(&dst, 0, sizeof(struct sockaddr_in6)); dst.sin6_family = AF_INET6; @@ -146,165 +147,46 @@ sctp6_input(struct mbuf **i_pak, int *of dst.sin6_port = sh->dest_port; dst.sin6_addr = ip6->ip6_dst; if (in6_setscope(&dst.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { - goto bad; + goto out; } if (faithprefix_p != NULL && (*faithprefix_p) (&dst.sin6_addr)) { /* XXX send icmp6 host/port unreach? */ - goto bad; + goto out; } length = ntohs(ip6->ip6_plen) + iphlen; /* Validate mbuf chain length with IP payload length. */ - if (SCTP_HEADER_LEN(*i_pak) != length) { + if (SCTP_HEADER_LEN(m) != length) { SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(*i_pak)); + "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(m)); SCTP_STAT_INCR(sctps_hdrops); - goto bad; + goto out; } if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - goto bad; + goto out; } - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d iphlen:%d\n", length, iphlen); - SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", - m->m_pkthdr.len, - if_name(m->m_pkthdr.rcvif), - m->m_pkthdr.csum_flags); + ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_recvnocrc); #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum; - } - check = sh->checksum; - sh->checksum = 0; - calc_check = sctp_calculate_cksum(m, iphlen); - sh->checksum = check; - SCTP_STAT_INCR(sctps_recvswcrc); - if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((inp != NULL) && (stcb == NULL)) { - refcount_up = 1; - } - SCTP_STAT_INCR(sctps_badsum); - SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); - goto bad; - } -sctp_skip_csum: -#endif - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto bad; - } - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if (inp == NULL) { - SCTP_STAT_INCR(sctps_noport); - if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) - goto bad; - if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2((struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, - use_mflowid, mflowid, - vrf_id, port); - goto bad; - } - if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { - goto bad; - } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { - if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || - ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && - (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, 0, NULL, - use_mflowid, mflowid, - vrf_id, port); - } - } - goto bad; - } else if (stcb == NULL) { - refcount_up = 1; - } -#ifdef IPSEC - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp && ipsec6_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(ipsec6stat).in_polvio++; - SCTP_STAT_INCR(sctps_hdrops); - goto bad; + compute_crc = 0; + } else { + SCTP_STAT_INCR(sctps_recvswcrc); + compute_crc = 1; } #endif - - ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, - sh, ch, inp, stcb, net, ecn_bits, + sh, ch, +#if !defined(SCTP_WITH_NO_CSUM) + compute_crc, +#endif + ecn_bits, use_mflowid, mflowid, vrf_id, port); - if (m) { - sctp_m_freem(m); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } - return (IPPROTO_DONE); -bad: - if (stcb) { - SCTP_TCB_UNLOCK(stcb); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } +out: if (m) { sctp_m_freem(m); } From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:31:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 365D9C19; Thu, 7 Mar 2013 23:31:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DC01A8C; Thu, 7 Mar 2013 23:31:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NVWmH054576; Thu, 7 Mar 2013 23:31:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NVWXJ054575; Thu, 7 Mar 2013 23:31:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072331.r27NVWXJ054575@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:31:32 +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: r247967 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:31:33 -0000 Author: tuexen Date: Thu Mar 7 23:31:32 2013 New Revision: 247967 URL: http://svnweb.freebsd.org/changeset/base/247967 Log: MFC r238087: Iniitialize a variable. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 23:28:08 2013 (r247966) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 23:31:32 2013 (r247967) @@ -5604,7 +5604,7 @@ sctp_common_input_processing(struct mbuf int cnt_ctrl_ready = 0; struct sctp_inpcb *inp = NULL, *inp_decr = NULL; struct sctp_tcb *stcb = NULL; - struct sctp_nets *net; + struct sctp_nets *net = NULL; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:35:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 755C0DB8; Thu, 7 Mar 2013 23:35:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D103AA2; Thu, 7 Mar 2013 23:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NZ7jd055132; Thu, 7 Mar 2013 23:35:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NZ7At055131; Thu, 7 Mar 2013 23:35:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072335.r27NZ7At055131@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:35:07 +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: r247968 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:35:07 -0000 Author: tuexen Date: Thu Mar 7 23:35:06 2013 New Revision: 247968 URL: http://svnweb.freebsd.org/changeset/base/247968 Log: MFC r238122: Use consistent method to determine IPV4_OUTPUT/IPV6_OUTPUT. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 23:31:32 2013 (r247967) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 23:35:06 2013 (r247968) @@ -10977,8 +10977,9 @@ sctp_send_resp_msg(struct sockaddr *src, return; } SCTP_ATTACH_CHAIN(o_pak, mout, len); + switch (dst->sa_family) { #ifdef INET - if (ip != NULL) { + case AF_INET: if (port) { if (V_udp_cksum) { udp->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); @@ -11012,10 +11013,10 @@ sctp_send_resp_msg(struct sockaddr *src, } #endif SCTP_IP_OUTPUT(ret, o_pak, NULL, NULL, vrf_id); - } + break; #endif #ifdef INET6 - if (ip6 != NULL) { + case AF_INET6: ip6->ip6_plen = len - sizeof(struct ip6_hdr); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -11042,8 +11043,15 @@ sctp_send_resp_msg(struct sockaddr *src, } #endif SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); - } + break; #endif + default: + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Unknown protocol (TSNH) type %d\n", + dst->sa_family); + sctp_m_freem(mout); + SCTP_LTRACE_ERR_RET_PKT(mout, NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); + return; + } SCTP_STAT_INCR(sctps_sendpackets); SCTP_STAT_INCR_COUNTER64(sctps_outpackets); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:37:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6C2FF1A7; Thu, 7 Mar 2013 23:37:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 463E0AC5; Thu, 7 Mar 2013 23:37:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NbsW1055641; Thu, 7 Mar 2013 23:37:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NbsrU055640; Thu, 7 Mar 2013 23:37:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072337.r27NbsrU055640@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:37:54 +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: r247970 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:37:54 -0000 Author: tuexen Date: Thu Mar 7 23:37:53 2013 New Revision: 247970 URL: http://svnweb.freebsd.org/changeset/base/247970 Log: MFC r238454: Bugfix: Send up a COMM UP notification for active 1-to-1 style sockets also in the case where the assoc comes up due to a remotely started handshake (collision case). Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Thu Mar 7 23:37:10 2013 (r247969) +++ stable/8/sys/netinet/sctp_input.c Thu Mar 7 23:37:53 2013 (r247970) @@ -2874,14 +2874,12 @@ sctp_handle_cookie_echo(struct mbuf *m, return (m); } } - if ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { - if (notification) { - sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - } - if (send_int_conf) { - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, - (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); - } + if (notification) { + sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + } + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); } return (m); } From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:39:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A77C0360; Thu, 7 Mar 2013 23:39:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90E5CADC; Thu, 7 Mar 2013 23:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Ndxp9055967; Thu, 7 Mar 2013 23:39:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Ndxd0055966; Thu, 7 Mar 2013 23:39:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072339.r27Ndxd0055966@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:39:59 +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: r247971 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:39:59 -0000 Author: tuexen Date: Thu Mar 7 23:39:59 2013 New Revision: 247971 URL: http://svnweb.freebsd.org/changeset/base/247971 Log: MFC r238455: Use case for selecting the address family (as in other places). Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 23:37:53 2013 (r247970) +++ stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 23:39:59 2013 (r247971) @@ -1203,11 +1203,18 @@ sctp_findassociation_ep_addr(struct sctp uint16_t rport; inp = *inp_p; - if (remote->sa_family == AF_INET) { + switch (remote->sa_family) { +#ifdef INET + case AF_INET: rport = (((struct sockaddr_in *)remote)->sin_port); - } else if (remote->sa_family == AF_INET6) { + break; +#endif +#ifdef INET6 + case AF_INET6: rport = (((struct sockaddr_in6 *)remote)->sin6_port); - } else { + break; +#endif + default: return (NULL); } if (locked_tcb) { From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:41:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5CAB25AF; Thu, 7 Mar 2013 23:41:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4EC09AF0; Thu, 7 Mar 2013 23:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NfwEJ057859; Thu, 7 Mar 2013 23:41:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NfwcJ057858; Thu, 7 Mar 2013 23:41:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072341.r27NfwcJ057858@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:41:58 +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: r247972 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:41:58 -0000 Author: tuexen Date: Thu Mar 7 23:41:57 2013 New Revision: 247972 URL: http://svnweb.freebsd.org/changeset/base/247972 Log: MFC r238458: Provide the correct notification type (SCTP_SEND_FAILED_EVENT) for unsent messages. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 23:39:59 2013 (r247971) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 23:41:57 2013 (r247972) @@ -2951,7 +2951,7 @@ sctp_notify_send_failed2(struct sctp_tcb SCTP_BUF_LEN(m_notify) = 0; if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); - ssfe->ssfe_type = SCTP_SEND_FAILED; + ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT; ssfe->ssfe_flags = SCTP_DATA_UNSENT; ssfe->ssfe_length = length; ssfe->ssfe_error = error; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:44:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D10F683C; Thu, 7 Mar 2013 23:44:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AEE59B02; Thu, 7 Mar 2013 23:44:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Ni4CK058289; Thu, 7 Mar 2013 23:44:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Ni3sa058284; Thu, 7 Mar 2013 23:44:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072344.r27Ni3sa058284@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:44:03 +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: r247974 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:44:04 -0000 Author: tuexen Date: Thu Mar 7 23:44:02 2013 New Revision: 247974 URL: http://svnweb.freebsd.org/changeset/base/247974 Log: MFC r238475: #ifdef INET and INET6 consistently. This also fixes a bug, where it was done wrong. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 23:43:03 2013 (r247973) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 23:44:02 2013 (r247974) @@ -8437,12 +8437,14 @@ again_one_more_time: } /* now lets add any data within the MTU constraints */ switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) { +#ifdef INET case AF_INET: if (net->mtu > (sizeof(struct ip) + sizeof(struct sctphdr))) omtu = net->mtu - (sizeof(struct ip) + sizeof(struct sctphdr)); else omtu = 0; break; +#endif #ifdef INET6 case AF_INET6: if (net->mtu > (sizeof(struct ip6_hdr) + sizeof(struct sctphdr))) @@ -12170,7 +12172,7 @@ sctp_lower_sosend(struct socket *so, union sctp_sockstore *raddr = (union sctp_sockstore *)addr; switch (raddr->sa.sa_family) { -#if defined(INET) +#ifdef INET case AF_INET: if (raddr->sin.sin_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); @@ -12180,7 +12182,7 @@ sctp_lower_sosend(struct socket *so, port = raddr->sin.sin_port; break; #endif -#if defined(INET6) +#ifdef INET6 case AF_INET6: if (raddr->sin6.sin6_len != sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 23:43:03 2013 (r247973) +++ stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 23:44:02 2013 (r247974) @@ -3013,6 +3013,7 @@ continue_anyway: memset(&store_sa, 0, sizeof(store_sa)); switch (addr->sa_family) { +#ifdef INET case AF_INET: { struct sockaddr_in *sin; @@ -3022,6 +3023,8 @@ continue_anyway: sin->sin_port = 0; break; } +#endif +#ifdef INET6 case AF_INET6: { struct sockaddr_in6 *sin6; @@ -3031,6 +3034,7 @@ continue_anyway: sin6->sin6_port = 0; break; } +#endif default: break; } @@ -5192,12 +5196,16 @@ sctp_destination_is_reachable(struct sct } /* NOTE: all "scope" checks are done when local addresses are added */ switch (destaddr->sa_family) { +#ifdef INET6 case AF_INET6: answer = inp->ip_inp.inp.inp_vflag & INP_IPV6; break; +#endif +#ifdef INET case AF_INET: answer = inp->ip_inp.inp.inp_vflag & INP_IPV4; break; +#endif default: /* invalid family, so it's unreachable */ answer = 0; @@ -5288,7 +5296,7 @@ sctp_add_local_addr_ep(struct sctp_inpcb inp->ip_inp.inp.inp_vflag |= INP_IPV6; break; #endif -#ifdef INET6 +#ifdef INET case AF_INET: inp->ip_inp.inp.inp_vflag |= INP_IPV4; break; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 23:43:03 2013 (r247973) +++ stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 23:44:02 2013 (r247974) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET6) +#ifdef INET6 #endif #include #include Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 23:43:03 2013 (r247973) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 23:44:02 2013 (r247974) @@ -5637,7 +5637,7 @@ found_one: memcpy(from, &sin6, sizeof(struct sockaddr_in6)); } #endif -#if defined(INET6) +#ifdef INET6 { struct sockaddr_in6 lsa6, *from6; @@ -6534,7 +6534,7 @@ sctp_bindx_delete_address(struct sctp_in return; } addr_touse = sa; -#if defined(INET6) +#ifdef INET6 if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 23:43:03 2013 (r247973) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 23:44:02 2013 (r247974) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET6) +#ifdef INET6 #include #endif #include @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #ifdef IPSEC #include -#if defined(INET6) +#ifdef INET6 #include #endif /* INET6 */ #endif /* IPSEC */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:44:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 555279A3; Thu, 7 Mar 2013 23:44:36 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46E1DB08; Thu, 7 Mar 2013 23:44:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NiaiB058394; Thu, 7 Mar 2013 23:44:36 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NiZGl058387; Thu, 7 Mar 2013 23:44:35 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201303072344.r27NiZGl058387@svn.freebsd.org> From: Olivier Houchard Date: Thu, 7 Mar 2013 23:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247975 - in head/usr.bin: . truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:44:36 -0000 Author: cognet Date: Thu Mar 7 23:44:35 2013 New Revision: 247975 URL: http://svnweb.freebsd.org/changeset/base/247975 Log: Add arm bits to truss. Added: head/usr.bin/truss/arm-fbsd.c (contents, props changed) Modified: head/usr.bin/Makefile.arm head/usr.bin/truss/extern.h head/usr.bin/truss/main.c Modified: head/usr.bin/Makefile.arm ============================================================================== --- head/usr.bin/Makefile.arm Thu Mar 7 23:44:02 2013 (r247974) +++ head/usr.bin/Makefile.arm Thu Mar 7 23:44:35 2013 (r247975) @@ -1,3 +1,2 @@ # $FreeBSD$ -SUBDIR:= ${SUBDIR:Ntruss} Added: head/usr.bin/truss/arm-fbsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/truss/arm-fbsd.c Thu Mar 7 23:44:35 2013 (r247975) @@ -0,0 +1,369 @@ +/* + * Copyright 1997 Sean Eric Fagan + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Sean Eric Fagan + * 4. Neither the name of the author may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * FreeBSD/arm-specific system call handling. This is probably the most + * complex part of the entire truss program, although I've got lots of + * it handled relatively cleanly now. The system call names are generated + * automatically, thanks to /usr/src/sys/kern/syscalls.master. The + * names used for the various structures are confusing, I sadly admit. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "truss.h" +#include "syscall.h" +#include "extern.h" + +#include "syscalls.h" + + +static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); + +/* + * This is what this particular file uses to keep track of a system call. + * It is probably not quite sufficient -- I can probably use the same + * structure for the various syscall personalities, and I also probably + * need to nest system calls (for signal handlers). + * + * 'struct syscall' describes the system call; it may be NULL, however, + * if we don't know about this particular system call yet. + */ +struct freebsd_syscall { + struct syscall *sc; + const char *name; + int number; + unsigned long *args; + int nargs; /* number of arguments -- *not* number of words! */ + char **s_args; /* the printable arguments */ +}; + +static struct freebsd_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct freebsd_syscall))); +} + +/* Clear up and free parts of the fsc structure. */ +static void +free_fsc(struct freebsd_syscall *fsc) +{ + int i; + + free(fsc->args); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); + } + free(fsc); +} + +/* + * Called when a process has entered a system call. nargs is the + * number of words, not number of arguments (a necessary distinction + * in some cases). Note that if the STOPEVENT() code in i386/i386/trap.c + * is ever changed these functions need to keep up. + */ + +void +arm_syscall_entry(struct trussinfo *trussinfo, int nargs) +{ + struct ptrace_io_desc iorequest; + struct reg regs; + struct freebsd_syscall *fsc; + struct syscall *sc; + lwpid_t tid; + int i, syscall_num; + register_t *ap; + + tid = trussinfo->curthread->tid; + + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return; + } + ap = ®s.r[0]; + + /* + * FreeBSD has two special kinds of system call redirctions -- + * SYS_syscall, and SYS___syscall. The former is the old syscall() + * routine, basically; the latter is for quad-aligned arguments. + */ +#ifdef __ARM_EABI__ + syscall_num = regs.r[7]; +#else + if ((syscall_num = ptrace(PT_READ_I, tid, + (caddr_t)(regs.r[_REG_PC] - INSN_SIZE), 0)) == -1) { + fprintf(trussinfo->outfile, "-- CANNOT READ PC --\n"); + return; + } + syscall_num = syscall_num & 0x000fffff; +#endif + switch (syscall_num) { + case SYS_syscall: + syscall_num = *ap++; + nargs--; + break; + case SYS___syscall: + syscall_num = ap[_QUAD_LOWWORD]; + ap += 2; + nargs -= 2; + break; + } + + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + NULL : syscallnames[syscall_num]; + if (!fsc->name) { + fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", + syscall_num); + } + + if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "rfork") == 0 || + strcmp(fsc->name, "vfork") == 0)) + trussinfo->curthread->in_fork = 1; + + if (nargs == 0) + return; + + fsc->args = malloc((1 + nargs) * sizeof(unsigned long)); + switch (nargs) { + default: + /* + * The OS doesn't seem to allow more than 10 words of + * parameters (yay!). So we shouldn't be here. + */ + warn("More than 10 words (%d) of arguments!\n", nargs); + break; + case 10: + case 9: + case 8: + case 7: + case 6: + case 5: + /* + * If there are 7-10 words of arguments, they are placed + * on the stack, as is normal for other processors. + * The fall-through for all of these is deliberate!!! + */ + // XXX BAD constant used here + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (void *)(regs.r[_REG_SP] + + 4 * sizeof(uint32_t)); + iorequest.piod_addr = &fsc->args[4]; + iorequest.piod_len = (nargs - 4) * sizeof(fsc->args[0]); + ptrace(PT_IO, tid, (caddr_t)&iorequest, 0); + if (iorequest.piod_len == 0) + return; + case 4: fsc->args[3] = ap[3]; + case 3: fsc->args[2] = ap[2]; + case 2: fsc->args[1] = ap[1]; + case 1: fsc->args[0] = ap[0]; + case 0: break; + } + + sc = NULL; + if (fsc->name) + sc = get_syscall(fsc->name); + if (sc) + fsc->nargs = sc->nargs; + else { +#if DEBUG + fprintf(trussinfo->outfile, "unknown syscall %s -- setting " + "args to %d\n", fsc->name, nargs); +#endif + fsc->nargs = nargs; + } + + fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *)); + fsc->sc = sc; + + /* + * At this point, we set up the system call arguments. + * We ignore any OUT ones, however -- those are arguments that + * are set by the system call, and so are probably meaningless + * now. This doesn't currently support arguments that are + * passed in *and* out, however. + */ + + if (fsc->name) { +#if DEBUG + fprintf(stderr, "syscall %s(", fsc->name); +#endif + for (i = 0; i < fsc->nargs; i++) { +#if DEBUG + fprintf(stderr, "0x%x%s", sc ? + fsc->args[sc->args[i].offset] : fsc->args[i], + i < (fsc->nargs - 1) ? "," : ""); +#endif + if (sc && !(sc->args[i].type & OUT)) { + fsc->s_args[i] = print_arg(&sc->args[i], + fsc->args, 0, trussinfo); + } + } +#if DEBUG + fprintf(stderr, ")\n"); +#endif + } + +#if DEBUG + fprintf(trussinfo->outfile, "\n"); +#endif + + if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || + strcmp(fsc->name, "exit") == 0)) { + /* + * XXX + * This could be done in a more general + * manner but it still wouldn't be very pretty. + */ + if (strcmp(fsc->name, "execve") == 0) { + if ((trussinfo->flags & EXECVEARGS) == 0) { + if (fsc->s_args[1]) { + free(fsc->s_args[1]); + fsc->s_args[1] = NULL; + } + } + if ((trussinfo->flags & EXECVEENVS) == 0) { + if (fsc->s_args[2]) { + free(fsc->s_args[2]); + fsc->s_args[2] = NULL; + } + } + } + } + trussinfo->curthread->fsc = fsc; +} + +/* + * And when the system call is done, we handle it here. + * Currently, no attempt is made to ensure that the system calls + * match -- this needs to be fixed (and is, in fact, why S_SCX includes + * the system call number instead of, say, an error status). + */ + +long +arm_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) +{ + struct reg regs; + struct freebsd_syscall *fsc; + struct syscall *sc; + lwpid_t tid; + long retval; + int errorp, i; + + if (trussinfo->curthread->fsc == NULL) + return (-1); + + tid = trussinfo->curthread->tid; + + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return (-1); + } + + retval = regs.r[0]; + errorp = !!(regs.r_cpsr & PSR_C_bit); + + /* + * This code, while simpler than the initial versions I used, could + * stand some significant cleaning. + */ + + fsc = trussinfo->curthread->fsc; + sc = fsc->sc; + if (!sc) { + for (i = 0; i < fsc->nargs; i++) + asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]); + } else { + /* + * Here, we only look for arguments that have OUT masked in -- + * otherwise, they were handled in the syscall_entry function. + */ + for (i = 0; i < sc->nargs; i++) { + char *temp; + if (sc->args[i].type & OUT) { + /* + * If an error occurred, then don't bother + * getting the data; it may not be valid. + */ + if (errorp) { + asprintf(&temp, "0x%lx", + fsc->args[sc->args[i].offset]); + } else { + temp = print_arg(&sc->args[i], + fsc->args, retval, trussinfo); + } + fsc->s_args[i] = temp; + } + } + } + + if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || + strcmp(fsc->name, "exit") == 0)) + trussinfo->curthread->in_syscall = 1; + + /* + * It would probably be a good idea to merge the error handling, + * but that complicates things considerably. + */ + + print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp, + retval, fsc->sc); + free_fsc(fsc); + + return (retval); +} Modified: head/usr.bin/truss/extern.h ============================================================================== --- head/usr.bin/truss/extern.h Thu Mar 7 23:44:02 2013 (r247974) +++ head/usr.bin/truss/extern.h Thu Mar 7 23:44:35 2013 (r247975) @@ -37,6 +37,10 @@ extern void restore_proc(int); extern void waitevent(struct trussinfo *); extern const char *ioctlname(unsigned long val); extern char *strsig(int sig); +#ifdef __arm__ +extern void arm_syscall_entry(struct trussinfo *, int); +extern long arm_syscall_exit(struct trussinfo *, int); +#endif #ifdef __amd64__ extern void amd64_syscall_entry(struct trussinfo *, int); extern long amd64_syscall_exit(struct trussinfo *, int); Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Thu Mar 7 23:44:02 2013 (r247974) +++ head/usr.bin/truss/main.c Thu Mar 7 23:44:35 2013 (r247975) @@ -79,6 +79,9 @@ static struct ex_types { void (*enter_syscall)(struct trussinfo *, int); long (*exit_syscall)(struct trussinfo *, int); } ex_types[] = { +#ifdef __arm__ + { "FreeBSD ELF32", arm_syscall_entry, arm_syscall_exit }, +#endif #ifdef __amd64__ { "FreeBSD ELF64", amd64_syscall_entry, amd64_syscall_exit }, { "FreeBSD ELF32", amd64_fbsd32_syscall_entry, amd64_fbsd32_syscall_exit }, From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:48:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FAA5C66; Thu, 7 Mar 2013 23:48:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 05382B2D; Thu, 7 Mar 2013 23:48:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NmUZY059048; Thu, 7 Mar 2013 23:48:30 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NmTp1059041; Thu, 7 Mar 2013 23:48:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072348.r27NmTp1059041@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247977 - in stable/8: sys/netinet sys/netinet6 usr.bin/netstat 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:48:31 -0000 Author: tuexen Date: Thu Mar 7 23:48:29 2013 New Revision: 247977 URL: http://svnweb.freebsd.org/changeset/base/247977 Log: MFC r238501,r238514: Changes which improve compilation if neither INET nor INET6 is defined. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet6/sctp6_usrreq.c stable/8/usr.bin/netstat/Makefile (contents, props changed) stable/8/usr.bin/netstat/sctp.c (contents, props changed) Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 23:45:16 2013 (r247976) +++ stable/8/sys/netinet/sctp_asconf.c Thu Mar 7 23:48:29 2013 (r247977) @@ -2747,13 +2747,14 @@ sctp_process_initack_addresses(struct sc struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; struct sctp_ifa *sctp_ifa; - struct sctp_ipv6addr_param addr_store; #ifdef INET6 + struct sctp_ipv6addr_param addr6_store; struct sockaddr_in6 sin6; #endif #ifdef INET + struct sctp_ipv4addr_param addr4_store; struct sockaddr_in sin; #endif @@ -2802,7 +2803,7 @@ sctp_process_initack_addresses(struct sc a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr6_store); if (plen != sizeof(struct sctp_ipv6addr_param) || a6p == NULL) { return; @@ -2821,7 +2822,7 @@ sctp_process_initack_addresses(struct sc /* get the entire IPv4 address param */ a4p = (struct sctp_ipv4addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr4_store); if (plen != sizeof(struct sctp_ipv4addr_param) || a4p == NULL) { return; @@ -2899,16 +2900,17 @@ sctp_addr_in_initack(struct mbuf *m, uin { struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; - struct sctp_ipv6addr_param addr_store; #ifdef INET struct sockaddr_in *sin; struct sctp_ipv4addr_param *a4p; + struct sctp_ipv6addr_param addr4_store; #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *a6p; + struct sctp_ipv6addr_param addr6_store; struct sockaddr_in6 sin6_tmp; #endif @@ -2954,7 +2956,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr6_store); if (a6p == NULL) { return (0); } @@ -2984,7 +2986,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a4p = (struct sctp_ipv4addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr4_store); if (a4p == NULL) { return (0); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 23:45:16 2013 (r247976) +++ stable/8/sys/netinet/sctp_output.c Thu Mar 7 23:48:29 2013 (r247977) @@ -3799,6 +3799,7 @@ sctp_get_ect(struct sctp_tcb *stcb) } } +#if defined(INET) || defined(INET6) static void sctp_handle_no_route(struct sctp_tcb *stcb, struct sctp_nets *net, @@ -3843,6 +3844,8 @@ sctp_handle_no_route(struct sctp_tcb *st } } +#endif + static int sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, /* may be NULL */ @@ -3882,14 +3885,18 @@ sctp_lowlevel_chunk_output(struct sctp_i * interface and smallest_mtu size as well. */ /* Will need ifdefs around this */ - struct mbuf *o_pak; struct mbuf *newm; struct sctphdr *sctphdr; int packet_length; int ret; uint32_t vrf_id; + +#if defined(INET) || defined(INET6) + struct mbuf *o_pak; sctp_route_t *ro = NULL; struct udphdr *udp = NULL; + +#endif uint8_t tos_value; #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Thu Mar 7 23:45:16 2013 (r247976) +++ stable/8/sys/netinet/sctp_uio.h Thu Mar 7 23:48:29 2013 (r247977) @@ -1124,10 +1124,10 @@ struct sctpstat { #define SCTP_STAT_DECR_GAUGE32(_x) SCTP_STAT_DECR(_x) union sctp_sockstore { -#if defined(INET) || !defined(_KERNEL) +#if defined(INET) struct sockaddr_in sin; #endif -#if defined(INET6) || !defined(_KERNEL) +#if defined(INET6) struct sockaddr_in6 sin6; #endif struct sockaddr sa; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 23:45:16 2013 (r247976) +++ stable/8/sys/netinet/sctp_usrreq.c Thu Mar 7 23:48:29 2013 (r247977) @@ -5226,7 +5226,6 @@ sctp_setopt(struct socket *so, int optna case SCTP_BINDX_ADD_ADDR: { struct sctp_getaddresses *addrs; - size_t sz; struct thread *td; td = (struct thread *)p; @@ -5234,8 +5233,7 @@ sctp_setopt(struct socket *so, int optna optsize); #ifdef INET if (addrs->addr->sa_family == AF_INET) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5248,8 +5246,7 @@ sctp_setopt(struct socket *so, int optna #endif #ifdef INET6 if (addrs->addr->sa_family == AF_INET6) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5273,7 +5270,6 @@ sctp_setopt(struct socket *so, int optna case SCTP_BINDX_REM_ADDR: { struct sctp_getaddresses *addrs; - size_t sz; struct thread *td; td = (struct thread *)p; @@ -5281,8 +5277,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses, optsize); #ifdef INET if (addrs->addr->sa_family == AF_INET) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5295,8 +5290,7 @@ sctp_setopt(struct socket *so, int optna #endif #ifdef INET6 if (addrs->addr->sa_family == AF_INET6) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 23:45:16 2013 (r247976) +++ stable/8/sys/netinet6/sctp6_usrreq.c Thu Mar 7 23:48:29 2013 (r247977) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INET6 #include #include #include @@ -1240,3 +1241,5 @@ struct pr_usrreqs sctp6_usrreqs = { .pru_sosend = sctp_sosend, .pru_soreceive = sctp_soreceive }; + +#endif Modified: stable/8/usr.bin/netstat/Makefile ============================================================================== --- stable/8/usr.bin/netstat/Makefile Thu Mar 7 23:45:16 2013 (r247976) +++ stable/8/usr.bin/netstat/Makefile Thu Mar 7 23:48:29 2013 (r247977) @@ -13,6 +13,10 @@ CFLAGS+=-fno-strict-aliasing CFLAGS+=-DIPSEC CFLAGS+=-DSCTP +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+=-DINET +.endif + .if ${MK_INET6_SUPPORT} != "no" SRCS+= inet6.c CFLAGS+=-DINET6 Modified: stable/8/usr.bin/netstat/sctp.c ============================================================================== --- stable/8/usr.bin/netstat/sctp.c Thu Mar 7 23:45:16 2013 (r247976) +++ stable/8/usr.bin/netstat/sctp.c Thu Mar 7 23:48:29 2013 (r247977) @@ -107,6 +107,7 @@ struct xraddr_entry { * If numeric_addr has been supplied, give * numeric value, otherwise try for symbolic name. */ +#ifdef INET static char * inetname(struct in_addr *inp) { @@ -146,6 +147,7 @@ inetname(struct in_addr *inp) } return (line); } +#endif #ifdef INET6 static char ntop_buf[INET6_ADDRSTRLEN]; @@ -197,9 +199,11 @@ sctp_print_address(union sctp_sockstore int width; switch (address->sa.sa_family) { +#ifdef INET case AF_INET: sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); break; +#endif #ifdef INET6 case AF_INET6: sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:51:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 192A4DDE; Thu, 7 Mar 2013 23:51:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF509B3F; Thu, 7 Mar 2013 23:51:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Np7kf061012; Thu, 7 Mar 2013 23:51:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Np7Bu061007; Thu, 7 Mar 2013 23:51:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072351.r27Np7Bu061007@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:51:07 +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: r247978 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:51:08 -0000 Author: tuexen Date: Thu Mar 7 23:51:07 2013 New Revision: 247978 URL: http://svnweb.freebsd.org/changeset/base/247978 Log: MFC r238550: Fix a refcount bug when freeing an association. While there: Change code to be consistent. Discussed with rrs@. Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 23:48:29 2013 (r247977) +++ stable/8/sys/netinet/sctp_pcb.c Thu Mar 7 23:51:07 2013 (r247978) @@ -4872,6 +4872,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, /* now clean up any chunks here */ TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { TAILQ_REMOVE(&outs->outqueue, sp, next); + sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { if (so) { /* Still an open socket - report */ @@ -4882,19 +4883,14 @@ sctp_free_assoc(struct sctp_inpcb *inp, sctp_m_freem(sp->data); sp->data = NULL; sp->tail_mbuf = NULL; + sp->length = 0; } } if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; } - sctp_free_spbufspace(stcb, asoc, sp); - if (sp->holds_key_ref) - sctp_auth_key_release(stcb, sp->auth_keyid, SCTP_SO_LOCKED); - /* Free the zone stuff */ - SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), sp); - SCTP_DECR_STRMOQ_COUNT(); - /* sa_ignore FREED_MEMORY */ + sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); } } /* sa_ignore FREED_MEMORY */ Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 23:48:29 2013 (r247977) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 23:51:07 2013 (r247978) @@ -3774,6 +3774,8 @@ sctp_report_all_outbound(struct sctp_tcb if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; + sp->tail_mbuf = NULL; + sp->length = 0; } } if (sp->net) { @@ -4833,7 +4835,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t /* * Pull any data to free up the SB * and allow sender to "add more" - * whilc we will throw away :-) + * while we will throw away :-) */ sctp_free_spbufspace(stcb, &stcb->asoc, sp); @@ -4841,9 +4843,9 @@ sctp_release_pr_sctp_chunk(struct sctp_t do_wakeup_routine = 1; sp->some_taken = 1; sctp_m_freem(sp->data); - sp->length = 0; sp->data = NULL; sp->tail_mbuf = NULL; + sp->length = 0; } break; } From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:53:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A61CF5; Thu, 7 Mar 2013 23:53:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E922AB4F; Thu, 7 Mar 2013 23:53:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NrBCa061381; Thu, 7 Mar 2013 23:53:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NrBNH061380; Thu, 7 Mar 2013 23:53:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072353.r27NrBNH061380@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:53:11 +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: r247980 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:53:12 -0000 Author: tuexen Date: Thu Mar 7 23:53:11 2013 New Revision: 247980 URL: http://svnweb.freebsd.org/changeset/base/247980 Log: MFC r238790: Fix the sctp_sockstore union such that userland programs don't depend on INET and/or INET6 to be defined and in-tune with how the kernel was compiled. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Thu Mar 7 23:52:15 2013 (r247979) +++ stable/8/sys/netinet/sctp_uio.h Thu Mar 7 23:53:11 2013 (r247980) @@ -1124,12 +1124,8 @@ struct sctpstat { #define SCTP_STAT_DECR_GAUGE32(_x) SCTP_STAT_DECR(_x) union sctp_sockstore { -#if defined(INET) struct sockaddr_in sin; -#endif -#if defined(INET6) struct sockaddr_in6 sin6; -#endif struct sockaddr sa; }; From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:55:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 00365282; Thu, 7 Mar 2013 23:55:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CD9E7B6A; Thu, 7 Mar 2013 23:55:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Nth4Y061806; Thu, 7 Mar 2013 23:55:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NthRn061805; Thu, 7 Mar 2013 23:55:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072355.r27NthRn061805@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247981 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:55:44 -0000 Author: tuexen Date: Thu Mar 7 23:55:42 2013 New Revision: 247981 URL: http://svnweb.freebsd.org/changeset/base/247981 Log: MFC r239035: Testing an interface property should depend on the interface, not on an address. Modified: stable/8/sys/netinet/sctp_bsd_addr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Thu Mar 7 23:53:11 2013 (r247980) +++ stable/8/sys/netinet/sctp_bsd_addr.c Thu Mar 7 23:55:42 2013 (r247981) @@ -152,12 +152,12 @@ sctp_gather_internal_ifa_flags(struct sc static uint32_t -sctp_is_desired_interface_type(struct ifaddr *ifa) +sctp_is_desired_interface_type(struct ifnet *ifn) { int result; /* check the interface type to see if it's one we care about */ - switch (ifa->ifa_ifp->if_type) { + switch (ifn->if_type) { case IFT_ETHER: case IFT_ISO88023: case IFT_ISO88024: @@ -216,6 +216,10 @@ sctp_init_ifns_for_vrf(int vrfid) IFNET_RLOCK(); TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { + if (sctp_is_desired_interface_type(ifn) == 0) { + /* non desired type */ + continue; + } IF_ADDR_RLOCK(ifn); TAILQ_FOREACH(ifa, &ifn->if_addrlist, ifa_list) { if (ifa->ifa_addr == NULL) { @@ -240,10 +244,6 @@ sctp_init_ifns_for_vrf(int vrfid) default: continue; } - if (sctp_is_desired_interface_type(ifa) == 0) { - /* non desired type */ - continue; - } switch (ifa->ifa_addr->sa_family) { #ifdef INET case AF_INET: @@ -317,6 +317,10 @@ sctp_addr_change(struct ifaddr *ifa, int if (ifa->ifa_addr == NULL) { return; } + if (sctp_is_desired_interface_type(ifa->ifa_ifp) == 0) { + /* non desired type */ + return; + } switch (ifa->ifa_addr->sa_family) { #ifdef INET case AF_INET: @@ -338,22 +342,16 @@ sctp_addr_change(struct ifaddr *ifa, int /* non inet/inet6 skip */ return; } - - if (sctp_is_desired_interface_type(ifa) == 0) { - /* non desired type */ - return; - } if (cmd == RTM_ADD) { (void)sctp_add_addr_to_vrf(SCTP_DEFAULT_VRFID, (void *)ifa->ifa_ifp, - ifa->ifa_ifp->if_index, ifa->ifa_ifp->if_type, - ifa->ifa_ifp->if_xname, + ifa->ifa_ifp->if_index, ifa->ifa_ifp->if_type, ifa->ifa_ifp->if_xname, (void *)ifa, ifa->ifa_addr, ifa_flags, 1); } else { sctp_del_addr_from_vrf(SCTP_DEFAULT_VRFID, ifa->ifa_addr, ifa->ifa_ifp->if_index, - ifa->ifa_ifp->if_xname - ); + ifa->ifa_ifp->if_xname); + /* * We don't bump refcount here so when it completes the * final delete will happen. From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:58:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 25E7C40E; Thu, 7 Mar 2013 23:58:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 002BFB9D; Thu, 7 Mar 2013 23:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NwI8A062173; Thu, 7 Mar 2013 23:58:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NwIZZ062172; Thu, 7 Mar 2013 23:58:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072358.r27NwIZZ062172@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:58:18 +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: r247982 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:58:19 -0000 Author: tuexen Date: Thu Mar 7 23:58:18 2013 New Revision: 247982 URL: http://svnweb.freebsd.org/changeset/base/247982 Log: MFC r240007: Fix a typo which results in RTT to be off by a factor of 10, if the RTT is larger than 1 second. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 23:55:42 2013 (r247981) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 23:58:18 2013 (r247982) @@ -2384,7 +2384,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb } timevalsub(&now, old); /* store the current RTT in us */ - net->rtt = (uint64_t) 10000000 *(uint64_t) now.tv_sec + + net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec + (uint64_t) now.tv_usec; /* computer rtt in ms */ From owner-svn-src-all@FreeBSD.ORG Thu Mar 7 23:59:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63735599; Thu, 7 Mar 2013 23:59:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 529DEBE2; Thu, 7 Mar 2013 23:59:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Nxmlp062404; Thu, 7 Mar 2013 23:59:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Nxm0a062403; Thu, 7 Mar 2013 23:59:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303072359.r27Nxm0a062403@svn.freebsd.org> From: Michael Tuexen Date: Thu, 7 Mar 2013 23:59:48 +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: r247983 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:59:48 -0000 Author: tuexen Date: Thu Mar 7 23:59:47 2013 New Revision: 247983 URL: http://svnweb.freebsd.org/changeset/base/247983 Log: MFC r240114: Whitespace change. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Thu Mar 7 23:58:18 2013 (r247982) +++ stable/8/sys/netinet/sctputil.c Thu Mar 7 23:59:47 2013 (r247983) @@ -2385,7 +2385,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb timevalsub(&now, old); /* store the current RTT in us */ net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec + - (uint64_t) now.tv_usec; + (uint64_t) now.tv_usec; /* computer rtt in ms */ rtt = net->rtt / 1000; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:01:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5831E740; Fri, 8 Mar 2013 00:01:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 300AABF4; Fri, 8 Mar 2013 00:01:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2801dsM064469; Fri, 8 Mar 2013 00:01:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2801dql064468; Fri, 8 Mar 2013 00:01:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080001.r2801dql064468@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:01:39 +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: r247984 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:01:39 -0000 Author: tuexen Date: Fri Mar 8 00:01:38 2013 New Revision: 247984 URL: http://svnweb.freebsd.org/changeset/base/247984 Log: MFC r240115: Use the consistenly the size of a variable. This helps to keep the code simpler for the userland implementation. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Thu Mar 7 23:59:47 2013 (r247983) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:01:38 2013 (r247984) @@ -3371,7 +3371,7 @@ sctp_find_cmsg(int c_type, void *data, s return (found); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ return (found); } @@ -3386,11 +3386,11 @@ sctp_find_cmsg(int c_type, void *data, s (cmh.cmsg_type == SCTP_PRINFO) || (cmh.cmsg_type == SCTP_AUTHINFO))))) { if (c_type == cmh.cmsg_type) { - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < cpsize) { return (found); } /* It is exactly what we want. Copy it out. */ - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), cpsize, (caddr_t)data); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), cpsize, (caddr_t)data); return (1); } else { struct sctp_sndrcvinfo *sndrcvinfo; @@ -3404,10 +3404,10 @@ sctp_find_cmsg(int c_type, void *data, s } switch (cmh.cmsg_type) { case SCTP_SNDINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_sndinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_sndinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); sndrcvinfo->sinfo_stream = sndinfo.snd_sid; sndrcvinfo->sinfo_flags = sndinfo.snd_flags; sndrcvinfo->sinfo_ppid = sndinfo.snd_ppid; @@ -3415,18 +3415,18 @@ sctp_find_cmsg(int c_type, void *data, s sndrcvinfo->sinfo_assoc_id = sndinfo.snd_assoc_id; break; case SCTP_PRINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_prinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_prinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); sndrcvinfo->sinfo_timetolive = prinfo.pr_value; sndrcvinfo->sinfo_flags |= prinfo.pr_policy; break; case SCTP_AUTHINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_authinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_authinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); sndrcvinfo->sinfo_keynumber_valid = 1; sndrcvinfo->sinfo_keynumber = authinfo.auth_keynumber; break; @@ -3466,7 +3466,7 @@ sctp_process_cmsgs_for_init(struct sctp_ return (1); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ *error = EINVAL; return (1); @@ -3479,11 +3479,11 @@ sctp_process_cmsgs_for_init(struct sctp_ if (cmh.cmsg_level == IPPROTO_SCTP) { switch (cmh.cmsg_type) { case SCTP_INIT: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_initmsg)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_initmsg)) { *error = EINVAL; return (1); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); if (initmsg.sinit_max_attempts) stcb->asoc.max_init_times = initmsg.sinit_max_attempts; if (initmsg.sinit_num_ostreams) @@ -3523,7 +3523,7 @@ sctp_process_cmsgs_for_init(struct sctp_ break; #ifdef INET case SCTP_DSTADDRV4: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in_addr)) { *error = EINVAL; return (1); } @@ -3531,7 +3531,7 @@ sctp_process_cmsgs_for_init(struct sctp_ sin.sin_family = AF_INET; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_port = stcb->rport; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); if ((sin.sin_addr.s_addr == INADDR_ANY) || (sin.sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { @@ -3547,7 +3547,7 @@ sctp_process_cmsgs_for_init(struct sctp_ #endif #ifdef INET6 case SCTP_DSTADDRV6: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in6_addr)) { *error = EINVAL; return (1); } @@ -3555,7 +3555,7 @@ sctp_process_cmsgs_for_init(struct sctp_ sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = stcb->rport; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) || IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) { *error = EINVAL; @@ -3623,7 +3623,7 @@ sctp_findassociation_cmsgs(struct sctp_i return (NULL); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ *error = EINVAL; return (NULL); @@ -3637,7 +3637,7 @@ sctp_findassociation_cmsgs(struct sctp_i switch (cmh.cmsg_type) { #ifdef INET case SCTP_DSTADDRV4: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in_addr)) { *error = EINVAL; return (NULL); } @@ -3645,13 +3645,13 @@ sctp_findassociation_cmsgs(struct sctp_i sin.sin_family = AF_INET; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_port = port; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); addr = (struct sockaddr *)&sin; break; #endif #ifdef INET6 case SCTP_DSTADDRV6: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in6_addr)) { *error = EINVAL; return (NULL); } @@ -3659,7 +3659,7 @@ sctp_findassociation_cmsgs(struct sctp_i sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = port; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); #ifdef INET if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { in6_sin6_2_sin(&sin, &sin6); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:03:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 381969CD; Fri, 8 Mar 2013 00:03:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27DD8C02; Fri, 8 Mar 2013 00:03:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2803YwW064928; Fri, 8 Mar 2013 00:03:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2803Wik064914; Fri, 8 Mar 2013 00:03:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080003.r2803Wik064914@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:03:32 +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: r247986 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:03:34 -0000 Author: tuexen Date: Fri Mar 8 00:03:31 2013 New Revision: 247986 URL: http://svnweb.freebsd.org/changeset/base/247986 Log: MFC r240148: Using %p in a format string requires a void *. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctp_asconf.c Fri Mar 8 00:03:31 2013 (r247986) @@ -2278,7 +2278,7 @@ sctp_set_primary_ip_address_sa(struct sc /* set primary queuing succeeded */ SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address_sa: queued on tcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { #ifdef SCTP_TIMER_BASED_ASCONF @@ -2291,7 +2291,7 @@ sctp_set_primary_ip_address_sa(struct sc } } else { SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address_sa: failed to add to queue on tcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); return (-1); } @@ -2314,7 +2314,7 @@ sctp_set_primary_ip_address(struct sctp_ SCTP_SET_PRIM_ADDR)) { /* set primary queuing succeeded */ SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address: queued on stcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &ifa->address.sa); if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { #ifdef SCTP_TIMER_BASED_ASCONF Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctp_auth.c Fri Mar 8 00:03:31 2013 (r247986) @@ -591,7 +591,7 @@ sctp_auth_key_acquire(struct sctp_tcb *s atomic_add_int(&skey->refcount, 1); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u refcount acquire to %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); } } @@ -612,7 +612,7 @@ sctp_auth_key_release(struct sctp_tcb *s sctp_free_sharedkey(skey); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u refcount release to %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); /* see if a notification should be generated */ if ((skey->refcount <= 1) && (skey->deactivated)) { @@ -621,7 +621,7 @@ sctp_auth_key_release(struct sctp_tcb *s key_id, 0, so_locked); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u no longer used, %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); } } } Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Mar 8 00:03:31 2013 (r247986) @@ -984,7 +984,7 @@ sctp_cwnd_update_exit_pf_common(struct s stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, old_cwnd, net->cwnd); SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); + (void *)net, net->cwnd); } Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:03:31 2013 (r247986) @@ -4420,7 +4420,7 @@ sctp_handle_sack(struct mbuf *m, int off cum_ack, send_s); if (tp1) { SCTP_PRINTF("Got send_s from tsn:%x + 1 of tp1:%p\n", - tp1->rec.data.TSN_seq, tp1); + tp1->rec.data.TSN_seq, (void *)tp1); } hopeless_peer: *abort_now = 1; Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:03:31 2013 (r247986) @@ -91,7 +91,7 @@ sctp_handle_init(struct mbuf *m, int iph struct mbuf *op_err; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_init: handling INIT tcb:%p\n", - stcb); + (void *)stcb); if (stcb == NULL) { SCTP_INP_RLOCK(inp); } @@ -2652,7 +2652,7 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTP_INP_INCR_REF((*stcb)->sctp_ep); if ((*stcb)->sctp_ep != l_inp) { SCTP_PRINTF("Huh? ep:%p diff then l_inp:%p?\n", - (*stcb)->sctp_ep, l_inp); + (void *)(*stcb)->sctp_ep, (void *)l_inp); } } } @@ -4404,7 +4404,7 @@ __attribute__((noinline)) #endif SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_control: iphlen=%u, offset=%u, length=%u stcb:%p\n", - iphlen, *offset, length, stcb); + iphlen, *offset, length, (void *)stcb); /* validate chunk header length... */ if (ntohs(ch->chunk_length) < sizeof(*ch)) { @@ -5023,7 +5023,7 @@ process_control_chunks: break; case SCTP_ABORT_ASSOCIATION: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ABORT, stcb %p\n", - stcb); + (void *)stcb); if ((stcb) && netp && *netp) sctp_handle_abort((struct sctp_abort_chunk *)ch, stcb, *netp); @@ -5032,7 +5032,7 @@ process_control_chunks: break; case SCTP_SHUTDOWN: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN, stcb %p\n", - stcb); + (void *)stcb); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_shutdown_chunk))) { *offset = length; if (locked_tcb) { @@ -5052,7 +5052,7 @@ process_control_chunks: } break; case SCTP_SHUTDOWN_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-ACK, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-ACK, stcb %p\n", (void *)stcb); if ((stcb) && (netp) && (*netp)) sctp_handle_shutdown_ack((struct sctp_shutdown_ack_chunk *)ch, stcb, *netp); *offset = length; @@ -5068,7 +5068,7 @@ process_control_chunks: break; case SCTP_COOKIE_ECHO: SCTPDBG(SCTP_DEBUG_INPUT3, - "SCTP_COOKIE-ECHO, stcb %p\n", stcb); + "SCTP_COOKIE-ECHO, stcb %p\n", (void *)stcb); if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { @@ -5170,7 +5170,7 @@ process_control_chunks: } break; case SCTP_COOKIE_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); @@ -5260,7 +5260,7 @@ process_control_chunks: } break; case SCTP_SHUTDOWN_COMPLETE: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-COMPLETE, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-COMPLETE, stcb %p\n", (void *)stcb); /* must be first and only chunk */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { @@ -5619,7 +5619,7 @@ sctp_common_input_processing(struct mbuf sh->checksum = check; if (calc_check != check) { SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); + calc_check, check, (void *)m, length, iphlen); stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); if ((net != NULL) && (port != 0)) { @@ -5724,13 +5724,13 @@ sctp_common_input_processing(struct mbuf } #endif SCTPDBG(SCTP_DEBUG_INPUT1, "Ok, Common input processing called, m:%p iphlen:%d offset:%d length:%d stcb:%p\n", - m, iphlen, offset, length, stcb); + (void *)m, iphlen, offset, length, (void *)stcb); if (stcb) { /* always clear this before beginning a packet */ stcb->asoc.authenticated = 0; stcb->asoc.seen_a_sack_this_pkt = 0; SCTPDBG(SCTP_DEBUG_INPUT1, "stcb:%p state:%x\n", - stcb, stcb->asoc.state); + (void *)stcb, stcb->asoc.state); if ((stcb->asoc.state & SCTP_STATE_WAS_ABORTED) || (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED)) { @@ -5968,9 +5968,9 @@ static void sctp_print_mbuf_chain(struct mbuf *m) { for (; m; m = SCTP_BUF_NEXT(m)) { - SCTP_PRINTF("%p: m_len = %ld\n", m, SCTP_BUF_LEN(m)); + SCTP_PRINTF("%p: m_len = %ld\n", (void *)m, SCTP_BUF_LEN(m)); if (SCTP_BUF_IS_EXTENDED(m)) - SCTP_PRINTF("%p: extend_size = %d\n", m, SCTP_BUF_EXTEND_SIZE(m)); + SCTP_PRINTF("%p: extend_size = %d\n", (void *)m, SCTP_BUF_EXTEND_SIZE(m)); } } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:03:31 2013 (r247986) @@ -2985,7 +2985,7 @@ bound_all_plan_b: } SCTPDBG(SCTP_DEBUG_OUTPUT2, "num preferred:%d on interface:%p cur_addr_num:%d\n", - num_preferred, sctp_ifn, cur_addr_num); + num_preferred, (void *)sctp_ifn, cur_addr_num); /* * Ok we have num_eligible_addr set with how many we can @@ -3022,7 +3022,7 @@ again_with_private_addresses_allowed: goto plan_d; } LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) { - SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", sctp_ifa); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", (void *)sctp_ifa); if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n"); @@ -3072,7 +3072,7 @@ plan_d: * out and see if we can find an acceptable address somewhere * amongst all interfaces. */ - SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", looked_at); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", (void *)looked_at); LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* wrong base scope */ @@ -3812,7 +3812,7 @@ sctp_handle_no_route(struct sctp_tcb *st SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT1, &net->ro._l_addr.sa); if (net->dest_state & SCTP_ADDR_CONFIRMED) { if ((net->dest_state & SCTP_ADDR_REACHABLE) && stcb) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "no route takes interface %p down\n", net); + SCTPDBG(SCTP_DEBUG_OUTPUT1, "no route takes interface %p down\n", (void *)net); sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, (void *)net, @@ -4106,7 +4106,7 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTPDBG(SCTP_DEBUG_OUTPUT3, "Destination is %x\n", (uint32_t) (ntohl(ip->ip_dst.s_addr))); SCTPDBG(SCTP_DEBUG_OUTPUT3, "RTP route is %p through\n", - ro->ro_rt); + (void *)ro->ro_rt); if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { /* failed to prepend data, give up */ @@ -12162,7 +12162,7 @@ sctp_lower_sosend(struct socket *so, sndlen = SCTP_HEADER_LEN(i_pak); } SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %d\n", - addr, + (void *)addr, sndlen); if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_socket->so_qlimit)) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:03:31 2013 (r247986) @@ -553,7 +553,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo (sctp_ifap->ifn_p->ifn_index == ifn_index)) { SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n", sctp_ifap->ifn_p->ifn_name, ifn_index, - sctp_ifap); + (void *)sctp_ifap); if (new_ifn_af) { /* Remove the created one that we don't want */ sctp_delete_ifn(sctp_ifnp, SCTP_ADDR_LOCKED); @@ -575,7 +575,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo * old one */ SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", - sctp_ifap, sctp_ifap->ifn_p->ifn_name, + (void *)sctp_ifap, sctp_ifap->ifn_p->ifn_name, sctp_ifap->ifn_p->ifn_index, if_name, ifn_index); /* remove the address from the old ifn */ @@ -587,7 +587,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo /* repair ifnp which was NULL ? */ sctp_ifap->localifa_flags = SCTP_ADDR_VALID; SCTPDBG(SCTP_DEBUG_PCB4, "Repairing ifn %p for ifa %p\n", - sctp_ifnp, sctp_ifap); + (void *)sctp_ifnp, (void *)sctp_ifap); sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); } goto exit_stage_left; @@ -763,7 +763,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, return; } } - SCTPDBG(SCTP_DEBUG_PCB4, "Deleting ifa %p\n", sctp_ifap); + SCTPDBG(SCTP_DEBUG_PCB4, "Deleting ifa %p\n", (void *)sctp_ifap); sctp_ifap->localifa_flags &= SCTP_ADDR_VALID; sctp_ifap->localifa_flags |= SCTP_BEING_DELETED; vrf->total_ifa_count--; @@ -1678,7 +1678,7 @@ sctp_endpoint_probe(struct sockaddr *nam continue; } SCTPDBG(SCTP_DEBUG_PCB1, "Ok laddr->ifa:%p is possible, ", - laddr->ifa); + (void *)laddr->ifa); if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) { SCTPDBG(SCTP_DEBUG_PCB1, "Huh IFA being deleted\n"); continue; @@ -2181,7 +2181,7 @@ sctp_findassociation_addr(struct mbuf *m retval = sctp_findassociation_addr_sa(src, dst, &inp, netp, find_tcp_pool, vrf_id); } - SCTPDBG(SCTP_DEBUG_PCB1, "retval:%p inp:%p\n", retval, inp); + SCTPDBG(SCTP_DEBUG_PCB1, "retval:%p inp:%p\n", (void *)retval, (void *)inp); if (retval == NULL && inp) { /* Found a EP but not this address */ if ((ch->chunk_type == SCTP_INITIATION) || @@ -2207,7 +2207,7 @@ sctp_findassociation_addr(struct mbuf *m } } } - SCTPDBG(SCTP_DEBUG_PCB1, "retval is %p\n", retval); + SCTPDBG(SCTP_DEBUG_PCB1, "retval is %p\n", (void *)retval); return (retval); } @@ -3100,7 +3100,7 @@ continue_anyway: /* put it in the bucket */ LIST_INSERT_HEAD(head, inp, sctp_hash); SCTPDBG(SCTP_DEBUG_PCB1, "Main hash to bind at head:%p, bound port:%d - in tcp_pool=%d\n", - head, ntohs(lport), port_reuse_active); + (void *)head, ntohs(lport), port_reuse_active); /* set in the port */ inp->sctp_lport = lport; @@ -3368,7 +3368,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, sctp_streamhead); if (sp == NULL) { SCTP_PRINTF("Error, sp is NULL, locked on sending is %p strm:%d\n", - asoc->asoc.locked_on_sending, + (void *)asoc->asoc.locked_on_sending, asoc->asoc.locked_on_sending->stream_no); } else { if ((sp->length == 0) && (sp->msg_is_complete == 0)) @@ -4341,7 +4341,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, LIST_INSERT_HEAD(head, stcb, sctp_tcbhash); } SCTP_INP_WUNLOCK(inp); - SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", stcb); + SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", (void *)stcb); return (stcb); } Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctp_timer.c Fri Mar 8 00:03:31 2013 (r247986) @@ -90,7 +90,7 @@ sctp_threshold_management(struct sctp_in if (net) { net->error_count++; SCTPDBG(SCTP_DEBUG_TIMER4, "Error count for %p now %d thresh:%d\n", - net, net->error_count, + (void *)net, net->error_count, net->failure_threshold); if (net->error_count > net->failure_threshold) { /* We had a threshold failure */ @@ -138,7 +138,7 @@ sctp_threshold_management(struct sctp_in stcb->asoc.overall_error_count++; } SCTPDBG(SCTP_DEBUG_TIMER4, "Overall error count for %p now %d thresh:%u state:%x\n", - &stcb->asoc, stcb->asoc.overall_error_count, + (void *)&stcb->asoc, stcb->asoc.overall_error_count, (uint32_t) threshold, ((net == NULL) ? (uint32_t) 0 : (uint32_t) net->dest_state)); /* @@ -439,7 +439,7 @@ sctp_recover_sent_list(struct sctp_tcb * TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", - chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); + (void *)chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->pr_sctp_on) { if (asoc->pr_sctp_cnt != 0) @@ -460,7 +460,7 @@ sctp_recover_sent_list(struct sctp_tcb * } SCTP_PRINTF("after recover order is as follows\n"); TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { - SCTP_PRINTF("chk:%p TSN:%x\n", chk, chk->rec.data.TSN_seq); + SCTP_PRINTF("chk:%p TSN:%x\n", (void *)chk, chk->rec.data.TSN_seq); } } @@ -767,7 +767,7 @@ start_again: if (audit_tf) { SCTPDBG(SCTP_DEBUG_TIMER4, "Audit total flight due to negative value net:%p\n", - net); + (void *)net); stcb->asoc.total_flight = 0; stcb->asoc.total_flight_count = 0; /* Clear all networks flight size */ @@ -775,7 +775,7 @@ start_again: lnets->flight_size = 0; SCTPDBG(SCTP_DEBUG_TIMER4, "Net:%p c-f cwnd:%d ssthresh:%d\n", - lnets, lnets->cwnd, lnets->ssthresh); + (void *)lnets, lnets->cwnd, lnets->ssthresh); } TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { if (chk->sent < SCTP_DATAGRAM_RESEND) { Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 00:03:07 2013 (r247985) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 00:03:31 2013 (r247986) @@ -686,7 +686,7 @@ sctp_auditing(int from, struct sctp_inpc } if (lnet->flight_size != tot_out) { SCTP_PRINTF("net:%p flight was %d corrected to %d\n", - lnet, lnet->flight_size, + (void *)lnet, lnet->flight_size, tot_out); lnet->flight_size = tot_out; } @@ -1434,7 +1434,7 @@ sctp_timeout_handler(void *t) if (tmr->self != (void *)tmr) { /* * SCTP_PRINTF("Stale SCTP timer fired (%p), ignoring...\n", - * tmr); + * (void *)tmr); */ CURVNET_RESTORE(); return; @@ -2112,7 +2112,7 @@ sctp_timer_start(int t_type, struct sctp } if ((to_ticks <= 0) || (tmr == NULL)) { SCTPDBG(SCTP_DEBUG_TIMER1, "%s: %d:software error to_ticks:%d tmr:%p not set ??\n", - __FUNCTION__, t_type, to_ticks, tmr); + __FUNCTION__, t_type, to_ticks, (void *)tmr); return; } if (SCTP_OS_TIMER_PENDING(&tmr->timer)) { From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:05:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EEFBBB47; Fri, 8 Mar 2013 00:05:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0E49C1A; Fri, 8 Mar 2013 00:05:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2805Fp6065298; Fri, 8 Mar 2013 00:05:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2805F63065297; Fri, 8 Mar 2013 00:05:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080005.r2805F63065297@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247987 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:05:16 -0000 Author: tuexen Date: Fri Mar 8 00:05:15 2013 New Revision: 247987 URL: http://svnweb.freebsd.org/changeset/base/247987 Log: MFC r240158: Get rid of a gcc'ism. Modified: stable/8/sys/netinet/sctp_cc_functions.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Mar 8 00:03:31 2013 (r247986) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Mar 8 00:05:15 2013 (r247987) @@ -1917,10 +1917,9 @@ measure_achieved_throughput(struct sctp_ return; } net->cc_mod.htcp_ca.bytecount += net->net_ack; - - if (net->cc_mod.htcp_ca.bytecount >= net->cwnd - ((net->cc_mod.htcp_ca.alpha >> 7 ? : 1) * net->mtu) - && now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT - && net->cc_mod.htcp_ca.minRTT > 0) { + if ((net->cc_mod.htcp_ca.bytecount >= net->cwnd - (((net->cc_mod.htcp_ca.alpha >> 7) ? (net->cc_mod.htcp_ca.alpha >> 7) : 1) * net->mtu)) && + (now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT) && + (net->cc_mod.htcp_ca.minRTT > 0)) { uint32_t cur_Bi = net->cc_mod.htcp_ca.bytecount / net->mtu * hz / (now - net->cc_mod.htcp_ca.lasttime); if (htcp_ccount(&net->cc_mod.htcp_ca) <= 3) { From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:07:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6FBBCE0D; Fri, 8 Mar 2013 00:07:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52D61C33; Fri, 8 Mar 2013 00:07:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2807L6N065762; Fri, 8 Mar 2013 00:07:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2807K2n065756; Fri, 8 Mar 2013 00:07:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080007.r2807K2n065756@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:07:20 +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: r247989 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:07:21 -0000 Author: tuexen Date: Fri Mar 8 00:07:19 2013 New Revision: 247989 URL: http://svnweb.freebsd.org/changeset/base/247989 Log: MFC r240198: Don't include a structure containing a flexible array in another structure. Modified: stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Mar 8 00:05:34 2013 (r247988) +++ stable/8/sys/netinet/sctp_header.h Fri Mar 8 00:07:19 2013 (r247989) @@ -510,16 +510,6 @@ struct sctp_stream_reset_add_strm { * streams then the request will need to be an overlay structure. */ -struct sctp_stream_reset_out_req { - struct sctp_chunkhdr ch; - struct sctp_stream_reset_out_request sr_req; -} SCTP_PACKED; - -struct sctp_stream_reset_in_req { - struct sctp_chunkhdr ch; - struct sctp_stream_reset_in_request sr_req; -} SCTP_PACKED; - struct sctp_stream_reset_tsn_req { struct sctp_chunkhdr ch; struct sctp_stream_reset_tsn_request sr_req; Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:05:34 2013 (r247988) +++ stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:07:19 2013 (r247989) @@ -2113,7 +2113,7 @@ finish_express_del: */ struct sctp_queued_to_read *ctl, *nctl; - sctp_reset_in_stream(stcb, liste->number_entries, liste->req.list_of_streams); + sctp_reset_in_stream(stcb, liste->number_entries, liste->list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); SCTP_FREE(liste, SCTP_M_STRESET); /* sa_ignore FREED_MEMORY */ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:05:34 2013 (r247988) +++ stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:07:19 2013 (r247989) @@ -3455,9 +3455,9 @@ process_chunk_drop(struct sctp_tcb *stcb } void -sctp_reset_in_stream(struct sctp_tcb *stcb, int number_entries, uint16_t * list) +sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list) { - int i; + uint32_t i; uint16_t temp; /* @@ -3511,7 +3511,7 @@ struct sctp_stream_reset_out_request * sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chunk **bchk) { struct sctp_association *asoc; - struct sctp_stream_reset_out_req *req; + struct sctp_chunkhdr *ch; struct sctp_stream_reset_out_request *r; struct sctp_tmit_chunk *chk; int len, clen; @@ -3534,8 +3534,8 @@ sctp_find_stream_reset(struct sctp_tcb * *bchk = chk; } clen = chk->send_size; - req = mtod(chk->data, struct sctp_stream_reset_out_req *); - r = &req->sr_req; + ch = mtod(chk->data, struct sctp_chunkhdr *); + r = (struct sctp_stream_reset_out_request *)(ch + 1); if (ntohl(r->request_seq) == seq) { /* found it */ return (r); @@ -3888,8 +3888,7 @@ sctp_handle_str_reset_request_out(struct } liste->tsn = tsn; liste->number_entries = number_entries; - memcpy(&liste->req, req, - (sizeof(struct sctp_stream_reset_out_request) + (number_entries * sizeof(uint16_t)))); + memcpy(&liste->list_of_streams, req->list_of_streams, number_entries * sizeof(uint16_t)); TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp); asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; } @@ -4059,7 +4058,7 @@ __attribute__((noinline)) #endif static int sctp_handle_stream_reset(struct sctp_tcb *stcb, struct mbuf *m, int offset, - struct sctp_stream_reset_out_req *sr_req) + struct sctp_chunkhdr *ch_req) { int chk_length, param_len, ptype; struct sctp_paramhdr pstore; @@ -4074,7 +4073,7 @@ __attribute__((noinline)) int num_param = 0; /* now it may be a reset or a reset-response */ - chk_length = ntohs(sr_req->ch.chunk_length); + chk_length = ntohs(ch_req->chunk_length); /* setup for adding the response */ sctp_alloc_a_chunk(stcb, chk); @@ -5413,7 +5412,7 @@ process_control_chunks: */ stcb->asoc.peer_supports_strreset = 1; } - if (sctp_handle_stream_reset(stcb, m, *offset, (struct sctp_stream_reset_out_req *)ch)) { + if (sctp_handle_stream_reset(stcb, m, *offset, ch)) { /* stop processing */ *offset = length; return (NULL); Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Fri Mar 8 00:05:34 2013 (r247988) +++ stable/8/sys/netinet/sctp_input.h Fri Mar 8 00:07:19 2013 (r247989) @@ -53,7 +53,7 @@ sctp_find_stream_reset(struct sctp_tcb * struct sctp_tmit_chunk **bchk); void -sctp_reset_in_stream(struct sctp_tcb *stcb, int number_entries, +sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list); Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Mar 8 00:05:34 2013 (r247988) +++ stable/8/sys/netinet/sctp_structs.h Fri Mar 8 00:07:19 2013 (r247989) @@ -77,8 +77,8 @@ TAILQ_HEAD(sctpnetlisthead, sctp_nets); struct sctp_stream_reset_list { TAILQ_ENTRY(sctp_stream_reset_list) next_resp; uint32_t tsn; - int number_entries; - struct sctp_stream_reset_out_request req; + uint32_t number_entries; + uint16_t list_of_streams[]; }; TAILQ_HEAD(sctp_resethead, sctp_stream_reset_list); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:09:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 11A06F87; Fri, 8 Mar 2013 00:09:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03759CB0; Fri, 8 Mar 2013 00:09:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2809Pok066171; Fri, 8 Mar 2013 00:09:25 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2809PJv066170; Fri, 8 Mar 2013 00:09:25 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080009.r2809PJv066170@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:09:25 +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: r247990 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:09:26 -0000 Author: tuexen Date: Fri Mar 8 00:09:25 2013 New Revision: 247990 URL: http://svnweb.freebsd.org/changeset/base/247990 Log: MFC r240250: Whitespace cleanup. Modified: stable/8/sys/netinet/sctp_asconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Mar 8 00:07:19 2013 (r247989) +++ stable/8/sys/netinet/sctp_asconf.c Fri Mar 8 00:09:25 2013 (r247990) @@ -1862,7 +1862,6 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * { int status; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 || sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_ASCONF)) { /* subset bound, no ASCONF allowed case, so ignore */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:12:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50DE4182; Fri, 8 Mar 2013 00:12:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41E5FCBA; Fri, 8 Mar 2013 00:12:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280C35d068268; Fri, 8 Mar 2013 00:12:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280C37S068267; Fri, 8 Mar 2013 00:12:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080012.r280C37S068267@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:12:03 +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: r247991 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:12:03 -0000 Author: tuexen Date: Fri Mar 8 00:12:02 2013 New Revision: 247991 URL: http://svnweb.freebsd.org/changeset/base/247991 Log: MFC r240263: Whitespace changes. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:09:25 2013 (r247990) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:12:02 2013 (r247991) @@ -2757,7 +2757,6 @@ sctp_inpcb_bind(struct socket *so, struc return (EINVAL); } lport = sin6->sin6_port; - /* * For LOOPBACK the prison_local_ip6() call * will transmute the ipv6 address to the @@ -2795,7 +2794,7 @@ sctp_inpcb_bind(struct socket *so, struc SCTP_INP_INCR_REF(inp); if (lport) { /* - * Did the caller specify a port? if so we must see if a ep + * Did the caller specify a port? if so we must see if an ep * already has this one bound. */ /* got to be root to get at low ports */ @@ -2876,8 +2875,7 @@ continue_anyway: if (bindall) { /* verify that no lport is not used by a singleton */ if ((port_reuse_active == 0) && - (inp_tmp = sctp_isport_inuse(inp, lport, vrf_id)) - ) { + (inp_tmp = sctp_isport_inuse(inp, lport, vrf_id))) { /* Sorry someone already has this one bound */ if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && (sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) { @@ -3043,9 +3041,9 @@ continue_anyway: * zero out the port to find the address! yuck! can't do * this earlier since need port for sctp_pcb_findep() */ - if (sctp_ifap != NULL) + if (sctp_ifap != NULL) { ifa = sctp_ifap; - else { + } else { /* * Note for BSD we hit here always other O/S's will * pass things in via the sctp_ifap argument From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:13:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 60AA23D4; Fri, 8 Mar 2013 00:13:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 51607CD2; Fri, 8 Mar 2013 00:13:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280DVCX068496; Fri, 8 Mar 2013 00:13:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280DVTo068495; Fri, 8 Mar 2013 00:13:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080013.r280DVTo068495@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:13:31 +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: r247992 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:13:31 -0000 Author: tuexen Date: Fri Mar 8 00:13:30 2013 New Revision: 247992 URL: http://svnweb.freebsd.org/changeset/base/247992 Log: MFC r240507: Small cleanups. No functional change. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 00:12:02 2013 (r247991) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 00:13:30 2013 (r247992) @@ -58,8 +58,7 @@ extern struct sctp_cc_functions sctp_cc_ extern struct sctp_ss_functions sctp_ss_functions[]; void -sctp_sblog(struct sockbuf *sb, - struct sctp_tcb *stcb, int from, int incr) +sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) { struct sctp_cwnd_log sctp_clog; @@ -103,7 +102,6 @@ sctp_log_closing(struct sctp_inpcb *inp, sctp_clog.x.misc.log4); } - void rto_logging(struct sctp_nets *net, int from) { @@ -198,8 +196,7 @@ sctp_log_map(uint32_t map, uint32_t cum, } void -sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn, - int from) +sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn, int from) { struct sctp_cwnd_log sctp_clog; @@ -242,8 +239,7 @@ sctp_log_mb(struct mbuf *m, int from) } void -sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, - int from) +sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, int from) { struct sctp_cwnd_log sctp_clog; @@ -4215,7 +4211,6 @@ sctp_print_address(struct sockaddr *sa) #ifdef INET6 char ip6buf[INET6_ADDRSTRLEN]; - ip6buf[0] = 0; #endif switch (sa->sa_family) { From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:16:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6C6A35C2; Fri, 8 Mar 2013 00:16:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1C5CEE; Fri, 8 Mar 2013 00:16:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280GI70068931; Fri, 8 Mar 2013 00:16:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280GHg0068929; Fri, 8 Mar 2013 00:16:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080016.r280GHg0068929@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:16:17 +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: r247993 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:16:18 -0000 Author: tuexen Date: Fri Mar 8 00:16:17 2013 New Revision: 247993 URL: http://svnweb.freebsd.org/changeset/base/247993 Log: MFC r240826: Small cleanups. No functional change. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:13:30 2013 (r247992) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:16:17 2013 (r247993) @@ -11399,11 +11399,11 @@ sctp_send_cwr(struct sctp_tcb *stcb, str struct sctp_cwr_chunk *cwr; struct sctp_tmit_chunk *chk; - asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); if (net == NULL) { return; } + asoc = &stcb->asoc; TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { if ((chk->rec.chunk_id.id == SCTP_ECN_CWR) && (net == chk->whoTo)) { /* @@ -11458,13 +11458,11 @@ sctp_add_stream_reset_out(struct sctp_tm int number_entries, uint16_t * list, uint32_t seq, uint32_t resp_seq, uint32_t last_sent) { - int len, old_len, i; + uint16_t len, old_len, i; struct sctp_stream_reset_out_request *req_out; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11498,19 +11496,16 @@ sctp_add_stream_reset_out(struct sctp_tm return; } - -void +static void sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, int number_entries, uint16_t * list, uint32_t seq) { - int len, old_len, i; + uint16_t len, old_len, i; struct sctp_stream_reset_in_request *req_in; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11542,18 +11537,15 @@ sctp_add_stream_reset_in(struct sctp_tmi return; } - -void +static void sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, uint32_t seq) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_tsn_request *req_tsn; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11577,13 +11569,11 @@ void sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_response *resp; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11602,22 +11592,18 @@ sctp_add_stream_reset_result(struct sctp chk->send_size = SCTP_SIZE32(chk->book_size); SCTP_BUF_LEN(chk->data) = chk->send_size; return; - } - void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result, uint32_t send_una, uint32_t recv_next) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_response_tsn *resp; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11645,7 +11631,7 @@ sctp_add_an_out_stream(struct sctp_tmit_ uint32_t seq, uint16_t adding) { - int len, old_len; + uint16_t len, old_len; struct sctp_chunkhdr *ch; struct sctp_stream_reset_add_strm *addstr; @@ -11678,7 +11664,7 @@ sctp_add_an_in_stream(struct sctp_tmit_c uint32_t seq, uint16_t adding) { - int len, old_len; + uint16_t len, old_len; struct sctp_chunkhdr *ch; struct sctp_stream_reset_add_strm *addstr; @@ -11705,8 +11691,6 @@ sctp_add_an_in_stream(struct sctp_tmit_c return; } - - int sctp_send_str_reset_req(struct sctp_tcb *stcb, int number_entries, uint16_t * list, @@ -11715,8 +11699,7 @@ sctp_send_str_reset_req(struct sctp_tcb uint8_t send_tsn_req, uint8_t add_stream, uint16_t adding_o, - uint16_t adding_i, uint8_t peer_asked -) + uint16_t adding_i, uint8_t peer_asked) { struct sctp_association *asoc; Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Mar 8 00:13:30 2013 (r247992) +++ stable/8/sys/netinet/sctp_output.h Fri Mar 8 00:16:17 2013 (r247993) @@ -173,37 +173,19 @@ void sctp_send_cwr(struct sctp_tcb *, st void -sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, - uint32_t seq, uint32_t resp_seq, uint32_t last_sent); +sctp_add_stream_reset_out(struct sctp_tmit_chunk *, + int, uint16_t *, uint32_t, uint32_t, uint32_t); void -sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, - uint32_t seq); + sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); void -sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, - uint32_t seq); - -void -sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, - uint32_t resp_seq, uint32_t result); - -void -sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, - uint32_t resp_seq, uint32_t result, - uint32_t send_una, uint32_t recv_next); +sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, + uint32_t, uint32_t, uint32_t, uint32_t); int -sctp_send_str_reset_req(struct sctp_tcb *stcb, - int number_entries, uint16_t * list, - uint8_t send_out_req, - uint8_t send_in_req, - uint8_t send_tsn_req, - uint8_t add_stream, - uint16_t adding_o, - uint16_t adding_i, uint8_t from_peer); +sctp_send_str_reset_req(struct sctp_tcb *, int, uint16_t *, uint8_t, uint8_t, + uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); void sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:17:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B6B44744; Fri, 8 Mar 2013 00:17:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91141D03; Fri, 8 Mar 2013 00:17:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280HwV2069182; Fri, 8 Mar 2013 00:17:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280HwKA069181; Fri, 8 Mar 2013 00:17:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080017.r280HwKA069181@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:17:58 +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: r247994 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:17:58 -0000 Author: tuexen Date: Fri Mar 8 00:17:57 2013 New Revision: 247994 URL: http://svnweb.freebsd.org/changeset/base/247994 Log: MFC r240842: Fix a bug related to handling Re-config chunks. It is not true that the association can be removed if the socket is gone. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:16:17 2013 (r247993) +++ stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:17:57 2013 (r247994) @@ -5387,23 +5387,6 @@ process_control_chunks: *offset = length; return (NULL); } - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(inp); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif - (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif - *offset = length; - return (NULL); - } if (stcb->asoc.peer_supports_strreset == 0) { /* * hmm, peer should have announced this, but From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:18:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A784E8A4; Fri, 8 Mar 2013 00:18:12 +0000 (UTC) (envelope-from john@jnielsen.net) Received: from ns1.jnielsen.net (secure.freebsdsolutions.net [69.55.234.48]) by mx1.freebsd.org (Postfix) with ESMTP id 8AECDD06; Fri, 8 Mar 2013 00:18:12 +0000 (UTC) Received: from [192.168.2.93] (c-67-182-217-170.hsd1.ut.comcast.net [67.182.217.170]) (authenticated bits=0) by ns1.jnielsen.net (8.14.4/8.14.4) with ESMTP id r27NqU2R063968 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 7 Mar 2013 18:52:31 -0500 (EST) (envelope-from john@jnielsen.net) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r247904 - head/crypto/openssh From: John Nielsen In-Reply-To: <86txonqvbe.fsf@ds4.des.no> Date: Thu, 7 Mar 2013 16:52:26 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201303062322.r26NMebp009010@svn.freebsd.org> <20130307022835.GA1496@glenbarber.us> <51386C23.2020600@FreeBSD.org> <86txonqvbe.fsf@ds4.des.no> To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1499) X-DCC-sonic.net-Metrics: ns1.jnielsen.net 1117; Body=7 Fuz1=7 Fuz2=7 X-Virus-Scanned: clamav-milter 0.97.5 at ns1.jnielsen.net X-Virus-Status: Clean Cc: src-committers@freebsd.org, Sean Bruno , svn-src-all@freebsd.org, Dimitry Andric , Glen Barber , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:18:12 -0000 On Mar 7, 2013, at 4:54 AM, Dag-Erling Sm=F8rgrav wrote: > Dimitry Andric writes: >> Glen Barber writes: >>> This commit now causes ssh(1) to dump core. >> Indeed, it will be the same problem that was reported many times on >> ports@; our strnvis() is not compatible with OpenBSD's strnvis(). :( >=20 > Thank you, and my apologies for the string of f*ups. I am currently > testing a patch based on Dimitry's and Sean's suggestions. >=20 > I've been working like a dog on OpenPAM and OpenSSH the last couple of > weeks and made a few too many assumptions... Thanks DES. As another data point, I did basically the same thing as = Sean yesterday before you committed r247904--undefined HAVE_STRNVIS. = Working fine, but I don't know what all that change affects. FreeBSD 10.0-CURRENT (STEALTH) #0 r247897M: Wed Mar 6 15:05:54 MST 2013 JN From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:19:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE668A26; Fri, 8 Mar 2013 00:19:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C03E0D14; Fri, 8 Mar 2013 00:19:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280JSL1069440; Fri, 8 Mar 2013 00:19:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280JSE8069439; Fri, 8 Mar 2013 00:19:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080019.r280JSE8069439@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:19: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: r247995 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:19:28 -0000 Author: tuexen Date: Fri Mar 8 00:19:28 2013 New Revision: 247995 URL: http://svnweb.freebsd.org/changeset/base/247995 Log: MFC r240848: Declare a static function as such. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:17:57 2013 (r247994) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:19:28 2013 (r247995) @@ -6417,7 +6417,7 @@ error_out: } } -int +static int sctp_med_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_association *asoc, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:20:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 78827BF7; Fri, 8 Mar 2013 00:20:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52B8ED2B; Fri, 8 Mar 2013 00:20:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280KutH071246; Fri, 8 Mar 2013 00:20:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280KuqM071245; Fri, 8 Mar 2013 00:20:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080020.r280KuqM071245@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:20:56 +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: r247996 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:20:56 -0000 Author: tuexen Date: Fri Mar 8 00:20:55 2013 New Revision: 247996 URL: http://svnweb.freebsd.org/changeset/base/247996 Log: MFC r240849: Whitespace change. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:19:28 2013 (r247995) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:20:55 2013 (r247996) @@ -3323,8 +3323,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, continue; } else if (TAILQ_EMPTY(&asoc->asoc.send_queue) && TAILQ_EMPTY(&asoc->asoc.sent_queue) && - (asoc->asoc.stream_queue_cnt == 0) - ) { + (asoc->asoc.stream_queue_cnt == 0)) { if (asoc->asoc.locked_on_sending) { goto abort_anyway; } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:28:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 905C3FE6; Fri, 8 Mar 2013 00:28:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6AEDBD67; Fri, 8 Mar 2013 00:28:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280SpBx072477; Fri, 8 Mar 2013 00:28:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280SpNS072476; Fri, 8 Mar 2013 00:28:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080028.r280SpNS072476@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:28:51 +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: r247999 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:28:51 -0000 Author: tuexen Date: Fri Mar 8 00:28:50 2013 New Revision: 247999 URL: http://svnweb.freebsd.org/changeset/base/247999 Log: MFC r242326: Add braces (as used elsewhere in the SCTP code). Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:23:42 2013 (r247998) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:28:50 2013 (r247999) @@ -3981,9 +3981,9 @@ sctp_lowlevel_chunk_output(struct sctp_i } if ((nofragment_flag) && (port == 0)) { ip->ip_off = IP_DF; - } else + } else { ip->ip_off = 0; - + } /* FreeBSD has a function for ip_id's */ ip->ip_id = ip_newid(); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:34:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC8D329D; Fri, 8 Mar 2013 00:34:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C2669D8D; Fri, 8 Mar 2013 00:34:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280Yoab074986; Fri, 8 Mar 2013 00:34:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280YoXo074985; Fri, 8 Mar 2013 00:34:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080034.r280YoXo074985@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:34:50 +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: r248000 - stable/8/lib/libc/net 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:34:50 -0000 Author: tuexen Date: Fri Mar 8 00:34:50 2013 New Revision: 248000 URL: http://svnweb.freebsd.org/changeset/base/248000 Log: MFC r242512: Fix errno in a couple of error cases. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Mar 8 00:28:50 2013 (r247999) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Mar 8 00:34:50 2013 (r248000) @@ -446,6 +446,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { + errno = ENOMEM; return (-1); } addrs->sget_assoc_id = id; @@ -774,6 +775,7 @@ sctp_sendx(int sd, const void *msg, size } buf = malloc(len); if (buf == NULL) { + errno = ENOMEM; return (-1); } aa = (int *)buf; @@ -1049,7 +1051,7 @@ sctp_sendv(int sd, CMSG_SPACE(sizeof(struct sctp_authinfo)) + (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); if (cmsgbuf == NULL) { - errno = ENOBUFS; + errno = ENOMEM; return (-1); } msg.msg_control = cmsgbuf; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:41:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DAEBB4D8; Fri, 8 Mar 2013 00:41:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4AEFDBB; Fri, 8 Mar 2013 00:41:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280fLn1077555; Fri, 8 Mar 2013 00:41:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280fKYM077551; Fri, 8 Mar 2013 00:41:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080041.r280fKYM077551@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:41:20 +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: r248001 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:41:21 -0000 Author: tuexen Date: Fri Mar 8 00:41:20 2013 New Revision: 248001 URL: http://svnweb.freebsd.org/changeset/base/248001 Log: MFC r242627: Move from early SSN assignment to late SSN assignment. This doesn't change functionality, but makes upcoming change much easier. Developed with rrs@ at the IETF 85. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:34:50 2013 (r248000) +++ stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:41:20 2013 (r248001) @@ -1942,7 +1942,7 @@ sctp_process_cookie_existing(struct mbuf sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].stream_no = i; - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; stcb->asoc.strmout[i].last_msg_incomplete = 0; } /* process the INIT-ACK info (my info) */ @@ -3489,7 +3489,7 @@ sctp_reset_out_streams(struct sctp_tcb * if (number_entries == 0) { for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; } } else if (number_entries) { for (i = 0; i < number_entries; i++) { @@ -3500,7 +3500,7 @@ sctp_reset_out_streams(struct sctp_tcb * /* no such stream */ continue; } - stcb->asoc.strmout[temp].next_sequence_sent = 0; + stcb->asoc.strmout[temp].next_sequence_send = 0; } } sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:34:50 2013 (r248000) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:41:20 2013 (r248001) @@ -3513,7 +3513,7 @@ sctp_process_cmsgs_for_init(struct sctp_ stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; } for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; @@ -6199,7 +6199,6 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->timetolive = srcv->sinfo_timetolive; sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; - sp->strseq = 0; if (sp->sinfo_flags & SCTP_ADDR_OVER) { sp->net = net; atomic_add_int(&sp->net->ref_count, 1); @@ -6240,10 +6239,6 @@ sctp_msg_append(struct sctp_tcb *stcb, sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); - if ((srcv->sinfo_flags & SCTP_UNORDERED) == 0) { - sp->strseq = strm->next_sequence_sent; - strm->next_sequence_sent++; - } stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; if (hold_stcb_lock == 0) { @@ -7384,7 +7379,10 @@ dont_do_it: chk->asoc = &stcb->asoc; chk->pad_inplace = 0; chk->no_fr_allowed = 0; - chk->rec.data.stream_seq = sp->strseq; + chk->rec.data.stream_seq = strq->next_sequence_send; + if (rcv_flags & SCTP_DATA_LAST_FRAG) { + strq->next_sequence_send++; + } chk->rec.data.stream_number = sp->stream; chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; @@ -11799,7 +11797,7 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 0, 1); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); - stcb->asoc.strmout[i].next_sequence_sent = oldstream[i].next_sequence_sent; + stcb->asoc.strmout[i].next_sequence_send = oldstream[i].next_sequence_send; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], &oldstream[i]); @@ -11819,7 +11817,7 @@ sctp_send_str_reset_req(struct sctp_tcb /* now the new streams */ stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); for (i = stcb->asoc.streamoutcnt; i < (stcb->asoc.streamoutcnt + adding_o); i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0x0; + stcb->asoc.strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; @@ -11976,7 +11974,6 @@ sctp_copy_it_in(struct sctp_tcb *stcb, sp->timetolive = srcv->sinfo_timetolive; sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; - sp->strseq = 0; (void)SCTP_GETTIME_TIMEVAL(&sp->ts); sp->stream = srcv->sinfo_stream; @@ -12729,15 +12726,7 @@ skip_preblock: } sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&asoc->stream_queue_cnt, 1); - if ((srcv->sinfo_flags & SCTP_UNORDERED) == 0) { - sp->strseq = strm->next_sequence_sent; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_AT_SEND_2_SCTP) { - sctp_misc_ints(SCTP_STRMOUT_LOG_ASSIGN, - (uintptr_t) stcb, sp->length, - (uint32_t) ((srcv->sinfo_stream << 16) | sp->strseq), 0); - } - strm->next_sequence_sent++; - } else { + if (srcv->sinfo_flags & SCTP_UNORDERED) { SCTP_STAT_INCR(sctps_sends_with_unord); } TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Mar 8 00:34:50 2013 (r248000) +++ stable/8/sys/netinet/sctp_structs.h Fri Mar 8 00:41:20 2013 (r248001) @@ -515,7 +515,6 @@ struct sctp_stream_queue_pending { uint32_t context; uint16_t sinfo_flags; uint16_t stream; - uint16_t strseq; uint16_t act_flags; uint16_t auth_keyid; uint8_t holds_key_ref; @@ -588,7 +587,7 @@ struct sctp_stream_out { struct sctp_streamhead outqueue; union scheduling_parameters ss_params; uint16_t stream_no; - uint16_t next_sequence_sent; /* next one I expect to send out */ + uint16_t next_sequence_send; /* next one I expect to send out */ uint8_t last_msg_incomplete; }; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 00:34:50 2013 (r248000) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 00:41:20 2013 (r248001) @@ -1052,7 +1052,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str * that were dropped must be notified to the upper layer as * failed to send. */ - asoc->strmout[i].next_sequence_sent = 0x0; + asoc->strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; @@ -2973,7 +2973,7 @@ sctp_notify_send_failed2(struct sctp_tcb /* not exactly what the user sent in, but should be close :) */ bzero(&ssf->ssf_info, sizeof(ssf->ssf_info)); ssf->ssf_info.sinfo_stream = sp->stream; - ssf->ssf_info.sinfo_ssn = sp->strseq; + ssf->ssf_info.sinfo_ssn = 0; if (sp->some_taken) { ssf->ssf_info.sinfo_flags = SCTP_DATA_LAST_FRAG; } else { @@ -4774,77 +4774,69 @@ sctp_release_pr_sctp_chunk(struct sctp_t * Still no eom found. That means there is stuff left on the * stream out queue.. yuck. */ - strq = &stcb->asoc.strmout[stream]; SCTP_TCB_SEND_LOCK(stcb); - TAILQ_FOREACH(sp, &strq->outqueue, next) { - /* FIXME: Shouldn't this be a serial number check? */ - if (sp->strseq > seq) { - break; - } - /* Check if its our SEQ */ - if (sp->strseq == seq) { - sp->discard_rest = 1; - /* - * We may need to put a chunk on the queue - * that holds the TSN that would have been - * sent with the LAST bit. - */ + strq = &stcb->asoc.strmout[stream]; + sp = TAILQ_FIRST(&strq->outqueue); + if (sp != NULL) { + sp->discard_rest = 1; + /* + * We may need to put a chunk on the queue that + * holds the TSN that would have been sent with the + * LAST bit. + */ + if (chk == NULL) { + /* Yep, we have to */ + sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { - /* Yep, we have to */ - sctp_alloc_a_chunk(stcb, chk); - if (chk == NULL) { - /* - * we are hosed. All we can - * do is nothing.. which - * will cause an abort if - * the peer is paying - * attention. - */ - goto oh_well; - } - memset(chk, 0, sizeof(*chk)); - chk->rec.data.rcv_flags = SCTP_DATA_LAST_FRAG; - chk->sent = SCTP_FORWARD_TSN_SKIP; - chk->asoc = &stcb->asoc; - chk->rec.data.stream_seq = sp->strseq; - chk->rec.data.stream_number = sp->stream; - chk->rec.data.payloadtype = sp->ppid; - chk->rec.data.context = sp->context; - chk->flags = sp->act_flags; - if (sp->net) - chk->whoTo = sp->net; - else - chk->whoTo = stcb->asoc.primary_destination; - atomic_add_int(&chk->whoTo->ref_count, 1); - chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); - stcb->asoc.pr_sctp_cnt++; - chk->pr_sctp_on = 1; - TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); - stcb->asoc.sent_queue_cnt++; - stcb->asoc.pr_sctp_cnt++; - } else { - chk->rec.data.rcv_flags |= SCTP_DATA_LAST_FRAG; - } - oh_well: - if (sp->data) { /* - * Pull any data to free up the SB - * and allow sender to "add more" - * while we will throw away :-) + * we are hosed. All we can do is + * nothing.. which will cause an + * abort if the peer is paying + * attention. */ - sctp_free_spbufspace(stcb, &stcb->asoc, - sp); - ret_sz += sp->length; - do_wakeup_routine = 1; - sp->some_taken = 1; - sctp_m_freem(sp->data); - sp->data = NULL; - sp->tail_mbuf = NULL; - sp->length = 0; + goto oh_well; } - break; + memset(chk, 0, sizeof(*chk)); + chk->rec.data.rcv_flags = SCTP_DATA_LAST_FRAG; + chk->sent = SCTP_FORWARD_TSN_SKIP; + chk->asoc = &stcb->asoc; + chk->rec.data.stream_seq = strq->next_sequence_send; + chk->rec.data.stream_number = sp->stream; + chk->rec.data.payloadtype = sp->ppid; + chk->rec.data.context = sp->context; + chk->flags = sp->act_flags; + if (sp->net) + chk->whoTo = sp->net; + else + chk->whoTo = stcb->asoc.primary_destination; + atomic_add_int(&chk->whoTo->ref_count, 1); + chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); + stcb->asoc.pr_sctp_cnt++; + chk->pr_sctp_on = 1; + TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); + stcb->asoc.sent_queue_cnt++; + stcb->asoc.pr_sctp_cnt++; + } else { + chk->rec.data.rcv_flags |= SCTP_DATA_LAST_FRAG; + } + strq->next_sequence_send++; + oh_well: + if (sp->data) { + /* + * Pull any data to free up the SB and allow + * sender to "add more" while we will throw + * away :-) + */ + sctp_free_spbufspace(stcb, &stcb->asoc, sp); + ret_sz += sp->length; + do_wakeup_routine = 1; + sp->some_taken = 1; + sctp_m_freem(sp->data); + sp->data = NULL; + sp->tail_mbuf = NULL; + sp->length = 0; } - } /* End tailq_foreach */ + } SCTP_TCB_SEND_UNLOCK(stcb); } if (do_wakeup_routine) { From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:43:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D19FD664; Fri, 8 Mar 2013 00:43:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA29DDCE; Fri, 8 Mar 2013 00:43:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280hoou077941; Fri, 8 Mar 2013 00:43:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280hooc077934; Fri, 8 Mar 2013 00:43:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080043.r280hooc077934@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:43:50 +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: r248002 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:43:50 -0000 Author: tuexen Date: Fri Mar 8 00:43:49 2013 New Revision: 248002 URL: http://svnweb.freebsd.org/changeset/base/248002 Log: MFC r242708,r242709: Improve PR-SCTP if used in combination with NR-SACK. Based on work done by Mohammad Rajiullah. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Mar 8 00:41:20 2013 (r248001) +++ stable/8/sys/netinet/sctp_constants.h Fri Mar 8 00:43:49 2013 (r248002) @@ -370,6 +370,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DATAGRAM_ACKED 10010 #define SCTP_DATAGRAM_MARKED 20010 #define SCTP_FORWARD_TSN_SKIP 30010 +#define SCTP_DATAGRAM_NR_MARKED 40010 /* chunk output send from locations */ #define SCTP_OUTPUT_FROM_USR_SEND 0 Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:41:20 2013 (r248001) +++ stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:43:49 2013 (r248002) @@ -2975,9 +2975,10 @@ sctp_process_segment_range(struct sctp_t * All chunks NOT UNSENT fall through here and are marked * (leave PR-SCTP ones that are to skip alone though) */ - if (tp1->sent != SCTP_FORWARD_TSN_SKIP) + if ((tp1->sent != SCTP_FORWARD_TSN_SKIP) && + (tp1->sent != SCTP_DATAGRAM_NR_MARKED)) { tp1->sent = SCTP_DATAGRAM_MARKED; - + } if (tp1->rec.data.chunk_was_revoked) { /* deflate the cwnd */ tp1->whoTo->cwnd -= tp1->book_size; @@ -2985,6 +2986,7 @@ sctp_process_segment_range(struct sctp_t } /* NR Sack code here */ if (nr_sacking) { + tp1->sent = SCTP_DATAGRAM_NR_MARKED; if (tp1->data) { /* * sa_ignore @@ -3600,12 +3602,14 @@ sctp_try_advance_peer_ack_point(struct s } TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && - tp1->sent != SCTP_DATAGRAM_RESEND) { + tp1->sent != SCTP_DATAGRAM_RESEND && + tp1->sent != SCTP_DATAGRAM_NR_MARKED) { /* no chance to advance, out of here */ break; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { - if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { + if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || + (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { sctp_misc_ints(SCTP_FWD_TSN_CHECK, asoc->advanced_peer_ack_point, tp1->rec.data.TSN_seq, 0, 0); @@ -3653,7 +3657,8 @@ sctp_try_advance_peer_ack_point(struct s * the chunk, advance our peer ack point and we can check * the next chunk. */ - if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { + if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || + (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { /* advance PeerAckPoint goes forward */ if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = tp1->rec.data.TSN_seq; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:41:20 2013 (r248001) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:43:49 2013 (r248002) @@ -10157,7 +10157,8 @@ sctp_fill_in_rest: unsigned int cnt_of_skipped = 0; TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { - if (at->sent != SCTP_FORWARD_TSN_SKIP) { + if ((at->sent != SCTP_FORWARD_TSN_SKIP) && + (at->sent != SCTP_DATAGRAM_NR_MARKED)) { /* no more to look at */ break; } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:46:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 23FA07E2; Fri, 8 Mar 2013 00:46:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F079BDDF; Fri, 8 Mar 2013 00:46:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280k6cY078370; Fri, 8 Mar 2013 00:46:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280k5p0078364; Fri, 8 Mar 2013 00:46:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080046.r280k5p0078364@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:46:05 +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: r248003 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:46:07 -0000 Author: tuexen Date: Fri Mar 8 00:46:05 2013 New Revision: 248003 URL: http://svnweb.freebsd.org/changeset/base/248003 Log: MFC r242714: Add per outgoing stream accounting for chunks in the send and sent queue. This provides no functional change, but is a preparation for an upcoming stream reset improvement. Done with rrs@. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:43:49 2013 (r248002) +++ stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:46:05 2013 (r248003) @@ -3963,7 +3963,15 @@ sctp_express_handle_sack(struct sctp_tcb tp1->whoTo->cwnd -= tp1->book_size; tp1->rec.data.chunk_was_revoked = 0; } - tp1->sent = SCTP_DATAGRAM_ACKED; + if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); +#endif + } + } TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->data) { /* sa_ignore NO_NULL_CHK */ @@ -4699,10 +4707,14 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cum_ack)) { break; } - if (tp1->sent == SCTP_DATAGRAM_UNSENT) { - /* no more sent on list */ - SCTP_PRINTF("Warning, tp1->sent == %d and its now acked?\n", - tp1->sent); + if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); +#endif + } } TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->pr_sctp_on) { Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:43:49 2013 (r248002) +++ stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:46:05 2013 (r248003) @@ -311,6 +311,13 @@ sctp_process_init(struct sctp_init_chunk if (chk->rec.data.stream_number >= newcnt) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt--; + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:43:49 2013 (r248002) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:46:05 2013 (r248003) @@ -4949,6 +4949,15 @@ sctp_free_assoc(struct sctp_inpcb *inp, } /* sent queue SHOULD be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } + } TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->data) { if (so) { Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Mar 8 00:43:49 2013 (r248002) +++ stable/8/sys/netinet/sctp_structs.h Fri Mar 8 00:46:05 2013 (r248003) @@ -586,6 +586,7 @@ union scheduling_parameters { struct sctp_stream_out { struct sctp_streamhead outqueue; union scheduling_parameters ss_params; + uint32_t chunks_on_queues; uint16_t stream_no; uint16_t next_sequence_send; /* next one I expect to send out */ uint8_t last_msg_incomplete; Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Mar 8 00:43:49 2013 (r248002) +++ stable/8/sys/netinet/sctp_timer.c Fri Mar 8 00:46:05 2013 (r248003) @@ -440,6 +440,11 @@ sctp_recover_sent_list(struct sctp_tcb * if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", (void *)chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; + } + } TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->pr_sctp_on) { if (asoc->pr_sctp_cnt != 0) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 00:43:49 2013 (r248002) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 00:46:05 2013 (r248003) @@ -3727,6 +3727,15 @@ sctp_report_all_outbound(struct sctp_tcb TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); asoc->sent_queue_cnt--; + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, @@ -3743,6 +3752,13 @@ sctp_report_all_outbound(struct sctp_tcb TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt--; + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:48:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F182495A; Fri, 8 Mar 2013 00:48:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C7C84DEE; Fri, 8 Mar 2013 00:48:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280mG1L078769; Fri, 8 Mar 2013 00:48:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280mFmY078755; Fri, 8 Mar 2013 00:48:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080048.r280mFmY078755@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248004 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:48:17 -0000 Author: tuexen Date: Fri Mar 8 00:48:15 2013 New Revision: 248004 URL: http://svnweb.freebsd.org/changeset/base/248004 Log: MFC r243157: Get the accounting working. We now have counters how many chunks for each SCTP outgoing stream are in the send and sent queue. While there, improve the naming of NR-SACK related constants recently introduced. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Mar 8 00:46:05 2013 (r248003) +++ stable/8/sys/netinet/sctp_constants.h Fri Mar 8 00:48:15 2013 (r248004) @@ -370,7 +370,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DATAGRAM_ACKED 10010 #define SCTP_DATAGRAM_MARKED 20010 #define SCTP_FORWARD_TSN_SKIP 30010 -#define SCTP_DATAGRAM_NR_MARKED 40010 +#define SCTP_DATAGRAM_NR_ACKED 40010 /* chunk output send from locations */ #define SCTP_OUTPUT_FROM_USR_SEND 0 Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:46:05 2013 (r248003) +++ stable/8/sys/netinet/sctp_indata.c Fri Mar 8 00:48:15 2013 (r248004) @@ -2976,7 +2976,7 @@ sctp_process_segment_range(struct sctp_t * (leave PR-SCTP ones that are to skip alone though) */ if ((tp1->sent != SCTP_FORWARD_TSN_SKIP) && - (tp1->sent != SCTP_DATAGRAM_NR_MARKED)) { + (tp1->sent != SCTP_DATAGRAM_NR_ACKED)) { tp1->sent = SCTP_DATAGRAM_MARKED; } if (tp1->rec.data.chunk_was_revoked) { @@ -2985,8 +2985,16 @@ sctp_process_segment_range(struct sctp_t tp1->rec.data.chunk_was_revoked = 0; } /* NR Sack code here */ - if (nr_sacking) { - tp1->sent = SCTP_DATAGRAM_NR_MARKED; + if (nr_sacking && + (tp1->sent != SCTP_DATAGRAM_NR_ACKED)) { + if (stcb->asoc.strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { + stcb->asoc.strmout[tp1->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); +#endif + } + tp1->sent = SCTP_DATAGRAM_NR_ACKED; if (tp1->data) { /* * sa_ignore @@ -3091,7 +3099,6 @@ sctp_check_for_revoked(struct sctp_tcb * uint32_t biggest_tsn_acked) { struct sctp_tmit_chunk *tp1; - int tot_revoked = 0; TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cumack)) { @@ -3126,7 +3133,6 @@ sctp_check_for_revoked(struct sctp_tcb * * artificial inflation of the flight_size. */ tp1->whoTo->cwnd += tp1->book_size; - tot_revoked++; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SACK_LOGGING_ENABLE) { sctp_log_sack(asoc->last_acked_seq, cumack, @@ -3603,13 +3609,13 @@ sctp_try_advance_peer_ack_point(struct s TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && tp1->sent != SCTP_DATAGRAM_RESEND && - tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + tp1->sent != SCTP_DATAGRAM_NR_ACKED) { /* no chance to advance, out of here */ break; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || - (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { + (tp1->sent == SCTP_DATAGRAM_NR_ACKED)) { sctp_misc_ints(SCTP_FWD_TSN_CHECK, asoc->advanced_peer_ack_point, tp1->rec.data.TSN_seq, 0, 0); @@ -3658,7 +3664,7 @@ sctp_try_advance_peer_ack_point(struct s * the next chunk. */ if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || - (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { + (tp1->sent == SCTP_DATAGRAM_NR_ACKED)) { /* advance PeerAckPoint goes forward */ if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = tp1->rec.data.TSN_seq; @@ -3963,7 +3969,7 @@ sctp_express_handle_sack(struct sctp_tcb tp1->whoTo->cwnd -= tp1->book_size; tp1->rec.data.chunk_was_revoked = 0; } - if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (tp1->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; #ifdef INVARIANTS @@ -4630,7 +4636,9 @@ sctp_handle_sack(struct mbuf *m, int off tp1->whoTo->cwnd -= tp1->book_size; tp1->rec.data.chunk_was_revoked = 0; } - tp1->sent = SCTP_DATAGRAM_ACKED; + if (tp1->sent != SCTP_DATAGRAM_NR_ACKED) { + tp1->sent = SCTP_DATAGRAM_ACKED; + } } } else { break; @@ -4707,7 +4715,7 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cum_ack)) { break; } - if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (tp1->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; #ifdef INVARIANTS Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:46:05 2013 (r248003) +++ stable/8/sys/netinet/sctp_input.c Fri Mar 8 00:48:15 2013 (r248004) @@ -1948,6 +1948,7 @@ sctp_process_cookie_existing(struct mbuf sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].chunks_on_queues = 0; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].next_sequence_send = 0; stcb->asoc.strmout[i].last_msg_incomplete = 0; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:46:05 2013 (r248003) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 00:48:15 2013 (r248004) @@ -3513,8 +3513,9 @@ sctp_process_cmsgs_for_init(struct sctp_ stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; } for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_send = 0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].chunks_on_queues = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); @@ -7499,6 +7500,7 @@ dont_do_it: *locked = 1; } asoc->chunks_on_out_queue++; + strq->chunks_on_queues++; TAILQ_INSERT_TAIL(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt++; out_of: @@ -10158,7 +10160,7 @@ sctp_fill_in_rest: TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { if ((at->sent != SCTP_FORWARD_TSN_SKIP) && - (at->sent != SCTP_DATAGRAM_NR_MARKED)) { + (at->sent != SCTP_DATAGRAM_NR_ACKED)) { /* no more to look at */ break; } @@ -11798,6 +11800,7 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 0, 1); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; stcb->asoc.strmout[i].next_sequence_send = oldstream[i].next_sequence_send; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; @@ -11818,8 +11821,9 @@ sctp_send_str_reset_req(struct sctp_tcb /* now the new streams */ stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); for (i = stcb->asoc.streamoutcnt; i < (stcb->asoc.streamoutcnt + adding_o); i++) { - stcb->asoc.strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].chunks_on_queues = 0; + stcb->asoc.strmout[i].next_sequence_send = 0x0; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:46:05 2013 (r248003) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 00:48:15 2013 (r248004) @@ -4925,6 +4925,13 @@ sctp_free_assoc(struct sctp_inpcb *inp, } /* pending send queue SHOULD be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); if (chk->data) { if (so) { @@ -4949,7 +4956,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } /* sent queue SHOULD be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { - if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; #ifdef INVARIANTS @@ -4977,6 +4984,13 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_DECR_CHK_COUNT(); /* sa_ignore FREED_MEMORY */ } +#ifdef INVARIANTS + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (stcb->asoc.strmout[i].chunks_on_queues > 0) { + panic("%u chunks left for stream %u.", stcb->asoc.strmout[i].chunks_on_queues, i); + } + } +#endif /* control queue MAY not be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Mar 8 00:46:05 2013 (r248003) +++ stable/8/sys/netinet/sctp_timer.c Fri Mar 8 00:48:15 2013 (r248004) @@ -440,7 +440,7 @@ sctp_recover_sent_list(struct sctp_tcb * if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", (void *)chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); - if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; } Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 00:46:05 2013 (r248003) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 00:48:15 2013 (r248004) @@ -1054,6 +1054,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str */ asoc->strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&asoc->strmout[i].outqueue); + asoc->strmout[i].chunks_on_queues = 0; asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL); @@ -3727,7 +3728,7 @@ sctp_report_all_outbound(struct sctp_tcb TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); asoc->sent_queue_cnt--; - if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; #ifdef INVARIANTS From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:54:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3F3EB14; Fri, 8 Mar 2013 00:54:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C16EEE12; Fri, 8 Mar 2013 00:54:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280snZ7081380; Fri, 8 Mar 2013 00:54:49 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280smdP081374; Fri, 8 Mar 2013 00:54:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080054.r280smdP081374@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:54:48 +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: r248005 - in stable/8/sys: netinet netinet6 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:54:49 -0000 Author: tuexen Date: Fri Mar 8 00:54:48 2013 New Revision: 248005 URL: http://svnweb.freebsd.org/changeset/base/248005 Log: MFC r243186: Add support for SCTP/UDP/IPV6. This completes the support of http://tools.ietf.org/html/draft-ietf-tsvwg-sctp-udp-encaps Modified: stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c stable/8/sys/netinet6/sctp6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Mar 8 00:48:15 2013 (r248004) +++ stable/8/sys/netinet/sctp_pcb.h Fri Mar 8 00:54:48 2013 (r248005) @@ -144,7 +144,12 @@ struct sctp_tagblock { struct sctp_epinfo { - struct socket *udp_tun_socket; +#ifdef INET + struct socket *udp4_tun_socket; +#endif +#ifdef INET6 + struct socket *udp6_tun_socket; +#endif struct sctpasochead *sctp_asochash; u_long hashasocmark; Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Mar 8 00:48:15 2013 (r248004) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Mar 8 00:54:48 2013 (r248005) @@ -549,8 +549,6 @@ skip: if ((var) < (min)) { (var) = (min); } \ else if ((var) > (max)) { (var) = (max); } -/* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ -#if !defined(__FreeBSD__) || defined(INET) static int sysctl_sctp_udp_tunneling_check(SYSCTL_HANDLER_ARGS) { @@ -582,8 +580,6 @@ out: return (error); } -#endif - static int sysctl_sctp_check(SYSCTL_HANDLER_ARGS) @@ -1067,12 +1063,9 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT "Clear SCTP Logging buffer"); #endif -/* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ -#if !defined(__FreeBSD__) || defined(INET) SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); -#endif SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 00:48:15 2013 (r248004) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 00:54:48 2013 (r248005) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef INET6 +#include #endif #include #include @@ -48,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #ifndef KTR_SCTP @@ -6769,24 +6773,15 @@ sctp_log_trace(uint32_t subsys, const ch } #endif -/* XXX: Remove the #ifdef after tunneling over IPv6 works also on FreeBSD. */ -#ifdef INET -/* We will need to add support - * to bind the ports and such here - * so we can do UDP tunneling. In - * the mean-time, we return error - */ -#include -#include -#include -#ifdef INET6 -#include -#endif - static void sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *ignored) { struct ip *iph; + +#ifdef INET6 + struct ip6_hdr *ip6; + +#endif struct mbuf *sp, *last; struct udphdr *uhdr; uint16_t port; @@ -6836,10 +6831,10 @@ sctp_recv_udp_tunneled_packet(struct mbu #endif #ifdef INET6 case IPV6_VERSION >> 4: - /* Not yet supported. */ - goto out; + ip6 = mtod(m, struct ip6_hdr *); + ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) - sizeof(struct udphdr)); + sctp6_input_with_port(&m, &off, port); break; - #endif default: goto out; @@ -6853,19 +6848,22 @@ out: void sctp_over_udp_stop(void) { - struct socket *sop; - /* * This function assumes sysctl caller holds sctp_sysctl_info_lock() * for writting! */ - if (SCTP_BASE_INFO(udp_tun_socket) == NULL) { - /* Nothing to do */ - return; +#ifdef INET + if (SCTP_BASE_INFO(udp4_tun_socket) != NULL) { + soclose(SCTP_BASE_INFO(udp4_tun_socket)); + SCTP_BASE_INFO(udp4_tun_socket) = NULL; } - sop = SCTP_BASE_INFO(udp_tun_socket); - soclose(sop); - SCTP_BASE_INFO(udp_tun_socket) = NULL; +#endif +#ifdef INET6 + if (SCTP_BASE_INFO(udp6_tun_socket) != NULL) { + soclose(SCTP_BASE_INFO(udp6_tun_socket)); + SCTP_BASE_INFO(udp6_tun_socket) = NULL; + } +#endif } int @@ -6873,53 +6871,83 @@ sctp_over_udp_start(void) { uint16_t port; int ret; + +#ifdef INET struct sockaddr_in sin; - struct socket *sop = NULL; - struct thread *th; - struct ucred *cred; +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; + +#endif /* * This function assumes sysctl caller holds sctp_sysctl_info_lock() * for writting! */ port = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); - if (port == 0) { + if (ntohs(port) == 0) { /* Must have a port set */ return (EINVAL); } - if (SCTP_BASE_INFO(udp_tun_socket) != NULL) { +#ifdef INET + if (SCTP_BASE_INFO(udp4_tun_socket) != NULL) { + /* Already running -- must stop first */ + return (EALREADY); + } +#endif +#ifdef INET6 + if (SCTP_BASE_INFO(udp6_tun_socket) != NULL) { /* Already running -- must stop first */ return (EALREADY); } - th = curthread; - cred = th->td_ucred; - if ((ret = socreate(PF_INET, &sop, - SOCK_DGRAM, IPPROTO_UDP, cred, th))) { +#endif +#ifdef INET + if ((ret = socreate(PF_INET, &SCTP_BASE_INFO(udp4_tun_socket), + SOCK_DGRAM, IPPROTO_UDP, + curthread->td_ucred, curthread))) { + sctp_over_udp_stop(); return (ret); } - SCTP_BASE_INFO(udp_tun_socket) = sop; - /* call the special UDP hook */ - ret = udp_set_kernel_tunneling(sop, sctp_recv_udp_tunneled_packet); - if (ret) { - goto exit_stage_left; - } - /* Ok we have a socket, bind it to the port */ - memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof(sin); + /* Call the special UDP hook. */ + if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp4_tun_socket), + sctp_recv_udp_tunneled_packet))) { + sctp_over_udp_stop(); + return (ret); + } + /* Ok, we have a socket, bind it to the port. */ + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_port = htons(port); - ret = sobind(sop, (struct sockaddr *)&sin, th); - if (ret) { - /* Close up we cant get the port */ -exit_stage_left: + if ((ret = sobind(SCTP_BASE_INFO(udp4_tun_socket), + (struct sockaddr *)&sin, curthread))) { sctp_over_udp_stop(); return (ret); } - /* - * Ok we should now get UDP packets directly to our input routine - * sctp_recv_upd_tunneled_packet(). - */ +#endif +#ifdef INET6 + if ((ret = socreate(PF_INET6, &SCTP_BASE_INFO(udp6_tun_socket), + SOCK_DGRAM, IPPROTO_UDP, + curthread->td_ucred, curthread))) { + sctp_over_udp_stop(); + return (ret); + } + /* Call the special UDP hook. */ + if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp6_tun_socket), + sctp_recv_udp_tunneled_packet))) { + sctp_over_udp_stop(); + return (ret); + } + /* Ok, we have a socket, bind it to the port. */ + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_family = AF_INET6; + sin6.sin6_port = htons(port); + if ((ret = sobind(SCTP_BASE_INFO(udp6_tun_socket), + (struct sockaddr *)&sin6, curthread))) { + sctp_over_udp_stop(); + return (ret); + } +#endif return (0); } - -#endif Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Mar 8 00:48:15 2013 (r248004) +++ stable/8/sys/netinet/sctputil.h Fri Mar 8 00:54:48 2013 (r248005) @@ -323,13 +323,9 @@ do { \ } while (0) /* functions to start/stop udp tunneling */ -/* XXX: Remove the #ifdef after tunneling over IPv6 works also on FreeBSD. */ -#ifdef INET void sctp_over_udp_stop(void); int sctp_over_udp_start(void); -#endif - int sctp_soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Mar 8 00:48:15 2013 (r248004) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Mar 8 00:54:48 2013 (r248005) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); extern struct protosw inetsw[]; int -sctp6_input(struct mbuf **i_pak, int *offp, int proto) +sctp6_input_with_port(struct mbuf **i_pak, int *offp, uint16_t port) { struct mbuf *m; int iphlen; @@ -84,7 +84,6 @@ sctp6_input(struct mbuf **i_pak, int *of #endif uint32_t mflowid; uint8_t use_mflowid; - uint16_t port = 0; iphlen = *offp; if (SCTP_GET_PKT_VRFID(*i_pak, vrf_id)) { @@ -195,6 +194,12 @@ out: } +int +sctp6_input(struct mbuf **i_pak, int *offp, int proto SCTP_UNUSED) +{ + return (sctp6_input_with_port(i_pak, offp, 0)); +} + static void sctp6_notify_mbuf(struct sctp_inpcb *inp, struct icmp6_hdr *icmp6, struct sctphdr *sh, struct sctp_tcb *stcb, struct sctp_nets *net) Modified: stable/8/sys/netinet6/sctp6_var.h ============================================================================== --- stable/8/sys/netinet6/sctp6_var.h Fri Mar 8 00:48:15 2013 (r248004) +++ stable/8/sys/netinet6/sctp6_var.h Fri Mar 8 00:54:48 2013 (r248005) @@ -43,6 +43,7 @@ extern struct pr_usrreqs sctp6_usrreqs; int sctp6_input __P((struct mbuf **, int *, int)); +int sctp6_input_with_port __P((struct mbuf **, int *, uint16_t)); int sctp6_output __P((struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *)); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:56:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8CE2FC9E; Fri, 8 Mar 2013 00:56:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66F93E28; Fri, 8 Mar 2013 00:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280ukph081728; Fri, 8 Mar 2013 00:56:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280ukdD081727; Fri, 8 Mar 2013 00:56:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080056.r280ukdD081727@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:56:46 +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: r248006 - stable/8/lib/libc/net 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:56:49 -0000 Author: tuexen Date: Fri Mar 8 00:56:46 2013 New Revision: 248006 URL: http://svnweb.freebsd.org/changeset/base/248006 Log: MFC r243300: Fix the handling of mapped IPv6 addresses in sctp_connectx(). Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Mar 8 00:54:48 2013 (r248005) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Mar 8 00:56:46 2013 (r248006) @@ -202,7 +202,6 @@ sctp_connectx(int sd, const struct socka return (-1); } if (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)at)->sin6_addr)) { - len += sizeof(struct sockaddr_in); in6_sin6_2_sin((struct sockaddr_in *)cpto, (struct sockaddr_in6 *)at); cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 00:58:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 250B6E09; Fri, 8 Mar 2013 00:58:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 08335E30; Fri, 8 Mar 2013 00:58:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280w7Mm081966; Fri, 8 Mar 2013 00:58:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280w7m3081965; Fri, 8 Mar 2013 00:58:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080058.r280w7m3081965@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 00:58:07 +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: r248007 - stable/8/lib/libc/net 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:58:08 -0000 Author: tuexen Date: Fri Mar 8 00:58:07 2013 New Revision: 248007 URL: http://svnweb.freebsd.org/changeset/base/248007 Log: MFC r243302: Cleanup the code a bit, which improves the portability. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Mar 8 00:56:46 2013 (r248006) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Mar 8 00:58:07 2013 (r248007) @@ -188,15 +188,18 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)buf + sizeof(int)); /* validate all the addresses and get the size */ for (i = 0; i < addrcnt; i++) { - if (at->sa_family == AF_INET) { + switch (at->sa_family) { + case AF_INET: if (at->sa_len != sizeof(struct sockaddr_in)) { errno = EINVAL; return (-1); } - memcpy(cpto, at, at->sa_len); - cpto = ((caddr_t)cpto + at->sa_len); - len += at->sa_len; - } else if (at->sa_family == AF_INET6) { + memcpy(cpto, at, sizeof(struct sockaddr_in)); + cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); + len += sizeof(struct sockaddr_in); + at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in)); + break; + case AF_INET6: if (at->sa_len != sizeof(struct sockaddr_in6)) { errno = EINVAL; return (-1); @@ -206,11 +209,13 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); } else { - memcpy(cpto, at, at->sa_len); - cpto = ((caddr_t)cpto + at->sa_len); - len += at->sa_len; + memcpy(cpto, at, sizeof(struct sockaddr_in6)); + cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in6)); + len += sizeof(struct sockaddr_in6); } - } else { + at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in6)); + break; + default: errno = EINVAL; return (-1); } @@ -219,7 +224,6 @@ sctp_connectx(int sd, const struct socka errno = E2BIG; return (-1); } - at = (struct sockaddr *)((caddr_t)at + at->sa_len); cnt++; } /* do we have any? */ @@ -260,56 +264,57 @@ sctp_bindx(int sd, struct sockaddr *addr errno = EINVAL; return (-1); } - argsz = (sizeof(struct sockaddr_storage) + - sizeof(struct sctp_getaddresses)); - gaddrs = (struct sctp_getaddresses *)calloc(1, argsz); - if (gaddrs == NULL) { - errno = ENOMEM; - return (-1); - } /* First pre-screen the addresses */ sa = addrs; for (i = 0; i < addrcnt; i++) { - if (sa->sa_family == AF_INET) { - if (sa->sa_len != sizeof(struct sockaddr_in)) - goto out_error; + switch (sa->sa_family) { + case AF_INET: + if (sa->sa_len != sizeof(struct sockaddr_in)) { + errno = EINVAL; + return (-1); + } sin = (struct sockaddr_in *)sa; if (sin->sin_port) { /* non-zero port, check or save */ if (sport) { /* Check against our port */ if (sport != sin->sin_port) { - goto out_error; + errno = EINVAL; + return (-1); } } else { /* save off the port */ sport = sin->sin_port; } } - } else if (sa->sa_family == AF_INET6) { - if (sa->sa_len != sizeof(struct sockaddr_in6)) - goto out_error; + break; + case AF_INET6: + if (sa->sa_len != sizeof(struct sockaddr_in6)) { + errno = EINVAL; + return (-1); + } sin6 = (struct sockaddr_in6 *)sa; if (sin6->sin6_port) { /* non-zero port, check or save */ if (sport) { /* Check against our port */ if (sport != sin6->sin6_port) { - goto out_error; + errno = EINVAL; + return (-1); } } else { /* save off the port */ sport = sin6->sin6_port; } } - } else { - /* invalid address family specified */ - goto out_error; + break; + default: + /* Invalid address family specified. */ + errno = EINVAL; + return (-1); } - sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } - sa = addrs; /* * Now if there was a port mentioned, assure that the first address * has that port to make sure it fails or succeeds correctly. @@ -318,20 +323,14 @@ sctp_bindx(int sd, struct sockaddr *addr sin = (struct sockaddr_in *)sa; sin->sin_port = sport; } + argsz = sizeof(struct sctp_getaddresses) + + sizeof(struct sockaddr_storage); + if ((gaddrs = (struct sctp_getaddresses *)malloc(argsz)) == NULL) { + errno = ENOMEM; + return (-1); + } + sa = addrs; for (i = 0; i < addrcnt; i++) { - if (sa->sa_family == AF_INET) { - if (sa->sa_len != sizeof(struct sockaddr_in)) - goto out_error; - } else if (sa->sa_family == AF_INET6) { - if (sa->sa_len != sizeof(struct sockaddr_in6)) - goto out_error; - } else { - /* invalid address family specified */ - out_error: - free(gaddrs); - errno = EINVAL; - return (-1); - } memset(gaddrs, 0, argsz); gaddrs->sget_assoc_id = 0; memcpy(gaddrs->addr, sa, sa->sa_len); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:00:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E5D3C1B5; Fri, 8 Mar 2013 01:00:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C2535E43; Fri, 8 Mar 2013 01:00:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281057f082375; Fri, 8 Mar 2013 01:00:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28105PS082372; Fri, 8 Mar 2013 01:00:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080100.r28105PS082372@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:00:05 +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: r248008 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:00:07 -0000 Author: tuexen Date: Fri Mar 8 01:00:05 2013 New Revision: 248008 URL: http://svnweb.freebsd.org/changeset/base/248008 Log: MFC r243516: Remove unused function. Modified: stable/8/sys/netinet/sctp_peeloff.c stable/8/sys/netinet/sctp_peeloff.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Fri Mar 8 00:58:07 2013 (r248007) +++ stable/8/sys/netinet/sctp_peeloff.c Fri Mar 8 01:00:05 2013 (r248008) @@ -151,103 +151,3 @@ sctp_do_peeloff(struct socket *head, str return (0); } - - -struct socket * -sctp_get_peeloff(struct socket *head, sctp_assoc_t assoc_id, int *error) -{ - struct socket *newso; - struct sctp_inpcb *inp, *n_inp; - struct sctp_tcb *stcb; - - SCTPDBG(SCTP_DEBUG_PEEL1, "SCTP peel-off called\n"); - inp = (struct sctp_inpcb *)head->so_pcb; - if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); - *error = EFAULT; - return (NULL); - } - stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); - if (stcb == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); - *error = ENOTCONN; - return (NULL); - } - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - CURVNET_SET(head->so_vnet); - newso = sonewconn(head, SS_ISCONNECTED - ); - CURVNET_RESTORE(); - if (newso == NULL) { - SCTPDBG(SCTP_DEBUG_PEEL1, "sctp_peeloff:sonewconn failed\n"); - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOMEM); - *error = ENOMEM; - atomic_subtract_int(&stcb->asoc.refcnt, 1); - return (NULL); - - } - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - n_inp = (struct sctp_inpcb *)newso->so_pcb; - SOCK_LOCK(head); - n_inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE | - SCTP_PCB_FLAGS_CONNECTED | - SCTP_PCB_FLAGS_IN_TCPPOOL | /* Turn on Blocking IO */ - (SCTP_PCB_COPY_FLAGS & inp->sctp_flags)); - n_inp->sctp_features = inp->sctp_features; - n_inp->sctp_frag_point = inp->sctp_frag_point; - n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; - n_inp->sctp_ecn_enable = inp->sctp_ecn_enable; - n_inp->partial_delivery_point = inp->partial_delivery_point; - n_inp->sctp_context = inp->sctp_context; - n_inp->local_strreset_support = inp->local_strreset_support; - n_inp->inp_starting_point_for_iterator = NULL; - - /* copy in the authentication parameters from the original endpoint */ - if (n_inp->sctp_ep.local_hmacs) - sctp_free_hmaclist(n_inp->sctp_ep.local_hmacs); - n_inp->sctp_ep.local_hmacs = - sctp_copy_hmaclist(inp->sctp_ep.local_hmacs); - if (n_inp->sctp_ep.local_auth_chunks) - sctp_free_chunklist(n_inp->sctp_ep.local_auth_chunks); - n_inp->sctp_ep.local_auth_chunks = - sctp_copy_chunklist(inp->sctp_ep.local_auth_chunks); - (void)sctp_copy_skeylist(&inp->sctp_ep.shared_keys, - &n_inp->sctp_ep.shared_keys); - - n_inp->sctp_socket = newso; - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) { - sctp_feature_off(n_inp, SCTP_PCB_FLAGS_AUTOCLOSE); - n_inp->sctp_ep.auto_close_time = 0; - sctp_timer_stop(SCTP_TIMER_TYPE_AUTOCLOSE, n_inp, stcb, NULL, - SCTP_FROM_SCTP_PEELOFF + SCTP_LOC_1); - } - /* Turn off any non-blocking semantic. */ - SCTP_CLEAR_SO_NBIO(newso); - newso->so_state |= SS_ISCONNECTED; - /* We remove it right away */ - -#ifdef SCTP_LOCK_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOCK_LOGGING_ENABLE) { - sctp_log_lock(inp, (struct sctp_tcb *)NULL, SCTP_LOG_LOCK_SOCK); - } -#endif - TAILQ_REMOVE(&head->so_comp, newso, so_list); - head->so_qlen--; - SOCK_UNLOCK(head); - /* - * Now we must move it from one hash table to another and get the - * stcb in the right place. - */ - sctp_move_pcb_and_assoc(inp, n_inp, stcb); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - /* - * And now the final hack. We move data in the pending side i.e. - * head to the new socket buffer. Let the GRUBBING begin :-0 - */ - sctp_pull_off_control_to_new_inp(inp, n_inp, stcb, SBL_WAIT); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - return (newso); -} Modified: stable/8/sys/netinet/sctp_peeloff.h ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.h Fri Mar 8 00:58:07 2013 (r248007) +++ stable/8/sys/netinet/sctp_peeloff.h Fri Mar 8 01:00:05 2013 (r248008) @@ -35,18 +35,9 @@ __FBSDID("$FreeBSD$"); #ifndef _NETINET_SCTP_PEELOFF_H_ #define _NETINET_SCTP_PEELOFF_H_ - - - - #if defined(_KERNEL) - int sctp_can_peel_off(struct socket *, sctp_assoc_t); int sctp_do_peeloff(struct socket *, struct socket *, sctp_assoc_t); -struct socket *sctp_get_peeloff(struct socket *, sctp_assoc_t, int *); - - #endif /* _KERNEL */ - -#endif +#endif /* _NETINET_SCTP_PEELOFF_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:01:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 715EF505; Fri, 8 Mar 2013 01:01:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63A8EE65; Fri, 8 Mar 2013 01:01:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2811cZO084364; Fri, 8 Mar 2013 01:01:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2811cAd084363; Fri, 8 Mar 2013 01:01:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080101.r2811cAd084363@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:01:38 +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: r248009 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:01:38 -0000 Author: tuexen Date: Fri Mar 8 01:01:37 2013 New Revision: 248009 URL: http://svnweb.freebsd.org/changeset/base/248009 Log: MFC r243558: Allow shutdown() to be used on fds returned from sctp_peeloff(). Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:00:05 2013 (r248008) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:01:37 2013 (r248009) @@ -971,7 +971,8 @@ sctp_shutdown(struct socket *so) } SCTP_INP_RLOCK(inp); /* For UDP model this is a invalid call */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { + if (!((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { /* Restore the flags that the soshutdown took away. */ SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_state &= ~SBS_CANTRCVMORE; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:03:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6DBF867D; Fri, 8 Mar 2013 01:03:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55965E74; Fri, 8 Mar 2013 01:03:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2813eCF084802; Fri, 8 Mar 2013 01:03:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2813eYu084801; Fri, 8 Mar 2013 01:03:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080103.r2813eYu084801@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:03:40 +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: r248010 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:03:40 -0000 Author: tuexen Date: Fri Mar 8 01:03:39 2013 New Revision: 248010 URL: http://svnweb.freebsd.org/changeset/base/248010 Log: MFC r243564: Find the endpoint for an incoming packet also if the endpoint comes from sctp_peeloff(). Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:01:37 2013 (r248009) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:03:39 2013 (r248010) @@ -1226,7 +1226,8 @@ sctp_findassociation_ep_addr(struct sctp SCTP_TCB_UNLOCK(locked_tcb); } SCTP_INP_INFO_RLOCK(); - if (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /*- * Now either this guy is our listener or it's the * connector. If it is the one that issued the connect, then From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:05:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EBCB27E8; Fri, 8 Mar 2013 01:05:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C54C4E7D; Fri, 8 Mar 2013 01:05:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28157Bc085142; Fri, 8 Mar 2013 01:05:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28157MR085141; Fri, 8 Mar 2013 01:05:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080105.r28157MR085141@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:05:07 +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: r248011 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:05:08 -0000 Author: tuexen Date: Fri Mar 8 01:05:07 2013 New Revision: 248011 URL: http://svnweb.freebsd.org/changeset/base/248011 Log: MFC r243565: Add support for sctp_peeloff() also in the front states of the association. Modified: stable/8/sys/netinet/sctp_peeloff.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Fri Mar 8 01:03:39 2013 (r248010) +++ stable/8/sys/netinet/sctp_peeloff.c Fri Mar 8 01:05:07 2013 (r248011) @@ -74,9 +74,7 @@ sctp_can_peel_off(struct socket *head, s } state = SCTP_GET_STATE((&stcb->asoc)); if ((state == SCTP_STATE_EMPTY) || - (state == SCTP_STATE_INUSE) || - (state == SCTP_STATE_COOKIE_WAIT) || - (state == SCTP_STATE_COOKIE_ECHOED)) { + (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); return (ENOTCONN); @@ -105,9 +103,7 @@ sctp_do_peeloff(struct socket *head, str } state = SCTP_GET_STATE((&stcb->asoc)); if ((state == SCTP_STATE_EMPTY) || - (state == SCTP_STATE_INUSE) || - (state == SCTP_STATE_COOKIE_WAIT) || - (state == SCTP_STATE_COOKIE_ECHOED)) { + (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); return (ENOTCONN); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:10:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 104FC992; Fri, 8 Mar 2013 01:10:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DCE83EA4; Fri, 8 Mar 2013 01:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281AXNF087613; Fri, 8 Mar 2013 01:10:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281AXow087611; Fri, 8 Mar 2013 01:10:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080110.r281AXow087611@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:10:33 +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: r248012 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:10:34 -0000 Author: tuexen Date: Fri Mar 8 01:10:33 2013 New Revision: 248012 URL: http://svnweb.freebsd.org/changeset/base/248012 Log: MFC r244021: Ensure that the padding of the last parameter of an INIT chunk is not included in the chunk length as required by RFC 4960. While there, cleanup sctp_send_initiate(). Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:05:07 2013 (r248011) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:10:33 2013 (r248012) @@ -1940,27 +1940,27 @@ sctp_is_address_in_scope(struct sctp_ifa } static struct mbuf * -sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa) +sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa, uint16_t * len) { struct sctp_paramhdr *parmh; struct mbuf *mret; - int len; + uint16_t plen; switch (ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - len = sizeof(struct sctp_ipv4addr_param); + plen = (uint16_t) sizeof(struct sctp_ipv4addr_param); break; #endif #ifdef INET6 case AF_INET6: - len = sizeof(struct sctp_ipv6addr_param); + plen = (uint16_t) sizeof(struct sctp_ipv6addr_param); break; #endif default: return (m); } - if (M_TRAILINGSPACE(m) >= len) { + if (M_TRAILINGSPACE(m) >= plen) { /* easy side we just drop it on the end */ parmh = (struct sctp_paramhdr *)(SCTP_BUF_AT(m, SCTP_BUF_LEN(m))); mret = m; @@ -1970,7 +1970,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st while (SCTP_BUF_NEXT(mret) != NULL) { mret = SCTP_BUF_NEXT(mret); } - SCTP_BUF_NEXT(mret) = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); + SCTP_BUF_NEXT(mret) = sctp_get_mbuf_for_msg(plen, 0, M_NOWAIT, 1, MT_DATA); if (SCTP_BUF_NEXT(mret) == NULL) { /* We are hosed, can't add more addresses */ return (m); @@ -1989,9 +1989,9 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st sin = (struct sockaddr_in *)&ifa->address.sin; ipv4p = (struct sctp_ipv4addr_param *)parmh; parmh->param_type = htons(SCTP_IPV4_ADDRESS); - parmh->param_length = htons(len); + parmh->param_length = htons(plen); ipv4p->addr = sin->sin_addr.s_addr; - SCTP_BUF_LEN(mret) += len; + SCTP_BUF_LEN(mret) += plen; break; } #endif @@ -2004,18 +2004,21 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; ipv6p = (struct sctp_ipv6addr_param *)parmh; parmh->param_type = htons(SCTP_IPV6_ADDRESS); - parmh->param_length = htons(len); + parmh->param_length = htons(plen); memcpy(ipv6p->addr, &sin6->sin6_addr, sizeof(ipv6p->addr)); /* clear embedded scope in the address */ in6_clearscope((struct in6_addr *)ipv6p->addr); - SCTP_BUF_LEN(mret) += len; + SCTP_BUF_LEN(mret) += plen; break; } #endif default: return (m); } + if (len != NULL) { + *len += plen; + } return (mret); } @@ -2023,7 +2026,8 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct mbuf * sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_scoping *scope, - struct mbuf *m_at, int cnt_inits_to) + struct mbuf *m_at, int cnt_inits_to, + uint16_t * padding_len, uint16_t * chunk_len) { struct sctp_vrf *vrf = NULL; int cnt, limit_out = 0, total_count; @@ -2103,7 +2107,15 @@ skip_count: scope->site_scope, 0) == 0) { continue; } - m_at = sctp_add_addr_to_mbuf(m_at, sctp_ifap); + if ((chunk_len != NULL) && + (padding_len != NULL) && + (*padding_len > 0)) { + memset(mtod(m_at, caddr_t)+*chunk_len, 0, *padding_len); + SCTP_BUF_LEN(m_at) += *padding_len; + *chunk_len += *padding_len; + *padding_len = 0; + } + m_at = sctp_add_addr_to_mbuf(m_at, sctp_ifap, chunk_len); if (limit_out) { cnt++; total_count++; @@ -2178,7 +2190,15 @@ skip_count: scope->site_scope, 0) == 0) { continue; } - m_at = sctp_add_addr_to_mbuf(m_at, laddr->ifa); + if ((chunk_len != NULL) && + (padding_len != NULL) && + (*padding_len > 0)) { + memset(mtod(m_at, caddr_t)+*chunk_len, 0, *padding_len); + SCTP_BUF_LEN(m_at) += *padding_len; + *chunk_len += *padding_len; + *padding_len = 0; + } + m_at = sctp_add_addr_to_mbuf(m_at, laddr->ifa, chunk_len); cnt++; if (cnt >= SCTP_ADDRESS_LIMIT) { break; @@ -4580,21 +4600,19 @@ sctp_send_initiate(struct sctp_inpcb *in #endif ) { - struct mbuf *m, *m_at, *mp_last; + struct sctp_scoping scp; + struct mbuf *m; struct sctp_nets *net; struct sctp_init_chunk *init; struct sctp_supported_addr_param *sup_addr; struct sctp_adaptation_layer_indication *ali; - struct sctp_ecn_supported_param *ecn; - struct sctp_prsctp_supported_param *prsctp; struct sctp_supported_chunk_types_param *pr_supported; + struct sctp_paramhdr *ph; int cnt_inits_to = 0; - int padval, ret; - int num_ext; - int p_len; + int ret; + uint16_t num_ext, chunk_len, padding_len, parameter_len; /* INIT's always go to the primary (and usually ONLY address) */ - mp_last = NULL; net = stcb->asoc.primary_destination; if (net == NULL) { net = TAILQ_FIRST(&stcb->asoc.nets); @@ -4611,15 +4629,12 @@ sctp_send_initiate(struct sctp_inpcb *in } SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT\n"); #ifdef INET6 - if (((struct sockaddr *)&(net->ro._l_addr))->sa_family == AF_INET6) { + if (net->ro._l_addr.sa.sa_family == AF_INET6) { /* * special hook, if we are sending to link local it will not * show up in our private address count. */ - struct sockaddr_in6 *sin6l; - - sin6l = &net->ro._l_addr.sin6; - if (IN6_IS_ADDR_LINKLOCAL(&sin6l->sin6_addr)) + if (IN6_IS_ADDR_LINKLOCAL(&net->ro._l_addr.sin6.sin6_addr)) cnt_inits_to = 1; } #endif @@ -4637,14 +4652,15 @@ sctp_send_initiate(struct sctp_inpcb *in SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - mbuf?\n"); return; } - SCTP_BUF_LEN(m) = sizeof(struct sctp_init_chunk); + chunk_len = (uint16_t) sizeof(struct sctp_init_chunk); + padding_len = 0; /* * assume peer supports asconf in order to be able to queue local * address changes while an INIT is in flight and before the assoc * is established. */ stcb->asoc.peer_supports_asconf = 1; - /* Now lets put the SCTP header in place */ + /* Now lets put the chunk header in place */ init = mtod(m, struct sctp_init_chunk *); /* now the chunk header */ init->ch.chunk_type = SCTP_INITIATION; @@ -4656,84 +4672,112 @@ sctp_send_initiate(struct sctp_inpcb *in /* set up some of the credits. */ init->init.a_rwnd = htonl(max(inp->sctp_socket ? SCTP_SB_LIMIT_RCV(inp->sctp_socket) : 0, SCTP_MINIMAL_RWND)); - init->init.num_outbound_streams = htons(stcb->asoc.pre_open_streams); init->init.num_inbound_streams = htons(stcb->asoc.max_inbound_streams); init->init.initial_tsn = htonl(stcb->asoc.init_seq_number); + +#if defined(INET) || defined(INET6) /* now the address restriction */ /* XXX Should we take the address family of the socket into account? */ - sup_addr = (struct sctp_supported_addr_param *)((caddr_t)init + - sizeof(*init)); + sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len); sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE); #ifdef INET6 #ifdef INET /* we support 2 types: IPv4/IPv6 */ - sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); + parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); + sup_addr->ph.param_length = htons(parameter_len); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(SCTP_IPV6_ADDRESS); + padding_len = 0; #else /* we support 1 type: IPv6 */ - sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); + parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); + sup_addr->ph.param_length = htons(parameter_len); sup_addr->addr_type[0] = htons(SCTP_IPV6_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ + padding_len = (uint16_t) sizeof(uint16_t); #endif #else /* we support 1 type: IPv4 */ - sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); + parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); + sup_addr->ph.param_length = htons(parameter_len); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ + padding_len = (uint16_t) sizeof(uint16_t); #endif - SCTP_BUF_LEN(m) += sizeof(struct sctp_supported_addr_param); - /* adaptation layer indication parameter */ - ali = (struct sctp_adaptation_layer_indication *)((caddr_t)sup_addr + sizeof(struct sctp_supported_addr_param)); + chunk_len += parameter_len; +#endif + /* Adaptation layer indication parameter */ + /* XXX: Should we include this always? */ + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_adaptation_layer_indication); + ali = (struct sctp_adaptation_layer_indication *)(mtod(m, caddr_t)+chunk_len); ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); - ali->ph.param_length = htons(sizeof(*ali)); + ali->ph.param_length = htons(parameter_len); ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); - SCTP_BUF_LEN(m) += sizeof(*ali); - ecn = (struct sctp_ecn_supported_param *)((caddr_t)ali + sizeof(*ali)); + chunk_len += parameter_len; if (SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly)) { - /* Add NAT friendly parameter */ - struct sctp_paramhdr *ph; - - ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); + /* Add NAT friendly parameter. */ + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len); ph->param_type = htons(SCTP_HAS_NAT_SUPPORT); - ph->param_length = htons(sizeof(struct sctp_paramhdr)); - SCTP_BUF_LEN(m) += sizeof(struct sctp_paramhdr); - ecn = (struct sctp_ecn_supported_param *)((caddr_t)ph + sizeof(*ph)); + ph->param_length = htons(parameter_len); + chunk_len += parameter_len; } /* now any cookie time extensions */ if (stcb->asoc.cookie_preserve_req) { struct sctp_cookie_perserve_param *cookie_preserve; - cookie_preserve = (struct sctp_cookie_perserve_param *)(ecn); + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_cookie_perserve_param); + cookie_preserve = (struct sctp_cookie_perserve_param *)(mtod(m, caddr_t)+chunk_len); cookie_preserve->ph.param_type = htons(SCTP_COOKIE_PRESERVE); - cookie_preserve->ph.param_length = htons( - sizeof(*cookie_preserve)); + cookie_preserve->ph.param_length = htons(parameter_len); cookie_preserve->time = htonl(stcb->asoc.cookie_preserve_req); - SCTP_BUF_LEN(m) += sizeof(*cookie_preserve); - ecn = (struct sctp_ecn_supported_param *)( - (caddr_t)cookie_preserve + sizeof(*cookie_preserve)); stcb->asoc.cookie_preserve_req = 0; + chunk_len += parameter_len; } /* ECN parameter */ if (stcb->asoc.ecn_allowed == 1) { - ecn->ph.param_type = htons(SCTP_ECN_CAPABLE); - ecn->ph.param_length = htons(sizeof(*ecn)); - SCTP_BUF_LEN(m) += sizeof(*ecn); - prsctp = (struct sctp_prsctp_supported_param *)((caddr_t)ecn + - sizeof(*ecn)); - } else { - prsctp = (struct sctp_prsctp_supported_param *)((caddr_t)ecn); + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len); + ph->param_type = htons(SCTP_ECN_CAPABLE); + ph->param_length = htons(parameter_len); + chunk_len += parameter_len; + } + /* And now tell the peer we do support PR-SCTP. */ + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; } - /* And now tell the peer we do pr-sctp */ - prsctp->ph.param_type = htons(SCTP_PRSCTP_SUPPORTED); - prsctp->ph.param_length = htons(sizeof(*prsctp)); - SCTP_BUF_LEN(m) += sizeof(*prsctp); + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len); + ph->param_type = htons(SCTP_PRSCTP_SUPPORTED); + ph->param_length = htons(parameter_len); + chunk_len += parameter_len; /* And now tell the peer we do all the extensions */ - pr_supported = (struct sctp_supported_chunk_types_param *) - ((caddr_t)prsctp + sizeof(*prsctp)); + pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len); pr_supported->ph.param_type = htons(SCTP_SUPPORTED_CHUNK_EXT); num_ext = 0; pr_supported->chunk_types[num_ext++] = SCTP_ASCONF; @@ -4747,99 +4791,94 @@ sctp_send_initiate(struct sctp_inpcb *in if (stcb->asoc.sctp_nr_sack_on_off == 1) { pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK; } - p_len = sizeof(*pr_supported) + num_ext; - pr_supported->ph.param_length = htons(p_len); - bzero((caddr_t)pr_supported + p_len, SCTP_SIZE32(p_len) - p_len); - SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); - + parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext; + pr_supported->ph.param_length = htons(parameter_len); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; /* add authentication parameters */ if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { - struct sctp_auth_random *randp; - struct sctp_auth_hmac_algo *hmacs; - struct sctp_auth_chunk_list *chunks; - /* attach RANDOM parameter, if available */ if (stcb->asoc.authinfo.random != NULL) { - randp = (struct sctp_auth_random *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); - p_len = sizeof(*randp) + stcb->asoc.authinfo.random_len; + struct sctp_auth_random *randp; + + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + randp = (struct sctp_auth_random *)(mtod(m, caddr_t)+chunk_len); + parameter_len = (uint16_t) sizeof(struct sctp_auth_random) + stcb->asoc.authinfo.random_len; /* random key already contains the header */ - bcopy(stcb->asoc.authinfo.random->key, randp, p_len); - /* zero out any padding required */ - bzero((caddr_t)randp + p_len, SCTP_SIZE32(p_len) - p_len); - SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); + memcpy(randp, stcb->asoc.authinfo.random->key, parameter_len); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; } /* add HMAC_ALGO parameter */ - hmacs = (struct sctp_auth_hmac_algo *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); - p_len = sctp_serialize_hmaclist(stcb->asoc.local_hmacs, - (uint8_t *) hmacs->hmac_ids); - if (p_len > 0) { - p_len += sizeof(*hmacs); + if ((stcb->asoc.local_hmacs != NULL) && + (stcb->asoc.local_hmacs->num_algo > 0)) { + struct sctp_auth_hmac_algo *hmacs; + + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + hmacs = (struct sctp_auth_hmac_algo *)(mtod(m, caddr_t)+chunk_len); + parameter_len = (uint16_t) (sizeof(struct sctp_auth_hmac_algo) + + stcb->asoc.local_hmacs->num_algo * sizeof(uint16_t)); hmacs->ph.param_type = htons(SCTP_HMAC_LIST); - hmacs->ph.param_length = htons(p_len); - /* zero out any padding required */ - bzero((caddr_t)hmacs + p_len, SCTP_SIZE32(p_len) - p_len); - SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); + hmacs->ph.param_length = htons(parameter_len); + sctp_serialize_hmaclist(stcb->asoc.local_hmacs, (uint8_t *) hmacs->hmac_ids); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; } /* add CHUNKS parameter */ - chunks = (struct sctp_auth_chunk_list *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); - p_len = sctp_serialize_auth_chunks(stcb->asoc.local_auth_chunks, - chunks->chunk_types); - if (p_len > 0) { - p_len += sizeof(*chunks); + if (sctp_auth_get_chklist_size(stcb->asoc.local_auth_chunks) > 0) { + struct sctp_auth_chunk_list *chunks; + + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + chunks = (struct sctp_auth_chunk_list *)(mtod(m, caddr_t)+chunk_len); + parameter_len = (uint16_t) (sizeof(struct sctp_auth_chunk_list) + + sctp_auth_get_chklist_size(stcb->asoc.local_auth_chunks)); chunks->ph.param_type = htons(SCTP_CHUNK_LIST); - chunks->ph.param_length = htons(p_len); - /* zero out any padding required */ - bzero((caddr_t)chunks + p_len, SCTP_SIZE32(p_len) - p_len); - SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); + chunks->ph.param_length = htons(parameter_len); + sctp_serialize_auth_chunks(stcb->asoc.local_auth_chunks, chunks->chunk_types); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; } } - /* now the addresses */ - { - struct sctp_scoping scp; - - /* - * To optimize this we could put the scoping stuff into a - * structure and remove the individual uint8's from the - * assoc structure. Then we could just sifa in the address - * within the stcb. But for now this is a quick hack to get - * the address stuff teased apart. - */ - - scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; - scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; - scp.loopback_scope = stcb->asoc.loopback_scope; - scp.ipv4_local_scope = stcb->asoc.ipv4_local_scope; - scp.local_scope = stcb->asoc.local_scope; - scp.site_scope = stcb->asoc.site_scope; - - sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to); - } + SCTP_BUF_LEN(m) = chunk_len; - /* calulate the size and update pkt header and chunk header */ - p_len = 0; - for (m_at = m; m_at; m_at = SCTP_BUF_NEXT(m_at)) { - if (SCTP_BUF_NEXT(m_at) == NULL) - mp_last = m_at; - p_len += SCTP_BUF_LEN(m_at); - } - init->ch.chunk_length = htons(p_len); + /* now the addresses */ /* - * We sifa 0 here to NOT set IP_DF if its IPv4, we ignore the return - * here since the timer will drive a retranmission. - */ + * To optimize this we could put the scoping stuff into a structure + * and remove the individual uint8's from the assoc structure. Then + * we could just sifa in the address within the stcb. But for now + * this is a quick hack to get the address stuff teased apart. + */ + scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; + scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; + scp.loopback_scope = stcb->asoc.loopback_scope; + scp.ipv4_local_scope = stcb->asoc.ipv4_local_scope; + scp.local_scope = stcb->asoc.local_scope; + scp.site_scope = stcb->asoc.site_scope; + sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to, &padding_len, &chunk_len); + + init->ch.chunk_length = htons(chunk_len); + if (padding_len > 0) { + struct mbuf *m_at, *mp_last; - /* I don't expect this to execute but we will be safe here */ - padval = p_len % 4; - if ((padval) && (mp_last)) { - /* - * The compiler worries that mp_last may not be set even - * though I think it is impossible :-> however we add - * mp_last here just in case. - */ - ret = sctp_add_pad_tombuf(mp_last, (4 - padval)); - if (ret) { - /* Houston we have a problem, no space */ + mp_last = NULL; + for (m_at = m; m_at; m_at = SCTP_BUF_NEXT(m_at)) { + if (SCTP_BUF_NEXT(m_at) == NULL) + mp_last = m_at; + } + if ((mp_last == NULL) || sctp_add_pad_tombuf(mp_last, padding_len)) { sctp_m_freem(m); return; } @@ -5758,7 +5797,7 @@ do_a_abort: /* I can have what I want :> */ initack->init.num_outbound_streams = htons(i_want); } - /* tell him his limt. */ + /* tell him his limit. */ initack->init.num_inbound_streams = htons(inp->sctp_ep.max_open_streams_intome); @@ -5874,7 +5913,7 @@ do_a_abort: scp.ipv4_local_scope = stc.ipv4_scope; scp.local_scope = stc.local_scope; scp.site_scope = stc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); + m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to, NULL, NULL); } /* tack on the operational error if present */ Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Mar 8 01:05:07 2013 (r248011) +++ stable/8/sys/netinet/sctp_output.h Fri Mar 8 01:10:33 2013 (r248012) @@ -46,7 +46,8 @@ sctp_add_addresses_to_i_ia(struct sctp_i struct sctp_tcb *stcb, struct sctp_scoping *scope, struct mbuf *m_at, - int cnt_inits_to); + int cnt_inits_to, + uint16_t * padding_len, uint16_t * chunk_len); int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:12:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3FD1EB5C; Fri, 8 Mar 2013 01:12:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26F5FEB0; Fri, 8 Mar 2013 01:12:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281Cf9P088184; Fri, 8 Mar 2013 01:12:41 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281CfJC088183; Fri, 8 Mar 2013 01:12:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080112.r281CfJC088183@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:12:40 +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: r248013 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:12:41 -0000 Author: tuexen Date: Fri Mar 8 01:12:40 2013 New Revision: 248013 URL: http://svnweb.freebsd.org/changeset/base/248013 Log: MFC r244026: Use correct padding of the ABORT chunk in case of an user initiated abort cause is used. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:10:33 2013 (r248012) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:12:40 2013 (r248013) @@ -10738,45 +10738,50 @@ sctp_send_abort_tcb(struct sctp_tcb *stc #endif ) { - struct mbuf *m_abort; - struct mbuf *m_out = NULL, *m_end = NULL; - struct sctp_abort_chunk *abort = NULL; - int sz; - uint32_t auth_offset = 0; + struct mbuf *m_abort, *m, *m_last; + struct mbuf *m_out, *m_end = NULL; + struct sctp_abort_chunk *abort; struct sctp_auth_chunk *auth = NULL; struct sctp_nets *net; + uint32_t auth_offset = 0; + uint16_t cause_len, chunk_len, padding_len; + SCTP_TCB_LOCK_ASSERT(stcb); /*- * Add an AUTH chunk, if chunk requires it and save the offset into * the chain for AUTH */ if (sctp_auth_is_required_chunk(SCTP_ABORT_ASSOCIATION, stcb->asoc.peer_auth_chunks)) { - m_out = sctp_add_auth_chunk(m_out, &m_end, &auth, &auth_offset, + m_out = sctp_add_auth_chunk(NULL, &m_end, &auth, &auth_offset, stcb, SCTP_ABORT_ASSOCIATION); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); + } else { + m_out = NULL; } - SCTP_TCB_LOCK_ASSERT(stcb); m_abort = sctp_get_mbuf_for_msg(sizeof(struct sctp_abort_chunk), 0, M_DONTWAIT, 1, MT_HEADER); if (m_abort == NULL) { - /* no mbuf's */ - if (m_out) + if (m_out) { sctp_m_freem(m_out); + } + if (operr) { + sctp_m_freem(operr); + } return; } /* link in any error */ SCTP_BUF_NEXT(m_abort) = operr; - sz = 0; - if (operr) { - struct mbuf *n; - - n = operr; - while (n) { - sz += SCTP_BUF_LEN(n); - n = SCTP_BUF_NEXT(n); + cause_len = 0; + m_last = NULL; + for (m = operr; m; m = SCTP_BUF_NEXT(m)) { + cause_len += (uint16_t) SCTP_BUF_LEN(m); + if (SCTP_BUF_NEXT(m) == NULL) { + m_last = m; } } - SCTP_BUF_LEN(m_abort) = sizeof(*abort); + SCTP_BUF_LEN(m_abort) = sizeof(struct sctp_abort_chunk); + chunk_len = (uint16_t) sizeof(struct sctp_abort_chunk) + cause_len; + padding_len = SCTP_SIZE32(chunk_len) - chunk_len; if (m_out == NULL) { /* NO Auth chunk prepended, so reserve space in front */ SCTP_BUF_RESV_UF(m_abort, SCTP_MIN_OVERHEAD); @@ -10790,12 +10795,18 @@ sctp_send_abort_tcb(struct sctp_tcb *stc } else { net = stcb->asoc.primary_destination; } - /* fill in the ABORT chunk */ + /* Fill in the ABORT chunk header. */ abort = mtod(m_abort, struct sctp_abort_chunk *); abort->ch.chunk_type = SCTP_ABORT_ASSOCIATION; abort->ch.chunk_flags = 0; - abort->ch.chunk_length = htons(sizeof(*abort) + sz); - + abort->ch.chunk_length = htons(chunk_len); + /* Add padding, if necessary. */ + if (padding_len > 0) { + if ((m_last == NULL) || sctp_add_pad_tombuf(m_last, padding_len)) { + sctp_m_freem(m_out); + return; + } + } (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:14:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D5B9CD1; Fri, 8 Mar 2013 01:14:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F70FEBC; Fri, 8 Mar 2013 01:14:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281EM7d088458; Fri, 8 Mar 2013 01:14:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281EMGj088457; Fri, 8 Mar 2013 01:14:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080114.r281EMGj088457@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:14:22 +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: r248014 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:14:23 -0000 Author: tuexen Date: Fri Mar 8 01:14:22 2013 New Revision: 248014 URL: http://svnweb.freebsd.org/changeset/base/248014 Log: MFC r244033: Get it compiling without INET and INET6 support (mainly userland stack). Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:12:40 2013 (r248013) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:14:22 2013 (r248014) @@ -4604,7 +4604,11 @@ sctp_send_initiate(struct sctp_inpcb *in struct mbuf *m; struct sctp_nets *net; struct sctp_init_chunk *init; + +#if defined(INET) || defined(INET6) struct sctp_supported_addr_param *sup_addr; + +#endif struct sctp_adaptation_layer_indication *ali; struct sctp_supported_chunk_types_param *pr_supported; struct sctp_paramhdr *ph; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:16:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2D746ED3; Fri, 8 Mar 2013 01:16:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 205F5ECF; Fri, 8 Mar 2013 01:16:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281G9TR088757; Fri, 8 Mar 2013 01:16:09 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281G8k3088756; Fri, 8 Mar 2013 01:16:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080116.r281G8k3088756@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:16:08 +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: r248015 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:16:09 -0000 Author: tuexen Date: Fri Mar 8 01:16:08 2013 New Revision: 248015 URL: http://svnweb.freebsd.org/changeset/base/248015 Log: MFC r244728: Fix a copy and paste error. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 01:14:22 2013 (r248014) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 01:16:08 2013 (r248015) @@ -4955,7 +4955,7 @@ sctp_get_ifa_hash_val(struct sockaddr *a } #endif #ifdef INET6 - case INET6: + case AF_INET6: { struct sockaddr_in6 *sin6; uint32_t hash_of_addr; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:17:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A800AE2; Fri, 8 Mar 2013 01:17:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8298DEE7; Fri, 8 Mar 2013 01:17:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281Hu4H089014; Fri, 8 Mar 2013 01:17:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281HuTt089013; Fri, 8 Mar 2013 01:17:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080117.r281HuTt089013@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:17:56 +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: r248016 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:17:56 -0000 Author: tuexen Date: Fri Mar 8 01:17:55 2013 New Revision: 248016 URL: http://svnweb.freebsd.org/changeset/base/248016 Log: MFC r244729: Minor cleanups of debug messages. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:16:08 2013 (r248015) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:17:55 2013 (r248016) @@ -2694,9 +2694,9 @@ sctp_inpcb_bind(struct socket *so, struc ip_inp = (struct inpcb *)so->so_pcb; #ifdef SCTP_DEBUG if (addr) { - SCTPDBG(SCTP_DEBUG_PCB1, "Bind called port:%d\n", + SCTPDBG(SCTP_DEBUG_PCB1, "Bind called port: %d\n", ntohs(((struct sockaddr_in *)addr)->sin_port)); - SCTPDBG(SCTP_DEBUG_PCB1, "Addr :"); + SCTPDBG(SCTP_DEBUG_PCB1, "Addr: "); SCTPDBG_ADDR(SCTP_DEBUG_PCB1, addr); } #endif From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:19:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 177ED365; Fri, 8 Mar 2013 01:19:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 09CB4F08; Fri, 8 Mar 2013 01:19:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281Jkxt089305; Fri, 8 Mar 2013 01:19:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281JkrK089304; Fri, 8 Mar 2013 01:19:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080119.r281JkrK089304@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:19:46 +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: r248017 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:19:47 -0000 Author: tuexen Date: Fri Mar 8 01:19:46 2013 New Revision: 248017 URL: http://svnweb.freebsd.org/changeset/base/248017 Log: MFC r244730: Some cleanups. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:17:55 2013 (r248016) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:19:46 2013 (r248017) @@ -547,27 +547,21 @@ try_again: static int sctp_bind(struct socket *so, struct sockaddr *addr, struct thread *p) { - struct sctp_inpcb *inp = NULL; - int error; + struct sctp_inpcb *inp; -#ifdef INET - if (addr && addr->sa_family != AF_INET) { - /* must be a v4 address! */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); - } -#endif /* INET6 */ - if (addr && (addr->sa_len != sizeof(struct sockaddr_in))) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); - } inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } - error = sctp_inpcb_bind(so, addr, NULL, p); - return (error); + if (addr != NULL) { + if ((addr->sa_family != AF_INET) || + (addr->sa_len != sizeof(struct sockaddr_in))) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + return (EINVAL); + } + } + return (sctp_inpcb_bind(so, addr, NULL, p)); } #endif From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:21:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DA0784E1; Fri, 8 Mar 2013 01:21:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BDAB0F18; Fri, 8 Mar 2013 01:21:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281LnKE091205; Fri, 8 Mar 2013 01:21:49 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281LmtM091193; Fri, 8 Mar 2013 01:21:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080121.r281LmtM091193@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:21:48 +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: r248018 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:21:49 -0000 Author: tuexen Date: Fri Mar 8 01:21:48 2013 New Revision: 248018 URL: http://svnweb.freebsd.org/changeset/base/248018 Log: MFC r246588: Fix a bug where HEARTBEATs were still sent in SHUTDOWN_SENT or SHUTDOWN_ACK_SENT state. While there, make the corresponding code consistent. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Mar 8 01:19:46 2013 (r248017) +++ stable/8/sys/netinet/sctp_indata.c Fri Mar 8 01:21:48 2013 (r248018) @@ -4262,19 +4262,19 @@ again: (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown_ack(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, netp); } @@ -4973,11 +4973,6 @@ sctp_handle_sack(struct mbuf *m, int off } else { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); @@ -4985,6 +4980,11 @@ sctp_handle_sack(struct mbuf *m, int off SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); @@ -4996,19 +4996,19 @@ sctp_handle_sack(struct mbuf *m, int off (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown_ack(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, netp); return; Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Mar 8 01:19:46 2013 (r248017) +++ stable/8/sys/netinet/sctp_input.c Fri Mar 8 01:21:48 2013 (r248018) @@ -956,7 +956,6 @@ sctp_handle_shutdown(struct sctp_shutdow } else { /* no outstanding data to send, so move on... */ /* send SHUTDOWN-ACK */ - sctp_send_shutdown_ack(stcb, net); /* move to SHUTDOWN-ACK-SENT state */ if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { @@ -965,6 +964,7 @@ sctp_handle_shutdown(struct sctp_shutdow SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); + sctp_send_shutdown_ack(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:19:46 2013 (r248017) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:21:48 2013 (r248018) @@ -6579,12 +6579,13 @@ sctp_sendall_iterator(struct sctp_inpcb * only send SHUTDOWN the first time * through */ - sctp_send_shutdown(stcb, net); if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + sctp_send_shutdown(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, @@ -13097,18 +13098,19 @@ dataless_eof: (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } /* only send SHUTDOWN the first time through */ - sctp_send_shutdown(stcb, netp); if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:19:46 2013 (r248017) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:21:48 2013 (r248018) @@ -3332,22 +3332,23 @@ sctp_inpcb_free(struct sctp_inpcb *inp, (SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; - if (asoc->asoc.alternate) { - netp = asoc->asoc.alternate; - } else { - netp = asoc->asoc.primary_destination; - } /* * there is nothing queued to send, * so I send shutdown */ - sctp_send_shutdown(asoc, netp); if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(asoc); + if (asoc->asoc.alternate) { + netp = asoc->asoc.alternate; + } else { + netp = asoc->asoc.primary_destination; + } + sctp_send_shutdown(asoc, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, asoc->sctp_ep, asoc, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc, Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Mar 8 01:19:46 2013 (r248017) +++ stable/8/sys/netinet/sctp_timer.c Fri Mar 8 01:21:48 2013 (r248018) @@ -1560,18 +1560,19 @@ sctp_autoclose_timer(struct sctp_inpcb * /* only send SHUTDOWN 1st time thru */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_send_shutdown(stcb, netp); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:19:46 2013 (r248017) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:21:48 2013 (r248018) @@ -794,25 +794,24 @@ sctp_disconnect(struct socket *so) /* only send SHUTDOWN 1st time thru */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, netp); - sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); - + sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); } } else { /* @@ -1014,24 +1013,24 @@ sctp_shutdown(struct socket *so) /* only send SHUTDOWN the first time through */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, netp); - sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); + sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); } } else { /* From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:24:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2D12E662; Fri, 8 Mar 2013 01:24:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1EB56F29; Fri, 8 Mar 2013 01:24:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281O39u091604; Fri, 8 Mar 2013 01:24:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281O1k3091584; Fri, 8 Mar 2013 01:24:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080124.r281O1k3091584@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248019 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:24:03 -0000 Author: tuexen Date: Fri Mar 8 01:24:00 2013 New Revision: 248019 URL: http://svnweb.freebsd.org/changeset/base/248019 Log: MFC r246595: Cleanup the handling of address scopes. Announce in the INIT/INIT-ACK only the supported address types. While there, do some whitespace cleanups. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp.h Fri Mar 8 01:24:00 2013 (r248019) @@ -500,12 +500,12 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_SOCKET_GONE 0x10000000 #define SCTP_PCB_FLAGS_SOCKET_ALLGONE 0x20000000 #define SCTP_PCB_FLAGS_SOCKET_CANT_READ 0x40000000 + /* flags to copy to new PCB */ #define SCTP_PCB_COPY_FLAGS (SCTP_PCB_FLAGS_BOUNDALL|\ SCTP_PCB_FLAGS_WAKEINPUT|\ SCTP_PCB_FLAGS_BOUND_V6) - /* * PCB Features (in sctp_features bitmask) */ Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp_asconf.c Fri Mar 8 01:24:00 2013 (r248019) @@ -1916,7 +1916,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * return; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - if (stcb->asoc.local_scope == 0) { + if (stcb->asoc.scope.local_scope == 0) { return; } /* is it the right link local scope? */ @@ -1924,7 +1924,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * return; } } - if (stcb->asoc.site_scope == 0 && + if (stcb->asoc.scope.site_scope == 0 && IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) { return; } @@ -1948,7 +1948,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * /* we skip unspecifed addresses */ return; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { return; } @@ -2106,7 +2106,7 @@ sctp_asconf_iterator_stcb(struct sctp_in continue; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - if (stcb->asoc.local_scope == 0) { + if (stcb->asoc.scope.local_scope == 0) { continue; } /* is it the right link local scope? */ @@ -2135,7 +2135,7 @@ sctp_asconf_iterator_stcb(struct sctp_in /* we skip unspecifed addresses */ continue; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { continue; } @@ -2198,13 +2198,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } } else { /* Need to check scopes for this guy */ - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } } @@ -2437,7 +2431,7 @@ sctp_find_valid_localaddr(struct sctp_tc return (NULL); } LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { - if (stcb->asoc.loopback_scope == 0 && + if (stcb->asoc.scope.loopback_scope == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* Skip if loopback_scope not set */ continue; @@ -2446,7 +2440,7 @@ sctp_find_valid_localaddr(struct sctp_tc switch (sctp_ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { struct sockaddr_in *sin; sin = (struct sockaddr_in *)&sctp_ifa->address.sa; @@ -2454,7 +2448,7 @@ sctp_find_valid_localaddr(struct sctp_tc /* skip unspecifed addresses */ continue; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) continue; @@ -2473,7 +2467,7 @@ sctp_find_valid_localaddr(struct sctp_tc #endif #ifdef INET6 case AF_INET6: - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { struct sockaddr_in6 *sin6; if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { @@ -2487,10 +2481,10 @@ sctp_find_valid_localaddr(struct sctp_tc */ continue; } - if (stcb->asoc.local_scope == 0 && + if (stcb->asoc.scope.local_scope == 0 && IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) continue; - if (stcb->asoc.site_scope == 0 && + if (stcb->asoc.scope.site_scope == 0 && IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) continue; Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp_input.c Fri Mar 8 01:24:00 2013 (r248019) @@ -2130,13 +2130,13 @@ sctp_process_cookie_new(struct mbuf *m, asoc = &stcb->asoc; /* get scope variables out of cookie */ - asoc->ipv4_local_scope = cookie->ipv4_scope; - asoc->site_scope = cookie->site_scope; - asoc->local_scope = cookie->local_scope; - asoc->loopback_scope = cookie->loopback_scope; + asoc->scope.ipv4_local_scope = cookie->ipv4_scope; + asoc->scope.site_scope = cookie->site_scope; + asoc->scope.local_scope = cookie->local_scope; + asoc->scope.loopback_scope = cookie->loopback_scope; - if ((asoc->ipv4_addr_legal != cookie->ipv4_addr_legal) || - (asoc->ipv6_addr_legal != cookie->ipv6_addr_legal)) { + if ((asoc->scope.ipv4_addr_legal != cookie->ipv4_addr_legal) || + (asoc->scope.ipv6_addr_legal != cookie->ipv6_addr_legal)) { struct mbuf *op_err; /* Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:24:00 2013 (r248019) @@ -1863,15 +1863,10 @@ struct sack_track sack_array[256] = { int sctp_is_address_in_scope(struct sctp_ifa *ifa, - int ipv4_addr_legal, - int ipv6_addr_legal, - int loopback_scope, - int ipv4_local_scope, - int local_scope SCTP_UNUSED,/* XXX */ - int site_scope, + struct sctp_scoping *scope, int do_update) { - if ((loopback_scope == 0) && + if ((scope->loopback_scope == 0) && (ifa->ifn_p) && SCTP_IFN_IS_IFT_LOOP(ifa->ifn_p)) { /* * skip loopback if not in scope * @@ -1881,7 +1876,7 @@ sctp_is_address_in_scope(struct sctp_ifa switch (ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - if (ipv4_addr_legal) { + if (scope->ipv4_addr_legal) { struct sockaddr_in *sin; sin = (struct sockaddr_in *)&ifa->address.sin; @@ -1889,7 +1884,7 @@ sctp_is_address_in_scope(struct sctp_ifa /* not in scope , unspecified */ return (0); } - if ((ipv4_local_scope == 0) && + if ((scope->ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { /* private address not in scope */ return (0); @@ -1901,7 +1896,7 @@ sctp_is_address_in_scope(struct sctp_ifa #endif #ifdef INET6 case AF_INET6: - if (ipv6_addr_legal) { + if (scope->ipv6_addr_legal) { struct sockaddr_in6 *sin6; /* @@ -1924,7 +1919,7 @@ sctp_is_address_in_scope(struct sctp_ifa (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) { return (0); } - if ((site_scope == 0) && + if ((scope->site_scope == 0) && (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { return (0); } @@ -2063,13 +2058,7 @@ sctp_add_addresses_to_i_ia(struct sctp_i if (sctp_is_addr_restricted(stcb, sctp_ifap)) { continue; } - if (sctp_is_address_in_scope(sctp_ifap, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 1) == 0) { + if (sctp_is_address_in_scope(sctp_ifap, scope, 1) == 0) { continue; } cnt++; @@ -2099,12 +2088,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(sctp_ifap, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 0) == 0) { + scope, 0) == 0) { continue; } if ((chunk_len != NULL) && @@ -2157,12 +2141,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(laddr->ifa, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 1) == 0) { + scope, 1) == 0) { continue; } cnt++; @@ -2182,12 +2161,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(laddr->ifa, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 0) == 0) { + scope, 0) == 0) { continue; } if ((chunk_len != NULL) && @@ -2801,13 +2775,7 @@ sctp_select_nth_preferred_addr_from_ifn_ } #endif if (stcb) { - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -2853,13 +2821,7 @@ sctp_count_num_preferred_boundall(struct continue; } if (stcb) { - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -3055,13 +3017,7 @@ again_with_private_addresses_allowed: continue; } if (stcb) { - if (sctp_is_address_in_scope(sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(sifa, &stcb->asoc.scope, 0) == 0) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "NOT in scope\n"); sifa = NULL; continue; @@ -3108,13 +3064,7 @@ plan_d: if (sifa == NULL) continue; if (stcb) { - if (sctp_is_address_in_scope(sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(sifa, &stcb->asoc.scope, 0) == 0) { sifa = NULL; continue; } @@ -3135,12 +3085,12 @@ plan_d: } } #ifdef INET - if ((retried == 0) && (stcb->asoc.ipv4_local_scope == 0)) { - stcb->asoc.ipv4_local_scope = 1; + if ((retried == 0) && (stcb->asoc.scope.ipv4_local_scope == 0)) { + stcb->asoc.scope.ipv4_local_scope = 1; retried = 1; goto again_with_private_addresses_allowed; } else if (retried == 1) { - stcb->asoc.ipv4_local_scope = 0; + stcb->asoc.scope.ipv4_local_scope = 0; } #endif out: @@ -3169,12 +3119,7 @@ out: } if (stcb) { if (sctp_is_address_in_scope(tmp_sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -4600,7 +4545,6 @@ sctp_send_initiate(struct sctp_inpcb *in #endif ) { - struct sctp_scoping scp; struct mbuf *m; struct sctp_nets *net; struct sctp_init_chunk *init; @@ -4680,37 +4624,29 @@ sctp_send_initiate(struct sctp_inpcb *in init->init.num_inbound_streams = htons(stcb->asoc.max_inbound_streams); init->init.initial_tsn = htonl(stcb->asoc.init_seq_number); -#if defined(INET) || defined(INET6) - /* now the address restriction */ - /* XXX Should we take the address family of the socket into account? */ - sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len); - sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE); -#ifdef INET6 -#ifdef INET - /* we support 2 types: IPv4/IPv6 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); - sup_addr->addr_type[1] = htons(SCTP_IPV6_ADDRESS); - padding_len = 0; -#else - /* we support 1 type: IPv6 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV6_ADDRESS); - sup_addr->addr_type[1] = htons(0); /* this is the padding */ - padding_len = (uint16_t) sizeof(uint16_t); -#endif -#else - /* we support 1 type: IPv4 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); - sup_addr->addr_type[1] = htons(0); /* this is the padding */ - padding_len = (uint16_t) sizeof(uint16_t); -#endif - chunk_len += parameter_len; -#endif + if (stcb->asoc.scope.ipv4_addr_legal || stcb->asoc.scope.ipv6_addr_legal) { + uint8_t i; + + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + if (stcb->asoc.scope.ipv4_addr_legal) { + parameter_len += (uint16_t) sizeof(uint16_t); + } + if (stcb->asoc.scope.ipv6_addr_legal) { + parameter_len += (uint16_t) sizeof(uint16_t); + } + sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len); + sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE); + sup_addr->ph.param_length = htons(parameter_len); + i = 0; + if (stcb->asoc.scope.ipv4_addr_legal) { + sup_addr->addr_type[i++] = htons(SCTP_IPV4_ADDRESS); + } + if (stcb->asoc.scope.ipv6_addr_legal) { + sup_addr->addr_type[i++] = htons(SCTP_IPV6_ADDRESS); + } + padding_len = 4 - 2 * i; + chunk_len += parameter_len; + } /* Adaptation layer indication parameter */ /* XXX: Should we include this always? */ if (padding_len > 0) { @@ -4865,13 +4801,7 @@ sctp_send_initiate(struct sctp_inpcb *in * we could just sifa in the address within the stcb. But for now * this is a quick hack to get the address stuff teased apart. */ - scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; - scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; - scp.loopback_scope = stcb->asoc.loopback_scope; - scp.ipv4_local_scope = stcb->asoc.ipv4_local_scope; - scp.local_scope = stcb->asoc.local_scope; - scp.site_scope = stcb->asoc.site_scope; - sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to, &padding_len, &chunk_len); + sctp_add_addresses_to_i_ia(inp, stcb, &stcb->asoc.scope, m, cnt_inits_to, &padding_len, &chunk_len); init->ch.chunk_length = htons(chunk_len); if (padding_len > 0) { @@ -5512,24 +5442,16 @@ do_a_abort: */ stc.site_scope = stc.local_scope = stc.loopback_scope = 0; if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - struct inpcb *in_inp; - - /* Its a V6 socket */ - in_inp = (struct inpcb *)inp; stc.ipv6_addr_legal = 1; - /* Now look at the binding flag to see if V4 will be legal */ - if (SCTP_IPV6_V6ONLY(in_inp) == 0) { - stc.ipv4_addr_legal = 1; - } else { - /* V4 addresses are NOT legal on the association */ + if (SCTP_IPV6_V6ONLY(inp)) { stc.ipv4_addr_legal = 0; + } else { + stc.ipv4_addr_legal = 1; } } else { - /* Its a V4 socket, no - V6 */ - stc.ipv4_addr_legal = 1; stc.ipv6_addr_legal = 0; + stc.ipv4_addr_legal = 1; } - #ifdef SCTP_DONT_DO_PRIVADDR_SCOPE stc.ipv4_scope = 1; #else @@ -5634,10 +5556,10 @@ do_a_abort: #endif - stc.loopback_scope = asoc->loopback_scope; - stc.ipv4_scope = asoc->ipv4_local_scope; - stc.site_scope = asoc->site_scope; - stc.local_scope = asoc->local_scope; + stc.loopback_scope = asoc->scope.loopback_scope; + stc.ipv4_scope = asoc->scope.ipv4_local_scope; + stc.site_scope = asoc->scope.site_scope; + stc.local_scope = asoc->scope.local_scope; #ifdef INET6 /* Why do we not consider IPv4 LL addresses? */ TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) { Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp_output.h Fri Mar 8 01:24:00 2013 (r248019) @@ -55,13 +55,9 @@ int sctp_is_addr_restricted(struct sctp_ int sctp_is_address_in_scope(struct sctp_ifa *ifa, - int ipv4_addr_legal, - int ipv6_addr_legal, - int loopback_scope, - int ipv4_local_scope, - int local_scope, - int site_scope, + struct sctp_scoping *scope, int do_update); + int sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:24:00 2013 (r248019) @@ -94,11 +94,10 @@ sctp_fill_pcbinfo(struct sctp_pcbinfo *s spcb->readq_count = SCTP_BASE_INFO(ipi_count_readq); spcb->stream_oque = SCTP_BASE_INFO(ipi_count_strmoq); spcb->free_chunks = SCTP_BASE_INFO(ipi_free_chunks); - SCTP_INP_INFO_RUNLOCK(); } -/* +/*- * Addresses are added to VRF's (Virtual Router's). For BSD we * have only the default VRF 0. We maintain a hash list of * VRF's. Each VRF has its own list of sctp_ifn's. Each of @@ -214,7 +213,6 @@ sctp_find_ifn(void *ifn, uint32_t ifn_in } - struct sctp_vrf * sctp_find_vrf(uint32_t vrf_id) { @@ -230,6 +228,7 @@ sctp_find_vrf(uint32_t vrf_id) return (NULL); } + void sctp_free_vrf(struct sctp_vrf *vrf) { @@ -245,6 +244,7 @@ sctp_free_vrf(struct sctp_vrf *vrf) } } + void sctp_free_ifn(struct sctp_ifn *sctp_ifnp) { @@ -258,6 +258,7 @@ sctp_free_ifn(struct sctp_ifn *sctp_ifnp } } + void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu) { @@ -283,6 +284,7 @@ sctp_free_ifa(struct sctp_ifa *sctp_ifap } } + static void sctp_delete_ifn(struct sctp_ifn *sctp_ifnp, int hold_addr_lock) { @@ -305,12 +307,13 @@ sctp_delete_ifn(struct sctp_ifn *sctp_if sctp_free_ifn(sctp_ifnp); } + void sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(vrf_id); @@ -348,12 +351,13 @@ out: SCTP_IPI_ADDR_RUNLOCK(); } + void sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(vrf_id); @@ -391,6 +395,7 @@ out: SCTP_IPI_ADDR_RUNLOCK(); } + /*- * Add an ifa to an ifn. * Register the interface as necessary. @@ -428,6 +433,7 @@ sctp_add_ifa_to_ifn(struct sctp_ifn *sct } } + /*- * Remove an ifa from its ifn. * If no more addresses exist, remove the ifn too. Otherwise, re-register @@ -479,6 +485,7 @@ sctp_remove_ifa_from_ifn(struct sctp_ifa } } + struct sctp_ifa * sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, uint32_t ifn_type, const char *if_name, void *ifa, @@ -1027,6 +1034,7 @@ sctp_tcb_special_locate(struct sctp_inpc return (NULL); } + static int sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) { @@ -1036,19 +1044,12 @@ sctp_does_stcb_own_this_addr(struct sctp struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; - ipv4_addr_legal = ipv6_addr_legal = 0; - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(stcb->sctp_ep) == 0) { - ipv4_addr_legal = 1; - } - } else { - ipv4_addr_legal = 1; - } + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(stcb->asoc.vrf_id); @@ -1183,6 +1184,7 @@ sctp_does_stcb_own_this_addr(struct sctp return (0); } + /* * rules for use * @@ -1471,11 +1473,11 @@ null_return: return (NULL); } + /* * Find an association for a specific endpoint using the association id given * out in the COMM_UP notification */ - struct sctp_tcb * sctp_findasoc_ep_asocid_locked(struct sctp_inpcb *inp, sctp_assoc_t asoc_id, int want_lock) { @@ -1536,6 +1538,9 @@ sctp_findassociation_ep_asocid(struct sc } +/* + * Endpoint probe expects that the INP_INFO is locked. + */ static struct sctp_inpcb * sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head, uint16_t lport, uint32_t vrf_id) @@ -1552,12 +1557,8 @@ sctp_endpoint_probe(struct sockaddr *nam struct sockaddr_in6 *intf_addr6; #endif - int fnd; - /* - * Endpoint probe expects that the INP_INFO is locked. - */ #ifdef INET sin = NULL; #endif @@ -1893,6 +1894,7 @@ sctp_pcb_findep(struct sockaddr *nam, in return (inp); } + /* * Find an association for an endpoint with the pointer to whom you want to * send to and the endpoint pointer. The address can be IPv4 or IPv6. We may @@ -2144,6 +2146,7 @@ sctp_findassoc_by_vtag(struct sockaddr * return (NULL); } + /* * Find an association with the pointer to the inbound IP packet. This can be * a IPv4 or IPv6 packet. @@ -3743,13 +3746,13 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->ipv4_local_scope = 1; #else if (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { - stcb->asoc.ipv4_local_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; } #endif /* SCTP_DONT_DO_PRIVADDR_SCOPE */ } else { /* Validate the address is in scope */ if ((IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) && - (stcb->asoc.ipv4_local_scope == 0)) { + (stcb->asoc.scope.ipv4_local_scope == 0)) { addr_inscope = 0; } } @@ -3770,10 +3773,10 @@ sctp_add_remote_addr(struct sctp_tcb *st sin6->sin6_len = sizeof(struct sockaddr_in6); if (set_scope) { if (sctp_is_address_on_local_host(newaddr, stcb->asoc.vrf_id)) { - stcb->asoc.loopback_scope = 1; - stcb->asoc.local_scope = 0; - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.loopback_scope = 1; + stcb->asoc.scope.local_scope = 0; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.site_scope = 1; } else if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { /* * If the new destination is a @@ -3785,26 +3788,26 @@ sctp_add_remote_addr(struct sctp_tcb *st * also be on our private network * for v4 too. */ - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.site_scope = 1; } else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) { /* * If the new destination is * SITE_LOCAL then we must have site * scope in common. */ - stcb->asoc.site_scope = 1; + stcb->asoc.scope.site_scope = 1; } } else { /* Validate the address is in scope */ if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) && - (stcb->asoc.loopback_scope == 0)) { + (stcb->asoc.scope.loopback_scope == 0)) { addr_inscope = 0; } else if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) && - (stcb->asoc.local_scope == 0)) { + (stcb->asoc.scope.local_scope == 0)) { addr_inscope = 0; } else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && - (stcb->asoc.site_scope == 0)) { + (stcb->asoc.scope.site_scope == 0)) { addr_inscope = 0; } } @@ -3839,10 +3842,10 @@ sctp_add_remote_addr(struct sctp_tcb *st } net->addr_is_local = sctp_is_address_on_local_host(newaddr, stcb->asoc.vrf_id); if (net->addr_is_local && ((set_scope || (from == SCTP_ADDR_IS_CONFIRMED)))) { - stcb->asoc.loopback_scope = 1; - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.local_scope = 0; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.loopback_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.local_scope = 0; + stcb->asoc.scope.site_scope = 1; addr_inscope = 1; } net->failure_threshold = stcb->asoc.def_net_failure; @@ -6071,7 +6074,7 @@ sctp_load_addresses_from_init(struct sct switch (sa->sa_family) { #ifdef INET case AF_INET: - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_2)) { return (-1); } @@ -6080,7 +6083,7 @@ sctp_load_addresses_from_init(struct sct #endif #ifdef INET6 case AF_INET6: - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_3)) { return (-2); } @@ -6127,7 +6130,7 @@ sctp_load_addresses_from_init(struct sct } #ifdef INET if (ptype == SCTP_IPV4_ADDRESS) { - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { struct sctp_ipv4addr_param *p4, p4_buf; /* ok get the v4 address and check/add */ @@ -6213,7 +6216,7 @@ sctp_load_addresses_from_init(struct sct #endif #ifdef INET6 if (ptype == SCTP_IPV6_ADDRESS) { - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { /* ok get the v6 address and check/add */ struct sctp_ipv6addr_param *p6, p6_buf; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp_structs.h Fri Mar 8 01:24:00 2013 (r248019) @@ -1175,17 +1175,7 @@ struct sctp_association { */ uint8_t peer_supports_pktdrop; - /* Do we allow V6/V4? */ - uint8_t ipv4_addr_legal; - uint8_t ipv6_addr_legal; - /* Address scoping flags */ - /* scope value for IPv4 */ - uint8_t ipv4_local_scope; - /* scope values for IPv6 */ - uint8_t local_scope; - uint8_t site_scope; - /* loopback scope */ - uint8_t loopback_scope; + struct sctp_scoping scope; /* flags to handle send alternate net tracking */ uint8_t used_alt_onsack; uint8_t used_alt_asconfack; Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Mar 8 01:24:00 2013 (r248019) @@ -197,29 +197,29 @@ copy_out_local_addresses(struct sctp_inp /* Turn on all the appropriate scope */ if (stcb) { /* use association specific values */ - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; } else { - /* use generic values for endpoints */ + /* Use generic values for endpoints. */ loopback_scope = 1; ipv4_local_scope = 1; local_scope = 1; site_scope = 1; - } - - /* use only address families of interest */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(inp)) { - ipv4_addr_legal = 0; + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ipv6_addr_legal = 1; + if (SCTP_IPV6_V6ONLY(inp)) { + ipv4_addr_legal = 0; + } else { + ipv4_addr_legal = 1; + } } else { + ipv6_addr_legal = 0; ipv4_addr_legal = 1; } - } else { - ipv4_addr_legal = 1; - ipv6_addr_legal = 0; } /* neither Mac OS X nor FreeBSD support mulitple routing functions */ Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:24:00 2013 (r248019) @@ -1143,23 +1143,29 @@ sctp_fill_up_addresses_vrf(struct sctp_i if (stcb) { /* Turn on all the appropriate scope */ - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; } else { - /* Turn on ALL scope, since we look at the EP */ - loopback_scope = ipv4_local_scope = local_scope = - site_scope = 1; - } - ipv4_addr_legal = ipv6_addr_legal = 0; - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(inp) == 0) { + /* Use generic values for endpoints. */ + loopback_scope = 1; + ipv4_local_scope = 1; + local_scope = 1; + site_scope = 1; + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ipv6_addr_legal = 1; + if (SCTP_IPV6_V6ONLY(inp)) { + ipv4_addr_legal = 0; + } else { + ipv4_addr_legal = 1; + } + } else { + ipv6_addr_legal = 0; ipv4_addr_legal = 1; } - } else { - ipv4_addr_legal = 1; } vrf = sctp_find_vrf(vrf_id); if (vrf == NULL) { @@ -1298,8 +1304,21 @@ sctp_fill_up_addresses_vrf(struct sctp_i } if (sctp_fill_user_address(sas, &laddr->ifa->address.sa)) continue; - - ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; + switch (laddr->ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; + break; +#endif +#ifdef INET6 + case AF_INET6: + ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; + break; +#endif + default: + /* TSNH */ + break; + } sas = (struct sockaddr_storage *)((caddr_t)sas + laddr->ifa->address.sa.sa_len); actual += laddr->ifa->address.sa.sa_len; @@ -5916,7 +5935,7 @@ sctp_connect(struct socket *so, struct s error = EINVAL; goto out_now; } -#endif /* INET6 */ +#endif if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) == SCTP_PCB_FLAGS_UNBOUND) { /* Bind a ephemeral port */ @@ -6210,8 +6229,8 @@ sctp_accept(struct socket *so, struct so return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); - sin->sin_port = ((struct sockaddr_in *)&store)->sin_port; - sin->sin_addr = ((struct sockaddr_in *)&store)->sin_addr; + sin->sin_port = store.sin.sin_port; + sin->sin_addr = store.sin.sin_addr; *addr = (struct sockaddr *)sin; break; } @@ -6226,9 +6245,8 @@ sctp_accept(struct socket *so, struct so return (ENOMEM); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); - sin6->sin6_port = ((struct sockaddr_in6 *)&store)->sin6_port; - - sin6->sin6_addr = ((struct sockaddr_in6 *)&store)->sin6_addr; + sin6->sin6_port = store.sin6.sin6_port; + sin6->sin6_addr = store.sin6.sin6_addr; if ((error = sa6_recoverscope(sin6)) != 0) { SCTP_FREE_SONAME(sin6); return (error); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 01:21:48 2013 (r248018) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 01:24:00 2013 (r248019) @@ -878,7 +878,7 @@ sctp_select_a_tag(struct sctp_inpcb *inp } int -sctp_init_asoc(struct sctp_inpcb *m, struct sctp_tcb *stcb, +sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint32_t override_tag, uint32_t vrf_id) { struct sctp_association *asoc; @@ -899,23 +899,23 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc = &stcb->asoc; /* init all variables to a known value. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:25:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E29BC7DC; Fri, 8 Mar 2013 01:25:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B23F1F31; Fri, 8 Mar 2013 01:25:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281PDCS091816; Fri, 8 Mar 2013 01:25:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281PDTB091815; Fri, 8 Mar 2013 01:25:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080125.r281PDTB091815@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:25:13 +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: r248020 - stable/8/lib/libc/net 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:25:14 -0000 Author: tuexen Date: Fri Mar 8 01:25:13 2013 New Revision: 248020 URL: http://svnweb.freebsd.org/changeset/base/248020 Log: MFC r246629: Improve code style. No functional change. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Mar 8 01:24:00 2013 (r248019) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Mar 8 01:25:13 2013 (r248020) @@ -580,36 +580,36 @@ sctp_sendmsg(int s, if ((tolen > 0) && ((to == NULL) || (tolen < sizeof(struct sockaddr)))) { errno = EINVAL; - return -1; + return (-1); } if (to && (tolen > 0)) { if (to->sa_family == AF_INET) { if (tolen != sizeof(struct sockaddr_in)) { errno = EINVAL; - return -1; + return (-1); } if ((to->sa_len > 0) && (to->sa_len != sizeof(struct sockaddr_in))) { errno = EINVAL; - return -1; + return (-1); } memcpy(&addr, to, sizeof(struct sockaddr_in)); addr.in.sin_len = sizeof(struct sockaddr_in); } else if (to->sa_family == AF_INET6) { if (tolen != sizeof(struct sockaddr_in6)) { errno = EINVAL; - return -1; + return (-1); } if ((to->sa_len > 0) && (to->sa_len != sizeof(struct sockaddr_in6))) { errno = EINVAL; - return -1; + return (-1); } memcpy(&addr, to, sizeof(struct sockaddr_in6)); addr.in6.sin6_len = sizeof(struct sockaddr_in6); } else { errno = EAFNOSUPPORT; - return -1; + return (-1); } who = (struct sockaddr *)&addr; } @@ -833,7 +833,7 @@ sctp_sendmsgx(int sd, sinfo.sinfo_ssn = stream_no; sinfo.sinfo_timetolive = timetolive; sinfo.sinfo_context = context; - return sctp_sendx(sd, msg, len, addrs, addrcnt, &sinfo, 0); + return (sctp_sendx(sd, msg, len, addrs, addrcnt, &sinfo, 0)); } ssize_t From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:27:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5D58295B; Fri, 8 Mar 2013 01:27:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 35665F44; Fri, 8 Mar 2013 01:27:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281RJRE092139; Fri, 8 Mar 2013 01:27:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281RJ2q092138; Fri, 8 Mar 2013 01:27:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080127.r281RJ2q092138@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:27:19 +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: r248021 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:27:19 -0000 Author: tuexen Date: Fri Mar 8 01:27:18 2013 New Revision: 248021 URL: http://svnweb.freebsd.org/changeset/base/248021 Log: MFC r246635: Make sure that received packets for removed addresses are handled consistently. While there, make variable names consistent. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:25:13 2013 (r248020) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:27:18 2013 (r248021) @@ -824,6 +824,160 @@ out_now: } +static int +sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) +{ + int loopback_scope, ipv4_local_scope, local_scope, site_scope; + int ipv4_addr_legal, ipv6_addr_legal; + struct sctp_vrf *vrf; + struct sctp_ifn *sctp_ifn; + struct sctp_ifa *sctp_ifa; + + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; + + SCTP_IPI_ADDR_RLOCK(); + vrf = sctp_find_vrf(stcb->asoc.vrf_id); + if (vrf == NULL) { + /* no vrf, no addresses */ + SCTP_IPI_ADDR_RUNLOCK(); + return (0); + } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { + LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { + if ((loopback_scope == 0) && + SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { + continue; + } + LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifa) && + (!sctp_is_addr_pending(stcb, sctp_ifa))) { + /* + * We allow pending addresses, where + * we have sent an asconf-add to be + * considered valid. + */ + continue; + } + switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + if (ipv4_addr_legal) { + struct sockaddr_in *sin, + *rsin; + + sin = &sctp_ifa->address.sin; + rsin = (struct sockaddr_in *)to; + if ((ipv4_local_scope == 0) && + IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { + continue; + } + if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (ipv6_addr_legal) { + struct sockaddr_in6 *sin6, + *rsin6; + + sin6 = &sctp_ifa->address.sin6; + rsin6 = (struct sockaddr_in6 *)to; + if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { + if (local_scope == 0) + continue; + if (sin6->sin6_scope_id == 0) { + if (sa6_recoverscope(sin6) != 0) + continue; + } + } + if ((site_scope == 0) && + (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { + continue; + } + if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + } + break; +#endif + default: + /* TSNH */ + break; + } + } + } + } else { + struct sctp_laddr *laddr; + + LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) { + if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) { + SCTPDBG(SCTP_DEBUG_PCB1, "ifa being deleted\n"); + continue; + } + if (sctp_is_addr_restricted(stcb, laddr->ifa) && + (!sctp_is_addr_pending(stcb, laddr->ifa))) { + /* + * We allow pending addresses, where we have + * sent an asconf-add to be considered + * valid. + */ + continue; + } + if (laddr->ifa->address.sa.sa_family != to->sa_family) { + continue; + } + switch (to->sa_family) { +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin, *rsin; + + sin = (struct sockaddr_in *)&laddr->ifa->address.sin; + rsin = (struct sockaddr_in *)to; + if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + break; + } +#endif +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6, *rsin6; + + sin6 = (struct sockaddr_in6 *)&laddr->ifa->address.sin6; + rsin6 = (struct sockaddr_in6 *)to; + if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + break; + } + +#endif + default: + /* TSNH */ + break; + } + + } + } + SCTP_IPI_ADDR_RUNLOCK(); + return (0); +} + + static struct sctp_tcb * sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from, struct sockaddr *to, struct sctp_nets **netp, uint32_t vrf_id) @@ -906,7 +1060,6 @@ sctp_tcb_special_locate(struct sctp_inpc if (laddr->ifa->address.sa.sa_family == to->sa_family) { /* see if it matches */ - #ifdef INET if (from->sa_family == AF_INET) { struct sockaddr_in *intf_addr, @@ -949,13 +1102,18 @@ sctp_tcb_special_locate(struct sctp_inpc * Ok if we hit here the ep has the address, does it hold * the tcb? */ - + /* XXX: Why don't we TAILQ_FOREACH through sctp_asoc_list? */ stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb == NULL) { SCTP_INP_RUNLOCK(inp); continue; } SCTP_TCB_LOCK(stcb); + if (!sctp_does_stcb_own_this_addr(stcb, to)) { + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_RUNLOCK(inp); + continue; + } if (stcb->rport != rport) { /* remote port does not match. */ SCTP_TCB_UNLOCK(stcb); @@ -967,6 +1125,11 @@ sctp_tcb_special_locate(struct sctp_inpc SCTP_INP_RUNLOCK(inp); continue; } + if (!sctp_does_stcb_own_this_addr(stcb, to)) { + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_RUNLOCK(inp); + continue; + } /* Does this TCB have a matching address? */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -1035,156 +1198,6 @@ sctp_tcb_special_locate(struct sctp_inpc } -static int -sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) -{ - int loopback_scope, ipv4_local_scope, local_scope, site_scope; - int ipv4_addr_legal, ipv6_addr_legal; - struct sctp_vrf *vrf; - struct sctp_ifn *sctp_ifn; - struct sctp_ifa *sctp_ifa; - - loopback_scope = stcb->asoc.scope.loopback_scope; - ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; - local_scope = stcb->asoc.scope.local_scope; - site_scope = stcb->asoc.scope.site_scope; - ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; - ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; - - SCTP_IPI_ADDR_RLOCK(); - vrf = sctp_find_vrf(stcb->asoc.vrf_id); - if (vrf == NULL) { - /* no vrf, no addresses */ - SCTP_IPI_ADDR_RUNLOCK(); - return (0); - } - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { - LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { - if ((loopback_scope == 0) && - SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { - continue; - } - LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { - if (sctp_is_addr_restricted(stcb, sctp_ifa) && - (!sctp_is_addr_pending(stcb, sctp_ifa))) { - /* - * We allow pending addresses, where - * we have sent an asconf-add to be - * considered valid. - */ - continue; - } - switch (sctp_ifa->address.sa.sa_family) { -#ifdef INET - case AF_INET: - if (ipv4_addr_legal) { - struct sockaddr_in *sin, - *rsin; - - sin = &sctp_ifa->address.sin; - rsin = (struct sockaddr_in *)to; - if ((ipv4_local_scope == 0) && - IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { - continue; - } - if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { - SCTP_IPI_ADDR_RUNLOCK(); - return (1); - } - } - break; -#endif -#ifdef INET6 - case AF_INET6: - if (ipv6_addr_legal) { - struct sockaddr_in6 *sin6, - *rsin6; - - sin6 = &sctp_ifa->address.sin6; - rsin6 = (struct sockaddr_in6 *)to; - if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - if (local_scope == 0) - continue; - if (sin6->sin6_scope_id == 0) { - if (sa6_recoverscope(sin6) != 0) - continue; - } - } - if ((site_scope == 0) && - (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { - continue; - } - if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { - SCTP_IPI_ADDR_RUNLOCK(); - return (1); - } - } - break; -#endif - default: - /* TSNH */ - break; - } - } - } - } else { - struct sctp_laddr *laddr; - - LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) { - if (sctp_is_addr_restricted(stcb, laddr->ifa) && - (!sctp_is_addr_pending(stcb, laddr->ifa))) { - /* - * We allow pending addresses, where we have - * sent an asconf-add to be considered - * valid. - */ - continue; - } - if (laddr->ifa->address.sa.sa_family != to->sa_family) { - continue; - } - switch (to->sa_family) { -#ifdef INET - case AF_INET: - { - struct sockaddr_in *sin, *rsin; - - sin = (struct sockaddr_in *)&laddr->ifa->address.sin; - rsin = (struct sockaddr_in *)to; - if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { - SCTP_IPI_ADDR_RUNLOCK(); - return (1); - } - break; - } -#endif -#ifdef INET6 - case AF_INET6: - { - struct sockaddr_in6 *sin6, *rsin6; - - sin6 = (struct sockaddr_in6 *)&laddr->ifa->address.sin6; - rsin6 = (struct sockaddr_in6 *)to; - if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { - SCTP_IPI_ADDR_RUNLOCK(); - return (1); - } - break; - } - -#endif - default: - /* TSNH */ - break; - } - - } - } - SCTP_IPI_ADDR_RUNLOCK(); - return (0); -} - - /* * rules for use * @@ -1906,20 +1919,20 @@ sctp_findassociation_addr_sa(struct sock uint32_t vrf_id) { struct sctp_inpcb *inp = NULL; - struct sctp_tcb *retval; + struct sctp_tcb *stcb; SCTP_INP_INFO_RLOCK(); if (find_tcp_pool) { if (inp_p != NULL) { - retval = sctp_tcb_special_locate(inp_p, from, to, netp, + stcb = sctp_tcb_special_locate(inp_p, from, to, netp, vrf_id); } else { - retval = sctp_tcb_special_locate(&inp, from, to, netp, + stcb = sctp_tcb_special_locate(&inp, from, to, netp, vrf_id); } - if (retval != NULL) { + if (stcb != NULL) { SCTP_INP_INFO_RUNLOCK(); - return (retval); + return (stcb); } } inp = sctp_pcb_findep(to, 0, 1, vrf_id); @@ -1927,7 +1940,6 @@ sctp_findassociation_addr_sa(struct sock *inp_p = inp; } SCTP_INP_INFO_RUNLOCK(); - if (inp == NULL) { return (NULL); } @@ -1938,13 +1950,13 @@ sctp_findassociation_addr_sa(struct sock * inbound packet side. */ if (inp_p != NULL) { - retval = sctp_findassociation_ep_addr(inp_p, from, netp, to, + stcb = sctp_findassociation_ep_addr(inp_p, from, netp, to, NULL); } else { - retval = sctp_findassociation_ep_addr(&inp, from, netp, to, + stcb = sctp_findassociation_ep_addr(&inp, from, netp, to, NULL); } - return retval; + return (stcb); } @@ -1959,7 +1971,7 @@ sctp_findassociation_special_addr(struct struct sockaddr *dst) { struct sctp_paramhdr *phdr, parm_buf; - struct sctp_tcb *retval; + struct sctp_tcb *stcb; uint32_t ptype, plen; #ifdef INET @@ -1984,7 +1996,7 @@ sctp_findassociation_special_addr(struct sin6.sin6_port = sh->src_port; #endif - retval = NULL; + stcb = NULL; offset += sizeof(struct sctp_init_chunk); phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); @@ -2009,10 +2021,10 @@ sctp_findassociation_special_addr(struct p4 = (struct sctp_ipv4addr_param *)phdr; memcpy(&sin4.sin_addr, &p4->addr, sizeof(p4->addr)); /* look it up */ - retval = sctp_findassociation_ep_addr(inp_p, + stcb = sctp_findassociation_ep_addr(inp_p, (struct sockaddr *)&sin4, netp, dst, NULL); - if (retval != NULL) { - return (retval); + if (stcb != NULL) { + return (stcb); } } #endif @@ -2030,10 +2042,10 @@ sctp_findassociation_special_addr(struct p6 = (struct sctp_ipv6addr_param *)phdr; memcpy(&sin6.sin6_addr, &p6->addr, sizeof(p6->addr)); /* look it up */ - retval = sctp_findassociation_ep_addr(inp_p, + stcb = sctp_findassociation_ep_addr(inp_p, (struct sockaddr *)&sin6, netp, dst, NULL); - if (retval != NULL) { - return (retval); + if (stcb != NULL) { + return (stcb); } } #endif @@ -2158,15 +2170,15 @@ sctp_findassociation_addr(struct mbuf *m struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) { int find_tcp_pool; - struct sctp_tcb *retval; + struct sctp_tcb *stcb; struct sctp_inpcb *inp; if (sh->v_tag) { /* we only go down this path if vtag is non-zero */ - retval = sctp_findassoc_by_vtag(src, dst, ntohl(sh->v_tag), + stcb = sctp_findassoc_by_vtag(src, dst, ntohl(sh->v_tag), inp_p, netp, sh->src_port, sh->dest_port, 0, vrf_id, 0); - if (retval) { - return (retval); + if (stcb) { + return (stcb); } } find_tcp_pool = 0; @@ -2178,15 +2190,15 @@ sctp_findassociation_addr(struct mbuf *m find_tcp_pool = 1; } if (inp_p) { - retval = sctp_findassociation_addr_sa(src, dst, inp_p, netp, + stcb = sctp_findassociation_addr_sa(src, dst, inp_p, netp, find_tcp_pool, vrf_id); inp = *inp_p; } else { - retval = sctp_findassociation_addr_sa(src, dst, &inp, netp, + stcb = sctp_findassociation_addr_sa(src, dst, &inp, netp, find_tcp_pool, vrf_id); } - SCTPDBG(SCTP_DEBUG_PCB1, "retval:%p inp:%p\n", (void *)retval, (void *)inp); - if (retval == NULL && inp) { + SCTPDBG(SCTP_DEBUG_PCB1, "stcb:%p inp:%p\n", (void *)stcb, (void *)inp); + if (stcb == NULL && inp) { /* Found a EP but not this address */ if ((ch->chunk_type == SCTP_INITIATION) || (ch->chunk_type == SCTP_INITIATION_ACK)) { @@ -2204,15 +2216,15 @@ sctp_findassociation_addr(struct mbuf *m } return (NULL); } - retval = sctp_findassociation_special_addr(m, + stcb = sctp_findassociation_special_addr(m, offset, sh, &inp, netp, dst); if (inp_p != NULL) { *inp_p = inp; } } } - SCTPDBG(SCTP_DEBUG_PCB1, "retval is %p\n", (void *)retval); - return (retval); + SCTPDBG(SCTP_DEBUG_PCB1, "stcb is %p\n", (void *)stcb); + return (stcb); } /* From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:29:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83730AD6; Fri, 8 Mar 2013 01:29:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D69EF52; Fri, 8 Mar 2013 01:29:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281T6Qo092422; Fri, 8 Mar 2013 01:29:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281T5MG092416; Fri, 8 Mar 2013 01:29:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080129.r281T5MG092416@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:29:05 +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: r248022 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:29:06 -0000 Author: tuexen Date: Fri Mar 8 01:29:05 2013 New Revision: 248022 URL: http://svnweb.freebsd.org/changeset/base/248022 Log: MFC r246674: Don't send kernel provided information in the User Initiated ABORT cause, since the user can also provide this kind of information. So the receiver doesn't know who provided the information. While there: Fix a bug where the stack would send a malformed ABORT chunk when using a send() call with SCTP_ABORT|SCT_SENDALL flags. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Mar 8 01:27:18 2013 (r248021) +++ stable/8/sys/netinet/sctp_indata.c Fri Mar 8 01:29:05 2013 (r248022) @@ -4221,19 +4221,15 @@ again: abort_out_now: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - sizeof(uint32_t); + SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr); ph = mtod(oper, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_24); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); @@ -4953,19 +4949,15 @@ sctp_handle_sack(struct mbuf *m, int off abort_out_now: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - sizeof(uint32_t); + SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr); ph = mtod(oper, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_31); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_31; sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:27:18 2013 (r248021) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:29:05 2013 (r248022) @@ -6447,7 +6447,7 @@ sctp_sendall_iterator(struct sctp_inpcb if (m) { ph = mtod(m, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(ca->sndlen); + ph->param_length = htons(sizeof(struct sctp_paramhdr) + ca->sndlen); } /* * We add one here to keep the assoc from @@ -12503,7 +12503,7 @@ sctp_lower_sosend(struct socket *so, /* now move forward the data pointer */ ph = mtod(mm, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons((sizeof(struct sctp_paramhdr) + tot_out)); + ph->param_length = htons(sizeof(struct sctp_paramhdr) + tot_out); ph++; SCTP_BUF_LEN(mm) = tot_out + sizeof(struct sctp_paramhdr); if (top == NULL) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:27:18 2013 (r248021) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:29:05 2013 (r248022) @@ -3308,22 +3308,16 @@ sctp_inpcb_free(struct sctp_inpcb *inp, /* Left with Data unread */ struct mbuf *op_err; - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(op_err) = - sizeof(struct sctp_paramhdr) + sizeof(uint32_t); - ph = mtod(op_err, - struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); + ph = mtod(op_err, struct sctp_paramhdr *); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_PCB + SCTP_LOC_3); } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_3; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); @@ -3395,7 +3389,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, struct mbuf *op_err; abort_anyway: - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* @@ -3403,18 +3397,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, * initiated abort */ struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(op_err) = - (sizeof(struct sctp_paramhdr) + - sizeof(uint32_t)); - ph = mtod(op_err, - struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); + ph = mtod(op_err, struct sctp_paramhdr *); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_PCB + SCTP_LOC_5); } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_5; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); @@ -3478,23 +3465,17 @@ sctp_inpcb_free(struct sctp_inpcb *inp, if ((SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_COOKIE_WAIT) && ((asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0)) { struct mbuf *op_err; - uint32_t *ippp; - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; - SCTP_BUF_LEN(op_err) = (sizeof(struct sctp_paramhdr) + - sizeof(uint32_t)); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); ph = mtod(op_err, struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_PCB + SCTP_LOC_7); - } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_7; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:27:18 2013 (r248021) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:29:05 2013 (r248022) @@ -854,7 +854,7 @@ sctp_disconnect(struct socket *so) struct mbuf *op_err; abort_anyway: - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* @@ -862,17 +862,11 @@ sctp_disconnect(struct socket *so) * initiated abort */ struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(op_err) = - (sizeof(struct sctp_paramhdr) + sizeof(uint32_t)); - ph = mtod(op_err, - struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); + ph = mtod(op_err, struct sctp_paramhdr *); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_USRREQ + SCTP_LOC_4); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_4; sctp_send_abort_tcb(stcb, op_err, SCTP_SO_LOCKED); @@ -1069,22 +1063,16 @@ sctp_shutdown(struct socket *so) struct mbuf *op_err; abort_anyway: - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(op_err) = - sizeof(struct sctp_paramhdr) + sizeof(uint32_t); - ph = mtod(op_err, - struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); + ph = mtod(op_err, struct sctp_paramhdr *); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6; sctp_abort_an_association(stcb->sctp_ep, stcb, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:31:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C3984CB4; Fri, 8 Mar 2013 01:31:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A64F6F70; Fri, 8 Mar 2013 01:31:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281VFXT094372; Fri, 8 Mar 2013 01:31:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281VEqZ094367; Fri, 8 Mar 2013 01:31:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080131.r281VEqZ094367@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:31:14 +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: r248023 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:31:15 -0000 Author: tuexen Date: Fri Mar 8 01:31:14 2013 New Revision: 248023 URL: http://svnweb.freebsd.org/changeset/base/248023 Log: MFC r246687: Send the adaptation layer indication only if set by the user. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:29:05 2013 (r248022) +++ stable/8/sys/netinet/sctp_output.c Fri Mar 8 01:31:14 2013 (r248023) @@ -4648,19 +4648,19 @@ sctp_send_initiate(struct sctp_inpcb *in chunk_len += parameter_len; } /* Adaptation layer indication parameter */ - /* XXX: Should we include this always? */ - if (padding_len > 0) { - memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); - chunk_len += padding_len; - padding_len = 0; + if (inp->sctp_ep.adaptation_layer_indicator_provided) { + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_adaptation_layer_indication); + ali = (struct sctp_adaptation_layer_indication *)(mtod(m, caddr_t)+chunk_len); + ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); + ali->ph.param_length = htons(parameter_len); + ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); + chunk_len += parameter_len; } - parameter_len = (uint16_t) sizeof(struct sctp_adaptation_layer_indication); - ali = (struct sctp_adaptation_layer_indication *)(mtod(m, caddr_t)+chunk_len); - ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); - ali->ph.param_length = htons(parameter_len); - ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); - chunk_len += parameter_len; - if (SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly)) { /* Add NAT friendly parameter. */ if (padding_len > 0) { @@ -5728,12 +5728,16 @@ do_a_abort: htons(inp->sctp_ep.max_open_streams_intome); /* adaptation layer indication parameter */ - ali = (struct sctp_adaptation_layer_indication *)((caddr_t)initack + sizeof(*initack)); - ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); - ali->ph.param_length = htons(sizeof(*ali)); - ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); - SCTP_BUF_LEN(m) += sizeof(*ali); - ecn = (struct sctp_ecn_supported_param *)((caddr_t)ali + sizeof(*ali)); + if (inp->sctp_ep.adaptation_layer_indicator_provided) { + ali = (struct sctp_adaptation_layer_indication *)((caddr_t)initack + sizeof(*initack)); + ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); + ali->ph.param_length = htons(sizeof(*ali)); + ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); + SCTP_BUF_LEN(m) += sizeof(*ali); + ecn = (struct sctp_ecn_supported_param *)((caddr_t)ali + sizeof(*ali)); + } else { + ecn = (struct sctp_ecn_supported_param *)((caddr_t)initack + sizeof(*initack)); + } /* ECN parameter */ if (((asoc != NULL) && (asoc->ecn_allowed == 1)) || Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:29:05 2013 (r248022) +++ stable/8/sys/netinet/sctp_pcb.c Fri Mar 8 01:31:14 2013 (r248023) @@ -2516,7 +2516,8 @@ sctp_inpcb_alloc(struct socket *so, uint m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); /* Add adaptation cookie */ - m->adaptation_layer_indicator = 0x504C5253; + m->adaptation_layer_indicator = 0; + m->adaptation_layer_indicator_provided = 0; /* seed random number generator */ m->random_counter = 1; Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Mar 8 01:29:05 2013 (r248022) +++ stable/8/sys/netinet/sctp_pcb.h Fri Mar 8 01:31:14 2013 (r248023) @@ -323,6 +323,7 @@ struct sctp_pcb { int auto_close_time; uint32_t initial_sequence_debug; uint32_t adaptation_layer_indicator; + uint8_t adaptation_layer_indicator_provided; uint32_t store_at; uint32_t max_burst; uint32_t fr_max_burst; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:29:05 2013 (r248022) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Mar 8 01:31:14 2013 (r248023) @@ -4585,6 +4585,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(adap_bits, optval, struct sctp_setadaptation, optsize); SCTP_INP_WLOCK(inp); inp->sctp_ep.adaptation_layer_indicator = adap_bits->ssb_adaptation_ind; + inp->sctp_ep.adaptation_layer_indicator_provided = 1; SCTP_INP_WUNLOCK(inp); break; } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:33:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8FEEFE3C; Fri, 8 Mar 2013 01:33:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 824C6F83; Fri, 8 Mar 2013 01:33:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281X7MV094701; Fri, 8 Mar 2013 01:33:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281X7TD094700; Fri, 8 Mar 2013 01:33:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201303080133.r281X7TD094700@svn.freebsd.org> From: Michael Tuexen Date: Fri, 8 Mar 2013 01:33:07 +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: r248024 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:33:07 -0000 Author: tuexen Date: Fri Mar 8 01:33:07 2013 New Revision: 248024 URL: http://svnweb.freebsd.org/changeset/base/248024 Log: MFC r247412: Fix a potential race in returning setting errno when an association goes down. Reported by Mozilla in https://bugzilla.mozilla.org/show_bug.cgi?id=845513 Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Mar 8 01:31:14 2013 (r248023) +++ stable/8/sys/netinet/sctputil.c Fri Mar 8 01:33:07 2013 (r248024) @@ -2678,6 +2678,7 @@ set_error: if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { + SOCK_LOCK(stcb->sctp_socket); if (from_peer) { if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNREFUSED); @@ -2709,7 +2710,7 @@ set_error: if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { - socantrcvmore(stcb->sctp_socket); + socantrcvmore_locked(stcb->sctp_socket); } sorwakeup(stcb->sctp_socket); sowwakeup(stcb->sctp_socket); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 01:45:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5421104 for ; Fri, 8 Mar 2013 01:45:52 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by mx1.freebsd.org (Postfix) with ESMTP id 53503FDE for ; Fri, 8 Mar 2013 01:45:51 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id 8so1889692wgl.6 for ; Thu, 07 Mar 2013 17:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=HhY+Vg9FV2a9+kG0TIfXjg2JifwJz4uNyArS21BjVrw=; b=kxB7C9hfC/ij3iPRopSVirbc46K0I6FWX4htUCK9G5TE+wD4tUH+/8po0800b7xbAE T9xbgpmaNkUvyl8nCsLe7HaEAINaxAp5IINALbg0Ebe6yo67t3QQJptByO9Lya6cbjKu utTVcTtALfINMcEf9J0f/9rmxT6Xninv9ymjM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:x-gm-message-state; bh=HhY+Vg9FV2a9+kG0TIfXjg2JifwJz4uNyArS21BjVrw=; b=k8QZBzrX7XIf/qxQt4fkb2QDsFEoD6JT3oJD8KBIIEJ4TRQOsyyJ/uSEBAFe8Vn/Z8 sANd1xB3Vd7L0PuEtS/uec4VPIqINc2rTrKTe1lLT4mmKTRyh4W2f1YEnctvyQ64hp4Z N8RrtSEHzTEkPESsP4eO92AnvF5TLu3f2sOXAogzIXTzfHJzgGPZarjnfyFEhdPiD4U6 HXzHlPb2RUx/Zh77Ef25iuXsHm1Ob/GrkTeeTL9gBAlKQMtmKTkUTzkjEvjxHiN2q/RO RZ3fOt0ZLr4tiTnSEO8TrNJoTlLh0tySJnXisecg+UBoLGSogQiOFdxQIMMtiNU03IMl taUg== X-Received: by 10.194.89.169 with SMTP id bp9mr552853wjb.57.1362707150899; Thu, 07 Mar 2013 17:45:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.179.194 with HTTP; Thu, 7 Mar 2013 17:45:20 -0800 (PST) In-Reply-To: <51391C1E.5030905@FreeBSD.org> References: <201303072216.r27MGZ1b031061@svn.freebsd.org> <513914C4.4010001@FreeBSD.org> <51391C1E.5030905@FreeBSD.org> From: Eitan Adler Date: Thu, 7 Mar 2013 20:45:20 -0500 Message-ID: Subject: Re: svn commit: r247960 - head/cddl/contrib/opensolaris/tools/ctf/cvt To: Dimitry Andric Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkzReWCh9M+1Dz7U3bKaQDjCktzdyAXbC86IUoqaP9mteDVsK3GsO8T9C/d+E/6PSYx0lC0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:45:52 -0000 On 7 March 2013 18:00, Dimitry Andric wrote: > On 2013-03-07 23:29, Andriy Gapon wrote: > ... > >> I was not really kidding when I said that this change, as is, is a nop: > > ... > >>> + bname = strrchr(match.iim_name, '/'); >>> + bname = bname == NULL ? match.iim_name : bname + >>> 1; >> >> >> It would probably make sense to make use of bname after going to through >> all the >> trouble of calculating it: >> >>> match.iim_file = match.iim_name; >> >> >> Should be match.iim_file = bname ? > > > Yes, I actually had this in my test code, and committed the wrong diff > by accident. :( Fixed in r247962, in any case. > > > >> Surprised that clang hasn't warned you about this one :-) > > > Clang currently does not have the -Wunused-but-set-variable warning; it > is apparently available in the static analyzer. On the other hand, that > warning is one of the most annoying ones that newer gcc's have. :-) I have found real bugs in FreeBSD's code base as a result of this warning, but the vast majority were more annoying than useful. -- Eitan Adler From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 02:00:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id ABD526BE; Fri, 8 Mar 2013 02:00:50 +0000 (UTC) Date: Fri, 8 Mar 2013 02:00:50 +0000 From: Alexey Dokuchaev To: Gleb Smirnoff Subject: Re: svn commit: r247910 - head/sys/dev/sound/pci/hda Message-ID: <20130308020050.GC83162@FreeBSD.org> References: <201303070754.r277soET065603@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201303070754.r277soET065603@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 02:00:50 -0000 On Thu, Mar 07, 2013 at 07:54:50AM +0000, Gleb Smirnoff wrote: > New Revision: 247910 > URL: http://svnweb.freebsd.org/changeset/base/247910 > > Log: > Plug a memory leak. > > Reviewed by: mav > Sponsored by: Nginx, Inc. Any MFCs planned? ./danfe From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 02:38:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 164E1EA3; Fri, 8 Mar 2013 02:38:20 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 07FC71F9; Fri, 8 Mar 2013 02:38:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r282cJFn013754; Fri, 8 Mar 2013 02:38:19 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r282cJ35013753; Fri, 8 Mar 2013 02:38:19 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201303080238.r282cJ35013753@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 8 Mar 2013 02:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248026 - stable/9/sys/dev/virtio/block 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 02:38:20 -0000 Author: bryanv Date: Fri Mar 8 02:38:19 2013 New Revision: 248026 URL: http://svnweb.freebsd.org/changeset/base/248026 Log: MFC r247829 Only set the barrier flag if the feature was negotiated Approved by: grehan (mentor) Modified: stable/9/sys/dev/virtio/block/virtio_blk.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/9/sys/dev/virtio/block/virtio_blk.c Fri Mar 8 01:51:32 2013 (r248025) +++ stable/9/sys/dev/virtio/block/virtio_blk.c Fri Mar 8 02:38:19 2013 (r248026) @@ -72,6 +72,7 @@ struct vtblk_softc { #define VTBLK_FLAG_DETACH 0x0004 #define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_DUMPING 0x0010 +#define VTBLK_FLAG_BARRIER 0x0020 struct virtqueue *vtblk_vq; struct sglist *vtblk_sglist; @@ -81,7 +82,8 @@ struct vtblk_softc { TAILQ_HEAD(, vtblk_request) vtblk_req_free; TAILQ_HEAD(, vtblk_request) - vtblk_req_ready; + vtblk_req_ready; + struct vtblk_request *vtblk_req_ordered; struct taskqueue *vtblk_tq; struct task vtblk_intr_task; @@ -278,9 +280,10 @@ vtblk_attach(device_t dev) if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) sc->vtblk_flags |= VTBLK_FLAG_INDIRECT; - if (virtio_with_feature(dev, VIRTIO_BLK_F_RO)) sc->vtblk_flags |= VTBLK_FLAG_READONLY; + if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER)) + sc->vtblk_flags |= VTBLK_FLAG_BARRIER; /* Get local copy of config. */ virtio_read_device_config(dev, 0, &blkcfg, @@ -766,25 +769,45 @@ vtblk_bio_request(struct vtblk_softc *sc bp->bio_cmd); } - if (bp->bio_flags & BIO_ORDERED) - req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; - return (req); } static int vtblk_execute_request(struct vtblk_softc *sc, struct vtblk_request *req) { + struct virtqueue *vq; struct sglist *sg; struct bio *bp; - int readable, writable, error; + int ordered, readable, writable, error; + vq = sc->vtblk_vq; sg = sc->vtblk_sglist; bp = req->vbr_bp; + ordered = 0; writable = 0; VTBLK_LOCK_ASSERT(sc); + /* + * Wait until the ordered request completes before + * executing subsequent requests. + */ + if (sc->vtblk_req_ordered != NULL) + return (EBUSY); + + if (bp->bio_flags & BIO_ORDERED) { + if ((sc->vtblk_flags & VTBLK_FLAG_BARRIER) == 0) { + /* + * This request will be executed once all + * the in-flight requests are completed. + */ + if (!virtqueue_empty(vq)) + return (EBUSY); + ordered = 1; + } else + req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; + } + sglist_reset(sg); sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr)); @@ -802,10 +825,13 @@ vtblk_execute_request(struct vtblk_softc writable++; sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); - readable = sg->sg_nseg - writable; - return (virtqueue_enqueue(sc->vtblk_vq, req, sg, readable, writable)); + error = virtqueue_enqueue(vq, req, sg, readable, writable); + if (error == 0 && ordered) + sc->vtblk_req_ordered = req; + + return (error); } static int @@ -1013,6 +1039,12 @@ vtblk_finish_completed(struct vtblk_soft while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { bp = req->vbr_bp; + if (sc->vtblk_req_ordered != NULL) { + /* This should be the only outstanding request. */ + MPASS(sc->vtblk_req_ordered == req); + sc->vtblk_req_ordered = NULL; + } + error = vtblk_request_error(req); if (error) disk_err(bp, "hard error", -1, 1); @@ -1039,6 +1071,7 @@ vtblk_drain_vq(struct vtblk_softc *sc, i vtblk_enqueue_request(sc, req); } + sc->vtblk_req_ordered = NULL; KASSERT(virtqueue_empty(vq), ("virtqueue not empty")); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 02:40:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3C1190; Fri, 8 Mar 2013 02:40:07 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5BD6206; Fri, 8 Mar 2013 02:40:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r282e7KM014067; Fri, 8 Mar 2013 02:40:07 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r282e7Dw014066; Fri, 8 Mar 2013 02:40:07 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201303080240.r282e7Dw014066@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 8 Mar 2013 02:40:07 +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: r248027 - stable/8/sys/dev/virtio/block 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 02:40:08 -0000 Author: bryanv Date: Fri Mar 8 02:40:07 2013 New Revision: 248027 URL: http://svnweb.freebsd.org/changeset/base/248027 Log: MFC r247829 Only set the barrier flag if the feature was negotiated Approved by: grehan (mentor) Modified: stable/8/sys/dev/virtio/block/virtio_blk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/virtio/ (props changed) Modified: stable/8/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/8/sys/dev/virtio/block/virtio_blk.c Fri Mar 8 02:38:19 2013 (r248026) +++ stable/8/sys/dev/virtio/block/virtio_blk.c Fri Mar 8 02:40:07 2013 (r248027) @@ -72,6 +72,7 @@ struct vtblk_softc { #define VTBLK_FLAG_DETACH 0x0004 #define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_DUMPING 0x0010 +#define VTBLK_FLAG_BARRIER 0x0020 struct virtqueue *vtblk_vq; struct sglist *vtblk_sglist; @@ -81,7 +82,8 @@ struct vtblk_softc { TAILQ_HEAD(, vtblk_request) vtblk_req_free; TAILQ_HEAD(, vtblk_request) - vtblk_req_ready; + vtblk_req_ready; + struct vtblk_request *vtblk_req_ordered; struct taskqueue *vtblk_tq; struct task vtblk_intr_task; @@ -278,9 +280,10 @@ vtblk_attach(device_t dev) if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) sc->vtblk_flags |= VTBLK_FLAG_INDIRECT; - if (virtio_with_feature(dev, VIRTIO_BLK_F_RO)) sc->vtblk_flags |= VTBLK_FLAG_READONLY; + if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER)) + sc->vtblk_flags |= VTBLK_FLAG_BARRIER; /* Get local copy of config. */ virtio_read_device_config(dev, 0, &blkcfg, @@ -766,25 +769,45 @@ vtblk_bio_request(struct vtblk_softc *sc bp->bio_cmd); } - if (bp->bio_flags & BIO_ORDERED) - req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; - return (req); } static int vtblk_execute_request(struct vtblk_softc *sc, struct vtblk_request *req) { + struct virtqueue *vq; struct sglist *sg; struct bio *bp; - int readable, writable, error; + int ordered, readable, writable, error; + vq = sc->vtblk_vq; sg = sc->vtblk_sglist; bp = req->vbr_bp; + ordered = 0; writable = 0; VTBLK_LOCK_ASSERT(sc); + /* + * Wait until the ordered request completes before + * executing subsequent requests. + */ + if (sc->vtblk_req_ordered != NULL) + return (EBUSY); + + if (bp->bio_flags & BIO_ORDERED) { + if ((sc->vtblk_flags & VTBLK_FLAG_BARRIER) == 0) { + /* + * This request will be executed once all + * the in-flight requests are completed. + */ + if (!virtqueue_empty(vq)) + return (EBUSY); + ordered = 1; + } else + req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; + } + sglist_reset(sg); sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr)); @@ -802,10 +825,13 @@ vtblk_execute_request(struct vtblk_softc writable++; sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); - readable = sg->sg_nseg - writable; - return (virtqueue_enqueue(sc->vtblk_vq, req, sg, readable, writable)); + error = virtqueue_enqueue(vq, req, sg, readable, writable); + if (error == 0 && ordered) + sc->vtblk_req_ordered = req; + + return (error); } static int @@ -1013,6 +1039,12 @@ vtblk_finish_completed(struct vtblk_soft while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { bp = req->vbr_bp; + if (sc->vtblk_req_ordered != NULL) { + /* This should be the only outstanding request. */ + MPASS(sc->vtblk_req_ordered == req); + sc->vtblk_req_ordered = NULL; + } + error = vtblk_request_error(req); if (error) disk_err(bp, "hard error", -1, 1); @@ -1039,6 +1071,7 @@ vtblk_drain_vq(struct vtblk_softc *sc, i vtblk_enqueue_request(sc, req); } + sc->vtblk_req_ordered = NULL; KASSERT(virtqueue_empty(vq), ("virtqueue not empty")); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 03:29:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9BDB093F; Fri, 8 Mar 2013 03:29:06 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7032A3E8; Fri, 8 Mar 2013 03:29:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r283T6gT030669; Fri, 8 Mar 2013 03:29:06 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r283T6i4030668; Fri, 8 Mar 2013 03:29:06 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201303080329.r283T6i4030668@svn.freebsd.org> From: Tim Kientzle Date: Fri, 8 Mar 2013 03:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248028 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 03:29:06 -0000 Author: kientzle Date: Fri Mar 8 03:29:05 2013 New Revision: 248028 URL: http://svnweb.freebsd.org/changeset/base/248028 Log: This file is specific to arm11x6 processors, so tell the assembler it's okay to use arm11x6 instructions. Modified: head/sys/arm/arm/cpufunc_asm_arm11x6.S Modified: head/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm11x6.S Fri Mar 8 02:40:07 2013 (r248027) +++ head/sys/arm/arm/cpufunc_asm_arm11x6.S Fri Mar 8 03:29:05 2013 (r248028) @@ -62,6 +62,8 @@ #include __FBSDID("$FreeBSD$"); + .cpu arm1136js + #if 0 #define Invalidate_I_cache(Rtmp1, Rtmp2) \ mcr p15, 0, Rtmp1, c7, c5, 0 /* Invalidate Entire I cache */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 08:09:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D09F6426; Fri, 8 Mar 2013 08:09:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3511F9D; Fri, 8 Mar 2013 08:09:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2889Qlw014013; Fri, 8 Mar 2013 08:09:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2889QLB014012; Fri, 8 Mar 2013 08:09:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303080809.r2889QLB014012@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Mar 2013 08:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248029 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 08:09:26 -0000 Author: kib Date: Fri Mar 8 08:09:26 2013 New Revision: 248029 URL: http://svnweb.freebsd.org/changeset/base/248029 Log: MFC r247560: Make the default implementation of the VOP_VPTOCNP() fail if the directory entry, matched by the inode number, is ".". Modified: stable/9/sys/kern/vfs_default.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_default.c ============================================================================== --- stable/9/sys/kern/vfs_default.c Fri Mar 8 03:29:05 2013 (r248028) +++ stable/9/sys/kern/vfs_default.c Fri Mar 8 08:09:26 2013 (r248029) @@ -856,8 +856,12 @@ vop_stdvptocnp(struct vop_vptocnp_args * error = ENOMEM; goto out; } - bcopy(dp->d_name, buf + i, dp->d_namlen); - error = 0; + if (dp->d_namlen == 1 && dp->d_name[0] == '.') { + error = ENOENT; + } else { + bcopy(dp->d_name, buf + i, dp->d_namlen); + error = 0; + } goto out; } } while (len > 0 || !eofflag); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 08:19:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B68BD6E4; Fri, 8 Mar 2013 08:19:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E288FE7; Fri, 8 Mar 2013 08:19:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r288JohJ017254; Fri, 8 Mar 2013 08:19:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r288Jo17017253; Fri, 8 Mar 2013 08:19:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303080819.r288Jo17017253@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Mar 2013 08:19:50 +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: r248030 - stable/8/sys/kern 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 08:19:50 -0000 Author: kib Date: Fri Mar 8 08:19:50 2013 New Revision: 248030 URL: http://svnweb.freebsd.org/changeset/base/248030 Log: MFC r247560: Make the default implementation of the VOP_VPTOCNP() fail if the directory entry, matched by the inode number, is ".". Modified: stable/8/sys/kern/vfs_default.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/vfs_default.c ============================================================================== --- stable/8/sys/kern/vfs_default.c Fri Mar 8 08:09:26 2013 (r248029) +++ stable/8/sys/kern/vfs_default.c Fri Mar 8 08:19:50 2013 (r248030) @@ -822,8 +822,12 @@ vop_stdvptocnp(struct vop_vptocnp_args * error = ENOMEM; goto out; } - bcopy(dp->d_name, buf + i, dp->d_namlen); - error = 0; + if (dp->d_namlen == 1 && dp->d_name[0] == '.') { + error = ENOENT; + } else { + bcopy(dp->d_name, buf + i, dp->d_namlen); + error = 0; + } goto out; } } while (len > 0 || !eofflag); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 10:14:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8F2EABD; Fri, 8 Mar 2013 10:14:59 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CEFE7DC; Fri, 8 Mar 2013 10:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28AExcs053199; Fri, 8 Mar 2013 10:14:59 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28AEwet053196; Fri, 8 Mar 2013 10:14:58 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201303081014.r28AEwet053196@svn.freebsd.org> From: Andre Oppermann Date: Fri, 8 Mar 2013 10:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248031 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 10:14:59 -0000 Author: andre Date: Fri Mar 8 10:14:58 2013 New Revision: 248031 URL: http://svnweb.freebsd.org/changeset/base/248031 Log: Move the auto-sizing of the callout array from init_param2() to kern_timeout_callwheel_alloc() where it is actually used. This is a mechanical move and no tuning parameters are changed. The pre-allocated callout array is only used for legacy timeout(9) calls and is only allocated and active on cpu0. Eventually all remaining users of timeout(9) should switch to the callout_* API. Reviewed by: davide Modified: head/sys/kern/kern_timeout.c head/sys/kern/subr_param.c head/sys/sys/callout.h Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Fri Mar 8 08:19:50 2013 (r248030) +++ head/sys/kern/kern_timeout.c Fri Mar 8 10:14:58 2013 (r248031) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -101,6 +102,11 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca 0, "Average number of MP direct callouts made per callout_process call. " "Units = 1/1000"); #endif + +static int ncallout; +SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, + "Number of entries in callwheel and size of timeout() preallocation"); + /* * TODO: * allocate more timeout table slots when table overflows. @@ -252,6 +258,14 @@ kern_timeout_callwheel_alloc(caddr_t v) timeout_cpu = PCPU_GET(cpuid); cc = CC_CPU(timeout_cpu); + + /* + * Calculate the size of the callout wheel and the preallocated + * timeout() structures. + */ + ncallout = imin(16 + maxproc + maxfiles, 18508); + TUNABLE_INT_FETCH("kern.ncallout", &ncallout); + /* * Calculate callout wheel size, should be next power of two higher * than 'ncallout'. Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Fri Mar 8 08:19:50 2013 (r248030) +++ head/sys/kern/subr_param.c Fri Mar 8 10:14:58 2013 (r248031) @@ -91,7 +91,6 @@ int maxprocperuid; /* max # of procs p int maxfiles; /* sys. wide open files limit */ int maxfilesperproc; /* per-proc open files limit */ int msgbufsize; /* size of kernel message buffer */ -int ncallout; /* maximum # of timer events */ int nbuf; int ngroups_max; /* max # groups per process */ int nswbuf; @@ -109,8 +108,6 @@ u_long sgrowsiz; /* amount to grow sta SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, "Number of clock ticks per second"); -SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, - "Number of pre-allocated timer events"); SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0, "Number of buffers in the buffer cache"); SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0, @@ -327,15 +324,6 @@ init_param2(long physpages) TUNABLE_INT_FETCH("kern.nbuf", &nbuf); /* - * XXX: Does the callout wheel have to be so big? - * - * Clip callout to result of previous function of maxusers maximum - * 384. This is still huge, but acceptable. - */ - ncallout = imin(16 + maxproc + maxfiles, 18508); - TUNABLE_INT_FETCH("kern.ncallout", &ncallout); - - /* * The default for maxpipekva is min(1/64 of the kernel address space, * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. */ Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Fri Mar 8 08:19:50 2013 (r248030) +++ head/sys/sys/callout.h Fri Mar 8 10:14:58 2013 (r248031) @@ -63,8 +63,6 @@ struct callout_handle { }; #ifdef _KERNEL -extern int ncallout; - #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) #define callout_drain(c) _callout_stop_safe(c, 1) From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 10:37:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3A64051E; Fri, 8 Mar 2013 10:37:18 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2018A6; Fri, 8 Mar 2013 10:37:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28AbHXd059454; Fri, 8 Mar 2013 10:37:17 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28AbHff059451; Fri, 8 Mar 2013 10:37:17 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201303081037.r28AbHff059451@svn.freebsd.org> From: Andre Oppermann Date: Fri, 8 Mar 2013 10:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248032 - in head/sys: kern 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 10:37:18 -0000 Author: andre Date: Fri Mar 8 10:37:17 2013 New Revision: 248032 URL: http://svnweb.freebsd.org/changeset/base/248032 Log: Move the callout subsystem initialization to its own SYSINIT() from being indirectly called via cpu_startup()+vm_ksubmap_init(). The boot order position remains the same at SI_SUB_CPU. Allocation of the callout array is changed to stardard kernel malloc from a slightly obscure direct kernel_map allocation. kern_timeout_callwheel_alloc() is renamed to callout_callwheel_init() to better describe its purpose. kern_timeout_callwheel_init() is removed simplifying the per-cpu initialization. Reviewed by: davide Modified: head/sys/kern/kern_timeout.c head/sys/sys/systm.h head/sys/vm/vm_init.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Fri Mar 8 10:14:58 2013 (r248031) +++ head/sys/kern/kern_timeout.c Fri Mar 8 10:37:17 2013 (r248032) @@ -187,6 +187,7 @@ struct callout_cpu cc_cpu; static int timeout_cpu; +static void callout_cpu_init(struct callout_cpu *cc); static void softclock_call_cc(struct callout *c, struct callout_cpu *cc, #ifdef CALLOUT_PROFILING int *mpcalls, int *lockcalls, int *gcalls, @@ -246,19 +247,14 @@ cc_cce_migrating(struct callout_cpu *cc, } /* - * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization - * - * This code is called very early in the kernel initialization sequence, - * and may be called more then once. + * Kernel low level callwheel initialization + * called on cpu0 during kernel startup. */ -caddr_t -kern_timeout_callwheel_alloc(caddr_t v) +static void +callout_callwheel_init(void *dummy) { struct callout_cpu *cc; - timeout_cpu = PCPU_GET(cpuid); - cc = CC_CPU(timeout_cpu); - /* * Calculate the size of the callout wheel and the preallocated * timeout() structures. @@ -273,13 +269,23 @@ kern_timeout_callwheel_alloc(caddr_t v) callwheelsize = 1 << fls(ncallout); callwheelmask = callwheelsize - 1; - cc->cc_callout = (struct callout *)v; - v = (caddr_t)(cc->cc_callout + ncallout); - cc->cc_callwheel = (struct callout_list *)v; - v = (caddr_t)(cc->cc_callwheel + callwheelsize); - return(v); + /* + * Only cpu0 handles timeout(9) and receives a preallocation. + * + * XXX: Once all timeout(9) consumers are converted this can + * be removed. + */ + timeout_cpu = PCPU_GET(cpuid); + cc = CC_CPU(timeout_cpu); + cc->cc_callout = malloc(ncallout * sizeof(struct callout), + M_CALLOUT, M_WAITOK); + callout_cpu_init(cc); } +SYSINIT(callwheel_init, SI_SUB_CPU, SI_ORDER_ANY, callout_callwheel_init, NULL); +/* + * Initialize the per-cpu callout structures. + */ static void callout_cpu_init(struct callout_cpu *cc) { @@ -288,13 +294,15 @@ callout_cpu_init(struct callout_cpu *cc) mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); SLIST_INIT(&cc->cc_callfree); + cc->cc_callwheel = malloc(sizeof(struct callout_tailq) * callwheelsize, + M_CALLOUT, M_WAITOK); for (i = 0; i < callwheelsize; i++) LIST_INIT(&cc->cc_callwheel[i]); TAILQ_INIT(&cc->cc_expireq); cc->cc_firstevent = INT64_MAX; for (i = 0; i < 2; i++) cc_cce_cleanup(cc, i); - if (cc->cc_callout == NULL) + if (cc->cc_callout == NULL) /* Only cpu0 handles timeout(9) */ return; for (i = 0; i < ncallout; i++) { c = &cc->cc_callout[i]; @@ -335,19 +343,6 @@ callout_cpu_switch(struct callout *c, st #endif /* - * kern_timeout_callwheel_init() - initialize previously reserved callwheel - * space. - * - * This code is called just once, after the space reserved for the - * callout wheel has been finalized. - */ -void -kern_timeout_callwheel_init(void) -{ - callout_cpu_init(CC_CPU(timeout_cpu)); -} - -/* * Start standard softclock thread. */ static void @@ -367,18 +362,14 @@ start_softclock(void *dummy) if (cpu == timeout_cpu) continue; cc = CC_CPU(cpu); + cc->cc_callout = NULL; /* Only cpu0 handles timeout(9). */ + callout_cpu_init(cc); if (swi_add(NULL, "clock", softclock, cc, SWI_CLOCK, INTR_MPSAFE, &cc->cc_cookie)) panic("died while creating standard software ithreads"); - cc->cc_callout = NULL; /* Only cpu0 handles timeout(). */ - cc->cc_callwheel = malloc( - sizeof(struct callout_list) * callwheelsize, M_CALLOUT, - M_WAITOK); - callout_cpu_init(cc); } #endif } - SYSINIT(start_softclock, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softclock, NULL); #define CC_HASH_SHIFT 8 Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Mar 8 10:14:58 2013 (r248031) +++ head/sys/sys/systm.h Fri Mar 8 10:37:17 2013 (r248032) @@ -321,8 +321,6 @@ typedef void timeout_t(void *); /* timeo void callout_handle_init(struct callout_handle *); struct callout_handle timeout(timeout_t *, void *, int); void untimeout(timeout_t *, void *, struct callout_handle); -caddr_t kern_timeout_callwheel_alloc(caddr_t v); -void kern_timeout_callwheel_init(void); /* Stubs for obsolete functions that used to be for interrupt management */ static __inline intrmask_t splbio(void) { return 0; } Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Fri Mar 8 10:14:58 2013 (r248031) +++ head/sys/vm/vm_init.c Fri Mar 8 10:37:17 2013 (r248032) @@ -157,8 +157,6 @@ vm_ksubmap_init(struct kva_md_info *kmi) again: v = (caddr_t)firstaddr; - v = kern_timeout_callwheel_alloc(v); - /* * Discount the physical memory larger than the size of kernel_map * to avoid eating up all of KVA space. @@ -202,10 +200,5 @@ again: * XXX: Mbuf system machine-specific initializations should * go here, if anywhere. */ - - /* - * Initialize the callouts we just allocated. - */ - kern_timeout_callwheel_init(); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 10:43:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 345AD701; Fri, 8 Mar 2013 10:43:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA548D8; Fri, 8 Mar 2013 10:43:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28Ah3Gd061801; Fri, 8 Mar 2013 10:43:03 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28Ah363061800; Fri, 8 Mar 2013 10:43:03 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303081043.r28Ah363061800@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 8 Mar 2013 10:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248033 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 10:43:04 -0000 Author: bapt Date: Fri Mar 8 10:43:03 2013 New Revision: 248033 URL: http://svnweb.freebsd.org/changeset/base/248033 Log: Fix bootstrapping pkgng by not appending "/latest/" to PACKAGESITE. Reporter by : Alexander Yerenkow (via irc) Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Fri Mar 8 10:37:17 2013 (r248032) +++ head/usr.sbin/pkg/pkg.c Fri Mar 8 10:43:03 2013 (r248033) @@ -167,7 +167,7 @@ bootstrap_pkg(void) warnx("No MIRROR_TYPE defined"); return (-1); } - snprintf(url, MAXPATHLEN, "%s/latest/Latest/pkg.txz", packagesite); + snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", packagesite); snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 11:25:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 267DACD4; Fri, 8 Mar 2013 11:25:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16CD3A0F; Fri, 8 Mar 2013 11:25:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28BPqjJ079270; Fri, 8 Mar 2013 11:25:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28BPqFf079269; Fri, 8 Mar 2013 11:25:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081125.r28BPqFf079269@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 11:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248034 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 11:25:53 -0000 Author: marius Date: Fri Mar 8 11:25:52 2013 New Revision: 248034 URL: http://svnweb.freebsd.org/changeset/base/248034 Log: MFC: r247561 - Use strdup(9) instead of reimplementing it. - Use __DECONST instead of strange casts. - Reduce code duplication and simplify name2oid(). PR: 176373 Submitted by: Christoph Mallon Modified: stable/9/sys/kern/kern_sysctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_sysctl.c ============================================================================== --- stable/9/sys/kern/kern_sysctl.c Fri Mar 8 10:43:03 2013 (r248033) +++ stable/9/sys/kern/kern_sysctl.c Fri Mar 8 11:25:52 2013 (r248034) @@ -444,9 +444,9 @@ sysctl_remove_oid_locked(struct sysctl_o SYSCTL_SLEEP(&oidp->oid_running, "oidrm", 0); } if (oidp->oid_descr) - free((void *)(uintptr_t)(const void *)oidp->oid_descr, M_SYSCTLOID); - free((void *)(uintptr_t)(const void *)oidp->oid_name, - M_SYSCTLOID); + free(__DECONST(char *, oidp->oid_descr), + M_SYSCTLOID); + free(__DECONST(char *, oidp->oid_name), M_SYSCTLOID); free(oidp, M_SYSCTLOID); } } @@ -462,8 +462,6 @@ sysctl_add_oid(struct sysctl_ctx_list *c int (*handler)(SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr) { struct sysctl_oid *oidp; - ssize_t len; - char *newname; /* You have to hook up somewhere.. */ if (parent == NULL) @@ -490,11 +488,7 @@ sysctl_add_oid(struct sysctl_ctx_list *c SLIST_NEXT(oidp, oid_link) = NULL; oidp->oid_number = number; oidp->oid_refcnt = 1; - len = strlen(name); - newname = malloc(len + 1, M_SYSCTLOID, M_WAITOK); - bcopy(name, newname, len + 1); - newname[len] = '\0'; - oidp->oid_name = newname; + oidp->oid_name = strdup(name, M_SYSCTLOID); oidp->oid_handler = handler; oidp->oid_kind = CTLFLAG_DYN | kind; if ((kind & CTLTYPE) == CTLTYPE_NODE) { @@ -508,12 +502,8 @@ sysctl_add_oid(struct sysctl_ctx_list *c oidp->oid_arg2 = arg2; } oidp->oid_fmt = fmt; - if (descr) { - int len = strlen(descr) + 1; - oidp->oid_descr = malloc(len, M_SYSCTLOID, M_WAITOK); - if (oidp->oid_descr) - strcpy((char *)(uintptr_t)(const void *)oidp->oid_descr, descr); - } + if (descr) + oidp->oid_descr = strdup(descr, M_SYSCTLOID); /* Update the context, if used */ if (clist != NULL) sysctl_ctx_entry_add(clist, oidp); @@ -529,16 +519,12 @@ sysctl_add_oid(struct sysctl_ctx_list *c void sysctl_rename_oid(struct sysctl_oid *oidp, const char *name) { - ssize_t len; char *newname; - void *oldname; + char *oldname; - len = strlen(name); - newname = malloc(len + 1, M_SYSCTLOID, M_WAITOK); - bcopy(name, newname, len + 1); - newname[len] = '\0'; + newname = strdup(name, M_SYSCTLOID); SYSCTL_XLOCK(); - oldname = (void *)(uintptr_t)(const void *)oidp->oid_name; + oldname = __DECONST(char *, oidp->oid_name); oidp->oid_name = newname; SYSCTL_XUNLOCK(); free(oldname, M_SYSCTLOID); @@ -823,39 +809,26 @@ static SYSCTL_NODE(_sysctl, 2, next, CTL static int name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) { - int i; struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; char *p; SYSCTL_ASSERT_XLOCKED(); - if (!*name) - return (ENOENT); + for (*len = 0; *len < CTL_MAXNAME;) { + p = strsep(&name, "."); - p = name + strlen(name) - 1 ; - if (*p == '.') - *p = '\0'; - - *len = 0; - - for (p = name; *p && *p != '.'; p++) - ; - i = *p; - if (i == '.') - *p = '\0'; - - oidp = SLIST_FIRST(lsp); - - while (oidp && *len < CTL_MAXNAME) { - if (strcmp(name, oidp->oid_name)) { - oidp = SLIST_NEXT(oidp, oid_link); - continue; + oidp = SLIST_FIRST(lsp); + for (;; oidp = SLIST_NEXT(oidp, oid_link)) { + if (oidp == NULL) + return (ENOENT); + if (strcmp(p, oidp->oid_name) == 0) + break; } *oid++ = oidp->oid_number; (*len)++; - if (!i) { + if (name == NULL || *name == '\0') { if (oidpp) *oidpp = oidp; return (0); @@ -868,13 +841,6 @@ name2oid(char *name, int *oid, int *len, break; lsp = SYSCTL_CHILDREN(oidp); - oidp = SLIST_FIRST(lsp); - name = p+1; - for (p = name; *p && *p != '.'; p++) - ; - i = *p; - if (i == '.') - *p = '\0'; } return (ENOENT); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 11:26:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E7DBDE2D; Fri, 8 Mar 2013 11:26:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA5F3A13; Fri, 8 Mar 2013 11:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28BQ0fV079335; Fri, 8 Mar 2013 11:26:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28BQ0WQ079334; Fri, 8 Mar 2013 11:26:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081126.r28BQ0WQ079334@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 11:26:00 +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: r248035 - stable/8/sys/kern 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 11:26:01 -0000 Author: marius Date: Fri Mar 8 11:26:00 2013 New Revision: 248035 URL: http://svnweb.freebsd.org/changeset/base/248035 Log: MFC: r247561 - Use strdup(9) instead of reimplementing it. - Use __DECONST instead of strange casts. - Reduce code duplication and simplify name2oid(). PR: 176373 Submitted by: Christoph Mallon Modified: stable/8/sys/kern/kern_sysctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_sysctl.c ============================================================================== --- stable/8/sys/kern/kern_sysctl.c Fri Mar 8 11:25:52 2013 (r248034) +++ stable/8/sys/kern/kern_sysctl.c Fri Mar 8 11:26:00 2013 (r248035) @@ -420,9 +420,9 @@ sysctl_remove_oid_locked(struct sysctl_o SYSCTL_SLEEP(&oidp->oid_running, "oidrm", 0); } if (oidp->oid_descr) - free((void *)(uintptr_t)(const void *)oidp->oid_descr, M_SYSCTLOID); - free((void *)(uintptr_t)(const void *)oidp->oid_name, - M_SYSCTLOID); + free(__DECONST(char *, oidp->oid_descr), + M_SYSCTLOID); + free(__DECONST(char *, oidp->oid_name), M_SYSCTLOID); free(oidp, M_SYSCTLOID); } } @@ -439,8 +439,6 @@ sysctl_add_oid(struct sysctl_ctx_list *c int (*handler)(SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr) { struct sysctl_oid *oidp; - ssize_t len; - char *newname; /* You have to hook up somewhere.. */ if (parent == NULL) @@ -467,11 +465,7 @@ sysctl_add_oid(struct sysctl_ctx_list *c SLIST_NEXT(oidp, oid_link) = NULL; oidp->oid_number = number; oidp->oid_refcnt = 1; - len = strlen(name); - newname = malloc(len + 1, M_SYSCTLOID, M_WAITOK); - bcopy(name, newname, len + 1); - newname[len] = '\0'; - oidp->oid_name = newname; + oidp->oid_name = strdup(name, M_SYSCTLOID); oidp->oid_handler = handler; oidp->oid_kind = CTLFLAG_DYN | kind; if ((kind & CTLTYPE) == CTLTYPE_NODE) { @@ -484,12 +478,8 @@ sysctl_add_oid(struct sysctl_ctx_list *c oidp->oid_arg2 = arg2; } oidp->oid_fmt = fmt; - if (descr) { - int len = strlen(descr) + 1; - oidp->oid_descr = malloc(len, M_SYSCTLOID, M_WAITOK); - if (oidp->oid_descr) - strcpy((char *)(uintptr_t)(const void *)oidp->oid_descr, descr); - } + if (descr) + oidp->oid_descr = strdup(descr, M_SYSCTLOID); /* Update the context, if used */ if (clist != NULL) sysctl_ctx_entry_add(clist, oidp); @@ -505,16 +495,12 @@ sysctl_add_oid(struct sysctl_ctx_list *c void sysctl_rename_oid(struct sysctl_oid *oidp, const char *name) { - ssize_t len; char *newname; - void *oldname; + char *oldname; - len = strlen(name); - newname = malloc(len + 1, M_SYSCTLOID, M_WAITOK); - bcopy(name, newname, len + 1); - newname[len] = '\0'; + newname = strdup(name, M_SYSCTLOID); SYSCTL_XLOCK(); - oldname = (void *)(uintptr_t)(const void *)oidp->oid_name; + oldname = __DECONST(char *, oidp->oid_name); oidp->oid_name = newname; SYSCTL_XUNLOCK(); free(oldname, M_SYSCTLOID); @@ -785,39 +771,26 @@ static SYSCTL_NODE(_sysctl, 2, next, CTL static int name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) { - int i; struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; char *p; SYSCTL_ASSERT_XLOCKED(); - if (!*name) - return (ENOENT); + for (*len = 0; *len < CTL_MAXNAME;) { + p = strsep(&name, "."); - p = name + strlen(name) - 1 ; - if (*p == '.') - *p = '\0'; - - *len = 0; - - for (p = name; *p && *p != '.'; p++) - ; - i = *p; - if (i == '.') - *p = '\0'; - - oidp = SLIST_FIRST(lsp); - - while (oidp && *len < CTL_MAXNAME) { - if (strcmp(name, oidp->oid_name)) { - oidp = SLIST_NEXT(oidp, oid_link); - continue; + oidp = SLIST_FIRST(lsp); + for (;; oidp = SLIST_NEXT(oidp, oid_link)) { + if (oidp == NULL) + return (ENOENT); + if (strcmp(p, oidp->oid_name) == 0) + break; } *oid++ = oidp->oid_number; (*len)++; - if (!i) { + if (name == NULL || *name == '\0') { if (oidpp) *oidpp = oidp; return (0); @@ -830,13 +803,6 @@ name2oid(char *name, int *oid, int *len, break; lsp = SYSCTL_CHILDREN(oidp); - oidp = SLIST_FIRST(lsp); - name = p+1; - for (p = name; *p && *p != '.'; p++) - ; - i = *p; - if (i == '.') - *p = '\0'; } return (ENOENT); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 11:32:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2CCFC28E; Fri, 8 Mar 2013 11:32:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E7FFA88; Fri, 8 Mar 2013 11:32:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28BWwYx084534; Fri, 8 Mar 2013 11:32:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28BWwkZ084532; Fri, 8 Mar 2013 11:32:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081132.r28BWwkZ084532@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 11:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248036 - stable/9/sys/dev/bce 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 11:32:59 -0000 Author: marius Date: Fri Mar 8 11:32:58 2013 New Revision: 248036 URL: http://svnweb.freebsd.org/changeset/base/248036 Log: MFC: r247565, r247590 - Make tables, device ID strings etc const. - Use NULL instead of 0 for pointers. - Remove redundant bzero(9)'ing of the softc. - Remove redundant/unused softc members. - Don't allocate MSI/MSI-X as RF_SHAREABLE. - Re-use bus accessor macros instead of duplicating them. - In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY address (missed in r213893). Modified: stable/9/sys/dev/bce/if_bce.c stable/9/sys/dev/bce/if_bcereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Fri Mar 8 11:26:00 2013 (r248035) +++ stable/9/sys/dev/bce/if_bce.c Fri Mar 8 11:32:58 2013 (r248036) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); /****************************************************************************/ #define BCE_DEVDESC_MAX 64 -static struct bce_type bce_devs[] = { +static const struct bce_type bce_devs[] = { /* BCM5706C Controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3101, "HP NC370T Multifunction Gigabit Server Adapter" }, @@ -161,7 +161,7 @@ static struct bce_type bce_devs[] = { /****************************************************************************/ /* Supported Flash NVRAM device data. */ /****************************************************************************/ -static struct flash_spec flash_table[] = +static const struct flash_spec flash_table[] = { #define BUFFERED_FLAGS (BCE_NV_BUFFERED | BCE_NV_TRANSLATE) #define NONBUFFERED_FLAGS (BCE_NV_WREN) @@ -258,7 +258,7 @@ static struct flash_spec flash_table[] = * logical-to-physical mapping is required in the * driver. */ -static struct flash_spec flash_5709 = { +static const struct flash_spec flash_5709 = { .flags = BCE_NV_BUFFERED, .page_bits = BCM5709_FLASH_PAGE_BITS, .page_size = BCM5709_FLASH_PAGE_SIZE, @@ -481,8 +481,8 @@ MODULE_DEPEND(bce, pci, 1, 1, 1); MODULE_DEPEND(bce, ether, 1, 1, 1); MODULE_DEPEND(bce, miibus, 1, 1, 1); -DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, 0, 0); -DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, NULL, NULL); +DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, NULL, NULL); /****************************************************************************/ @@ -647,7 +647,7 @@ SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks, static int bce_probe(device_t dev) { - struct bce_type *t; + const struct bce_type *t; struct bce_softc *sc; char *descbuf; u16 vid = 0, did = 0, svid = 0, sdid = 0; @@ -655,7 +655,6 @@ bce_probe(device_t dev) t = bce_devs; sc = device_get_softc(dev); - bzero(sc, sizeof(struct bce_softc)); sc->bce_unit = device_get_unit(dev); sc->bce_dev = dev; @@ -1040,7 +1039,7 @@ bce_attach(device_t dev) struct bce_softc *sc; struct ifnet *ifp; u32 val; - int error, rid, rc = 0; + int count, error, rc = 0, rid; sc = device_get_softc(dev); sc->bce_dev = dev; @@ -1077,6 +1076,7 @@ bce_attach(device_t dev) bce_probe_pci_caps(dev, sc); rid = 1; + count = 0; #if 0 /* Try allocating MSI-X interrupts. */ if ((sc->bce_cap_flags & BCE_MSIX_CAPABLE_FLAG) && @@ -1084,14 +1084,14 @@ bce_attach(device_t dev) ((sc->bce_res_irq = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE)) != NULL)) { - msi_needed = sc->bce_msi_count = 1; + msi_needed = count = 1; - if (((error = pci_alloc_msix(dev, &sc->bce_msi_count)) != 0) || - (sc->bce_msi_count != msi_needed)) { + if (((error = pci_alloc_msix(dev, &count)) != 0) || + (count != msi_needed)) { BCE_PRINTF("%s(%d): MSI-X allocation failed! Requested = %d," "Received = %d, error = %d\n", __FILE__, __LINE__, - msi_needed, sc->bce_msi_count, error); - sc->bce_msi_count = 0; + msi_needed, count, error); + count = 0; pci_release_msi(dev); bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->bce_res_irq); @@ -1100,19 +1100,18 @@ bce_attach(device_t dev) DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI-X interrupt.\n", __FUNCTION__); sc->bce_flags |= BCE_USING_MSIX_FLAG; - sc->bce_intr = bce_intr; } } #endif /* Try allocating a MSI interrupt. */ if ((sc->bce_cap_flags & BCE_MSI_CAPABLE_FLAG) && - (bce_msi_enable >= 1) && (sc->bce_msi_count == 0)) { - sc->bce_msi_count = 1; - if ((error = pci_alloc_msi(dev, &sc->bce_msi_count)) != 0) { + (bce_msi_enable >= 1) && (count == 0)) { + count = 1; + if ((error = pci_alloc_msi(dev, &count)) != 0) { BCE_PRINTF("%s(%d): MSI allocation failed! " "error = %d\n", __FILE__, __LINE__, error); - sc->bce_msi_count = 0; + count = 0; pci_release_msi(dev); } else { DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI " @@ -1120,23 +1119,19 @@ bce_attach(device_t dev) sc->bce_flags |= BCE_USING_MSI_FLAG; if (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) sc->bce_flags |= BCE_ONE_SHOT_MSI_FLAG; - sc->bce_irq_rid = 1; - sc->bce_intr = bce_intr; + rid = 1; } } /* Try allocating a legacy interrupt. */ - if (sc->bce_msi_count == 0) { + if (count == 0) { DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using INTx interrupt.\n", __FUNCTION__); rid = 0; - sc->bce_intr = bce_intr; } sc->bce_res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &rid, RF_SHAREABLE | RF_ACTIVE); - - sc->bce_irq_rid = rid; + &rid, RF_ACTIVE | (count != 0 ? 0 : RF_SHAREABLE)); /* Report any IRQ allocation errors. */ if (sc->bce_res_irq == NULL) { @@ -1635,7 +1630,7 @@ bce_shutdown(device_t dev) static u32 bce_reg_rd(struct bce_softc *sc, u32 offset) { - u32 val = bus_space_read_4(sc->bce_btag, sc->bce_bhandle, offset); + u32 val = REG_RD(sc, offset); DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%08X\n", __FUNCTION__, offset, val); return val; @@ -1653,7 +1648,7 @@ bce_reg_wr16(struct bce_softc *sc, u32 o { DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%04X\n", __FUNCTION__, offset, val); - bus_space_write_2(sc->bce_btag, sc->bce_bhandle, offset, val); + REG_WR16(sc, offset, val); } @@ -1668,7 +1663,7 @@ bce_reg_wr(struct bce_softc *sc, u32 off { DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%08X\n", __FUNCTION__, offset, val); - bus_space_write_4(sc->bce_btag, sc->bce_bhandle, offset, val); + REG_WR(sc, offset, val); } #endif @@ -1879,13 +1874,6 @@ bce_miibus_read_reg(device_t dev, int ph sc = device_get_softc(dev); - /* Make sure we are accessing the correct PHY address. */ - if (phy != sc->bce_phy_addr) { - DBPRINT(sc, BCE_INSANE_PHY, "Invalid PHY address %d " - "for PHY read!\n", phy); - return(0); - } - /* * The 5709S PHY is an IEEE Clause 45 PHY * with special mappings to work with IEEE @@ -1968,13 +1956,6 @@ bce_miibus_write_reg(device_t dev, int p sc = device_get_softc(dev); - /* Make sure we are accessing the correct PHY address. */ - if (phy != sc->bce_phy_addr) { - DBPRINT(sc, BCE_INSANE_PHY, "Invalid PHY address %d " - "for PHY write!\n", phy); - return(0); - } - DB_PRINT_PHY_REG(reg, val); /* @@ -2535,7 +2516,7 @@ bce_init_nvram(struct bce_softc *sc) { u32 val; int j, entry_count, rc = 0; - struct flash_spec *flash; + const struct flash_spec *flash; DBENTER(BCE_VERBOSE_NVRAM); @@ -3949,8 +3930,8 @@ bce_release_resources(struct bce_softc * if (sc->bce_res_irq != NULL) { DBPRINT(sc, BCE_INFO_RESET, "Releasing IRQ.\n"); - bus_release_resource(dev, SYS_RES_IRQ, sc->bce_irq_rid, - sc->bce_res_irq); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->bce_res_irq), sc->bce_res_irq); } if (sc->bce_flags & (BCE_USING_MSI_FLAG | BCE_USING_MSIX_FLAG)) { @@ -11650,4 +11631,3 @@ bce_breakpoint(struct bce_softc *sc) return; } #endif - Modified: stable/9/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/9/sys/dev/bce/if_bcereg.h Fri Mar 8 11:26:00 2013 (r248035) +++ stable/9/sys/dev/bce/if_bcereg.h Fri Mar 8 11:32:58 2013 (r248036) @@ -623,7 +623,7 @@ struct bce_type { u_int16_t bce_did; u_int16_t bce_svid; u_int16_t bce_sdid; - char *bce_name; + const char *bce_name; }; /****************************************************************************/ @@ -717,7 +717,7 @@ struct flash_spec { u32 page_size; u32 addr_mask; u32 total_size; - u8 *name; + const u8 *name; }; @@ -2002,7 +2002,7 @@ struct l2_fhdr { #define BCE_MISC_ENABLE_CLR_BITS_UMP_ENABLE (1L<<27) #define BCE_MISC_ENABLE_CLR_BITS_RV2P_CMD_SCHEDULER_ENABLE (1L<<28) #define BCE_MISC_ENABLE_CLR_BITS_RSVD_FUTURE_ENABLE (0x7L<<29) - + #define BCE_MISC_ENABLE_CLR_DEFAULT 0x17ffffff #define BCE_MISC_CLOCK_CONTROL_BITS 0x00000818 @@ -6319,19 +6319,19 @@ struct fw_info { u32 text_addr; u32 text_len; u32 text_index; - u32 *text; + const u32 *text; /* Data section. */ u32 data_addr; u32 data_len; u32 data_index; - u32 *data; + const u32 *data; /* SBSS section. */ u32 sbss_addr; u32 sbss_len; u32 sbss_index; - u32 *sbss; + const u32 *sbss; /* BSS section. */ u32 bss_addr; @@ -6422,7 +6422,7 @@ struct fw_info { struct bce_softc { - /* Interface info. Must be first!! */ + /* Interface info */ struct ifnet *bce_ifp; /* Parent device handle */ @@ -6452,10 +6452,7 @@ struct bce_softc struct mtx bce_mtx; /* Interrupt handler. */ - driver_intr_t *bce_intr; void *bce_intrhand; - int bce_irq_rid; - int bce_msi_count; /* ASIC Chip ID. */ u32 bce_chipid; @@ -6510,7 +6507,7 @@ struct bce_softc u16 link_speed; /* Flash NVRAM settings */ - struct flash_spec *bce_flash_info; + const struct flash_spec *bce_flash_info; /* Flash NVRAM size */ u32 bce_flash_size; @@ -6519,7 +6516,7 @@ struct bce_softc u32 bce_shmem_base; /* Name string */ - char *bce_name; + const char *bce_name; /* Tracks the version of bootcode firmware. */ char bce_bc_ver[32]; @@ -6835,4 +6832,3 @@ struct bce_softc }; #endif /* __BCEREG_H_DEFINED */ - From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 11:33:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 44825291; Fri, 8 Mar 2013 11:33:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2866EA8B; Fri, 8 Mar 2013 11:33:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28BX3Ro084625; Fri, 8 Mar 2013 11:33:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28BX229084620; Fri, 8 Mar 2013 11:33:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081133.r28BX229084620@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 11:33:02 +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: r248037 - stable/8/sys/dev/bce 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 11:33:03 -0000 Author: marius Date: Fri Mar 8 11:33:02 2013 New Revision: 248037 URL: http://svnweb.freebsd.org/changeset/base/248037 Log: MFC: r247565, r247590 - Make tables, device ID strings etc const. - Use NULL instead of 0 for pointers. - Remove redundant bzero(9)'ing of the softc. - Remove redundant/unused softc members. - Don't allocate MSI/MSI-X as RF_SHAREABLE. - Re-use bus accessor macros instead of duplicating them. - In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY address (missed in r213893, which was MFC'ed to stable/8 in r214909). Modified: stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/bce/if_bcereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bce/ (props changed) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Fri Mar 8 11:32:58 2013 (r248036) +++ stable/8/sys/dev/bce/if_bce.c Fri Mar 8 11:33:02 2013 (r248037) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); /****************************************************************************/ #define BCE_DEVDESC_MAX 64 -static struct bce_type bce_devs[] = { +static const struct bce_type bce_devs[] = { /* BCM5706C Controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3101, "HP NC370T Multifunction Gigabit Server Adapter" }, @@ -161,7 +161,7 @@ static struct bce_type bce_devs[] = { /****************************************************************************/ /* Supported Flash NVRAM device data. */ /****************************************************************************/ -static struct flash_spec flash_table[] = +static const struct flash_spec flash_table[] = { #define BUFFERED_FLAGS (BCE_NV_BUFFERED | BCE_NV_TRANSLATE) #define NONBUFFERED_FLAGS (BCE_NV_WREN) @@ -258,7 +258,7 @@ static struct flash_spec flash_table[] = * logical-to-physical mapping is required in the * driver. */ -static struct flash_spec flash_5709 = { +static const struct flash_spec flash_5709 = { .flags = BCE_NV_BUFFERED, .page_bits = BCM5709_FLASH_PAGE_BITS, .page_size = BCM5709_FLASH_PAGE_SIZE, @@ -481,8 +481,8 @@ MODULE_DEPEND(bce, pci, 1, 1, 1); MODULE_DEPEND(bce, ether, 1, 1, 1); MODULE_DEPEND(bce, miibus, 1, 1, 1); -DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, 0, 0); -DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, NULL, NULL); +DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, NULL, NULL); /****************************************************************************/ @@ -647,7 +647,7 @@ SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks, static int bce_probe(device_t dev) { - struct bce_type *t; + const struct bce_type *t; struct bce_softc *sc; char *descbuf; u16 vid = 0, did = 0, svid = 0, sdid = 0; @@ -655,7 +655,6 @@ bce_probe(device_t dev) t = bce_devs; sc = device_get_softc(dev); - bzero(sc, sizeof(struct bce_softc)); sc->bce_unit = device_get_unit(dev); sc->bce_dev = dev; @@ -1040,7 +1039,7 @@ bce_attach(device_t dev) struct bce_softc *sc; struct ifnet *ifp; u32 val; - int error, rid, rc = 0; + int count, error, rc = 0, rid; sc = device_get_softc(dev); sc->bce_dev = dev; @@ -1077,6 +1076,7 @@ bce_attach(device_t dev) bce_probe_pci_caps(dev, sc); rid = 1; + count = 0; #if 0 /* Try allocating MSI-X interrupts. */ if ((sc->bce_cap_flags & BCE_MSIX_CAPABLE_FLAG) && @@ -1084,14 +1084,14 @@ bce_attach(device_t dev) ((sc->bce_res_irq = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE)) != NULL)) { - msi_needed = sc->bce_msi_count = 1; + msi_needed = count = 1; - if (((error = pci_alloc_msix(dev, &sc->bce_msi_count)) != 0) || - (sc->bce_msi_count != msi_needed)) { + if (((error = pci_alloc_msix(dev, &count)) != 0) || + (count != msi_needed)) { BCE_PRINTF("%s(%d): MSI-X allocation failed! Requested = %d," "Received = %d, error = %d\n", __FILE__, __LINE__, - msi_needed, sc->bce_msi_count, error); - sc->bce_msi_count = 0; + msi_needed, count, error); + count = 0; pci_release_msi(dev); bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->bce_res_irq); @@ -1100,19 +1100,18 @@ bce_attach(device_t dev) DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI-X interrupt.\n", __FUNCTION__); sc->bce_flags |= BCE_USING_MSIX_FLAG; - sc->bce_intr = bce_intr; } } #endif /* Try allocating a MSI interrupt. */ if ((sc->bce_cap_flags & BCE_MSI_CAPABLE_FLAG) && - (bce_msi_enable >= 1) && (sc->bce_msi_count == 0)) { - sc->bce_msi_count = 1; - if ((error = pci_alloc_msi(dev, &sc->bce_msi_count)) != 0) { + (bce_msi_enable >= 1) && (count == 0)) { + count = 1; + if ((error = pci_alloc_msi(dev, &count)) != 0) { BCE_PRINTF("%s(%d): MSI allocation failed! " "error = %d\n", __FILE__, __LINE__, error); - sc->bce_msi_count = 0; + count = 0; pci_release_msi(dev); } else { DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI " @@ -1120,23 +1119,19 @@ bce_attach(device_t dev) sc->bce_flags |= BCE_USING_MSI_FLAG; if (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) sc->bce_flags |= BCE_ONE_SHOT_MSI_FLAG; - sc->bce_irq_rid = 1; - sc->bce_intr = bce_intr; + rid = 1; } } /* Try allocating a legacy interrupt. */ - if (sc->bce_msi_count == 0) { + if (count == 0) { DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using INTx interrupt.\n", __FUNCTION__); rid = 0; - sc->bce_intr = bce_intr; } sc->bce_res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &rid, RF_SHAREABLE | RF_ACTIVE); - - sc->bce_irq_rid = rid; + &rid, RF_ACTIVE | (count != 0 ? 0 : RF_SHAREABLE)); /* Report any IRQ allocation errors. */ if (sc->bce_res_irq == NULL) { @@ -1635,7 +1630,7 @@ bce_shutdown(device_t dev) static u32 bce_reg_rd(struct bce_softc *sc, u32 offset) { - u32 val = bus_space_read_4(sc->bce_btag, sc->bce_bhandle, offset); + u32 val = REG_RD(sc, offset); DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%08X\n", __FUNCTION__, offset, val); return val; @@ -1653,7 +1648,7 @@ bce_reg_wr16(struct bce_softc *sc, u32 o { DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%04X\n", __FUNCTION__, offset, val); - bus_space_write_2(sc->bce_btag, sc->bce_bhandle, offset, val); + REG_WR16(sc, offset, val); } @@ -1668,7 +1663,7 @@ bce_reg_wr(struct bce_softc *sc, u32 off { DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%08X\n", __FUNCTION__, offset, val); - bus_space_write_4(sc->bce_btag, sc->bce_bhandle, offset, val); + REG_WR(sc, offset, val); } #endif @@ -1879,13 +1874,6 @@ bce_miibus_read_reg(device_t dev, int ph sc = device_get_softc(dev); - /* Make sure we are accessing the correct PHY address. */ - if (phy != sc->bce_phy_addr) { - DBPRINT(sc, BCE_INSANE_PHY, "Invalid PHY address %d " - "for PHY read!\n", phy); - return(0); - } - /* * The 5709S PHY is an IEEE Clause 45 PHY * with special mappings to work with IEEE @@ -1968,13 +1956,6 @@ bce_miibus_write_reg(device_t dev, int p sc = device_get_softc(dev); - /* Make sure we are accessing the correct PHY address. */ - if (phy != sc->bce_phy_addr) { - DBPRINT(sc, BCE_INSANE_PHY, "Invalid PHY address %d " - "for PHY write!\n", phy); - return(0); - } - DB_PRINT_PHY_REG(reg, val); /* @@ -2535,7 +2516,7 @@ bce_init_nvram(struct bce_softc *sc) { u32 val; int j, entry_count, rc = 0; - struct flash_spec *flash; + const struct flash_spec *flash; DBENTER(BCE_VERBOSE_NVRAM); @@ -3949,8 +3930,8 @@ bce_release_resources(struct bce_softc * if (sc->bce_res_irq != NULL) { DBPRINT(sc, BCE_INFO_RESET, "Releasing IRQ.\n"); - bus_release_resource(dev, SYS_RES_IRQ, sc->bce_irq_rid, - sc->bce_res_irq); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->bce_res_irq), sc->bce_res_irq); } if (sc->bce_flags & (BCE_USING_MSI_FLAG | BCE_USING_MSIX_FLAG)) { @@ -11650,4 +11631,3 @@ bce_breakpoint(struct bce_softc *sc) return; } #endif - Modified: stable/8/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/8/sys/dev/bce/if_bcereg.h Fri Mar 8 11:32:58 2013 (r248036) +++ stable/8/sys/dev/bce/if_bcereg.h Fri Mar 8 11:33:02 2013 (r248037) @@ -623,7 +623,7 @@ struct bce_type { u_int16_t bce_did; u_int16_t bce_svid; u_int16_t bce_sdid; - char *bce_name; + const char *bce_name; }; /****************************************************************************/ @@ -717,7 +717,7 @@ struct flash_spec { u32 page_size; u32 addr_mask; u32 total_size; - u8 *name; + const u8 *name; }; @@ -2002,7 +2002,7 @@ struct l2_fhdr { #define BCE_MISC_ENABLE_CLR_BITS_UMP_ENABLE (1L<<27) #define BCE_MISC_ENABLE_CLR_BITS_RV2P_CMD_SCHEDULER_ENABLE (1L<<28) #define BCE_MISC_ENABLE_CLR_BITS_RSVD_FUTURE_ENABLE (0x7L<<29) - + #define BCE_MISC_ENABLE_CLR_DEFAULT 0x17ffffff #define BCE_MISC_CLOCK_CONTROL_BITS 0x00000818 @@ -6319,19 +6319,19 @@ struct fw_info { u32 text_addr; u32 text_len; u32 text_index; - u32 *text; + const u32 *text; /* Data section. */ u32 data_addr; u32 data_len; u32 data_index; - u32 *data; + const u32 *data; /* SBSS section. */ u32 sbss_addr; u32 sbss_len; u32 sbss_index; - u32 *sbss; + const u32 *sbss; /* BSS section. */ u32 bss_addr; @@ -6422,7 +6422,7 @@ struct fw_info { struct bce_softc { - /* Interface info. Must be first!! */ + /* Interface info */ struct ifnet *bce_ifp; /* Parent device handle */ @@ -6452,10 +6452,7 @@ struct bce_softc struct mtx bce_mtx; /* Interrupt handler. */ - driver_intr_t *bce_intr; void *bce_intrhand; - int bce_irq_rid; - int bce_msi_count; /* ASIC Chip ID. */ u32 bce_chipid; @@ -6510,7 +6507,7 @@ struct bce_softc u16 link_speed; /* Flash NVRAM settings */ - struct flash_spec *bce_flash_info; + const struct flash_spec *bce_flash_info; /* Flash NVRAM size */ u32 bce_flash_size; @@ -6519,7 +6516,7 @@ struct bce_softc u32 bce_shmem_base; /* Name string */ - char *bce_name; + const char *bce_name; /* Tracks the version of bootcode firmware. */ char bce_bc_ver[32]; @@ -6835,4 +6832,3 @@ struct bce_softc }; #endif /* __BCEREG_H_DEFINED */ - From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 11:41:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3E256B0; Fri, 8 Mar 2013 11:41:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B76CFAD0; Fri, 8 Mar 2013 11:41:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28BfmWK087431; Fri, 8 Mar 2013 11:41:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28BfmRt087429; Fri, 8 Mar 2013 11:41:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081141.r28BfmRt087429@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 11:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248038 - stable/9/sys/dev/puc 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 11:41:48 -0000 Author: marius Date: Fri Mar 8 11:41:48 2013 New Revision: 248038 URL: http://svnweb.freebsd.org/changeset/base/248038 Log: MFC: r247571 - Apparently, r186520 was just wrong and the clock of Oxford OX16PCI958 is neither DEFAULT_RCLK * 2 nor DEFAULT_RCLK * 10 but plain DEFAULT_RCLK and there's no (open) source indicating otherwise. This was tested with an EXSYS EX-41098-2, whose clock is not configurable and identifies as: puc0@pci0:5:1:0: class=0x070200 card=0x06711415 chip=0x95381415 rev=0x01 hdr=0x00 vendor = 'Oxford Semiconductor Ltd' class = simple comms subclass = multiport serial Note that this exactly matches the card mentioned in PR 129665 so no sub-device/sub-vendor based quirking of the latter is possible. So maybe we should grow some sort of tunable, in case non-default cards such as the latter aren't configurable either (this also wouldn't be the first time an allegedly tested commit turns out to be wrong though). - Make the TiMedia tables const. Modified: stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/puc/ (props changed) Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Fri Mar 8 11:33:02 2013 (r248037) +++ stable/9/sys/dev/puc/pucdata.c Fri Mar 8 11:41:48 2013 (r248038) @@ -769,7 +769,7 @@ const struct puc_cfg puc_pci_devices[] = { 0x1415, 0x9538, 0xffff, 0, "Oxford Semiconductor OX16PCI958 UARTs", - DEFAULT_RCLK * 10, + DEFAULT_RCLK, PUC_PORT_8S, 0x18, 0, 8, }, @@ -918,6 +918,7 @@ const struct puc_cfg puc_pci_devices[] = DEFAULT_RCLK * 8, PUC_PORT_4S, 0x10, 0, 8, }, + { 0x14d2, 0xa004, 0xffff, 0, "Titan PCI-800H", DEFAULT_RCLK * 8, @@ -1054,7 +1055,7 @@ const struct puc_cfg puc_pci_devices[] = { 0x9710, 0x9865, 0xa000, 0x3004, "NetMos NM9865 Quad UART", DEFAULT_RCLK, - PUC_PORT_4S, 0x10, 4, 0,0 + PUC_PORT_4S, 0x10, 4, 0, }, { 0x9710, 0x9865, 0xa000, 0x3011, @@ -1414,26 +1415,26 @@ static int puc_config_timedia(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { - static uint16_t dual[] = { + static const uint16_t dual[] = { 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085, 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079, 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079, 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079, 0xD079, 0 }; - static uint16_t quad[] = { + static const uint16_t quad[] = { 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157, 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159, 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056, 0xB157, 0 }; - static uint16_t octa[] = { + static const uint16_t octa[] = { 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166, 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0 }; - static struct { + static const struct { int ports; - uint16_t *ids; + const uint16_t *ids; } subdevs[] = { { 2, dual }, { 4, quad }, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 11:41:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B58496BA; Fri, 8 Mar 2013 11:41:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3849DAD3; Fri, 8 Mar 2013 11:41:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28BfrHb087472; Fri, 8 Mar 2013 11:41:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28BfrL1087471; Fri, 8 Mar 2013 11:41:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081141.r28BfrL1087471@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 11:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248039 - stable/8/sys/dev/puc 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 11:41:53 -0000 Author: marius Date: Fri Mar 8 11:41:52 2013 New Revision: 248039 URL: http://svnweb.freebsd.org/changeset/base/248039 Log: MFC: r247571 - Apparently, r186520 was just wrong and the clock of Oxford OX16PCI958 is neither DEFAULT_RCLK * 2 nor DEFAULT_RCLK * 10 but plain DEFAULT_RCLK and there's no (open) source indicating otherwise. This was tested with an EXSYS EX-41098-2, whose clock is not configurable and identifies as: puc0@pci0:5:1:0: class=0x070200 card=0x06711415 chip=0x95381415 rev=0x01 hdr=0x00 vendor = 'Oxford Semiconductor Ltd' class = simple comms subclass = multiport serial Note that this exactly matches the card mentioned in PR 129665 so no sub-device/sub-vendor based quirking of the latter is possible. So maybe we should grow some sort of tunable, in case non-default cards such as the latter aren't configurable either (this also wouldn't be the first time an allegedly tested commit turns out to be wrong though). - Make the TiMedia tables const. Modified: stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/puc/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Fri Mar 8 11:41:48 2013 (r248038) +++ stable/8/sys/dev/puc/pucdata.c Fri Mar 8 11:41:52 2013 (r248039) @@ -769,7 +769,7 @@ const struct puc_cfg puc_pci_devices[] = { 0x1415, 0x9538, 0xffff, 0, "Oxford Semiconductor OX16PCI958 UARTs", - DEFAULT_RCLK * 10, + DEFAULT_RCLK, PUC_PORT_8S, 0x18, 0, 8, }, @@ -893,6 +893,7 @@ const struct puc_cfg puc_pci_devices[] = DEFAULT_RCLK * 8, PUC_PORT_4S, 0x10, 0, 8, }, + { 0x14d2, 0xa004, 0xffff, 0, "Titan PCI-800H", DEFAULT_RCLK * 8, @@ -1029,7 +1030,7 @@ const struct puc_cfg puc_pci_devices[] = { 0x9710, 0x9865, 0xa000, 0x3004, "NetMos NM9865 Quad UART", DEFAULT_RCLK, - PUC_PORT_4S, 0x10, 4, 0,0 + PUC_PORT_4S, 0x10, 4, 0, }, { 0x9710, 0x9865, 0xa000, 0x3011, @@ -1389,26 +1390,26 @@ static int puc_config_timedia(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { - static uint16_t dual[] = { + static const uint16_t dual[] = { 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085, 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079, 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079, 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079, 0xD079, 0 }; - static uint16_t quad[] = { + static const uint16_t quad[] = { 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157, 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159, 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056, 0xB157, 0 }; - static uint16_t octa[] = { + static const uint16_t octa[] = { 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166, 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0 }; - static struct { + static const struct { int ports; - uint16_t *ids; + const uint16_t *ids; } subdevs[] = { { 2, dual }, { 4, quad }, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:08:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8E07FCA; Fri, 8 Mar 2013 12:08:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A2F7FCF4; Fri, 8 Mar 2013 12:08:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28C8qRn094718; Fri, 8 Mar 2013 12:08:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28C8qiE094717; Fri, 8 Mar 2013 12:08:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081208.r28C8qiE094717@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248040 - stable/9/sys/dev/puc 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:08:53 -0000 Author: marius Date: Fri Mar 8 12:08:52 2013 New Revision: 248040 URL: http://svnweb.freebsd.org/changeset/base/248040 Log: MFC: r236736 Add support for the Sunix SER5437A dual serial PCI Express card. Modified: stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/puc/ (props changed) Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Fri Mar 8 11:41:52 2013 (r248039) +++ stable/9/sys/dev/puc/pucdata.c Fri Mar 8 12:08:52 2013 (r248040) @@ -974,6 +974,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, + { 0x1fd4, 0x1999, 0xffff, 0, + "Sunix SER5437A", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x5372, 0x6873, 0xffff, 0, "Sun 1040 PCI Quad Serial", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:09:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A53061C2; Fri, 8 Mar 2013 12:09:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96EFBCF7; Fri, 8 Mar 2013 12:09:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28C9Cok094825; Fri, 8 Mar 2013 12:09:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28C9CxD094824; Fri, 8 Mar 2013 12:09:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081209.r28C9CxD094824@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248041 - stable/8/sys/dev/puc 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:09:12 -0000 Author: marius Date: Fri Mar 8 12:09:12 2013 New Revision: 248041 URL: http://svnweb.freebsd.org/changeset/base/248041 Log: MFC: r236736 Add support for the Sunix SER5437A dual serial PCI Express card. MFC: r239048 Add additional Perle Speed LE serial cards PR: kern/168816 Submitted by: Dennis Oyama Modified: stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/puc/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Fri Mar 8 12:08:52 2013 (r248040) +++ stable/8/sys/dev/puc/pucdata.c Fri Mar 8 12:09:12 2013 (r248041) @@ -780,11 +780,36 @@ const struct puc_cfg puc_pci_devices[] = */ { 0x155f, 0x0331, 0xffff, 0, + "Perle Ultraport4 Express", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + + { 0x155f, 0xB012, 0xffff, 0, + "Perle Speed2 LE", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, + + { 0x155f, 0xB022, 0xffff, 0, + "Perle Speed2 LE", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, + + { 0x155f, 0xB004, 0xffff, 0, "Perle Speed4 LE", DEFAULT_RCLK * 8, PUC_PORT_4S, 0x10, 0, 8, }, + { 0x155f, 0xB008, 0xffff, 0, + "Perle Speed8 LE", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x10, 0, 8, + }, + + /* * Oxford Semiconductor PCI Express Expresso family * @@ -949,6 +974,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, + { 0x1fd4, 0x1999, 0xffff, 0, + "Sunix SER5437A", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x5372, 0x6873, 0xffff, 0, "Sun 1040 PCI Quad Serial", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:11:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2BCB13F9; Fri, 8 Mar 2013 12:11:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C6ECD1F; Fri, 8 Mar 2013 12:11:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CBbFl096981; Fri, 8 Mar 2013 12:11:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CBbpJ096980; Fri, 8 Mar 2013 12:11:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081211.r28CBbpJ096980@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248042 - stable/9/sys/sparc64/pci 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:11:38 -0000 Author: marius Date: Fri Mar 8 12:11:37 2013 New Revision: 248042 URL: http://svnweb.freebsd.org/changeset/base/248042 Log: MFC: r247573 - Remove an unused header. - Use NULL instead of 0 for pointers. - Let ofw_pcib_probe() return BUS_PROBE_DEFAULT instead of 0 so specialized PCI-PCI-bridge drivers may attach instead. - Add WARs for PLX Technology PEX 8114 bridges and PEX 8532 switches. Ideally, these should live in MI code but at least for the latter we're missing the necessary infrastructure there. Modified: stable/9/sys/sparc64/pci/ofw_pcib.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/9/sys/sparc64/pci/ofw_pcib.c Fri Mar 8 12:09:12 2013 (r248041) +++ stable/9/sys/sparc64/pci/ofw_pcib.c Fri Mar 8 12:11:37 2013 (r248042) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -58,8 +56,12 @@ __FBSDID("$FreeBSD$"); #include #include +#define PCI_DEVID_ALI_M5249 0x524910b9 +#define PCI_VENDOR_PLX 0x10b5 + static device_probe_t ofw_pcib_probe; static device_attach_t ofw_pcib_attach; +static ofw_pci_setup_device_t ofw_pcib_setup_device; static device_method_t ofw_pcib_methods[] = { /* Device interface */ @@ -73,6 +75,7 @@ static device_method_t ofw_pcib_methods[ /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), + DEVMETHOD(ofw_pci_setup_device, ofw_pcib_setup_device), DEVMETHOD_END }; @@ -81,7 +84,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_1(pcib, ofw_pcib_driver, ofw_pcib_methods, sizeof(struct ofw_pcib_gen_softc), pcib_driver); -EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0, +EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, NULL, NULL, BUS_PASS_BUS); MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); @@ -104,7 +107,7 @@ ofw_pcib_probe(device_t dev) ISDTYPE(pbdtype, OFW_TYPE_PCIE) ? "e" : "", ISDTYPE(dtype, OFW_TYPE_PCIE) ? "e" : ""); device_set_desc_copy(dev, desc); - return (0); + return (BUS_PROBE_DEFAULT); } #undef ISDTYPE @@ -119,7 +122,6 @@ ofw_pcib_attach(device_t dev) sc = device_get_softc(dev); - /* Quirk handling */ switch (pci_get_devid(dev)) { /* * The ALi M5249 found in Fire-based machines by definition must me @@ -127,13 +129,46 @@ ofw_pcib_attach(device_t dev) * don't indicate this in the class code although the ISA I/O range * isn't included in their bridge decode. */ - case 0x524910b9: + case PCI_DEVID_ALI_M5249: sc->ops_pcib_sc.flags |= PCIB_SUBTRACTIVE; break; } + switch (pci_get_vendor(dev)) { + /* + * Concurrently write the primary and secondary bus numbers in order + * to work around a bug in PLX PEX 8114 causing the internal shadow + * copies of these not to be updated when setting them bytewise. + */ + case PCI_VENDOR_PLX: + pci_write_config(dev, PCIR_PRIBUS_1, + pci_read_config(dev, PCIR_SECBUS_1, 1) << 8 | + pci_read_config(dev, PCIR_PRIBUS_1, 1), 2); + break; + } + ofw_pcib_gen_setup(dev); pcib_attach_common(dev); device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); } + +static void +ofw_pcib_setup_device(device_t bus, device_t child) +{ + int i; + uint16_t reg; + + switch (pci_get_vendor(bus)) { + /* + * For PLX PEX 8532 issue 64 TLPs to the child from the downstream + * port to the child device in order to work around a hardware bug. + */ + case PCI_VENDOR_PLX: + for (i = 0, reg = 0; i < 64; i++) + reg |= pci_get_devid(child); + break; + } + + OFW_PCI_SETUP_DEVICE(device_get_parent(bus), child); +} From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:11:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3A58C3FA; Fri, 8 Mar 2013 12:11:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 218ADD21; Fri, 8 Mar 2013 12:11:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CBglS097024; Fri, 8 Mar 2013 12:11:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CBfXP097023; Fri, 8 Mar 2013 12:11:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081211.r28CBfXP097023@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:11:41 +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: r248043 - stable/8/sys/sparc64/pci 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:11:42 -0000 Author: marius Date: Fri Mar 8 12:11:41 2013 New Revision: 248043 URL: http://svnweb.freebsd.org/changeset/base/248043 Log: MFC: r247573 - Remove an unused header. - Use NULL instead of 0 for pointers. - Let ofw_pcib_probe() return BUS_PROBE_DEFAULT instead of 0 so specialized PCI-PCI-bridge drivers may attach instead. - Add WARs for PLX Technology PEX 8114 bridges and PEX 8532 switches. Ideally, these should live in MI code but at least for the latter we're missing the necessary infrastructure there. Modified: stable/8/sys/sparc64/pci/ofw_pcib.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcib.c Fri Mar 8 12:11:37 2013 (r248042) +++ stable/8/sys/sparc64/pci/ofw_pcib.c Fri Mar 8 12:11:41 2013 (r248043) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -58,8 +56,12 @@ __FBSDID("$FreeBSD$"); #include #include +#define PCI_DEVID_ALI_M5249 0x524910b9 +#define PCI_VENDOR_PLX 0x10b5 + static device_probe_t ofw_pcib_probe; static device_attach_t ofw_pcib_attach; +static ofw_pci_setup_device_t ofw_pcib_setup_device; static device_method_t ofw_pcib_methods[] = { /* Device interface */ @@ -73,6 +75,7 @@ static device_method_t ofw_pcib_methods[ /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), + DEVMETHOD(ofw_pci_setup_device, ofw_pcib_setup_device), DEVMETHOD_END }; @@ -81,7 +84,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_1(pcib, ofw_pcib_driver, ofw_pcib_methods, sizeof(struct ofw_pcib_gen_softc), pcib_driver); -EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0, +EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, NULL, NULL, BUS_PASS_BUS); MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); @@ -104,7 +107,7 @@ ofw_pcib_probe(device_t dev) ISDTYPE(pbdtype, OFW_TYPE_PCIE) ? "e" : "", ISDTYPE(dtype, OFW_TYPE_PCIE) ? "e" : ""); device_set_desc_copy(dev, desc); - return (0); + return (BUS_PROBE_DEFAULT); } #undef ISDTYPE @@ -119,7 +122,6 @@ ofw_pcib_attach(device_t dev) sc = device_get_softc(dev); - /* Quirk handling */ switch (pci_get_devid(dev)) { /* * The ALi M5249 found in Fire-based machines by definition must me @@ -127,13 +129,46 @@ ofw_pcib_attach(device_t dev) * don't indicate this in the class code although the ISA I/O range * isn't included in their bridge decode. */ - case 0x524910b9: + case PCI_DEVID_ALI_M5249: sc->ops_pcib_sc.flags |= PCIB_SUBTRACTIVE; break; } + switch (pci_get_vendor(dev)) { + /* + * Concurrently write the primary and secondary bus numbers in order + * to work around a bug in PLX PEX 8114 causing the internal shadow + * copies of these not to be updated when setting them bytewise. + */ + case PCI_VENDOR_PLX: + pci_write_config(dev, PCIR_PRIBUS_1, + pci_read_config(dev, PCIR_SECBUS_1, 1) << 8 | + pci_read_config(dev, PCIR_PRIBUS_1, 1), 2); + break; + } + ofw_pcib_gen_setup(dev); pcib_attach_common(dev); device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); } + +static void +ofw_pcib_setup_device(device_t bus, device_t child) +{ + int i; + uint16_t reg; + + switch (pci_get_vendor(bus)) { + /* + * For PLX PEX 8532 issue 64 TLPs to the child from the downstream + * port to the child device in order to work around a hardware bug. + */ + case PCI_VENDOR_PLX: + for (i = 0, reg = 0; i < 64; i++) + reg |= pci_get_devid(child); + break; + } + + OFW_PCI_SETUP_DEVICE(device_get_parent(bus), child); +} From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:13:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E04936D1; Fri, 8 Mar 2013 12:13:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C30F8D32; Fri, 8 Mar 2013 12:13:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CDU2D097411; Fri, 8 Mar 2013 12:13:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CDUgb097409; Fri, 8 Mar 2013 12:13:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081213.r28CDUgb097409@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:13:30 +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: r248044 - stable/9/sys/sparc64/pci 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:13:31 -0000 Author: marius Date: Fri Mar 8 12:13:30 2013 New Revision: 248044 URL: http://svnweb.freebsd.org/changeset/base/248044 Log: MFC: r247574 - In sbbc_pci_attach() just pass the already obtained bus tag and handle instead of acquiring these anew. - Use NULL instead of 0 for pointers. Modified: stable/9/sys/sparc64/pci/sbbc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/pci/sbbc.c ============================================================================== --- stable/9/sys/sparc64/pci/sbbc.c Fri Mar 8 12:11:41 2013 (r248043) +++ stable/9/sys/sparc64/pci/sbbc.c Fri Mar 8 12:13:30 2013 (r248044) @@ -299,7 +299,7 @@ static device_method_t sbbc_pci_methods[ static devclass_t sbbc_devclass; DEFINE_CLASS_0(sbbc, sbbc_driver, sbbc_pci_methods, sizeof(struct sbbc_softc)); -DRIVER_MODULE(sbbc, pci, sbbc_driver, sbbc_devclass, 0, 0); +DRIVER_MODULE(sbbc, pci, sbbc_driver, sbbc_devclass, NULL, NULL); static int sbbc_pci_probe(device_t dev) @@ -358,8 +358,7 @@ sbbc_pci_attach(device_t dev) if (error != 0) device_printf(dev, "failed to attach UART device\n"); } else { - error = sbbc_parse_toc(rman_get_bustag(sc->sc_res), - rman_get_bushandle(sc->sc_res)); + error = sbbc_parse_toc(bst, bsh); if (error != 0) { device_printf(dev, "failed to parse TOC\n"); if (sbbc_console != 0) { @@ -609,7 +608,7 @@ static device_method_t sbbc_uart_sbbc_me DEFINE_CLASS_0(uart, sbbc_uart_driver, sbbc_uart_sbbc_methods, sizeof(struct uart_softc)); -DRIVER_MODULE(uart, sbbc, sbbc_uart_driver, uart_devclass, 0, 0); +DRIVER_MODULE(uart, sbbc, sbbc_uart_driver, uart_devclass, NULL, NULL); static int sbbc_uart_sbbc_probe(device_t dev) From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:13:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC6DD6D2; Fri, 8 Mar 2013 12:13:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 966E6D33; Fri, 8 Mar 2013 12:13:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CDXJ4097450; Fri, 8 Mar 2013 12:13:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CDXpT097449; Fri, 8 Mar 2013 12:13:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081213.r28CDXpT097449@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:13:33 +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: r248045 - stable/8/sys/sparc64/pci 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:13:33 -0000 Author: marius Date: Fri Mar 8 12:13:33 2013 New Revision: 248045 URL: http://svnweb.freebsd.org/changeset/base/248045 Log: MFC: r247574 - In sbbc_pci_attach() just pass the already obtained bus tag and handle instead of acquiring these anew. - Use NULL instead of 0 for pointers. Modified: stable/8/sys/sparc64/pci/sbbc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/pci/sbbc.c ============================================================================== --- stable/8/sys/sparc64/pci/sbbc.c Fri Mar 8 12:13:30 2013 (r248044) +++ stable/8/sys/sparc64/pci/sbbc.c Fri Mar 8 12:13:33 2013 (r248045) @@ -299,7 +299,7 @@ static device_method_t sbbc_pci_methods[ static devclass_t sbbc_devclass; DEFINE_CLASS_0(sbbc, sbbc_driver, sbbc_pci_methods, sizeof(struct sbbc_softc)); -DRIVER_MODULE(sbbc, pci, sbbc_driver, sbbc_devclass, 0, 0); +DRIVER_MODULE(sbbc, pci, sbbc_driver, sbbc_devclass, NULL, NULL); static int sbbc_pci_probe(device_t dev) @@ -358,8 +358,7 @@ sbbc_pci_attach(device_t dev) if (error != 0) device_printf(dev, "failed to attach UART device\n"); } else { - error = sbbc_parse_toc(rman_get_bustag(sc->sc_res), - rman_get_bushandle(sc->sc_res)); + error = sbbc_parse_toc(bst, bsh); if (error != 0) { device_printf(dev, "failed to parse TOC\n"); if (sbbc_console != 0) { @@ -609,7 +608,7 @@ static device_method_t sbbc_uart_sbbc_me DEFINE_CLASS_0(uart, sbbc_uart_driver, sbbc_uart_sbbc_methods, sizeof(struct uart_softc)); -DRIVER_MODULE(uart, sbbc, sbbc_uart_driver, uart_devclass, 0, 0); +DRIVER_MODULE(uart, sbbc, sbbc_uart_driver, uart_devclass, NULL, NULL); static int sbbc_uart_sbbc_probe(device_t dev) From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:44:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0767C15B; Fri, 8 Mar 2013 12:44:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4302E94; Fri, 8 Mar 2013 12:44:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28Ci8ui006648; Fri, 8 Mar 2013 12:44:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28Ci8kk006647; Fri, 8 Mar 2013 12:44:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081244.r28Ci8kk006647@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248046 - stable/9/sys/dev/cas 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:44:09 -0000 Author: marius Date: Fri Mar 8 12:44:08 2013 New Revision: 248046 URL: http://svnweb.freebsd.org/changeset/base/248046 Log: MFC: r247579 - Move reporting of failures to disable RX/TX MAC under bootverbose as at least the Saturn chips of 501-6738 cards may fail to do so the first time, which isn't fatal though. Reported by: Paul Keusemann - Explain why we don't enable infinite bursts on sparc64. - Given that these chips support memory write invalidate, make sure that it's enabled in the command register. Also make sure that PERR# and SERR# assertion is enabled. Modified: stable/9/sys/dev/cas/if_cas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cas/if_cas.c ============================================================================== --- stable/9/sys/dev/cas/if_cas.c Fri Mar 8 12:13:33 2013 (r248045) +++ stable/9/sys/dev/cas/if_cas.c Fri Mar 8 12:44:08 2013 (r248046) @@ -824,7 +824,8 @@ cas_disable_rx(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_EN, 0)) return (1); - device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + if (bootverbose) + device_printf(sc->sc_dev, "cannot disable RX MAC\n"); return (0); } @@ -838,7 +839,8 @@ cas_disable_tx(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (cas_bitwait(sc, CAS_MAC_TX_CONF, CAS_MAC_TX_CONF_EN, 0)) return (1); - device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + if (bootverbose) + device_printf(sc->sc_dev, "cannot disable TX MAC\n"); return (0); } @@ -1041,7 +1043,8 @@ cas_init_locked(struct cas_softc *sc) /* * Enable infinite bursts for revisions without PCI issues if * applicable. Doing so greatly improves the TX performance on - * !__sparc64__. + * !__sparc64__ (on sparc64, setting CAS_INF_BURST improves TX + * performance only marginally but hurts RX throughput quite a bit). */ CAS_WRITE_4(sc, CAS_INF_BURST, #if !defined(__sparc64__) @@ -2691,7 +2694,10 @@ cas_pci_attach(device_t dev) return (ENXIO); } - pci_enable_busmaster(dev); + /* PCI configuration */ + pci_write_config(dev, PCIR_COMMAND, + pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_BUSMASTEREN | + PCIM_CMD_MWRICEN | PCIM_CMD_PERRESPEN | PCIM_CMD_SERRESPEN, 2); sc->sc_dev = dev; if (sc->sc_variant == CAS_CAS && pci_get_devid(dev) < 0x02) From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:44:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7D0DD2C5; Fri, 8 Mar 2013 12:44:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6134EEAC; Fri, 8 Mar 2013 12:44:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CifV9006744; Fri, 8 Mar 2013 12:44:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CifFd006741; Fri, 8 Mar 2013 12:44:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081244.r28CifFd006741@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:44:41 +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: r248047 - stable/8/sys/dev/cas 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:44:41 -0000 Author: marius Date: Fri Mar 8 12:44:40 2013 New Revision: 248047 URL: http://svnweb.freebsd.org/changeset/base/248047 Log: MFC: r223951 Partially merge r223648 and r223949 from gem(4) (committed to stable/8 in r224367): - Consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the old content of CAS_MAC_RX_CONF. - Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation failure. - According to the Cassini datasheet the RX MAC should also be disabled in cas_setladrf() before changing its configuration. - Add error messages to gem_disable_{r,t}x() and take advantage of these throughout the driver instead of duplicating their functionality all over the place. MFC: r247579 - Move reporting of failures to disable RX/TX MAC under bootverbose as at least the Saturn chips of 501-6738 cards may fail to do so the first time, which isn't fatal though. Reported by: Paul Keusemann - Explain why we don't enable infinite bursts on sparc64. - Given that these chips support memory write invalidate, make sure that it's enabled in the command register. Also make sure that PERR# and SERR# assertion is enabled. Modified: stable/8/sys/dev/cas/if_cas.c stable/8/sys/dev/cas/if_casvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cas/ (props changed) Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Fri Mar 8 12:44:08 2013 (r248046) +++ stable/8/sys/dev/cas/if_cas.c Fri Mar 8 12:44:40 2013 (r248047) @@ -768,7 +768,7 @@ cas_reset_rx(struct cas_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - cas_disable_rx(sc); + (void)cas_disable_rx(sc); CAS_WRITE_4(sc, CAS_RX_CONF, 0); CAS_BARRIER(sc, CAS_RX_CONF, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -780,7 +780,7 @@ cas_reset_rx(struct cas_softc *sc) ((sc->sc_flags & CAS_SERDES) != 0 ? CAS_RESET_PCS_DIS : 0)); CAS_BARRIER(sc, CAS_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!cas_bitwait(sc, CAS_RESET, CAS_RESET_RX | CAS_RESET_TX, 0)) { + if (!cas_bitwait(sc, CAS_RESET, CAS_RESET_RX, 0)) { device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } @@ -795,7 +795,7 @@ cas_reset_tx(struct cas_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - cas_disable_tx(sc); + (void)cas_disable_tx(sc); CAS_WRITE_4(sc, CAS_TX_CONF, 0); CAS_BARRIER(sc, CAS_TX_CONF, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -807,7 +807,7 @@ cas_reset_tx(struct cas_softc *sc) ((sc->sc_flags & CAS_SERDES) != 0 ? CAS_RESET_PCS_DIS : 0)); CAS_BARRIER(sc, CAS_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!cas_bitwait(sc, CAS_RESET, CAS_RESET_RX | CAS_RESET_TX, 0)) { + if (!cas_bitwait(sc, CAS_RESET, CAS_RESET_TX, 0)) { device_printf(sc->sc_dev, "cannot reset transmitter\n"); return (1); } @@ -822,7 +822,11 @@ cas_disable_rx(struct cas_softc *sc) CAS_READ_4(sc, CAS_MAC_RX_CONF) & ~CAS_MAC_RX_CONF_EN); CAS_BARRIER(sc, CAS_MAC_RX_CONF, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_EN, 0)); + if (cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_EN, 0)) + return (1); + if (bootverbose) + device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + return (0); } static int @@ -833,7 +837,11 @@ cas_disable_tx(struct cas_softc *sc) CAS_READ_4(sc, CAS_MAC_TX_CONF) & ~CAS_MAC_TX_CONF_EN); CAS_BARRIER(sc, CAS_MAC_TX_CONF, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (cas_bitwait(sc, CAS_MAC_TX_CONF, CAS_MAC_TX_CONF_EN, 0)); + if (cas_bitwait(sc, CAS_MAC_TX_CONF, CAS_MAC_TX_CONF_EN, 0)) + return (1); + if (bootverbose) + device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + return (0); } static inline void @@ -996,7 +1004,6 @@ cas_init_locked(struct cas_softc *sc) cas_init_regs(sc); /* step 5. RX MAC registers & counters */ - cas_setladrf(sc); /* step 6 & 7. Program Ring Base Addresses. */ CAS_WRITE_4(sc, CAS_TX_DESC3_BASE_HI, @@ -1036,7 +1043,8 @@ cas_init_locked(struct cas_softc *sc) /* * Enable infinite bursts for revisions without PCI issues if * applicable. Doing so greatly improves the TX performance on - * !__sparc64__. + * !__sparc64__ (on sparc64, setting CAS_INF_BURST improves TX + * performance only marginally but hurts RX throughput quite a bit). */ CAS_WRITE_4(sc, CAS_INF_BURST, #if !defined(__sparc64__) @@ -1141,23 +1149,20 @@ cas_init_locked(struct cas_softc *sc) /* step 11. Configure Media. */ /* step 12. RX_MAC Configuration Register */ - v = CAS_READ_4(sc, CAS_MAC_RX_CONF) & ~CAS_MAC_RX_CONF_STRPPAD; - v |= CAS_MAC_RX_CONF_EN | CAS_MAC_RX_CONF_STRPFCS; - CAS_WRITE_4(sc, CAS_MAC_RX_CONF, 0); - CAS_BARRIER(sc, CAS_MAC_RX_CONF, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_EN, 0)) - device_printf(sc->sc_dev, "cannot configure RX MAC\n"); - CAS_WRITE_4(sc, CAS_MAC_RX_CONF, v); + v = CAS_READ_4(sc, CAS_MAC_RX_CONF); + v &= ~(CAS_MAC_RX_CONF_STRPPAD | CAS_MAC_RX_CONF_EN); + v |= CAS_MAC_RX_CONF_STRPFCS; + sc->sc_mac_rxcfg = v; + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + cas_setladrf(sc); /* step 13. TX_MAC Configuration Register */ v = CAS_READ_4(sc, CAS_MAC_TX_CONF); v |= CAS_MAC_TX_CONF_EN; - CAS_WRITE_4(sc, CAS_MAC_TX_CONF, 0); - CAS_BARRIER(sc, CAS_MAC_TX_CONF, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!cas_bitwait(sc, CAS_MAC_TX_CONF, CAS_MAC_TX_CONF_EN, 0)) - device_printf(sc->sc_dev, "cannot configure TX MAC\n"); + (void)cas_disable_tx(sc); CAS_WRITE_4(sc, CAS_MAC_TX_CONF, v); /* step 14. Issue Transmit Pending command. */ @@ -1753,7 +1758,7 @@ cas_rint(struct cas_softc *sc) (*ifp->if_input)(ifp, m); CAS_LOCK(sc); } else - ifp->if_ierrors++; + ifp->if_iqdrops++; if ((word1 & CAS_RC1_RELEASE_HDR) != 0 && refcount_release(&rxds->rxds_refcount) != 0) @@ -1851,7 +1856,7 @@ cas_rint(struct cas_softc *sc) (*ifp->if_input)(ifp, m); CAS_LOCK(sc); } else - ifp->if_ierrors++; + ifp->if_iqdrops++; if ((word1 & CAS_RC1_RELEASE_DATA) != 0 && refcount_release(&rxds->rxds_refcount) != 0) @@ -2342,8 +2347,8 @@ cas_mii_statchg(device_t dev) * the Cassini+ ASIC Specification. */ - rxcfg = CAS_READ_4(sc, CAS_MAC_RX_CONF); - rxcfg &= ~(CAS_MAC_RX_CONF_EN | CAS_MAC_RX_CONF_CARR); + rxcfg = sc->sc_mac_rxcfg; + rxcfg &= ~CAS_MAC_RX_CONF_CARR; txcfg = CAS_MAC_TX_CONF_EN_IPG0 | CAS_MAC_TX_CONF_NGU | CAS_MAC_TX_CONF_NGUL; if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) != 0) @@ -2352,17 +2357,9 @@ cas_mii_statchg(device_t dev) rxcfg |= CAS_MAC_RX_CONF_CARR; txcfg |= CAS_MAC_TX_CONF_CARR; } - CAS_WRITE_4(sc, CAS_MAC_TX_CONF, 0); - CAS_BARRIER(sc, CAS_MAC_TX_CONF, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!cas_bitwait(sc, CAS_MAC_TX_CONF, CAS_MAC_TX_CONF_EN, 0)) - device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + (void)cas_disable_tx(sc); CAS_WRITE_4(sc, CAS_MAC_TX_CONF, txcfg); - CAS_WRITE_4(sc, CAS_MAC_RX_CONF, 0); - CAS_BARRIER(sc, CAS_MAC_RX_CONF, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_EN, 0)) - device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + (void)cas_disable_rx(sc); CAS_WRITE_4(sc, CAS_MAC_RX_CONF, rxcfg); v = CAS_READ_4(sc, CAS_MAC_CTRL_CONF) & @@ -2420,6 +2417,7 @@ cas_mii_statchg(device_t dev) v |= CAS_MAC_XIF_CONF_FDXLED; CAS_WRITE_4(sc, CAS_MAC_XIF_CONF, v); + sc->sc_mac_rxcfg = rxcfg; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & CAS_LINK) != 0) { CAS_WRITE_4(sc, CAS_MAC_TX_CONF, @@ -2534,23 +2532,21 @@ cas_setladrf(struct cas_softc *sc) CAS_LOCK_ASSERT(sc, MA_OWNED); - /* Get the current RX configuration. */ - v = CAS_READ_4(sc, CAS_MAC_RX_CONF); - /* - * Turn off promiscuous mode, promiscuous group mode (all multicast), - * and hash filter. Depending on the case, the right bit will be - * enabled. + * Turn off the RX MAC and the hash filter as required by the Sun + * Cassini programming restrictions. */ - v &= ~(CAS_MAC_RX_CONF_PROMISC | CAS_MAC_RX_CONF_HFILTER | - CAS_MAC_RX_CONF_PGRP); - + v = sc->sc_mac_rxcfg & ~(CAS_MAC_RX_CONF_HFILTER | + CAS_MAC_RX_CONF_EN); CAS_WRITE_4(sc, CAS_MAC_RX_CONF, v); CAS_BARRIER(sc, CAS_MAC_RX_CONF, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_HFILTER, 0)) - device_printf(sc->sc_dev, "cannot disable RX hash filter\n"); + if (!cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_HFILTER | + CAS_MAC_RX_CONF_EN, 0)) + device_printf(sc->sc_dev, + "cannot disable RX MAC or hash filter\n"); + v &= ~(CAS_MAC_RX_CONF_PROMISC | CAS_MAC_RX_CONF_PGRP); if ((ifp->if_flags & IFF_PROMISC) != 0) { v |= CAS_MAC_RX_CONF_PROMISC; goto chipit; @@ -2596,7 +2592,8 @@ cas_setladrf(struct cas_softc *sc) hash[i]); chipit: - CAS_WRITE_4(sc, CAS_MAC_RX_CONF, v); + sc->sc_mac_rxcfg = v; + CAS_WRITE_4(sc, CAS_MAC_RX_CONF, v | CAS_MAC_RX_CONF_EN); } static int cas_pci_attach(device_t dev); @@ -2697,7 +2694,10 @@ cas_pci_attach(device_t dev) return (ENXIO); } - pci_enable_busmaster(dev); + /* PCI configuration */ + pci_write_config(dev, PCIR_COMMAND, + pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_BUSMASTEREN | + PCIM_CMD_MWRICEN | PCIM_CMD_PERRESPEN | PCIM_CMD_SERRESPEN, 2); sc->sc_dev = dev; if (sc->sc_variant == CAS_CAS && pci_get_devid(dev) < 0x02) Modified: stable/8/sys/dev/cas/if_casvar.h ============================================================================== --- stable/8/sys/dev/cas/if_casvar.h Fri Mar 8 12:44:08 2013 (r248046) +++ stable/8/sys/dev/cas/if_casvar.h Fri Mar 8 12:44:40 2013 (r248047) @@ -196,6 +196,8 @@ struct cas_softc { u_int sc_rxcptr; /* next ready RX completion */ u_int sc_rxdptr; /* next ready RX descriptor */ + uint32_t sc_mac_rxcfg; /* RX MAC conf. % CAS_MAC_RX_CONF_EN */ + int sc_ifflags; }; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:50:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F820482; Fri, 8 Mar 2013 12:50:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 18138EE8; Fri, 8 Mar 2013 12:50:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CoTCs009028; Fri, 8 Mar 2013 12:50:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CoT1g009026; Fri, 8 Mar 2013 12:50:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081250.r28CoT1g009026@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:50:29 +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: r248048 - in stable/9/sys: conf sparc64/pci 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:50:30 -0000 Author: marius Date: Fri Mar 8 12:50:29 2013 New Revision: 248048 URL: http://svnweb.freebsd.org/changeset/base/248048 Log: MFC: r247600, r247620 - While Netra X1 generally show no ill effects when registering a power fail interrupt handler, there seems to be either a broken batch of them or a tendency to develop a defect which causes this interrupt to fire inadvertedly. Given that apart from this problem these machines work just fine, add a tunable allowing the setup of the power fail interrupt to be disabled. While at it, remove the DEBUGGER_ON_POWERFAIL compile time option and make that behavior also selectable via the newly added tunable. - Correct an incorrect argument to shutdown_nice(9). - Mark unused parameters as such. - Use NULL instead of 0 for pointers. Modified: stable/9/sys/conf/options.sparc64 stable/9/sys/sparc64/pci/psycho.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/options.sparc64 ============================================================================== --- stable/9/sys/conf/options.sparc64 Fri Mar 8 12:44:40 2013 (r248047) +++ stable/9/sys/conf/options.sparc64 Fri Mar 8 12:50:29 2013 (r248048) @@ -23,7 +23,6 @@ PSM_DEBUG opt_psm.h PSM_HOOKRESUME opt_psm.h PSM_RESETAFTERSUSPEND opt_psm.h -DEBUGGER_ON_POWERFAIL opt_psycho.h PSYCHO_DEBUG opt_psycho.h SCHIZO_DEBUG opt_schizo.h Modified: stable/9/sys/sparc64/pci/psycho.c ============================================================================== --- stable/9/sys/sparc64/pci/psycho.c Fri Mar 8 12:44:40 2013 (r248047) +++ stable/9/sys/sparc64/pci/psycho.c Fri Mar 8 12:50:29 2013 (r248048) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -94,7 +95,8 @@ static void psycho_intr_clear(void *); static driver_filter_t psycho_ue; static driver_filter_t psycho_ce; static driver_filter_t psycho_pci_bus; -static driver_filter_t psycho_powerfail; +static driver_filter_t psycho_powerdebug; +static driver_intr_t psycho_powerdown; static driver_intr_t psycho_overtemp; #ifdef PSYCHO_MAP_WAKEUP static driver_filter_t psycho_wakeup; @@ -159,9 +161,16 @@ static devclass_t psycho_devclass; DEFINE_CLASS_0(pcib, psycho_driver, psycho_methods, sizeof(struct psycho_softc)); -EARLY_DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, 0, 0, +EARLY_DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, NULL, NULL, BUS_PASS_BUS); +static SYSCTL_NODE(_hw, OID_AUTO, psycho, CTLFLAG_RD, 0, "psycho parameters"); + +static u_int psycho_powerfail = 1; +TUNABLE_INT("hw.psycho.powerfail", &psycho_powerfail); +SYSCTL_UINT(_hw_psycho, OID_AUTO, powerfail, CTLFLAG_RDTUN, &psycho_powerfail, + 0, "powerfail action (0: none, 1: shutdown (default), 2: debugger)"); + static SLIST_HEAD(, psycho_softc) psycho_softcs = SLIST_HEAD_INITIALIZER(psycho_softcs); @@ -612,13 +621,18 @@ psycho_attach(device_t dev) */ psycho_set_intr(sc, 1, PSR_UE_INT_MAP, psycho_ue, NULL); psycho_set_intr(sc, 2, PSR_CE_INT_MAP, psycho_ce, NULL); -#ifdef DEBUGGER_ON_POWERFAIL - psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, psycho_powerfail, - NULL); -#else - psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, NULL, - (driver_intr_t *)psycho_powerfail); -#endif + switch (psycho_powerfail) { + case 0: + break; + case 2: + psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, + psycho_powerdebug, NULL); + break; + default: + psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, NULL, + psycho_powerdown); + break; + } if (sc->sc_mode == PSYCHO_MODE_PSYCHO) { /* * Hummingbirds/Sabres do not have the following two @@ -629,8 +643,8 @@ psycho_attach(device_t dev) * The spare hardware interrupt is used for the * over-temperature interrupt. */ - psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, - NULL, psycho_overtemp); + psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, NULL, + psycho_overtemp); #ifdef PSYCHO_MAP_WAKEUP /* * psycho_wakeup() doesn't do anything useful right @@ -837,27 +851,28 @@ psycho_pci_bus(void *arg) } static int -psycho_powerfail(void *arg) +psycho_powerdebug(void *arg __unused) { -#ifdef DEBUGGER_ON_POWERFAIL - struct psycho_softc *sc = arg; kdb_enter(KDB_WHY_POWERFAIL, "powerfail"); -#else + return (FILTER_HANDLED); +} + +static void +psycho_powerdown(void *arg __unused) +{ static int shutdown; /* As the interrupt is cleared we may be called multiple times. */ if (shutdown != 0) - return (FILTER_HANDLED); + return; shutdown++; printf("Power Failure Detected: Shutting down NOW.\n"); - shutdown_nice(0); -#endif - return (FILTER_HANDLED); + shutdown_nice(RB_POWEROFF); } static void -psycho_overtemp(void *arg) +psycho_overtemp(void *arg __unused) { static int shutdown; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:50:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA55C483; Fri, 8 Mar 2013 12:50:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8DB90EEA; Fri, 8 Mar 2013 12:50:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CoW1b009071; Fri, 8 Mar 2013 12:50:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CoWDY009069; Fri, 8 Mar 2013 12:50:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081250.r28CoWDY009069@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:50:32 +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: r248049 - in stable/8/sys: conf sparc64/pci 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:50:32 -0000 Author: marius Date: Fri Mar 8 12:50:31 2013 New Revision: 248049 URL: http://svnweb.freebsd.org/changeset/base/248049 Log: MFC: r247600, r247620 - While Netra X1 generally show no ill effects when registering a power fail interrupt handler, there seems to be either a broken batch of them or a tendency to develop a defect which causes this interrupt to fire inadvertedly. Given that apart from this problem these machines work just fine, add a tunable allowing the setup of the power fail interrupt to be disabled. While at it, remove the DEBUGGER_ON_POWERFAIL compile time option and make that behavior also selectable via the newly added tunable. - Correct an incorrect argument to shutdown_nice(9). - Mark unused parameters as such. - Use NULL instead of 0 for pointers. Modified: stable/8/sys/conf/options.sparc64 stable/8/sys/sparc64/pci/psycho.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/conf/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/conf/options.sparc64 ============================================================================== --- stable/8/sys/conf/options.sparc64 Fri Mar 8 12:50:29 2013 (r248048) +++ stable/8/sys/conf/options.sparc64 Fri Mar 8 12:50:31 2013 (r248049) @@ -23,7 +23,6 @@ PSM_DEBUG opt_psm.h PSM_HOOKRESUME opt_psm.h PSM_RESETAFTERSUSPEND opt_psm.h -DEBUGGER_ON_POWERFAIL opt_psycho.h PSYCHO_DEBUG opt_psycho.h SCHIZO_DEBUG opt_schizo.h Modified: stable/8/sys/sparc64/pci/psycho.c ============================================================================== --- stable/8/sys/sparc64/pci/psycho.c Fri Mar 8 12:50:29 2013 (r248048) +++ stable/8/sys/sparc64/pci/psycho.c Fri Mar 8 12:50:31 2013 (r248049) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -94,7 +95,8 @@ static void psycho_intr_clear(void *); static driver_filter_t psycho_ue; static driver_filter_t psycho_ce; static driver_filter_t psycho_pci_bus; -static driver_filter_t psycho_powerfail; +static driver_filter_t psycho_powerdebug; +static driver_intr_t psycho_powerdown; static driver_intr_t psycho_overtemp; #ifdef PSYCHO_MAP_WAKEUP static driver_filter_t psycho_wakeup; @@ -159,9 +161,16 @@ static devclass_t psycho_devclass; DEFINE_CLASS_0(pcib, psycho_driver, psycho_methods, sizeof(struct psycho_softc)); -EARLY_DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, 0, 0, +EARLY_DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, NULL, NULL, BUS_PASS_BUS); +static SYSCTL_NODE(_hw, OID_AUTO, psycho, CTLFLAG_RD, 0, "psycho parameters"); + +static u_int psycho_powerfail = 1; +TUNABLE_INT("hw.psycho.powerfail", &psycho_powerfail); +SYSCTL_UINT(_hw_psycho, OID_AUTO, powerfail, CTLFLAG_RDTUN, &psycho_powerfail, + 0, "powerfail action (0: none, 1: shutdown (default), 2: debugger)"); + static SLIST_HEAD(, psycho_softc) psycho_softcs = SLIST_HEAD_INITIALIZER(psycho_softcs); @@ -612,13 +621,18 @@ psycho_attach(device_t dev) */ psycho_set_intr(sc, 1, PSR_UE_INT_MAP, psycho_ue, NULL); psycho_set_intr(sc, 2, PSR_CE_INT_MAP, psycho_ce, NULL); -#ifdef DEBUGGER_ON_POWERFAIL - psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, psycho_powerfail, - NULL); -#else - psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, NULL, - (driver_intr_t *)psycho_powerfail); -#endif + switch (psycho_powerfail) { + case 0: + break; + case 2: + psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, + psycho_powerdebug, NULL); + break; + default: + psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, NULL, + psycho_powerdown); + break; + } if (sc->sc_mode == PSYCHO_MODE_PSYCHO) { /* * Hummingbirds/Sabres do not have the following two @@ -629,8 +643,8 @@ psycho_attach(device_t dev) * The spare hardware interrupt is used for the * over-temperature interrupt. */ - psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, - NULL, psycho_overtemp); + psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, NULL, + psycho_overtemp); #ifdef PSYCHO_MAP_WAKEUP /* * psycho_wakeup() doesn't do anything useful right @@ -837,27 +851,28 @@ psycho_pci_bus(void *arg) } static int -psycho_powerfail(void *arg) +psycho_powerdebug(void *arg __unused) { -#ifdef DEBUGGER_ON_POWERFAIL - struct psycho_softc *sc = arg; kdb_enter(KDB_WHY_POWERFAIL, "powerfail"); -#else + return (FILTER_HANDLED); +} + +static void +psycho_powerdown(void *arg __unused) +{ static int shutdown; /* As the interrupt is cleared we may be called multiple times. */ if (shutdown != 0) - return (FILTER_HANDLED); + return; shutdown++; printf("Power Failure Detected: Shutting down NOW.\n"); - shutdown_nice(0); -#endif - return (FILTER_HANDLED); + shutdown_nice(RB_POWEROFF); } static void -psycho_overtemp(void *arg) +psycho_overtemp(void *arg __unused) { static int shutdown; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:52:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 52AAF76C; Fri, 8 Mar 2013 12:52:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A12EF01; Fri, 8 Mar 2013 12:52:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28Cqree009620; Fri, 8 Mar 2013 12:52:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CqrcC009619; Fri, 8 Mar 2013 12:52:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081252.r28CqrcC009619@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248050 - stable/9/sys/sparc64/sbus 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:52:53 -0000 Author: marius Date: Fri Mar 8 12:52:52 2013 New Revision: 248050 URL: http://svnweb.freebsd.org/changeset/base/248050 Log: MFC: r247601, r247621 - Correct an incorrect argument to shutdown_nice(9). - Mark unused parameters as such. - Use NULL instead of 0 for pointers. Modified: stable/9/sys/sparc64/sbus/sbus.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/9/sys/sparc64/sbus/sbus.c Fri Mar 8 12:50:31 2013 (r248049) +++ stable/9/sys/sparc64/sbus/sbus.c Fri Mar 8 12:52:52 2013 (r248050) @@ -199,7 +199,7 @@ static driver_t sbus_driver = { static devclass_t sbus_devclass; -EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0, +EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, NULL, NULL, BUS_PASS_BUS); MODULE_DEPEND(sbus, nexus, 1, 1, 1); MODULE_VERSION(sbus, 1); @@ -898,7 +898,7 @@ sbus_get_devinfo(device_t bus, device_t * The same needs to be done to PCI controller drivers. */ static void -sbus_overtemp(void *arg) +sbus_overtemp(void *arg __unused) { static int shutdown; @@ -912,7 +912,7 @@ sbus_overtemp(void *arg) /* Try to shut down in time in case of power failure. */ static void -sbus_pwrfail(void *arg) +sbus_pwrfail(void *arg __unused) { static int shutdown; @@ -921,7 +921,7 @@ sbus_pwrfail(void *arg) return; shutdown++; printf("Power failure detected\nShutting down NOW.\n"); - shutdown_nice(0); + shutdown_nice(RB_POWEROFF); } static int From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:52:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 083DC76E; Fri, 8 Mar 2013 12:52:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EEA74F03; Fri, 8 Mar 2013 12:52:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CqvRx009667; Fri, 8 Mar 2013 12:52:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28Cqvfu009666; Fri, 8 Mar 2013 12:52:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081252.r28Cqvfu009666@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:52:57 +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: r248051 - stable/8/sys/sparc64/sbus 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:52:58 -0000 Author: marius Date: Fri Mar 8 12:52:57 2013 New Revision: 248051 URL: http://svnweb.freebsd.org/changeset/base/248051 Log: MFC: r247601, r247621 - Correct an incorrect argument to shutdown_nice(9). - Mark unused parameters as such. - Use NULL instead of 0 for pointers. Modified: stable/8/sys/sparc64/sbus/sbus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/sbus.c Fri Mar 8 12:52:52 2013 (r248050) +++ stable/8/sys/sparc64/sbus/sbus.c Fri Mar 8 12:52:57 2013 (r248051) @@ -199,7 +199,7 @@ static driver_t sbus_driver = { static devclass_t sbus_devclass; -EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0, +EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, NULL, NULL, BUS_PASS_BUS); MODULE_DEPEND(sbus, nexus, 1, 1, 1); MODULE_VERSION(sbus, 1); @@ -898,7 +898,7 @@ sbus_get_devinfo(device_t bus, device_t * The same needs to be done to PCI controller drivers. */ static void -sbus_overtemp(void *arg) +sbus_overtemp(void *arg __unused) { static int shutdown; @@ -912,7 +912,7 @@ sbus_overtemp(void *arg) /* Try to shut down in time in case of power failure. */ static void -sbus_pwrfail(void *arg) +sbus_pwrfail(void *arg __unused) { static int shutdown; @@ -921,7 +921,7 @@ sbus_pwrfail(void *arg) return; shutdown++; printf("Power failure detected\nShutting down NOW.\n"); - shutdown_nice(0); + shutdown_nice(RB_POWEROFF); } static int From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:57:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5BE86DEB; Fri, 8 Mar 2013 12:57:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 34AC8F3B; Fri, 8 Mar 2013 12:57:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CvxYP010663; Fri, 8 Mar 2013 12:57:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28Cvx7J010662; Fri, 8 Mar 2013 12:57:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081257.r28Cvx7J010662@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248052 - stable/9/sys/dev/pci 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:57:59 -0000 Author: marius Date: Fri Mar 8 12:57:58 2013 New Revision: 248052 URL: http://svnweb.freebsd.org/changeset/base/248052 Log: MFC: r247632 - Complete r231621 (MFC'ed to stable/9 in r232092) by also blacklisting the bridge used by VMware for PCIe devices. While at it, update the comment now that we know that MSI-X doesn't work with ESXi 5.1 for Intel 82576 either and the underlying issue is a bug in the MSI-X allocation code of the hypervisor. Reported by: Harald Schmalzbauer - Make the nomatch table const. Modified: stable/9/sys/dev/pci/pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Fri Mar 8 12:52:57 2013 (r248051) +++ stable/9/sys/dev/pci/pci.c Fri Mar 8 12:57:58 2013 (r248052) @@ -243,10 +243,11 @@ static const struct pci_quirk pci_quirks { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* - * MSI-X doesn't work with at least LSI SAS1068E passed through by - * VMware. + * MSI-X allocation doesn't work properly for devices passed through + * by VMware up to at least ESXi 5.1. */ - { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCI/PCI-X */ + { 0x07a015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCIe */ /* * Some virtualization environments emulate an older chipset @@ -3572,11 +3573,11 @@ pci_print_child(device_t dev, device_t c return (retval); } -static struct +static const struct { - int class; - int subclass; - char *desc; + int class; + int subclass; + const char *desc; } pci_nomatch_tab[] = { {PCIC_OLD, -1, "old"}, {PCIC_OLD, PCIS_OLD_NONVGA, "non-VGA display device"}, @@ -3668,8 +3669,9 @@ static struct void pci_probe_nomatch(device_t dev, device_t child) { - int i; - char *cp, *scp, *device; + int i; + const char *cp, *scp; + char *device; /* * Look for a listing for this device in a loaded device database. @@ -3702,7 +3704,6 @@ pci_probe_nomatch(device_t dev, device_t printf(" at device %d.%d (no driver attached)\n", pci_get_slot(child), pci_get_function(child)); pci_cfg_save(child, device_get_ivars(child), 1); - return; } /* From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:58:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 53177F8E; Fri, 8 Mar 2013 12:58:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D380F45; Fri, 8 Mar 2013 12:58:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28CwQM5010781; Fri, 8 Mar 2013 12:58:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28CwQvk010780; Fri, 8 Mar 2013 12:58:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081258.r28CwQvk010780@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:58:26 +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: r248053 - stable/8/sys/dev/pci 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:58:26 -0000 Author: marius Date: Fri Mar 8 12:58:25 2013 New Revision: 248053 URL: http://svnweb.freebsd.org/changeset/base/248053 Log: - Complete r231621 (MFC'ed to stable/8 in r232093) by also blacklisting the bridge used by VMware for PCIe devices. While at it, update the comment now that we know that MSI-X doesn't work with ESXi 5.1 for Intel 82576 either and the underlying issue is a bug in the MSI-X allocation code of the hypervisor. Reported by: Harald Schmalzbauer - Make the nomatch table const. Modified: stable/8/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Fri Mar 8 12:57:58 2013 (r248052) +++ stable/8/sys/dev/pci/pci.c Fri Mar 8 12:58:25 2013 (r248053) @@ -249,10 +249,11 @@ static const struct pci_quirk pci_quirks { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* - * MSI-X doesn't work with at least LSI SAS1068E passed through by - * VMware. + * MSI-X allocation doesn't work properly for devices passed through + * by VMware up to at least ESXi 5.1. */ - { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCI/PCI-X */ + { 0x07a015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCIe */ /* * Some virtualization environments emulate an older chipset @@ -3479,11 +3480,11 @@ pci_print_child(device_t dev, device_t c return (retval); } -static struct +static const struct { - int class; - int subclass; - char *desc; + int class; + int subclass; + const char *desc; } pci_nomatch_tab[] = { {PCIC_OLD, -1, "old"}, {PCIC_OLD, PCIS_OLD_NONVGA, "non-VGA display device"}, @@ -3575,8 +3576,9 @@ static struct void pci_probe_nomatch(device_t dev, device_t child) { - int i; - char *cp, *scp, *device; + int i; + const char *cp, *scp; + char *device; /* * Look for a listing for this device in a loaded device database. @@ -3609,7 +3611,6 @@ pci_probe_nomatch(device_t dev, device_t printf(" at device %d.%d (no driver attached)\n", pci_get_slot(child), pci_get_function(child)); pci_cfg_save(child, device_get_ivars(child), 1); - return; } /* From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 12:59:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30884292; Fri, 8 Mar 2013 12:59:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 060B1F5E; Fri, 8 Mar 2013 12:59:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28Cx6Vd010906; Fri, 8 Mar 2013 12:59:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28Cx61v010905; Fri, 8 Mar 2013 12:59:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081259.r28Cx61v010905@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 12:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r248054 - stable/7/sys/dev/pci X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 12:59:07 -0000 Author: marius Date: Fri Mar 8 12:59:06 2013 New Revision: 248054 URL: http://svnweb.freebsd.org/changeset/base/248054 Log: MFC: r247632 - Complete r231621 (MFC'ed to stable/7 in r232094) by also blacklisting the bridge used by VMware for PCIe devices. While at it, update the comment now that we know that MSI-X doesn't work with ESXi 5.1 for Intel 82576 either and the underlying issue is a bug in the MSI-X allocation code of the hypervisor. Reported by: Harald Schmalzbauer - Make the nomatch table const. Modified: stable/7/sys/dev/pci/pci.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Fri Mar 8 12:58:25 2013 (r248053) +++ stable/7/sys/dev/pci/pci.c Fri Mar 8 12:59:06 2013 (r248054) @@ -215,10 +215,11 @@ static const struct pci_quirk const pci_ { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* - * MSI-X doesn't work with at least LSI SAS1068E passed through by - * VMware. + * MSI-X allocation doesn't work properly for devices passed through + * by VMware up to at least ESXi 5.1. */ - { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCI/PCI-X */ + { 0x07a015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCIe */ /* * Some virtualization environments emulate an older chipset @@ -3053,11 +3054,11 @@ pci_print_child(device_t dev, device_t c return (retval); } -static struct +static const struct { - int class; - int subclass; - char *desc; + int class; + int subclass; + const char *desc; } pci_nomatch_tab[] = { {PCIC_OLD, -1, "old"}, {PCIC_OLD, PCIS_OLD_NONVGA, "non-VGA display device"}, @@ -3149,8 +3150,9 @@ static struct void pci_probe_nomatch(device_t dev, device_t child) { - int i; - char *cp, *scp, *device; + int i; + const char *cp, *scp; + char *device; /* * Look for a listing for this device in a loaded device database. @@ -3183,7 +3185,6 @@ pci_probe_nomatch(device_t dev, device_t printf(" at device %d.%d (no driver attached)\n", pci_get_slot(child), pci_get_function(child)); pci_cfg_save(child, (struct pci_devinfo *)device_get_ivars(child), 1); - return; } /* From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 13:11:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6920C81C; Fri, 8 Mar 2013 13:11:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B961FD9; Fri, 8 Mar 2013 13:11:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28DBkkR016523; Fri, 8 Mar 2013 13:11:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28DBjdH016521; Fri, 8 Mar 2013 13:11:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303081311.r28DBjdH016521@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Mar 2013 13:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248055 - in head: . sys/sparc64/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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 13:11:46 -0000 Author: marius Date: Fri Mar 8 13:11:45 2013 New Revision: 248055 URL: http://svnweb.freebsd.org/changeset/base/248055 Log: Merge r247814 from x86 modulo whitespace bug: Turn on the CTL disable tunable by default. This will allow GENERIC configurations to boot on small memory boxes, but not require end users who want to use CTL to recompile their kernel. They can simply set kern.cam.ctl.disable=0 in loader.conf. Modified: head/UPDATING head/sys/sparc64/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Mar 8 12:59:06 2013 (r248054) +++ head/UPDATING Fri Mar 8 13:11:45 2013 (r248055) @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130308: + CTL_DISABLE has also been added to the sparc64 GENERIC (for further + information, see the respective 20130304 entry). + 20130304: Recent commits to callout(9) changed the size of struct callout, so the KBI is probably heavily disturbed. Also, some functions Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Mar 8 12:59:06 2013 (r248054) +++ head/sys/sparc64/conf/GENERIC Fri Mar 8 13:11:45 2013 (r248055) @@ -122,6 +122,9 @@ device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) device ctl # CAM Target Layer +options CTL_DISABLE # Disable CTL by default to save memory. + # Re-enable with kern.cam.ctl.disable=0 in + # /boot/loader.conf # RAID controllers #device amr # AMI MegaRAID From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 17:28:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19D05543; Fri, 8 Mar 2013 17:28:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DCFF7790; Fri, 8 Mar 2013 17:28:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28HSgN8094480; Fri, 8 Mar 2013 17:28:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28HSfOB094471; Fri, 8 Mar 2013 17:28:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303081728.r28HSfOB094471@svn.freebsd.org> From: Xin LI Date: Fri, 8 Mar 2013 17:28:41 +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: r248057 - in stable/8: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/ec crypto/openssl/crypto/ecdh crypto/openssl/crypto/ecds... 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 17:28:43 -0000 Author: delphij Date: Fri Mar 8 17:28:40 2013 New Revision: 248057 URL: http://svnweb.freebsd.org/changeset/base/248057 Log: Merge OpenSSL 0.9.8y. This is a direct commit to stable/8 as HEAD is on a different release now. Added: stable/8/crypto/openssl/ssl/s3_cbc.c - copied unchanged from r247958, vendor-crypto/openssl/dist-0.9.8/ssl/s3_cbc.c Modified: stable/8/crypto/openssl/CHANGES stable/8/crypto/openssl/Configure stable/8/crypto/openssl/FAQ stable/8/crypto/openssl/Makefile stable/8/crypto/openssl/NEWS stable/8/crypto/openssl/README stable/8/crypto/openssl/apps/Makefile stable/8/crypto/openssl/apps/apps.c stable/8/crypto/openssl/apps/dhparam.c stable/8/crypto/openssl/apps/s_server.c stable/8/crypto/openssl/crypto/asn1/a_strex.c stable/8/crypto/openssl/crypto/asn1/a_verify.c stable/8/crypto/openssl/crypto/asn1/x_pubkey.c stable/8/crypto/openssl/crypto/cryptlib.c stable/8/crypto/openssl/crypto/crypto.h stable/8/crypto/openssl/crypto/ec/ec.h stable/8/crypto/openssl/crypto/ec/ec_key.c stable/8/crypto/openssl/crypto/ecdh/ech_lib.c stable/8/crypto/openssl/crypto/ecdsa/ecs_lib.c stable/8/crypto/openssl/crypto/o_init.c stable/8/crypto/openssl/crypto/ocsp/ocsp_vfy.c stable/8/crypto/openssl/crypto/opensslv.h stable/8/crypto/openssl/crypto/rsa/rsa_oaep.c stable/8/crypto/openssl/crypto/symhacks.h stable/8/crypto/openssl/doc/apps/CA.pl.pod stable/8/crypto/openssl/engines/e_capi.c stable/8/crypto/openssl/openssl.spec stable/8/crypto/openssl/ssl/Makefile stable/8/crypto/openssl/ssl/d1_enc.c stable/8/crypto/openssl/ssl/d1_pkt.c stable/8/crypto/openssl/ssl/s2_clnt.c stable/8/crypto/openssl/ssl/s2_pkt.c stable/8/crypto/openssl/ssl/s3_both.c stable/8/crypto/openssl/ssl/s3_clnt.c stable/8/crypto/openssl/ssl/s3_enc.c stable/8/crypto/openssl/ssl/s3_pkt.c stable/8/crypto/openssl/ssl/s3_srvr.c stable/8/crypto/openssl/ssl/ssl.h stable/8/crypto/openssl/ssl/ssl3.h stable/8/crypto/openssl/ssl/ssl_err.c stable/8/crypto/openssl/ssl/ssl_lib.c stable/8/crypto/openssl/ssl/ssl_locl.h stable/8/crypto/openssl/ssl/t1_enc.c stable/8/crypto/openssl/ssl/t1_lib.c stable/8/crypto/openssl/util/libeay.num stable/8/secure/lib/libcrypto/Makefile.inc stable/8/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/8/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/8/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/8/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/8/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/8/secure/lib/libcrypto/man/BIO_ctrl.3 stable/8/secure/lib/libcrypto/man/BIO_f_base64.3 stable/8/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/8/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/8/secure/lib/libcrypto/man/BIO_f_md.3 stable/8/secure/lib/libcrypto/man/BIO_f_null.3 stable/8/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/8/secure/lib/libcrypto/man/BIO_find_type.3 stable/8/secure/lib/libcrypto/man/BIO_new.3 stable/8/secure/lib/libcrypto/man/BIO_push.3 stable/8/secure/lib/libcrypto/man/BIO_read.3 stable/8/secure/lib/libcrypto/man/BIO_s_accept.3 stable/8/secure/lib/libcrypto/man/BIO_s_bio.3 stable/8/secure/lib/libcrypto/man/BIO_s_connect.3 stable/8/secure/lib/libcrypto/man/BIO_s_fd.3 stable/8/secure/lib/libcrypto/man/BIO_s_file.3 stable/8/secure/lib/libcrypto/man/BIO_s_mem.3 stable/8/secure/lib/libcrypto/man/BIO_s_null.3 stable/8/secure/lib/libcrypto/man/BIO_s_socket.3 stable/8/secure/lib/libcrypto/man/BIO_set_callback.3 stable/8/secure/lib/libcrypto/man/BIO_should_retry.3 stable/8/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/8/secure/lib/libcrypto/man/BN_CTX_new.3 stable/8/secure/lib/libcrypto/man/BN_CTX_start.3 stable/8/secure/lib/libcrypto/man/BN_add.3 stable/8/secure/lib/libcrypto/man/BN_add_word.3 stable/8/secure/lib/libcrypto/man/BN_bn2bin.3 stable/8/secure/lib/libcrypto/man/BN_cmp.3 stable/8/secure/lib/libcrypto/man/BN_copy.3 stable/8/secure/lib/libcrypto/man/BN_generate_prime.3 stable/8/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/8/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/8/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/8/secure/lib/libcrypto/man/BN_new.3 stable/8/secure/lib/libcrypto/man/BN_num_bytes.3 stable/8/secure/lib/libcrypto/man/BN_rand.3 stable/8/secure/lib/libcrypto/man/BN_set_bit.3 stable/8/secure/lib/libcrypto/man/BN_swap.3 stable/8/secure/lib/libcrypto/man/BN_zero.3 stable/8/secure/lib/libcrypto/man/CONF_modules_free.3 stable/8/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/8/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/8/secure/lib/libcrypto/man/DH_generate_key.3 stable/8/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/8/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/8/secure/lib/libcrypto/man/DH_new.3 stable/8/secure/lib/libcrypto/man/DH_set_method.3 stable/8/secure/lib/libcrypto/man/DH_size.3 stable/8/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/8/secure/lib/libcrypto/man/DSA_do_sign.3 stable/8/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/8/secure/lib/libcrypto/man/DSA_generate_key.3 stable/8/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/8/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/8/secure/lib/libcrypto/man/DSA_new.3 stable/8/secure/lib/libcrypto/man/DSA_set_method.3 stable/8/secure/lib/libcrypto/man/DSA_sign.3 stable/8/secure/lib/libcrypto/man/DSA_size.3 stable/8/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/8/secure/lib/libcrypto/man/ERR_clear_error.3 stable/8/secure/lib/libcrypto/man/ERR_error_string.3 stable/8/secure/lib/libcrypto/man/ERR_get_error.3 stable/8/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/8/secure/lib/libcrypto/man/ERR_load_strings.3 stable/8/secure/lib/libcrypto/man/ERR_print_errors.3 stable/8/secure/lib/libcrypto/man/ERR_put_error.3 stable/8/secure/lib/libcrypto/man/ERR_remove_state.3 stable/8/secure/lib/libcrypto/man/ERR_set_mark.3 stable/8/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/8/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/8/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/8/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/8/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/8/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/8/secure/lib/libcrypto/man/EVP_SealInit.3 stable/8/secure/lib/libcrypto/man/EVP_SignInit.3 stable/8/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/8/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/8/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/8/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/8/secure/lib/libcrypto/man/OPENSSL_config.3 stable/8/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/8/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/8/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/8/secure/lib/libcrypto/man/PKCS12_create.3 stable/8/secure/lib/libcrypto/man/PKCS12_parse.3 stable/8/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/8/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/8/secure/lib/libcrypto/man/PKCS7_sign.3 stable/8/secure/lib/libcrypto/man/PKCS7_verify.3 stable/8/secure/lib/libcrypto/man/RAND_add.3 stable/8/secure/lib/libcrypto/man/RAND_bytes.3 stable/8/secure/lib/libcrypto/man/RAND_cleanup.3 stable/8/secure/lib/libcrypto/man/RAND_egd.3 stable/8/secure/lib/libcrypto/man/RAND_load_file.3 stable/8/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/8/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/8/secure/lib/libcrypto/man/RSA_check_key.3 stable/8/secure/lib/libcrypto/man/RSA_generate_key.3 stable/8/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/8/secure/lib/libcrypto/man/RSA_new.3 stable/8/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/8/secure/lib/libcrypto/man/RSA_print.3 stable/8/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/8/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/8/secure/lib/libcrypto/man/RSA_set_method.3 stable/8/secure/lib/libcrypto/man/RSA_sign.3 stable/8/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/8/secure/lib/libcrypto/man/RSA_size.3 stable/8/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/8/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/8/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/8/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/8/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/8/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/8/secure/lib/libcrypto/man/X509_new.3 stable/8/secure/lib/libcrypto/man/bio.3 stable/8/secure/lib/libcrypto/man/blowfish.3 stable/8/secure/lib/libcrypto/man/bn.3 stable/8/secure/lib/libcrypto/man/bn_internal.3 stable/8/secure/lib/libcrypto/man/buffer.3 stable/8/secure/lib/libcrypto/man/crypto.3 stable/8/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/8/secure/lib/libcrypto/man/d2i_DHparams.3 stable/8/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/8/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/8/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/8/secure/lib/libcrypto/man/d2i_X509.3 stable/8/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/8/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/8/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/8/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/8/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/8/secure/lib/libcrypto/man/des.3 stable/8/secure/lib/libcrypto/man/dh.3 stable/8/secure/lib/libcrypto/man/dsa.3 stable/8/secure/lib/libcrypto/man/ecdsa.3 stable/8/secure/lib/libcrypto/man/engine.3 stable/8/secure/lib/libcrypto/man/err.3 stable/8/secure/lib/libcrypto/man/evp.3 stable/8/secure/lib/libcrypto/man/hmac.3 stable/8/secure/lib/libcrypto/man/lh_stats.3 stable/8/secure/lib/libcrypto/man/lhash.3 stable/8/secure/lib/libcrypto/man/md5.3 stable/8/secure/lib/libcrypto/man/mdc2.3 stable/8/secure/lib/libcrypto/man/pem.3 stable/8/secure/lib/libcrypto/man/rand.3 stable/8/secure/lib/libcrypto/man/rc4.3 stable/8/secure/lib/libcrypto/man/ripemd.3 stable/8/secure/lib/libcrypto/man/rsa.3 stable/8/secure/lib/libcrypto/man/sha.3 stable/8/secure/lib/libcrypto/man/threads.3 stable/8/secure/lib/libcrypto/man/ui.3 stable/8/secure/lib/libcrypto/man/ui_compat.3 stable/8/secure/lib/libcrypto/man/x509.3 stable/8/secure/lib/libssl/Makefile stable/8/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/8/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/8/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/8/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/8/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/8/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/8/secure/lib/libssl/man/SSL_CTX_free.3 stable/8/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/8/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/8/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/8/secure/lib/libssl/man/SSL_CTX_new.3 stable/8/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/8/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/8/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/8/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/8/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/8/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/8/secure/lib/libssl/man/SSL_SESSION_free.3 stable/8/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/8/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/8/secure/lib/libssl/man/SSL_accept.3 stable/8/secure/lib/libssl/man/SSL_alert_type_string.3 stable/8/secure/lib/libssl/man/SSL_clear.3 stable/8/secure/lib/libssl/man/SSL_connect.3 stable/8/secure/lib/libssl/man/SSL_do_handshake.3 stable/8/secure/lib/libssl/man/SSL_free.3 stable/8/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/8/secure/lib/libssl/man/SSL_get_ciphers.3 stable/8/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/8/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/8/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/8/secure/lib/libssl/man/SSL_get_error.3 stable/8/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/8/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/8/secure/lib/libssl/man/SSL_get_fd.3 stable/8/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/8/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/8/secure/lib/libssl/man/SSL_get_rbio.3 stable/8/secure/lib/libssl/man/SSL_get_session.3 stable/8/secure/lib/libssl/man/SSL_get_verify_result.3 stable/8/secure/lib/libssl/man/SSL_get_version.3 stable/8/secure/lib/libssl/man/SSL_library_init.3 stable/8/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/8/secure/lib/libssl/man/SSL_new.3 stable/8/secure/lib/libssl/man/SSL_pending.3 stable/8/secure/lib/libssl/man/SSL_read.3 stable/8/secure/lib/libssl/man/SSL_rstate_string.3 stable/8/secure/lib/libssl/man/SSL_session_reused.3 stable/8/secure/lib/libssl/man/SSL_set_bio.3 stable/8/secure/lib/libssl/man/SSL_set_connect_state.3 stable/8/secure/lib/libssl/man/SSL_set_fd.3 stable/8/secure/lib/libssl/man/SSL_set_session.3 stable/8/secure/lib/libssl/man/SSL_set_shutdown.3 stable/8/secure/lib/libssl/man/SSL_set_verify_result.3 stable/8/secure/lib/libssl/man/SSL_shutdown.3 stable/8/secure/lib/libssl/man/SSL_state_string.3 stable/8/secure/lib/libssl/man/SSL_want.3 stable/8/secure/lib/libssl/man/SSL_write.3 stable/8/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/8/secure/lib/libssl/man/ssl.3 stable/8/secure/usr.bin/openssl/man/CA.pl.1 stable/8/secure/usr.bin/openssl/man/asn1parse.1 stable/8/secure/usr.bin/openssl/man/ca.1 stable/8/secure/usr.bin/openssl/man/ciphers.1 stable/8/secure/usr.bin/openssl/man/crl.1 stable/8/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/8/secure/usr.bin/openssl/man/dgst.1 stable/8/secure/usr.bin/openssl/man/dhparam.1 stable/8/secure/usr.bin/openssl/man/dsa.1 stable/8/secure/usr.bin/openssl/man/dsaparam.1 stable/8/secure/usr.bin/openssl/man/ec.1 stable/8/secure/usr.bin/openssl/man/ecparam.1 stable/8/secure/usr.bin/openssl/man/enc.1 stable/8/secure/usr.bin/openssl/man/errstr.1 stable/8/secure/usr.bin/openssl/man/gendsa.1 stable/8/secure/usr.bin/openssl/man/genrsa.1 stable/8/secure/usr.bin/openssl/man/nseq.1 stable/8/secure/usr.bin/openssl/man/ocsp.1 stable/8/secure/usr.bin/openssl/man/openssl.1 stable/8/secure/usr.bin/openssl/man/passwd.1 stable/8/secure/usr.bin/openssl/man/pkcs12.1 stable/8/secure/usr.bin/openssl/man/pkcs7.1 stable/8/secure/usr.bin/openssl/man/pkcs8.1 stable/8/secure/usr.bin/openssl/man/rand.1 stable/8/secure/usr.bin/openssl/man/req.1 stable/8/secure/usr.bin/openssl/man/rsa.1 stable/8/secure/usr.bin/openssl/man/rsautl.1 stable/8/secure/usr.bin/openssl/man/s_client.1 stable/8/secure/usr.bin/openssl/man/s_server.1 stable/8/secure/usr.bin/openssl/man/s_time.1 stable/8/secure/usr.bin/openssl/man/sess_id.1 stable/8/secure/usr.bin/openssl/man/smime.1 stable/8/secure/usr.bin/openssl/man/speed.1 stable/8/secure/usr.bin/openssl/man/spkac.1 stable/8/secure/usr.bin/openssl/man/verify.1 stable/8/secure/usr.bin/openssl/man/version.1 stable/8/secure/usr.bin/openssl/man/x509.1 stable/8/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: stable/8/crypto/openssl/ (props changed) Modified: stable/8/crypto/openssl/CHANGES ============================================================================== --- stable/8/crypto/openssl/CHANGES Fri Mar 8 15:01:40 2013 (r248056) +++ stable/8/crypto/openssl/CHANGES Fri Mar 8 17:28:40 2013 (r248057) @@ -2,6 +2,35 @@ OpenSSL CHANGES _______________ + Changes between 0.9.8x and 0.9.8y [5 Feb 2013] + + *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time. + + This addresses the flaw in CBC record processing discovered by + Nadhem Alfardan and Kenny Paterson. Details of this attack can be found + at: http://www.isg.rhul.ac.uk/tls/ + + Thanks go to Nadhem Alfardan and Kenny Paterson of the Information + Security Group at Royal Holloway, University of London + (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and + Emilia Käsper for the initial patch. + (CVE-2013-0169) + [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson] + + *) Return an error when checking OCSP signatures when key is NULL. + This fixes a DoS attack. (CVE-2013-0166) + [Steve Henson] + + *) Call OCSP Stapling callback after ciphersuite has been chosen, so + the right response is stapled. Also change SSL_get_certificate() + so it returns the certificate actually sent. + See http://rt.openssl.org/Ticket/Display.html?id=2836. + (This is a backport) + [Rob Stradling ] + + *) Fix possible deadlock when decoding public keys. + [Steve Henson] + Changes between 0.9.8w and 0.9.8x [10 May 2012] *) Sanity check record length before skipping explicit IV in DTLS Modified: stable/8/crypto/openssl/Configure ============================================================================== --- stable/8/crypto/openssl/Configure Fri Mar 8 15:01:40 2013 (r248056) +++ stable/8/crypto/openssl/Configure Fri Mar 8 17:28:40 2013 (r248057) @@ -162,6 +162,7 @@ my %table=( "debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", "debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", "debug-ben-debug", "gcc:$gcc_devteam_warn -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -ggdb3 -O2 -pipe::(unknown)::::::", +"debug-ben-debug-64", "gcc:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-ben-debug-noopt", "gcc:$gcc_devteam_warn -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -ggdb3 -pipe::(unknown)::::::", "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", @@ -172,10 +173,10 @@ my %table=( "debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -m32 -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", "debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT:${no_asm}:dlfcn:linux-shared", -"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-geoff","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", "debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", @@ -428,8 +429,8 @@ my %table=( "aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64", # Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE # at build time. $OBJECT_MODE is respected at ./config stage! -"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", -"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", +"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", +"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", # # Cray T90 and similar (SDSC) Modified: stable/8/crypto/openssl/FAQ ============================================================================== --- stable/8/crypto/openssl/FAQ Fri Mar 8 15:01:40 2013 (r248056) +++ stable/8/crypto/openssl/FAQ Fri Mar 8 17:28:40 2013 (r248057) @@ -83,7 +83,7 @@ OpenSSL - Frequently Asked Questions * Which is the current version of OpenSSL? The current version is available from . -OpenSSL 1.0.1c was released on May 10th, 2012. +OpenSSL 1.0.1d was released on Feb 5th, 2013. In addition to the current stable release, you can also access daily snapshots of the OpenSSL development version at Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5767639C; Fri, 8 Mar 2013 18:07:44 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F579ABF; Fri, 8 Mar 2013 18:07:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28I7iBG006738; Fri, 8 Mar 2013 18:07:44 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28I7id2006737; Fri, 8 Mar 2013 18:07:44 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201303081807.r28I7id2006737@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Fri, 8 Mar 2013 18:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248058 - head/sys/geom/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:07:44 -0000 Author: dumbbell Date: Fri Mar 8 18:07:43 2013 New Revision: 248058 URL: http://svnweb.freebsd.org/changeset/base/248058 Log: g_label_ntfs_taste: Abort taste is recsize == 0 This will avoid a 0-byte read (in g_read_data()) leading to a panic, if previously read data are erroneous. Suggested by: John-Mark Gurney Modified: head/sys/geom/label/g_label_ntfs.c Modified: head/sys/geom/label/g_label_ntfs.c ============================================================================== --- head/sys/geom/label/g_label_ntfs.c Fri Mar 8 17:28:40 2013 (r248057) +++ head/sys/geom/label/g_label_ntfs.c Fri Mar 8 18:07:43 2013 (r248058) @@ -115,7 +115,7 @@ g_label_ntfs_taste(struct g_consumer *cp mftrecsz = (char)bf->bf_mftrecsz; recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); - if (recsize % pp->sectorsize != 0) + if (recsize == 0 || recsize % pp->sectorsize != 0) goto done; voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps + From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 18:08:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8B4A522; Fri, 8 Mar 2013 18:08:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AB79FAD0; Fri, 8 Mar 2013 18:08:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28I8D1D006877; Fri, 8 Mar 2013 18:08:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28I8D9H006872; Fri, 8 Mar 2013 18:08:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303081808.r28I8D9H006872@svn.freebsd.org> From: Xin LI Date: Fri, 8 Mar 2013 18:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248059 - head/sys/dev/oce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:08:13 -0000 Author: delphij Date: Fri Mar 8 18:08:12 2013 New Revision: 248059 URL: http://svnweb.freebsd.org/changeset/base/248059 Log: Eliminate excessive $FreeBSD$ headers. Noticed by: jmallett Modified: head/sys/dev/oce/oce_hw.h head/sys/dev/oce/oce_sysctl.c Modified: head/sys/dev/oce/oce_hw.h ============================================================================== --- head/sys/dev/oce/oce_hw.h Fri Mar 8 18:07:43 2013 (r248058) +++ head/sys/dev/oce/oce_hw.h Fri Mar 8 18:08:12 2013 (r248059) @@ -38,8 +38,6 @@ /* $FreeBSD$ */ -/* $FreeBSD$ */ - #include #undef _BIG_ENDIAN /* TODO */ Modified: head/sys/dev/oce/oce_sysctl.c ============================================================================== --- head/sys/dev/oce/oce_sysctl.c Fri Mar 8 18:07:43 2013 (r248058) +++ head/sys/dev/oce/oce_sysctl.c Fri Mar 8 18:08:12 2013 (r248059) @@ -38,8 +38,6 @@ /* $FreeBSD$ */ -/* $FreeBSD$ */ - #include "oce_if.h" From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 18:11:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 684D875C; Fri, 8 Mar 2013 18:11:03 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC89B33; Fri, 8 Mar 2013 18:11:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28IB3J2009021; Fri, 8 Mar 2013 18:11:03 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28IB2JI009017; Fri, 8 Mar 2013 18:11:02 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201303081811.r28IB2JI009017@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Fri, 8 Mar 2013 18:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248060 - in head/sys/dev/drm2: . ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:11:03 -0000 Author: dumbbell Date: Fri Mar 8 18:11:02 2013 New Revision: 248060 URL: http://svnweb.freebsd.org/changeset/base/248060 Log: drm: Fix a call to free(9) with an incorrect malloc type While here, the call to free(9) is moved to drm_global.c, near the initial malloc(9). Reviewed by: Konstantin Belousov (kib@) Modified: head/sys/dev/drm2/drm_global.c head/sys/dev/drm2/ttm/ttm_bo.c head/sys/dev/drm2/ttm/ttm_memory.c Modified: head/sys/dev/drm2/drm_global.c ============================================================================== --- head/sys/dev/drm2/drm_global.c Fri Mar 8 18:08:12 2013 (r248059) +++ head/sys/dev/drm2/drm_global.c Fri Mar 8 18:11:02 2013 (r248060) @@ -104,6 +104,7 @@ void drm_global_item_unref(struct drm_gl MPASS(ref->object == item->object); if (--item->refcount == 0) { ref->release(ref); + free(item->object, M_DRM_GLOBAL); item->object = NULL; } sx_xunlock(&item->mutex); Modified: head/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo.c Fri Mar 8 18:08:12 2013 (r248059) +++ head/sys/dev/drm2/ttm/ttm_bo.c Fri Mar 8 18:11:02 2013 (r248060) @@ -1400,7 +1400,6 @@ static void ttm_bo_global_kobj_release(s ttm_mem_unregister_shrink(glob->mem_glob, &glob->shrink); vm_page_free(glob->dummy_read_page); - free(glob, M_DRM_GLOBAL); } void ttm_bo_global_release(struct drm_global_reference *ref) Modified: head/sys/dev/drm2/ttm/ttm_memory.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_memory.c Fri Mar 8 18:08:12 2013 (r248059) +++ head/sys/dev/drm2/ttm/ttm_memory.c Fri Mar 8 18:11:02 2013 (r248060) @@ -125,8 +125,6 @@ static ssize_t ttm_mem_zone_store(struct static void ttm_mem_global_kobj_release(struct ttm_mem_global *glob) { - - free(glob, M_TTM_ZONE); } static bool ttm_zones_above_swap_target(struct ttm_mem_global *glob, From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 18:14:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 527A3A53 for ; Fri, 8 Mar 2013 18:14:52 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-oa0-f53.google.com (mail-oa0-f53.google.com [209.85.219.53]) by mx1.freebsd.org (Postfix) with ESMTP id 1DEF5BEC for ; Fri, 8 Mar 2013 18:14:51 +0000 (UTC) Received: by mail-oa0-f53.google.com with SMTP id m1so2341050oag.26 for ; Fri, 08 Mar 2013 10:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=TjCuDfxHyrg03Jk28/ieQzvJh8LUmDfPaRlTWaxsiwo=; b=qGCSYGO36r5Pxxc8Iy2rCzUQ8Xb45s6mjgppgxf1Zi1Nh5cayFzP9JNQ8TjXzGKCp9 IgAyQhD1HXq/35erytU6vIij8Pa1/++uyo/cjxYNsquH4JSO6hGx4cl5DsdEAYC8ZBYa txuyxgxwbuOY59Op8ftd9fPh/qq+y+DsGvZVs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=TjCuDfxHyrg03Jk28/ieQzvJh8LUmDfPaRlTWaxsiwo=; b=SIs/AlHtZeyBF7ANGhtb7HbhhZl5YWiVmWHgy/ymKW2BSzxuYzEk8CEUaAyjmey9Gr Co7axRoGJUanBM3VORQL5unTYCtAjn+wfD2JLo7f0IrhM20xhufR155XP2LkGmg4/jPL oMJ7RbuRQ5z3TAIYxlm7k3qd74FTnJsZDwg5HSp/ThXu3iGQaPQH1ToAu9BJ6bsObaW+ l7L8uXFNbXAWGHSrHFvQQM248+9yFIlBOn701cb6QHowqzQ5dMfmnRYv1mDRlsNEgIbV nRL+eYe+KvK0yxDh0GxiT/yU1YnjeFHi0CP+zeNqLs2pqb71HTzfK/W8WEycvzx+qGIk qSww== X-Received: by 10.60.31.170 with SMTP id b10mr2519201oei.34.1362766491171; Fri, 08 Mar 2013 10:14:51 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.60.26.74 with HTTP; Fri, 8 Mar 2013 10:14:21 -0800 (PST) In-Reply-To: <201303081811.r28IB2JI009017@svn.freebsd.org> References: <201303081811.r28IB2JI009017@svn.freebsd.org> From: Eitan Adler Date: Fri, 8 Mar 2013 13:14:21 -0500 X-Google-Sender-Auth: 4HlVdUsnnvj024OPZA_w8CXi_l4 Message-ID: Subject: Re: svn commit: r248060 - in head/sys/dev/drm2: . ttm To: Jean-Sebastien Pedron Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQneT0IJBWpYq13gfklHKNUGZqrqquYyZlAvACOyQ1UIbxO3SRr7v86W5zogmVJU6nSixTKE Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:14:52 -0000 On 8 March 2013 13:11, Jean-Sebastien Pedron wrote: > @@ -125,8 +125,6 @@ static ssize_t ttm_mem_zone_store(struct > > static void ttm_mem_global_kobj_release(struct ttm_mem_global *glob) > { > - > - free(glob, M_TTM_ZONE); > } Can this function now be removed, because it appears to be empty? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 18:15:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 38CB7BC4; Fri, 8 Mar 2013 18:15:08 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7DDBF1; Fri, 8 Mar 2013 18:15:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28IF8le009804; Fri, 8 Mar 2013 18:15:08 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28IF8Cs009803; Fri, 8 Mar 2013 18:15:08 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201303081815.r28IF8Cs009803@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Fri, 8 Mar 2013 18:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248061 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:15:08 -0000 Author: dumbbell Date: Fri Mar 8 18:15:07 2013 New Revision: 248061 URL: http://svnweb.freebsd.org/changeset/base/248061 Log: Import Linux commit a1b7736dac5f2d5876e68c47a0fce3f423840070 Author: Sascha Hauer Date: Wed Feb 1 11:38:22 2012 +0100 drm drm_fb_helper: destroy modes drm_setup_crtcs allocated modes using drm_mode_duplicate. Free them in drm_fb_helper_crtc_free. Signed-off-by: Sascha Hauer Signed-off-by: Dave Airlie Discussed with: Konstantin Belousov (kib@) Modified: head/sys/dev/drm2/drm_fb_helper.c Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Fri Mar 8 18:11:02 2013 (r248060) +++ head/sys/dev/drm2/drm_fb_helper.c Fri Mar 8 18:15:07 2013 (r248061) @@ -555,8 +555,11 @@ static void drm_fb_helper_crtc_free(stru for (i = 0; i < helper->connector_count; i++) free(helper->connector_info[i], DRM_MEM_KMS); free(helper->connector_info, DRM_MEM_KMS); - for (i = 0; i < helper->crtc_count; i++) + for (i = 0; i < helper->crtc_count; i++) { free(helper->crtc_info[i].mode_set.connectors, DRM_MEM_KMS); + if (helper->crtc_info[i].mode_set.mode) + drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode); + } free(helper->crtc_info, DRM_MEM_KMS); } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 18:17:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81DA0D8B; Fri, 8 Mar 2013 18:17:38 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) by mx1.freebsd.org (Postfix) with ESMTP id 333D2C2C; Fri, 8 Mar 2013 18:17:37 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id r28BYs8u029991; Fri, 8 Mar 2013 12:17:36 -0600 Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by pp1.rice.edu with ESMTP id 1axwq1geg2-1; Fri, 08 Mar 2013 12:17:36 -0600 Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 80C205001AD; Fri, 8 Mar 2013 12:17:36 -0600 (CST) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 7F4D1500110; Fri, 8 Mar 2013 12:17:36 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id WugWxzyevXTX; Fri, 8 Mar 2013 12:17:36 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id 052775001AB; Fri, 8 Mar 2013 12:17:35 -0600 (CST) Message-ID: <513A2B3E.2070804@rice.edu> Date: Fri, 08 Mar 2013 12:17:34 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130127 Thunderbird/17.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r248031 - in head/sys: kern sys References: <201303081014.r28AEwet053196@svn.freebsd.org> In-Reply-To: <201303081014.r28AEwet053196@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5400 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=4 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1111160001 definitions=main-1101130121 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:17:38 -0000 On 03/08/2013 04:14, Andre Oppermann wrote: > Author: andre > Date: Fri Mar 8 10:14:58 2013 > New Revision: 248031 > URL: http://svnweb.freebsd.org/changeset/base/248031 > > Log: > Move the auto-sizing of the callout array from init_param2() to > kern_timeout_callwheel_alloc() where it is actually used. > > This is a mechanical move and no tuning parameters are changed. > > The pre-allocated callout array is only used for legacy timeout(9) > calls and is only allocated and active on cpu0. Eventually all > remaining users of timeout(9) should switch to the callout_* API. > In the meantime, until all legacy timeout(9) users are updated, I think that it would be wise to retain the comment that describes where the magic number 18508 comes from. Regards, Alan > Reviewed by: davide > > Modified: > head/sys/kern/kern_timeout.c > head/sys/kern/subr_param.c > head/sys/sys/callout.h > > Modified: head/sys/kern/kern_timeout.c > ============================================================================== > --- head/sys/kern/kern_timeout.c Fri Mar 8 08:19:50 2013 (r248030) > +++ head/sys/kern/kern_timeout.c Fri Mar 8 10:14:58 2013 (r248031) > @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -101,6 +102,11 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca > 0, "Average number of MP direct callouts made per callout_process call. " > "Units = 1/1000"); > #endif > + > +static int ncallout; > +SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, > + "Number of entries in callwheel and size of timeout() preallocation"); > + > /* > * TODO: > * allocate more timeout table slots when table overflows. > @@ -252,6 +258,14 @@ kern_timeout_callwheel_alloc(caddr_t v) > > timeout_cpu = PCPU_GET(cpuid); > cc = CC_CPU(timeout_cpu); > + > + /* > + * Calculate the size of the callout wheel and the preallocated > + * timeout() structures. > + */ > + ncallout = imin(16 + maxproc + maxfiles, 18508); > + TUNABLE_INT_FETCH("kern.ncallout", &ncallout); > + > /* > * Calculate callout wheel size, should be next power of two higher > * than 'ncallout'. > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Fri Mar 8 08:19:50 2013 (r248030) > +++ head/sys/kern/subr_param.c Fri Mar 8 10:14:58 2013 (r248031) > @@ -91,7 +91,6 @@ int maxprocperuid; /* max # of procs p > int maxfiles; /* sys. wide open files limit */ > int maxfilesperproc; /* per-proc open files limit */ > int msgbufsize; /* size of kernel message buffer */ > -int ncallout; /* maximum # of timer events */ > int nbuf; > int ngroups_max; /* max # groups per process */ > int nswbuf; > @@ -109,8 +108,6 @@ u_long sgrowsiz; /* amount to grow sta > > SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, > "Number of clock ticks per second"); > -SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, > - "Number of pre-allocated timer events"); > SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0, > "Number of buffers in the buffer cache"); > SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0, > @@ -327,15 +324,6 @@ init_param2(long physpages) > TUNABLE_INT_FETCH("kern.nbuf", &nbuf); > > /* > - * XXX: Does the callout wheel have to be so big? > - * > - * Clip callout to result of previous function of maxusers maximum > - * 384. This is still huge, but acceptable. > - */ > - ncallout = imin(16 + maxproc + maxfiles, 18508); > - TUNABLE_INT_FETCH("kern.ncallout", &ncallout); > - > - /* > * The default for maxpipekva is min(1/64 of the kernel address space, > * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. > */ > > Modified: head/sys/sys/callout.h > ============================================================================== > --- head/sys/sys/callout.h Fri Mar 8 08:19:50 2013 (r248030) > +++ head/sys/sys/callout.h Fri Mar 8 10:14:58 2013 (r248031) > @@ -63,8 +63,6 @@ struct callout_handle { > }; > > #ifdef _KERNEL > -extern int ncallout; > - > #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) > #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) > #define callout_drain(c) _callout_stop_safe(c, 1) > From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 18:46:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAC2F8BE; Fri, 8 Mar 2013 18:46:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A10FEF76; Fri, 8 Mar 2013 18:46:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28IkMlJ018802; Fri, 8 Mar 2013 18:46:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28IkM9B018798; Fri, 8 Mar 2013 18:46:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303081846.r28IkM9B018798@svn.freebsd.org> From: Xin LI Date: Fri, 8 Mar 2013 18:46: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: r248062 - in stable: 8/sys/dev/oce 9/sys/dev/oce 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:46:22 -0000 Author: delphij Date: Fri Mar 8 18:46:21 2013 New Revision: 248062 URL: http://svnweb.freebsd.org/changeset/base/248062 Log: MFC r231879,246799,247880,248059: Update driver to version 4.6.95.0. Submitted by: "Duvvuru,Venkat Kumar" Modified: stable/9/sys/dev/oce/oce_hw.c stable/9/sys/dev/oce/oce_hw.h stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/oce/oce_if.h stable/9/sys/dev/oce/oce_mbox.c stable/9/sys/dev/oce/oce_queue.c stable/9/sys/dev/oce/oce_sysctl.c stable/9/sys/dev/oce/oce_util.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/oce/oce_hw.c stable/8/sys/dev/oce/oce_hw.h stable/8/sys/dev/oce/oce_if.c stable/8/sys/dev/oce/oce_if.h stable/8/sys/dev/oce/oce_mbox.c stable/8/sys/dev/oce/oce_queue.c stable/8/sys/dev/oce/oce_sysctl.c stable/8/sys/dev/oce/oce_util.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/oce/ (props changed) Modified: stable/9/sys/dev/oce/oce_hw.c ============================================================================== --- stable/9/sys/dev/oce/oce_hw.c Fri Mar 8 18:15:07 2013 (r248061) +++ stable/9/sys/dev/oce/oce_hw.c Fri Mar 8 18:46:21 2013 (r248062) @@ -340,8 +340,10 @@ oce_hw_shutdown(POCE_SOFTC sc) oce_stats_free(sc); /* disable hardware interrupts */ oce_hw_intr_disable(sc); +#if defined(INET6) || defined(INET) /* Free LRO resources */ oce_free_lro(sc); +#endif /* Release queue*/ oce_queue_release_all(sc); /*Delete Network Interface*/ @@ -403,11 +405,6 @@ oce_create_nw_interface(POCE_SOFTC sc) sc->if_cap_flags = capab_en_flags; - /* Enable VLAN Promisc on HW */ - rc = oce_config_vlan(sc, (uint8_t) sc->if_id, NULL, 0, 1, 1); - if (rc) - goto error; - /* set default flow control */ rc = oce_set_flow_control(sc, sc->flow_control); if (rc) @@ -475,12 +472,9 @@ oce_hw_start(POCE_SOFTC sc) return 1; if (link.logical_link_status == NTWK_LOGICAL_LINK_UP) { - sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; sc->link_status = NTWK_LOGICAL_LINK_UP; if_link_state_change(sc->ifp, LINK_STATE_UP); } else { - sc->ifp->if_drv_flags &= - ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->link_status = NTWK_LOGICAL_LINK_DOWN; if_link_state_change(sc->ifp, LINK_STATE_DOWN); } @@ -494,12 +488,17 @@ oce_hw_start(POCE_SOFTC sc) rc = oce_start_mq(sc->mq); - /* we need to get MCC aync events. - So enable intrs and also arm first EQ + /* we need to get MCC aync events. So enable intrs and arm + first EQ, Other EQs will be armed after interface is UP */ oce_hw_intr_enable(sc); oce_arm_eq(sc, sc->eq[0]->eq_id, 0, TRUE, FALSE); + /* Send first mcc cmd and after that we get gracious + MCC notifications from FW + */ + oce_first_mcc_cmd(sc); + return rc; } @@ -537,8 +536,8 @@ oce_hw_intr_disable(POCE_SOFTC sc) /** - * @brief Function for hardware update multicast filter - * @param sc software handle to the device + * @brief Function for hardware update multicast filter + * @param sc software handle to the device */ int oce_hw_update_multicast(POCE_SOFTC sc) Modified: stable/9/sys/dev/oce/oce_hw.h ============================================================================== --- stable/9/sys/dev/oce/oce_hw.h Fri Mar 8 18:15:07 2013 (r248061) +++ stable/9/sys/dev/oce/oce_hw.h Fri Mar 8 18:46:21 2013 (r248062) @@ -154,6 +154,12 @@ #define ASYNC_EVENT_CODE_LINK_STATE 0x1 #define ASYNC_EVENT_LINK_UP 0x1 #define ASYNC_EVENT_LINK_DOWN 0x0 +#define ASYNC_EVENT_GRP5 0x5 +#define ASYNC_EVENT_CODE_DEBUG 0x6 +#define ASYNC_EVENT_PVID_STATE 0x3 +#define ASYNC_EVENT_DEBUG_QNQ 0x1 +#define ASYNC_EVENT_CODE_SLIPORT 0x11 +#define VLAN_VID_MASK 0x0FFF /* port link_status */ #define ASYNC_EVENT_LOGICAL 0x02 @@ -610,7 +616,10 @@ struct oce_mq_cqe { uint32_t hpi_buffer_cmpl:1; uint32_t completed:1; uint32_t consumed:1; - uint32_t rsvd0:27; + uint32_t rsvd0:3; + uint32_t async_type:8; + uint32_t event_type:8; + uint32_t rsvd1:8; #else /* dw0 */ uint32_t completion_status:16; @@ -618,7 +627,10 @@ struct oce_mq_cqe { /* dw1 dw2 */ uint32_t mq_tag[2]; /* dw3 */ - uint32_t rsvd0:27; + uint32_t rsvd1:8; + uint32_t event_type:8; + uint32_t async_type:8; + uint32_t rsvd0:3; uint32_t consumed:1; uint32_t completed:1; uint32_t hpi_buffer_cmpl:1; @@ -687,6 +699,112 @@ struct oce_async_cqe_link_state { } u0; }; + +/* PVID aync event */ +struct oce_async_event_grp5_pvid_state { + uint8_t enabled; + uint8_t rsvd0; + uint16_t tag; + uint32_t event_tag; + uint32_t rsvd1; + uint32_t code; +}; + +/* async event indicating outer VLAN tag in QnQ */ +struct oce_async_event_qnq { + uint8_t valid; /* Indicates if outer VLAN is valid */ + uint8_t rsvd0; + uint16_t vlan_tag; + uint32_t event_tag; + uint8_t rsvd1[4]; + uint32_t code; +} ; + + +typedef union oce_mq_ext_ctx_u { + uint32_t dw[6]; + struct { + #ifdef _BIG_ENDIAN + /* dw0 */ + uint32_t dw4rsvd1:16; + uint32_t num_pages:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t cq_id:10; + uint32_t dw5rsvd2:2; + uint32_t ring_size:4; + uint32_t dw5rsvd1:16; + /* dw3 */ + uint32_t valid:1; + uint32_t dw6rsvd1:31; + /* dw4 */ + uint32_t dw7rsvd1:21; + uint32_t async_cq_id:10; + uint32_t async_cq_valid:1; + #else + /* dw0 */ + uint32_t num_pages:16; + uint32_t dw4rsvd1:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t dw5rsvd1:16; + uint32_t ring_size:4; + uint32_t dw5rsvd2:2; + uint32_t cq_id:10; + /* dw3 */ + uint32_t dw6rsvd1:31; + uint32_t valid:1; + /* dw4 */ + uint32_t async_cq_valid:1; + uint32_t async_cq_id:10; + uint32_t dw7rsvd1:21; + #endif + /* dw5 */ + uint32_t dw8rsvd1; + } v0; + struct { + #ifdef _BIG_ENDIAN + /* dw0 */ + uint32_t cq_id:16; + uint32_t num_pages:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t dw5rsvd2:12; + uint32_t ring_size:4; + uint32_t async_cq_id:16; + /* dw3 */ + uint32_t valid:1; + uint32_t dw6rsvd1:31; + /* dw4 */ + uint32_t dw7rsvd1:31; + uint32_t async_cq_valid:1; + #else + /* dw0 */ + uint32_t num_pages:16; + uint32_t cq_id:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t async_cq_id:16; + uint32_t ring_size:4; + uint32_t dw5rsvd2:12; + /* dw3 */ + uint32_t dw6rsvd1:31; + uint32_t valid:1; + /* dw4 */ + uint32_t async_cq_valid:1; + uint32_t dw7rsvd1:31; + #endif + /* dw5 */ + uint32_t dw8rsvd1; + } v1; + +} oce_mq_ext_ctx_t; + + /* MQ mailbox structure */ struct oce_bmbx { struct oce_mbx mbx; @@ -760,6 +878,7 @@ enum COMMON_SUBSYSTEM_OPCODES { OPCODE_COMMON_SET_BEACON_CONFIG = 69, OPCODE_COMMON_GET_BEACON_CONFIG = 70, OPCODE_COMMON_GET_PHYSICAL_LINK_CONFIG = 71, + OPCODE_COMMON_READ_TRANSRECEIVER_DATA = 73, OPCODE_COMMON_GET_OEM_ATTRIBUTES = 76, OPCODE_COMMON_GET_PORT_NAME = 77, OPCODE_COMMON_GET_CONFIG_SIGNATURE = 78, @@ -1342,6 +1461,23 @@ struct mbx_create_common_mq { } params; }; +struct mbx_create_common_mq_ex { + struct mbx_hdr hdr; + union { + struct { + oce_mq_ext_ctx_t context; + struct phys_addr pages[8]; + } req; + + struct { + uint32_t mq_id:16; + uint32_t rsvd0:16; + } rsp; + } params; +}; + + + /* [53] OPCODE_COMMON_DESTROY_MQ */ struct mbx_destroy_common_mq { struct mbx_hdr hdr; @@ -1584,7 +1720,7 @@ enum CQFW_FUNCTION_MODES_SUPPORTED { FNM_BE3_COMPAT_MODE = 0x10000, /* BE3 features */ FNM_VNIC_MODE = 0x20000, /* Set when IBM vNIC mode is set */ FNM_VNTAG_MODE = 0x40000, /* Set when VNTAG mode is set */ - FNM_UMC_MODE = 0x80000, /* Set when UMC mode is set */ + FNM_UMC_MODE = 0x1000000, /* Set when UMC mode is set */ FNM_UMC_DEF_EN = 0x100000, /* Set when UMC Default is set */ FNM_ONE_GB_EN = 0x200000, /* Set when 1GB Default is set */ FNM_VNIC_DEF_VALID = 0x400000, /* Set when VNIC_DEF_EN is valid */ @@ -1641,6 +1777,12 @@ struct mbx_set_common_iface_rx_filter { } params; }; +struct be_set_eqd { + uint32_t eq_id; + uint32_t phase; + uint32_t dm; +}; + /* [41] OPCODE_COMMON_MODIFY_EQ_DELAY */ struct mbx_modify_common_eq_delay { struct mbx_hdr hdr; @@ -1660,6 +1802,76 @@ struct mbx_modify_common_eq_delay { } params; }; +/* [32] OPCODE_COMMON_GET_CNTL_ATTRIBUTES */ + +struct mgmt_hba_attr { + int8_t flashrom_ver_str[32]; + int8_t manufac_name[32]; + uint32_t supp_modes; + int8_t seeprom_ver_lo; + int8_t seeprom_ver_hi; + int8_t rsvd0[2]; + uint32_t ioctl_data_struct_ver; + uint32_t ep_fw_data_struct_ver; + uint8_t ncsi_ver_str[12]; + uint32_t def_ext_to; + int8_t cntl_mod_num[32]; + int8_t cntl_desc[64]; + int8_t cntl_ser_num[32]; + int8_t ip_ver_str[32]; + int8_t fw_ver_str[32]; + int8_t bios_ver_str[32]; + int8_t redboot_ver_str[32]; + int8_t drv_ver_str[32]; + int8_t fw_on_flash_ver_str[32]; + uint32_t funcs_supp; + uint16_t max_cdblen; + uint8_t asic_rev; + uint8_t gen_guid[16]; + uint8_t hba_port_count; + uint16_t default_link_down_timeout; + uint8_t iscsi_ver_min_max; + uint8_t multifunc_dev; + uint8_t cache_valid; + uint8_t hba_status; + uint8_t max_domains_supp; + uint8_t phy_port; + uint32_t fw_post_status; + uint32_t hba_mtu[8]; + uint8_t iSCSI_feat; + uint8_t asic_gen; + uint8_t future_u8[2]; + uint32_t future_u32[3]; +}; + +struct mgmt_cntl_attr { + struct mgmt_hba_attr hba_attr; + uint16_t pci_vendor_id; + uint16_t pci_device_id; + uint16_t pci_sub_vendor_id; + uint16_t pci_sub_system_id; + uint8_t pci_bus_num; + uint8_t pci_dev_num; + uint8_t pci_func_num; + uint8_t interface_type; + uint64_t unique_id; + uint8_t netfilters; + uint8_t rsvd0[3]; + uint32_t future_u32[4]; +}; + +struct mbx_common_get_cntl_attr { + struct mbx_hdr hdr; + union { + struct { + uint32_t rsvd0; + } req; + struct { + struct mgmt_cntl_attr cntl_attr_info; + } rsp; + } params; +}; + /* [59] OPCODE_ADD_COMMON_IFACE_MAC */ struct mbx_add_common_iface_mac { struct mbx_hdr hdr; @@ -1702,6 +1914,23 @@ struct ioctl_common_function_reset { struct mbx_hdr hdr; }; +/* [73] OPCODE_COMMON_READ_TRANSRECEIVER_DATA */ +struct mbx_read_common_transrecv_data { + struct mbx_hdr hdr; + union { + struct { + uint32_t page_num; + uint32_t port; + } req; + struct { + uint32_t page_num; + uint32_t port; + uint32_t page_data[32]; + } rsp; + } params; + +}; + /* [80] OPCODE_COMMON_FUNCTION_LINK_CONFIG */ struct mbx_common_func_link_cfg { struct mbx_hdr hdr; @@ -2027,7 +2256,9 @@ enum RSS_ENABLE_FLAGS { RSS_ENABLE_IPV4 = 0x1, /* (IPV4 HASH enabled ) */ RSS_ENABLE_TCP_IPV4 = 0x2, /* (TCP IPV4 Hash enabled) */ RSS_ENABLE_IPV6 = 0x4, /* (IPV6 HASH enabled) */ - RSS_ENABLE_TCP_IPV6 = 0x8 /* (TCP IPV6 HASH */ + RSS_ENABLE_TCP_IPV6 = 0x8, /* (TCP IPV6 HASH */ + RSS_ENABLE_UDP_IPV4 = 0x10, /* UDP IPV4 HASH */ + RSS_ENABLE_UDP_IPV6 = 0x20 /* UDP IPV6 HASH */ }; #define RSS_ENABLE (RSS_ENABLE_IPV4 | RSS_ENABLE_TCP_IPV4) #define RSS_DISABLE RSS_ENABLE_NONE Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Fri Mar 8 18:15:07 2013 (r248061) +++ stable/9/sys/dev/oce/oce_if.c Fri Mar 8 18:46:21 2013 (r248062) @@ -71,10 +71,6 @@ static int oce_tx(POCE_SOFTC sc, struct static void oce_tx_restart(POCE_SOFTC sc, struct oce_wq *wq); static void oce_tx_complete(struct oce_wq *wq, uint32_t wqe_idx, uint32_t status); -#if defined(INET6) || defined(INET) -static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, - uint16_t *mss); -#endif static int oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, struct oce_wq *wq); @@ -82,9 +78,6 @@ static int oce_multiq_transmit(struct i static void oce_discard_rx_comp(struct oce_rq *rq, struct oce_nic_rx_cqe *cqe); static int oce_cqe_vtp_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); static int oce_cqe_portid_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); -#if defined(INET6) || defined(INET) -static void oce_rx_flush_lro(struct oce_rq *rq); -#endif static void oce_rx(struct oce_rq *rq, uint32_t rqe_idx, struct oce_nic_rx_cqe *cqe); @@ -96,13 +89,21 @@ static int oce_vid_config(POCE_SOFTC sc static void oce_mac_addr_set(POCE_SOFTC sc); static int oce_handle_passthrough(struct ifnet *ifp, caddr_t data); static void oce_local_timer(void *arg); -#if defined(INET6) || defined(INET) -static int oce_init_lro(POCE_SOFTC sc); -#endif static void oce_if_deactivate(POCE_SOFTC sc); static void oce_if_activate(POCE_SOFTC sc); static void setup_max_queues_want(POCE_SOFTC sc); static void update_queues_got(POCE_SOFTC sc); +static void process_link_state(POCE_SOFTC sc, + struct oce_async_cqe_link_state *acqe); +static int oce_tx_asic_stall_verify(POCE_SOFTC sc, struct mbuf *m); +static struct mbuf *oce_insert_vlan_tag(POCE_SOFTC sc, struct mbuf *m, boolean_t *complete); + +/* IP specific */ +#if defined(INET6) || defined(INET) +static int oce_init_lro(POCE_SOFTC sc); +static void oce_rx_flush_lro(struct oce_rq *rq); +static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp); +#endif static device_method_t oce_dispatch[] = { DEVMETHOD(device_probe, oce_probe), @@ -157,10 +158,10 @@ static uint32_t supportedDevices[] = { static int oce_probe(device_t dev) { - uint16_t vendor; - uint16_t device; - int i; - char str[80]; + uint16_t vendor = 0; + uint16_t device = 0; + int i = 0; + char str[256] = {0}; POCE_SOFTC sc; sc = device_get_softc(dev); @@ -170,11 +171,10 @@ oce_probe(device_t dev) vendor = pci_get_vendor(dev); device = pci_get_device(dev); - for (i = 0; i < (sizeof(supportedDevices) / sizeof(uint16_t)); i++) { + for (i = 0; i < (sizeof(supportedDevices) / sizeof(uint32_t)); i++) { if (vendor == ((supportedDevices[i] >> 16) & 0xffff)) { if (device == (supportedDevices[i] & 0xffff)) { - sprintf(str, "%s:%s", - "Emulex CNA NIC function", + sprintf(str, "%s:%s", "Emulex CNA NIC function", component_revision); device_set_desc_copy(dev, str); @@ -228,37 +228,30 @@ oce_attach(device_t dev) if (rc) goto pci_res_free; - setup_max_queues_want(sc); - rc = oce_setup_intr(sc); if (rc) goto mbox_free; - rc = oce_queue_init_all(sc); if (rc) goto intr_free; - rc = oce_attach_ifp(sc); if (rc) goto queues_free; - #if defined(INET6) || defined(INET) rc = oce_init_lro(sc); if (rc) - goto ifp_free; + goto ifp_free; #endif - rc = oce_hw_start(sc); if (rc) goto lro_free; - sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, oce_add_vlan, sc, EVENTHANDLER_PRI_FIRST); sc->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, @@ -270,7 +263,6 @@ oce_attach(device_t dev) oce_add_sysctls(sc); - callout_init(&sc->timer, CALLOUT_MPSAFE); rc = callout_reset(&sc->timer, 2 * hz, oce_local_timer, sc); if (rc) @@ -315,9 +307,7 @@ oce_detach(device_t dev) POCE_SOFTC sc = device_get_softc(dev); LOCK(&sc->dev_lock); - oce_if_deactivate(sc); - UNLOCK(&sc->dev_lock); callout_drain(&sc->timer); @@ -359,34 +349,11 @@ oce_ioctl(struct ifnet *ifp, u_long comm uint32_t u; switch (command) { - case SIOCGIFPSRCADDR_IN6: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFPSRCADDR: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFSTATUS: - rc = ether_ioctl(ifp, command, data); - break; case SIOCGIFMEDIA: rc = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; - case SIOCSIFMEDIA: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFGENERIC: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGETMIFCNT_IN6: - rc = ether_ioctl(ifp, command, data); - break; - case SIOCSIFMTU: if (ifr->ifr_mtu > OCE_MAX_MTU) rc = EINVAL; @@ -474,7 +441,6 @@ oce_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; oce_vid_config(sc); } - #if defined(INET6) || defined(INET) if (u & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; @@ -518,7 +484,7 @@ oce_multiq_start(struct ifnet *ifp, stru struct oce_wq *wq = NULL; int queue_index = 0; int status = 0; - + if ((m->m_flags & M_FLOWID) != 0) queue_index = m->m_pkthdr.flowid % sc->nwqs; @@ -601,6 +567,7 @@ oce_intr(void *arg, int pending) eq_arm: oce_arm_eq(sc, eq->eq_id, 0, TRUE, FALSE); + return; } @@ -666,6 +633,8 @@ oce_fast_isr(void *arg) taskqueue_enqueue_fast(ii->tq, &ii->task); + ii->eq->intr++; + return FILTER_HANDLED; } @@ -813,9 +782,7 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct oce_nic_frag_wqe *nicfrag; int num_wqes; uint32_t reg_value; -#if defined(INET6) || defined(INET) - uint16_t mss = 0; -#endif + boolean_t complete = TRUE; m = *mpp; if (!m) @@ -826,10 +793,19 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, goto free_ret; } + if(oce_tx_asic_stall_verify(sc, m)) { + m = oce_insert_vlan_tag(sc, m, &complete); + if(!m) { + device_printf(sc->dev, "Insertion unsuccessful\n"); + return 0; + } + + } + if (m->m_pkthdr.csum_flags & CSUM_TSO) { -#if defined(INET6) || defined(INET) /* consolidate packet buffers for TSO/LSO segment offload */ - m = oce_tso_setup(sc, mpp, &mss); +#if defined(INET6) || defined(INET) + m = oce_tso_setup(sc, mpp); #else m = NULL; #endif @@ -873,15 +849,15 @@ retry: nichdr->u0.dw[2] = 0; nichdr->u0.dw[3] = 0; - nichdr->u0.s.complete = 1; + nichdr->u0.s.complete = complete; nichdr->u0.s.event = 1; nichdr->u0.s.crc = 1; nichdr->u0.s.forward = 0; nichdr->u0.s.ipcs = (m->m_pkthdr.csum_flags & CSUM_IP) ? 1 : 0; nichdr->u0.s.udpcs = - (m->m_pkthdr.csum_flags & CSUM_UDP) ? 1 : 0; + (m->m_pkthdr.csum_flags & CSUM_UDP) ? 1 : 0; nichdr->u0.s.tcpcs = - (m->m_pkthdr.csum_flags & CSUM_TCP) ? 1 : 0; + (m->m_pkthdr.csum_flags & CSUM_TCP) ? 1 : 0; nichdr->u0.s.num_wqe = num_wqes; nichdr->u0.s.total_length = m->m_pkthdr.len; if (m->m_flags & M_VLANTAG) { @@ -931,7 +907,7 @@ retry: wq->tx_stats.tx_wrbs += num_wqes; wq->tx_stats.tx_bytes += m->m_pkthdr.len; wq->tx_stats.tx_pkts++; - + bus_dmamap_sync(wq->ring->dma.tag, wq->ring->dma.map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); reg_value = (num_wqes << 16) | wq->wq_id; @@ -1012,9 +988,10 @@ oce_tx_restart(POCE_SOFTC sc, struct oce } + #if defined(INET6) || defined(INET) static struct mbuf * -oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, uint16_t *mss) +oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp) { struct mbuf *m; #ifdef INET @@ -1025,12 +1002,10 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf #endif struct ether_vlan_header *eh; struct tcphdr *th; - int total_len = 0; uint16_t etype; - int ehdrlen = 0; + int total_len = 0, ehdrlen = 0; m = *mpp; - *mss = m->m_pkthdr.tso_segsz; if (M_WRITABLE(m) == 0) { m = m_dup(*mpp, M_DONTWAIT); @@ -1049,7 +1024,6 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf ehdrlen = ETHER_HDR_LEN; } - switch (etype) { #ifdef INET case ETHERTYPE_IP: @@ -1084,7 +1058,6 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf } #endif /* INET6 || INET */ - void oce_tx_task(void *arg, int npending) { @@ -1115,22 +1088,26 @@ oce_start(struct ifnet *ifp) POCE_SOFTC sc = ifp->if_softc; struct mbuf *m; int rc = 0; + int def_q = 0; /* Defualt tx queue is 0*/ if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; + + if (!sc->link_status) + return; do { IF_DEQUEUE(&sc->ifp->if_snd, m); if (m == NULL) break; - /* oce_start always uses default TX queue 0 */ - LOCK(&sc->wq[0]->tx_lock); - rc = oce_tx(sc, &m, 0); - UNLOCK(&sc->wq[0]->tx_lock); + + LOCK(&sc->wq[def_q]->tx_lock); + rc = oce_tx(sc, &m, def_q); + UNLOCK(&sc->wq[def_q]->tx_lock); if (rc) { if (m != NULL) { - sc->wq[0]->tx_stats.tx_stops ++; + sc->wq[def_q]->tx_stats.tx_stops ++; ifp->if_drv_flags |= IFF_DRV_OACTIVE; IFQ_DRV_PREPEND(&ifp->if_snd, m); m = NULL; @@ -1140,7 +1117,7 @@ oce_start(struct ifnet *ifp) if (m != NULL) ETHER_BPF_MTAP(ifp, m); - } while (1); + } while (TRUE); return; } @@ -1250,13 +1227,19 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i uint16_t vtag; len = cqe->u0.s.pkt_size; - vtag = cqe->u0.s.vlan_tag; if (!len) { /*partial DMA workaround for Lancer*/ oce_discard_rx_comp(rq, cqe); goto exit; } + /* Get vlan_tag value */ + if(IS_BE(sc)) + vtag = BSWAP_16(cqe->u0.s.vlan_tag); + else + vtag = cqe->u0.s.vlan_tag; + + for (i = 0; i < cqe->u0.s.num_fragments; i++) { if (rq->packets_out == rq->packets_in) { @@ -1292,7 +1275,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i pd->mbuf->m_pkthdr.csum_data = 0xffff; } if (cqe->u0.s.ip_cksum_pass) { - if (!cqe->u0.s.ip_ver) { //IPV4 + if (!cqe->u0.s.ip_ver) { /* IPV4 */ pd->mbuf->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID); } @@ -1315,24 +1298,20 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i m->m_pkthdr.flowid = rq->queue_index; m->m_flags |= M_FLOWID; #endif - //This deternies if vlan tag is present + /* This deternies if vlan tag is Valid */ if (oce_cqe_vtp_valid(sc, cqe)) { if (sc->function_mode & FNM_FLEX10_MODE) { - /* FLEX10 */ + /* FLEX10. If QnQ is not set, neglect VLAN */ if (cqe->u0.s.qnq) { - /* If QnQ is not set, neglect VLAN */ - if (IS_BE(sc)) - m->m_pkthdr.ether_vtag = - BSWAP_16(vtag); - else - m->m_pkthdr.ether_vtag = vtag; + m->m_pkthdr.ether_vtag = vtag; m->m_flags |= M_VLANTAG; } - } else { - if (IS_BE(sc)) - m->m_pkthdr.ether_vtag = BSWAP_16(vtag); - else - m->m_pkthdr.ether_vtag = vtag; + } else if (sc->pvid != (vtag & VLAN_VID_MASK)) { + /* In UMC mode generally pvid will be striped by + hw. But in some cases we have seen it comes + with pvid. So if pvid == vlan, neglect vlan. + */ + m->m_pkthdr.ether_vtag = vtag; m->m_flags |= M_VLANTAG; } } @@ -1341,7 +1320,6 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i #if defined(INET6) || defined(INET) /* Try to queue to LRO */ if (IF_LRO_ENABLED(sc) && - !(m->m_flags & M_VLANTAG) && (cqe->u0.s.ip_cksum_pass) && (cqe->u0.s.l4_cksum_pass) && (!cqe->u0.s.ip_ver) && @@ -1381,13 +1359,6 @@ oce_discard_rx_comp(struct oce_rq *rq, s POCE_SOFTC sc = (POCE_SOFTC) rq->parent; int num_frags = cqe->u0.s.num_fragments; - if (IS_XE201(sc) && cqe->u0.s.error) { - /* Lancer A0 workaround - * num_frags will be 1 more than actual in case of error - */ - if (num_frags) - num_frags -= 1; - } for (i = 0; i < num_frags; i++) { if (rq->packets_out == rq->packets_in) { device_printf(sc->dev, @@ -1417,9 +1388,8 @@ oce_cqe_vtp_valid(POCE_SOFTC sc, struct if (sc->be3_native) { cqe_v1 = (struct oce_nic_rx_cqe_v1 *)cqe; vtp = cqe_v1->u0.s.vlan_tag_present; - } else { + } else vtp = cqe->u0.s.vlan_tag_present; - } return vtp; @@ -1444,7 +1414,6 @@ oce_cqe_portid_valid(POCE_SOFTC sc, stru } - #if defined(INET6) || defined(INET) static void oce_rx_flush_lro(struct oce_rq *rq) @@ -1484,12 +1453,11 @@ oce_init_lro(POCE_SOFTC sc) return rc; } -#endif /* INET6 || INET */ + void oce_free_lro(POCE_SOFTC sc) { -#if defined(INET6) || defined(INET) struct lro_ctrl *lro = NULL; int i = 0; @@ -1498,9 +1466,8 @@ oce_free_lro(POCE_SOFTC sc) if (lro) tcp_lro_free(lro); } -#endif } - +#endif int oce_alloc_rx_bufs(struct oce_rq *rq, int count) @@ -1513,7 +1480,7 @@ oce_alloc_rx_bufs(struct oce_rq *rq, int struct oce_nic_rqe *rqe; pd_rxulp_db_t rxdb_reg; - + bzero(&rxdb_reg, sizeof(pd_rxulp_db_t)); for (i = 0; i < count; i++) { in = rq->packets_in + 1; if (in == OCE_RQ_PACKET_ARRAY_SIZE) @@ -1554,14 +1521,12 @@ oce_alloc_rx_bufs(struct oce_rq *rq, int } if (added != 0) { for (i = added / OCE_MAX_RQ_POSTS; i > 0; i--) { - DELAY(1); rxdb_reg.bits.num_posted = OCE_MAX_RQ_POSTS; rxdb_reg.bits.qid = rq->rq_id; OCE_WRITE_REG32(sc, db, PD_RXULP_DB, rxdb_reg.dw0); added -= OCE_MAX_RQ_POSTS; } if (added > 0) { - DELAY(1); rxdb_reg.bits.qid = rq->rq_id; rxdb_reg.bits.num_posted = added; OCE_WRITE_REG32(sc, db, PD_RXULP_DB, rxdb_reg.dw0); @@ -1596,13 +1561,8 @@ oce_rq_handler(void *arg) } else { rq->rx_stats.rxcp_err++; sc->ifp->if_ierrors++; - if (IS_XE201(sc)) - /* Lancer A0 no buffer workaround */ - oce_discard_rx_comp(rq, cqe); - else - /* Post L3/L4 errors to stack.*/ - oce_rx(rq, cqe->u0.s.frag_index, cqe); - + /* Post L3/L4 errors to stack.*/ + oce_rx(rq, cqe->u0.s.frag_index, cqe); } rq->rx_stats.rx_compl++; cqe->u0.dw[2] = 0; @@ -1622,6 +1582,7 @@ oce_rq_handler(void *arg) if (num_cqes >= (IS_XE201(sc) ? 8 : oce_max_rsp_handled)) break; } + #if defined(INET6) || defined(INET) if (IF_LRO_ENABLED(sc)) oce_rx_flush_lro(rq); @@ -1684,9 +1645,11 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_capabilities = OCE_IF_CAPABILITIES; sc->ifp->if_capabilities |= IFCAP_HWCSUM; sc->ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; + #if defined(INET6) || defined(INET) sc->ifp->if_capabilities |= IFCAP_TSO; sc->ifp->if_capabilities |= IFCAP_LRO; + sc->ifp->if_capabilities |= IFCAP_VLAN_HWTSO; #endif sc->ifp->if_capenable = sc->ifp->if_capabilities; @@ -1796,18 +1759,18 @@ oce_handle_passthrough(struct ifnet *ifp uint32_t req_size; struct mbx_hdr req; OCE_DMA_MEM dma_mem; - + struct mbx_common_get_cntl_attr *fw_cmd; if (copyin(priv_data, cookie, strlen(IOCTL_COOKIE))) return EFAULT; - + if (memcmp(cookie, IOCTL_COOKIE, strlen(IOCTL_COOKIE))) return EINVAL; - + ioctl_ptr = (char *)priv_data + strlen(IOCTL_COOKIE); if (copyin(ioctl_ptr, &req, sizeof(struct mbx_hdr))) return EFAULT; - + req_size = le32toh(req.u0.req.request_length); if (req_size > 65536) return EINVAL; @@ -1831,12 +1794,86 @@ oce_handle_passthrough(struct ifnet *ifp if (copyout(OCE_DMAPTR(&dma_mem,char), ioctl_ptr, req_size)) rc = EFAULT; + /* + firmware is filling all the attributes for this ioctl except + the driver version..so fill it + */ + if(req.u0.rsp.opcode == OPCODE_COMMON_GET_CNTL_ATTRIBUTES) { + fw_cmd = (struct mbx_common_get_cntl_attr *) ioctl_ptr; + strncpy(fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str, + COMPONENT_REVISION, strlen(COMPONENT_REVISION)); + } + dma_free: oce_dma_free(sc, &dma_mem); return rc; } +static void +oce_eqd_set_periodic(POCE_SOFTC sc) +{ + struct oce_set_eqd set_eqd[OCE_MAX_EQ]; + struct oce_aic_obj *aic; + struct oce_eq *eqo; + uint64_t now = 0, delta; + int eqd, i, num = 0; + uint32_t ips = 0; + int tps; + + for (i = 0 ; i < sc->neqs; i++) { + eqo = sc->eq[i]; + aic = &sc->aic_obj[i]; + /* When setting the static eq delay from the user space */ + if (!aic->enable) { + eqd = aic->et_eqd; + goto modify_eqd; + } + + now = ticks; + + /* Over flow check */ + if ((now < aic->ticks) || (eqo->intr < aic->intr_prev)) + goto done; + + delta = now - aic->ticks; + tps = delta/hz; + + /* Interrupt rate based on elapsed ticks */ + if(tps) + ips = (uint32_t)(eqo->intr - aic->intr_prev) / tps; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 18:46:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B46D8BF; Fri, 8 Mar 2013 18:46:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 485B3F77; Fri, 8 Mar 2013 18:46:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28IkNbB018814; Fri, 8 Mar 2013 18:46:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28IkMwp018808; Fri, 8 Mar 2013 18:46:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303081846.r28IkMwp018808@svn.freebsd.org> From: Xin LI Date: Fri, 8 Mar 2013 18:46:22 +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: r248062 - in stable: 8/sys/dev/oce 9/sys/dev/oce 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 18:46:23 -0000 Author: delphij Date: Fri Mar 8 18:46:21 2013 New Revision: 248062 URL: http://svnweb.freebsd.org/changeset/base/248062 Log: MFC r231879,246799,247880,248059: Update driver to version 4.6.95.0. Submitted by: "Duvvuru,Venkat Kumar" Modified: stable/8/sys/dev/oce/oce_hw.c stable/8/sys/dev/oce/oce_hw.h stable/8/sys/dev/oce/oce_if.c stable/8/sys/dev/oce/oce_if.h stable/8/sys/dev/oce/oce_mbox.c stable/8/sys/dev/oce/oce_queue.c stable/8/sys/dev/oce/oce_sysctl.c stable/8/sys/dev/oce/oce_util.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/oce/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/oce/oce_hw.c stable/9/sys/dev/oce/oce_hw.h stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/oce/oce_if.h stable/9/sys/dev/oce/oce_mbox.c stable/9/sys/dev/oce/oce_queue.c stable/9/sys/dev/oce/oce_sysctl.c stable/9/sys/dev/oce/oce_util.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/8/sys/dev/oce/oce_hw.c ============================================================================== --- stable/8/sys/dev/oce/oce_hw.c Fri Mar 8 18:15:07 2013 (r248061) +++ stable/8/sys/dev/oce/oce_hw.c Fri Mar 8 18:46:21 2013 (r248062) @@ -340,8 +340,10 @@ oce_hw_shutdown(POCE_SOFTC sc) oce_stats_free(sc); /* disable hardware interrupts */ oce_hw_intr_disable(sc); +#if defined(INET6) || defined(INET) /* Free LRO resources */ oce_free_lro(sc); +#endif /* Release queue*/ oce_queue_release_all(sc); /*Delete Network Interface*/ @@ -403,11 +405,6 @@ oce_create_nw_interface(POCE_SOFTC sc) sc->if_cap_flags = capab_en_flags; - /* Enable VLAN Promisc on HW */ - rc = oce_config_vlan(sc, (uint8_t) sc->if_id, NULL, 0, 1, 1); - if (rc) - goto error; - /* set default flow control */ rc = oce_set_flow_control(sc, sc->flow_control); if (rc) @@ -475,12 +472,9 @@ oce_hw_start(POCE_SOFTC sc) return 1; if (link.logical_link_status == NTWK_LOGICAL_LINK_UP) { - sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; sc->link_status = NTWK_LOGICAL_LINK_UP; if_link_state_change(sc->ifp, LINK_STATE_UP); } else { - sc->ifp->if_drv_flags &= - ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->link_status = NTWK_LOGICAL_LINK_DOWN; if_link_state_change(sc->ifp, LINK_STATE_DOWN); } @@ -494,12 +488,17 @@ oce_hw_start(POCE_SOFTC sc) rc = oce_start_mq(sc->mq); - /* we need to get MCC aync events. - So enable intrs and also arm first EQ + /* we need to get MCC aync events. So enable intrs and arm + first EQ, Other EQs will be armed after interface is UP */ oce_hw_intr_enable(sc); oce_arm_eq(sc, sc->eq[0]->eq_id, 0, TRUE, FALSE); + /* Send first mcc cmd and after that we get gracious + MCC notifications from FW + */ + oce_first_mcc_cmd(sc); + return rc; } @@ -537,8 +536,8 @@ oce_hw_intr_disable(POCE_SOFTC sc) /** - * @brief Function for hardware update multicast filter - * @param sc software handle to the device + * @brief Function for hardware update multicast filter + * @param sc software handle to the device */ int oce_hw_update_multicast(POCE_SOFTC sc) Modified: stable/8/sys/dev/oce/oce_hw.h ============================================================================== --- stable/8/sys/dev/oce/oce_hw.h Fri Mar 8 18:15:07 2013 (r248061) +++ stable/8/sys/dev/oce/oce_hw.h Fri Mar 8 18:46:21 2013 (r248062) @@ -154,6 +154,12 @@ #define ASYNC_EVENT_CODE_LINK_STATE 0x1 #define ASYNC_EVENT_LINK_UP 0x1 #define ASYNC_EVENT_LINK_DOWN 0x0 +#define ASYNC_EVENT_GRP5 0x5 +#define ASYNC_EVENT_CODE_DEBUG 0x6 +#define ASYNC_EVENT_PVID_STATE 0x3 +#define ASYNC_EVENT_DEBUG_QNQ 0x1 +#define ASYNC_EVENT_CODE_SLIPORT 0x11 +#define VLAN_VID_MASK 0x0FFF /* port link_status */ #define ASYNC_EVENT_LOGICAL 0x02 @@ -610,7 +616,10 @@ struct oce_mq_cqe { uint32_t hpi_buffer_cmpl:1; uint32_t completed:1; uint32_t consumed:1; - uint32_t rsvd0:27; + uint32_t rsvd0:3; + uint32_t async_type:8; + uint32_t event_type:8; + uint32_t rsvd1:8; #else /* dw0 */ uint32_t completion_status:16; @@ -618,7 +627,10 @@ struct oce_mq_cqe { /* dw1 dw2 */ uint32_t mq_tag[2]; /* dw3 */ - uint32_t rsvd0:27; + uint32_t rsvd1:8; + uint32_t event_type:8; + uint32_t async_type:8; + uint32_t rsvd0:3; uint32_t consumed:1; uint32_t completed:1; uint32_t hpi_buffer_cmpl:1; @@ -687,6 +699,112 @@ struct oce_async_cqe_link_state { } u0; }; + +/* PVID aync event */ +struct oce_async_event_grp5_pvid_state { + uint8_t enabled; + uint8_t rsvd0; + uint16_t tag; + uint32_t event_tag; + uint32_t rsvd1; + uint32_t code; +}; + +/* async event indicating outer VLAN tag in QnQ */ +struct oce_async_event_qnq { + uint8_t valid; /* Indicates if outer VLAN is valid */ + uint8_t rsvd0; + uint16_t vlan_tag; + uint32_t event_tag; + uint8_t rsvd1[4]; + uint32_t code; +} ; + + +typedef union oce_mq_ext_ctx_u { + uint32_t dw[6]; + struct { + #ifdef _BIG_ENDIAN + /* dw0 */ + uint32_t dw4rsvd1:16; + uint32_t num_pages:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t cq_id:10; + uint32_t dw5rsvd2:2; + uint32_t ring_size:4; + uint32_t dw5rsvd1:16; + /* dw3 */ + uint32_t valid:1; + uint32_t dw6rsvd1:31; + /* dw4 */ + uint32_t dw7rsvd1:21; + uint32_t async_cq_id:10; + uint32_t async_cq_valid:1; + #else + /* dw0 */ + uint32_t num_pages:16; + uint32_t dw4rsvd1:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t dw5rsvd1:16; + uint32_t ring_size:4; + uint32_t dw5rsvd2:2; + uint32_t cq_id:10; + /* dw3 */ + uint32_t dw6rsvd1:31; + uint32_t valid:1; + /* dw4 */ + uint32_t async_cq_valid:1; + uint32_t async_cq_id:10; + uint32_t dw7rsvd1:21; + #endif + /* dw5 */ + uint32_t dw8rsvd1; + } v0; + struct { + #ifdef _BIG_ENDIAN + /* dw0 */ + uint32_t cq_id:16; + uint32_t num_pages:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t dw5rsvd2:12; + uint32_t ring_size:4; + uint32_t async_cq_id:16; + /* dw3 */ + uint32_t valid:1; + uint32_t dw6rsvd1:31; + /* dw4 */ + uint32_t dw7rsvd1:31; + uint32_t async_cq_valid:1; + #else + /* dw0 */ + uint32_t num_pages:16; + uint32_t cq_id:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t async_cq_id:16; + uint32_t ring_size:4; + uint32_t dw5rsvd2:12; + /* dw3 */ + uint32_t dw6rsvd1:31; + uint32_t valid:1; + /* dw4 */ + uint32_t async_cq_valid:1; + uint32_t dw7rsvd1:31; + #endif + /* dw5 */ + uint32_t dw8rsvd1; + } v1; + +} oce_mq_ext_ctx_t; + + /* MQ mailbox structure */ struct oce_bmbx { struct oce_mbx mbx; @@ -760,6 +878,7 @@ enum COMMON_SUBSYSTEM_OPCODES { OPCODE_COMMON_SET_BEACON_CONFIG = 69, OPCODE_COMMON_GET_BEACON_CONFIG = 70, OPCODE_COMMON_GET_PHYSICAL_LINK_CONFIG = 71, + OPCODE_COMMON_READ_TRANSRECEIVER_DATA = 73, OPCODE_COMMON_GET_OEM_ATTRIBUTES = 76, OPCODE_COMMON_GET_PORT_NAME = 77, OPCODE_COMMON_GET_CONFIG_SIGNATURE = 78, @@ -1342,6 +1461,23 @@ struct mbx_create_common_mq { } params; }; +struct mbx_create_common_mq_ex { + struct mbx_hdr hdr; + union { + struct { + oce_mq_ext_ctx_t context; + struct phys_addr pages[8]; + } req; + + struct { + uint32_t mq_id:16; + uint32_t rsvd0:16; + } rsp; + } params; +}; + + + /* [53] OPCODE_COMMON_DESTROY_MQ */ struct mbx_destroy_common_mq { struct mbx_hdr hdr; @@ -1584,7 +1720,7 @@ enum CQFW_FUNCTION_MODES_SUPPORTED { FNM_BE3_COMPAT_MODE = 0x10000, /* BE3 features */ FNM_VNIC_MODE = 0x20000, /* Set when IBM vNIC mode is set */ FNM_VNTAG_MODE = 0x40000, /* Set when VNTAG mode is set */ - FNM_UMC_MODE = 0x80000, /* Set when UMC mode is set */ + FNM_UMC_MODE = 0x1000000, /* Set when UMC mode is set */ FNM_UMC_DEF_EN = 0x100000, /* Set when UMC Default is set */ FNM_ONE_GB_EN = 0x200000, /* Set when 1GB Default is set */ FNM_VNIC_DEF_VALID = 0x400000, /* Set when VNIC_DEF_EN is valid */ @@ -1641,6 +1777,12 @@ struct mbx_set_common_iface_rx_filter { } params; }; +struct be_set_eqd { + uint32_t eq_id; + uint32_t phase; + uint32_t dm; +}; + /* [41] OPCODE_COMMON_MODIFY_EQ_DELAY */ struct mbx_modify_common_eq_delay { struct mbx_hdr hdr; @@ -1660,6 +1802,76 @@ struct mbx_modify_common_eq_delay { } params; }; +/* [32] OPCODE_COMMON_GET_CNTL_ATTRIBUTES */ + +struct mgmt_hba_attr { + int8_t flashrom_ver_str[32]; + int8_t manufac_name[32]; + uint32_t supp_modes; + int8_t seeprom_ver_lo; + int8_t seeprom_ver_hi; + int8_t rsvd0[2]; + uint32_t ioctl_data_struct_ver; + uint32_t ep_fw_data_struct_ver; + uint8_t ncsi_ver_str[12]; + uint32_t def_ext_to; + int8_t cntl_mod_num[32]; + int8_t cntl_desc[64]; + int8_t cntl_ser_num[32]; + int8_t ip_ver_str[32]; + int8_t fw_ver_str[32]; + int8_t bios_ver_str[32]; + int8_t redboot_ver_str[32]; + int8_t drv_ver_str[32]; + int8_t fw_on_flash_ver_str[32]; + uint32_t funcs_supp; + uint16_t max_cdblen; + uint8_t asic_rev; + uint8_t gen_guid[16]; + uint8_t hba_port_count; + uint16_t default_link_down_timeout; + uint8_t iscsi_ver_min_max; + uint8_t multifunc_dev; + uint8_t cache_valid; + uint8_t hba_status; + uint8_t max_domains_supp; + uint8_t phy_port; + uint32_t fw_post_status; + uint32_t hba_mtu[8]; + uint8_t iSCSI_feat; + uint8_t asic_gen; + uint8_t future_u8[2]; + uint32_t future_u32[3]; +}; + +struct mgmt_cntl_attr { + struct mgmt_hba_attr hba_attr; + uint16_t pci_vendor_id; + uint16_t pci_device_id; + uint16_t pci_sub_vendor_id; + uint16_t pci_sub_system_id; + uint8_t pci_bus_num; + uint8_t pci_dev_num; + uint8_t pci_func_num; + uint8_t interface_type; + uint64_t unique_id; + uint8_t netfilters; + uint8_t rsvd0[3]; + uint32_t future_u32[4]; +}; + +struct mbx_common_get_cntl_attr { + struct mbx_hdr hdr; + union { + struct { + uint32_t rsvd0; + } req; + struct { + struct mgmt_cntl_attr cntl_attr_info; + } rsp; + } params; +}; + /* [59] OPCODE_ADD_COMMON_IFACE_MAC */ struct mbx_add_common_iface_mac { struct mbx_hdr hdr; @@ -1702,6 +1914,23 @@ struct ioctl_common_function_reset { struct mbx_hdr hdr; }; +/* [73] OPCODE_COMMON_READ_TRANSRECEIVER_DATA */ +struct mbx_read_common_transrecv_data { + struct mbx_hdr hdr; + union { + struct { + uint32_t page_num; + uint32_t port; + } req; + struct { + uint32_t page_num; + uint32_t port; + uint32_t page_data[32]; + } rsp; + } params; + +}; + /* [80] OPCODE_COMMON_FUNCTION_LINK_CONFIG */ struct mbx_common_func_link_cfg { struct mbx_hdr hdr; @@ -2027,7 +2256,9 @@ enum RSS_ENABLE_FLAGS { RSS_ENABLE_IPV4 = 0x1, /* (IPV4 HASH enabled ) */ RSS_ENABLE_TCP_IPV4 = 0x2, /* (TCP IPV4 Hash enabled) */ RSS_ENABLE_IPV6 = 0x4, /* (IPV6 HASH enabled) */ - RSS_ENABLE_TCP_IPV6 = 0x8 /* (TCP IPV6 HASH */ + RSS_ENABLE_TCP_IPV6 = 0x8, /* (TCP IPV6 HASH */ + RSS_ENABLE_UDP_IPV4 = 0x10, /* UDP IPV4 HASH */ + RSS_ENABLE_UDP_IPV6 = 0x20 /* UDP IPV6 HASH */ }; #define RSS_ENABLE (RSS_ENABLE_IPV4 | RSS_ENABLE_TCP_IPV4) #define RSS_DISABLE RSS_ENABLE_NONE Modified: stable/8/sys/dev/oce/oce_if.c ============================================================================== --- stable/8/sys/dev/oce/oce_if.c Fri Mar 8 18:15:07 2013 (r248061) +++ stable/8/sys/dev/oce/oce_if.c Fri Mar 8 18:46:21 2013 (r248062) @@ -71,10 +71,6 @@ static int oce_tx(POCE_SOFTC sc, struct static void oce_tx_restart(POCE_SOFTC sc, struct oce_wq *wq); static void oce_tx_complete(struct oce_wq *wq, uint32_t wqe_idx, uint32_t status); -#if defined(INET6) || defined(INET) -static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, - uint16_t *mss); -#endif static int oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, struct oce_wq *wq); @@ -82,9 +78,6 @@ static int oce_multiq_transmit(struct i static void oce_discard_rx_comp(struct oce_rq *rq, struct oce_nic_rx_cqe *cqe); static int oce_cqe_vtp_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); static int oce_cqe_portid_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); -#if defined(INET6) || defined(INET) -static void oce_rx_flush_lro(struct oce_rq *rq); -#endif static void oce_rx(struct oce_rq *rq, uint32_t rqe_idx, struct oce_nic_rx_cqe *cqe); @@ -96,13 +89,21 @@ static int oce_vid_config(POCE_SOFTC sc static void oce_mac_addr_set(POCE_SOFTC sc); static int oce_handle_passthrough(struct ifnet *ifp, caddr_t data); static void oce_local_timer(void *arg); -#if defined(INET6) || defined(INET) -static int oce_init_lro(POCE_SOFTC sc); -#endif static void oce_if_deactivate(POCE_SOFTC sc); static void oce_if_activate(POCE_SOFTC sc); static void setup_max_queues_want(POCE_SOFTC sc); static void update_queues_got(POCE_SOFTC sc); +static void process_link_state(POCE_SOFTC sc, + struct oce_async_cqe_link_state *acqe); +static int oce_tx_asic_stall_verify(POCE_SOFTC sc, struct mbuf *m); +static struct mbuf *oce_insert_vlan_tag(POCE_SOFTC sc, struct mbuf *m, boolean_t *complete); + +/* IP specific */ +#if defined(INET6) || defined(INET) +static int oce_init_lro(POCE_SOFTC sc); +static void oce_rx_flush_lro(struct oce_rq *rq); +static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp); +#endif static device_method_t oce_dispatch[] = { DEVMETHOD(device_probe, oce_probe), @@ -157,10 +158,10 @@ static uint32_t supportedDevices[] = { static int oce_probe(device_t dev) { - uint16_t vendor; - uint16_t device; - int i; - char str[80]; + uint16_t vendor = 0; + uint16_t device = 0; + int i = 0; + char str[256] = {0}; POCE_SOFTC sc; sc = device_get_softc(dev); @@ -170,11 +171,10 @@ oce_probe(device_t dev) vendor = pci_get_vendor(dev); device = pci_get_device(dev); - for (i = 0; i < (sizeof(supportedDevices) / sizeof(uint16_t)); i++) { + for (i = 0; i < (sizeof(supportedDevices) / sizeof(uint32_t)); i++) { if (vendor == ((supportedDevices[i] >> 16) & 0xffff)) { if (device == (supportedDevices[i] & 0xffff)) { - sprintf(str, "%s:%s", - "Emulex CNA NIC function", + sprintf(str, "%s:%s", "Emulex CNA NIC function", component_revision); device_set_desc_copy(dev, str); @@ -228,37 +228,30 @@ oce_attach(device_t dev) if (rc) goto pci_res_free; - setup_max_queues_want(sc); - rc = oce_setup_intr(sc); if (rc) goto mbox_free; - rc = oce_queue_init_all(sc); if (rc) goto intr_free; - rc = oce_attach_ifp(sc); if (rc) goto queues_free; - #if defined(INET6) || defined(INET) rc = oce_init_lro(sc); if (rc) - goto ifp_free; + goto ifp_free; #endif - rc = oce_hw_start(sc); if (rc) goto lro_free; - sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, oce_add_vlan, sc, EVENTHANDLER_PRI_FIRST); sc->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, @@ -270,7 +263,6 @@ oce_attach(device_t dev) oce_add_sysctls(sc); - callout_init(&sc->timer, CALLOUT_MPSAFE); rc = callout_reset(&sc->timer, 2 * hz, oce_local_timer, sc); if (rc) @@ -315,9 +307,7 @@ oce_detach(device_t dev) POCE_SOFTC sc = device_get_softc(dev); LOCK(&sc->dev_lock); - oce_if_deactivate(sc); - UNLOCK(&sc->dev_lock); callout_drain(&sc->timer); @@ -359,34 +349,11 @@ oce_ioctl(struct ifnet *ifp, u_long comm uint32_t u; switch (command) { - case SIOCGIFPSRCADDR_IN6: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFPSRCADDR: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFSTATUS: - rc = ether_ioctl(ifp, command, data); - break; case SIOCGIFMEDIA: rc = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; - case SIOCSIFMEDIA: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFGENERIC: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGETMIFCNT_IN6: - rc = ether_ioctl(ifp, command, data); - break; - case SIOCSIFMTU: if (ifr->ifr_mtu > OCE_MAX_MTU) rc = EINVAL; @@ -474,7 +441,6 @@ oce_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; oce_vid_config(sc); } - #if defined(INET6) || defined(INET) if (u & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; @@ -518,7 +484,7 @@ oce_multiq_start(struct ifnet *ifp, stru struct oce_wq *wq = NULL; int queue_index = 0; int status = 0; - + if ((m->m_flags & M_FLOWID) != 0) queue_index = m->m_pkthdr.flowid % sc->nwqs; @@ -601,6 +567,7 @@ oce_intr(void *arg, int pending) eq_arm: oce_arm_eq(sc, eq->eq_id, 0, TRUE, FALSE); + return; } @@ -666,6 +633,8 @@ oce_fast_isr(void *arg) taskqueue_enqueue_fast(ii->tq, &ii->task); + ii->eq->intr++; + return FILTER_HANDLED; } @@ -813,9 +782,7 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct oce_nic_frag_wqe *nicfrag; int num_wqes; uint32_t reg_value; -#if defined(INET6) || defined(INET) - uint16_t mss = 0; -#endif + boolean_t complete = TRUE; m = *mpp; if (!m) @@ -826,10 +793,19 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, goto free_ret; } + if(oce_tx_asic_stall_verify(sc, m)) { + m = oce_insert_vlan_tag(sc, m, &complete); + if(!m) { + device_printf(sc->dev, "Insertion unsuccessful\n"); + return 0; + } + + } + if (m->m_pkthdr.csum_flags & CSUM_TSO) { -#if defined(INET6) || defined(INET) /* consolidate packet buffers for TSO/LSO segment offload */ - m = oce_tso_setup(sc, mpp, &mss); +#if defined(INET6) || defined(INET) + m = oce_tso_setup(sc, mpp); #else m = NULL; #endif @@ -873,15 +849,15 @@ retry: nichdr->u0.dw[2] = 0; nichdr->u0.dw[3] = 0; - nichdr->u0.s.complete = 1; + nichdr->u0.s.complete = complete; nichdr->u0.s.event = 1; nichdr->u0.s.crc = 1; nichdr->u0.s.forward = 0; nichdr->u0.s.ipcs = (m->m_pkthdr.csum_flags & CSUM_IP) ? 1 : 0; nichdr->u0.s.udpcs = - (m->m_pkthdr.csum_flags & CSUM_UDP) ? 1 : 0; + (m->m_pkthdr.csum_flags & CSUM_UDP) ? 1 : 0; nichdr->u0.s.tcpcs = - (m->m_pkthdr.csum_flags & CSUM_TCP) ? 1 : 0; + (m->m_pkthdr.csum_flags & CSUM_TCP) ? 1 : 0; nichdr->u0.s.num_wqe = num_wqes; nichdr->u0.s.total_length = m->m_pkthdr.len; if (m->m_flags & M_VLANTAG) { @@ -931,7 +907,7 @@ retry: wq->tx_stats.tx_wrbs += num_wqes; wq->tx_stats.tx_bytes += m->m_pkthdr.len; wq->tx_stats.tx_pkts++; - + bus_dmamap_sync(wq->ring->dma.tag, wq->ring->dma.map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); reg_value = (num_wqes << 16) | wq->wq_id; @@ -1012,9 +988,10 @@ oce_tx_restart(POCE_SOFTC sc, struct oce } + #if defined(INET6) || defined(INET) static struct mbuf * -oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, uint16_t *mss) +oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp) { struct mbuf *m; #ifdef INET @@ -1025,12 +1002,10 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf #endif struct ether_vlan_header *eh; struct tcphdr *th; - int total_len = 0; uint16_t etype; - int ehdrlen = 0; + int total_len = 0, ehdrlen = 0; m = *mpp; - *mss = m->m_pkthdr.tso_segsz; if (M_WRITABLE(m) == 0) { m = m_dup(*mpp, M_DONTWAIT); @@ -1049,7 +1024,6 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf ehdrlen = ETHER_HDR_LEN; } - switch (etype) { #ifdef INET case ETHERTYPE_IP: @@ -1084,7 +1058,6 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf } #endif /* INET6 || INET */ - void oce_tx_task(void *arg, int npending) { @@ -1115,22 +1088,26 @@ oce_start(struct ifnet *ifp) POCE_SOFTC sc = ifp->if_softc; struct mbuf *m; int rc = 0; + int def_q = 0; /* Defualt tx queue is 0*/ if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; + + if (!sc->link_status) + return; do { IF_DEQUEUE(&sc->ifp->if_snd, m); if (m == NULL) break; - /* oce_start always uses default TX queue 0 */ - LOCK(&sc->wq[0]->tx_lock); - rc = oce_tx(sc, &m, 0); - UNLOCK(&sc->wq[0]->tx_lock); + + LOCK(&sc->wq[def_q]->tx_lock); + rc = oce_tx(sc, &m, def_q); + UNLOCK(&sc->wq[def_q]->tx_lock); if (rc) { if (m != NULL) { - sc->wq[0]->tx_stats.tx_stops ++; + sc->wq[def_q]->tx_stats.tx_stops ++; ifp->if_drv_flags |= IFF_DRV_OACTIVE; IFQ_DRV_PREPEND(&ifp->if_snd, m); m = NULL; @@ -1140,7 +1117,7 @@ oce_start(struct ifnet *ifp) if (m != NULL) ETHER_BPF_MTAP(ifp, m); - } while (1); + } while (TRUE); return; } @@ -1248,13 +1225,19 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i uint16_t vtag; len = cqe->u0.s.pkt_size; - vtag = cqe->u0.s.vlan_tag; if (!len) { /*partial DMA workaround for Lancer*/ oce_discard_rx_comp(rq, cqe); goto exit; } + /* Get vlan_tag value */ + if(IS_BE(sc)) + vtag = BSWAP_16(cqe->u0.s.vlan_tag); + else + vtag = cqe->u0.s.vlan_tag; + + for (i = 0; i < cqe->u0.s.num_fragments; i++) { if (rq->packets_out == rq->packets_in) { @@ -1290,7 +1273,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i pd->mbuf->m_pkthdr.csum_data = 0xffff; } if (cqe->u0.s.ip_cksum_pass) { - if (!cqe->u0.s.ip_ver) { //IPV4 + if (!cqe->u0.s.ip_ver) { /* IPV4 */ pd->mbuf->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID); } @@ -1313,24 +1296,20 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i m->m_pkthdr.flowid = rq->queue_index; m->m_flags |= M_FLOWID; #endif - //This deternies if vlan tag is present + /* This deternies if vlan tag is Valid */ if (oce_cqe_vtp_valid(sc, cqe)) { if (sc->function_mode & FNM_FLEX10_MODE) { - /* FLEX10 */ + /* FLEX10. If QnQ is not set, neglect VLAN */ if (cqe->u0.s.qnq) { - /* If QnQ is not set, neglect VLAN */ - if (IS_BE(sc)) - m->m_pkthdr.ether_vtag = - BSWAP_16(vtag); - else - m->m_pkthdr.ether_vtag = vtag; + m->m_pkthdr.ether_vtag = vtag; m->m_flags |= M_VLANTAG; } - } else { - if (IS_BE(sc)) - m->m_pkthdr.ether_vtag = BSWAP_16(vtag); - else - m->m_pkthdr.ether_vtag = vtag; + } else if (sc->pvid != (vtag & VLAN_VID_MASK)) { + /* In UMC mode generally pvid will be striped by + hw. But in some cases we have seen it comes + with pvid. So if pvid == vlan, neglect vlan. + */ + m->m_pkthdr.ether_vtag = vtag; m->m_flags |= M_VLANTAG; } } @@ -1339,7 +1318,6 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i #if defined(INET6) || defined(INET) /* Try to queue to LRO */ if (IF_LRO_ENABLED(sc) && - !(m->m_flags & M_VLANTAG) && (cqe->u0.s.ip_cksum_pass) && (cqe->u0.s.l4_cksum_pass) && (!cqe->u0.s.ip_ver) && @@ -1379,13 +1357,6 @@ oce_discard_rx_comp(struct oce_rq *rq, s POCE_SOFTC sc = (POCE_SOFTC) rq->parent; int num_frags = cqe->u0.s.num_fragments; - if (IS_XE201(sc) && cqe->u0.s.error) { - /* Lancer A0 workaround - * num_frags will be 1 more than actual in case of error - */ - if (num_frags) - num_frags -= 1; - } for (i = 0; i < num_frags; i++) { if (rq->packets_out == rq->packets_in) { device_printf(sc->dev, @@ -1415,9 +1386,8 @@ oce_cqe_vtp_valid(POCE_SOFTC sc, struct if (sc->be3_native) { cqe_v1 = (struct oce_nic_rx_cqe_v1 *)cqe; vtp = cqe_v1->u0.s.vlan_tag_present; - } else { + } else vtp = cqe->u0.s.vlan_tag_present; - } return vtp; @@ -1442,7 +1412,6 @@ oce_cqe_portid_valid(POCE_SOFTC sc, stru } - #if defined(INET6) || defined(INET) static void oce_rx_flush_lro(struct oce_rq *rq) @@ -1482,12 +1451,11 @@ oce_init_lro(POCE_SOFTC sc) return rc; } -#endif /* INET6 || INET */ + void oce_free_lro(POCE_SOFTC sc) { -#if defined(INET6) || defined(INET) struct lro_ctrl *lro = NULL; int i = 0; @@ -1496,9 +1464,8 @@ oce_free_lro(POCE_SOFTC sc) if (lro) tcp_lro_free(lro); } -#endif } - +#endif int oce_alloc_rx_bufs(struct oce_rq *rq, int count) @@ -1511,7 +1478,7 @@ oce_alloc_rx_bufs(struct oce_rq *rq, int struct oce_nic_rqe *rqe; pd_rxulp_db_t rxdb_reg; - + bzero(&rxdb_reg, sizeof(pd_rxulp_db_t)); for (i = 0; i < count; i++) { in = rq->packets_in + 1; if (in == OCE_RQ_PACKET_ARRAY_SIZE) @@ -1552,14 +1519,12 @@ oce_alloc_rx_bufs(struct oce_rq *rq, int } if (added != 0) { for (i = added / OCE_MAX_RQ_POSTS; i > 0; i--) { - DELAY(1); rxdb_reg.bits.num_posted = OCE_MAX_RQ_POSTS; rxdb_reg.bits.qid = rq->rq_id; OCE_WRITE_REG32(sc, db, PD_RXULP_DB, rxdb_reg.dw0); added -= OCE_MAX_RQ_POSTS; } if (added > 0) { - DELAY(1); rxdb_reg.bits.qid = rq->rq_id; rxdb_reg.bits.num_posted = added; OCE_WRITE_REG32(sc, db, PD_RXULP_DB, rxdb_reg.dw0); @@ -1594,13 +1559,8 @@ oce_rq_handler(void *arg) } else { rq->rx_stats.rxcp_err++; sc->ifp->if_ierrors++; - if (IS_XE201(sc)) - /* Lancer A0 no buffer workaround */ - oce_discard_rx_comp(rq, cqe); - else - /* Post L3/L4 errors to stack.*/ - oce_rx(rq, cqe->u0.s.frag_index, cqe); - + /* Post L3/L4 errors to stack.*/ + oce_rx(rq, cqe->u0.s.frag_index, cqe); } rq->rx_stats.rx_compl++; cqe->u0.dw[2] = 0; @@ -1620,6 +1580,7 @@ oce_rq_handler(void *arg) if (num_cqes >= (IS_XE201(sc) ? 8 : oce_max_rsp_handled)) break; } + #if defined(INET6) || defined(INET) if (IF_LRO_ENABLED(sc)) oce_rx_flush_lro(rq); @@ -1682,9 +1643,11 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_capabilities = OCE_IF_CAPABILITIES; sc->ifp->if_capabilities |= IFCAP_HWCSUM; sc->ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; + #if defined(INET6) || defined(INET) sc->ifp->if_capabilities |= IFCAP_TSO; sc->ifp->if_capabilities |= IFCAP_LRO; + sc->ifp->if_capabilities |= IFCAP_VLAN_HWTSO; #endif sc->ifp->if_capenable = sc->ifp->if_capabilities; @@ -1794,18 +1757,18 @@ oce_handle_passthrough(struct ifnet *ifp uint32_t req_size; struct mbx_hdr req; OCE_DMA_MEM dma_mem; - + struct mbx_common_get_cntl_attr *fw_cmd; if (copyin(priv_data, cookie, strlen(IOCTL_COOKIE))) return EFAULT; - + if (memcmp(cookie, IOCTL_COOKIE, strlen(IOCTL_COOKIE))) return EINVAL; - + ioctl_ptr = (char *)priv_data + strlen(IOCTL_COOKIE); if (copyin(ioctl_ptr, &req, sizeof(struct mbx_hdr))) return EFAULT; - + req_size = le32toh(req.u0.req.request_length); if (req_size > 65536) return EINVAL; @@ -1829,12 +1792,86 @@ oce_handle_passthrough(struct ifnet *ifp if (copyout(OCE_DMAPTR(&dma_mem,char), ioctl_ptr, req_size)) rc = EFAULT; + /* + firmware is filling all the attributes for this ioctl except + the driver version..so fill it + */ + if(req.u0.rsp.opcode == OPCODE_COMMON_GET_CNTL_ATTRIBUTES) { + fw_cmd = (struct mbx_common_get_cntl_attr *) ioctl_ptr; + strncpy(fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str, + COMPONENT_REVISION, strlen(COMPONENT_REVISION)); + } + dma_free: oce_dma_free(sc, &dma_mem); return rc; } +static void +oce_eqd_set_periodic(POCE_SOFTC sc) +{ + struct oce_set_eqd set_eqd[OCE_MAX_EQ]; + struct oce_aic_obj *aic; + struct oce_eq *eqo; + uint64_t now = 0, delta; + int eqd, i, num = 0; + uint32_t ips = 0; + int tps; + + for (i = 0 ; i < sc->neqs; i++) { + eqo = sc->eq[i]; + aic = &sc->aic_obj[i]; + /* When setting the static eq delay from the user space */ + if (!aic->enable) { + eqd = aic->et_eqd; + goto modify_eqd; + } + + now = ticks; + + /* Over flow check */ + if ((now < aic->ticks) || (eqo->intr < aic->intr_prev)) + goto done; + + delta = now - aic->ticks; + tps = delta/hz; + + /* Interrupt rate based on elapsed ticks */ + if(tps) + ips = (uint32_t)(eqo->intr - aic->intr_prev) / tps; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 19:01:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D14AF49C; Fri, 8 Mar 2013 19:01:26 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B883B253; Fri, 8 Mar 2013 19:01:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28J1QQT024349; Fri, 8 Mar 2013 19:01:26 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28J1Qi7024348; Fri, 8 Mar 2013 19:01:26 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303081901.r28J1Qi7024348@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 19:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248063 - stable/9/sys/dev/aac 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 19:01:26 -0000 Author: rstone Date: Fri Mar 8 19:01:26 2013 New Revision: 248063 URL: http://svnweb.freebsd.org/changeset/base/248063 Log: MFC r240923 Some aac(4) adapters will always report that a direct access device is offline in response to a INQUIRY command that does not retreive vital product data(I personally have observed the behaviour on an Adaptec 2405 and a 5805). Force the peripheral qualifier to "connected" so that upper layers correctly recognize that a disk is present. This bug was uncovered by r216236. Prior to that fix, aac(4) was accidentally clearing the peripheral qualifier for all inquiry commands. This fixes an issue where passthrough devices were not created for disks behind aac(4) controllers suffering from the bug. I have verified that if a disk is not present that we still properly detect that and not create the passthrough device. Sponsored by: Sandvine Incorporated MFC after: 1 week Modified: stable/9/sys/dev/aac/aac_cam.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aac/aac_cam.c ============================================================================== --- stable/9/sys/dev/aac/aac_cam.c Fri Mar 8 18:46:21 2013 (r248062) +++ stable/9/sys/dev/aac/aac_cam.c Fri Mar 8 19:01:26 2013 (r248063) @@ -527,6 +527,53 @@ aac_cam_poll(struct cam_sim *sim) } static void +aac_cam_fix_inquiry(struct aac_softc *sc, union ccb *ccb) +{ + struct scsi_inquiry_data *inq; + uint8_t *data; + uint8_t device, qual; + + /* If this is an inquiry command, fake things out */ + if (ccb->ccb_h.flags & CAM_CDB_POINTER) + data = ccb->csio.cdb_io.cdb_ptr; + else + data = ccb->csio.cdb_io.cdb_bytes; + + if (data[0] != INQUIRY) + return; + + if (ccb->ccb_h.status == CAM_REQ_CMP) { + inq = (struct scsi_inquiry_data *)ccb->csio.data_ptr; + device = SID_TYPE(inq); + qual = SID_QUAL(inq); + + /* + * We want DASD and PROC devices to only be + * visible through the pass device. + */ + if (((device == T_DIRECT) || + (device == T_PROCESSOR) || + (sc->flags & AAC_FLAGS_CAM_PASSONLY))) { + /* + * Some aac(4) adapters will always report that a direct + * access device is offline in response to a INQUIRY + * command that does not retreive vital product data. + * Force the qualifier to connected so that upper layers + * correctly recognize that a disk is present. + */ + if ((data[1] & SI_EVPD) == 0 && device == T_DIRECT && + qual == SID_QUAL_LU_OFFLINE) + qual = SID_QUAL_LU_CONNECTED; + ccb->csio.data_ptr[0] = (qual << 5) | T_NODEVICE; + } + } else if (ccb->ccb_h.status == CAM_SEL_TIMEOUT && + ccb->ccb_h.target_lun != 0) { + /* fix for INQUIRYs on Lun>0 */ + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + } +} + +static void aac_cam_complete(struct aac_command *cm) { union ccb *ccb; @@ -551,8 +598,6 @@ aac_cam_complete(struct aac_command *cm) /* Take care of SCSI_IO ops. */ if (ccb->ccb_h.func_code == XPT_SCSI_IO) { - u_int8_t command, device; - ccb->csio.scsi_status = srbr->scsi_status; /* Take care of autosense */ @@ -572,31 +617,7 @@ aac_cam_complete(struct aac_command *cm) // scsi_sense_print(&ccb->csio); } - /* If this is an inquiry command, fake things out */ - if (ccb->ccb_h.flags & CAM_CDB_POINTER) - command = ccb->csio.cdb_io.cdb_ptr[0]; - else - command = ccb->csio.cdb_io.cdb_bytes[0]; - - if (command == INQUIRY) { - if (ccb->ccb_h.status == CAM_REQ_CMP) { - device = ccb->csio.data_ptr[0] & 0x1f; - /* - * We want DASD and PROC devices to only be - * visible through the pass device. - */ - if ((device == T_DIRECT) || - (device == T_PROCESSOR) || - (sc->flags & AAC_FLAGS_CAM_PASSONLY)) - ccb->csio.data_ptr[0] = - ((ccb->csio.data_ptr[0] & 0xe0) | - T_NODEVICE); - } else if (ccb->ccb_h.status == CAM_SEL_TIMEOUT && - ccb->ccb_h.target_lun != 0) { - /* fix for INQUIRYs on Lun>0 */ - ccb->ccb_h.status = CAM_DEV_NOT_THERE; - } - } + aac_cam_fix_inquiry(sc, ccb); } } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 19:02:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0161774E; Fri, 8 Mar 2013 19:02:46 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E783B295; Fri, 8 Mar 2013 19:02:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28J2j0O027555; Fri, 8 Mar 2013 19:02:45 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28J2jap027554; Fri, 8 Mar 2013 19:02:45 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303081902.r28J2jap027554@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 19:02:45 +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: r248064 - stable/8/sys/dev/aac 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 19:02:46 -0000 Author: rstone Date: Fri Mar 8 19:02:45 2013 New Revision: 248064 URL: http://svnweb.freebsd.org/changeset/base/248064 Log: MFC r240923 Some aac(4) adapters will always report that a direct access device is offline in response to a INQUIRY command that does not retreive vital product data(I personally have observed the behaviour on an Adaptec 2405 and a 5805). Force the peripheral qualifier to "connected" so that upper layers correctly recognize that a disk is present. This bug was uncovered by r216236. Prior to that fix, aac(4) was accidentally clearing the peripheral qualifier for all inquiry commands. This fixes an issue where passthrough devices were not created for disks behind aac(4) controllers suffering from the bug. I have verified that if a disk is not present that we still properly detect that and not create the passthrough device. Sponsored by: Sandvine Incorporated MFC after: 1 week Modified: stable/8/sys/dev/aac/aac_cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/aac/ (props changed) Modified: stable/8/sys/dev/aac/aac_cam.c ============================================================================== --- stable/8/sys/dev/aac/aac_cam.c Fri Mar 8 19:01:26 2013 (r248063) +++ stable/8/sys/dev/aac/aac_cam.c Fri Mar 8 19:02:45 2013 (r248064) @@ -527,6 +527,53 @@ aac_cam_poll(struct cam_sim *sim) } static void +aac_cam_fix_inquiry(struct aac_softc *sc, union ccb *ccb) +{ + struct scsi_inquiry_data *inq; + uint8_t *data; + uint8_t device, qual; + + /* If this is an inquiry command, fake things out */ + if (ccb->ccb_h.flags & CAM_CDB_POINTER) + data = ccb->csio.cdb_io.cdb_ptr; + else + data = ccb->csio.cdb_io.cdb_bytes; + + if (data[0] != INQUIRY) + return; + + if (ccb->ccb_h.status == CAM_REQ_CMP) { + inq = (struct scsi_inquiry_data *)ccb->csio.data_ptr; + device = SID_TYPE(inq); + qual = SID_QUAL(inq); + + /* + * We want DASD and PROC devices to only be + * visible through the pass device. + */ + if (((device == T_DIRECT) || + (device == T_PROCESSOR) || + (sc->flags & AAC_FLAGS_CAM_PASSONLY))) { + /* + * Some aac(4) adapters will always report that a direct + * access device is offline in response to a INQUIRY + * command that does not retreive vital product data. + * Force the qualifier to connected so that upper layers + * correctly recognize that a disk is present. + */ + if ((data[1] & SI_EVPD) == 0 && device == T_DIRECT && + qual == SID_QUAL_LU_OFFLINE) + qual = SID_QUAL_LU_CONNECTED; + ccb->csio.data_ptr[0] = (qual << 5) | T_NODEVICE; + } + } else if (ccb->ccb_h.status == CAM_SEL_TIMEOUT && + ccb->ccb_h.target_lun != 0) { + /* fix for INQUIRYs on Lun>0 */ + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + } +} + +static void aac_cam_complete(struct aac_command *cm) { union ccb *ccb; @@ -551,8 +598,6 @@ aac_cam_complete(struct aac_command *cm) /* Take care of SCSI_IO ops. */ if (ccb->ccb_h.func_code == XPT_SCSI_IO) { - u_int8_t command, device; - ccb->csio.scsi_status = srbr->scsi_status; /* Take care of autosense */ @@ -572,31 +617,7 @@ aac_cam_complete(struct aac_command *cm) // scsi_sense_print(&ccb->csio); } - /* If this is an inquiry command, fake things out */ - if (ccb->ccb_h.flags & CAM_CDB_POINTER) - command = ccb->csio.cdb_io.cdb_ptr[0]; - else - command = ccb->csio.cdb_io.cdb_bytes[0]; - - if (command == INQUIRY) { - if (ccb->ccb_h.status == CAM_REQ_CMP) { - device = ccb->csio.data_ptr[0] & 0x1f; - /* - * We want DASD and PROC devices to only be - * visible through the pass device. - */ - if ((device == T_DIRECT) || - (device == T_PROCESSOR) || - (sc->flags & AAC_FLAGS_CAM_PASSONLY)) - ccb->csio.data_ptr[0] = - ((ccb->csio.data_ptr[0] & 0xe0) | - T_NODEVICE); - } else if (ccb->ccb_h.status == CAM_SEL_TIMEOUT && - ccb->ccb_h.target_lun != 0) { - /* fix for INQUIRYs on Lun>0 */ - ccb->ccb_h.status = CAM_DEV_NOT_THERE; - } - } + aac_cam_fix_inquiry(sc, ccb); } } From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 19:36:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D336BEA1; Fri, 8 Mar 2013 19:36:36 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C574EC41; Fri, 8 Mar 2013 19:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28JaaSO037760; Fri, 8 Mar 2013 19:36:36 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28JaaN9037759; Fri, 8 Mar 2013 19:36:36 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303081936.r28JaaN9037759@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 19:36:36 +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: r248066 - stable/9/sys/netgraph 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 19:36:36 -0000 Author: rstone Date: Fri Mar 8 19:36:36 2013 New Revision: 248066 URL: http://svnweb.freebsd.org/changeset/base/248066 Log: MFC r241009 Ensure that all cases that enqueue a netgraph item for delivery by a ngthread properly set the item's depth to 1. In particular, prior to this change if ng_snd_item failed to acquire a lock on a node, the item's depth would not be set at all. This fix ensures that the error code from rcvmsg/ rcvdata is properly passed back to the apply callback. For example, this fixes a bug where an error from rcvmsg/rcvdata would not previously propagate back to a libnetgraph consumer when the message was queued. Reviewed by: mav MFC after: 1 month Sponsored by: Sandvine Incorporated Modified: stable/9/sys/netgraph/ng_base.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/ng_base.c ============================================================================== --- stable/9/sys/netgraph/ng_base.c Fri Mar 8 19:16:24 2013 (r248065) +++ stable/9/sys/netgraph/ng_base.c Fri Mar 8 19:36:36 2013 (r248066) @@ -2005,6 +2005,7 @@ ng_queue_rw(node_p node, item_p item, i NGI_SET_WRITER(item); else NGI_SET_READER(item); + item->depth = 1; NG_QUEUE_LOCK(ngq); /* Set OP_PENDING flag and enqueue the item. */ @@ -2283,7 +2284,6 @@ ng_snd_item(item_p item, int flags) } if (queue) { - item->depth = 1; /* Put it on the queue for that node*/ ng_queue_rw(node, item, rw); return ((flags & NG_PROGRESS) ? EINPROGRESS : 0); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 19:36:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 59D99FC4; Fri, 8 Mar 2013 19:36:45 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E1C7BCB9; Fri, 8 Mar 2013 19:36:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28Jai9X037816; Fri, 8 Mar 2013 19:36:44 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28JaiBO037815; Fri, 8 Mar 2013 19:36:44 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303081936.r28JaiBO037815@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 19:36:44 +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: r248067 - stable/8/sys/netgraph 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 19:36:45 -0000 Author: rstone Date: Fri Mar 8 19:36:44 2013 New Revision: 248067 URL: http://svnweb.freebsd.org/changeset/base/248067 Log: MFC r241009 Ensure that all cases that enqueue a netgraph item for delivery by a ngthread properly set the item's depth to 1. In particular, prior to this change if ng_snd_item failed to acquire a lock on a node, the item's depth would not be set at all. This fix ensures that the error code from rcvmsg/ rcvdata is properly passed back to the apply callback. For example, this fixes a bug where an error from rcvmsg/rcvdata would not previously propagate back to a libnetgraph consumer when the message was queued. Reviewed by: mav MFC after: 1 month Sponsored by: Sandvine Incorporated Modified: stable/8/sys/netgraph/ng_base.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netgraph/ (props changed) Modified: stable/8/sys/netgraph/ng_base.c ============================================================================== --- stable/8/sys/netgraph/ng_base.c Fri Mar 8 19:36:36 2013 (r248066) +++ stable/8/sys/netgraph/ng_base.c Fri Mar 8 19:36:44 2013 (r248067) @@ -1947,6 +1947,7 @@ ng_queue_rw(node_p node, item_p item, i NGI_SET_WRITER(item); else NGI_SET_READER(item); + item->depth = 1; NG_QUEUE_LOCK(ngq); /* Set OP_PENDING flag and enqueue the item. */ @@ -2225,7 +2226,6 @@ ng_snd_item(item_p item, int flags) } if (queue) { - item->depth = 1; /* Put it on the queue for that node*/ ng_queue_rw(node, item, rw); return ((flags & NG_PROGRESS) ? EINPROGRESS : 0); From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 20:07:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A9866CA; Fri, 8 Mar 2013 20:07:33 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5C328809; Fri, 8 Mar 2013 20:07:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28K7XVs047055; Fri, 8 Mar 2013 20:07:33 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28K7XQH047053; Fri, 8 Mar 2013 20:07:33 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201303082007.r28K7XQH047053@svn.freebsd.org> From: Sean Bruno Date: Fri, 8 Mar 2013 20:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248068 - in head: sbin/geom/class/raid sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 20:07:33 -0000 Author: sbruno Date: Fri Mar 8 20:07:32 2013 New Revision: 248068 URL: http://svnweb.freebsd.org/changeset/base/248068 Log: Add legacy support to geom raid to create a /dev/arX device for support of upgrading older machines using ataraid(4) to newer releases. This optional parameter is controlled via kern.geom.raid.legacy_aliases and will create a /dev/ar0 device that will point at /dev/raid/r0 for example. Tested on Dell SC 1425 DDF-1 format software raid controllers installing from stable/7 and upgrading to stable/9 without having to adjust /etc/fstab Reviewed by: mav Obtained from: Yahoo! MFC after: 2 Weeks Modified: head/sbin/geom/class/raid/graid.8 head/sys/geom/raid/g_raid.c Modified: head/sbin/geom/class/raid/graid.8 ============================================================================== --- head/sbin/geom/class/raid/graid.8 Fri Mar 8 19:36:44 2013 (r248067) +++ head/sbin/geom/class/raid/graid.8 Fri Mar 8 20:07:32 2013 (r248068) @@ -305,6 +305,9 @@ Write errors are always considered as di Time to wait for missing array components on startup. .It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 Enable taste for specific metadata or transformation module. +.It Va kern.geom.raid.legacy_aliases : No 0 +Enable geom raid emulation of /dev/ar%d devices from ataraid(4) +This should aid the upgrade of systems from legacy to modern releases. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Fri Mar 8 19:36:44 2013 (r248067) +++ head/sys/geom/raid/g_raid.c Fri Mar 8 20:07:32 2013 (r248068) @@ -92,6 +92,11 @@ TUNABLE_INT("kern.geom.raid.idle_thresho SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idle_threshold, CTLFLAG_RW, &g_raid_idle_threshold, 1000000, "Time in microseconds to consider a volume idle."); +static u_int ar_legacy_aliases = 1; +SYSCTL_INT(_kern_geom_raid, OID_AUTO, legacy_aliases, CTLFLAG_RW, + &ar_legacy_aliases, 0, "Create aliases named as the legacy ataraid style."); +TUNABLE_INT("kern.geom_raid.legacy_aliases", &ar_legacy_aliases); + #define MSLEEP(rv, ident, mtx, priority, wmesg, timeout) do { \ G_RAID_DEBUG(4, "%s: Sleeping %p.", __func__, (ident)); \ @@ -1637,6 +1642,7 @@ g_raid_launch_provider(struct g_raid_vol struct g_raid_softc *sc; struct g_provider *pp; char name[G_RAID_MAX_VOLUMENAME]; + char announce_buf[80], buf1[32]; off_t off; sc = vol->v_softc; @@ -1650,6 +1656,22 @@ g_raid_launch_provider(struct g_raid_vol /* Otherwise use sequential volume number. */ snprintf(name, sizeof(name), "raid/r%d", vol->v_global_id); } + + /* + * Create a /dev/ar%d that the old ataraid(4) stack once + * created as an alias for /dev/raid/r%d if requested. + * This helps going from stable/7 ataraid devices to newer + * FreeBSD releases. sbruno 07 MAY 2013 + */ + + if (ar_legacy_aliases) { + snprintf(announce_buf, sizeof(announce_buf), + "kern.devalias.%s", name); + snprintf(buf1, sizeof(buf1), + "ar%d", vol->v_global_id); + setenv(announce_buf, buf1); + } + pp = g_new_providerf(sc->sc_geom, "%s", name); pp->private = vol; pp->mediasize = vol->v_mediasize; From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 20:23:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CBE67CA9; Fri, 8 Mar 2013 20:23:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD4908B9; Fri, 8 Mar 2013 20:23:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28KNvbd054407; Fri, 8 Mar 2013 20:23:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28KNufc054395; Fri, 8 Mar 2013 20:23:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303082023.r28KNufc054395@svn.freebsd.org> From: Adrian Chadd Date: Fri, 8 Mar 2013 20:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248069 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 20:23:57 -0000 Author: adrian Date: Fri Mar 8 20:23:55 2013 New Revision: 248069 URL: http://svnweb.freebsd.org/changeset/base/248069 Log: Bring over my initial work from the net80211 TX locking branch. This patchset implements a new TX lock, covering both the per-VAP (and thus per-node) TX locking and the serialisation through to the underlying physical device. This implements the hard requirement that frames to the underlying physical device are scheduled to the underlying device in the same order that they are processed at the VAP layer. This includes adding extra encapsulation state (such as sequence numbers and CCMP IV numbers.) Any order mismatch here will result in dropped packets at the receiver. There are multiple transmit contexts from the upper protocol layers as well as the "raw" interface via the management and BPF transmit paths. All of these need to be correctly serialised or bad behaviour will result under load. The specifics: * add a new TX IC lock - it will eventually just be used for serialisation to the underlying physical device but for now it's used for both the VAP encapsulation/serialisation and the physical device dispatch. This lock is specifically non-recursive. * Methodize the parent transmit, vap transmit and ic_raw_xmit function pointers; use lock assertions in the parent/vap transmit routines. * Add a lock assertion in ieee80211_encap() - the TX lock must be held here to guarantee sensible behaviour. * Refactor out the packet sending code from ieee80211_start() - now ieee80211_start() is just a loop over the ifnet queue and it dispatches each VAP packet send through ieee80211_start_pkt(). Yes, I will likely rename ieee80211_start_pkt() to something that better reflects its status as a VAP packet transmit path. More on that later. * Add locking around the management and BAR TX sending - to ensure that encapsulation and TX are done hand-in-hand. * Add locking in the mesh code - again, to ensure that encapsulation and mesh transmit are done hand-in-hand. * Add locking around the power save queue and ageq handling, when dispatching to the parent interface. * Add locking around the WDS handoff. * Add a note in the mesh dispatch code that the TX path needs to be re-thought-out - right now it's doing a direct parent device transmit rather than going via the vap layer. It may "work", but it's likely incorrect (as it bypasses any possible per-node power save and aggregation handling.) Why not a per-VAP or per-node lock? Because in order to ensure per-VAP ordering, we'd have to hold the VAP lock across parent->if_transmit(). There are a few problems with this: * There's some state being setup during each driver transmit - specifically, the encryption encap / CCMP IV setup. That should eventually be dragged back into the encapsulation phase but for now it lives in the driver TX path. This should be locked. * Two drivers (ath, iwn) re-use the node->ni_txseqs array in order to allocate sequence numbers when doing transmit aggregation. This should also be locked. * Drivers may have multiple frames queued already - so when one calls if_transmit(), it may end up dispatching multiple frames for different VAPs/nodes, each needing a different lock when handling that particular end destination. So to be "correct" locking-wise, we'd end up needing to grab a VAP or node lock inside the driver TX path when setting up crypto / AMPDU sequence numbers, and we may already _have_ a TX lock held - mostly for the same destination vap/node, but sometimes it'll be for others. That could lead to LORs and thus deadlocks. So for now, I'm sticking with an IC TX lock. It has the advantage of papering over the above and it also has the added advantage that I can assert that it's being held when doing a parent device transmit. I'll look at splitting the locks out a bit more later on. General outstanding net80211 TX path issues / TODO: * Look into separating out the VAP serialisation and the IC handoff. It's going to be tricky as parent->if_transmit() doesn't give me the opportunity to split queuing from driver dispatch. See above. * Work with monthadar to fix up the mesh transmit path so it doesn't go via the parent interface when retransmitting frames. * Push the encryption handling back into the driver, if it's at all architectually sane to do so. I know it's possible - it's what mac80211 in Linux does. * Make ieee80211_raw_xmit() queue a frame into VAP or parent queue rather than doing a short-cut direct into the driver. There are QoS issues here - you do want your management frames to be encapsulated and pushed onto the stack sooner than the (large, bursty) amount of data frames that are queued. But there has to be a saner way to do this. * Fragments are still broken - drivers need to be upgraded to an if_transmit() implementation and then fragmentation handling needs to be properly fixed. Tested: * STA - AR5416, AR9280, Intel 5300 abgn wifi * Hostap - AR5416, AR9160, AR9280 * Mesh - some testing by monthadar@, more to come. Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_superg.c head/sys/net80211/ieee80211_var.h head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Mar 8 20:07:32 2013 (r248068) +++ head/sys/net80211/ieee80211.c Fri Mar 8 20:23:55 2013 (r248069) @@ -278,6 +278,7 @@ ieee80211_ifattach(struct ieee80211com * KASSERT(ifp->if_type == IFT_IEEE80211, ("if_type %d", ifp->if_type)); IEEE80211_LOCK_INIT(ic, ifp->if_xname); + IEEE80211_TX_LOCK_INIT(ic, ifp->if_xname); TAILQ_INIT(&ic->ic_vaps); /* Create a taskqueue for all state changes */ @@ -385,6 +386,7 @@ ieee80211_ifdetach(struct ieee80211com * ifmedia_removeall(&ic->ic_media); taskqueue_free(ic->ic_tq); + IEEE80211_TX_LOCK_DESTROY(ic); IEEE80211_LOCK_DESTROY(ic); } Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Fri Mar 8 20:07:32 2013 (r248068) +++ head/sys/net80211/ieee80211_freebsd.c Fri Mar 8 20:23:55 2013 (r248069) @@ -504,6 +504,44 @@ ieee80211_process_callback(struct ieee80 } } +/* + * Transmit a frame to the parent interface. + * + * TODO: if the transmission fails, make sure the parent node is freed + * (the callers will first need modifying.) + */ +int +ieee80211_parent_transmit(struct ieee80211com *ic, + struct mbuf *m) +{ + struct ifnet *parent = ic->ic_ifp; + /* + * Assert the IC TX lock is held - this enforces the + * processing -> queuing order is maintained + */ + IEEE80211_TX_LOCK_ASSERT(ic); + + return (parent->if_transmit(parent, m)); +} + +/* + * Transmit a frame to the VAP interface. + */ +int +ieee80211_vap_transmit(struct ieee80211vap *vap, struct mbuf *m) +{ + struct ifnet *ifp = vap->iv_ifp; + + /* + * When transmitting via the VAP, we shouldn't hold + * any IC TX lock as the VAP TX path will acquire it. + */ + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); + + return (ifp->if_transmit(ifp, m)); + +} + #include void Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Fri Mar 8 20:07:32 2013 (r248068) +++ head/sys/net80211/ieee80211_freebsd.h Fri Mar 8 20:23:55 2013 (r248069) @@ -57,6 +57,30 @@ typedef struct { mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_NOTOWNED) /* + * Transmit lock. + * + * This is a (mostly) temporary lock designed to serialise all of the + * transmission operations throughout the stack. + */ +typedef struct { + char name[16]; /* e.g. "ath0_com_lock" */ + struct mtx mtx; +} ieee80211_tx_lock_t; +#define IEEE80211_TX_LOCK_INIT(_ic, _name) do { \ + ieee80211_tx_lock_t *cl = &(_ic)->ic_txlock; \ + snprintf(cl->name, sizeof(cl->name), "%s_tx_lock", _name); \ + mtx_init(&cl->mtx, cl->name, NULL, MTX_DEF); \ +} while (0) +#define IEEE80211_TX_LOCK_OBJ(_ic) (&(_ic)->ic_txlock.mtx) +#define IEEE80211_TX_LOCK_DESTROY(_ic) mtx_destroy(IEEE80211_TX_LOCK_OBJ(_ic)) +#define IEEE80211_TX_LOCK(_ic) mtx_lock(IEEE80211_TX_LOCK_OBJ(_ic)) +#define IEEE80211_TX_UNLOCK(_ic) mtx_unlock(IEEE80211_TX_LOCK_OBJ(_ic)) +#define IEEE80211_TX_LOCK_ASSERT(_ic) \ + mtx_assert(IEEE80211_TX_LOCK_OBJ(_ic), MA_OWNED) +#define IEEE80211_TX_UNLOCK_ASSERT(_ic) \ + mtx_assert(IEEE80211_TX_LOCK_OBJ(_ic), MA_NOTOWNED) + +/* * Node locking definitions. */ typedef struct { @@ -272,9 +296,11 @@ int ieee80211_add_callback(struct mbuf * void (*func)(struct ieee80211_node *, void *, int), void *arg); void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int); -void get_random_bytes(void *, size_t); - struct ieee80211com; +int ieee80211_parent_transmit(struct ieee80211com *, struct mbuf *); +int ieee80211_vap_transmit(struct ieee80211vap *, struct mbuf *); + +void get_random_bytes(void *, size_t); void ieee80211_sysctl_attach(struct ieee80211com *); void ieee80211_sysctl_detach(struct ieee80211com *); Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Fri Mar 8 20:07:32 2013 (r248068) +++ head/sys/net80211/ieee80211_hostap.c Fri Mar 8 20:23:55 2013 (r248069) @@ -412,7 +412,7 @@ hostap_deliver_data(struct ieee80211vap if (mcopy != NULL) { int len, err; len = mcopy->m_pkthdr.len; - err = ifp->if_transmit(ifp, mcopy); + err = ieee80211_vap_transmit(vap, mcopy); if (err) { /* NB: IFQ_HANDOFF reclaims mcopy */ } else { @@ -2255,8 +2255,8 @@ void ieee80211_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0) { struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = vap->iv_ic; struct ieee80211_frame_min *wh; - struct ifnet *ifp; struct mbuf *m; uint16_t aid; int qlen; @@ -2320,23 +2320,15 @@ ieee80211_recv_pspoll(struct ieee80211_n } m->m_flags |= M_PWR_SAV; /* bypass PS handling */ - if (m->m_flags & M_ENCAP) - ifp = vap->iv_ic->ic_ifp; - else - ifp = vap->iv_ifp; - /* - * Free any node ref which this mbuf may have. - * - * Much like psq_mfree(), we assume that M_ENCAP nodes have - * node references. + * Do the right thing; if it's an encap'ed frame then + * call ieee80211_parent_transmit() (and free the ref) else + * call ieee80211_vap_transmit(). */ - if (ifp->if_transmit(ifp, m) != 0) { - /* - * XXX m is invalid (freed) at this point, determine M_ENCAP - * an alternate way. - */ - if (ifp == vap->iv_ic->ic_ifp) + if (m->m_flags & M_ENCAP) { + if (ieee80211_parent_transmit(ic, m) != 0) ieee80211_free_node(ni); + } else { + (void) ieee80211_vap_transmit(vap, m); } } Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Fri Mar 8 20:07:32 2013 (r248068) +++ head/sys/net80211/ieee80211_ht.c Fri Mar 8 20:23:55 2013 (r248069) @@ -2392,7 +2392,9 @@ ieee80211_send_bar(struct ieee80211_node * ic_raw_xmit will free the node reference * regardless of queue/TX success or failure. */ - ret = ic->ic_raw_xmit(ni, m, NULL); + IEEE80211_TX_LOCK(ic); + ret = ieee80211_raw_output(vap, ni, m, NULL); + IEEE80211_TX_UNLOCK(ic); if (ret != 0) { IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_11N, ni, "send BAR: failed: (ret = %d)\n", Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Fri Mar 8 20:07:32 2013 (r248068) +++ head/sys/net80211/ieee80211_hwmp.c Fri Mar 8 20:23:55 2013 (r248069) @@ -592,6 +592,7 @@ hwmp_send_action(struct ieee80211vap *va struct ieee80211_bpf_params params; struct mbuf *m; uint8_t *frm; + int ret; if (IEEE80211_IS_MULTICAST(da)) { ni = ieee80211_ref_node(vap->iv_bss); @@ -654,6 +655,9 @@ hwmp_send_action(struct ieee80211vap *va vap->iv_stats.is_tx_nobuf++; return ENOMEM; } + + IEEE80211_TX_LOCK(ic); + ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, IEEE80211_NONQOS_TID, vap->iv_myaddr, da, vap->iv_myaddr); @@ -669,7 +673,9 @@ hwmp_send_action(struct ieee80211vap *va else params.ibp_try0 = ni->ni_txparms->maxretry; params.ibp_power = ni->ni_txpower; - return ic->ic_raw_xmit(ni, m, ¶ms); + ret = ieee80211_raw_output(vap, ni, m, ¶ms); + IEEE80211_TX_UNLOCK(ic); + return (ret); } #define ADDSHORT(frm, v) do { \ @@ -1271,12 +1277,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_mesh_route *rtext = NULL; struct ieee80211_hwmp_route *hr; struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = vap->iv_ifp; struct mbuf *m, *next; uint32_t metric = 0; const uint8_t *addr; - int is_encap; - struct ieee80211_node *ni_encap; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "received PREP, orig %6D, targ %6D", prep->prep_origaddr, ":", @@ -1450,22 +1453,21 @@ hwmp_recv_prep(struct ieee80211vap *vap, m = ieee80211_ageq_remove(&ic->ic_stageq, (struct ieee80211_node *)(uintptr_t) ieee80211_mac_hash(ic, addr)); /* either dest or ext_dest */ + + /* + * All frames in the stageq here should be non-M_ENCAP; or things + * will get very unhappy. + */ for (; m != NULL; m = next) { - is_encap = !! (m->m_flags & M_ENCAP); - ni_encap = (struct ieee80211_node *) m->m_pkthdr.rcvif; next = m->m_nextpkt; m->m_nextpkt = NULL; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "flush queued frame %p len %d", m, m->m_pkthdr.len); - /* * If the mbuf has M_ENCAP set, ensure we free it. * Note that after if_transmit() is called, m is invalid. */ - if (ifp->if_transmit(ifp, m) != 0) { - if (is_encap) - ieee80211_free_node(ni_encap); - } + (void) ieee80211_vap_transmit(vap, m); } #undef IS_PROXY #undef PROXIED_BY_US Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Fri Mar 8 20:07:32 2013 (r248068) +++ head/sys/net80211/ieee80211_mesh.c Fri Mar 8 20:23:55 2013 (r248069) @@ -1041,11 +1041,12 @@ mesh_transmit_to_gate(struct ieee80211va { struct ifnet *ifp = vap->iv_ifp; struct ieee80211com *ic = vap->iv_ic; - struct ifnet *parent = ic->ic_ifp; struct ieee80211_node *ni; struct ether_header *eh; int error; + IEEE80211_TX_UNLOCK_ASSERT(ic); + eh = mtod(m, struct ether_header *); ni = ieee80211_mesh_find_txnode(vap, rt_gate->rt_dest); if (ni == NULL) { @@ -1132,6 +1133,8 @@ mesh_transmit_to_gate(struct ieee80211va } } #endif /* IEEE80211_SUPPORT_SUPERG */ + + IEEE80211_TX_LOCK(ic); if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { /* * Encapsulate the packet in prep for transmission. @@ -1143,9 +1146,9 @@ mesh_transmit_to_gate(struct ieee80211va return; } } - error = parent->if_transmit(parent, m); + error = ieee80211_parent_transmit(ic, m); + IEEE80211_TX_UNLOCK(ic); if (error != 0) { - m_freem(m); ieee80211_free_node(ni); } else { ifp->if_opackets++; @@ -1171,6 +1174,8 @@ ieee80211_mesh_forward_to_gates(struct i struct ieee80211_mesh_gate_route *gr = NULL, *gr_next; struct mbuf *m, *mcopy, *next; + IEEE80211_TX_UNLOCK_ASSERT(ic); + KASSERT( rt_dest->rt_flags == IEEE80211_MESHRT_FLAGS_DISCOVER, ("Route is not marked with IEEE80211_MESHRT_FLAGS_DISCOVER")); @@ -1240,7 +1245,6 @@ mesh_forward(struct ieee80211vap *vap, s struct ieee80211com *ic = vap->iv_ic; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ifnet *ifp = vap->iv_ifp; - struct ifnet *parent = ic->ic_ifp; const struct ieee80211_frame *wh = mtod(m, const struct ieee80211_frame *); struct mbuf *mcopy; @@ -1249,6 +1253,9 @@ mesh_forward(struct ieee80211vap *vap, s struct ieee80211_node *ni; int err; + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + /* * mesh ttl of 1 means we are the last one receving it, * according to amendment we decrement and then check if @@ -1320,7 +1327,20 @@ mesh_forward(struct ieee80211vap *vap, s /* XXX do we know m_nextpkt is NULL? */ mcopy->m_pkthdr.rcvif = (void *) ni; - err = parent->if_transmit(parent, mcopy); + + /* + * XXX this bypasses all of the VAP TX handling; it passes frames + * directly to the parent interface. + * + * Because of this, there's no TX lock being held as there's no + * encaps state being used. + * + * Doing a direct parent transmit may not be the correct thing + * to do here; we'll have to re-think this soon. + */ + IEEE80211_TX_LOCK(ic); + err = ieee80211_parent_transmit(ic, mcopy); + IEEE80211_TX_UNLOCK(ic); if (err != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); @@ -1457,6 +1477,10 @@ mesh_recv_indiv_data_to_fwrd(struct ieee struct ieee80211_qosframe_addr4 *qwh; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt_meshda, *rt_meshsa; + struct ieee80211com *ic = vap->iv_ic; + + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; @@ -1512,8 +1536,12 @@ mesh_recv_indiv_data_to_me(struct ieee80 const struct ieee80211_meshcntl_ae10 *mc10; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt; + struct ieee80211com *ic = vap->iv_ic; int ae; + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + qwh = (struct ieee80211_qosframe_addr4 *)wh; mc10 = (const struct ieee80211_meshcntl_ae10 *)mc; @@ -1575,6 +1603,10 @@ mesh_recv_group_data(struct ieee80211vap { #define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc) struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211com *ic = vap->iv_ic; + + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); mesh_forward(vap, m, mc); @@ -1621,6 +1653,9 @@ mesh_input(struct ieee80211_node *ni, st need_tap = 1; /* mbuf need to be tapped. */ type = -1; /* undefined */ + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, ni->ni_macaddr, NULL, @@ -2743,6 +2778,7 @@ mesh_send_action(struct ieee80211_node * struct ieee80211com *ic = ni->ni_ic; struct ieee80211_bpf_params params; struct ieee80211_frame *wh; + int ret; KASSERT(ni != NULL, ("null node")); @@ -2761,6 +2797,7 @@ mesh_send_action(struct ieee80211_node * return ENOMEM; } + IEEE80211_TX_LOCK(ic); wh = mtod(m, struct ieee80211_frame *); ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, @@ -2778,7 +2815,9 @@ mesh_send_action(struct ieee80211_node * IEEE80211_NODE_STAT(ni, tx_mgmt); - return ic->ic_raw_xmit(ni, m, ¶ms); + ret = ieee80211_raw_output(vap, ni, m, ¶ms); + IEEE80211_TX_UNLOCK(ic); + return (ret); } #define ADDSHORT(frm, v) do { \ Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Mar 8 20:07:32 2013 (r248068) +++ head/sys/net80211/ieee80211_output.c Fri Mar 8 20:23:55 2013 (r248069) @@ -110,6 +110,255 @@ doprint(struct ieee80211vap *vap, int su #endif /* + * Send the given mbuf through the given vap. + * + * This consumes the mbuf regardless of whether the transmit + * was successful or not. + * + * This does none of the initial checks that ieee80211_start() + * does (eg CAC timeout, interface wakeup) - the caller must + * do this first. + */ +static int +ieee80211_start_pkt(struct ieee80211vap *vap, struct mbuf *m) +{ +#define IS_DWDS(vap) \ + (vap->iv_opmode == IEEE80211_M_WDS && \ + (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) == 0) + struct ieee80211com *ic = vap->iv_ic; + struct ifnet *ifp = vap->iv_ifp; + struct ieee80211_node *ni; + struct ether_header *eh; + int error; + + /* + * Cancel any background scan. + */ + if (ic->ic_flags & IEEE80211_F_SCAN) + ieee80211_cancel_anyscan(vap); + /* + * Find the node for the destination so we can do + * things like power save and fast frames aggregation. + * + * NB: past this point various code assumes the first + * mbuf has the 802.3 header present (and contiguous). + */ + ni = NULL; + if (m->m_len < sizeof(struct ether_header) && + (m = m_pullup(m, sizeof(struct ether_header))) == NULL) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, + "discard frame, %s\n", "m_pullup failed"); + vap->iv_stats.is_tx_nobuf++; /* XXX */ + ifp->if_oerrors++; + return (ENOBUFS); + } + eh = mtod(m, struct ether_header *); + if (ETHER_IS_MULTICAST(eh->ether_dhost)) { + if (IS_DWDS(vap)) { + /* + * Only unicast frames from the above go out + * DWDS vaps; multicast frames are handled by + * dispatching the frame as it comes through + * the AP vap (see below). + */ + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_WDS, + eh->ether_dhost, "mcast", "%s", "on DWDS"); + vap->iv_stats.is_dwds_mcast++; + m_freem(m); + /* XXX better status? */ + return (ENOBUFS); + } + if (vap->iv_opmode == IEEE80211_M_HOSTAP) { + /* + * Spam DWDS vap's w/ multicast traffic. + */ + /* XXX only if dwds in use? */ + ieee80211_dwds_mcast(vap, m); + } + } +#ifdef IEEE80211_SUPPORT_MESH + if (vap->iv_opmode != IEEE80211_M_MBSS) { +#endif + ni = ieee80211_find_txnode(vap, eh->ether_dhost); + if (ni == NULL) { + /* NB: ieee80211_find_txnode does stat+msg */ + ifp->if_oerrors++; + m_freem(m); + /* XXX better status? */ + return (ENOBUFS); + } + if (ni->ni_associd == 0 && + (ni->ni_flags & IEEE80211_NODE_ASSOCID)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, + eh->ether_dhost, NULL, + "sta not associated (type 0x%04x)", + htons(eh->ether_type)); + vap->iv_stats.is_tx_notassoc++; + ifp->if_oerrors++; + m_freem(m); + ieee80211_free_node(ni); + /* XXX better status? */ + return (ENOBUFS); + } +#ifdef IEEE80211_SUPPORT_MESH + } else { + if (!IEEE80211_ADDR_EQ(eh->ether_shost, vap->iv_myaddr)) { + /* + * Proxy station only if configured. + */ + if (!ieee80211_mesh_isproxyena(vap)) { + IEEE80211_DISCARD_MAC(vap, + IEEE80211_MSG_OUTPUT | + IEEE80211_MSG_MESH, + eh->ether_dhost, NULL, + "%s", "proxy not enabled"); + vap->iv_stats.is_mesh_notproxy++; + ifp->if_oerrors++; + m_freem(m); + /* XXX better status? */ + return (ENOBUFS); + } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, + "forward frame from DS SA(%6D), DA(%6D)\n", + eh->ether_shost, ":", + eh->ether_dhost, ":"); + ieee80211_mesh_proxy_check(vap, eh->ether_shost); + } + ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m); + if (ni == NULL) { + /* + * NB: ieee80211_mesh_discover holds/disposes + * frame (e.g. queueing on path discovery). + */ + ifp->if_oerrors++; + /* XXX better status? */ + return (ENOBUFS); + } + } +#endif + if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && + (m->m_flags & M_PWR_SAV) == 0) { + /* + * Station in power save mode; pass the frame + * to the 802.11 layer and continue. We'll get + * the frame back when the time is right. + * XXX lose WDS vap linkage? + */ + (void) ieee80211_pwrsave(ni, m); + ieee80211_free_node(ni); + /* XXX better status? */ + return (ENOBUFS); + } + /* calculate priority so drivers can find the tx queue */ + if (ieee80211_classify(ni, m)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, + eh->ether_dhost, NULL, + "%s", "classification failure"); + vap->iv_stats.is_tx_classify++; + ifp->if_oerrors++; + m_freem(m); + ieee80211_free_node(ni); + /* XXX better status? */ + return (ENOBUFS); + } + /* + * Stash the node pointer. Note that we do this after + * any call to ieee80211_dwds_mcast because that code + * uses any existing value for rcvif to identify the + * interface it (might have been) received on. + */ + m->m_pkthdr.rcvif = (void *)ni; + + BPF_MTAP(ifp, m); /* 802.3 tx */ + + + /* + * Check if A-MPDU tx aggregation is setup or if we + * should try to enable it. The sta must be associated + * with HT and A-MPDU enabled for use. When the policy + * routine decides we should enable A-MPDU we issue an + * ADDBA request and wait for a reply. The frame being + * encapsulated will go out w/o using A-MPDU, or possibly + * it might be collected by the driver and held/retransmit. + * The default ic_ampdu_enable routine handles staggering + * ADDBA requests in case the receiver NAK's us or we are + * otherwise unable to establish a BA stream. + */ + if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && + (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX) && + (m->m_flags & M_EAPOL) == 0) { + int tid = WME_AC_TO_TID(M_WME_GETAC(m)); + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; + + ieee80211_txampdu_count_packet(tap); + if (IEEE80211_AMPDU_RUNNING(tap)) { + /* + * Operational, mark frame for aggregation. + * + * XXX do tx aggregation here + */ + m->m_flags |= M_AMPDU_MPDU; + } else if (!IEEE80211_AMPDU_REQUESTED(tap) && + ic->ic_ampdu_enable(ni, tap)) { + /* + * Not negotiated yet, request service. + */ + ieee80211_ampdu_request(ni, tap); + /* XXX hold frame for reply? */ + } + } + +#ifdef IEEE80211_SUPPORT_SUPERG + else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) { + m = ieee80211_ff_check(ni, m); + if (m == NULL) { + /* NB: any ni ref held on stageq */ + /* XXX better status? */ + return (ENOBUFS); + } + } +#endif /* IEEE80211_SUPPORT_SUPERG */ + + /* + * Grab the TX lock - serialise the TX process from this + * point (where TX state is being checked/modified) + * through to driver queue. + */ + IEEE80211_TX_LOCK(ic); + + if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { + /* + * Encapsulate the packet in prep for transmission. + */ + m = ieee80211_encap(vap, ni, m); + if (m == NULL) { + /* NB: stat+msg handled in ieee80211_encap */ + IEEE80211_TX_UNLOCK(ic); + ieee80211_free_node(ni); + /* XXX better status? */ + return (ENOBUFS); + } + } + error = ieee80211_parent_transmit(ic, m); + + /* + * Unlock at this point - no need to hold it across + * ieee80211_free_node() (ie, the comlock) + */ + IEEE80211_TX_UNLOCK(ic); + if (error != 0) { + /* NB: IFQ_HANDOFF reclaims mbuf */ + ieee80211_free_node(ni); + } else { + ifp->if_opackets++; + } + ic->ic_lastdata = ticks; + + return (0); +#undef IS_DWDS +} + +/* * Start method for vap's. All packets from the stack come * through here. We handle common processing of the packets * before dispatching them to the underlying device. @@ -117,16 +366,10 @@ doprint(struct ieee80211vap *vap, int su void ieee80211_start(struct ifnet *ifp) { -#define IS_DWDS(vap) \ - (vap->iv_opmode == IEEE80211_M_WDS && \ - (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) == 0) struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; struct ifnet *parent = ic->ic_ifp; - struct ieee80211_node *ni; struct mbuf *m; - struct ether_header *eh; - int error; /* NB: parent must be up and running */ if (!IFNET_IS_UP_RUNNING(parent)) { @@ -165,6 +408,7 @@ ieee80211_start(struct ifnet *ifp) } IEEE80211_UNLOCK(ic); } + for (;;) { IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) @@ -180,203 +424,23 @@ ieee80211_start(struct ifnet *ifp) */ m->m_flags &= ~(M_80211_TX - M_PWR_SAV - M_MORE_DATA); /* - * Cancel any background scan. - */ - if (ic->ic_flags & IEEE80211_F_SCAN) - ieee80211_cancel_anyscan(vap); - /* - * Find the node for the destination so we can do - * things like power save and fast frames aggregation. - * - * NB: past this point various code assumes the first - * mbuf has the 802.3 header present (and contiguous). + * Bump to the packet transmission path. */ - ni = NULL; - if (m->m_len < sizeof(struct ether_header) && - (m = m_pullup(m, sizeof(struct ether_header))) == NULL) { - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, - "discard frame, %s\n", "m_pullup failed"); - vap->iv_stats.is_tx_nobuf++; /* XXX */ - ifp->if_oerrors++; - continue; - } - eh = mtod(m, struct ether_header *); - if (ETHER_IS_MULTICAST(eh->ether_dhost)) { - if (IS_DWDS(vap)) { - /* - * Only unicast frames from the above go out - * DWDS vaps; multicast frames are handled by - * dispatching the frame as it comes through - * the AP vap (see below). - */ - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_WDS, - eh->ether_dhost, "mcast", "%s", "on DWDS"); - vap->iv_stats.is_dwds_mcast++; - m_freem(m); - continue; - } - if (vap->iv_opmode == IEEE80211_M_HOSTAP) { - /* - * Spam DWDS vap's w/ multicast traffic. - */ - /* XXX only if dwds in use? */ - ieee80211_dwds_mcast(vap, m); - } - } -#ifdef IEEE80211_SUPPORT_MESH - if (vap->iv_opmode != IEEE80211_M_MBSS) { -#endif - ni = ieee80211_find_txnode(vap, eh->ether_dhost); - if (ni == NULL) { - /* NB: ieee80211_find_txnode does stat+msg */ - ifp->if_oerrors++; - m_freem(m); - continue; - } - if (ni->ni_associd == 0 && - (ni->ni_flags & IEEE80211_NODE_ASSOCID)) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, - eh->ether_dhost, NULL, - "sta not associated (type 0x%04x)", - htons(eh->ether_type)); - vap->iv_stats.is_tx_notassoc++; - ifp->if_oerrors++; - m_freem(m); - ieee80211_free_node(ni); - continue; - } -#ifdef IEEE80211_SUPPORT_MESH - } else { - if (!IEEE80211_ADDR_EQ(eh->ether_shost, vap->iv_myaddr)) { - /* - * Proxy station only if configured. - */ - if (!ieee80211_mesh_isproxyena(vap)) { - IEEE80211_DISCARD_MAC(vap, - IEEE80211_MSG_OUTPUT | - IEEE80211_MSG_MESH, - eh->ether_dhost, NULL, - "%s", "proxy not enabled"); - vap->iv_stats.is_mesh_notproxy++; - ifp->if_oerrors++; - m_freem(m); - continue; - } - IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, - "forward frame from DS SA(%6D), DA(%6D)\n", - eh->ether_shost, ":", - eh->ether_dhost, ":"); - ieee80211_mesh_proxy_check(vap, eh->ether_shost); - } - ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m); - if (ni == NULL) { - /* - * NB: ieee80211_mesh_discover holds/disposes - * frame (e.g. queueing on path discovery). - */ - ifp->if_oerrors++; - continue; - } - } -#endif - if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && - (m->m_flags & M_PWR_SAV) == 0) { - /* - * Station in power save mode; pass the frame - * to the 802.11 layer and continue. We'll get - * the frame back when the time is right. - * XXX lose WDS vap linkage? - */ - (void) ieee80211_pwrsave(ni, m); - ieee80211_free_node(ni); - continue; - } - /* calculate priority so drivers can find the tx queue */ - if (ieee80211_classify(ni, m)) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, - eh->ether_dhost, NULL, - "%s", "classification failure"); - vap->iv_stats.is_tx_classify++; - ifp->if_oerrors++; - m_freem(m); - ieee80211_free_node(ni); - continue; - } - /* - * Stash the node pointer. Note that we do this after - * any call to ieee80211_dwds_mcast because that code - * uses any existing value for rcvif to identify the - * interface it (might have been) received on. - */ - m->m_pkthdr.rcvif = (void *)ni; - - BPF_MTAP(ifp, m); /* 802.3 tx */ - - /* - * Check if A-MPDU tx aggregation is setup or if we - * should try to enable it. The sta must be associated - * with HT and A-MPDU enabled for use. When the policy - * routine decides we should enable A-MPDU we issue an - * ADDBA request and wait for a reply. The frame being - * encapsulated will go out w/o using A-MPDU, or possibly - * it might be collected by the driver and held/retransmit. - * The default ic_ampdu_enable routine handles staggering - * ADDBA requests in case the receiver NAK's us or we are - * otherwise unable to establish a BA stream. - */ - if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && - (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX) && - (m->m_flags & M_EAPOL) == 0) { - int tid = WME_AC_TO_TID(M_WME_GETAC(m)); - struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; - - ieee80211_txampdu_count_packet(tap); - if (IEEE80211_AMPDU_RUNNING(tap)) { - /* - * Operational, mark frame for aggregation. - * - * XXX do tx aggregation here - */ - m->m_flags |= M_AMPDU_MPDU; - } else if (!IEEE80211_AMPDU_REQUESTED(tap) && - ic->ic_ampdu_enable(ni, tap)) { - /* - * Not negotiated yet, request service. - */ - ieee80211_ampdu_request(ni, tap); - /* XXX hold frame for reply? */ - } - } -#ifdef IEEE80211_SUPPORT_SUPERG - else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) { - m = ieee80211_ff_check(ni, m); - if (m == NULL) { - /* NB: any ni ref held on stageq */ - continue; - } - } -#endif /* IEEE80211_SUPPORT_SUPERG */ - if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { - /* - * Encapsulate the packet in prep for transmission. - */ - m = ieee80211_encap(vap, ni, m); - if (m == NULL) { - /* NB: stat+msg handled in ieee80211_encap */ - ieee80211_free_node(ni); - continue; - } - } - error = parent->if_transmit(parent, m); - if (error != 0) { - /* NB: IFQ_HANDOFF reclaims mbuf */ - ieee80211_free_node(ni); - } else { - ifp->if_opackets++; - } - ic->ic_lastdata = ticks; + (void) ieee80211_start_pkt(vap, m); + /* mbuf is consumed here */ } -#undef IS_DWDS +} + +/* + * 802.11 raw output routine. + */ +int +ieee80211_raw_output(struct ieee80211vap *vap, struct ieee80211_node *ni, + struct mbuf *m, const struct ieee80211_bpf_params *params) +{ + struct ieee80211com *ic = vap->iv_ic; + + return (ic->ic_raw_xmit(ni, m, params)); } /* @@ -392,7 +456,9 @@ ieee80211_output(struct ifnet *ifp, stru struct ieee80211_node *ni = NULL; struct ieee80211vap *vap; struct ieee80211_frame *wh; + struct ieee80211com *ic = NULL; int error; + int ret; IFQ_LOCK(&ifp->if_snd); if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { @@ -409,6 +475,7 @@ ieee80211_output(struct ifnet *ifp, stru } IFQ_UNLOCK(&ifp->if_snd); vap = ifp->if_softc; + ic = vap->iv_ic; /* * Hand to the 802.3 code if not tagged as * a raw 802.11 frame. @@ -489,15 +556,19 @@ ieee80211_output(struct ifnet *ifp, stru /* NB: ieee80211_encap does not include 802.11 header */ IEEE80211_NODE_STAT_ADD(ni, tx_bytes, m->m_pkthdr.len); + IEEE80211_TX_LOCK(ic); + /* * NB: DLT_IEEE802_11_RADIO identifies the parameters are * present by setting the sa_len field of the sockaddr (yes, * this is a hack). * NB: we assume sa_data is suitably aligned to cast. */ - return vap->iv_ic->ic_raw_xmit(ni, m, + ret = ieee80211_raw_output(vap, ni, m, (const struct ieee80211_bpf_params *)(dst->sa_len ? dst->sa_data : NULL)); + IEEE80211_TX_UNLOCK(ic); + return (ret); bad: if (m != NULL) m_freem(m); @@ -526,8 +597,11 @@ ieee80211_send_setup( struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_tx_ampdu *tap; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); + struct ieee80211com *ic = ni->ni_ic; ieee80211_seq seqno; + IEEE80211_TX_LOCK_ASSERT(ic); + wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type; if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) { switch (vap->iv_opmode) { @@ -621,6 +695,7 @@ ieee80211_mgmt_output(struct ieee80211_n struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct ieee80211_frame *wh; + int ret; KASSERT(ni != NULL, ("null node")); @@ -642,6 +717,8 @@ ieee80211_mgmt_output(struct ieee80211_n return ENOMEM; } + IEEE80211_TX_LOCK(ic); + wh = mtod(m, struct ieee80211_frame *); ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | type, IEEE80211_NONQOS_TID, @@ -670,7 +747,9 @@ ieee80211_mgmt_output(struct ieee80211_n #endif IEEE80211_NODE_STAT(ni, tx_mgmt); - return ic->ic_raw_xmit(ni, m, params); + ret = ieee80211_raw_output(vap, ni, m, params); + IEEE80211_TX_UNLOCK(ic); + return (ret); } /* @@ -694,6 +773,7 @@ ieee80211_send_nulldata(struct ieee80211 struct ieee80211_frame *wh; int hdrlen; uint8_t *frm; + int ret; if (vap->iv_state == IEEE80211_S_CAC) { IEEE80211_NOTE(vap, IEEE80211_MSG_OUTPUT | IEEE80211_MSG_DOTH, @@ -729,6 +809,8 @@ ieee80211_send_nulldata(struct ieee80211 return ENOMEM; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 20:33:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9700B16F; Fri, 8 Mar 2013 20:33:51 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 88C3791B; Fri, 8 Mar 2013 20:33:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28KXpra057471; Fri, 8 Mar 2013 20:33:51 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28KXpKK057468; Fri, 8 Mar 2013 20:33:51 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303082033.r28KXpKK057468@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 8 Mar 2013 20:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248070 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 20:33:51 -0000 Author: melifaro Date: Fri Mar 8 20:33:50 2013 New Revision: 248070 URL: http://svnweb.freebsd.org/changeset/base/248070 Log: Fix long-standing issue with interface routes being unprotected: Use RTM_PINNED flag to mark route as immutable. Forbid deleting immutable routes without special rtrequest1_fib() flag. Adding interface address with prefix already in route table is handled by atomically deleting old prefix and adding interface one. Discussed with: andre, eri MFC after: 3 weeks Modified: head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Mar 8 20:23:55 2013 (r248069) +++ head/sys/net/if.c Fri Mar 8 20:33:50 2013 (r248070) @@ -1357,7 +1357,8 @@ if_rtdel(struct radix_node *rn, void *ar return (0); err = rtrequest_fib(RTM_DELETE, rt_key(rt), rt->rt_gateway, - rt_mask(rt), rt->rt_flags|RTF_RNH_LOCKED, + rt_mask(rt), + rt->rt_flags|RTF_RNH_LOCKED|RTF_PINNED, (struct rtentry **) NULL, rt->rt_fibnum); if (err) { log(LOG_WARNING, "if_rtdel: error %d\n", err); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Fri Mar 8 20:23:55 2013 (r248069) +++ head/sys/net/route.c Fri Mar 8 20:33:50 2013 (r248070) @@ -1112,6 +1112,14 @@ rtrequest1_fib(int req, struct rt_addrin error = 0; } #endif + if ((flags & RTF_PINNED) == 0) { + /* Check if target route can be deleted */ + rt = (struct rtentry *)rnh->rnh_lookup(dst, + netmask, rnh); + if ((rt != NULL) && (rt->rt_flags & RTF_PINNED)) + senderr(EADDRINUSE); + } + /* * Remove the item from the tree and return it. * Complain if it is not there and do no more processing. @@ -1430,6 +1438,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int int didwork = 0; int a_failure = 0; static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; + struct radix_node_head *rnh; if (flags & RTF_HOST) { dst = ifa->ifa_dstaddr; @@ -1488,7 +1497,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int */ for ( fibnum = startfib; fibnum <= endfib; fibnum++) { if (cmd == RTM_DELETE) { - struct radix_node_head *rnh; struct radix_node *rn; /* * Look up an rtentry that is in the routing tree and @@ -1538,7 +1546,8 @@ rtinit1(struct ifaddr *ifa, int cmd, int */ bzero((caddr_t)&info, sizeof(info)); info.rti_ifa = ifa; - info.rti_flags = flags | (ifa->ifa_flags & ~IFA_RTSELF); + info.rti_flags = flags | + (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; info.rti_info[RTAX_DST] = dst; /* * doing this for compatibility reasons @@ -1550,6 +1559,33 @@ rtinit1(struct ifaddr *ifa, int cmd, int info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; error = rtrequest1_fib(cmd, &info, &rt, fibnum); + + if ((error == EEXIST) && (cmd == RTM_ADD)) { + /* + * Interface route addition failed. + * Atomically delete current prefix generating + * RTM_DELETE message, and retry adding + * interface prefix. + */ + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + RADIX_NODE_HEAD_LOCK(rnh); + + /* Delete old prefix */ + info.rti_ifa = NULL; + info.rti_flags = RTF_RNH_LOCKED; + + error = rtrequest1_fib(RTM_DELETE, &info, &rt, fibnum); + if (error == 0) { + info.rti_ifa = ifa; + info.rti_flags = flags | RTF_RNH_LOCKED | + (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; + error = rtrequest1_fib(cmd, &info, &rt, fibnum); + } + + RADIX_NODE_HEAD_UNLOCK(rnh); + } + + if (error == 0 && rt != NULL) { /* * notify any listening routing agents of the change Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Fri Mar 8 20:23:55 2013 (r248069) +++ head/sys/net/route.h Fri Mar 8 20:33:50 2013 (r248070) @@ -176,7 +176,7 @@ struct ortentry { /* 0x20000 unused, was RTF_WASCLONED */ #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ /* 0x80000 unused */ -#define RTF_PINNED 0x100000 /* future use */ +#define RTF_PINNED 0x100000 /* route is immutable */ #define RTF_LOCAL 0x200000 /* route represents a local address */ #define RTF_BROADCAST 0x400000 /* route represents a bcast address */ #define RTF_MULTICAST 0x800000 /* route represents a mcast address */ From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 21:03:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 437AB87D; Fri, 8 Mar 2013 21:03:36 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1D7AAA4A; Fri, 8 Mar 2013 21:03:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28L3ZSk066456; Fri, 8 Mar 2013 21:03:35 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28L3Z8Z066455; Fri, 8 Mar 2013 21:03:35 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303082103.r28L3Z8Z066455@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 21:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248071 - stable/9/sys/cddl/dev/dtrace 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 21:03:36 -0000 Author: rstone Date: Fri Mar 8 21:03:35 2013 New Revision: 248071 URL: http://svnweb.freebsd.org/changeset/base/248071 Log: MFC r226452 (by marcel@) Define dtrace_cmpset_long in terms of atomic_cmpset_long and not by virtue of inline assembly. Now this file compiles on all supported architectures. Modified: stable/9/sys/cddl/dev/dtrace/dtrace_debug.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/dtrace_debug.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_debug.c Fri Mar 8 20:33:50 2013 (r248070) +++ stable/9/sys/cddl/dev/dtrace/dtrace_debug.c Fri Mar 8 21:03:35 2013 (r248071) @@ -31,49 +31,9 @@ #ifdef DEBUG -#if defined(__amd64__) -static __inline int -dtrace_cmpset_long(volatile u_long *dst, u_long exp, u_long src) -{ - u_char res; - - __asm __volatile( - " lock ; " - " cmpxchgq %2,%1 ; " - " sete %0 ; " - "1: " - "# dtrace_cmpset_long" - : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (exp), /* 3 */ - "m" (*dst) /* 4 */ - : "memory"); - - return (res); -} -#elif defined(__i386__) -static __inline int -dtrace_cmpset_long(volatile u_long *dst, u_long exp, u_long src) -{ - u_char res; - - __asm __volatile( - " lock ; " - " cmpxchgl %2,%1 ; " - " sete %0 ; " - "1: " - "# dtrace_cmpset_long" - : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (exp), /* 3 */ - "m" (*dst) /* 4 */ - : "memory"); +#include - return (res); -} -#endif +#define dtrace_cmpset_long atomic_cmpset_long #define DTRACE_DEBUG_BUFR_SIZE (32 * 1024) From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 21:04:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42F999EB; Fri, 8 Mar 2013 21:04:17 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1B7ECA52; Fri, 8 Mar 2013 21:04:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28L4GBO066610; Fri, 8 Mar 2013 21:04:16 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28L4G3E066609; Fri, 8 Mar 2013 21:04:16 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303082104.r28L4G3E066609@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 21:04:16 +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: r248072 - stable/8/sys/cddl/dev/dtrace 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 21:04:17 -0000 Author: rstone Date: Fri Mar 8 21:04:16 2013 New Revision: 248072 URL: http://svnweb.freebsd.org/changeset/base/248072 Log: MFC r226452 (by marcel@) Define dtrace_cmpset_long in terms of atomic_cmpset_long and not by virtue of inline assembly. Now this file compiles on all supported architectures. Modified: stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/dtrace/dtrace_debug.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Fri Mar 8 21:03:35 2013 (r248071) +++ stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Fri Mar 8 21:04:16 2013 (r248072) @@ -31,49 +31,9 @@ #ifdef DEBUG -#if defined(__amd64__) -static __inline int -dtrace_cmpset_long(volatile u_long *dst, u_long exp, u_long src) -{ - u_char res; - - __asm __volatile( - " lock ; " - " cmpxchgq %2,%1 ; " - " sete %0 ; " - "1: " - "# dtrace_cmpset_long" - : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (exp), /* 3 */ - "m" (*dst) /* 4 */ - : "memory"); - - return (res); -} -#elif defined(__i386__) -static __inline int -dtrace_cmpset_long(volatile u_long *dst, u_long exp, u_long src) -{ - u_char res; - - __asm __volatile( - " lock ; " - " cmpxchgl %2,%1 ; " - " sete %0 ; " - "1: " - "# dtrace_cmpset_long" - : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (exp), /* 3 */ - "m" (*dst) /* 4 */ - : "memory"); +#include - return (res); -} -#endif +#define dtrace_cmpset_long atomic_cmpset_long #define DTRACE_DEBUG_BUFR_SIZE (32 * 1024) From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 21:07:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7AA92B88; Fri, 8 Mar 2013 21:07:02 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E600A74; Fri, 8 Mar 2013 21:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28L72eP067157; Fri, 8 Mar 2013 21:07:02 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28L727F067156; Fri, 8 Mar 2013 21:07:02 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303082107.r28L727F067156@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 21:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248073 - stable/9/sys/cddl/dev/dtrace 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 21:07:02 -0000 Author: rstone Date: Fri Mar 8 21:07:01 2013 New Revision: 248073 URL: http://svnweb.freebsd.org/changeset/base/248073 Log: MFC r244631 Correct a series of errors in the hand-rolled locking for drace_debug.c: - Use spinlock_enter()/spinlock_exit() to prevent a thread holding a debug lock from being preempted to prevent other threads waiting on that lock from starvation. - Handle the possibility of CPU migration in between the fetch of curcpu and the call to spinlock_enter() by saving curcpu in a local variable. - Use memory barriers to prevent reordering of loads and stores of the data protected by the lock outside of the critical section - Eliminate false sharing of the locks by moving them into the structures that they protect and aligning them to a cacheline boundary. - Record the owning thread in the lock to make debugging future problems easier. Reviewed by: rpaulo (initial version) Modified: stable/9/sys/cddl/dev/dtrace/dtrace_debug.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/dtrace_debug.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_debug.c Fri Mar 8 21:04:16 2013 (r248072) +++ stable/9/sys/cddl/dev/dtrace/dtrace_debug.c Fri Mar 8 21:07:01 2013 (r248073) @@ -33,11 +33,10 @@ #include -#define dtrace_cmpset_long atomic_cmpset_long - #define DTRACE_DEBUG_BUFR_SIZE (32 * 1024) struct dtrace_debug_data { + uintptr_t lock __aligned(CACHE_LINE_SIZE); char bufr[DTRACE_DEBUG_BUFR_SIZE]; char *first; char *last; @@ -46,20 +45,22 @@ struct dtrace_debug_data { static char dtrace_debug_bufr[DTRACE_DEBUG_BUFR_SIZE]; -static volatile u_long dtrace_debug_flag[MAXCPU]; - static void dtrace_debug_lock(int cpu) { - while (dtrace_cmpset_long(&dtrace_debug_flag[cpu], 0, 1) == 0) - /* Loop until the lock is obtained. */ + uintptr_t tid; + + tid = (uintptr_t)curthread; + spinlock_enter(); + while (atomic_cmpset_acq_ptr(&dtrace_debug_data[cpu].lock, 0, tid) == 0) /* Loop until the lock is obtained. */ ; } static void dtrace_debug_unlock(int cpu) { - dtrace_debug_flag[cpu] = 0; + atomic_store_rel_ptr(&dtrace_debug_data[cpu].lock, 0); + spinlock_exit(); } static void @@ -151,10 +152,11 @@ dtrace_debug_output(void) */ static __inline void -dtrace_debug__putc(char c) +dtrace_debug__putc(int cpu, char c) { - struct dtrace_debug_data *d = &dtrace_debug_data[curcpu]; + struct dtrace_debug_data *d; + d = &dtrace_debug_data[cpu]; *d->next++ = c; if (d->next == d->last) @@ -172,24 +174,30 @@ dtrace_debug__putc(char c) static void __used dtrace_debug_putc(char c) { - dtrace_debug_lock(curcpu); + int cpu; + + cpu = curcpu; + dtrace_debug_lock(cpu); - dtrace_debug__putc(c); + dtrace_debug__putc(cpu, c); - dtrace_debug_unlock(curcpu); + dtrace_debug_unlock(cpu); } static void __used dtrace_debug_puts(const char *s) { - dtrace_debug_lock(curcpu); + int cpu; + + cpu = curcpu; + dtrace_debug_lock(cpu); while (*s != '\0') - dtrace_debug__putc(*s++); + dtrace_debug__putc(cpu, *s++); - dtrace_debug__putc('\0'); + dtrace_debug__putc(cpu, '\0'); - dtrace_debug_unlock(curcpu); + dtrace_debug_unlock(cpu); } /* @@ -219,7 +227,7 @@ dtrace_debug_ksprintn(char *nbuf, uintma #define MAXNBUF (sizeof(intmax_t) * NBBY + 1) static void -dtrace_debug_vprintf(const char *fmt, va_list ap) +dtrace_debug_vprintf(int cpu, const char *fmt, va_list ap) { char nbuf[MAXNBUF]; const char *p, *percent, *q; @@ -243,10 +251,10 @@ dtrace_debug_vprintf(const char *fmt, va width = 0; while ((ch = (u_char)*fmt++) != '%' || stop) { if (ch == '\0') { - dtrace_debug__putc('\0'); + dtrace_debug__putc(cpu, '\0'); return; } - dtrace_debug__putc(ch); + dtrace_debug__putc(cpu, ch); } percent = fmt - 1; qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; @@ -266,7 +274,7 @@ reswitch: switch (ch = (u_char)*fmt++) { ladjust = 1; goto reswitch; case '%': - dtrace_debug__putc(ch); + dtrace_debug__putc(cpu, ch); break; case '*': if (!dot) { @@ -301,7 +309,7 @@ reswitch: switch (ch = (u_char)*fmt++) { num = (u_int)va_arg(ap, int); p = va_arg(ap, char *); for (q = dtrace_debug_ksprintn(nbuf, num, *p++, NULL, 0); *q;) - dtrace_debug__putc(*q--); + dtrace_debug__putc(cpu, *q--); if (num == 0) break; @@ -309,19 +317,19 @@ reswitch: switch (ch = (u_char)*fmt++) { for (tmp = 0; *p;) { n = *p++; if (num & (1 << (n - 1))) { - dtrace_debug__putc(tmp ? ',' : '<'); + dtrace_debug__putc(cpu, tmp ? ',' : '<'); for (; (n = *p) > ' '; ++p) - dtrace_debug__putc(n); + dtrace_debug__putc(cpu, n); tmp = 1; } else for (; *p > ' '; ++p) continue; } if (tmp) - dtrace_debug__putc('>'); + dtrace_debug__putc(cpu, '>'); break; case 'c': - dtrace_debug__putc(va_arg(ap, int)); + dtrace_debug__putc(cpu, va_arg(ap, int)); break; case 'D': up = va_arg(ap, u_char *); @@ -329,12 +337,12 @@ reswitch: switch (ch = (u_char)*fmt++) { if (!width) width = 16; while(width--) { - dtrace_debug__putc(hex2ascii(*up >> 4)); - dtrace_debug__putc(hex2ascii(*up & 0x0f)); + dtrace_debug__putc(cpu, hex2ascii(*up >> 4)); + dtrace_debug__putc(cpu, hex2ascii(*up & 0x0f)); up++; if (width) for (q=p;*q;q++) - dtrace_debug__putc(*q); + dtrace_debug__putc(cpu, *q); } break; case 'd': @@ -406,12 +414,12 @@ reswitch: switch (ch = (u_char)*fmt++) { if (!ladjust && width > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); while (n--) - dtrace_debug__putc(*p++); + dtrace_debug__putc(cpu, *p++); if (ladjust && width > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); break; case 't': tflag = 1; @@ -485,32 +493,32 @@ number: if (!ladjust && padc != '0' && width && (width -= tmp) > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); if (neg) - dtrace_debug__putc('-'); + dtrace_debug__putc(cpu, '-'); if (sharpflag && num != 0) { if (base == 8) { - dtrace_debug__putc('0'); + dtrace_debug__putc(cpu, '0'); } else if (base == 16) { - dtrace_debug__putc('0'); - dtrace_debug__putc('x'); + dtrace_debug__putc(cpu, '0'); + dtrace_debug__putc(cpu, 'x'); } } if (!ladjust && width && (width -= tmp) > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); while (*p) - dtrace_debug__putc(*p--); + dtrace_debug__putc(cpu, *p--); if (ladjust && width && (width -= tmp) > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); break; default: while (percent < fmt) - dtrace_debug__putc(*percent++); + dtrace_debug__putc(cpu, *percent++); /* * Since we ignore an formatting argument it is no * longer safe to obey the remaining formatting @@ -522,23 +530,25 @@ number: } } - dtrace_debug__putc('\0'); + dtrace_debug__putc(cpu, '\0'); } void dtrace_debug_printf(const char *fmt, ...) { va_list ap; + int cpu; - dtrace_debug_lock(curcpu); + cpu = curcpu; + dtrace_debug_lock(cpu); va_start(ap, fmt); - dtrace_debug_vprintf(fmt, ap); + dtrace_debug_vprintf(cpu, fmt, ap); va_end(ap); - dtrace_debug_unlock(curcpu); + dtrace_debug_unlock(cpu); } #else From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 21:07:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4BD54D31; Fri, 8 Mar 2013 21:07:32 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA89A82; Fri, 8 Mar 2013 21:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28L7Wsu067270; Fri, 8 Mar 2013 21:07:32 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28L7W9Z067269; Fri, 8 Mar 2013 21:07:32 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303082107.r28L7W9Z067269@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 21:07:32 +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: r248074 - stable/8/sys/cddl/dev/dtrace 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 21:07:32 -0000 Author: rstone Date: Fri Mar 8 21:07:31 2013 New Revision: 248074 URL: http://svnweb.freebsd.org/changeset/base/248074 Log: MFC r244631 Correct a series of errors in the hand-rolled locking for drace_debug.c: - Use spinlock_enter()/spinlock_exit() to prevent a thread holding a debug lock from being preempted to prevent other threads waiting on that lock from starvation. - Handle the possibility of CPU migration in between the fetch of curcpu and the call to spinlock_enter() by saving curcpu in a local variable. - Use memory barriers to prevent reordering of loads and stores of the data protected by the lock outside of the critical section - Eliminate false sharing of the locks by moving them into the structures that they protect and aligning them to a cacheline boundary. - Record the owning thread in the lock to make debugging future problems easier. Reviewed by: rpaulo (initial version) Modified: stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/dtrace/dtrace_debug.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Fri Mar 8 21:07:01 2013 (r248073) +++ stable/8/sys/cddl/dev/dtrace/dtrace_debug.c Fri Mar 8 21:07:31 2013 (r248074) @@ -33,11 +33,10 @@ #include -#define dtrace_cmpset_long atomic_cmpset_long - #define DTRACE_DEBUG_BUFR_SIZE (32 * 1024) struct dtrace_debug_data { + uintptr_t lock __aligned(CACHE_LINE_SIZE); char bufr[DTRACE_DEBUG_BUFR_SIZE]; char *first; char *last; @@ -46,20 +45,22 @@ struct dtrace_debug_data { static char dtrace_debug_bufr[DTRACE_DEBUG_BUFR_SIZE]; -static volatile u_long dtrace_debug_flag[MAXCPU]; - static void dtrace_debug_lock(int cpu) { - while (dtrace_cmpset_long(&dtrace_debug_flag[cpu], 0, 1) == 0) - /* Loop until the lock is obtained. */ + uintptr_t tid; + + tid = (uintptr_t)curthread; + spinlock_enter(); + while (atomic_cmpset_acq_ptr(&dtrace_debug_data[cpu].lock, 0, tid) == 0) /* Loop until the lock is obtained. */ ; } static void dtrace_debug_unlock(int cpu) { - dtrace_debug_flag[cpu] = 0; + atomic_store_rel_ptr(&dtrace_debug_data[cpu].lock, 0); + spinlock_exit(); } static void @@ -151,10 +152,11 @@ dtrace_debug_output(void) */ static __inline void -dtrace_debug__putc(char c) +dtrace_debug__putc(int cpu, char c) { - struct dtrace_debug_data *d = &dtrace_debug_data[curcpu]; + struct dtrace_debug_data *d; + d = &dtrace_debug_data[cpu]; *d->next++ = c; if (d->next == d->last) @@ -172,24 +174,30 @@ dtrace_debug__putc(char c) static void __used dtrace_debug_putc(char c) { - dtrace_debug_lock(curcpu); + int cpu; + + cpu = curcpu; + dtrace_debug_lock(cpu); - dtrace_debug__putc(c); + dtrace_debug__putc(cpu, c); - dtrace_debug_unlock(curcpu); + dtrace_debug_unlock(cpu); } static void __used dtrace_debug_puts(const char *s) { - dtrace_debug_lock(curcpu); + int cpu; + + cpu = curcpu; + dtrace_debug_lock(cpu); while (*s != '\0') - dtrace_debug__putc(*s++); + dtrace_debug__putc(cpu, *s++); - dtrace_debug__putc('\0'); + dtrace_debug__putc(cpu, '\0'); - dtrace_debug_unlock(curcpu); + dtrace_debug_unlock(cpu); } /* @@ -219,7 +227,7 @@ dtrace_debug_ksprintn(char *nbuf, uintma #define MAXNBUF (sizeof(intmax_t) * NBBY + 1) static void -dtrace_debug_vprintf(const char *fmt, va_list ap) +dtrace_debug_vprintf(int cpu, const char *fmt, va_list ap) { char nbuf[MAXNBUF]; const char *p, *percent, *q; @@ -243,10 +251,10 @@ dtrace_debug_vprintf(const char *fmt, va width = 0; while ((ch = (u_char)*fmt++) != '%' || stop) { if (ch == '\0') { - dtrace_debug__putc('\0'); + dtrace_debug__putc(cpu, '\0'); return; } - dtrace_debug__putc(ch); + dtrace_debug__putc(cpu, ch); } percent = fmt - 1; qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; @@ -266,7 +274,7 @@ reswitch: switch (ch = (u_char)*fmt++) { ladjust = 1; goto reswitch; case '%': - dtrace_debug__putc(ch); + dtrace_debug__putc(cpu, ch); break; case '*': if (!dot) { @@ -301,7 +309,7 @@ reswitch: switch (ch = (u_char)*fmt++) { num = (u_int)va_arg(ap, int); p = va_arg(ap, char *); for (q = dtrace_debug_ksprintn(nbuf, num, *p++, NULL, 0); *q;) - dtrace_debug__putc(*q--); + dtrace_debug__putc(cpu, *q--); if (num == 0) break; @@ -309,19 +317,19 @@ reswitch: switch (ch = (u_char)*fmt++) { for (tmp = 0; *p;) { n = *p++; if (num & (1 << (n - 1))) { - dtrace_debug__putc(tmp ? ',' : '<'); + dtrace_debug__putc(cpu, tmp ? ',' : '<'); for (; (n = *p) > ' '; ++p) - dtrace_debug__putc(n); + dtrace_debug__putc(cpu, n); tmp = 1; } else for (; *p > ' '; ++p) continue; } if (tmp) - dtrace_debug__putc('>'); + dtrace_debug__putc(cpu, '>'); break; case 'c': - dtrace_debug__putc(va_arg(ap, int)); + dtrace_debug__putc(cpu, va_arg(ap, int)); break; case 'D': up = va_arg(ap, u_char *); @@ -329,12 +337,12 @@ reswitch: switch (ch = (u_char)*fmt++) { if (!width) width = 16; while(width--) { - dtrace_debug__putc(hex2ascii(*up >> 4)); - dtrace_debug__putc(hex2ascii(*up & 0x0f)); + dtrace_debug__putc(cpu, hex2ascii(*up >> 4)); + dtrace_debug__putc(cpu, hex2ascii(*up & 0x0f)); up++; if (width) for (q=p;*q;q++) - dtrace_debug__putc(*q); + dtrace_debug__putc(cpu, *q); } break; case 'd': @@ -406,12 +414,12 @@ reswitch: switch (ch = (u_char)*fmt++) { if (!ladjust && width > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); while (n--) - dtrace_debug__putc(*p++); + dtrace_debug__putc(cpu, *p++); if (ladjust && width > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); break; case 't': tflag = 1; @@ -485,32 +493,32 @@ number: if (!ladjust && padc != '0' && width && (width -= tmp) > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); if (neg) - dtrace_debug__putc('-'); + dtrace_debug__putc(cpu, '-'); if (sharpflag && num != 0) { if (base == 8) { - dtrace_debug__putc('0'); + dtrace_debug__putc(cpu, '0'); } else if (base == 16) { - dtrace_debug__putc('0'); - dtrace_debug__putc('x'); + dtrace_debug__putc(cpu, '0'); + dtrace_debug__putc(cpu, 'x'); } } if (!ladjust && width && (width -= tmp) > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); while (*p) - dtrace_debug__putc(*p--); + dtrace_debug__putc(cpu, *p--); if (ladjust && width && (width -= tmp) > 0) while (width--) - dtrace_debug__putc(padc); + dtrace_debug__putc(cpu, padc); break; default: while (percent < fmt) - dtrace_debug__putc(*percent++); + dtrace_debug__putc(cpu, *percent++); /* * Since we ignore an formatting argument it is no * longer safe to obey the remaining formatting @@ -522,23 +530,25 @@ number: } } - dtrace_debug__putc('\0'); + dtrace_debug__putc(cpu, '\0'); } void dtrace_debug_printf(const char *fmt, ...) { va_list ap; + int cpu; - dtrace_debug_lock(curcpu); + cpu = curcpu; + dtrace_debug_lock(cpu); va_start(ap, fmt); - dtrace_debug_vprintf(fmt, ap); + dtrace_debug_vprintf(cpu, fmt, ap); va_end(ap); - dtrace_debug_unlock(curcpu); + dtrace_debug_unlock(cpu); } #else From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 21:44:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BFC1D4AC; Fri, 8 Mar 2013 21:44:42 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1DFDBFC; Fri, 8 Mar 2013 21:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28Ligb9078711; Fri, 8 Mar 2013 21:44:42 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28Lig0g078710; Fri, 8 Mar 2013 21:44:42 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201303082144.r28Lig0g078710@svn.freebsd.org> From: Josh Paetzel Date: Fri, 8 Mar 2013 21:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r248075 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 21:44:42 -0000 Author: jpaetzel Date: Fri Mar 8 21:44:42 2013 New Revision: 248075 URL: http://svnweb.freebsd.org/changeset/base/248075 Log: Enter code freeze for the 8.4 release cycle by turning on approval checking for stable/8. Approved by: core (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Fri Mar 8 21:07:31 2013 (r248074) +++ svnadmin/conf/approvers Fri Mar 8 21:44:42 2013 (r248075) @@ -18,7 +18,7 @@ # #^head/ re #^stable/9/ re -#^stable/8/ re +^stable/8/ re #^stable/7/ re ^releng/9.[0-1]/ (security-officer|so) ^releng/8.[0-3]/ (security-officer|so) From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 22:14:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8057AB07; Fri, 8 Mar 2013 22:14:26 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 64B2BD29; Fri, 8 Mar 2013 22:14:26 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 3F81934FD; Fri, 8 Mar 2013 14:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1362780866; bh=1/KQKSHXqyZD/8U0WLr4qkJ42U1gSqWPhOwc97BhS5Y=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=10df+YgMHeT4tZrSz3RstLdlweZM1yJ+R+AYgqIWJhD7BleTpEHvA2kgcVTsDSnj6 uuRuYp+8DNrNLcg8EuH+aB/d7Z1xNnTjaPBlr6prA+Yqj0uwyFeq5Es/VSxlsANUT/ nhBZ8hN0ZNjeD/hdNxIAdGRfPOLPZrEz0ESP+WPc= Message-ID: <513A62C0.2080104@delphij.net> Date: Fri, 08 Mar 2013 14:14:24 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Diane Bruce Subject: Re: svn commit: r247919 - head/lib/libutil References: <201303071900.r27J006A068238@svn.freebsd.org> In-Reply-To: <201303071900.r27J006A068238@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 22:14:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 03/07/13 11:00, Diane Bruce wrote: > Author: db (ports committer) Date: Thu Mar 7 19:00:00 2013 New > Revision: 247919 URL: > http://svnweb.freebsd.org/changeset/base/247919 > > Log: Cleanup gr_add() so it does not leak mem This is part of > ongoing work on sbin/pw > > M libutil.h M gr_util.c > > Approved by: theraven This breaks 'pw groupadd -n someone -g 1234'... Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJROmK/AAoJEG80Jeu8UPuz7RgIAKpeaJIFOiP9zRzoMqDIdjKc tq9E2x9USxmwLHlk6aoKpPVMGfVVjrPllI5WeSv48plrVBq4amg998dkh9tZ1j/+ MhQNCKGnaKLXrXHQy/HD7f9jMfwiZug+dXWFn5ajgDqcNhTQ32pIB2vlWZEdhtM6 8gTQajTZU4zdIecHWOp5q+1vww95SDtFm8rENsh9ulUtD0TJyT8ouPvicwq6Hufr +5DxOF7wBWFSWOEI2Oax0f86xGy9PVuF/ZvcX+Sqkfvf7io1qwkNwQl6DkpvYVdt +jdzMUomN0VOyLO5b7UrJyXjXz9/RDj1Khf4hQZcx563hJXC7xhu8xFIcbGQtWw= =NX+s -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 22:54:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 718AC590; Fri, 8 Mar 2013 22:54:29 +0000 (UTC) (envelope-from jase@FreeBSD.org) Received: from svr06-mx.btshosting.co.uk (unknown [IPv6:2a01:4f8:121:2403:2::]) by mx1.freebsd.org (Postfix) with ESMTP id 34961E41; Fri, 8 Mar 2013 22:54:29 +0000 (UTC) Received: from [192.168.1.65] (5e0ec7ef.bb.sky.com [94.14.199.239]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by svr06-mx.btshosting.co.uk (Postfix) with ESMTPSA id 1A4EA49B81; Fri, 8 Mar 2013 22:54:28 +0000 (UTC) Message-ID: <513A6C09.2080901@FreeBSD.org> Date: Fri, 08 Mar 2013 22:54:01 +0000 From: Jase Thew Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: svn commit: r237268 - head/lib/libutil References: <201206191139.q5JBdugJ041786@svn.freebsd.org> In-Reply-To: <201206191139.q5JBdugJ041786@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2HFMUEKPFKRIDVAQUDOAS" Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 22:54:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2HFMUEKPFKRIDVAQUDOAS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 19/06/2012 12:39, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Jun 19 11:39:56 2012 > New Revision: 237268 > URL: http://svn.freebsd.org/changeset/base/237268 >=20 > Log: > Revert user comparison back to user names as some user can share uids= (root/toor > for example) > =20 > get the username information from old_pw structures to still allow re= naming of a > user. > =20 > Reported by: Claude Buisson > Approved by: des (mentor) > MFC after: 3 weeks >=20 Hi Bapt, Could you MFC this to stable/8 please, as it's still an issue there : root@jail-gitlab:~ # uname -v FreeBSD 8.3-STABLE #0 r247666M: Sat Mar 2 21:06:00 GMT 2013 toor@jailhost.localdomain:/usr/obj/usr/src/sys/JAILHOST root@jail-gitlab:~ # chpass -s /usr/local/bin/zsh toor chpass: entry inconsistent chpass: pw_copy: Invalid argument Thanks in advance. Regards, Jase. --=20 Jase Thew jase@FreeBSD.org FreeBSD Ports Committer ------enig2HFMUEKPFKRIDVAQUDOAS 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.0.17 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQGcBAEBAgAGBQJROmwaAAoJEKSEvNs+6vHrnp4MAJN1ZNZfnGcZn4AxOt4a2nRU FlcRoVe+PSLpJmDiVx1c75hWfxPWbm9YQOVQQp5j+05HE7VzBMEFeH/LuKaaLWfj ThKOCdDzFKJ9GhEnB3oeynxdFzuoAGHNu2u2SR8CJ6lONwU2yygip7DTYhftS4to mDmnPzQWhS5K7spfERDkVsi726VteXERdkY8HNywGM6XvwH/v3I+pqWTAerDUIzP nyRcPEddKU5m4bN/YemKyJhk+qDDtTks+qCvzIZRrFvdjkrZlJm0GJ4SB7sS91j/ AOKjfQruX5XXVbIU39L3V5RrRMlXZH1vECUBbyJfbNnNSvfxce3f3s/Yh03dIA2P CLGjQInqis6fnuatOyaPMu2rWujheFMAAnKVpKL2vhmrtIL4SdJaW4j1CMPTbrga eLW1STuhcjZe2KCIsqKBBvRLcg7P1uRTLcG1hgmGgVFVabGLIhrH0lsUR4k0N7ZV mmAfvigjWa71X4CleAyop6ZicnQzx1IUrBGMEoi8lw== =Kkw4 -----END PGP SIGNATURE----- ------enig2HFMUEKPFKRIDVAQUDOAS-- From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 22:56:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C1F945FE; Fri, 8 Mar 2013 22:56:51 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B1651E56; Fri, 8 Mar 2013 22:56:51 +0000 (UTC) Received: from kruse-124.4.ixsystems.com (drawbridge.ixsystems.com [206.40.55.65]) by elvis.mu.org (Postfix) with ESMTPSA id 921FF1A3CBC; Fri, 8 Mar 2013 14:56:43 -0800 (PST) Message-ID: <513A6CA1.3000005@mu.org> Date: Fri, 08 Mar 2013 14:56:33 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r248031 - in head/sys: kern sys References: <201303081014.r28AEwet053196@svn.freebsd.org> <513A2B3E.2070804@rice.edu> In-Reply-To: <513A2B3E.2070804@rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 22:56:51 -0000 Agreed, Andre, please stop removing my comments. -Alfred On 3/8/13 10:17 AM, Alan Cox wrote: > On 03/08/2013 04:14, Andre Oppermann wrote: >> Author: andre >> Date: Fri Mar 8 10:14:58 2013 >> New Revision: 248031 >> URL: http://svnweb.freebsd.org/changeset/base/248031 >> >> Log: >> Move the auto-sizing of the callout array from init_param2() to >> kern_timeout_callwheel_alloc() where it is actually used. >> >> This is a mechanical move and no tuning parameters are changed. >> >> The pre-allocated callout array is only used for legacy timeout(9) >> calls and is only allocated and active on cpu0. Eventually all >> remaining users of timeout(9) should switch to the callout_* API. >> > In the meantime, until all legacy timeout(9) users are updated, I think > that it would be wise to retain the comment that describes where the > magic number 18508 comes from. > > Regards, > Alan > >> Reviewed by: davide >> >> Modified: >> head/sys/kern/kern_timeout.c >> head/sys/kern/subr_param.c >> head/sys/sys/callout.h >> >> Modified: head/sys/kern/kern_timeout.c >> ============================================================================== >> --- head/sys/kern/kern_timeout.c Fri Mar 8 08:19:50 2013 (r248030) >> +++ head/sys/kern/kern_timeout.c Fri Mar 8 10:14:58 2013 (r248031) >> @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -101,6 +102,11 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca >> 0, "Average number of MP direct callouts made per callout_process call. " >> "Units = 1/1000"); >> #endif >> + >> +static int ncallout; >> +SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, >> + "Number of entries in callwheel and size of timeout() preallocation"); >> + >> /* >> * TODO: >> * allocate more timeout table slots when table overflows. >> @@ -252,6 +258,14 @@ kern_timeout_callwheel_alloc(caddr_t v) >> >> timeout_cpu = PCPU_GET(cpuid); >> cc = CC_CPU(timeout_cpu); >> + >> + /* >> + * Calculate the size of the callout wheel and the preallocated >> + * timeout() structures. >> + */ >> + ncallout = imin(16 + maxproc + maxfiles, 18508); >> + TUNABLE_INT_FETCH("kern.ncallout", &ncallout); >> + >> /* >> * Calculate callout wheel size, should be next power of two higher >> * than 'ncallout'. >> >> Modified: head/sys/kern/subr_param.c >> ============================================================================== >> --- head/sys/kern/subr_param.c Fri Mar 8 08:19:50 2013 (r248030) >> +++ head/sys/kern/subr_param.c Fri Mar 8 10:14:58 2013 (r248031) >> @@ -91,7 +91,6 @@ int maxprocperuid; /* max # of procs p >> int maxfiles; /* sys. wide open files limit */ >> int maxfilesperproc; /* per-proc open files limit */ >> int msgbufsize; /* size of kernel message buffer */ >> -int ncallout; /* maximum # of timer events */ >> int nbuf; >> int ngroups_max; /* max # groups per process */ >> int nswbuf; >> @@ -109,8 +108,6 @@ u_long sgrowsiz; /* amount to grow sta >> >> SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, >> "Number of clock ticks per second"); >> -SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, >> - "Number of pre-allocated timer events"); >> SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0, >> "Number of buffers in the buffer cache"); >> SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0, >> @@ -327,15 +324,6 @@ init_param2(long physpages) >> TUNABLE_INT_FETCH("kern.nbuf", &nbuf); >> >> /* >> - * XXX: Does the callout wheel have to be so big? >> - * >> - * Clip callout to result of previous function of maxusers maximum >> - * 384. This is still huge, but acceptable. >> - */ >> - ncallout = imin(16 + maxproc + maxfiles, 18508); >> - TUNABLE_INT_FETCH("kern.ncallout", &ncallout); >> - >> - /* >> * The default for maxpipekva is min(1/64 of the kernel address space, >> * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. >> */ >> >> Modified: head/sys/sys/callout.h >> ============================================================================== >> --- head/sys/sys/callout.h Fri Mar 8 08:19:50 2013 (r248030) >> +++ head/sys/sys/callout.h Fri Mar 8 10:14:58 2013 (r248031) >> @@ -63,8 +63,6 @@ struct callout_handle { >> }; >> >> #ifdef _KERNEL >> -extern int ncallout; >> - >> #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) >> #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) >> #define callout_drain(c) _callout_stop_safe(c, 1) >> From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 00:40:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79934AF0; Sat, 9 Mar 2013 00:40:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 687D91EB; Sat, 9 Mar 2013 00:40:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r290e2oR031493; Sat, 9 Mar 2013 00:40:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r290dtU0031413; Sat, 9 Mar 2013 00:39:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303090039.r290dtU0031413@svn.freebsd.org> From: Marius Strobl Date: Sat, 9 Mar 2013 00:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248078 - in stable/9/sys/dev: age alc ale an ath bce bfe bge bm bwi bwn bxe cas ce cm cp cs ctau cx cxgb cxgb/sys cxgbe cxgbe/tom dc de e1000 ed en ep et ex fatm fe firewire fxp gem ha... 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 00:40:02 -0000 Author: marius Date: Sat Mar 9 00:39:54 2013 New Revision: 248078 URL: http://svnweb.freebsd.org/changeset/base/248078 Log: MFC: r243857 (partial) Mechanically substitute flags from historic mbuf allocator with malloc(9) flags in sys/dev. Modified: stable/9/sys/dev/age/if_age.c stable/9/sys/dev/alc/if_alc.c stable/9/sys/dev/ale/if_ale.c stable/9/sys/dev/an/if_an.c stable/9/sys/dev/ath/if_ath_tx.c stable/9/sys/dev/bce/if_bce.c stable/9/sys/dev/bfe/if_bfe.c stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bm/if_bm.c stable/9/sys/dev/bwi/if_bwi.c stable/9/sys/dev/bwn/if_bwn.c stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/dev/cas/if_cas.c stable/9/sys/dev/ce/if_ce.c stable/9/sys/dev/cm/smc90cx6.c stable/9/sys/dev/cp/if_cp.c stable/9/sys/dev/cs/if_cs.c stable/9/sys/dev/ctau/if_ct.c stable/9/sys/dev/cx/if_cx.c stable/9/sys/dev/cxgb/cxgb_main.c stable/9/sys/dev/cxgb/cxgb_sge.c stable/9/sys/dev/cxgb/sys/uipc_mvec.c stable/9/sys/dev/cxgbe/t4_sge.c stable/9/sys/dev/cxgbe/tom/t4_ddp.c stable/9/sys/dev/cxgbe/tom/t4_listen.c stable/9/sys/dev/dc/if_dc.c stable/9/sys/dev/de/if_de.c stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/e1000/if_lem.c stable/9/sys/dev/ed/if_ed.c stable/9/sys/dev/en/midway.c stable/9/sys/dev/ep/if_ep.c stable/9/sys/dev/et/if_et.c stable/9/sys/dev/ex/if_ex.c stable/9/sys/dev/fatm/if_fatm.c stable/9/sys/dev/fe/if_fe.c stable/9/sys/dev/firewire/fwohci.c stable/9/sys/dev/firewire/if_fwe.c stable/9/sys/dev/firewire/if_fwip.c stable/9/sys/dev/fxp/if_fxp.c stable/9/sys/dev/gem/if_gem.c stable/9/sys/dev/hatm/if_hatm_intr.c stable/9/sys/dev/hatm/if_hatm_tx.c stable/9/sys/dev/hifn/hifn7751.c stable/9/sys/dev/hme/if_hme.c stable/9/sys/dev/ie/if_ie.c stable/9/sys/dev/if_ndis/if_ndis.c stable/9/sys/dev/ipw/if_ipw.c stable/9/sys/dev/iwi/if_iwi.c stable/9/sys/dev/iwn/if_iwn.c stable/9/sys/dev/ixgb/if_ixgb.c stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixv.c stable/9/sys/dev/jme/if_jme.c stable/9/sys/dev/le/lance.c stable/9/sys/dev/lge/if_lge.c stable/9/sys/dev/lmc/if_lmc.c stable/9/sys/dev/malo/if_malo.c stable/9/sys/dev/mge/if_mge.c stable/9/sys/dev/mn/if_mn.c stable/9/sys/dev/msk/if_msk.c stable/9/sys/dev/mwl/if_mwl.c stable/9/sys/dev/mxge/if_mxge.c stable/9/sys/dev/my/if_my.c stable/9/sys/dev/nfe/if_nfe.c stable/9/sys/dev/nge/if_nge.c stable/9/sys/dev/nve/if_nve.c stable/9/sys/dev/nxge/if_nxge.c stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/patm/if_patm_intr.c stable/9/sys/dev/patm/if_patm_rx.c stable/9/sys/dev/patm/if_patm_tx.c stable/9/sys/dev/pcn/if_pcn.c stable/9/sys/dev/pdq/pdq_freebsd.h stable/9/sys/dev/pdq/pdq_ifsubr.c stable/9/sys/dev/pdq/pdqvar.h stable/9/sys/dev/qlxgb/qla_os.c stable/9/sys/dev/ral/rt2560.c stable/9/sys/dev/ral/rt2661.c stable/9/sys/dev/ral/rt2860.c stable/9/sys/dev/re/if_re.c stable/9/sys/dev/rt/if_rt.c stable/9/sys/dev/safe/safe.c stable/9/sys/dev/sbni/if_sbni.c stable/9/sys/dev/sf/if_sf.c stable/9/sys/dev/sfxge/sfxge_dma.c stable/9/sys/dev/sfxge/sfxge_tx.c stable/9/sys/dev/sge/if_sge.c stable/9/sys/dev/sis/if_sis.c stable/9/sys/dev/sk/if_sk.c stable/9/sys/dev/smc/if_smc.c stable/9/sys/dev/sn/if_sn.c stable/9/sys/dev/snc/dp83932.c stable/9/sys/dev/ste/if_ste.c stable/9/sys/dev/stge/if_stge.c stable/9/sys/dev/ti/if_ti.c stable/9/sys/dev/tl/if_tl.c stable/9/sys/dev/tsec/if_tsec.c stable/9/sys/dev/tx/if_tx.c stable/9/sys/dev/txp/if_txp.c stable/9/sys/dev/ubsec/ubsec.c stable/9/sys/dev/usb/misc/udbp.c stable/9/sys/dev/usb/net/if_axe.c stable/9/sys/dev/usb/net/if_cdce.c stable/9/sys/dev/usb/net/if_usie.c stable/9/sys/dev/usb/net/uhso.c stable/9/sys/dev/usb/net/usb_ethernet.c stable/9/sys/dev/usb/wlan/if_rum.c stable/9/sys/dev/usb/wlan/if_run.c stable/9/sys/dev/usb/wlan/if_uath.c stable/9/sys/dev/usb/wlan/if_upgt.c stable/9/sys/dev/usb/wlan/if_ural.c stable/9/sys/dev/usb/wlan/if_urtw.c stable/9/sys/dev/usb/wlan/if_zyd.c stable/9/sys/dev/vge/if_vge.c stable/9/sys/dev/virtio/network/if_vtnet.c stable/9/sys/dev/vr/if_vr.c stable/9/sys/dev/vte/if_vte.c stable/9/sys/dev/vx/if_vx.c stable/9/sys/dev/vxge/vxge.c stable/9/sys/dev/wb/if_wb.c stable/9/sys/dev/wi/if_wi.c stable/9/sys/dev/wl/if_wl.c stable/9/sys/dev/wpi/if_wpi.c stable/9/sys/dev/xe/if_xe.c stable/9/sys/dev/xen/netfront/netfront.c stable/9/sys/dev/xl/if_xl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) Modified: stable/9/sys/dev/age/if_age.c ============================================================================== --- stable/9/sys/dev/age/if_age.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/age/if_age.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1524,7 +1524,7 @@ age_encap(struct age_softc *sc, struct m if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); /* Release original mbufs. */ m_freem(*m_head); if (m == NULL) { @@ -1602,7 +1602,7 @@ age_encap(struct age_softc *sc, struct m error = bus_dmamap_load_mbuf_sg(sc->age_cdata.age_tx_tag, map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, AGE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, AGE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -3096,7 +3096,7 @@ age_newbuf(struct age_softc *sc, struct AGE_LOCK_ASSERT(sc); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; Modified: stable/9/sys/dev/alc/if_alc.c ============================================================================== --- stable/9/sys/dev/alc/if_alc.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/alc/if_alc.c Sat Mar 9 00:39:54 2013 (r248078) @@ -2047,7 +2047,7 @@ alc_encap(struct alc_softc *sc, struct m if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); /* Release original mbufs. */ m_freem(*m_head); if (m == NULL) { @@ -2125,7 +2125,7 @@ alc_encap(struct alc_softc *sc, struct m error = bus_dmamap_load_mbuf_sg(sc->alc_cdata.alc_tx_tag, map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, ALC_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, ALC_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -2803,7 +2803,7 @@ alc_newbuf(struct alc_softc *sc, struct bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = RX_BUF_SIZE_MAX; @@ -2923,7 +2923,7 @@ alc_fixup_rx(struct ifnet *ifp, struct m * header from the mbuf chain. This can save lots of CPU * cycles for jumbo frame. */ - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { ifp->if_iqdrops++; m_freem(m); Modified: stable/9/sys/dev/ale/if_ale.c ============================================================================== --- stable/9/sys/dev/ale/if_ale.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/ale/if_ale.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1640,7 +1640,7 @@ ale_encap(struct ale_softc *sc, struct m if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); /* Release original mbufs. */ m_freem(*m_head); if (m == NULL) { @@ -1657,7 +1657,7 @@ ale_encap(struct ale_softc *sc, struct m if ((sc->ale_flags & ALE_FLAG_TXCSUM_BUG) != 0 && (m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0 && (mtod(m, intptr_t) & 3) != 0) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { *m_head = NULL; return (ENOBUFS); @@ -1742,7 +1742,7 @@ ale_encap(struct ale_softc *sc, struct m error = bus_dmamap_load_mbuf_sg(sc->ale_cdata.ale_tx_tag, map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, ALE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, ALE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; Modified: stable/9/sys/dev/an/if_an.c ============================================================================== --- stable/9/sys/dev/an/if_an.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/an/if_an.c Sat Mar 9 00:39:54 2013 (r248078) @@ -946,12 +946,12 @@ an_rxeof(struct an_softc *sc) /* dump raw 802.11 packet to bpf and skip ip stack */ BPF_TAP(ifp, bpf_buf, len); } else { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { ifp->if_ierrors++; return; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); ifp->if_ierrors++; @@ -1037,12 +1037,12 @@ an_rxeof(struct an_softc *sc) if (an_rx_desc.an_done && !an_rx_desc.an_valid) { buf = sc->an_rx_buffer[count].an_dma_vaddr; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { ifp->if_ierrors++; return; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); ifp->if_ierrors++; Modified: stable/9/sys/dev/ath/if_ath_tx.c ============================================================================== --- stable/9/sys/dev/ath/if_ath_tx.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/ath/if_ath_tx.c Sat Mar 9 00:39:54 2013 (r248078) @@ -195,7 +195,7 @@ ath_tx_dmasetup(struct ath_softc *sc, st */ if (bf->bf_nseg > ATH_TXDESC) { /* too many desc's, linearize */ sc->sc_stats.ast_tx_linear++; - m = m_collapse(m0, M_DONTWAIT, ATH_TXDESC); + m = m_collapse(m0, M_NOWAIT, ATH_TXDESC); if (m == NULL) { ath_freetx(m0); sc->sc_stats.ast_tx_nombuf++; Modified: stable/9/sys/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/bce/if_bce.c Sat Mar 9 00:39:54 2013 (r248078) @@ -5418,9 +5418,9 @@ bce_get_rx_buf(struct bce_softc *sc, str /* This is a new mbuf allocation. */ if (bce_hdr_split == TRUE) - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); else - m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, sc->rx_bd_mbuf_alloc_size); if (m_new == NULL) { @@ -5540,7 +5540,7 @@ bce_get_pg_buf(struct bce_softc *sc, str goto bce_get_pg_buf_exit); /* This is a new mbuf allocation. */ - m_new = m_getcl(M_DONTWAIT, MT_DATA, 0); + m_new = m_getcl(M_NOWAIT, MT_DATA, 0); if (m_new == NULL) { sc->mbuf_alloc_failed_count++; rc = ENOBUFS; @@ -7301,7 +7301,7 @@ bce_tso_setup(struct bce_softc *sc, stru /* Controller may modify mbuf chains. */ if (M_WRITABLE(*m_head) == 0) { - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { sc->mbuf_alloc_failed_count++; @@ -7467,7 +7467,7 @@ bce_tx_encap(struct bce_softc *sc, struc sc->mbuf_frag_count++; /* Try to defrag the mbuf. */ - m0 = m_collapse(*m_head, M_DONTWAIT, BCE_MAX_SEGMENTS); + m0 = m_collapse(*m_head, M_NOWAIT, BCE_MAX_SEGMENTS); if (m0 == NULL) { /* Defrag was unsuccessful */ m_freem(*m_head); Modified: stable/9/sys/dev/bfe/if_bfe.c ============================================================================== --- stable/9/sys/dev/bfe/if_bfe.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/bfe/if_bfe.c Sat Mar 9 00:39:54 2013 (r248078) @@ -792,7 +792,7 @@ bfe_list_newbuf(struct bfe_softc *sc, in u_int32_t ctrl; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); m->m_len = m->m_pkthdr.len = MCLBYTES; if (bus_dmamap_load_mbuf_sg(sc->bfe_rxmbuf_tag, sc->bfe_rx_sparemap, @@ -1520,7 +1520,7 @@ bfe_encap(struct bfe_softc *sc, struct m error = bus_dmamap_load_mbuf_sg(sc->bfe_txmbuf_tag, r->bfe_map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, BFE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, BFE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/bge/if_bge.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1312,12 +1312,12 @@ bge_newbuf_std(struct bge_softc *sc, int if (sc->bge_flags & BGE_FLAG_JUMBO_STD && (sc->bge_ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN))) { - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MJUM9BYTES; } else { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1368,11 +1368,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i struct mbuf *m; int error, nsegs; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); - m_cljget(m, M_DONTWAIT, MJUM9BYTES); + m_cljget(m, M_NOWAIT, MJUM9BYTES); if (!(m->m_flags & M_EXT)) { m_freem(m); return (ENOBUFS); @@ -4971,7 +4971,7 @@ bge_cksum_pad(struct mbuf *m) /* Allocate new empty mbuf, pad it. Compact later. */ struct mbuf *n; - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n == NULL) return (ENOBUFS); n->m_len = 0; @@ -5013,7 +5013,7 @@ bge_check_short_dma(struct mbuf *m) } if (found > 1) { - n = m_defrag(m, M_DONTWAIT); + n = m_defrag(m, M_NOWAIT); if (n == NULL) m_freem(m); } else @@ -5033,7 +5033,7 @@ bge_setup_tso(struct bge_softc *sc, stru if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - n = m_dup(m, M_DONTWAIT); + n = m_dup(m, M_NOWAIT); m_freem(m); if (n == NULL) return (NULL); @@ -5150,9 +5150,9 @@ bge_encap(struct bge_softc *sc, struct m * DMA read operation. */ if (sc->bge_forced_collapse == 1) - m = m_defrag(m, M_DONTWAIT); + m = m_defrag(m, M_NOWAIT); else - m = m_collapse(m, M_DONTWAIT, + m = m_collapse(m, M_NOWAIT, sc->bge_forced_collapse); if (m == NULL) m = *m_head; @@ -5164,7 +5164,7 @@ bge_encap(struct bge_softc *sc, struct m error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(m, M_DONTWAIT, BGE_NSEG_NEW); + m = m_collapse(m, M_NOWAIT, BGE_NSEG_NEW); if (m == NULL) { m_freem(*m_head); *m_head = NULL; Modified: stable/9/sys/dev/bm/if_bm.c ============================================================================== --- stable/9/sys/dev/bm/if_bm.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/bm/if_bm.c Sat Mar 9 00:39:54 2013 (r248078) @@ -540,7 +540,7 @@ bm_dummypacket(struct bm_softc *sc) ifp = sc->sc_ifp; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return; @@ -794,7 +794,7 @@ bm_encap(struct bm_softc *sc, struct mbu *m_head, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, nsegs); + m = m_collapse(*m_head, M_NOWAIT, nsegs); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1239,7 +1239,7 @@ bm_add_rxbuf(struct bm_softc *sc, int id bus_dma_segment_t segs[1]; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; Modified: stable/9/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/9/sys/dev/bwi/if_bwi.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/bwi/if_bwi.c Sat Mar 9 00:39:54 2013 (r248078) @@ -2533,7 +2533,7 @@ bwi_newbuf(struct bwi_softc *sc, int buf KASSERT(buf_idx < BWI_RX_NDESC, ("buf_idx %d", buf_idx)); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { error = ENOBUFS; @@ -3014,7 +3014,7 @@ bwi_encap(struct bwi_softc *sc, int idx, /* * Setup the embedded TX header */ - M_PREPEND(m, sizeof(*hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(*hdr), M_NOWAIT); if (m == NULL) { if_printf(ifp, "%s: prepend TX header failed\n", __func__); return ENOBUFS; @@ -3073,7 +3073,7 @@ bwi_encap(struct bwi_softc *sc, int idx, if (error) { /* error == EFBIG */ struct mbuf *m_new; - m_new = m_defrag(m, M_DONTWAIT); + m_new = m_defrag(m, M_NOWAIT); if (m_new == NULL) { if_printf(ifp, "%s: can't defrag TX buffer\n", __func__); @@ -3194,7 +3194,7 @@ bwi_encap_raw(struct bwi_softc *sc, int /* * Setup the embedded TX header */ - M_PREPEND(m, sizeof(*hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(*hdr), M_NOWAIT); if (m == NULL) { if_printf(ifp, "%s: prepend TX header failed\n", __func__); return ENOBUFS; @@ -3248,7 +3248,7 @@ bwi_encap_raw(struct bwi_softc *sc, int __func__, error); goto back; } - m_new = m_defrag(m, M_DONTWAIT); + m_new = m_defrag(m, M_NOWAIT); if (m_new == NULL) { if_printf(ifp, "%s: can't defrag TX buffer\n", __func__); Modified: stable/9/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/9/sys/dev/bwn/if_bwn.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/bwn/if_bwn.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1427,7 +1427,7 @@ bwn_pio_tx_start(struct bwn_mac *mac, st /* * XXX please removes m_defrag(9) */ - m_new = m_defrag(m, M_DONTWAIT); + m_new = m_defrag(m, M_NOWAIT); if (m_new == NULL) { device_printf(sc->sc_dev, "%s: can't defrag TX buffer\n", @@ -1543,7 +1543,7 @@ bwn_dma_tx_start(struct bwn_mac *mac, st if (error) { /* error == EFBIG */ struct mbuf *m_new; - m_new = m_defrag(m, M_DONTWAIT); + m_new = m_defrag(m, M_NOWAIT); if (m_new == NULL) { if_printf(ifp, "%s: can't defrag TX buffer\n", __func__); @@ -9123,7 +9123,7 @@ ready: padding = (macstat & BWN_RX_MAC_PADDING) ? 2 : 0; totlen = len + padding; KASSERT(totlen <= MCLBYTES, ("too big..\n")); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "%s: out of memory", __func__); goto error; @@ -9182,7 +9182,7 @@ bwn_dma_newbuf(struct bwn_dma_ring *dr, struct mbuf *m; int error; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { error = ENOBUFS; Modified: stable/9/sys/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/bxe/if_bxe.c Sat Mar 9 00:39:54 2013 (r248078) @@ -3752,7 +3752,7 @@ bxe_alloc_buf_rings(struct bxe_softc *sc if (fp != NULL) { fp->br = buf_ring_alloc(BXE_BR_SIZE, - M_DEVBUF, M_DONTWAIT, &fp->mtx); + M_DEVBUF, M_NOWAIT, &fp->mtx); if (fp->br == NULL) { rc = ENOMEM; goto bxe_alloc_buf_rings_exit; @@ -8955,7 +8955,7 @@ bxe_tx_encap(struct bxe_fastpath *fp, st } else if (error == EFBIG) { /* Possibly recoverable with defragmentation. */ fp->mbuf_defrag_attempts++; - m0 = m_defrag(*m_head, M_DONTWAIT); + m0 = m_defrag(*m_head, M_NOWAIT); if (m0 == NULL) { fp->mbuf_defrag_failures++; rc = ENOBUFS; @@ -10462,7 +10462,7 @@ bxe_alloc_tpa_mbuf(struct bxe_fastpath * #endif /* Allocate the new TPA mbuf. */ - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size); if (__predict_false(m == NULL)) { fp->mbuf_tpa_alloc_failed++; rc = ENOBUFS; @@ -10656,7 +10656,7 @@ bxe_alloc_rx_sge_mbuf(struct bxe_fastpat #endif /* Allocate a new SGE mbuf. */ - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, SGE_PAGE_SIZE); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, SGE_PAGE_SIZE); if (__predict_false(m == NULL)) { fp->mbuf_sge_alloc_failed++; rc = ENOMEM; @@ -10846,7 +10846,7 @@ bxe_alloc_rx_bd_mbuf(struct bxe_fastpath #endif /* Allocate the new RX BD mbuf. */ - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size); if (__predict_false(m == NULL)) { fp->mbuf_rx_bd_alloc_failed++; rc = ENOBUFS; Modified: stable/9/sys/dev/cas/if_cas.c ============================================================================== --- stable/9/sys/dev/cas/if_cas.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cas/if_cas.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1204,7 +1204,7 @@ cas_load_txmbuf(struct cas_softc *sc, st cflags = 0; if (((*m_head)->m_pkthdr.csum_flags & CAS_CSUM_FEATURES) != 0) { if (M_WRITABLE(*m_head) == 0) { - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); *m_head = m; if (m == NULL) @@ -1227,7 +1227,7 @@ cas_load_txmbuf(struct cas_softc *sc, st error = bus_dmamap_load_mbuf_sg(sc->sc_tdmatag, txs->txs_dmamap, *m_head, txsegs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, CAS_NTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, CAS_NTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1726,7 +1726,7 @@ cas_rint(struct cas_softc *sc) __func__, idx, off, len); #endif rxds = &sc->sc_rxdsoft[idx]; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m != NULL) { refcount_acquire(&rxds->rxds_refcount); bus_dmamap_sync(sc->sc_rdmatag, @@ -1771,7 +1771,7 @@ cas_rint(struct cas_softc *sc) __func__, idx, off, len); #endif rxds = &sc->sc_rxdsoft[idx]; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m != NULL) { refcount_acquire(&rxds->rxds_refcount); off += ETHER_ALIGN; @@ -1808,7 +1808,7 @@ cas_rint(struct cas_softc *sc) #endif rxds2 = &sc->sc_rxdsoft[idx2]; if (m != NULL) { - MGET(m2, M_DONTWAIT, MT_DATA); + MGET(m2, M_NOWAIT, MT_DATA); if (m2 != NULL) { refcount_acquire( &rxds2->rxds_refcount); Modified: stable/9/sys/dev/ce/if_ce.c ============================================================================== --- stable/9/sys/dev/ce/if_ce.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/ce/if_ce.c Sat Mar 9 00:39:54 2013 (r248078) @@ -319,10 +319,10 @@ static struct mbuf *makembuf (void *buf, { struct mbuf *m; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return 0; - MCLGET (m, M_DONTWAIT); + MCLGET (m, M_NOWAIT); if (! (m->m_flags & M_EXT)) { m_freem (m); return 0; Modified: stable/9/sys/dev/cm/smc90cx6.c ============================================================================== --- stable/9/sys/dev/cm/smc90cx6.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cm/smc90cx6.c Sat Mar 9 00:39:54 2013 (r248078) @@ -502,7 +502,7 @@ cm_srint_locked(vsc) buffer = sc->sc_rx_act ^ 1; /* Allocate header mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == 0) { /* @@ -539,7 +539,7 @@ cm_srint_locked(vsc) */ if ((len + 2 + 2) > MHLEN) { /* attach an mbuf cluster */ - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); /* Insist on getting a cluster */ if ((m->m_flags & M_EXT) == 0) { Modified: stable/9/sys/dev/cp/if_cp.c ============================================================================== --- stable/9/sys/dev/cp/if_cp.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cp/if_cp.c Sat Mar 9 00:39:54 2013 (r248078) @@ -203,10 +203,10 @@ static struct mbuf *makembuf (void *buf, { struct mbuf *m; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return 0; - MCLGET (m, M_DONTWAIT); + MCLGET (m, M_NOWAIT); if (! (m->m_flags & M_EXT)) { m_freem (m); return 0; Modified: stable/9/sys/dev/cs/if_cs.c ============================================================================== --- stable/9/sys/dev/cs/if_cs.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cs/if_cs.c Sat Mar 9 00:39:54 2013 (r248078) @@ -726,12 +726,12 @@ cs_get_packet(struct cs_softc *sc) return (-1); } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m==NULL) return (-1); if (length > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); return (-1); Modified: stable/9/sys/dev/ctau/if_ct.c ============================================================================== --- stable/9/sys/dev/ctau/if_ct.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/ctau/if_ct.c Sat Mar 9 00:39:54 2013 (r248078) @@ -205,10 +205,10 @@ static struct mbuf *makembuf (void *buf, { struct mbuf *m; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return 0; - MCLGET (m, M_DONTWAIT); + MCLGET (m, M_NOWAIT); if (! (m->m_flags & M_EXT)) { m_freem (m); return 0; Modified: stable/9/sys/dev/cx/if_cx.c ============================================================================== --- stable/9/sys/dev/cx/if_cx.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cx/if_cx.c Sat Mar 9 00:39:54 2013 (r248078) @@ -252,13 +252,13 @@ static struct mbuf *makembuf (void *buf, { struct mbuf *m, *o, *p; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return 0; if (len >= MINCLSIZE) - MCLGET (m, M_DONTWAIT); + MCLGET (m, M_NOWAIT); m->m_pkthdr.len = len; m->m_len = 0; @@ -271,13 +271,13 @@ static struct mbuf *makembuf (void *buf, if (! n) { /* Allocate new mbuf. */ o = p; - MGET (p, M_DONTWAIT, MT_DATA); + MGET (p, M_NOWAIT, MT_DATA); if (! p) { m_freem (m); return 0; } if (len >= MINCLSIZE) - MCLGET (p, M_DONTWAIT); + MCLGET (p, M_NOWAIT); p->m_len = 0; o->m_next = p; Modified: stable/9/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_main.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cxgb/cxgb_main.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1442,7 +1442,7 @@ send_pktsched_cmd(struct adapter *adap, struct mbuf *m; struct mngt_pktsched_wr *req; - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m) { req = mtod(m, struct mngt_pktsched_wr *); req->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_MNGT)); Modified: stable/9/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_sge.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cxgb/cxgb_sge.c Sat Mar 9 00:39:54 2013 (r248078) @@ -2710,7 +2710,7 @@ get_packet(adapter_t *adap, unsigned int if (recycle_enable && len <= SGE_RX_COPY_THRES && sopeop == RSPQ_SOP_EOP) { - if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) + if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL) goto skip_recycle; cl = mtod(m, void *); memcpy(cl, sd->rxsd_cl, len); @@ -2866,10 +2866,10 @@ process_responses(adapter_t *adap, struc printf("async notification\n"); if (mh->mh_head == NULL) { - mh->mh_head = m_gethdr(M_DONTWAIT, MT_DATA); + mh->mh_head = m_gethdr(M_NOWAIT, MT_DATA); m = mh->mh_head; } else { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); } if (m == NULL) goto no_mem; @@ -2882,7 +2882,7 @@ process_responses(adapter_t *adap, struc rspq->async_notif++; goto skip; } else if (flags & F_RSPD_IMM_DATA_VALID) { - struct mbuf *m = m_gethdr(M_DONTWAIT, MT_DATA); + struct mbuf *m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { no_mem: Modified: stable/9/sys/dev/cxgb/sys/uipc_mvec.c ============================================================================== --- stable/9/sys/dev/cxgb/sys/uipc_mvec.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cxgb/sys/uipc_mvec.c Sat Mar 9 00:39:54 2013 (r248078) @@ -98,7 +98,7 @@ retry: printf("mbuf chain too long: %d max allowed %d\n", seg_count, TX_MAX_SEGS); if (!defragged) { - n = m_defrag(*m, M_DONTWAIT); + n = m_defrag(*m, M_NOWAIT); if (n == NULL) { err = ENOBUFS; goto err_out; Modified: stable/9/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/9/sys/dev/cxgbe/t4_sge.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cxgbe/t4_sge.c Sat Mar 9 00:39:54 2013 (r248078) @@ -2763,7 +2763,7 @@ start: sgl->nsegs = 0; rc = bus_dmamap_load_mbuf_sg(txq->tx_tag, txm->map, m, sgl->seg, &sgl->nsegs, BUS_DMA_NOWAIT); if (rc == EFBIG && defragged == 0) { - m = m_defrag(m, M_DONTWAIT); + m = m_defrag(m, M_NOWAIT); if (m == NULL) return (EFBIG); Modified: stable/9/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_ddp.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cxgbe/tom/t4_ddp.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1207,7 +1207,7 @@ deliver: KASSERT(sb->sb_mb != NULL, ("%s: len > 0 && sb->sb_mb empty", __func__)); - m = m_copym(sb->sb_mb, 0, len, M_DONTWAIT); + m = m_copym(sb->sb_mb, 0, len, M_NOWAIT); if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_listen.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/cxgbe/tom/t4_listen.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1366,7 +1366,7 @@ do_pass_accept_req(struct sge_iq *iq, co * or may not be stashed in the original SYN mbuf passed to us. * Just copy it over instead of dealing with all possibilities. */ - m = m_dup(synqe->syn, M_DONTWAIT); + m = m_dup(synqe->syn, M_NOWAIT); if (m) m->m_pkthdr.rcvif = hw_ifp; Modified: stable/9/sys/dev/dc/if_dc.c ============================================================================== --- stable/9/sys/dev/dc/if_dc.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/dc/if_dc.c Sat Mar 9 00:39:54 2013 (r248078) @@ -2650,7 +2650,7 @@ dc_newbuf(struct dc_softc *sc, int i) bus_dma_segment_t segs[1]; int error, nseg; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -3387,7 +3387,7 @@ dc_encap(struct dc_softc *sc, struct mbu defragged = 0; if (sc->dc_flags & DC_TX_COALESCE && ((*m_head)->m_next != NULL || sc->dc_flags & DC_TX_ALIGN)) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); defragged = 1; } else { /* @@ -3402,7 +3402,7 @@ dc_encap(struct dc_softc *sc, struct mbu if (i > DC_TX_LIST_CNT / 4 || DC_TX_LIST_CNT - i + sc->dc_cdata.dc_tx_cnt <= DC_TX_LIST_RSVD) { - m = m_collapse(*m_head, M_DONTWAIT, DC_MAXFRAGS); + m = m_collapse(*m_head, M_NOWAIT, DC_MAXFRAGS); defragged = 1; } } @@ -3419,7 +3419,7 @@ dc_encap(struct dc_softc *sc, struct mbu error = bus_dmamap_load_mbuf_sg(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx], *m_head, segs, &nseg, 0); if (error == EFBIG) { - if (defragged != 0 || (m = m_collapse(*m_head, M_DONTWAIT, + if (defragged != 0 || (m = m_collapse(*m_head, M_NOWAIT, DC_MAXFRAGS)) == NULL) { m_freem(*m_head); *m_head = NULL; Modified: stable/9/sys/dev/de/if_de.c ============================================================================== --- stable/9/sys/dev/de/if_de.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/de/if_de.c Sat Mar 9 00:39:54 2013 (r248078) @@ -257,7 +257,7 @@ tulip_txprobe(tulip_softc_t * const sc) * to verify the connectivity. */ TULIP_LOCK_ASSERT(sc); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return 0; /* @@ -3517,7 +3517,7 @@ tulip_rx_intr(tulip_softc_t * const sc) ms->m_pkthdr.len = total_len; ms->m_pkthdr.rcvif = ifp; m0 = ms; - ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + ms = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); #endif TULIP_UNLOCK(sc); CTR1(KTR_TULIP, "tulip_rx_intr: passing %p to upper layer", m0); @@ -3528,7 +3528,7 @@ tulip_rx_intr(tulip_softc_t * const sc) * If we are priming the TULIP with mbufs, then allocate * a new cluster for the next descriptor. */ - ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + ms = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); #ifndef __NO_STRICT_ALIGNMENT skip_input: @@ -3970,7 +3970,7 @@ tulip_txput(tulip_softc_t * const sc, st * to recopy it into one mbuf and then try again. If * we can't recopy it, try again later. */ - m0 = m_defrag(m, M_DONTWAIT); + m0 = m_defrag(m, M_NOWAIT); if (m0 == NULL) { sc->tulip_flags |= TULIP_WANTTXSTART; #if defined(TULIP_DEBUG) Modified: stable/9/sys/dev/e1000/if_em.c ============================================================================== --- stable/9/sys/dev/e1000/if_em.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/e1000/if_em.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1829,7 +1829,7 @@ retry: if (do_tso || (m_head->m_next != NULL && m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD)) { if (M_WRITABLE(*m_headp) == 0) { - m_head = m_dup(*m_headp, M_DONTWAIT); + m_head = m_dup(*m_headp, M_NOWAIT); m_freem(*m_headp); if (m_head == NULL) { *m_headp = NULL; @@ -1946,7 +1946,7 @@ retry: if (error == EFBIG && remap) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { adapter->mbuf_alloc_failed++; m_freem(*m_headp); @@ -3928,7 +3928,7 @@ em_refresh_mbufs(struct rx_ring *rxr, in while (j != limit) { rxbuf = &rxr->rx_buffers[i]; if (rxbuf->m_head == NULL) { - m = m_getjcl(M_DONTWAIT, MT_DATA, + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); /* ** If we have a temporary resource shortage @@ -4098,7 +4098,7 @@ em_setup_receive_ring(struct rx_ring *rx continue; } #endif /* DEV_NETMAP */ - rxbuf->m_head = m_getjcl(M_DONTWAIT, MT_DATA, + rxbuf->m_head = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (rxbuf->m_head == NULL) { error = ENOBUFS; @@ -4577,7 +4577,7 @@ em_fixup_rx(struct rx_ring *rxr) bcopy(m->m_data, m->m_data + ETHER_HDR_LEN, m->m_len); m->m_data += ETHER_HDR_LEN; } else { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n != NULL) { bcopy(m->m_data, n->m_data, ETHER_HDR_LEN); m->m_data += ETHER_HDR_LEN; Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/e1000/if_igb.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1836,7 +1836,7 @@ retry: if (do_tso || (m_head->m_next != NULL && m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD)) { if (M_WRITABLE(*m_headp) == 0) { - m_head = m_dup(*m_headp, M_DONTWAIT); + m_head = m_dup(*m_headp, M_NOWAIT); m_freem(*m_headp); if (m_head == NULL) { *m_headp = NULL; @@ -1941,7 +1941,7 @@ retry: if (error == EFBIG && remap) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { adapter->mbuf_defrag_failed++; m_freem(*m_headp); @@ -3990,7 +3990,7 @@ igb_refresh_mbufs(struct rx_ring *rxr, i if (rxr->hdr_split == FALSE) goto no_split; if (rxbuf->m_head == NULL) { - mh = m_gethdr(M_DONTWAIT, MT_DATA); + mh = m_gethdr(M_NOWAIT, MT_DATA); if (mh == NULL) goto update; } else @@ -4016,7 +4016,7 @@ igb_refresh_mbufs(struct rx_ring *rxr, i htole64(hseg[0].ds_addr); no_split: if (rxbuf->m_pack == NULL) { - mp = m_getjcl(M_DONTWAIT, MT_DATA, + mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (mp == NULL) goto update; @@ -4232,7 +4232,7 @@ igb_setup_receive_ring(struct rx_ring *r goto skip_head; /* First the header */ - rxbuf->m_head = m_gethdr(M_DONTWAIT, MT_DATA); + rxbuf->m_head = m_gethdr(M_NOWAIT, MT_DATA); if (rxbuf->m_head == NULL) { error = ENOBUFS; goto fail; @@ -4254,7 +4254,7 @@ igb_setup_receive_ring(struct rx_ring *r skip_head: /* Now the payload cluster */ - rxbuf->m_pack = m_getjcl(M_DONTWAIT, MT_DATA, + rxbuf->m_pack = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (rxbuf->m_pack == NULL) { error = ENOBUFS; Modified: stable/9/sys/dev/e1000/if_lem.c ============================================================================== --- stable/9/sys/dev/e1000/if_lem.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/e1000/if_lem.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1588,7 +1588,7 @@ lem_xmit(struct adapter *adapter, struct if (error == EFBIG) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { adapter->mbuf_alloc_failed++; m_freem(*m_headp); @@ -3096,7 +3096,7 @@ lem_get_buf(struct adapter *adapter, int struct em_buffer *rx_buffer; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { adapter->mbuf_cluster_failed++; return (ENOBUFS); @@ -3668,7 +3668,7 @@ lem_fixup_rx(struct adapter *adapter) bcopy(m->m_data, m->m_data + ETHER_HDR_LEN, m->m_len); m->m_data += ETHER_HDR_LEN; } else { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n != NULL) { bcopy(m->m_data, n->m_data, ETHER_HDR_LEN); m->m_data += ETHER_HDR_LEN; Modified: stable/9/sys/dev/ed/if_ed.c ============================================================================== --- stable/9/sys/dev/ed/if_ed.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/ed/if_ed.c Sat Mar 9 00:39:54 2013 (r248078) @@ -1268,7 +1268,7 @@ ed_get_packet(struct ed_softc *sc, bus_s struct mbuf *m; /* Allocate a header mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return; m->m_pkthdr.rcvif = ifp; @@ -1282,7 +1282,7 @@ ed_get_packet(struct ed_softc *sc, bus_s */ if ((len + 2) > MHLEN) { /* Attach an mbuf cluster */ - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); /* Insist on getting a cluster */ if ((m->m_flags & M_EXT) == 0) { Modified: stable/9/sys/dev/en/midway.c ============================================================================== --- stable/9/sys/dev/en/midway.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/en/midway.c Sat Mar 9 00:39:54 2013 (r248078) @@ -837,15 +837,15 @@ copy_mbuf(struct mbuf *m) { struct mbuf *new; - MGET(new, M_WAIT, MT_DATA); + MGET(new, M_WAITOK, MT_DATA); if (m->m_flags & M_PKTHDR) { M_MOVE_PKTHDR(new, m); if (m->m_len > MHLEN) - MCLGET(new, M_WAIT); + MCLGET(new, M_WAITOK); } else { if (m->m_len > MLEN) - MCLGET(new, M_WAIT); + MCLGET(new, M_WAITOK); } bcopy(m->m_data, new->m_data, m->m_len); @@ -1925,7 +1925,7 @@ en_mget(struct en_softc *sc, u_int pktle * words at the begin. */ /* called from interrupt context */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); @@ -1940,7 +1940,7 @@ en_mget(struct en_softc *sc, u_int pktle totlen -= m->m_len; /* called from interrupt context */ - tmp = m_getm(m, totlen, M_DONTWAIT, MT_DATA); + tmp = m_getm(m, totlen, M_NOWAIT, MT_DATA); if (tmp == NULL) { m_free(m); return (NULL); @@ -2924,7 +2924,7 @@ en_attach(struct en_softc *sc) &en_utopia_methods); utopia_init_media(&sc->utopia); - MGET(sc->padbuf, M_WAIT, MT_DATA); + MGET(sc->padbuf, M_WAITOK, MT_DATA); bzero(sc->padbuf->m_data, MLEN); if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, Modified: stable/9/sys/dev/ep/if_ep.c ============================================================================== --- stable/9/sys/dev/ep/if_ep.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/ep/if_ep.c Sat Mar 9 00:39:54 2013 (r248078) @@ -747,11 +747,11 @@ read_again: rx_fifo = rx_fifo2 = status & RX_BYTES_MASK; if (EP_FTST(sc, F_RX_FIRST)) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) goto out; if (rx_fifo >= MINCLSIZE) - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); sc->top = sc->mcur = top = m; #define EROUND ((sizeof(struct ether_header) + 3) & ~3) #define EOFF (EROUND - sizeof(struct ether_header)) @@ -775,11 +775,11 @@ read_again: lenthisone = min(rx_fifo, M_TRAILINGSPACE(m)); if (lenthisone == 0) { /* no room in this one */ mcur = m; - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (!m) goto out; if (rx_fifo >= MINCLSIZE) - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); m->m_len = 0; mcur->m_next = m; lenthisone = min(rx_fifo, M_TRAILINGSPACE(m)); Modified: stable/9/sys/dev/et/if_et.c ============================================================================== --- stable/9/sys/dev/et/if_et.c Fri Mar 8 22:15:00 2013 (r248077) +++ stable/9/sys/dev/et/if_et.c Sat Mar 9 00:39:54 2013 (r248078) @@ -2169,7 +2169,7 @@ et_encap(struct et_softc *sc, struct mbu *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 01:05:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1CD251B1; Sat, 9 Mar 2013 01:05:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 09ED928F; Sat, 9 Mar 2013 01:05:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2915aPc040019; Sat, 9 Mar 2013 01:05:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2915aDt040018; Sat, 9 Mar 2013 01:05:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303090105.r2915aDt040018@svn.freebsd.org> From: Adrian Chadd Date: Sat, 9 Mar 2013 01:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248079 - head/sys/modules/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 01:05:37 -0000 Author: adrian Date: Sat Mar 9 01:05:36 2013 New Revision: 248079 URL: http://svnweb.freebsd.org/changeset/base/248079 Log: Placeholder for the upcoming AR9300 HAL code. Modified: head/sys/modules/ath/Makefile Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Sat Mar 9 00:39:54 2013 (r248078) +++ head/sys/modules/ath/Makefile Sat Mar 9 01:05:36 2013 (r248079) @@ -123,6 +123,15 @@ SRCS+= ah_eeprom_9287.c .PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9002 SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c +# + AR9300 HAL +# .PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9003 +#SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c +#SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c +#SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c +#SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c +#SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c +#SRCS+= ar9300_power.c ar9300_timer.c + # NB: rate control is bound to the driver by symbol names so only pick one .if ${ATH_RATE} == "sample" .PATH: ${.CURDIR}/../../dev/ath/ath_rate/sample From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 02:05:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 276D7E10; Sat, 9 Mar 2013 02:05:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14A83643; Sat, 9 Mar 2013 02:05:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2925Ut3058283; Sat, 9 Mar 2013 02:05:30 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2925UQv058279; Sat, 9 Mar 2013 02:05:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303090205.r2925UQv058279@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 02:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248082 - in head/sys: cddl/compat/opensolaris/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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 02:05:31 -0000 Author: attilio Date: Sat Mar 9 02:05:29 2013 New Revision: 248082 URL: http://svnweb.freebsd.org/changeset/base/248082 Log: Merge from vmc-playground: Introduce a new KPI that verifies if the page cache is empty for a specified vm_object. This KPI does not make assumptions about the locking in order to be used also for building assertions at init and destroy time. It is mostly used to hide implementation details of the page cache. Sponsored by: EMC / Isilon storage division Reviewed by: jeff Reviewed by: alc (vm_radix based version) Tested by: flo, pho, jhb, davide Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/vnode.h Sat Mar 9 01:54:26 2013 (r248081) +++ head/sys/cddl/compat/opensolaris/sys/vnode.h Sat Mar 9 02:05:29 2013 (r248082) @@ -76,7 +76,7 @@ vn_is_readonly(vnode_t *vp) #define vn_has_cached_data(vp) \ ((vp)->v_object != NULL && \ ((vp)->v_object->resident_page_count > 0 || \ - (vp)->v_object->cache != NULL)) + !vm_object_cache_is_empty((vp)->v_object))) #define vn_exists(vp) do { } while (0) #define vn_invalid(vp) do { } while (0) #define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0) Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Mar 9 01:54:26 2013 (r248081) +++ head/sys/vm/vm_object.c Sat Mar 9 02:05:29 2013 (r248082) @@ -173,7 +173,7 @@ vm_object_zdtor(void *mem, int size, voi ("object %p has reservations", object)); #endif - KASSERT(object->cache == NULL, + KASSERT(vm_object_cache_is_empty(object), ("object %p has cached pages", object)); KASSERT(object->paging_in_progress == 0, @@ -752,7 +752,7 @@ vm_object_terminate(vm_object_t object) if (__predict_false(!LIST_EMPTY(&object->rvq))) vm_reserv_break_all(object); #endif - if (__predict_false(object->cache != NULL)) + if (__predict_false(!vm_object_cache_is_empty(object))) vm_page_cache_free(object, 0, 0); /* @@ -1377,7 +1377,7 @@ retry: * should still be OBJT_DEFAULT and orig_object should not * contain any cached pages within the specified range. */ - if (__predict_false(orig_object->cache != NULL)) + if (__predict_false(!vm_object_cache_is_empty(orig_object))) vm_page_cache_transfer(orig_object, offidxstart, new_object); } @@ -1726,7 +1726,8 @@ vm_object_collapse(vm_object_t object) /* * Free any cached pages from backing_object. */ - if (__predict_false(backing_object->cache != NULL)) + if (__predict_false( + !vm_object_cache_is_empty(backing_object))) vm_page_cache_free(backing_object, 0, 0); } /* @@ -1920,7 +1921,7 @@ again: } vm_object_pip_wakeup(object); skipmemq: - if (__predict_false(object->cache != NULL)) + if (__predict_false(!vm_object_cache_is_empty(object))) vm_page_cache_free(object, start, end); } Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sat Mar 9 01:54:26 2013 (r248081) +++ head/sys/vm/vm_object.h Sat Mar 9 02:05:29 2013 (r248082) @@ -229,6 +229,13 @@ void vm_object_pip_wakeup(vm_object_t ob void vm_object_pip_wakeupn(vm_object_t object, short i); void vm_object_pip_wait(vm_object_t object, char *waitid); +static __inline boolean_t +vm_object_cache_is_empty(vm_object_t object) +{ + + return (object->cache == NULL); +} + vm_object_t vm_object_allocate (objtype_t, vm_pindex_t); boolean_t vm_object_coalesce(vm_object_t, vm_ooffset_t, vm_size_t, vm_size_t, boolean_t); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Mar 9 01:54:26 2013 (r248081) +++ head/sys/vm/vm_page.c Sat Mar 9 02:05:29 2013 (r248082) @@ -1129,7 +1129,7 @@ vm_page_cache_free(vm_object_t object, v boolean_t empty; mtx_lock(&vm_page_queue_free_mtx); - if (__predict_false(object->cache == NULL)) { + if (__predict_false(vm_object_cache_is_empty(object))) { mtx_unlock(&vm_page_queue_free_mtx); return; } @@ -1173,7 +1173,7 @@ vm_page_cache_free(vm_object_t object, v cnt.v_cache_count--; cnt.v_free_count++; } - empty = object->cache == NULL; + empty = vm_object_cache_is_empty(object); mtx_unlock(&vm_page_queue_free_mtx); if (object->type == OBJT_VNODE && empty) vdrop(object->handle); @@ -1257,7 +1257,7 @@ vm_page_cache_transfer(vm_object_t orig_ * not. */ VM_OBJECT_LOCK_ASSERT(new_object, MA_OWNED); - KASSERT(new_object->cache == NULL, + KASSERT(vm_object_cache_is_empty(new_object), ("vm_page_cache_transfer: object %p has cached pages", new_object)); mtx_lock(&vm_page_queue_free_mtx); @@ -1300,7 +1300,7 @@ vm_page_cache_transfer(vm_object_t orig_ m_next->left = m; new_object->cache = m_next; } - KASSERT(new_object->cache == NULL || + KASSERT(vm_object_cache_is_empty(new_object) || new_object->type == OBJT_SWAP, ("vm_page_cache_transfer: object %p's type is incompatible" " with cached pages", new_object)); @@ -1327,7 +1327,7 @@ vm_page_is_cached(vm_object_t object, vm * exist. */ VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (__predict_true(object->cache == NULL)) + if (__predict_true(vm_object_cache_is_empty(object))) return (FALSE); mtx_lock(&vm_page_queue_free_mtx); m = vm_page_cache_lookup(object, pindex); @@ -1465,7 +1465,8 @@ vm_page_alloc(vm_object_t object, vm_pin m->valid = 0; m_object = m->object; vm_page_cache_remove(m); - if (m_object->type == OBJT_VNODE && m_object->cache == NULL) + if (m_object->type == OBJT_VNODE && + vm_object_cache_is_empty(m_object)) vp = m_object->handle; } else { KASSERT(VM_PAGE_IS_FREE(m), @@ -1722,7 +1723,8 @@ vm_page_alloc_init(vm_page_t m) m->valid = 0; m_object = m->object; vm_page_cache_remove(m); - if (m_object->type == OBJT_VNODE && m_object->cache == NULL) + if (m_object->type == OBJT_VNODE && + vm_object_cache_is_empty(m_object)) drop = m_object->handle; } else { KASSERT(VM_PAGE_IS_FREE(m), From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 02:32:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A6EB92B4; Sat, 9 Mar 2013 02:32:27 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 909A76FF; Sat, 9 Mar 2013 02:32:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r292WRmQ067186; Sat, 9 Mar 2013 02:32:27 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r292WN6W067161; Sat, 9 Mar 2013 02:32:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303090232.r292WN6W067161@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 02:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248084 - in head/sys: amd64/amd64 arm/arm cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 02:32:27 -0000 Author: attilio Date: Sat Mar 9 02:32:23 2013 New Revision: 248084 URL: http://svnweb.freebsd.org/changeset/base/248084 Log: Switch the vm_object mutex to be a rwlock. This will enable in the future further optimizations where the vm_object lock will be held in read mode most of the time the page cache resident pool of pages are accessed for reading purposes. The change is mostly mechanical but few notes are reported: * The KPI changes as follow: - VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK() - VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK() - VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK() - VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED() (in order to avoid visibility of implementation details) - The read-mode operations are added: VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(), VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED() * The vm/vm_pager.h namespace pollution avoidance (forcing requiring sys/mutex.h in consumers directly to cater its inlining functions using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h consumers now must include also sys/rwlock.h. * zfs requires a quite convoluted fix to include FreeBSD rwlocks into the compat layer because the name clash between FreeBSD and solaris versions must be avoided. At this purpose zfs redefines the vm_object locking functions directly, isolating the FreeBSD components in specific compat stubs. The KPI results heavilly broken by this commit. Thirdy part ports must be updated accordingly (I can think off-hand of VirtualBox, for example). Sponsored by: EMC / Isilon storage division Reviewed by: jeff Reviewed by: pjd (ZFS specific review) Discussed with: alc Tested by: pho Added: head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c - copied unchanged from r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c head/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h - copied unchanged from r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h head/sys/cddl/compat/opensolaris/sys/vm.h - copied unchanged from r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/vm.h Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/pmap.c head/sys/arm/arm/machdep.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/compat/linprocfs/linprocfs.c head/sys/conf/files head/sys/dev/agp/agp.c head/sys/dev/agp/agp_i810.c head/sys/dev/drm/drmP.h head/sys/dev/drm2/drmP.h head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/ttm/ttm_bo_vm.c head/sys/dev/drm2/ttm/ttm_tt.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/md/md.c head/sys/dev/netmap/netmap.c head/sys/dev/sound/pcm/dsp.c head/sys/fs/fuse/fuse_io.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/procfs/procfs_map.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/i386/i386/machdep.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/pmap.c head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/kern/kern_proc.c head/sys/kern/kern_sharedpage.c head/sys/kern/kern_shutdown.c head/sys/kern/subr_uio.c head/sys/kern/sys_process.c head/sys/kern/sysv_shm.c head/sys/kern/uipc_shm.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_aio.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/mips/mips/machdep.c head/sys/mips/mips/pmap.c head/sys/modules/zfs/Makefile head/sys/nfsclient/nfs_bio.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsserver/nfs_serv.c head/sys/ofed/drivers/infiniband/core/umem.c head/sys/ofed/include/linux/linux_compat.c head/sys/pc98/pc98/machdep.c head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c head/sys/security/mac/mac_process.c head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/pmap.c head/sys/ufs/ffs/ffs_rawread.c head/sys/ufs/ffs/ffs_vnops.c head/sys/vm/default_pager.c head/sys/vm/device_pager.c head/sys/vm/phys_pager.c head/sys/vm/sg_pager.c head/sys/vm/swap_pager.c head/sys/vm/uma_core.c head/sys/vm/vm_fault.c head/sys/vm/vm_glue.c head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_map.c head/sys/vm/vm_meter.c head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h head/sys/vm/vm_reserv.c head/sys/vm/vnode_pager.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/amd64/amd64/machdep.c Sat Mar 9 02:32:23 2013 (r248084) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef SMP Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/amd64/amd64/pmap.c Sat Mar 9 02:32:23 2013 (r248084) @@ -3493,7 +3493,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0) - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); pa = VM_PAGE_TO_PHYS(m); newpte = (pt_entry_t)(pa | PG_A | PG_V); if ((access & VM_PROT_WRITE) != 0) @@ -3760,7 +3760,7 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m, mpte; vm_pindex_t diff, psize; - VM_OBJECT_LOCK_ASSERT(m_start->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m_start->object); psize = atop(end - start); mpte = NULL; m = m_start; @@ -3942,7 +3942,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_page_t p, pdpg; int pat_mode; - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { @@ -4556,7 +4556,7 @@ pmap_is_modified(vm_page_t m) * concurrently set while the object is locked. Thus, if PGA_WRITEABLE * is clear, no PTEs can have PG_M set. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); @@ -4687,7 +4687,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; @@ -4831,7 +4831,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/arm/arm/machdep.c Sat Mar 9 02:32:23 2013 (r248084) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/arm/arm/pmap-v6.c Sat Mar 9 02:32:23 2013 (r248084) @@ -2212,7 +2212,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_pindex_t pindex, vm_size_t size) { - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } @@ -3428,7 +3428,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); @@ -3475,7 +3475,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) != 0 || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/arm/arm/pmap.c Sat Mar 9 02:32:23 2013 (r248084) @@ -3006,7 +3006,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_pindex_t pindex, vm_size_t size) { - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } @@ -4461,7 +4461,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); @@ -4523,7 +4523,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) != 0 || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); Copied: head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c (from r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Sat Mar 9 02:32:23 2013 (r248084, copy of r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +const int zfs_vm_pagerret_bad = VM_PAGER_BAD; +const int zfs_vm_pagerret_error = VM_PAGER_ERROR; +const int zfs_vm_pagerret_ok = VM_PAGER_OK; + +void +zfs_vmobject_assert_wlocked(vm_object_t object) +{ + + /* + * This is not ideal because FILE/LINE used by assertions will not + * be too helpful, but it must be an hard function for + * compatibility reasons. + */ + VM_OBJECT_ASSERT_WLOCKED(object); +} + +void +zfs_vmobject_wlock(vm_object_t object) +{ + + VM_OBJECT_WLOCK(object); +} + +void +zfs_vmobject_wunlock(vm_object_t object) +{ + + VM_OBJECT_WUNLOCK(object); +} Copied: head/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h (from r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h Sat Mar 9 02:32:23 2013 (r248084, copy of r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_FREEBSD_RWLOCK_H_ +#define _OPENSOLARIS_SYS_FREEBSD_RWLOCK_H_ + +#include_next + +#endif Copied: head/sys/cddl/compat/opensolaris/sys/vm.h (from r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/vm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/compat/opensolaris/sys/vm.h Sat Mar 9 02:32:23 2013 (r248084, copy of r248082, user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/vm.h) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_VM_H_ +#define _OPENSOLARIS_SYS_VM_H_ + +#ifdef _KERNEL + +extern const int zfs_vm_pagerret_bad; +extern const int zfs_vm_pagerret_error; +extern const int zfs_vm_pagerret_ok; + +void zfs_vmobject_assert_wlocked(vm_object_t object); +void zfs_vmobject_wlock(vm_object_t object); +void zfs_vmobject_wunlock(vm_object_t object); + +#endif /* _KERNEL */ + +#endif /* _OPENSOLARIS_SYS_VM_H_ */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Sat Mar 9 02:32:23 2013 (r248084) @@ -103,7 +103,6 @@ extern "C" { #include #include #include -#include #include #include /* There is clash. vm_map.h defines the two below and vdev_cache.c use them. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Mar 9 02:32:23 2013 (r248084) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -329,7 +330,7 @@ page_busy(vnode_t *vp, int64_t start, in vm_page_t pp; obj = vp->v_object; - VM_OBJECT_LOCK_ASSERT(obj, MA_OWNED); + zfs_vmobject_assert_wlocked(obj); for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && @@ -377,7 +378,7 @@ page_hold(vnode_t *vp, int64_t start) vm_page_t pp; obj = vp->v_object; - VM_OBJECT_LOCK_ASSERT(obj, MA_OWNED); + zfs_vmobject_assert_wlocked(obj); for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && @@ -450,7 +451,7 @@ update_pages(vnode_t *vp, int64_t start, ASSERT(obj != NULL); off = start & PAGEOFFSET; - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; int nbytes = imin(PAGESIZE - off, len); @@ -467,23 +468,23 @@ update_pages(vnode_t *vp, int64_t start, ("zfs update_pages: unbusy page in putpages case")); KASSERT(!pmap_page_is_write_mapped(pp), ("zfs update_pages: writable page in putpages case")); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); (void) dmu_write(os, oid, start, nbytes, va, tx); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); vm_page_undirty(pp); } else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) { - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); (void) dmu_read(os, oid, start+off, nbytes, va+off, DMU_READ_PREFETCH);; zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); page_unbusy(pp); } len -= nbytes; @@ -491,7 +492,7 @@ update_pages(vnode_t *vp, int64_t start, } if (segflg != UIO_NOCOPY) vm_object_pip_wakeupn(obj, 0); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); } /* @@ -523,7 +524,7 @@ mappedread_sf(vnode_t *vp, int nbytes, u ASSERT(obj != NULL); ASSERT((uio->uio_loffset & PAGEOFFSET) == 0); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start = uio->uio_loffset; len > 0; start += PAGESIZE) { int bytes = MIN(PAGESIZE, len); @@ -531,14 +532,14 @@ mappedread_sf(vnode_t *vp, int nbytes, u VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_IGN_SBUSY); if (pp->valid == 0) { vm_page_io_start(pp); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); error = dmu_read(os, zp->z_id, start, bytes, va, DMU_READ_PREFETCH); if (bytes != PAGESIZE && error == 0) bzero(va + bytes, PAGESIZE - bytes); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); vm_page_io_finish(pp); vm_page_lock(pp); if (error) { @@ -555,7 +556,7 @@ mappedread_sf(vnode_t *vp, int nbytes, u uio->uio_offset += bytes; len -= bytes; } - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); return (error); } @@ -587,7 +588,7 @@ mappedread(vnode_t *vp, int nbytes, uio_ start = uio->uio_loffset; off = start & PAGEOFFSET; - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; uint64_t bytes = MIN(PAGESIZE - off, len); @@ -596,23 +597,23 @@ mappedread(vnode_t *vp, int nbytes, uio_ struct sf_buf *sf; caddr_t va; - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); error = uiomove(va + off, bytes, UIO_READ, uio); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); page_unhold(pp); } else { - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); error = dmu_read_uio(os, zp->z_id, uio, bytes); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); } len -= bytes; off = 0; if (error) break; } - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); return (error); } @@ -5684,7 +5685,7 @@ zfs_getpages(struct vnode *vp, vm_page_t mfirst = m[reqstart]; mlast = m[reqstart + reqsize - 1]; - VM_OBJECT_LOCK(object); + zfs_vmobject_wlock(object); for (i = 0; i < reqstart; i++) { vm_page_lock(m[i]); @@ -5700,9 +5701,9 @@ zfs_getpages(struct vnode *vp, vm_page_t if (mreq->valid && reqsize == 1) { if (mreq->valid != VM_PAGE_BITS_ALL) vm_page_zero_invalid(mreq, TRUE); - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); - return (VM_PAGER_OK); + return (zfs_vm_pagerret_ok); } PCPU_INC(cnt.v_vnodein); @@ -5716,16 +5717,16 @@ zfs_getpages(struct vnode *vp, vm_page_t vm_page_unlock(m[i]); } } - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); - return (VM_PAGER_BAD); + return (zfs_vm_pagerret_bad); } lsize = PAGE_SIZE; if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) lsize = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mlast->pindex); - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); for (i = reqstart; i < reqstart + reqsize; i++) { size = PAGE_SIZE; @@ -5741,7 +5742,7 @@ zfs_getpages(struct vnode *vp, vm_page_t break; } - VM_OBJECT_LOCK(object); + zfs_vmobject_wlock(object); for (i = reqstart; i < reqstart + reqsize; i++) { if (!error) @@ -5751,11 +5752,11 @@ zfs_getpages(struct vnode *vp, vm_page_t vm_page_readahead_finish(m[i]); } - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); - return (error ? VM_PAGER_ERROR : VM_PAGER_OK); + return (error ? zfs_vm_pagerret_error : zfs_vm_pagerret_ok); } static int Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/compat/linprocfs/linprocfs.c Sat Mar 9 02:32:23 2013 (r248084) @@ -1031,9 +1031,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) e_end = entry->end; obj = entry->object.vm_object; for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { - VM_OBJECT_LOCK(tobj); + VM_OBJECT_WLOCK(tobj); if (lobj != obj) - VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_WUNLOCK(lobj); lobj = tobj; } last_timestamp = map->timestamp; @@ -1049,11 +1049,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) else vp = NULL; if (lobj != obj) - VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_WUNLOCK(lobj); flags = obj->flags; ref_count = obj->ref_count; shadow_count = obj->shadow_count; - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); if (vp) { vn_fullpath(td, vp, &name, &freename); vn_lock(vp, LK_SHARED | LK_RETRY); Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/conf/files Sat Mar 9 02:32:23 2013 (r248084) @@ -157,6 +157,7 @@ cddl/compat/opensolaris/kern/opensolaris cddl/compat/opensolaris/kern/opensolaris_taskq.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_uio.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_vfs.c optional zfs compile-with "${ZFS_C}" +cddl/compat/opensolaris/kern/opensolaris_vm.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_zone.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/acl/acl_common.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/avl/avl.c optional zfs compile-with "${ZFS_C}" Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/dev/agp/agp.c Sat Mar 9 02:32:23 2013 (r248084) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -544,7 +545,7 @@ agp_generic_bind_memory(device_t dev, st * because vm_page_grab() may sleep and we can't hold a mutex * while sleeping. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { /* * Find a page from the object and wire it @@ -557,14 +558,14 @@ agp_generic_bind_memory(device_t dev, st VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); AGP_DPF("found page pa=%#jx\n", (uintmax_t)VM_PAGE_TO_PHYS(m)); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); mtx_lock(&sc->as_lock); if (mem->am_is_bound) { device_printf(dev, "memory already bound\n"); error = EINVAL; - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); i = 0; goto bad; } @@ -573,7 +574,7 @@ agp_generic_bind_memory(device_t dev, st * Bind the individual pages and flush the chipset's * TLB. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(i)); @@ -601,7 +602,7 @@ agp_generic_bind_memory(device_t dev, st } vm_page_wakeup(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); /* * Flush the cpu cache since we are providing a new mapping @@ -622,7 +623,7 @@ agp_generic_bind_memory(device_t dev, st return 0; bad: mtx_unlock(&sc->as_lock); - VM_OBJECT_LOCK_ASSERT(mem->am_obj, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(mem->am_obj); for (k = 0; k < mem->am_size; k += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k)); if (k >= i) @@ -631,7 +632,7 @@ bad: vm_page_unwire(m, 0); vm_page_unlock(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); return error; } @@ -658,14 +659,14 @@ agp_generic_unbind_memory(device_t dev, */ for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) AGP_UNBIND_PAGE(dev, mem->am_offset + i); - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, atop(i)); vm_page_lock(m); vm_page_unwire(m, 0); vm_page_unlock(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); agp_flush_cache(); AGP_FLUSH_TLB(dev); Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/dev/agp/agp_i810.c Sat Mar 9 02:32:23 2013 (r248084) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1967,10 +1968,10 @@ agp_i810_alloc_memory(device_t dev, int * Allocate and wire down the page now so that we can * get its physical address. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); m = vm_page_grab(mem->am_obj, 0, VM_ALLOC_NOBUSY | VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); mem->am_physical = VM_PAGE_TO_PHYS(m); } else { /* Our allocation is already nicely wired down for us. @@ -2005,12 +2006,12 @@ agp_i810_free_memory(device_t dev, struc /* * Unwire the page which we wired in alloc_memory. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); m = vm_page_lookup(mem->am_obj, 0); vm_page_lock(m); vm_page_unwire(m, 0); vm_page_unlock(m); - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); } else { contigfree(sc->argb_cursor, mem->am_size, M_AGP); sc->argb_cursor = NULL; Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/dev/drm/drmP.h Sat Mar 9 02:32:23 2013 (r248084) @@ -59,6 +59,7 @@ struct drm_file; #include #include #include +#include #include #include #include Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/dev/drm2/drmP.h Sat Mar 9 02:32:23 2013 (r248084) @@ -58,6 +58,7 @@ struct drm_file; #include #include #include +#include #include #include #include Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/dev/drm2/i915/i915_gem.c Sat Mar 9 02:32:23 2013 (r248084) @@ -990,14 +990,14 @@ i915_gem_swap_io(struct drm_device *dev, vm_obj = obj->base.vm_obj; ret = 0; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_pip_add(vm_obj, 1); while (size > 0) { obj_pi = OFF_TO_IDX(offset); obj_po = offset & PAGE_MASK; m = i915_gem_wire_page(vm_obj, obj_pi); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); sched_pin(); sf = sf_buf_alloc(m, SFB_CPUPRIVATE); @@ -1031,7 +1031,7 @@ i915_gem_swap_io(struct drm_device *dev, } sf_buf_free(sf); sched_unpin(); - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); if (rw == UIO_WRITE) vm_page_dirty(m); vm_page_reference(m); @@ -1044,7 +1044,7 @@ i915_gem_swap_io(struct drm_device *dev, break; } vm_object_pip_wakeup(vm_obj); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); return (ret); } @@ -1357,7 +1357,7 @@ i915_gem_pager_fault(vm_object_t vm_obj, } else oldm = NULL; retry: - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); unlocked_vmobj: cause = ret = 0; m = NULL; @@ -1407,7 +1407,7 @@ unlocked_vmobj: list_move_tail(&obj->mm_list, &dev_priv->mm.inactive_list); obj->fault_mappable = true; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); m = vm_phys_fictitious_to_vm_page(dev->agp->base + obj->gtt_offset + offset); if (m == NULL) { @@ -1452,7 +1452,7 @@ out: kern_yield(PRI_USER); goto unlocked_vmobj; } - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_pip_wakeup(vm_obj); return (VM_PAGER_ERROR); } @@ -2208,12 +2208,12 @@ i915_gem_object_get_pages_gtt(struct drm obj->pages = malloc(page_count * sizeof(vm_page_t), DRM_I915_GEM, M_WAITOK); vm_obj = obj->base.vm_obj; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); for (i = 0; i < page_count; i++) { if ((obj->pages[i] = i915_gem_wire_page(vm_obj, i)) == NULL) goto failed; } - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); if (i915_gem_object_needs_bit17_swizzle(obj)) i915_gem_object_do_bit_17_swizzle(obj); return (0); @@ -2226,7 +2226,7 @@ failed: vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); free(obj->pages, DRM_I915_GEM); obj->pages = NULL; return (-EIO); @@ -2272,7 +2272,7 @@ i915_gem_object_put_pages_gtt(struct drm if (obj->madv == I915_MADV_DONTNEED) obj->dirty = 0; page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); #if GEM_PARANOID_CHECK_GTT i915_gem_assert_pages_not_mapped(obj->base.dev, obj->pages, page_count); #endif @@ -2287,7 +2287,7 @@ i915_gem_object_put_pages_gtt(struct drm vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); obj->dirty = 0; free(obj->pages, DRM_I915_GEM); obj->pages = NULL; @@ -2309,7 +2309,7 @@ i915_gem_release_mmap(struct drm_i915_ge if (devobj != NULL) { page_count = OFF_TO_IDX(obj->base.size); - VM_OBJECT_LOCK(devobj); + VM_OBJECT_WLOCK(devobj); retry: for (i = 0; i < page_count; i++) { m = vm_page_lookup(devobj, i); @@ -2319,7 +2319,7 @@ retry: goto retry; cdev_pager_free_page(devobj, m); } - VM_OBJECT_UNLOCK(devobj); + VM_OBJECT_WUNLOCK(devobj); vm_object_deallocate(devobj); } @@ -2437,9 +2437,9 @@ i915_gem_object_truncate(struct drm_i915 vm_object_t vm_obj; vm_obj = obj->base.vm_obj; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_page_remove(vm_obj, 0, 0, false); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); obj->madv = I915_MADV_PURGED_INTERNAL; } @@ -2488,7 +2488,7 @@ i915_gem_wire_page(vm_object_t object, v vm_page_t m; int rv; - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(object, pindex, NULL, NULL)) { @@ -3567,13 +3567,13 @@ i915_gem_detach_phys_object(struct drm_d vaddr = obj->phys_obj->handle->vaddr; page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); for (i = 0; i < page_count; i++) { m = i915_gem_wire_page(obj->base.vm_obj, i); if (m == NULL) continue; /* XXX */ - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); sf = sf_buf_alloc(m, 0); if (sf != NULL) { dst = (char *)sf_buf_kva(sf); @@ -3582,7 +3582,7 @@ i915_gem_detach_phys_object(struct drm_d } drm_clflush_pages(&m, 1); - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); vm_page_reference(m); vm_page_lock(m); vm_page_dirty(m); @@ -3590,7 +3590,7 @@ i915_gem_detach_phys_object(struct drm_d vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); intel_gtt_chipset_flush(); obj->phys_obj->cur_obj = NULL; @@ -3632,7 +3632,7 @@ i915_gem_attach_phys_object(struct drm_d page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); ret = 0; for (i = 0; i < page_count; i++) { m = i915_gem_wire_page(obj->base.vm_obj, i); @@ -3640,14 +3640,14 @@ i915_gem_attach_phys_object(struct drm_d ret = -EIO; break; } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); sf = sf_buf_alloc(m, 0); src = (char *)sf_buf_kva(sf); dst = (char *)obj->phys_obj->handle->vaddr + IDX_TO_OFF(i); memcpy(dst, src, PAGE_SIZE); sf_buf_free(sf); - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); vm_page_reference(m); vm_page_lock(m); @@ -3655,7 +3655,7 @@ i915_gem_attach_phys_object(struct drm_d vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); return (0); } Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Mar 9 02:32:23 2013 (r248084) @@ -118,7 +118,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_o } else oldm = NULL; retry: - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); m = NULL; reserve: @@ -213,7 +213,7 @@ reserve: VM_MEMATTR_WRITE_BACK : ttm_io_prot(bo->mem.placement)); } - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); if ((m->flags & VPO_BUSY) != 0) { vm_page_sleep(m, "ttmpbs"); ttm_mem_io_unlock(man); @@ -241,11 +241,11 @@ out_unlock1: return (retval); out_io_unlock: - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); goto out_io_unlock1; out_unlock: - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); goto out_unlock1; } Modified: head/sys/dev/drm2/ttm/ttm_tt.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_tt.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/dev/drm2/ttm/ttm_tt.c Sat Mar 9 02:32:23 2013 (r248084) @@ -285,7 +285,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) obj = ttm->swap_storage; - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); vm_object_pip_add(obj, 1); for (i = 0; i < ttm->num_pages; ++i) { from_page = vm_page_grab(obj, i, VM_ALLOC_RETRY); @@ -312,7 +312,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) vm_page_wakeup(from_page); } vm_object_pip_wakeup(obj); - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP)) vm_object_deallocate(obj); @@ -322,7 +322,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) err_ret: vm_object_pip_wakeup(obj); - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); return (ret); } @@ -346,7 +346,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, v } else obj = persistent_swap_storage; - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); vm_object_pip_add(obj, 1); for (i = 0; i < ttm->num_pages; ++i) { from_page = ttm->pages[i]; @@ -359,7 +359,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, v vm_page_wakeup(to_page); } vm_object_pip_wakeup(obj); - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); ttm->bdev->driver->ttm_tt_unpopulate(ttm); ttm->swap_storage = obj; Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Mar 9 02:13:24 2013 (r248083) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Mar 9 02:32:23 2013 (r248084) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 02:36:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5196B55D; Sat, 9 Mar 2013 02:36:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39DD172D; Sat, 9 Mar 2013 02:36:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r292apHl068008; Sat, 9 Mar 2013 02:36:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r292aXWs067894; Sat, 9 Mar 2013 02:36:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201303090236.r292aXWs067894@svn.freebsd.org> From: Marius Strobl Date: Sat, 9 Mar 2013 02:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248085 - in stable/9/sys: amd64/amd64 amd64/linux32 arm/arm arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 cam/ata cam/scsi compat/ia32 compat/linux compat/x86bios dev/aac dev/a... 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 02:36:51 -0000 Author: marius Date: Sat Mar 9 02:36:32 2013 New Revision: 248085 URL: http://svnweb.freebsd.org/changeset/base/248085 Log: MFC: r227309 (partial) Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Modified: stable/9/sys/amd64/amd64/mp_machdep.c stable/9/sys/amd64/amd64/pmap.c stable/9/sys/amd64/linux32/linux32_sysvec.c stable/9/sys/arm/arm/busdma_machdep.c stable/9/sys/arm/xscale/i80321/iq31244_7seg.c stable/9/sys/arm/xscale/i8134x/iq81342_7seg.c stable/9/sys/arm/xscale/ixp425/if_npe.c stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_pmp.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/compat/ia32/ia32_sysvec.c stable/9/sys/compat/linux/linux_mib.c stable/9/sys/compat/x86bios/x86bios.c stable/9/sys/dev/aac/aac.c stable/9/sys/dev/acpica/acpi_ec.c stable/9/sys/dev/acpica/acpi_smbat.c stable/9/sys/dev/an/if_an.c stable/9/sys/dev/ata/ata-all.c stable/9/sys/dev/ath/ah_osdep.c stable/9/sys/dev/atkbdc/psm.c stable/9/sys/dev/bce/if_bce.c stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bktr/bktr_os.c stable/9/sys/dev/bwn/if_bwn.c stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/dev/cardbus/cardbus.c stable/9/sys/dev/cs/if_cs.c stable/9/sys/dev/dcons/dcons_os.c stable/9/sys/dev/fb/vesa.c stable/9/sys/dev/fdc/fdc.c stable/9/sys/dev/firewire/fwmem.c stable/9/sys/dev/firewire/if_fwe.c stable/9/sys/dev/firewire/if_fwip.c stable/9/sys/dev/firewire/sbp.c stable/9/sys/dev/hifn/hifn7751.c stable/9/sys/dev/ipmi/ipmi.c stable/9/sys/dev/kbd/kbd.c stable/9/sys/dev/malo/if_malo_pci.c stable/9/sys/dev/mmc/mmc.c stable/9/sys/dev/mwl/mwlhal.c stable/9/sys/dev/pccard/pccard.c stable/9/sys/dev/pccbb/pccbb.c stable/9/sys/dev/pccbb/pccbb_isa.c stable/9/sys/dev/rndtest/rndtest.c stable/9/sys/dev/rt/if_rt.c stable/9/sys/dev/safe/safe.c stable/9/sys/dev/sdhci/sdhci.c stable/9/sys/dev/sound/midi/midi.c stable/9/sys/dev/sound/pci/maestro.c stable/9/sys/dev/sound/usb/uaudio.c stable/9/sys/dev/syscons/syscons.c stable/9/sys/dev/ubsec/ubsec.c stable/9/sys/dev/usb/controller/at91dci.c stable/9/sys/dev/usb/controller/atmegadci.c stable/9/sys/dev/usb/controller/avr32dci.c stable/9/sys/dev/usb/controller/ehci.c stable/9/sys/dev/usb/controller/musb_otg.c stable/9/sys/dev/usb/controller/ohci.c stable/9/sys/dev/usb/controller/uhci.c stable/9/sys/dev/usb/controller/usb_controller.c stable/9/sys/dev/usb/controller/uss820dci.c stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/input/atp.c stable/9/sys/dev/usb/input/uep.c stable/9/sys/dev/usb/input/uhid.c stable/9/sys/dev/usb/input/ukbd.c stable/9/sys/dev/usb/input/ums.c stable/9/sys/dev/usb/misc/udbp.c stable/9/sys/dev/usb/net/if_aue.c stable/9/sys/dev/usb/net/if_axe.c stable/9/sys/dev/usb/net/if_cdce.c stable/9/sys/dev/usb/net/if_cue.c stable/9/sys/dev/usb/net/if_ipheth.c stable/9/sys/dev/usb/net/if_kue.c stable/9/sys/dev/usb/net/if_mos.c stable/9/sys/dev/usb/net/if_rue.c stable/9/sys/dev/usb/net/if_udav.c stable/9/sys/dev/usb/net/if_usie.c stable/9/sys/dev/usb/net/uhso.c stable/9/sys/dev/usb/net/usb_ethernet.c stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/serial/ubsa.c stable/9/sys/dev/usb/serial/ubser.c stable/9/sys/dev/usb/serial/uchcom.c stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/serial/ulpt.c stable/9/sys/dev/usb/serial/umcs.c stable/9/sys/dev/usb/serial/umodem.c stable/9/sys/dev/usb/serial/umoscom.c stable/9/sys/dev/usb/serial/uplcom.c stable/9/sys/dev/usb/serial/usb_serial.c stable/9/sys/dev/usb/serial/uslcom.c stable/9/sys/dev/usb/serial/uvisor.c stable/9/sys/dev/usb/serial/uvscom.c stable/9/sys/dev/usb/storage/umass.c stable/9/sys/dev/usb/storage/urio.c stable/9/sys/dev/usb/usb_dev.c stable/9/sys/dev/usb/usb_generic.c stable/9/sys/dev/usb/usb_hub.c stable/9/sys/dev/usb/usb_process.c stable/9/sys/dev/usb/wlan/if_rum.c stable/9/sys/dev/usb/wlan/if_run.c stable/9/sys/dev/usb/wlan/if_uath.c stable/9/sys/dev/usb/wlan/if_upgt.c stable/9/sys/dev/usb/wlan/if_ural.c stable/9/sys/dev/usb/wlan/if_urtw.c stable/9/sys/dev/usb/wlan/if_zyd.c stable/9/sys/dev/wi/if_wi.c stable/9/sys/dev/xe/if_xe.c stable/9/sys/dev/xen/balloon/balloon.c stable/9/sys/fs/ext2fs/ext2_alloc.c stable/9/sys/fs/pseudofs/pseudofs_vncache.c stable/9/sys/geom/cache/g_cache.c stable/9/sys/geom/concat/g_concat.c stable/9/sys/geom/geom_disk.c stable/9/sys/geom/journal/g_journal.c stable/9/sys/geom/mirror/g_mirror.c stable/9/sys/geom/mountver/g_mountver.c stable/9/sys/geom/multipath/g_multipath.c stable/9/sys/geom/nop/g_nop.c stable/9/sys/geom/raid3/g_raid3.c stable/9/sys/geom/sched/gs_rr.c stable/9/sys/geom/shsec/g_shsec.c stable/9/sys/geom/stripe/g_stripe.c stable/9/sys/geom/vinum/geom_vinum.c stable/9/sys/geom/virstor/g_virstor.c stable/9/sys/geom/zero/g_zero.c stable/9/sys/gnu/fs/xfs/FreeBSD/support/debug.c stable/9/sys/i386/i386/mp_machdep.c stable/9/sys/i386/i386/pmap.c stable/9/sys/ia64/ia64/busdma_machdep.c stable/9/sys/ia64/ia64/machdep.c stable/9/sys/ia64/ia64/mca.c stable/9/sys/ia64/ia64/pmap.c stable/9/sys/kern/kern_clock.c stable/9/sys/kern/kern_cpu.c stable/9/sys/kern/kern_et.c stable/9/sys/kern/kern_jail.c stable/9/sys/kern/kern_ktr.c stable/9/sys/kern/kern_malloc.c stable/9/sys/kern/kern_poll.c stable/9/sys/kern/kern_shutdown.c stable/9/sys/kern/kern_sig.c stable/9/sys/kern/kern_tc.c stable/9/sys/kern/kern_thr.c stable/9/sys/kern/kern_umtx.c stable/9/sys/kern/sched_4bsd.c stable/9/sys/kern/subr_devstat.c stable/9/sys/kern/subr_kdb.c stable/9/sys/kern/subr_lock.c stable/9/sys/kern/subr_prof.c stable/9/sys/kern/subr_rman.c stable/9/sys/kern/subr_sleepqueue.c stable/9/sys/kern/subr_smp.c stable/9/sys/kern/subr_turnstile.c stable/9/sys/kern/subr_witness.c stable/9/sys/kern/uipc_mqueue.c stable/9/sys/kern/uipc_usrreq.c stable/9/sys/kern/vfs_cache.c stable/9/sys/mips/cavium/usb/octusb.c stable/9/sys/mips/mips/busdma_machdep.c stable/9/sys/net/bpf.c stable/9/sys/net/flowtable.c stable/9/sys/net/if_bridge.c stable/9/sys/net/if_enc.c stable/9/sys/net/if_epair.c stable/9/sys/net/if_gif.c stable/9/sys/net/if_gre.c stable/9/sys/net/if_lagg.c stable/9/sys/net/if_mib.c stable/9/sys/net/if_stf.c stable/9/sys/net/if_tap.c stable/9/sys/net/if_tun.c stable/9/sys/net/if_vlan.c stable/9/sys/net/netisr.c stable/9/sys/net/raw_cb.c stable/9/sys/net/rtsock.c stable/9/sys/net80211/ieee80211_hwmp.c stable/9/sys/net80211/ieee80211_mesh.c stable/9/sys/netgraph/atm/ng_atm.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c stable/9/sys/netgraph/ng_socket.c stable/9/sys/netinet/accf_http.c stable/9/sys/netinet/if_ether.c stable/9/sys/netinet/igmp.c stable/9/sys/netinet/in_mcast.c stable/9/sys/netinet/in_pcb.c stable/9/sys/netinet/ip_divert.c stable/9/sys/netinet/ip_mroute.c stable/9/sys/netinet/libalias/alias_sctp.c stable/9/sys/netinet/tcp_hostcache.c stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_reass.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet6/in6_mcast.c stable/9/sys/netinet6/in6_src.c stable/9/sys/netinet6/ip6_mroute.c stable/9/sys/netinet6/mld6.c stable/9/sys/netipx/ipx_proto.c stable/9/sys/netpfil/ipfw/ip_dn_io.c stable/9/sys/nlm/nlm_prot_impl.c stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c stable/9/sys/powerpc/fpu/fpu_emu.c stable/9/sys/powerpc/ofw/ofw_syscons.c stable/9/sys/powerpc/powerpc/busdma_machdep.c stable/9/sys/powerpc/ps3/ps3disk.c stable/9/sys/security/audit/audit.c stable/9/sys/security/mac_biba/mac_biba.c stable/9/sys/security/mac_bsdextended/mac_bsdextended.c stable/9/sys/security/mac_ifoff/mac_ifoff.c stable/9/sys/security/mac_lomac/mac_lomac.c stable/9/sys/security/mac_mls/mac_mls.c stable/9/sys/security/mac_partition/mac_partition.c stable/9/sys/security/mac_portacl/mac_portacl.c stable/9/sys/security/mac_seeotheruids/mac_seeotheruids.c stable/9/sys/security/mac_stub/mac_stub.c stable/9/sys/security/mac_test/mac_test.c stable/9/sys/sparc64/sparc64/identcpu.c stable/9/sys/sparc64/sparc64/tick.c stable/9/sys/ufs/ffs/ffs_softdep.c stable/9/sys/vm/memguard.c stable/9/sys/vm/redzone.c stable/9/sys/vm/vm_object.c stable/9/sys/x86/bios/vpd.c stable/9/sys/x86/x86/busdma_machdep.c stable/9/sys/x86/x86/io_apic.c stable/9/sys/x86/x86/mca.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/mp_machdep.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/amd64/amd64/mp_machdep.c Sat Mar 9 02:36:32 2013 (r248085) @@ -1046,7 +1046,7 @@ start_ap(int apic_id) u_int xhits_gbl[MAXCPU]; u_int xhits_pg[MAXCPU]; u_int xhits_rng[MAXCPU]; -SYSCTL_NODE(_debug, OID_AUTO, xhits, CTLFLAG_RW, 0, ""); +static SYSCTL_NODE(_debug, OID_AUTO, xhits, CTLFLAG_RW, 0, ""); SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, global, CTLFLAG_RW, &xhits_gbl, sizeof(xhits_gbl), "IU", ""); SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, page, CTLFLAG_RW, &xhits_pg, Modified: stable/9/sys/amd64/amd64/pmap.c ============================================================================== --- stable/9/sys/amd64/amd64/pmap.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/amd64/amd64/pmap.c Sat Mar 9 02:36:32 2013 (r248085) @@ -214,7 +214,7 @@ static vm_paddr_t dmaplimit; vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; pt_entry_t pg_nx; -SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pat_works = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works, CTLFLAG_RD, &pat_works, 1, @@ -839,7 +839,7 @@ pmap_init(void) TAILQ_INIT(&pv_table[i].pv_list); } -SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, "2MB page mapping counters"); static u_long pmap_pde_demotions; @@ -858,7 +858,7 @@ static u_long pmap_pde_promotions; SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, promotions, CTLFLAG_RD, &pmap_pde_promotions, 0, "2MB page promotions"); -SYSCTL_NODE(_vm_pmap, OID_AUTO, pdpe, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, pdpe, CTLFLAG_RD, 0, "1GB page mapping counters"); static u_long pmap_pdpe_demotions; Modified: stable/9/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_sysvec.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/amd64/linux32/linux32_sysvec.c Sat Mar 9 02:36:32 2013 (r248085) @@ -977,7 +977,7 @@ linux_copyout_strings(struct image_param return ((register_t *)stack_base); } -SYSCTL_NODE(_compat, OID_AUTO, linux32, CTLFLAG_RW, 0, +static SYSCTL_NODE(_compat, OID_AUTO, linux32, CTLFLAG_RW, 0, "32-bit Linux emulation"); static u_long linux32_maxdsiz = LINUX32_MAXDSIZ; Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/arm/arm/busdma_machdep.c Sat Mar 9 02:36:32 2013 (r248085) @@ -126,7 +126,7 @@ static int total_bpages; static int busdma_zonecount; static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); Modified: stable/9/sys/arm/xscale/i80321/iq31244_7seg.c ============================================================================== --- stable/9/sys/arm/xscale/i80321/iq31244_7seg.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/arm/xscale/i80321/iq31244_7seg.c Sat Mar 9 02:36:32 2013 (r248085) @@ -334,7 +334,7 @@ static const uint8_t snakemap[][2] = { { ~SEG_B, ~SEG_F }, }; -SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); +static SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); static int freq = 20; SYSCTL_INT(_hw_sevenseg, OID_AUTO, freq, CTLFLAG_RW, &freq, 0, "7 Seg update frequency"); Modified: stable/9/sys/arm/xscale/i8134x/iq81342_7seg.c ============================================================================== --- stable/9/sys/arm/xscale/i8134x/iq81342_7seg.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/arm/xscale/i8134x/iq81342_7seg.c Sat Mar 9 02:36:32 2013 (r248085) @@ -335,7 +335,7 @@ static const uint8_t snakemap[][2] = { { SEG_B, SEG_F }, }; -SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); +static SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); static int freq = 20; SYSCTL_INT(_hw_sevenseg, OID_AUTO, freq, CTLFLAG_RW, &freq, 0, "7 Seg update frequency"); Modified: stable/9/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- stable/9/sys/arm/xscale/ixp425/if_npe.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/arm/xscale/ixp425/if_npe.c Sat Mar 9 02:36:32 2013 (r248085) @@ -250,7 +250,8 @@ static int npe_setloopback(struct npe_so /* NB: all tx done processing goes through one queue */ static int tx_doneqid = -1; -SYSCTL_NODE(_hw, OID_AUTO, npe, CTLFLAG_RD, 0, "IXP4XX NPE driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, npe, CTLFLAG_RD, 0, + "IXP4XX NPE driver parameters"); static int npe_debug = 0; SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RW, &npe_debug, Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/cam/ata/ata_da.c Sat Mar 9 02:36:32 2013 (r248085) @@ -467,7 +467,7 @@ static int ada_spindown_suspend = ADA_DE static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD; static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; -SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, +static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RW, &ada_legacy_aliases, 0, "Create legacy-like device aliases"); Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/cam/ata/ata_pmp.c Sat Mar 9 02:36:32 2013 (r248085) @@ -134,7 +134,7 @@ static int pmp_retry_count = PMP_DEFAULT static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; -SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, +static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RW, &pmp_retry_count, 0, "Normal I/O retry count"); Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/cam/scsi/scsi_cd.c Sat Mar 9 02:36:32 2013 (r248085) @@ -304,8 +304,9 @@ static int cd_retry_count = CD_DEFAULT_R static int changer_min_busy_seconds = CHANGER_MIN_BUSY_SECONDS; static int changer_max_busy_seconds = CHANGER_MAX_BUSY_SECONDS; -SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); -SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, "CD Changer"); +static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); +static SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, + "CD Changer"); SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW, &cd_retry_count, 0, "Normal I/O retry count"); TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/cam/scsi/scsi_da.c Sat Mar 9 02:36:32 2013 (r248085) @@ -892,7 +892,7 @@ static int da_retry_count = DA_DEFAULT_R static int da_default_timeout = DA_DEFAULT_TIMEOUT; static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; -SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, +static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW, &da_retry_count, 0, "Normal I/O retry count"); Modified: stable/9/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/9/sys/compat/ia32/ia32_sysvec.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/compat/ia32/ia32_sysvec.c Sat Mar 9 02:36:32 2013 (r248085) @@ -95,7 +95,7 @@ CTASSERT(sizeof(struct ia32_sigframe4) = extern const char *freebsd32_syscallnames[]; -SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode"); +static SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode"); static u_long ia32_maxdsiz = IA32_MAXDSIZ; SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxdsiz, CTLFLAG_RW, &ia32_maxdsiz, 0, ""); Modified: stable/9/sys/compat/linux/linux_mib.c ============================================================================== --- stable/9/sys/compat/linux/linux_mib.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/compat/linux/linux_mib.c Sat Mar 9 02:36:32 2013 (r248085) @@ -136,7 +136,7 @@ static struct linux_prison lprison0 = { static unsigned linux_osd_jail_slot; -SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, +static SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode"); static int linux_set_osname(struct thread *td, char *osname); Modified: stable/9/sys/compat/x86bios/x86bios.c ============================================================================== --- stable/9/sys/compat/x86bios/x86bios.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/compat/x86bios/x86bios.c Sat Mar 9 02:36:32 2013 (r248085) @@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$"); static struct mtx x86bios_lock; -SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging"); +static SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, + "x86bios debugging"); static int x86bios_trace_call; TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call); SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RW, &x86bios_trace_call, 0, Modified: stable/9/sys/dev/aac/aac.c ============================================================================== --- stable/9/sys/dev/aac/aac.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/aac/aac.c Sat Mar 9 02:36:32 2013 (r248085) @@ -222,7 +222,7 @@ static struct cdevsw aac_cdevsw = { MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); /* sysctl node */ -SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); /* * Device Interface Modified: stable/9/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_ec.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/acpica/acpi_ec.c Sat Mar 9 02:36:32 2013 (r248085) @@ -178,7 +178,7 @@ struct acpi_ec_softc { ACPI_SERIAL_DECL(ec, "ACPI embedded controller"); -SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); +static SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); static int ec_burst_mode; TUNABLE_INT("debug.acpi.ec.burst", &ec_burst_mode); Modified: stable/9/sys/dev/acpica/acpi_smbat.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_smbat.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/acpica/acpi_smbat.c Sat Mar 9 02:36:32 2013 (r248085) @@ -62,7 +62,8 @@ static int acpi_smbat_get_bst(device_t d ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); -SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); +static SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, + "Battery debugging"); /* On some laptops with smart batteries, enabling battery monitoring * software causes keystrokes from atkbd to be lost. This has also been Modified: stable/9/sys/dev/an/if_an.c ============================================================================== --- stable/9/sys/dev/an/if_an.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/an/if_an.c Sat Mar 9 02:36:32 2013 (r248085) @@ -203,7 +203,8 @@ static char an_conf_cache[256]; /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, an, CTLFLAG_RD, 0, "Wireless driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, an, CTLFLAG_RD, 0, + "Wireless driver parameters"); /* XXX violate ethernet/netgraph callback hooks */ extern void (*ng_ether_attach_p)(struct ifnet *ifp); Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/ata/ata-all.c Sat Mar 9 02:36:32 2013 (r248085) @@ -111,7 +111,7 @@ static int atapi_dma = 1; #endif /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); #ifndef ATA_CAM TUNABLE_INT("hw.ata.ata_dma", &ata_dma); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, CTLFLAG_RDTUN, &ata_dma, 0, Modified: stable/9/sys/dev/ath/ah_osdep.c ============================================================================== --- stable/9/sys/dev/ath/ah_osdep.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/ath/ah_osdep.c Sat Mar 9 02:36:32 2013 (r248085) @@ -76,7 +76,8 @@ extern void DO_HALDEBUG(struct ath_hal * /* NB: put this here instead of the driver to avoid circular references */ SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_RD, 0, "Atheros driver parameters"); -SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); +static SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, + "Atheros HAL parameters"); #ifdef AH_DEBUG int ath_hal_debug = 0; Modified: stable/9/sys/dev/atkbdc/psm.c ============================================================================== --- stable/9/sys/dev/atkbdc/psm.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/atkbdc/psm.c Sat Mar 9 02:36:32 2013 (r248085) @@ -2265,8 +2265,8 @@ psmtimeout(void *arg) } /* Add all sysctls under the debug.psm and hw.psm nodes */ -SYSCTL_NODE(_debug, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); -SYSCTL_NODE(_hw, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); +static SYSCTL_NODE(_debug, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); +static SYSCTL_NODE(_hw, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); SYSCTL_INT(_debug_psm, OID_AUTO, loglevel, CTLFLAG_RW, &verbose, 0, "Verbosity level"); Modified: stable/9/sys/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/bce/if_bce.c Sat Mar 9 02:36:32 2013 (r248085) @@ -488,7 +488,7 @@ DRIVER_MODULE(miibus, bce, miibus_driver /****************************************************************************/ /* Tunable device values */ /****************************************************************************/ -SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD, 0, "bce driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD, 0, "bce driver parameters"); /* Allowable values are TRUE or FALSE */ static int bce_verbose = TRUE; Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/bge/if_bge.c Sat Mar 9 02:36:32 2013 (r248085) @@ -532,7 +532,7 @@ static int bge_allow_asf = 1; TUNABLE_INT("hw.bge.allow_asf", &bge_allow_asf); -SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RD, &bge_allow_asf, 0, "Allow ASF mode if available"); Modified: stable/9/sys/dev/bktr/bktr_os.c ============================================================================== --- stable/9/sys/dev/bktr/bktr_os.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/bktr/bktr_os.c Sat Mar 9 02:36:32 2013 (r248085) @@ -108,7 +108,7 @@ int bt848_amsound = 0; /* hard-wire AM int bt848_dolby = 0; #endif -SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt"); +static SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt"); SYSCTL_INT(_hw_bt848, OID_AUTO, card, CTLFLAG_RW, &bt848_card, -1, ""); SYSCTL_INT(_hw_bt848, OID_AUTO, tuner, CTLFLAG_RW, &bt848_tuner, -1, ""); SYSCTL_INT(_hw_bt848, OID_AUTO, reverse_mute, CTLFLAG_RW, &bt848_reverse_mute, -1, ""); Modified: stable/9/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/9/sys/dev/bwn/if_bwn.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/bwn/if_bwn.c Sat Mar 9 02:36:32 2013 (r248085) @@ -73,7 +73,8 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, + "Broadcom driver parameters"); /* * Tunable & sysctl variables. Modified: stable/9/sys/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/bxe/if_bxe.c Sat Mar 9 02:36:32 2013 (r248085) @@ -419,7 +419,7 @@ DRIVER_MODULE(bxe, pci, bxe_driver, bxe_ /* * Tunable device values */ -SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters"); /* Allowable values are TRUE (1) or FALSE (0). */ static int bxe_dcc_enable = FALSE; Modified: stable/9/sys/dev/cardbus/cardbus.c ============================================================================== --- stable/9/sys/dev/cardbus/cardbus.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/cardbus/cardbus.c Sat Mar 9 02:36:32 2013 (r248085) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, cardbus, CTLFLAG_RD, 0, "CardBus parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cardbus, CTLFLAG_RD, 0, "CardBus parameters"); int cardbus_debug = 0; TUNABLE_INT("hw.cardbus.debug", &cardbus_debug); Modified: stable/9/sys/dev/cs/if_cs.c ============================================================================== --- stable/9/sys/dev/cs/if_cs.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/cs/if_cs.c Sat Mar 9 02:36:32 2013 (r248085) @@ -103,7 +103,7 @@ devclass_t cs_devclass; driver_intr_t csintr; /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, cs, CTLFLAG_RD, 0, "cs device parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cs, CTLFLAG_RD, 0, "cs device parameters"); int cs_ignore_cksum_failure = 0; TUNABLE_INT("hw.cs.ignore_checksum_failure", &cs_ignore_cksum_failure); Modified: stable/9/sys/dev/dcons/dcons_os.c ============================================================================== --- stable/9/sys/dev/dcons/dcons_os.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/dcons/dcons_os.c Sat Mar 9 02:36:32 2013 (r248085) @@ -93,7 +93,7 @@ static int poll_hz = DCONS_POLL_HZ; static struct dcons_softc sc[DCONS_NPORT]; -SYSCTL_NODE(_kern, OID_AUTO, dcons, CTLFLAG_RD, 0, "Dumb Console"); +static SYSCTL_NODE(_kern, OID_AUTO, dcons, CTLFLAG_RD, 0, "Dumb Console"); SYSCTL_INT(_kern_dcons, OID_AUTO, poll_hz, CTLFLAG_RW, &poll_hz, 0, "dcons polling rate"); Modified: stable/9/sys/dev/fb/vesa.c ============================================================================== --- stable/9/sys/dev/fb/vesa.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/fb/vesa.c Sat Mar 9 02:36:32 2013 (r248085) @@ -98,7 +98,7 @@ static size_t vesa_bios_size; /* VESA video adapter */ static video_adapter_t *vesa_adp; -SYSCTL_NODE(_debug, OID_AUTO, vesa, CTLFLAG_RD, NULL, "VESA debugging"); +static SYSCTL_NODE(_debug, OID_AUTO, vesa, CTLFLAG_RD, NULL, "VESA debugging"); static int vesa_shadow_rom; TUNABLE_INT("debug.vesa.shadow_rom", &vesa_shadow_rom); SYSCTL_INT(_debug_vesa, OID_AUTO, shadow_rom, CTLFLAG_RDTUN, &vesa_shadow_rom, Modified: stable/9/sys/dev/fdc/fdc.c ============================================================================== --- stable/9/sys/dev/fdc/fdc.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/fdc/fdc.c Sat Mar 9 02:36:32 2013 (r248085) @@ -267,7 +267,7 @@ static driver_filter_t fdc_intr_fast; static void fdc_reset(struct fdc_data *); static int fd_probe_disk(struct fd_data *, int *); -SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, "fdc driver"); +static SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, "fdc driver"); static int fifo_threshold = 8; SYSCTL_INT(_debug_fdc, OID_AUTO, fifo, CTLFLAG_RW, &fifo_threshold, 0, Modified: stable/9/sys/dev/firewire/fwmem.c ============================================================================== --- stable/9/sys/dev/firewire/fwmem.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/firewire/fwmem.c Sat Mar 9 02:36:32 2013 (r248085) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); static int fwmem_speed=2, fwmem_debug=0; static struct fw_eui64 fwmem_eui64; SYSCTL_DECL(_hw_firewire); -SYSCTL_NODE(_hw_firewire, OID_AUTO, fwmem, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwmem, CTLFLAG_RD, 0, "FireWire Memory Access"); SYSCTL_UINT(_hw_firewire_fwmem, OID_AUTO, eui64_hi, CTLFLAG_RW, &fwmem_eui64.hi, 0, "Fwmem target EUI64 high"); Modified: stable/9/sys/dev/firewire/if_fwe.c ============================================================================== --- stable/9/sys/dev/firewire/if_fwe.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/firewire/if_fwe.c Sat Mar 9 02:36:32 2013 (r248085) @@ -89,7 +89,7 @@ static int rx_queue_len = FWMAXQUEUE; MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, ""); SYSCTL_DECL(_hw_firewire); -SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, "Ethernet emulation subsystem"); SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, stream_ch, CTLFLAG_RW, &stream_ch, 0, "Stream channel to use"); Modified: stable/9/sys/dev/firewire/if_fwip.c ============================================================================== --- stable/9/sys/dev/firewire/if_fwip.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/firewire/if_fwip.c Sat Mar 9 02:36:32 2013 (r248085) @@ -102,7 +102,7 @@ static int rx_queue_len = FWMAXQUEUE; MALLOC_DEFINE(M_FWIP, "if_fwip", "IP over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwip_debug, CTLFLAG_RW, &fwipdebug, 0, ""); SYSCTL_DECL(_hw_firewire); -SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD, 0, "Firewire ip subsystem"); SYSCTL_INT(_hw_firewire_fwip, OID_AUTO, rx_queue_len, CTLFLAG_RW, &rx_queue_len, 0, "Length of the receive queue"); Modified: stable/9/sys/dev/firewire/sbp.c ============================================================================== --- stable/9/sys/dev/firewire/sbp.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/firewire/sbp.c Sat Mar 9 02:36:32 2013 (r248085) @@ -132,7 +132,8 @@ static int use_doorbell = 0; static int sbp_tags = 0; SYSCTL_DECL(_hw_firewire); -SYSCTL_NODE(_hw_firewire, OID_AUTO, sbp, CTLFLAG_RD, 0, "SBP-II Subsystem"); +static SYSCTL_NODE(_hw_firewire, OID_AUTO, sbp, CTLFLAG_RD, 0, + "SBP-II Subsystem"); SYSCTL_INT(_debug, OID_AUTO, sbp_debug, CTLFLAG_RW, &debug, 0, "SBP debug flag"); SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, auto_login, CTLFLAG_RW, &auto_login, 0, Modified: stable/9/sys/dev/hifn/hifn7751.c ============================================================================== --- stable/9/sys/dev/hifn/hifn7751.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/hifn/hifn7751.c Sat Mar 9 02:36:32 2013 (r248085) @@ -180,7 +180,8 @@ READ_REG_1(struct hifn_softc *sc, bus_si } #define WRITE_REG_1(sc, reg, val) hifn_write_reg_1(sc, reg, val) -SYSCTL_NODE(_hw, OID_AUTO, hifn, CTLFLAG_RD, 0, "Hifn driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, hifn, CTLFLAG_RD, 0, + "Hifn driver parameters"); #ifdef HIFN_DEBUG static int hifn_debug = 0; Modified: stable/9/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/ipmi/ipmi.c Sat Mar 9 02:36:32 2013 (r248085) @@ -63,7 +63,8 @@ static void ipmi_dtor(void *arg); int ipmi_attached = 0; static int on = 1; -SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD, 0, "IPMI driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD, 0, + "IPMI driver parameters"); SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RW, &on, 0, ""); Modified: stable/9/sys/dev/kbd/kbd.c ============================================================================== --- stable/9/sys/dev/kbd/kbd.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/kbd/kbd.c Sat Mar 9 02:36:32 2013 (r248085) @@ -81,7 +81,7 @@ static keyboard_switch_t *kbdsw_ini; keyboard_switch_t **kbdsw = &kbdsw_ini; static int keymap_restrict_change; -SYSCTL_NODE(_hw, OID_AUTO, kbd, CTLFLAG_RD, 0, "kbd"); +static SYSCTL_NODE(_hw, OID_AUTO, kbd, CTLFLAG_RD, 0, "kbd"); SYSCTL_INT(_hw_kbd, OID_AUTO, keymap_restrict_change, CTLFLAG_RW, &keymap_restrict_change, 0, "restrict ability to change keymap"); Modified: stable/9/sys/dev/malo/if_malo_pci.c ============================================================================== --- stable/9/sys/dev/malo/if_malo_pci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/malo/if_malo_pci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -79,7 +79,7 @@ struct malo_pci_softc { * Tunable variables. */ SYSCTL_DECL(_hw_malo); -SYSCTL_NODE(_hw_malo, OID_AUTO, pci, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_malo, OID_AUTO, pci, CTLFLAG_RD, 0, "Marvell 88W8335 driver PCI parameters"); static int msi_disable = 0; /* MSI disabled */ Modified: stable/9/sys/dev/mmc/mmc.c ============================================================================== --- stable/9/sys/dev/mmc/mmc.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/mmc/mmc.c Sat Mar 9 02:36:32 2013 (r248085) @@ -106,7 +106,7 @@ struct mmc_ivars { #define CMD_RETRIES 3 -SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); +static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); static int mmc_debug; SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RW, &mmc_debug, 0, "Debug level"); Modified: stable/9/sys/dev/mwl/mwlhal.c ============================================================================== --- stable/9/sys/dev/mwl/mwlhal.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/mwl/mwlhal.c Sat Mar 9 02:36:32 2013 (r248085) @@ -190,7 +190,8 @@ static void dumpresult(struct mwl_hal_pr #endif /* MWLHAL_DEBUG */ SYSCTL_DECL(_hw_mwl); -SYSCTL_NODE(_hw_mwl, OID_AUTO, hal, CTLFLAG_RD, 0, "Marvell HAL parameters"); +static SYSCTL_NODE(_hw_mwl, OID_AUTO, hal, CTLFLAG_RD, 0, + "Marvell HAL parameters"); static __inline void MWL_HAL_LOCK(struct mwl_hal_priv *mh) Modified: stable/9/sys/dev/pccard/pccard.c ============================================================================== --- stable/9/sys/dev/pccard/pccard.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/pccard/pccard.c Sat Mar 9 02:36:32 2013 (r248085) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define PCCARDDEBUG /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD, 0, "PCCARD parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD, 0, "PCCARD parameters"); int pccard_debug = 0; TUNABLE_INT("hw.pccard.debug", &pccard_debug); Modified: stable/9/sys/dev/pccbb/pccbb.c ============================================================================== --- stable/9/sys/dev/pccbb/pccbb.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/pccbb/pccbb.c Sat Mar 9 02:36:32 2013 (r248085) @@ -129,7 +129,7 @@ __FBSDID("$FreeBSD$"); devclass_t cbb_devclass; /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD, 0, "CBB parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD, 0, "CBB parameters"); /* There's no way to say TUNEABLE_LONG to get the right types */ u_long cbb_start_mem = CBB_START_MEM; Modified: stable/9/sys/dev/pccbb/pccbb_isa.c ============================================================================== --- stable/9/sys/dev/pccbb/pccbb_isa.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/pccbb/pccbb_isa.c Sat Mar 9 02:36:32 2013 (r248085) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); *****************************************************************************/ /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, "PCIC parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, "PCIC parameters"); static int isa_intr_mask = EXCA_INT_MASK_ALLOWED; TUNABLE_INT("hw.cbb.intr_mask", &isa_intr_mask); Modified: stable/9/sys/dev/rndtest/rndtest.c ============================================================================== --- stable/9/sys/dev/rndtest/rndtest.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/rndtest/rndtest.c Sat Mar 9 02:36:32 2013 (r248085) @@ -70,8 +70,8 @@ static const struct rndtest_testfunc { #define RNDTEST_NTESTS (sizeof(rndtest_funcs)/sizeof(rndtest_funcs[0])) -SYSCTL_NODE(_kern, OID_AUTO, rndtest, CTLFLAG_RD, 0, "RNG test parameters"); - +static SYSCTL_NODE(_kern, OID_AUTO, rndtest, CTLFLAG_RD, 0, + "RNG test parameters"); static int rndtest_retest = 120; /* interval in seconds */ SYSCTL_INT(_kern_rndtest, OID_AUTO, retest, CTLFLAG_RW, &rndtest_retest, 0, "retest interval (seconds)"); Modified: stable/9/sys/dev/rt/if_rt.c ============================================================================== --- stable/9/sys/dev/rt/if_rt.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/rt/if_rt.c Sat Mar 9 02:36:32 2013 (r248085) @@ -136,7 +136,7 @@ static int rt_miibus_writereg(device_t, static int rt_ifmedia_upd(struct ifnet *); static void rt_ifmedia_sts(struct ifnet *, struct ifmediareq *); -SYSCTL_NODE(_hw, OID_AUTO, rt, CTLFLAG_RD, 0, "RT driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, rt, CTLFLAG_RD, 0, "RT driver parameters"); #ifdef IF_RT_DEBUG static int rt_debug = 0; SYSCTL_INT(_hw_rt, OID_AUTO, debug, CTLFLAG_RW, &rt_debug, 0, Modified: stable/9/sys/dev/safe/safe.c ============================================================================== --- stable/9/sys/dev/safe/safe.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/safe/safe.c Sat Mar 9 02:36:32 2013 (r248085) @@ -143,7 +143,8 @@ static void safe_totalreset(struct safe_ static int safe_free_entry(struct safe_softc *, struct safe_ringentry *); -SYSCTL_NODE(_hw, OID_AUTO, safe, CTLFLAG_RD, 0, "SafeNet driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, safe, CTLFLAG_RD, 0, + "SafeNet driver parameters"); #ifdef SAFE_DEBUG static void safe_dump_dmastatus(struct safe_softc *, const char *); Modified: stable/9/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/9/sys/dev/sdhci/sdhci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/sdhci/sdhci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -158,7 +158,7 @@ struct sdhci_softc { struct sdhci_slot slots[6]; }; -SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); +static SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); int sdhci_debug; TUNABLE_INT("hw.sdhci.debug", &sdhci_debug); Modified: stable/9/sys/dev/sound/midi/midi.c ============================================================================== --- stable/9/sys/dev/sound/midi/midi.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/sound/midi/midi.c Sat Mar 9 02:36:32 2013 (r248085) @@ -239,7 +239,7 @@ static int midi_unload(void); * Misc declr. */ SYSCTL_NODE(_hw, OID_AUTO, midi, CTLFLAG_RD, 0, "Midi driver"); -SYSCTL_NODE(_hw_midi, OID_AUTO, stat, CTLFLAG_RD, 0, "Status device"); +static SYSCTL_NODE(_hw_midi, OID_AUTO, stat, CTLFLAG_RD, 0, "Status device"); int midi_debug; /* XXX: should this be moved into debug.midi? */ Modified: stable/9/sys/dev/sound/pci/maestro.c ============================================================================== --- stable/9/sys/dev/sound/pci/maestro.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/sound/pci/maestro.c Sat Mar 9 02:36:32 2013 (r248085) @@ -191,7 +191,7 @@ static unsigned int powerstate_init = /* XXX: this should move to a device specific sysctl dev.pcm.X.debug.Y via device_get_sysctl_*() as discussed on multimedia@ in msg-id <861wujij2q.fsf@xps.des.no> */ -SYSCTL_NODE(_debug, OID_AUTO, maestro, CTLFLAG_RD, 0, ""); +static SYSCTL_NODE(_debug, OID_AUTO, maestro, CTLFLAG_RD, 0, ""); SYSCTL_UINT(_debug_maestro, OID_AUTO, powerstate_active, CTLFLAG_RW, &powerstate_active, 0, "The Dx power state when active (0-1)"); SYSCTL_UINT(_debug_maestro, OID_AUTO, powerstate_idle, CTLFLAG_RW, Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/sound/usb/uaudio.c Sat Mar 9 02:36:32 2013 (r248085) @@ -98,7 +98,7 @@ static int uaudio_default_channels = 0; #ifdef USB_DEBUG static int uaudio_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RW, &uaudio_debug, 0, "uaudio debug level"); Modified: stable/9/sys/dev/syscons/syscons.c ============================================================================== --- stable/9/sys/dev/syscons/syscons.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/syscons/syscons.c Sat Mar 9 02:36:32 2013 (r248085) @@ -136,8 +136,8 @@ static int sc_no_suspend_vtswitch = 0; #endif static int sc_susp_scr; -SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD, 0, "syscons"); -SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, CTLFLAG_RD, 0, "saver"); +static SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD, 0, "syscons"); +static SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, CTLFLAG_RD, 0, "saver"); SYSCTL_INT(_hw_syscons_saver, OID_AUTO, keybonly, CTLFLAG_RW, &sc_saver_keyb_only, 0, "screen saver interrupted by input only"); SYSCTL_INT(_hw_syscons, OID_AUTO, bell, CTLFLAG_RW, &enable_bell, Modified: stable/9/sys/dev/ubsec/ubsec.c ============================================================================== --- stable/9/sys/dev/ubsec/ubsec.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/ubsec/ubsec.c Sat Mar 9 02:36:32 2013 (r248085) @@ -173,7 +173,8 @@ static int ubsec_ksigbits(struct crparam static void ubsec_kshift_r(u_int, u_int8_t *, u_int, u_int8_t *, u_int); static void ubsec_kshift_l(u_int, u_int8_t *, u_int, u_int8_t *, u_int); -SYSCTL_NODE(_hw, OID_AUTO, ubsec, CTLFLAG_RD, 0, "Broadcom driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, ubsec, CTLFLAG_RD, 0, + "Broadcom driver parameters"); #ifdef UBSEC_DEBUG static void ubsec_dump_pb(volatile struct ubsec_pktbuf *); Modified: stable/9/sys/dev/usb/controller/at91dci.c ============================================================================== --- stable/9/sys/dev/usb/controller/at91dci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/at91dci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -91,7 +91,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int at91dcidebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, at91dci, CTLFLAG_RW, 0, "USB at91dci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, at91dci, CTLFLAG_RW, 0, "USB at91dci"); SYSCTL_INT(_hw_usb_at91dci, OID_AUTO, debug, CTLFLAG_RW, &at91dcidebug, 0, "at91dci debug level"); #endif Modified: stable/9/sys/dev/usb/controller/atmegadci.c ============================================================================== --- stable/9/sys/dev/usb/controller/atmegadci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/atmegadci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -83,7 +83,8 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int atmegadci_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, atmegadci, CTLFLAG_RW, 0, "USB ATMEGA DCI"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, atmegadci, CTLFLAG_RW, 0, + "USB ATMEGA DCI"); SYSCTL_INT(_hw_usb_atmegadci, OID_AUTO, debug, CTLFLAG_RW, &atmegadci_debug, 0, "ATMEGA DCI debug level"); #endif Modified: stable/9/sys/dev/usb/controller/avr32dci.c ============================================================================== --- stable/9/sys/dev/usb/controller/avr32dci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/avr32dci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int avr32dci_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, avr32dci, CTLFLAG_RW, 0, "USB AVR32 DCI"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, avr32dci, CTLFLAG_RW, 0, "USB AVR32 DCI"); SYSCTL_INT(_hw_usb_avr32dci, OID_AUTO, debug, CTLFLAG_RW, &avr32dci_debug, 0, "AVR32 DCI debug level"); #endif Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/ehci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -94,7 +94,7 @@ static int ehcinohighspeed = 0; static int ehciiaadbug = 0; static int ehcilostintrbug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ehcidebug, 0, "Debug level"); TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug); Modified: stable/9/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/9/sys/dev/usb/controller/musb_otg.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/musb_otg.c Sat Mar 9 02:36:32 2013 (r248085) @@ -85,7 +85,7 @@ #ifdef USB_DEBUG static int musbotgdebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, musbotg, CTLFLAG_RW, 0, "USB musbotg"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, musbotg, CTLFLAG_RW, 0, "USB musbotg"); SYSCTL_INT(_hw_usb_musbotg, OID_AUTO, debug, CTLFLAG_RW, &musbotgdebug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/controller/ohci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ohci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/ohci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int ohcidebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ohcidebug, 0, "ohci debug level"); TUNABLE_INT("hw.usb.ohci.debug", &ohcidebug); Modified: stable/9/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/uhci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/uhci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -85,7 +85,7 @@ __FBSDID("$FreeBSD$"); static int uhcidebug = 0; static int uhcinoloop = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci"); SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uhcidebug, 0, "uhci debug level"); TUNABLE_INT("hw.usb.uhci.debug", &uhcidebug); Modified: stable/9/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/9/sys/dev/usb/controller/usb_controller.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/usb_controller.c Sat Mar 9 02:36:32 2013 (r248085) @@ -79,7 +79,7 @@ static void usb_attach_sub(device_t, str #ifdef USB_DEBUG static int usb_ctrl_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ctrl, CTLFLAG_RW, 0, "USB controller"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ctrl, CTLFLAG_RW, 0, "USB controller"); SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug, CTLFLAG_RW, &usb_ctrl_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/controller/uss820dci.c ============================================================================== --- stable/9/sys/dev/usb/controller/uss820dci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/uss820dci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -79,7 +79,8 @@ #ifdef USB_DEBUG static int uss820dcidebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0, "USB uss820dci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0, + "USB uss820dci"); SYSCTL_INT(_hw_usb_uss820dci, OID_AUTO, debug, CTLFLAG_RW, &uss820dcidebug, 0, "uss820dci debug level"); #endif Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/controller/xhci.c Sat Mar 9 02:36:32 2013 (r248085) @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); static int xhcidebug; static int xhciroute; -SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &xhcidebug, 0, "Debug level"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); Modified: stable/9/sys/dev/usb/input/atp.c ============================================================================== --- stable/9/sys/dev/usb/input/atp.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/input/atp.c Sat Mar 9 02:36:32 2013 (r248085) @@ -114,7 +114,7 @@ __FBSDID("$FreeBSD$"); /* Tunables */ -SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); #ifdef USB_DEBUG enum atp_log_level { Modified: stable/9/sys/dev/usb/input/uep.c ============================================================================== --- stable/9/sys/dev/usb/input/uep.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/input/uep.c Sat Mar 9 02:36:32 2013 (r248085) @@ -57,7 +57,7 @@ #ifdef USB_DEBUG static int uep_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uep, CTLFLAG_RW, 0, "USB uep"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uep, CTLFLAG_RW, 0, "USB uep"); SYSCTL_INT(_hw_usb_uep, OID_AUTO, debug, CTLFLAG_RW, &uep_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/input/uhid.c ============================================================================== --- stable/9/sys/dev/usb/input/uhid.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/input/uhid.c Sat Mar 9 02:36:32 2013 (r248085) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int uhid_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid"); SYSCTL_INT(_hw_usb_uhid, OID_AUTO, debug, CTLFLAG_RW, &uhid_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/9/sys/dev/usb/input/ukbd.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/input/ukbd.c Sat Mar 9 02:36:32 2013 (r248085) @@ -93,7 +93,7 @@ __FBSDID("$FreeBSD$"); static int ukbd_debug = 0; static int ukbd_no_leds = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB ukbd"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB ukbd"); SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ukbd_debug, 0, "Debug level"); TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_debug); Modified: stable/9/sys/dev/usb/input/ums.c ============================================================================== --- stable/9/sys/dev/usb/input/ums.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/input/ums.c Sat Mar 9 02:36:32 2013 (r248085) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int ums_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums"); SYSCTL_INT(_hw_usb_ums, OID_AUTO, debug, CTLFLAG_RW, &ums_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/misc/udbp.c ============================================================================== --- stable/9/sys/dev/usb/misc/udbp.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/misc/udbp.c Sat Mar 9 02:36:32 2013 (r248085) @@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int udbp_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp"); SYSCTL_INT(_hw_usb_udbp, OID_AUTO, debug, CTLFLAG_RW, &udbp_debug, 0, "udbp debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_aue.c ============================================================================== --- stable/9/sys/dev/usb/net/if_aue.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_aue.c Sat Mar 9 02:36:32 2013 (r248085) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int aue_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue"); SYSCTL_INT(_hw_usb_aue, OID_AUTO, debug, CTLFLAG_RW, &aue_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/9/sys/dev/usb/net/if_axe.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_axe.c Sat Mar 9 02:36:32 2013 (r248085) @@ -133,7 +133,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int axe_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe"); SYSCTL_INT(_hw_usb_axe, OID_AUTO, debug, CTLFLAG_RW, &axe_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/9/sys/dev/usb/net/if_cdce.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_cdce.c Sat Mar 9 02:36:32 2013 (r248085) @@ -111,7 +111,7 @@ static uint32_t cdce_m_crc32(struct mbuf static int cdce_debug = 0; static int cdce_tx_interval = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet"); SYSCTL_INT(_hw_usb_cdce, OID_AUTO, debug, CTLFLAG_RW, &cdce_debug, 0, "Debug level"); SYSCTL_INT(_hw_usb_cdce, OID_AUTO, interval, CTLFLAG_RW, &cdce_tx_interval, 0, Modified: stable/9/sys/dev/usb/net/if_cue.c ============================================================================== --- stable/9/sys/dev/usb/net/if_cue.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_cue.c Sat Mar 9 02:36:32 2013 (r248085) @@ -124,7 +124,7 @@ static void cue_reset(struct cue_softc * #ifdef USB_DEBUG static int cue_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue"); SYSCTL_INT(_hw_usb_cue, OID_AUTO, debug, CTLFLAG_RW, &cue_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_ipheth.c ============================================================================== --- stable/9/sys/dev/usb/net/if_ipheth.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_ipheth.c Sat Mar 9 02:36:32 2013 (r248085) @@ -81,7 +81,7 @@ static uether_fn_t ipheth_setpromisc; #ifdef USB_DEBUG static int ipheth_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ipheth, CTLFLAG_RW, 0, "USB iPhone ethernet"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ipheth, CTLFLAG_RW, 0, "USB iPhone ethernet"); SYSCTL_INT(_hw_usb_ipheth, OID_AUTO, debug, CTLFLAG_RW, &ipheth_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_kue.c ============================================================================== --- stable/9/sys/dev/usb/net/if_kue.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_kue.c Sat Mar 9 02:36:32 2013 (r248085) @@ -165,7 +165,7 @@ static void kue_reset(struct kue_softc * #ifdef USB_DEBUG static int kue_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue"); SYSCTL_INT(_hw_usb_kue, OID_AUTO, debug, CTLFLAG_RW, &kue_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_mos.c ============================================================================== --- stable/9/sys/dev/usb/net/if_mos.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_mos.c Sat Mar 9 02:36:32 2013 (r248085) @@ -132,7 +132,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int mos_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, mos, CTLFLAG_RW, 0, "USB mos"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, mos, CTLFLAG_RW, 0, "USB mos"); SYSCTL_INT(_hw_usb_mos, OID_AUTO, debug, CTLFLAG_RW, &mos_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_rue.c ============================================================================== --- stable/9/sys/dev/usb/net/if_rue.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_rue.c Sat Mar 9 02:36:32 2013 (r248085) @@ -99,7 +99,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int rue_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue"); SYSCTL_INT(_hw_usb_rue, OID_AUTO, debug, CTLFLAG_RW, &rue_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/9/sys/dev/usb/net/if_udav.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_udav.c Sat Mar 9 02:36:32 2013 (r248085) @@ -193,7 +193,7 @@ static const struct usb_ether_methods ud #ifdef USB_DEBUG static int udav_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav"); SYSCTL_INT(_hw_usb_udav, OID_AUTO, debug, CTLFLAG_RW, &udav_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/net/if_usie.c ============================================================================== --- stable/9/sys/dev/usb/net/if_usie.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/if_usie.c Sat Mar 9 02:36:32 2013 (r248085) @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int usie_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, usie, CTLFLAG_RW, 0, "sierra USB modem"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, usie, CTLFLAG_RW, 0, "sierra USB modem"); SYSCTL_INT(_hw_usb_usie, OID_AUTO, debug, CTLFLAG_RW, &usie_debug, 0, "usie debug level"); #endif Modified: stable/9/sys/dev/usb/net/uhso.c ============================================================================== --- stable/9/sys/dev/usb/net/uhso.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/uhso.c Sat Mar 9 02:36:32 2013 (r248085) @@ -283,7 +283,7 @@ static const STRUCT_USB_HOST_ID uhso_dev #undef UHSO_DEV }; -SYSCTL_NODE(_hw_usb, OID_AUTO, uhso, CTLFLAG_RW, 0, "USB uhso"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uhso, CTLFLAG_RW, 0, "USB uhso"); static int uhso_autoswitch = 1; SYSCTL_INT(_hw_usb_uhso, OID_AUTO, auto_switch, CTLFLAG_RW, &uhso_autoswitch, 0, "Automatically switch to modem mode"); Modified: stable/9/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- stable/9/sys/dev/usb/net/usb_ethernet.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/net/usb_ethernet.c Sat Mar 9 02:36:32 2013 (r248085) @@ -57,7 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_NODE(_net, OID_AUTO, ue, CTLFLAG_RD, 0, "USB Ethernet parameters"); +static SYSCTL_NODE(_net, OID_AUTO, ue, CTLFLAG_RD, 0, + "USB Ethernet parameters"); #define UE_LOCK(_ue) mtx_lock((_ue)->ue_mtx) #define UE_UNLOCK(_ue) mtx_unlock((_ue)->ue_mtx) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/serial/u3g.c Sat Mar 9 02:36:32 2013 (r248085) @@ -67,7 +67,7 @@ #ifdef USB_DEBUG static int u3g_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g"); SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, CTLFLAG_RW, &u3g_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/serial/ubsa.c ============================================================================== --- stable/9/sys/dev/usb/serial/ubsa.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/serial/ubsa.c Sat Mar 9 02:36:32 2013 (r248085) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int ubsa_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa"); SYSCTL_INT(_hw_usb_ubsa, OID_AUTO, debug, CTLFLAG_RW, &ubsa_debug, 0, "ubsa debug level"); #endif Modified: stable/9/sys/dev/usb/serial/ubser.c ============================================================================== --- stable/9/sys/dev/usb/serial/ubser.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/serial/ubser.c Sat Mar 9 02:36:32 2013 (r248085) @@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int ubser_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW, 0, "USB ubser"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW, 0, "USB ubser"); SYSCTL_INT(_hw_usb_ubser, OID_AUTO, debug, CTLFLAG_RW, &ubser_debug, 0, "ubser debug level"); #endif Modified: stable/9/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uchcom.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/serial/uchcom.c Sat Mar 9 02:36:32 2013 (r248085) @@ -103,7 +103,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int uchcom_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uchcom, CTLFLAG_RW, 0, "USB uchcom"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uchcom, CTLFLAG_RW, 0, "USB uchcom"); SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RW, &uchcom_debug, 0, "uchcom debug level"); #endif Modified: stable/9/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/serial/uftdi.c Sat Mar 9 02:36:32 2013 (r248085) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int uftdi_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debug, CTLFLAG_RW, &uftdi_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/serial/ulpt.c ============================================================================== --- stable/9/sys/dev/usb/serial/ulpt.c Sat Mar 9 02:32:23 2013 (r248084) +++ stable/9/sys/dev/usb/serial/ulpt.c Sat Mar 9 02:36:32 2013 (r248085) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int ulpt_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ulpt, CTLFLAG_RW, 0, "USB ulpt"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ulpt, CTLFLAG_RW, 0, "USB ulpt"); SYSCTL_INT(_hw_usb_ulpt, OID_AUTO, debug, CTLFLAG_RW, &ulpt_debug, 0, "Debug level"); #endif Modified: stable/9/sys/dev/usb/serial/umcs.c ============================================================================== --- stable/9/sys/dev/usb/serial/umcs.c Sat Mar 9 02:32:23 2013 (r248084) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 05:20:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8FC2A6E1; Sat, 9 Mar 2013 05:20:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 69AD5BE4; Sat, 9 Mar 2013 05:20:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r295KY4J018308; Sat, 9 Mar 2013 05:20:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r295KYU4018307; Sat, 9 Mar 2013 05:20:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303090520.r295KYU4018307@svn.freebsd.org> From: Adrian Chadd Date: Sat, 9 Mar 2013 05:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248089 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 05:20:34 -0000 Author: adrian Date: Sat Mar 9 05:20:33 2013 New Revision: 248089 URL: http://svnweb.freebsd.org/changeset/base/248089 Log: Fix non-invariant compilation. Modified: head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Sat Mar 9 03:19:53 2013 (r248088) +++ head/sys/net80211/ieee80211_mesh.c Sat Mar 9 05:20:33 2013 (r248089) @@ -1477,10 +1477,9 @@ mesh_recv_indiv_data_to_fwrd(struct ieee struct ieee80211_qosframe_addr4 *qwh; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt_meshda, *rt_meshsa; - struct ieee80211com *ic = vap->iv_ic; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; @@ -1536,11 +1535,10 @@ mesh_recv_indiv_data_to_me(struct ieee80 const struct ieee80211_meshcntl_ae10 *mc10; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt; - struct ieee80211com *ic = vap->iv_ic; int ae; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; mc10 = (const struct ieee80211_meshcntl_ae10 *)mc; @@ -1603,10 +1601,9 @@ mesh_recv_group_data(struct ieee80211vap { #define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc) struct ieee80211_mesh_state *ms = vap->iv_mesh; - struct ieee80211com *ic = vap->iv_ic; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); mesh_forward(vap, m, mc); From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 06:11:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0A0F6E9F; Sat, 9 Mar 2013 06:11:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D76BAD52; Sat, 9 Mar 2013 06:11:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r296Bwml035021; Sat, 9 Mar 2013 06:11:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r296BwGh035020; Sat, 9 Mar 2013 06:11:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303090611.r296BwGh035020@svn.freebsd.org> From: Adrian Chadd Date: Sat, 9 Mar 2013 06:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248090 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 06:11:59 -0000 Author: adrian Date: Sat Mar 9 06:11:58 2013 New Revision: 248090 URL: http://svnweb.freebsd.org/changeset/base/248090 Log: Print out the queue flags during a TX DMA shutdown. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Mar 9 05:20:33 2013 (r248089) +++ head/sys/dev/ath/if_ath.c Sat Mar 9 06:11:58 2013 (r248090) @@ -4342,9 +4342,12 @@ ath_tx_stopdma(struct ath_softc *sc, str { struct ath_hal *ah = sc->sc_ah; - DPRINTF(sc, ATH_DEBUG_RESET, "%s: tx queue [%u] %p, link %p\n", - __func__, txq->axq_qnum, + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: tx queue [%u] %p, flags 0x%08x, link %p\n", + __func__, + txq->axq_qnum, (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, txq->axq_qnum), + txq->axq_flags, txq->axq_link); (void) ath_hal_stoptxdma(ah, txq->axq_qnum); } From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 08:50:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E449FC6B; Sat, 9 Mar 2013 08:50:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99FF9609; Sat, 9 Mar 2013 08:50:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r298oHBR082396; Sat, 9 Mar 2013 08:50:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r298oHjn082395; Sat, 9 Mar 2013 08:50:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303090850.r298oHjn082395@svn.freebsd.org> From: Adrian Chadd Date: Sat, 9 Mar 2013 08:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248091 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 08:50:18 -0000 Author: adrian Date: Sat Mar 9 08:50:17 2013 New Revision: 248091 URL: http://svnweb.freebsd.org/changeset/base/248091 Log: Disable the hw TID != buffer TID check. I can 100% reliably trigger this on TID 1 traffic by using iperf -S 32 to create traffic that maps to TID 1. The reference driver doesn't do this check. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Mar 9 06:11:58 2013 (r248090) +++ head/sys/dev/ath/if_ath_tx.c Sat Mar 9 08:50:17 2013 (r248091) @@ -4340,12 +4340,23 @@ ath_tx_aggr_comp_aggr(struct ath_softc * __func__, tap->txa_start, tx_ok, ts.ts_status, ts.ts_flags, isaggr, seq_st, hasba, ba[0], ba[1]); + /* + * The reference driver doesn't do this; it simply ignores + * this check in its entirety. + * + * I've seen this occur when using iperf to send traffic + * out tid 1 - the aggregate frames are all marked as TID 1, + * but the TXSTATUS has TID=0. So, let's just ignore this + * check. + */ +#if 0 /* Occasionally, the MAC sends a tx status for the wrong TID. */ if (tid != ts.ts_tid) { device_printf(sc->sc_dev, "%s: tid %d != hw tid %d\n", __func__, tid, ts.ts_tid); tx_ok = 0; } +#endif /* AR5416 BA bug; this requires an interface reset */ if (isaggr && tx_ok && (! hasba)) { From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 09:07:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E68C72CA; Sat, 9 Mar 2013 09:07:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D93FB69B; Sat, 9 Mar 2013 09:07:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2997DjQ086807; Sat, 9 Mar 2013 09:07:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2997DjA086805; Sat, 9 Mar 2013 09:07:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303090907.r2997DjA086805@svn.freebsd.org> From: Alexander Motin Date: Sat, 9 Mar 2013 09:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248092 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 09:07:14 -0000 Author: mav Date: Sat Mar 9 09:07:13 2013 New Revision: 248092 URL: http://svnweb.freebsd.org/changeset/base/248092 Log: Rework overflow checks of r247898 to not let too "intelligent" compiler to optimize it out. Submitted by: bde Modified: head/sys/kern/kern_event.c head/sys/kern/sys_generic.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Mar 9 08:50:17 2013 (r248091) +++ head/sys/kern/kern_event.c Sat Mar 9 09:07:13 2013 (r248092) @@ -1329,12 +1329,13 @@ kqueue_scan(struct kqueue *kq, int maxev goto done_nl; } if (timespecisset(tsp)) { - if (tsp->tv_sec < INT32_MAX) { + if (tsp->tv_sec <= INT32_MAX) { rsbt = tstosbt(*tsp); if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - asbt += rsbt; - if (asbt < rsbt) + if (asbt <= INT64_MAX - rsbt) + asbt += rsbt; + else asbt = 0; rsbt >>= tc_precexp; } else Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sat Mar 9 08:50:17 2013 (r248091) +++ head/sys/kern/sys_generic.c Sat Mar 9 09:07:13 2013 (r248092) @@ -1051,16 +1051,17 @@ kern_select(struct thread *td, int nd, f error = EINVAL; goto done; } - if (rtv.tv_sec == 0 && rtv.tv_usec == 0) + if (!timevalisset(&rtv)) asbt = 0; - else if (rtv.tv_sec < INT32_MAX) { + else if (rtv.tv_sec <= INT32_MAX) { rsbt = tvtosbt(rtv); precision = rsbt; precision >>= tc_precexp; if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - asbt += rsbt; - if (asbt < rsbt) + if (asbt <= INT64_MAX - rsbt) + asbt += rsbt; + else asbt = -1; } else asbt = -1; From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 10:16:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0BDDA3C2; Sat, 9 Mar 2013 10:16:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F138A8E4; Sat, 9 Mar 2013 10:16:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29AG8lY008041; Sat, 9 Mar 2013 10:16:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29AG8jK008040; Sat, 9 Mar 2013 10:16:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201303091016.r29AG8jK008040@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Mar 2013 10:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248093 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 10:16:09 -0000 Author: kib Date: Sat Mar 9 10:16:08 2013 New Revision: 248093 URL: http://svnweb.freebsd.org/changeset/base/248093 Log: Correct the lock class for the vm object lock. Reported and tested by: joel Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Sat Mar 9 09:07:13 2013 (r248092) +++ head/sys/kern/subr_witness.c Sat Mar 9 10:16:08 2013 (r248093) @@ -602,7 +602,7 @@ static struct witness_order_list_entry o * VM */ { "vm map (user)", &lock_class_sx }, - { "vm object", &lock_class_mtx_sleep }, + { "vm object", &lock_class_rw }, { "vm page", &lock_class_mtx_sleep }, { "vm page queue", &lock_class_mtx_sleep }, { "pmap pv global", &lock_class_rw }, From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 11:48:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F152C6FC; Sat, 9 Mar 2013 11:48:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6C41BB37; Sat, 9 Mar 2013 11:48:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r29Bm4RL078693; Sat, 9 Mar 2013 15:48:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r29Bm4ah078692; Sat, 9 Mar 2013 15:48:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 9 Mar 2013 15:48:04 +0400 From: Gleb Smirnoff To: Alexey Dokuchaev Subject: Re: svn commit: r247910 - head/sys/dev/sound/pci/hda Message-ID: <20130309114804.GI48089@FreeBSD.org> References: <201303070754.r277soET065603@svn.freebsd.org> <20130308020050.GC83162@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130308020050.GC83162@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 11:48:14 -0000 On Fri, Mar 08, 2013 at 02:00:50AM +0000, Alexey Dokuchaev wrote: A> On Thu, Mar 07, 2013 at 07:54:50AM +0000, Gleb Smirnoff wrote: A> > New Revision: 247910 A> > URL: http://svnweb.freebsd.org/changeset/base/247910 A> > A> > Log: A> > Plug a memory leak. A> > A> > Reviewed by: mav A> > Sponsored by: Nginx, Inc. A> A> Any MFCs planned? Yes, to stable/9. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 12:34:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 667C67A0; Sat, 9 Mar 2013 12:34:46 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42A27DDF; Sat, 9 Mar 2013 12:34:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29CYk8R050971; Sat, 9 Mar 2013 12:34:46 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29CYkBo050970; Sat, 9 Mar 2013 12:34:46 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201303091234.r29CYkBo050970@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 9 Mar 2013 12:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r248096 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 12:34:46 -0000 Author: gavin Date: Sat Mar 9 12:34:45 2013 New Revision: 248096 URL: http://svnweb.freebsd.org/changeset/base/248096 Log: This file is intended for doc committers to receive src commit email directly, rather than through the svn-src-all mailing lists etc. As such, only current doc committers should be in here, as documented by a comment in the file itself. Remove any committers who no longer hold a doc bit. Some of these entries date back to the CVS days. All of the removed users have been emailed in advance to let them know of this, there was no objection from any of the respondants. Approved by: core (implicit) Modified: svnadmin/conf/access.doc Modified: svnadmin/conf/access.doc ============================================================================== --- svnadmin/conf/access.doc Sat Mar 9 12:03:08 2013 (r248095) +++ svnadmin/conf/access.doc Sat Mar 9 12:34:45 2013 (r248096) @@ -18,10 +18,5 @@ # type of commits. # blackend -chern gjb -jcamou joel -mwlucas -nik -rushani From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 12:45:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D02CBBC1; Sat, 9 Mar 2013 12:45:37 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC1CEFB; Sat, 9 Mar 2013 12:45:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29Cjbq1054005; Sat, 9 Mar 2013 12:45:37 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29Cjbr3054004; Sat, 9 Mar 2013 12:45:37 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091245.r29Cjbr3054004@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 12:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248097 - in head: . lib/libncp lib/libprocstat share/examples/nwclient sys/fs/nwfs sys/modules/ncp sys/modules/nwfs sys/netncp usr.bin/ncplist usr.bin/ncplogin usr.sbin/mount_nwfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 12:45:37 -0000 Author: attilio Date: Sat Mar 9 12:45:36 2013 New Revision: 248097 URL: http://svnweb.freebsd.org/changeset/base/248097 Log: Garbage collect NWFS and NCP bits which are now completely disconnected from the tree since few months. This patch is not targeted for MFC. Deleted: head/lib/libncp/ head/lib/libprocstat/nwfs.c head/share/examples/nwclient/ head/sys/fs/nwfs/ head/sys/modules/ncp/ head/sys/modules/nwfs/ head/sys/netncp/ head/usr.bin/ncplist/ head/usr.bin/ncplogin/ head/usr.sbin/mount_nwfs/ Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Mar 9 12:34:45 2013 (r248096) +++ head/ObsoleteFiles.inc Sat Mar 9 12:45:36 2013 (r248097) @@ -38,6 +38,43 @@ # xargs -n1 | sort | uniq -d; # done +# 20130902: NWFS and NCP supports removed +OLD_FILES+=usr/bin/ncplist +OLD_FILES+=usr/bin/ncplogin +OLD_FILES+=usr/bin/ncplogout +OLD_FILES+=usr/include/fs/nwfs/nwfs.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_mount.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_node.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_subr.h +OLD_DIRS+=usr/include/fs/nwfs +OLD_FILES+=usr/include/netncp/ncp.h +OLD_FILES+=usr/include/netncp/ncp_cfg.h +OLD_FILES+=usr/include/netncp/ncp_conn.h +OLD_FILES+=usr/include/netncp/ncp_file.h +OLD_FILES+=usr/include/netncp/ncp_lib.h +OLD_FILES+=usr/include/netncp/ncp_ncp.h +OLD_FILES+=usr/include/netncp/ncp_nls.h +OLD_FILES+=usr/include/netncp/ncp_rcfile.h +OLD_FILES+=usr/include/netncp/ncp_rq.h +OLD_FILES+=usr/include/netncp/ncp_sock.h +OLD_FILES+=usr/include/netncp/ncp_subr.h +OLD_FILES+=usr/include/netncp/ncp_user.h +OLD_FILES+=usr/include/netncp/ncpio.h +OLD_FILES+=usr/include/netncp/nwerror.h +OLD_DIRS+=usr/include/netncp +OLD_FILES+=usr/lib/libncp.a +OLD_FILES+=usr/lib/libncp.so +OLD_LIBS+=usr/lib/libncp.so.4 +OLD_FILES+=usr/lib/libncp_p.a +OLD_FILES+=usr/lib32/libncp.a +OLD_FILES+=usr/lib32/libncp.so +OLD_LIBS+=usr/lib32/libncp.so.4 +OLD_FILES+=usr/lib32/libncp_p.a +OLD_FILES+=usr/sbin/mount_nwfs +OLD_FILES+=usr/share/man/man1/ncplist.1.gz +OLD_FILES+=usr/share/man/man1/ncplogin.1.gz +OLD_FILES+=usr/share/man/man1/ncplogout.1.gz +OLD_FILES+=usr/share/man/man8/mount_nwfs.8.gz # 20130302: NTFS support removed OLD_FILES+=rescue/mount_ntfs OLD_FILES+=sbin/mount_ntfs From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 13:05:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 399CC162; Sat, 9 Mar 2013 13:05:22 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5B6FD3; Sat, 9 Mar 2013 13:05:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29D5LvE060077; Sat, 9 Mar 2013 13:05:21 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29D5LDA060076; Sat, 9 Mar 2013 13:05:21 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303091305.r29D5LDA060076@svn.freebsd.org> From: Davide Italiano Date: Sat, 9 Mar 2013 13:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248099 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 13:05:22 -0000 Author: davide Date: Sat Mar 9 13:05:21 2013 New Revision: 248099 URL: http://svnweb.freebsd.org/changeset/base/248099 Log: - Initialize variable in smbfs_rename() to silent compiler warning - Fix smbfs_mkdir() return value (in case of error). Reported by: pho Modified: head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Sat Mar 9 12:51:39 2013 (r248098) +++ head/sys/fs/smbfs/smbfs_vnops.c Sat Mar 9 13:05:21 2013 (r248099) @@ -580,6 +580,7 @@ smbfs_rename(ap) u_int16_t flags = 6; int error=0; + scred = NULL; /* Check for cross-device rename */ if ((fvp->v_mount != tdvp->v_mount) || (tvp && (fvp->v_mount != tvp->v_mount))) { @@ -730,7 +731,7 @@ smbfs_mkdir(ap) *ap->a_vpp = vp; out: smbfs_free_scred(scred); - return 0; + return error; } /* From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 13:25:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3081D632; Sat, 9 Mar 2013 13:25:46 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A94E13F; Sat, 9 Mar 2013 13:25:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29DPjN3066320; Sat, 9 Mar 2013 13:25:45 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29DPjfS066318; Sat, 9 Mar 2013 13:25:45 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303091325.r29DPjfS066318@svn.freebsd.org> From: Davide Italiano Date: Sat, 9 Mar 2013 13:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248101 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 13:25:46 -0000 Author: davide Date: Sat Mar 9 13:25:45 2013 New Revision: 248101 URL: http://svnweb.freebsd.org/changeset/base/248101 Log: smbfs_lookup() in the DOTDOT case operates on dvp->n_parent without proper locking. This doesn't prevent in any case reclaim of the vnode. Avoid this not going over-the-wire in this case and relying on subsequent smbfs_getattr() call to restore consistency. While I'm here, change a couple of SMBVDEBUG() in MPASS(). sbmfs_smb_lookup() doesn't and shouldn't know about '.' and '..' Reported by: pho's stress2 suite Modified: head/sys/fs/smbfs/smbfs_smb.c head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- head/sys/fs/smbfs/smbfs_smb.c Sat Mar 9 13:12:12 2013 (r248100) +++ head/sys/fs/smbfs/smbfs_smb.c Sat Mar 9 13:25:45 2013 (r248101) @@ -1455,15 +1455,9 @@ smbfs_smb_lookup(struct smbnode *dnp, co fap->fa_ino = 2; return 0; } - if (nmlen == 1 && name[0] == '.') { - error = smbfs_smb_lookup(dnp, NULL, 0, fap, scred); - return error; - } else if (nmlen == 2 && name[0] == '.' && name[1] == '.') { - error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap, - scred); - printf("%s: knows NOTHING about '..'\n", __func__); - return error; - } + MPASS(!(nmlen == 2 && name[0] == '.' && name[1] == '.')); + MPASS(!(nmlen == 1 && name[0] == '.')); + ASSERT_VOP_ELOCKED(dnp->n_vnode, "smbfs_smb_lookup"); error = smbfs_findopen(dnp, name, nmlen, SMB_FA_SYSTEM | SMB_FA_HIDDEN | SMB_FA_DIR, scred, &ctx); if (error) Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Sat Mar 9 13:12:12 2013 (r248100) +++ head/sys/fs/smbfs/smbfs_vnops.c Sat Mar 9 13:25:45 2013 (r248101) @@ -1204,13 +1204,20 @@ smbfs_lookup(ap) smb_makescred(scred, td, cnp->cn_cred); fap = &fattr; if (flags & ISDOTDOT) { - error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap, - scred); - SMBVDEBUG("result of dotdot lookup: %d\n", error); - } else { - fap = &fattr; + /* + * In the DOTDOT case, don't go over-the-wire + * in order to request attributes. We already + * know it's a directory and subsequent call to + * smbfs_getattr() will restore consistency. + * + */ + SMBVDEBUG("smbfs_smb_lookup: dotdot\n"); + } else if (isdot) { + error = smbfs_smb_lookup(dnp, NULL, 0, fap, scred); + SMBVDEBUG("result of smbfs_smb_lookup: %d\n", error); + } + else { error = smbfs_smb_lookup(dnp, name, nmlen, fap, scred); -/* if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')*/ SMBVDEBUG("result of smbfs_smb_lookup: %d\n", error); } if (error && error != ENOENT) From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 13:30:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0A54849; Sat, 9 Mar 2013 13:30:06 +0000 (UTC) (envelope-from db@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A50AE182; Sat, 9 Mar 2013 13:30:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29DU6lR067102; Sat, 9 Mar 2013 13:30:06 GMT (envelope-from db@svn.freebsd.org) Received: (from db@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29DU6s1067101; Sat, 9 Mar 2013 13:30:06 GMT (envelope-from db@svn.freebsd.org) Message-Id: <201303091330.r29DU6s1067101@svn.freebsd.org> From: Diane Bruce Date: Sat, 9 Mar 2013 13:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248102 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 13:30:06 -0000 Author: db (ports committer) Date: Sat Mar 9 13:30:06 2013 New Revision: 248102 URL: http://svnweb.freebsd.org/changeset/base/248102 Log: commit correct tested fix for gr_util.c Approved by: theraven Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Sat Mar 9 13:25:45 2013 (r248101) +++ head/lib/libutil/gr_util.c Sat Mar 9 13:30:06 2013 (r248102) @@ -50,7 +50,7 @@ static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; static size_t grmemlen(const struct group *, const char *, int *); -static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx); +static struct group *grcopy(const struct group *gr, char *mem, const char *, int ndx); /* * Initialize statics @@ -361,26 +361,30 @@ gr_equal(const struct group *gr1, const if (gr1->gr_gid != gr2->gr_gid) return (false); - /* Check all members in both groups. */ - if (gr1->gr_mem == NULL || gr2->gr_mem == NULL) { - if (gr1->gr_mem != gr2->gr_mem) - return (false); - } else { - for (gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) { - for (gr2_ndx = 0;; gr2_ndx++) { - if (gr2->gr_mem[gr2_ndx] == NULL) - return (false); - if (strcmp(gr1->gr_mem[gr1_ndx], - gr2->gr_mem[gr2_ndx]) == 0) { - break; - } - } - } - - /* Check that group2 does not have more members than group1. */ - if (gr2->gr_mem[gr1_ndx] != NULL) - return (false); - } + /* Check all members in both groups. + * getgrnam can return gr_mem with a pointer to NULL. + * gr_dup and gr_add strip out this superfluous NULL, setting + * gr_mem to NULL for no members. + */ + if (gr1->gr_mem != NULL && gr2->gr_mem != NULL) { + int i; + + for (i = 0; gr1->gr_mem[i] != NULL; i++) { + if (strcmp(gr1->gr_mem[i], gr2->gr_mem[i]) != 0) + return (false); + } + } + /* Count number of members in both structs */ + gr2_ndx = 0; + if (gr2->gr_mem != NULL) + for(; gr2->gr_mem[gr2_ndx] != NULL; gr2_ndx++) + /* empty */; + gr1_ndx = 0; + if (gr1->gr_mem != NULL) + for(; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) + /* empty */; + if (gr1_ndx != gr2_ndx) + return (false); return (true); } @@ -439,21 +443,21 @@ gr_dup(const struct group *gr) struct group * gr_add(const struct group *gr, const char *newmember) { - struct group *newgr; + char *mem; size_t len; int num_mem; num_mem = 0; len = grmemlen(gr, newmember, &num_mem); /* Create new group and copy old group into it. */ - if ((newgr = malloc(len)) == NULL) + if ((mem = malloc(len)) == NULL) return (NULL); - return (grcopy(gr, newgr, newmember, num_mem)); + return (grcopy(gr, mem, newmember, num_mem)); } /* It is safer to walk the pointers given at gr_mem since there is no - * guarantee the gr_mem + strings are continguous in the given struct group - * but compact the new group into the following form. + * guarantee the gr_mem + strings are contiguous in the given struct group + * but compactify the new group into the following form. * * The new struct is laid out like this in memory. The example given is * for a group with two members only. @@ -474,23 +478,21 @@ gr_add(const struct group *gr, const cha * } */ /* - * Copy the guts of a group plus given name to a preallocated group struct + * Copy the contents of a group plus given name to a preallocated group struct */ static struct group * -grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx) +grcopy(const struct group *gr, char *dst, const char *name, int ndx) { - char *dst; int i; + struct group *newgr; - if (name != NULL) - ndx++; - /* point new gr_mem to end of struct + 1 if there are names */ - if (ndx != 0) - newgr->gr_mem = (char **)(newgr + 1); - else + newgr = (struct group *)(void *)dst; /* avoid alignment warning */ + dst += sizeof(*newgr); + if (ndx != 0) { + newgr->gr_mem = (char **)(void *)(dst); /* avoid alignment warning */ + dst += (ndx + 1) * sizeof(*newgr->gr_mem); + } else newgr->gr_mem = NULL; - /* point dst after the end of all the gr_mem pointers in newgr */ - dst = (char *)&newgr->gr_mem[ndx + 1]; if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; @@ -502,17 +504,23 @@ grcopy(const struct group *gr, struct gr } else newgr->gr_passwd = NULL; newgr->gr_gid = gr->gr_gid; - if (ndx != 0) { - for (i = 0; gr->gr_mem[i] != NULL; i++) { + i = 0; + /* Original group struct might have a NULL gr_mem */ + if (gr->gr_mem != NULL) { + for (; gr->gr_mem[i] != NULL; i++) { newgr->gr_mem[i] = dst; dst = stpcpy(dst, gr->gr_mem[i]) + 1; } - if (name != NULL) { - newgr->gr_mem[i++] = dst; - dst = stpcpy(dst, name) + 1; - } - newgr->gr_mem[i] = NULL; } + /* If name is not NULL, newgr->gr_mem is known to be not NULL */ + if (name != NULL) { + newgr->gr_mem[i++] = dst; + dst = stpcpy(dst, name) + 1; + } + /* if newgr->gr_mem is not NULL add NULL marker */ + if (newgr->gr_mem != NULL) + newgr->gr_mem[i] = NULL; + return (newgr); } @@ -533,18 +541,22 @@ grmemlen(const struct group *gr, const c len += strlen(gr->gr_name) + 1; if (gr->gr_passwd != NULL) len += strlen(gr->gr_passwd) + 1; + i = 0; if (gr->gr_mem != NULL) { - for (len = i = 0; gr->gr_mem[i] != NULL; i++) { + for (; gr->gr_mem[i] != NULL; i++) { len += strlen(gr->gr_mem[i]) + 1; len += sizeof(*gr->gr_mem); } - *num_mem = i; } if (name != NULL) { + i++; len += strlen(name) + 1; - if (gr->gr_mem == NULL) - len += sizeof(*gr->gr_mem); + len += sizeof(*gr->gr_mem); } + /* Allow for NULL pointer */ + if (i != 0) + len += sizeof(*gr->gr_mem); + *num_mem = i; return(len); } From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 15:02:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0FC68B9; Sat, 9 Mar 2013 15:02:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 99370789; Sat, 9 Mar 2013 15:02:35 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 2A03A46B2E; Sat, 9 Mar 2013 10:02:35 -0500 (EST) Date: Sat, 9 Mar 2013 15:02:35 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Attilio Rao Subject: Re: svn commit: r248097 - in head: . lib/libncp lib/libprocstat share/examples/nwclient sys/fs/nwfs sys/modules/ncp sys/modules/nwfs sys/netncp usr.bin/ncplist usr.bin/ncplogin usr.sbin/mount_nwfs In-Reply-To: <201303091245.r29Cjbr3054004@svn.freebsd.org> Message-ID: References: <201303091245.r29Cjbr3054004@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 15:02:35 -0000 Hi Attilio: It's really great to see the continued progress towards the goal entirely-MPSAFE VFS in 10.x -- we owe you a huge vote of thanks for pursuing this! Robert N M Watson Computer Laboratory University of Cambridge On Sat, 9 Mar 2013, Attilio Rao wrote: > Author: attilio > Date: Sat Mar 9 12:45:36 2013 > New Revision: 248097 > URL: http://svnweb.freebsd.org/changeset/base/248097 > > Log: > Garbage collect NWFS and NCP bits which are now completely disconnected > from the tree since few months. > > This patch is not targeted for MFC. > > Deleted: > head/lib/libncp/ > head/lib/libprocstat/nwfs.c > head/share/examples/nwclient/ > head/sys/fs/nwfs/ > head/sys/modules/ncp/ > head/sys/modules/nwfs/ > head/sys/netncp/ > head/usr.bin/ncplist/ > head/usr.bin/ncplogin/ > head/usr.sbin/mount_nwfs/ > Modified: > head/ObsoleteFiles.inc > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Sat Mar 9 12:34:45 2013 (r248096) > +++ head/ObsoleteFiles.inc Sat Mar 9 12:45:36 2013 (r248097) > @@ -38,6 +38,43 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20130902: NWFS and NCP supports removed > +OLD_FILES+=usr/bin/ncplist > +OLD_FILES+=usr/bin/ncplogin > +OLD_FILES+=usr/bin/ncplogout > +OLD_FILES+=usr/include/fs/nwfs/nwfs.h > +OLD_FILES+=usr/include/fs/nwfs/nwfs_mount.h > +OLD_FILES+=usr/include/fs/nwfs/nwfs_node.h > +OLD_FILES+=usr/include/fs/nwfs/nwfs_subr.h > +OLD_DIRS+=usr/include/fs/nwfs > +OLD_FILES+=usr/include/netncp/ncp.h > +OLD_FILES+=usr/include/netncp/ncp_cfg.h > +OLD_FILES+=usr/include/netncp/ncp_conn.h > +OLD_FILES+=usr/include/netncp/ncp_file.h > +OLD_FILES+=usr/include/netncp/ncp_lib.h > +OLD_FILES+=usr/include/netncp/ncp_ncp.h > +OLD_FILES+=usr/include/netncp/ncp_nls.h > +OLD_FILES+=usr/include/netncp/ncp_rcfile.h > +OLD_FILES+=usr/include/netncp/ncp_rq.h > +OLD_FILES+=usr/include/netncp/ncp_sock.h > +OLD_FILES+=usr/include/netncp/ncp_subr.h > +OLD_FILES+=usr/include/netncp/ncp_user.h > +OLD_FILES+=usr/include/netncp/ncpio.h > +OLD_FILES+=usr/include/netncp/nwerror.h > +OLD_DIRS+=usr/include/netncp > +OLD_FILES+=usr/lib/libncp.a > +OLD_FILES+=usr/lib/libncp.so > +OLD_LIBS+=usr/lib/libncp.so.4 > +OLD_FILES+=usr/lib/libncp_p.a > +OLD_FILES+=usr/lib32/libncp.a > +OLD_FILES+=usr/lib32/libncp.so > +OLD_LIBS+=usr/lib32/libncp.so.4 > +OLD_FILES+=usr/lib32/libncp_p.a > +OLD_FILES+=usr/sbin/mount_nwfs > +OLD_FILES+=usr/share/man/man1/ncplist.1.gz > +OLD_FILES+=usr/share/man/man1/ncplogin.1.gz > +OLD_FILES+=usr/share/man/man1/ncplogout.1.gz > +OLD_FILES+=usr/share/man/man8/mount_nwfs.8.gz > # 20130302: NTFS support removed > OLD_FILES+=rescue/mount_ntfs > OLD_FILES+=sbin/mount_ntfs > From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 15:04:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AEB9FB64; Sat, 9 Mar 2013 15:04:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A20B97B7; Sat, 9 Mar 2013 15:04:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29F4j2x096577; Sat, 9 Mar 2013 15:04:45 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29F4jiC096573; Sat, 9 Mar 2013 15:04:45 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201303091504.r29F4jiC096573@svn.freebsd.org> From: Mark Johnston Date: Sat, 9 Mar 2013 15:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248104 - head/sys/dev/ichwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 15:04:45 -0000 Author: markj Date: Sat Mar 9 15:04:44 2013 New Revision: 248104 URL: http://svnweb.freebsd.org/changeset/base/248104 Log: Don't log a message when the watchdog is reloaded. It's not useful to do so and these messages flood the log when bootverbose is enabled. Approved by: rstone (co-mentor) Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Sat Mar 9 14:34:53 2013 (r248103) +++ head/sys/dev/ichwd/ichwd.c Sat Mar 9 15:04:44 2013 (r248104) @@ -323,8 +323,6 @@ ichwd_tmr_reload(struct ichwd_softc *sc) ichwd_write_tco_1(sc, TCO_RLD, 1); else ichwd_write_tco_2(sc, TCO_RLD, 1); - - ichwd_verbose_printf(sc->device, "timer reloaded\n"); } /* From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 15:17:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B4C38FCC; Sat, 9 Mar 2013 15:17:56 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2EE843; Sat, 9 Mar 2013 15:17:56 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id 16so3093336iea.8 for ; Sat, 09 Mar 2013 07:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=fiIXaWjzoAWODtQp30iP6R7qjas3BPTQU5RwBxwOIgg=; b=bij9ahUGks+8z6FK3vdVy5DZzgU9nXIUgZljfYxH9OQ1uvY+RnQcJ7PeHKlX/k4KpC VgXEOZA3i9Knf4CP8hR5j5LQHUyOBKYXq1alAhDuk9J4pEwo0HD9/vcqiEB/4iTiRWDS +wjlkAjjB8mRJKiZGmeacT8NQxfKe1dYiXyg0ljD8vQcPYhSuzOpK8uOfP6F0YBLtnvm dAPXBhDR+5W1CS+axT2AVSKTu3nTFr5jYekItQnJBtAiuRjKvu88R2I5MC1+gm287qUP DcTq8lIGoR8SXOIzlMBSf4COVQYH+ygrjluVuxd3UyTIyA5xIyzQcNKunuJTQmV3KAwQ rL4g== MIME-Version: 1.0 X-Received: by 10.43.103.195 with SMTP id dj3mr4366900icc.3.1362842276141; Sat, 09 Mar 2013 07:17:56 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Sat, 9 Mar 2013 07:17:56 -0800 (PST) In-Reply-To: References: <201303091245.r29Cjbr3054004@svn.freebsd.org> Date: Sat, 9 Mar 2013 16:17:56 +0100 X-Google-Sender-Auth: 5I1DAw6bPZ2U5HwF2cymejg7Byw Message-ID: Subject: Re: svn commit: r248097 - in head: . lib/libncp lib/libprocstat share/examples/nwclient sys/fs/nwfs sys/modules/ncp sys/modules/nwfs sys/netncp usr.bin/ncplist usr.bin/ncplogin usr.sbin/mount_nwfs From: Attilio Rao To: Robert Watson Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 15:17:56 -0000 On Sat, Mar 9, 2013 at 4:02 PM, Robert Watson wrote: > Hi Attilio: > > It's really great to see the continued progress towards the goal > entirely-MPSAFE VFS in 10.x -- we owe you a huge vote of thanks for pursuing > this! Thanks for the kind words. The VFS can be considered completely MPSAFE by date, the only remaining thing to do is sweeping out smbfs/netsmb. However a known FreeBSD shops has patches to make smbfs MPSAFE and I'd rather give them more time to commit them and re-add smbfs as a MPSAFE filesystem rather than get into their way and remove the support. This is the last bit to sort out. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 15:31:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7B21D8EA; Sat, 9 Mar 2013 15:31:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68CF794E; Sat, 9 Mar 2013 15:31:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29FVKU4005496; Sat, 9 Mar 2013 15:31:20 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29FVKXc005495; Sat, 9 Mar 2013 15:31:20 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091531.r29FVKXc005495@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 15:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248105 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 15:31:20 -0000 Author: attilio Date: Sat Mar 9 15:31:19 2013 New Revision: 248105 URL: http://svnweb.freebsd.org/changeset/base/248105 Log: Improve UMTX_PROFILING: - Use u_int values for length and max_length values - Add a way to reset the max_length heuristic in order to have the possibility to reuse the mechanism consecutively without rebooting the machine - Add a way to quick display top5 contented buckets in the system for the max_length value. This should give a quick overview on the quality of the hash table distribution. Sponsored by: EMC / Isilon storage division Reviewed by: jeff, davide Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat Mar 9 15:04:44 2013 (r248104) +++ head/sys/kern/kern_umtx.c Sat Mar 9 15:31:19 2013 (r248105) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -64,6 +65,11 @@ __FBSDID("$FreeBSD$"); #define _UMUTEX_TRY 1 #define _UMUTEX_WAIT 2 +#ifdef UMTX_PROFILING +#define UPROF_PERC_BIGGER(w, f, sw, sf) \ + (((w) > (sw)) || ((w) == (sw) && (f) > (sf))) +#endif + /* Priority inheritance mutex info. */ struct umtx_pi { /* Owner thread */ @@ -157,8 +163,8 @@ struct umtxq_chain { TAILQ_HEAD(,umtx_pi) uc_pi_list; #ifdef UMTX_PROFILING - int length; - int max_length; + u_int length; + u_int max_length; #endif }; @@ -252,6 +258,117 @@ umtx_init_profiling(void) "max_length1", CTLFLAG_RD, &umtxq_chains[1][i].max_length, 0, NULL); } } + +static int +sysctl_debug_umtx_chains_peaks(SYSCTL_HANDLER_ARGS) +{ + char buf[512]; + struct sbuf sb; + struct umtxq_chain *uc; + u_int fract, i, j, tot, whole; + u_int sf0, sf1, sf2, sf3, sf4; + u_int si0, si1, si2, si3, si4; + u_int sw0, sw1, sw2, sw3, sw4; + + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + for (i = 0; i < 2; i++) { + tot = 0; + for (j = 0; j < UMTX_CHAINS; ++j) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + tot += uc->max_length; + mtx_unlock(&uc->uc_lock); + } + if (tot == 0) + sbuf_printf(&sb, "%u) Empty ", i); + else { + sf0 = sf1 = sf2 = sf3 = sf4 = 0; + si0 = si1 = si2 = si3 = si4 = 0; + sw0 = sw1 = sw2 = sw3 = sw4 = 0; + for (j = 0; j < UMTX_CHAINS; j++) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + whole = uc->max_length * 100; + mtx_unlock(&uc->uc_lock); + fract = (whole % tot) * 100; + if (UPROF_PERC_BIGGER(whole, fract, sw0, sf0)) { + sf0 = fract; + si0 = j; + sw0 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw1, + sf1)) { + sf1 = fract; + si1 = j; + sw1 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw2, + sf2)) { + sf2 = fract; + si2 = j; + sw2 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw3, + sf3)) { + sf3 = fract; + si3 = j; + sw3 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw4, + sf4)) { + sf4 = fract; + si4 = j; + sw4 = whole; + } + } + sbuf_printf(&sb, "queue %u:\n", i); + sbuf_printf(&sb, "1st: %u.%u%% idx: %u\n", sw0 / tot, + sf0 / tot, si0); + sbuf_printf(&sb, "2nd: %u.%u%% idx: %u\n", sw1 / tot, + sf1 / tot, si1); + sbuf_printf(&sb, "3rd: %u.%u%% idx: %u\n", sw2 / tot, + sf2 / tot, si2); + sbuf_printf(&sb, "4th: %u.%u%% idx: %u\n", sw3 / tot, + sf3 / tot, si3); + sbuf_printf(&sb, "5th: %u.%u%% idx: %u\n", sw4 / tot, + sf4 / tot, si4); + } + } + sbuf_trim(&sb); + sbuf_finish(&sb); + sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); + sbuf_delete(&sb); + return (0); +} + +static int +sysctl_debug_umtx_chains_clear(SYSCTL_HANDLER_ARGS) +{ + struct umtxq_chain *uc; + u_int i, j; + int clear, error; + + clear = 0; + error = sysctl_handle_int(oidp, &clear, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (clear != 0) { + for (i = 0; i < 2; ++i) { + for (j = 0; j < UMTX_CHAINS; ++j) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + uc->length = 0; + uc->max_length = 0; + mtx_unlock(&uc->uc_lock); + } + } + } + return (0); +} + +SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, clear, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_umtx_chains_clear, "I", "Clear umtx chains statistics"); +SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, peaks, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_umtx_chains_peaks, "A", "Highest peaks in chains max length"); #endif static void From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 15:35:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8317FDD1; Sat, 9 Mar 2013 15:35:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7654C9AD; Sat, 9 Mar 2013 15:35:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29FZWo6006099; Sat, 9 Mar 2013 15:35:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29FZWdO006098; Sat, 9 Mar 2013 15:35:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303091535.r29FZWdO006098@svn.freebsd.org> From: Adrian Chadd Date: Sat, 9 Mar 2013 15:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248106 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 15:35:32 -0000 Author: adrian Date: Sat Mar 9 15:35:31 2013 New Revision: 248106 URL: http://svnweb.freebsd.org/changeset/base/248106 Log: Fix another compiler warning issue when invariants are disabled. Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sat Mar 9 15:31:19 2013 (r248105) +++ head/sys/net80211/ieee80211_output.c Sat Mar 9 15:35:31 2013 (r248106) @@ -597,10 +597,9 @@ ieee80211_send_setup( struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_tx_ampdu *tap; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); - struct ieee80211com *ic = ni->ni_ic; ieee80211_seq seqno; - IEEE80211_TX_LOCK_ASSERT(ic); + IEEE80211_TX_LOCK_ASSERT(ni->ni_ic); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type; if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) { From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 16:29:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3274D170; Sat, 9 Mar 2013 16:29:27 +0000 (UTC) (envelope-from joel@vnode.se) Received: from mail.vnode.se (mail.vnode.se [212.247.52.13]) by mx1.freebsd.org (Postfix) with ESMTP id E3A5AE81; Sat, 9 Mar 2013 16:29:26 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 9877AE3F07A; Sat, 9 Mar 2013 17:29:25 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ylhf8KM87skr; Sat, 9 Mar 2013 17:29:23 +0100 (CET) Received: from devbox.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 03553E3F079; Sat, 9 Mar 2013 17:29:22 +0100 (CET) Date: Sat, 9 Mar 2013 17:29:22 +0100 From: Joel Dahl To: Attilio Rao Subject: Re: svn commit: r248097 - in head: . lib/libncp lib/libprocstat share/examples/nwclient sys/fs/nwfs sys/modules/ncp sys/modules/nwfs sys/netncp usr.bin/ncplist usr.bin/ncplogin usr.sbin/mount_nwfs Message-ID: <20130309162921.GL17537@devbox.vnode.local> References: <201303091245.r29Cjbr3054004@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 16:29:27 -0000 On Sat, Mar 09, 2013 at 04:17:56PM +0100, Attilio Rao wrote: > On Sat, Mar 9, 2013 at 4:02 PM, Robert Watson wrote: > > Hi Attilio: > > > > It's really great to see the continued progress towards the goal > > entirely-MPSAFE VFS in 10.x -- we owe you a huge vote of thanks for pursuing > > this! > > Thanks for the kind words. > > The VFS can be considered completely MPSAFE by date, the only > remaining thing to do is sweeping out smbfs/netsmb. > However a known FreeBSD shops has patches to make smbfs MPSAFE and I'd > rather give them more time to commit them and re-add smbfs as a MPSAFE > filesystem rather than get into their way and remove the support. Have they given you any ETA for this? 10.0 is approaching ... :-) -- Joel From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 16:47:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DE6E6F70; Sat, 9 Mar 2013 16:47:16 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vb0-x229.google.com (mail-vb0-x229.google.com [IPv6:2607:f8b0:400c:c02::229]) by mx1.freebsd.org (Postfix) with ESMTP id 55C25F6A; Sat, 9 Mar 2013 16:47:16 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so1063458vbn.28 for ; Sat, 09 Mar 2013 08:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=WML4Uwtt1d7rqzIFdsOBwDSSmxBfH01aDSZfGuAOyhM=; b=uc70ZbW11agPA4B8r7Jw40ikx75DvOIza/TPoH6ZLFOvkNR/aqstmKfREM9xpjDjU1 4z//oXwxGknpr+YnvO0V1BUUG0g7PCPWzqx9JWJgTycLz6RI9YLhxh/JGhAqN/qoZNSV GMfx6vIHQwBWupTakWt5qJ4QNblP+GccwX+QS1LTMMlX+MEDYTETTJsYX/M4BDUtKInY KdDTEvGUqdwBBL5IEUB4XsFeaNT5yW9fVqK1SlPuLhuNPKe28/w80SZukyLD3hD/qds8 yYNaImDUyBGikBk6JTu2hHoXvILaMU/NUaS41x77aj0BnAuyqgQLKj0Ka8eW22uTwJwg kQfg== MIME-Version: 1.0 X-Received: by 10.52.88.237 with SMTP id bj13mr2209920vdb.75.1362847635818; Sat, 09 Mar 2013 08:47:15 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.220.34.203 with HTTP; Sat, 9 Mar 2013 08:47:15 -0800 (PST) In-Reply-To: <20130309162921.GL17537@devbox.vnode.local> References: <201303091245.r29Cjbr3054004@svn.freebsd.org> <20130309162921.GL17537@devbox.vnode.local> Date: Sat, 9 Mar 2013 17:47:15 +0100 X-Google-Sender-Auth: K6hFw3cSVG9ltU1kV4C7YQns6f8 Message-ID: Subject: Re: svn commit: r248097 - in head: . lib/libncp lib/libprocstat share/examples/nwclient sys/fs/nwfs sys/modules/ncp sys/modules/nwfs sys/netncp usr.bin/ncplist usr.bin/ncplogin usr.sbin/mount_nwfs From: Davide Italiano To: Joel Dahl Content-Type: text/plain; charset=ISO-8859-1 Cc: Attilio Rao , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 16:47:17 -0000 On Sat, Mar 9, 2013 at 5:29 PM, Joel Dahl wrote: > On Sat, Mar 09, 2013 at 04:17:56PM +0100, Attilio Rao wrote: >> On Sat, Mar 9, 2013 at 4:02 PM, Robert Watson wrote: >> > Hi Attilio: >> > >> > It's really great to see the continued progress towards the goal >> > entirely-MPSAFE VFS in 10.x -- we owe you a huge vote of thanks for pursuing >> > this! >> >> Thanks for the kind words. >> >> The VFS can be considered completely MPSAFE by date, the only >> remaining thing to do is sweeping out smbfs/netsmb. >> However a known FreeBSD shops has patches to make smbfs MPSAFE and I'd >> rather give them more time to commit them and re-add smbfs as a MPSAFE >> filesystem rather than get into their way and remove the support. > > Have they given you any ETA for this? 10.0 is approaching ... :-) > > -- > Joel I'm working on this right now and should be addressed in few days. Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 16:58:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C53E576; Sat, 9 Mar 2013 16:58:20 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F07AFE2; Sat, 9 Mar 2013 16:58:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29GwKEt030989; Sat, 9 Mar 2013 16:58:20 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29GwKaW030988; Sat, 9 Mar 2013 16:58:20 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303091658.r29GwKaW030988@svn.freebsd.org> From: Davide Italiano Date: Sat, 9 Mar 2013 16:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248109 - head/sys/netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 16:58:20 -0000 Author: davide Date: Sat Mar 9 16:58:19 2013 New Revision: 248109 URL: http://svnweb.freebsd.org/changeset/base/248109 Log: Call make_dev_credf() rather than using the couple make_dev()/dev_ref(). This closes a race with clone_cleanup(). Modified: head/sys/netsmb/smb_dev.c Modified: head/sys/netsmb/smb_dev.c ============================================================================== --- head/sys/netsmb/smb_dev.c Sat Mar 9 16:11:29 2013 (r248108) +++ head/sys/netsmb/smb_dev.c Sat Mar 9 16:58:19 2013 (r248109) @@ -107,14 +107,9 @@ nsmb_dev_clone(void *arg, struct ucred * else if (dev_stdclone(name, NULL, NSMB_NAME, &u) != 1) return; i = clone_create(&nsmb_clones, &nsmb_cdevsw, &u, dev, 0); - if (i) { - *dev = make_dev(&nsmb_cdevsw, u, UID_ROOT, GID_WHEEL, 0600, - "%s%d", NSMB_NAME, u); - if (*dev != NULL) { - dev_ref(*dev); - (*dev)->si_flags |= SI_CHEAPCLONE; - } - } + if (i) + *dev = make_dev_credf(MAKEDEV_REF, &nsmb_cdevsw, u, cred, + UID_ROOT, GID_WHEEL, 0600, "%s%d", NSMB_NAME, u); } static int From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 20:01:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2F879CF5; Sat, 9 Mar 2013 20:01:36 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DCCC80C; Sat, 9 Mar 2013 20:01:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29K1Z0J088875; Sat, 9 Mar 2013 20:01:35 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29K1ZS9088874; Sat, 9 Mar 2013 20:01:35 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303092001.r29K1ZS9088874@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 9 Mar 2013 20:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248112 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 20:01:36 -0000 Author: melifaro Date: Sat Mar 9 20:01:35 2013 New Revision: 248112 URL: http://svnweb.freebsd.org/changeset/base/248112 Log: Document netstat -Q flags meaning. MFC after: 1 week Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Sat Mar 9 18:40:37 2013 (r248111) +++ head/usr.bin/netstat/netstat.1 Sat Mar 9 20:01:35 2013 (r248112) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd February 22, 2010 +.Dd March 10, 2013 .Dt NETSTAT 1 .Os .Sh NAME @@ -301,6 +301,11 @@ is repeated, counters with a value of ze Show .Xr netisr 9 statistics. +The flags field shows available ISR handlers: +.Bl -column ".Li W" ".Dv NETISR_SNP_FLAGS_DRAINEDCPU" +.It Li C Ta Dv NETISR_SNP_FLAGS_M2CPUID Ta "Able to map mbuf to cpu id" +.It Li D Ta Dv NETISR_SNP_FLAGS_DRAINEDCPU Ta "Has queue drain handler" +.It Li F Ta Dv NETISR_SNP_FLAGS_M2FLOW Ta "Able to map mbuf to flow id" .El .Pp Some options have the general meaning: From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 20:03:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 657B6E7A; Sat, 9 Mar 2013 20:03:11 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53E7381B; Sat, 9 Mar 2013 20:03:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29K3B9W089196; Sat, 9 Mar 2013 20:03:11 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29K3BPc089195; Sat, 9 Mar 2013 20:03:11 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303092003.r29K3BPc089195@svn.freebsd.org> From: Davide Italiano Date: Sat, 9 Mar 2013 20:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248113 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 20:03:11 -0000 Author: davide Date: Sat Mar 9 20:03:10 2013 New Revision: 248113 URL: http://svnweb.freebsd.org/changeset/base/248113 Log: Fixup r248032: Change size requested to malloc(9) now that callwheel buckets are callout_list and not callout_tailq anymore. This change was already there but it seems it got lost after code churn in r248032. Reported by: alc, kib Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sat Mar 9 20:01:35 2013 (r248112) +++ head/sys/kern/kern_timeout.c Sat Mar 9 20:03:10 2013 (r248113) @@ -294,7 +294,7 @@ callout_cpu_init(struct callout_cpu *cc) mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); SLIST_INIT(&cc->cc_callfree); - cc->cc_callwheel = malloc(sizeof(struct callout_tailq) * callwheelsize, + cc->cc_callwheel = malloc(sizeof(struct callout_list) * callwheelsize, M_CALLOUT, M_WAITOK); for (i = 0; i < callwheelsize; i++) LIST_INIT(&cc->cc_callwheel[i]); From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 20:04:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C5229187; Sat, 9 Mar 2013 20:04:47 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B36DA831; Sat, 9 Mar 2013 20:04:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29K4lej089498; Sat, 9 Mar 2013 20:04:47 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29K4lk7089497; Sat, 9 Mar 2013 20:04:47 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303092004.r29K4lk7089497@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 9 Mar 2013 20:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248114 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 20:04:47 -0000 Author: melifaro Date: Sat Mar 9 20:04:47 2013 New Revision: 248114 URL: http://svnweb.freebsd.org/changeset/base/248114 Log: Add forgotten .El MFC with: r248112 Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Sat Mar 9 20:03:10 2013 (r248113) +++ head/usr.bin/netstat/netstat.1 Sat Mar 9 20:04:47 2013 (r248114) @@ -307,6 +307,7 @@ The flags field shows available ISR hand .It Li D Ta Dv NETISR_SNP_FLAGS_DRAINEDCPU Ta "Has queue drain handler" .It Li F Ta Dv NETISR_SNP_FLAGS_M2FLOW Ta "Able to map mbuf to flow id" .El +.El .Pp Some options have the general meaning: .Bl -tag -width flag From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 21:21:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EC1C5222; Sat, 9 Mar 2013 21:21:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE953A78; Sat, 9 Mar 2013 21:21:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29LLUB8013470; Sat, 9 Mar 2013 21:21:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29LLUkV013469; Sat, 9 Mar 2013 21:21:30 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201303092121.r29LLUkV013469@svn.freebsd.org> From: Glen Barber Date: Sat, 9 Mar 2013 21:21:30 +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: r248115 - stable/9/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 21:21:31 -0000 Author: gjb (doc,ports committer) Date: Sat Mar 9 21:21:30 2013 New Revision: 248115 URL: http://svnweb.freebsd.org/changeset/base/248115 Log: Update ports count and size in sysinstall(8). This is a direct commit to stable/9. Submitted by: ryusuke Approved by: kib (implicit) Modified: stable/9/usr.sbin/sysinstall/dist.c Modified: stable/9/usr.sbin/sysinstall/dist.c ============================================================================== --- stable/9/usr.sbin/sysinstall/dist.c Sat Mar 9 20:04:47 2013 (r248114) +++ stable/9/usr.sbin/sysinstall/dist.c Sat Mar 9 21:21:30 2013 (r248115) @@ -280,8 +280,8 @@ distMaybeSetPorts(dialogMenuItem *self) { dialog_clear_norefresh(); if (!msgYesNo("Would you like to install the FreeBSD ports collection?\n\n" - "This will give you ready access to over 19,000 ported software packages,\n" - "at a cost of around 445MB of disk space when \"clean\" and possibly\n" + "This will give you ready access to over 24,000 ported software packages,\n" + "at a cost of around 500MB of disk space when \"clean\" and possibly\n" "much more than that when a lot of the distribution tarballs are loaded\n" "(unless you have the extra discs available from a FreeBSD CD/DVD distribution\n" "and can mount them on /cdrom, in which case this is far less of a problem).\n\n" From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 21:21:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EE3BD37E; Sat, 9 Mar 2013 21:21:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0FE7A7A; Sat, 9 Mar 2013 21:21:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29LLlOY013537; Sat, 9 Mar 2013 21:21:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29LLlH3013536; Sat, 9 Mar 2013 21:21:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201303092121.r29LLlH3013536@svn.freebsd.org> From: Glen Barber Date: Sat, 9 Mar 2013 21:21:47 +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: r248116 - stable/8/usr.sbin/sysinstall 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 21:21:48 -0000 Author: gjb (doc,ports committer) Date: Sat Mar 9 21:21:47 2013 New Revision: 248116 URL: http://svnweb.freebsd.org/changeset/base/248116 Log: Update ports count and size in sysinstall(8). This is a direct commit to stable/8. Submitted by: ryusuke Approved by: re (kib) Modified: stable/8/usr.sbin/sysinstall/dist.c Modified: stable/8/usr.sbin/sysinstall/dist.c ============================================================================== --- stable/8/usr.sbin/sysinstall/dist.c Sat Mar 9 21:21:30 2013 (r248115) +++ stable/8/usr.sbin/sysinstall/dist.c Sat Mar 9 21:21:47 2013 (r248116) @@ -289,8 +289,8 @@ distMaybeSetPorts(dialogMenuItem *self) { dialog_clear_norefresh(); if (!msgYesNo("Would you like to install the FreeBSD ports collection?\n\n" - "This will give you ready access to over 19,000 ported software packages,\n" - "at a cost of around 445MB of disk space when \"clean\" and possibly\n" + "This will give you ready access to over 24,000 ported software packages,\n" + "at a cost of around 500MB of disk space when \"clean\" and possibly\n" "much more than that when a lot of the distribution tarballs are loaded\n" "(unless you have the extra discs available from a FreeBSD CD/DVD distribution\n" "and can mount them on /cdrom, in which case this is far less of a problem).\n\n" From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 21:32:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6F79B46; Sat, 9 Mar 2013 21:32:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D01CDAE8; Sat, 9 Mar 2013 21:32:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29LWOm1016888; Sat, 9 Mar 2013 21:32:24 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29LWOLR016887; Sat, 9 Mar 2013 21:32:24 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201303092132.r29LWOLR016887@svn.freebsd.org> From: Alan Cox Date: Sat, 9 Mar 2013 21:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248117 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 21:32:25 -0000 Author: alc Date: Sat Mar 9 21:32:24 2013 New Revision: 248117 URL: http://svnweb.freebsd.org/changeset/base/248117 Log: Update a comment: The object lock is no longer a mutex. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Mar 9 21:21:47 2013 (r248116) +++ head/sys/vm/vm_page.c Sat Mar 9 21:32:24 2013 (r248117) @@ -73,7 +73,7 @@ * * The page daemon can acquire and hold any pair of page queue * locks in any order. * - * - The object mutex is held when inserting or removing + * - The object lock is required when inserting or removing * pages from an object (vm_page_insert() or vm_page_remove()). * */ From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 23:05:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9B41D32; Sat, 9 Mar 2013 23:05:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9E02EA5; Sat, 9 Mar 2013 23:05:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29N5KoH045847; Sat, 9 Mar 2013 23:05:20 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29N5KWW045846; Sat, 9 Mar 2013 23:05:20 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201303092305.r29N5KWW045846@svn.freebsd.org> From: Ian Lepore Date: Sat, 9 Mar 2013 23:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248118 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 23:05:21 -0000 Author: ian Date: Sat Mar 9 23:05:19 2013 New Revision: 248118 URL: http://svnweb.freebsd.org/changeset/base/248118 Log: Since ubldr doesn't necessarily load a kernel at the physical address in the elf headers, mask out the high nibble of that address. This effectly makes the entry point the offset from the load address, and it gets adjusted for the actual load address before jumping to it. Masking the high nibble makes assumptions about memory layout that are true for all the arm platforms we support right now, but it makes me uneasy. This needs to be revisited. Modified: head/sys/boot/common/load_elf.c Modified: head/sys/boot/common/load_elf.c ============================================================================== --- head/sys/boot/common/load_elf.c Sat Mar 9 21:32:24 2013 (r248117) +++ head/sys/boot/common/load_elf.c Sat Mar 9 23:05:19 2013 (r248118) @@ -297,15 +297,16 @@ __elfN(loadimage)(struct preloaded_file * the MI code below uses the p_vaddr fields with an offset added for * loading (doing so is arguably wrong). To make loading work, we need * an offset that represents the difference between physical and virtual - * addressing. ARM kernels are always linked at 0xC0000000. Depending + * addressing. ARM kernels are always linked at 0xCnnnnnnn. Depending * on the headers, the offset value passed in may be physical or virtual * (because it typically comes from e_entry), but we always replace * whatever is passed in with the va<->pa offset. On the other hand, we - * only adjust the entry point if it's a virtual address to begin with. + * always remove the high-order part of the entry address whether it's + * physical or virtual, because it will be adjusted later for the actual + * physical entry point based on where the image gets loaded. */ - off = -0xc0000000u; - if ((ehdr->e_entry & 0xc0000000u) == 0xc0000000u) - ehdr->e_entry += off; + off = -0xc0000000; + ehdr->e_entry &= ~0xf0000000; #ifdef ELF_VERBOSE printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", ehdr->e_entry, off); #endif From owner-svn-src-all@FreeBSD.ORG Sat Mar 9 23:55:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6D639E4E; Sat, 9 Mar 2013 23:55:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC4213F; Sat, 9 Mar 2013 23:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29NtOuR061571; Sat, 9 Mar 2013 23:55:24 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29NtORC061569; Sat, 9 Mar 2013 23:55:24 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201303092355.r29NtORC061569@svn.freebsd.org> From: Andrew Turner Date: Sat, 9 Mar 2013 23:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248119 - 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 23:55:24 -0000 Author: andrew Date: Sat Mar 9 23:55:23 2013 New Revision: 248119 URL: http://svnweb.freebsd.org/changeset/base/248119 Log: __FreeBSD_ARCH_armv6__ is undefined on clang. We can use __ARM_ARCH in it's place. This makes 'uname -p' correctly output 'armv6' on a kernel built with clang. Modified: head/sys/arm/arm/disassem.c head/sys/arm/include/param.h Modified: head/sys/arm/arm/disassem.c ============================================================================== --- head/sys/arm/arm/disassem.c Sat Mar 9 23:05:19 2013 (r248118) +++ head/sys/arm/arm/disassem.c Sat Mar 9 23:55:23 2013 (r248119) @@ -130,7 +130,7 @@ static const struct arm32_insn arm32_i[] { 0x0c500000, 0x04100000, "ldr", "daW" }, { 0x0c500000, 0x04400000, "strb", "daW" }, { 0x0c500000, 0x04500000, "ldrb", "daW" }, -#ifdef __FreeBSD_ARCH_armv6__ +#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) { 0xffffffff, 0xf57ff01f, "clrex", "c" }, { 0x0ff00ff0, 0x01800f90, "strex", "dmo" }, { 0x0ff00fff, 0x01900f9f, "ldrex", "do" }, Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Sat Mar 9 23:05:19 2013 (r248118) +++ head/sys/arm/include/param.h Sat Mar 9 23:55:23 2013 (r248119) @@ -56,7 +56,7 @@ #define MACHINE "arm" #endif #ifndef MACHINE_ARCH -#ifdef __FreeBSD_ARCH_armv6__ +#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) #ifdef __ARMEB__ #define MACHINE_ARCH "armv6eb" #else