From owner-svn-src-stable-10@FreeBSD.ORG Sun Nov 30 10:36:30 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ED18BB8; Sun, 30 Nov 2014 10:36:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A343240; Sun, 30 Nov 2014 10:36:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUAaUHR089707; Sun, 30 Nov 2014 10:36:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUAaUZ6089706; Sun, 30 Nov 2014 10:36:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411301036.sAUAaUZ6089706@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 30 Nov 2014 10:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275310 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 10:36:30 -0000 Author: trasz Date: Sun Nov 30 10:36:29 2014 New Revision: 275310 URL: https://svnweb.freebsd.org/changeset/base/275310 Log: MFC r273918: Change the default log level for iSCSI target from 3 to 1. It should have been 1 from the beginning; not sure how it ended up at 3. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sun Nov 30 10:01:47 2014 (r275309) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sun Nov 30 10:36:29 2014 (r275310) @@ -84,7 +84,7 @@ static uma_zone_t cfiscsi_data_wait_zone SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0, "CAM Target Layer iSCSI Frontend"); -static int debug = 3; +static int debug = 1; TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug); SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); From owner-svn-src-stable-10@FreeBSD.ORG Mon Dec 1 02:59:06 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01EB97F2; Mon, 1 Dec 2014 02:59:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E26C28CE; Mon, 1 Dec 2014 02:59:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB12x5rr047560; Mon, 1 Dec 2014 02:59:05 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB12x5UA047559; Mon, 1 Dec 2014 02:59:05 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201412010259.sB12x5UA047559@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 1 Dec 2014 02:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275348 - stable/10/usr.bin/dc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 02:59:06 -0000 Author: kevlo Date: Mon Dec 1 02:59:05 2014 New Revision: 275348 URL: https://svnweb.freebsd.org/changeset/base/275348 Log: MFC r275162: Init array field in the proper place. Obtained from: OpenBSD Modified: stable/10/usr.bin/dc/stack.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/dc/stack.c ============================================================================== --- stable/10/usr.bin/dc/stack.c Sun Nov 30 20:20:55 2014 (r275347) +++ stable/10/usr.bin/dc/stack.c Mon Dec 1 02:59:05 2014 (r275348) @@ -137,14 +137,12 @@ stack_swap(struct stack *stack) static void stack_grow(struct stack *stack) { - size_t i, new_size; + size_t new_size; if (++stack->sp == stack->size) { new_size = stack->size * 2 + 1; stack->stack = brealloc(stack->stack, new_size * sizeof(*stack->stack)); - for (i = stack->size; i < new_size; i++) - stack->stack[i].array = NULL; stack->size = new_size; } } @@ -156,6 +154,7 @@ stack_pushnumber(struct stack *stack, st stack_grow(stack); stack->stack[stack->sp].type = BCODE_NUMBER; stack->stack[stack->sp].u.num = b; + stack->stack[stack->sp].array = NULL; } void @@ -165,6 +164,7 @@ stack_pushstring(struct stack *stack, ch stack_grow(stack); stack->stack[stack->sp].type = BCODE_STRING; stack->stack[stack->sp].u.string = string; + stack->stack[stack->sp].array = NULL; } void From owner-svn-src-stable-10@FreeBSD.ORG Mon Dec 1 03:04:16 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B677EC59; Mon, 1 Dec 2014 03:04:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3DEA90; Mon, 1 Dec 2014 03:04:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB134GAc053051; Mon, 1 Dec 2014 03:04:16 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB134GSE053049; Mon, 1 Dec 2014 03:04:16 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201412010304.sB134GSE053049@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 1 Dec 2014 03:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275350 - stable/10/sys/contrib/dev/ral X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 03:04:16 -0000 Author: kevlo Date: Mon Dec 1 03:04:15 2014 New Revision: 275350 URL: https://svnweb.freebsd.org/changeset/base/275350 Log: MFC r275003: Add missing headers needed by write(). Modified: stable/10/sys/contrib/dev/ral/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/dev/ral/Makefile ============================================================================== --- stable/10/sys/contrib/dev/ral/Makefile Mon Dec 1 03:01:01 2014 (r275349) +++ stable/10/sys/contrib/dev/ral/Makefile Mon Dec 1 03:04:15 2014 (r275350) @@ -3,7 +3,8 @@ FILES= rt2561s.fw.uu rt2561.fw.uu rt2661.fw.uu rt2860.fw.uu rt2561s.fw.uu: microcode.h LICENSE - (echo '#include '; \ + (echo '#include '; \ + echo '#include '; \ cat microcode.h; \ echo 'int main(void) { \ write(1, rt2561s, sizeof(rt2561s)); return 0; \ @@ -11,7 +12,8 @@ rt2561s.fw.uu: microcode.h LICENSE (sed 's/^/# /' LICENSE; ./build | uuencode rt2561s.fw) > ${.TARGET} rt2561.fw.uu: microcode.h LICENSE - (echo '#include '; \ + (echo '#include '; \ + echo '#include '; \ cat microcode.h; \ echo 'int main(void) { \ write(1, rt2561, sizeof(rt2561)); return 0; \ @@ -19,7 +21,8 @@ rt2561.fw.uu: microcode.h LICENSE (sed 's/^/# /' LICENSE; ./build | uuencode rt2561.fw) > ${.TARGET} rt2661.fw.uu: microcode.h LICENSE - (echo '#include '; \ + (echo '#include '; \ + echo '#include '; \ cat microcode.h; \ echo 'int main(void) { \ write(1, rt2661, sizeof(rt2661)); return 0; \ @@ -27,7 +30,8 @@ rt2661.fw.uu: microcode.h LICENSE (sed 's/^/# /' LICENSE; ./build | uuencode rt2661.fw) > ${.TARGET} rt2860.fw.uu: microcode.h LICENSE - (echo '#include '; \ + (echo '#include '; \ + echo '#include '; \ cat microcode.h; \ echo 'int main(void) { \ write(1, rt2860, sizeof(rt2860)); return 0; \ From owner-svn-src-stable-10@FreeBSD.ORG Mon Dec 1 07:34:26 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9845A02; Mon, 1 Dec 2014 07:34:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A939E84; Mon, 1 Dec 2014 07:34:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB17YQTG076236; Mon, 1 Dec 2014 07:34:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB17YQ0H076235; Mon, 1 Dec 2014 07:34:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412010734.sB17YQ0H076235@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 1 Dec 2014 07:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275351 - stable/10/sys/dev/sound/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 07:34:26 -0000 Author: hselasky Date: Mon Dec 1 07:34:25 2014 New Revision: 275351 URL: https://svnweb.freebsd.org/changeset/base/275351 Log: MFC r274918: Don't use the synchronization endpoint unless referenced by the isochronous endpoint descriptor used for the data transfers, hence the synchronization feature might not be supposed to be supported [yet]. This makes seamless playback synced with the USB HOST clock work with the DN32-USB module for Midas audio systems and possibly other similar products from Klark Teknik. Modified: stable/10/sys/dev/sound/usb/uaudio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.c Mon Dec 1 03:04:15 2014 (r275350) +++ stable/10/sys/dev/sound/usb/uaudio.c Mon Dec 1 07:34:25 2014 (r275351) @@ -195,6 +195,7 @@ struct uaudio_chan_alt { uint8_t iface_index; uint8_t iface_alt_index; uint8_t channels; + uint8_t enable_sync; }; struct uaudio_chan { @@ -1804,6 +1805,14 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; + if (UEP_HAS_SYNCADDR(ed1) && ed1->bSynchAddress != 0) { + DPRINTF("Sync endpoint will be used, if present\n"); + chan_alt->enable_sync = 1; + } else { + DPRINTF("Sync endpoint will not be used\n"); + chan_alt->enable_sync = 0; + } + usbd_set_parent_iface(sc->sc_udev, curidx, sc->sc_mixer_iface_index); @@ -2080,8 +2089,10 @@ tr_transferred: chn_intr(ch->pcm_ch); /* start SYNC transfer, if any */ - if ((ch->last_sync_time++ & 7) == 0) - usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + if (ch->usb_alt[ch->cur_alt].enable_sync != 0) { + if ((ch->last_sync_time++ & 7) == 0) + usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + } case USB_ST_SETUP: mfl = usbd_xfer_max_framelen(xfer); From owner-svn-src-stable-10@FreeBSD.ORG Tue Dec 2 11:47:28 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE72F9B4; Tue, 2 Dec 2014 11:47:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FF7DCC4; Tue, 2 Dec 2014 11:47:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2BlSvg075661; Tue, 2 Dec 2014 11:47:28 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2BlR8T075654; Tue, 2 Dec 2014 11:47:27 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201412021147.sB2BlR8T075654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Tue, 2 Dec 2014 11:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275402 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 11:47:28 -0000 Author: jch Date: Tue Dec 2 11:47:26 2014 New Revision: 275402 URL: https://svnweb.freebsd.org/changeset/base/275402 Log: MFC r264321, r264342, r264351, r264356, r273850, r274629: Currently, the TCP slow timer can starve TCP input processing while it walks the list of connections in TIME_WAIT closing expired connections due to contention on the global TCP pcbinfo lock. To remediate, introduce a new global lock to protect the list of connections in TIME_WAIT. Only acquire the TCP pcbinfo lock when closing an expired connection. This limits the window of time when TCP input processing is stopped to the amount of time needed to close a single connection. Approved by: jhb (mentor) Modified: stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h stable/10/sys/netinet/tcp_timewait.c stable/10/sys/netinet/tcp_usrreq.c stable/10/sys/netinet/tcp_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_timer.c ============================================================================== --- stable/10/sys/netinet/tcp_timer.c Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_timer.c Tue Dec 2 11:47:26 2014 (r275402) @@ -195,9 +195,7 @@ tcp_slowtimo(void) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - INP_INFO_WLOCK(&V_tcbinfo); (void) tcp_tw_2msl_scan(0); - INP_INFO_WUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); Modified: stable/10/sys/netinet/tcp_timer.h ============================================================================== --- stable/10/sys/netinet/tcp_timer.h Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_timer.h Tue Dec 2 11:47:26 2014 (r275402) @@ -178,7 +178,7 @@ extern int tcp_fast_finwait2_recycle; void tcp_timer_init(void); void tcp_timer_2msl(void *xtp); struct tcptw * - tcp_tw_2msl_scan(int _reuse); /* XXX temporary */ + tcp_tw_2msl_scan(int reuse); /* XXX temporary? */ void tcp_timer_keep(void *xtp); void tcp_timer_persist(void *xtp); void tcp_timer_rexmt(void *xtp); Modified: stable/10/sys/netinet/tcp_timewait.c ============================================================================== --- stable/10/sys/netinet/tcp_timewait.c Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_timewait.c Tue Dec 2 11:47:26 2014 (r275402) @@ -91,20 +91,40 @@ __FBSDID("$FreeBSD$"); #include static VNET_DEFINE(uma_zone_t, tcptw_zone); -#define V_tcptw_zone VNET(tcptw_zone) +#define V_tcptw_zone VNET(tcptw_zone) static int maxtcptw; /* * The timed wait queue contains references to each of the TCP sessions * currently in the TIME_WAIT state. The queue pointers, including the * queue pointers in each tcptw structure, are protected using the global - * tcbinfo lock, which must be held over queue iteration and modification. + * timewait lock, which must be held over queue iteration and modification. + * + * Rules on tcptw usage: + * - a inpcb is always freed _after_ its tcptw + * - a tcptw relies on its inpcb reference counting for memory stability + * - a tcptw is dereferenceable only while its inpcb is locked */ static VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl); -#define V_twq_2msl VNET(twq_2msl) +#define V_twq_2msl VNET(twq_2msl) + +/* Global timewait lock */ +static VNET_DEFINE(struct rwlock, tw_lock); +#define V_tw_lock VNET(tw_lock) + +#define TW_LOCK_INIT(tw, d) rw_init_flags(&(tw), (d), 0) +#define TW_LOCK_DESTROY(tw) rw_destroy(&(tw)) +#define TW_RLOCK(tw) rw_rlock(&(tw)) +#define TW_WLOCK(tw) rw_wlock(&(tw)) +#define TW_RUNLOCK(tw) rw_runlock(&(tw)) +#define TW_WUNLOCK(tw) rw_wunlock(&(tw)) +#define TW_LOCK_ASSERT(tw) rw_assert(&(tw), RA_LOCKED) +#define TW_RLOCK_ASSERT(tw) rw_assert(&(tw), RA_RLOCKED) +#define TW_WLOCK_ASSERT(tw) rw_assert(&(tw), RA_WLOCKED) +#define TW_UNLOCK_ASSERT(tw) rw_assert(&(tw), RA_UNLOCKED) static void tcp_tw_2msl_reset(struct tcptw *, int); -static void tcp_tw_2msl_stop(struct tcptw *); +static void tcp_tw_2msl_stop(struct tcptw *, int); static int tcp_twrespond(struct tcptw *, int); static int @@ -172,6 +192,7 @@ tcp_tw_init(void) else uma_zone_set_max(V_tcptw_zone, maxtcptw); TAILQ_INIT(&V_twq_2msl); + TW_LOCK_INIT(V_tw_lock, "tcptw"); } #ifdef VIMAGE @@ -181,10 +202,11 @@ tcp_tw_destroy(void) struct tcptw *tw; INP_INFO_WLOCK(&V_tcbinfo); - while((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL) + while ((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL) tcp_twclose(tw, 0); INP_INFO_WUNLOCK(&V_tcbinfo); + TW_LOCK_DESTROY(V_tw_lock); uma_zdestroy(V_tcptw_zone); } #endif @@ -205,7 +227,7 @@ tcp_twstart(struct tcpcb *tp) int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6; #endif - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* tcp_tw_2msl_reset(). */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); if (V_nolocaltimewait) { @@ -230,6 +252,14 @@ tcp_twstart(struct tcpcb *tp) tw = uma_zalloc(V_tcptw_zone, M_NOWAIT); if (tw == NULL) { + /* + * Reached limit on total number of TIMEWAIT connections + * allowed. Remove a connection from TIMEWAIT queue in LRU + * fashion to make room for this connection. + * + * pcbinfo lock is needed here to prevent deadlock as + * two inpcb locks can be acquired simultaneously. + */ tw = tcp_tw_2msl_scan(1); if (tw == NULL) { tp = tcp_close(tp); @@ -238,7 +268,12 @@ tcp_twstart(struct tcpcb *tp) return; } } + /* + * The tcptw will hold a reference on its inpcb until tcp_twclose + * is called + */ tw->tw_inpcb = inp; + in_pcbref(inp); /* Reference from tw */ /* * Recover last window size sent. @@ -321,7 +356,7 @@ tcp_twstart(struct tcpcb *tp) * Most other new OSes use semi-randomized ISN values, so we * do not need to worry about them. */ -#define MS_ISN_BYTES_PER_SECOND 250000 +#define MS_ISN_BYTES_PER_SECOND 250000 /* * Determine if the ISN we will generate has advanced beyond the last @@ -357,7 +392,6 @@ tcp_twcheck(struct inpcb *inp, struct tc int thflags; tcp_seq seq; - /* tcbinfo lock required for tcp_twclose(), tcp_tw_2msl_reset(). */ INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); @@ -459,11 +493,10 @@ tcp_twclose(struct tcptw *tw, int reuse) inp = tw->tw_inpcb; KASSERT((inp->inp_flags & INP_TIMEWAIT), ("tcp_twclose: !timewait")); KASSERT(intotw(inp) == tw, ("tcp_twclose: inp_ppcb != tw")); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* tcp_tw_2msl_stop(). */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* in_pcbfree() */ INP_WLOCK_ASSERT(inp); - tw->tw_inpcb = NULL; - tcp_tw_2msl_stop(tw); + tcp_tw_2msl_stop(tw, reuse); inp->inp_ppcb = NULL; in_pcbdrop(inp); @@ -492,14 +525,14 @@ tcp_twclose(struct tcptw *tw, int reuse) */ INP_WUNLOCK(inp); } - } else + } else { + /* + * The socket has been already cleaned-up for us, only free the + * inpcb. + */ in_pcbfree(inp); + } TCPSTAT_INC(tcps_closed); - crfree(tw->tw_cred); - tw->tw_cred = NULL; - if (reuse) - return; - uma_zfree(V_tcptw_zone, tw); } static int @@ -617,34 +650,106 @@ tcp_tw_2msl_reset(struct tcptw *tw, int INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tw->tw_inpcb); + + TW_WLOCK(V_tw_lock); if (rearm) TAILQ_REMOVE(&V_twq_2msl, tw, tw_2msl); tw->tw_time = ticks + 2 * tcp_msl; TAILQ_INSERT_TAIL(&V_twq_2msl, tw, tw_2msl); + TW_WUNLOCK(V_tw_lock); } static void -tcp_tw_2msl_stop(struct tcptw *tw) +tcp_tw_2msl_stop(struct tcptw *tw, int reuse) { + struct ucred *cred; + struct inpcb *inp; + int released; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + + TW_WLOCK(V_tw_lock); + inp = tw->tw_inpcb; + tw->tw_inpcb = NULL; + TAILQ_REMOVE(&V_twq_2msl, tw, tw_2msl); + cred = tw->tw_cred; + tw->tw_cred = NULL; + TW_WUNLOCK(V_tw_lock); + + if (cred != NULL) + crfree(cred); + + released = in_pcbrele_wlocked(inp); + KASSERT(!released, ("%s: inp should not be released here", __func__)); + + if (!reuse) + uma_zfree(V_tcptw_zone, tw); } struct tcptw * tcp_tw_2msl_scan(int reuse) { struct tcptw *tw; + struct inpcb *inp; + +#ifdef INVARIANTS + if (reuse) { + /* + * pcbinfo lock is needed in reuse case to prevent deadlock + * as two inpcb locks can be acquired simultaneously: + * - the inpcb transitioning to TIME_WAIT state in + * tcp_tw_start(), + * - the inpcb closed by tcp_twclose(). + */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + } +#endif - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); for (;;) { + TW_RLOCK(V_tw_lock); tw = TAILQ_FIRST(&V_twq_2msl); - if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) + if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) { + TW_RUNLOCK(V_tw_lock); + break; + } + KASSERT(tw->tw_inpcb != NULL, ("%s: tw->tw_inpcb == NULL", + __func__)); + + inp = tw->tw_inpcb; + in_pcbref(inp); + TW_RUNLOCK(V_tw_lock); + + if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { + + INP_WLOCK(inp); + tw = intotw(inp); + if (in_pcbrele_wlocked(inp)) { + KASSERT(tw == NULL, ("%s: held last inp " + "reference but tw not NULL", __func__)); + INP_INFO_WUNLOCK(&V_tcbinfo); + continue; + } + + if (tw == NULL) { + /* tcp_twclose() has already been called */ + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + continue; + } + + tcp_twclose(tw, reuse); + INP_INFO_WUNLOCK(&V_tcbinfo); + if (reuse) + return tw; + } else { + /* INP_INFO lock is busy, continue later. */ + INP_WLOCK(inp); + if (!in_pcbrele_wlocked(inp)) + INP_WUNLOCK(inp); break; - INP_WLOCK(tw->tw_inpcb); - tcp_twclose(tw, reuse); - if (reuse) - return (tw); + } } - return (NULL); + + return NULL; } Modified: stable/10/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/10/sys/netinet/tcp_usrreq.c Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_usrreq.c Tue Dec 2 11:47:26 2014 (r275402) @@ -182,6 +182,21 @@ tcp_detach(struct socket *so, struct inp * present until timewait ends. * * XXXRW: Would it be cleaner to free the tcptw here? + * + * Astute question indeed, from twtcp perspective there are + * three cases to consider: + * + * #1 tcp_detach is called at tcptw creation time by + * tcp_twstart, then do not discard the newly created tcptw + * and leave inpcb present until timewait ends + * #2 tcp_detach is called at timewait end (or reuse) by + * tcp_twclose, then the tcptw has already been discarded + * and inpcb is freed here + * #3 tcp_detach is called() after timewait ends (or reuse) + * (e.g. by soclose), then tcptw has already been discarded + * and inpcb is freed here + * + * In all three cases the tcptw should not be freed here. */ if (inp->inp_flags & INP_DROPPED) { KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " Modified: stable/10/sys/netinet/tcp_var.h ============================================================================== --- stable/10/sys/netinet/tcp_var.h Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_var.h Tue Dec 2 11:47:26 2014 (r275402) @@ -663,7 +663,7 @@ void tcp_twstart(struct tcpcb *); #if 0 int tcp_twrecycleable(struct tcptw *tw); #endif -void tcp_twclose(struct tcptw *_tw, int _reuse); +void tcp_twclose(struct tcptw *, int); void tcp_ctlinput(int, struct sockaddr *, void *); int tcp_ctloutput(struct socket *, struct sockopt *); struct tcpcb * From owner-svn-src-stable-10@FreeBSD.ORG Tue Dec 2 13:46:16 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 708E848C; Tue, 2 Dec 2014 13:46:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B9B2B72; Tue, 2 Dec 2014 13:46:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2DkG2E032681; Tue, 2 Dec 2014 13:46:16 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2DkEDX032671; Tue, 2 Dec 2014 13:46:14 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201412021346.sB2DkEDX032671@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 2 Dec 2014 13:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275406 - stable/10/sys/dev/agp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 13:46:16 -0000 Author: tijl Date: Tue Dec 2 13:46:13 2014 New Revision: 275406 URL: https://svnweb.freebsd.org/changeset/base/275406 Log: MFC r273856,273863,273963-273965 - Add two new functions to the AGP driver KPI to bind/unbind arbitrary sets of pages into the GTT. - Avoid possible overflow in agp_generic_alloc_memory. - In agp(4) avoid the need to flush all cpu caches with wbinvd between updating the GTT and flushing the AGP TLB by storing the GTT in write-combining memory. - In agp_amd_bind_page don't flush the AGP TLB. It's done by the calling function. - agp_generic_unbind_memory: flush AGP TLB before unwiring pages agp_bind_pages: assert that pages have been wired down Modified: stable/10/sys/dev/agp/agp.c stable/10/sys/dev/agp/agp_amd.c stable/10/sys/dev/agp/agp_amd64.c stable/10/sys/dev/agp/agp_apple.c stable/10/sys/dev/agp/agp_ati.c stable/10/sys/dev/agp/agp_i810.c stable/10/sys/dev/agp/agppriv.h stable/10/sys/dev/agp/agpvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/agp/agp.c ============================================================================== --- stable/10/sys/dev/agp/agp.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp.c Tue Dec 2 13:46:13 2014 (r275406) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -84,14 +86,6 @@ static devclass_t agp_devclass; /* Helper functions for implementing chipset mini drivers. */ -void -agp_flush_cache() -{ -#if defined(__i386__) || defined(__amd64__) - wbinvd(); -#endif -} - u_int8_t agp_find_caps(device_t dev) { @@ -158,17 +152,16 @@ agp_alloc_gatt(device_t dev) return 0; gatt->ag_entries = entries; - gatt->ag_virtual = contigmalloc(entries * sizeof(u_int32_t), M_AGP, 0, - 0, ~0, PAGE_SIZE, 0); + gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, + 0, VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_virtual) { if (bootverbose) device_printf(dev, "contiguous allocation failed\n"); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_virtual, entries * sizeof(u_int32_t)); gatt->ag_physical = vtophys((vm_offset_t) gatt->ag_virtual); - agp_flush_cache(); return gatt; } @@ -176,8 +169,8 @@ agp_alloc_gatt(device_t dev) void agp_free_gatt(struct agp_gatt *gatt) { - contigfree(gatt->ag_virtual, - gatt->ag_entries * sizeof(u_int32_t), M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + gatt->ag_entries * sizeof(u_int32_t)); free(gatt, M_AGP); } @@ -280,7 +273,6 @@ agp_free_res(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid, sc->as_aperture); mtx_destroy(&sc->as_lock); - agp_flush_cache(); } int @@ -485,7 +477,7 @@ agp_generic_alloc_memory(device_t dev, i if ((size & (AGP_PAGE_SIZE - 1)) != 0) return 0; - if (sc->as_allocated + size > sc->as_maxmem) + if (size > sc->as_maxmem - sc->as_allocated) return 0; if (type != 0) { @@ -605,12 +597,6 @@ agp_generic_bind_memory(device_t dev, st VM_OBJECT_WUNLOCK(mem->am_obj); /* - * Flush the cpu cache since we are providing a new mapping - * for these pages. - */ - agp_flush_cache(); - - /* * Make sure the chipset gets the new mappings. */ AGP_FLUSH_TLB(dev); @@ -659,6 +645,9 @@ 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); + + AGP_FLUSH_TLB(dev); + 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)); @@ -667,9 +656,6 @@ agp_generic_unbind_memory(device_t dev, vm_page_unlock(m); } VM_OBJECT_WUNLOCK(mem->am_obj); - - agp_flush_cache(); - AGP_FLUSH_TLB(dev); mem->am_offset = 0; mem->am_is_bound = 0; @@ -996,3 +982,76 @@ void agp_memory_info(device_t dev, void mi->ami_offset = mem->am_offset; mi->ami_is_bound = mem->am_is_bound; } + +int +agp_bind_pages(device_t dev, vm_page_t *pages, vm_size_t size, + vm_offset_t offset) +{ + struct agp_softc *sc; + vm_offset_t i, j, k, pa; + vm_page_t m; + int error; + + if ((size & (AGP_PAGE_SIZE - 1)) != 0 || + (offset & (AGP_PAGE_SIZE - 1)) != 0) + return (EINVAL); + + sc = device_get_softc(dev); + + mtx_lock(&sc->as_lock); + for (i = 0; i < size; i += PAGE_SIZE) { + m = pages[OFF_TO_IDX(i)]; + KASSERT(m->wire_count > 0, + ("agp_bind_pages: page %p hasn't been wired", m)); + + /* + * Install entries in the GATT, making sure that if + * AGP_PAGE_SIZE < PAGE_SIZE and size is not + * aligned to PAGE_SIZE, we don't modify too many GATT + * entries. + */ + for (j = 0; j < PAGE_SIZE && i + j < size; j += AGP_PAGE_SIZE) { + pa = VM_PAGE_TO_PHYS(m) + j; + AGP_DPF("binding offset %#jx to pa %#jx\n", + (uintmax_t)offset + i + j, (uintmax_t)pa); + error = AGP_BIND_PAGE(dev, offset + i + j, pa); + if (error) { + /* + * Bail out. Reverse all the mappings. + */ + for (k = 0; k < i + j; k += AGP_PAGE_SIZE) + AGP_UNBIND_PAGE(dev, offset + k); + + mtx_unlock(&sc->as_lock); + return (error); + } + } + } + + AGP_FLUSH_TLB(dev); + + mtx_unlock(&sc->as_lock); + return (0); +} + +int +agp_unbind_pages(device_t dev, vm_size_t size, vm_offset_t offset) +{ + struct agp_softc *sc; + vm_offset_t i; + + if ((size & (AGP_PAGE_SIZE - 1)) != 0 || + (offset & (AGP_PAGE_SIZE - 1)) != 0) + return (EINVAL); + + sc = device_get_softc(dev); + + mtx_lock(&sc->as_lock); + for (i = 0; i < size; i += AGP_PAGE_SIZE) + AGP_UNBIND_PAGE(dev, offset + i); + + AGP_FLUSH_TLB(dev); + + mtx_unlock(&sc->as_lock); + return (0); +} Modified: stable/10/sys/dev/agp/agp_amd.c ============================================================================== --- stable/10/sys/dev/agp/agp_amd.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_amd.c Tue Dec 2 13:46:13 2014 (r275406) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -92,34 +94,35 @@ agp_amd_alloc_gatt(device_t dev) /* * The AMD751 uses a page directory to map a non-contiguous - * gatt so we don't need to use contigmalloc. - * Malloc individual gatt pages and map them into the page + * gatt so we don't need to use kmem_alloc_contig. + * Allocate individual GATT pages and map them into the page * directory. */ gatt->ag_entries = entries; - gatt->ag_virtual = malloc(entries * sizeof(u_int32_t), - M_AGP, M_NOWAIT); + gatt->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, + VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_virtual) { if (bootverbose) device_printf(dev, "allocation failed\n"); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_virtual, entries * sizeof(u_int32_t)); /* * Allocate the page directory. */ - gatt->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT); + gatt->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_vdir) { if (bootverbose) device_printf(dev, "failed to allocate page directory\n"); - free(gatt->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + entries * sizeof(u_int32_t)); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_vdir, AGP_PAGE_SIZE); gatt->ag_pdir = vtophys((vm_offset_t) gatt->ag_vdir); if(bootverbose) @@ -158,19 +161,15 @@ agp_amd_alloc_gatt(device_t dev) gatt->ag_vdir[i + pdir_offset] = pa | 1; } - /* - * Make sure the chipset can see everything. - */ - agp_flush_cache(); - return gatt; } static void agp_amd_free_gatt(struct agp_amd_gatt *gatt) { - free(gatt->ag_virtual, M_AGP); - free(gatt->ag_vdir, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_vdir, AGP_PAGE_SIZE); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + gatt->ag_entries * sizeof(u_int32_t)); free(gatt, M_AGP); } @@ -348,9 +347,6 @@ agp_amd_bind_page(device_t dev, vm_offse return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1; - - /* invalidate the cache */ - AGP_FLUSH_TLB(dev); return 0; } Modified: stable/10/sys/dev/agp/agp_amd64.c ============================================================================== --- stable/10/sys/dev/agp/agp_amd64.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_amd64.c Tue Dec 2 13:46:13 2014 (r275406) @@ -241,8 +241,6 @@ agp_amd64_attach(device_t dev) 4); } - agp_flush_cache(); - return (0); } Modified: stable/10/sys/dev/agp/agp_apple.c ============================================================================== --- stable/10/sys/dev/agp/agp_apple.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_apple.c Tue Dec 2 13:46:13 2014 (r275406) @@ -224,8 +224,6 @@ agp_apple_bind_page(device_t dev, vm_off return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; - __asm __volatile("dcbst 0,%0; sync" :: - "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); return (0); } @@ -238,8 +236,6 @@ agp_apple_unbind_page(device_t dev, vm_o return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; - __asm __volatile("dcbst 0,%0; sync" :: - "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); return (0); } Modified: stable/10/sys/dev/agp/agp_ati.c ============================================================================== --- stable/10/sys/dev/agp/agp_ati.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_ati.c Tue Dec 2 13:46:13 2014 (r275406) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -129,20 +131,23 @@ agp_ati_alloc_gatt(device_t dev) /* Alloc the GATT -- pointers to pages of AGP memory */ sc->ag_entries = entries; - sc->ag_virtual = malloc(entries * sizeof(u_int32_t), M_AGP, - M_NOWAIT | M_ZERO); + sc->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, + VM_MEMATTR_WRITE_COMBINING); if (sc->ag_virtual == NULL) { if (bootverbose) - device_printf(dev, "aperture allocation failed\n"); + device_printf(dev, "GATT allocation failed\n"); return ENOMEM; } /* Alloc the page directory -- pointers to each page of the GATT */ - sc->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT | M_ZERO); + sc->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (sc->ag_vdir == NULL) { if (bootverbose) device_printf(dev, "pagedir allocation failed\n"); - free(sc->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_virtual, + entries * sizeof(u_int32_t)); return ENOMEM; } sc->ag_pdir = vtophys((vm_offset_t)sc->ag_vdir); @@ -158,11 +163,6 @@ agp_ati_alloc_gatt(device_t dev) sc->ag_vdir[apbase_offset + i] = pa | 1; } - /* - * Make sure the chipset can see everything. - */ - agp_flush_cache(); - return 0; } @@ -264,8 +264,9 @@ agp_ati_detach(device_t dev) temp = pci_read_config(dev, apsize_reg, 4); pci_write_config(dev, apsize_reg, temp & ~1, 4); - free(sc->ag_vdir, M_AGP); - free(sc->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_vdir, AGP_PAGE_SIZE); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_virtual, + sc->ag_entries * sizeof(u_int32_t)); bus_release_resource(dev, SYS_RES_MEMORY, ATI_GART_MMADDR, sc->regs); agp_free_res(dev); Modified: stable/10/sys/dev/agp/agp_i810.c ============================================================================== --- stable/10/sys/dev/agp/agp_i810.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_i810.c Tue Dec 2 13:46:13 2014 (r275406) @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -1449,17 +1451,16 @@ agp_i810_install_gatt(device_t dev) sc->dcache_size = 0; /* According to the specs the gatt on the i810 must be 64k. */ - sc->gatt->ag_virtual = contigmalloc(64 * 1024, M_AGP, 0, 0, ~0, - PAGE_SIZE, 0); + sc->gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, + 64 * 1024, M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, + 0, VM_MEMATTR_WRITE_COMBINING); if (sc->gatt->ag_virtual == NULL) { if (bootverbose) device_printf(dev, "contiguous allocation failed\n"); return (ENOMEM); } - bzero(sc->gatt->ag_virtual, sc->gatt->ag_entries * sizeof(u_int32_t)); sc->gatt->ag_physical = vtophys((vm_offset_t)sc->gatt->ag_virtual); - agp_flush_cache(); /* Install the GATT. */ bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, sc->gatt->ag_physical | 1); @@ -1591,7 +1592,7 @@ agp_i810_deinstall_gatt(device_t dev) sc = device_get_softc(dev); bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, 0); - contigfree(sc->gatt->ag_virtual, 64 * 1024, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->gatt->ag_virtual, 64 * 1024); } static void @@ -2146,7 +2147,6 @@ agp_i810_bind_memory(device_t dev, struc sc->match->driver->install_gtt_pte(dev, (offset + i) >> AGP_PAGE_SHIFT, mem->am_physical + i, 0); } - agp_flush_cache(); mem->am_offset = offset; mem->am_is_bound = 1; mtx_unlock(&sc->agp.as_lock); @@ -2187,7 +2187,6 @@ agp_i810_unbind_memory(device_t dev, str sc->match->driver->install_gtt_pte(dev, (mem->am_offset + i) >> AGP_PAGE_SHIFT, 0, 0); } - agp_flush_cache(); mem->am_is_bound = 0; mtx_unlock(&sc->agp.as_lock); return (0); Modified: stable/10/sys/dev/agp/agppriv.h ============================================================================== --- stable/10/sys/dev/agp/agppriv.h Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agppriv.h Tue Dec 2 13:46:13 2014 (r275406) @@ -83,7 +83,6 @@ struct agp_gatt { vm_offset_t ag_physical; }; -void agp_flush_cache(void); u_int8_t agp_find_caps(device_t dev); struct agp_gatt *agp_alloc_gatt(device_t dev); void agp_set_aperture_resource(device_t dev, int rid); Modified: stable/10/sys/dev/agp/agpvar.h ============================================================================== --- stable/10/sys/dev/agp/agpvar.h Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agpvar.h Tue Dec 2 13:46:13 2014 (r275406) @@ -122,6 +122,19 @@ int agp_unbind_memory(device_t dev, void */ void agp_memory_info(device_t dev, void *handle, struct agp_memory_info *mi); +/* + * Bind a set of pages at a given offset within the AGP aperture. + * Returns EINVAL if the given size or offset is not at an AGP page boundary. + */ +int agp_bind_pages(device_t dev, vm_page_t *pages, vm_size_t size, + vm_offset_t offset); + +/* + * Unbind a set of pages from the AGP aperture. + * Returns EINVAL if the given size or offset is not at an AGP page boundary. + */ +int agp_unbind_pages(device_t dev, vm_size_t size, vm_offset_t offset); + #define AGP_NORMAL_MEMORY 0 #define AGP_USER_TYPES (1 << 16) From owner-svn-src-stable-10@FreeBSD.ORG Tue Dec 2 14:09:57 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C8CBACA; Tue, 2 Dec 2014 14:09:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 074B5D8E; Tue, 2 Dec 2014 14:09:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2E9ump042779; Tue, 2 Dec 2014 14:09:56 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2E9sZu042768; Tue, 2 Dec 2014 14:09:54 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201412021409.sB2E9sZu042768@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 2 Dec 2014 14:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275408 - in stable/10/sys: dev/drm2 dev/drm2/radeon dev/drm2/ttm modules/drm2/drm2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 14:09:57 -0000 Author: tijl Date: Tue Dec 2 14:09:54 2014 New Revision: 275408 URL: https://svnweb.freebsd.org/changeset/base/275408 Log: MFC r273862,273902: Port the TTM AGP backend to the FreeBSD agp driver and enable AGP support in the radeonkms driver. Note: In PCI mode virtual addresses on the graphics card that map to system RAM are translated to physical addresses by the graphics card itself. In AGP mode address translation is done by the AGP chipset so fictitious addresses appear on the system bus. For the CPU cache management to work correctly when the CPU accesses this memory it needs to use the same fictitious addresses (and let the chipset translate them) instead of using the physical addresses directly. Reviewed by: kib Modified: stable/10/sys/dev/drm2/drm_agpsupport.c stable/10/sys/dev/drm2/radeon/radeon.h stable/10/sys/dev/drm2/radeon/radeon_device.c stable/10/sys/dev/drm2/radeon/radeon_ttm.c stable/10/sys/dev/drm2/ttm/ttm_agp_backend.c stable/10/sys/dev/drm2/ttm/ttm_bo_driver.h stable/10/sys/dev/drm2/ttm/ttm_page_alloc.c stable/10/sys/modules/drm2/drm2/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_agpsupport.c ============================================================================== --- stable/10/sys/dev/drm2/drm_agpsupport.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/drm_agpsupport.c Tue Dec 2 14:09:54 2014 (r275408) @@ -396,7 +396,7 @@ void *drm_agp_allocate_memory(size_t pag if (!agpdev) return NULL; - return agp_alloc_memory(agpdev, type, pages << AGP_PAGE_SHIFT); + return agp_alloc_memory(agpdev, type, pages << PAGE_SHIFT); } int drm_agp_free_memory(void *handle) Modified: stable/10/sys/dev/drm2/radeon/radeon.h ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon.h Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/radeon/radeon.h Tue Dec 2 14:09:54 2014 (r275408) @@ -1618,6 +1618,7 @@ struct radeon_device { bool need_dma32; bool accel_working; bool fictitious_range_registered; + bool fictitious_agp_range_registered; struct radeon_surface_reg surface_regs[RADEON_GEM_MAX_SURFACES]; const struct firmware *me_fw; /* all family ME firmware */ const struct firmware *pfp_fw; /* r6/700 PFP firmware */ Modified: stable/10/sys/dev/drm2/radeon/radeon_device.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_device.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/radeon/radeon_device.c Tue Dec 2 14:09:54 2014 (r275408) @@ -1014,6 +1014,7 @@ int radeon_device_init(struct radeon_dev rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024; rdev->accel_working = false; rdev->fictitious_range_registered = false; + rdev->fictitious_agp_range_registered = false; /* set up ring ids */ for (i = 0; i < RADEON_NUM_RINGS; i++) { rdev->ring[i].idx = i; @@ -1168,6 +1169,24 @@ int radeon_device_init(struct radeon_dev return (-r); } rdev->fictitious_range_registered = true; +#if __OS_HAS_AGP + if (rdev->flags & RADEON_IS_AGP) { + DRM_INFO("%s: Taking over the fictitious range 0x%jx-0x%jx\n", + __func__, (uintmax_t)rdev->mc.agp_base, + (uintmax_t)rdev->mc.agp_base + rdev->mc.gtt_size); + r = vm_phys_fictitious_reg_range( + rdev->mc.agp_base, + rdev->mc.agp_base + rdev->mc.gtt_size, + VM_MEMATTR_WRITE_COMBINING); + if (r != 0) { + DRM_ERROR("Failed to register fictitious range " + "0x%jx-0x%jx (%d).\n", (uintmax_t)rdev->mc.agp_base, + (uintmax_t)rdev->mc.agp_base + rdev->mc.gtt_size, r); + return (-r); + } + rdev->fictitious_agp_range_registered = true; + } +#endif if ((radeon_testing & 1)) { radeon_test_moves(rdev); @@ -1205,6 +1224,13 @@ void radeon_device_fini(struct radeon_de rdev->mc.aper_base, rdev->mc.aper_base + rdev->mc.visible_vram_size); } +#if __OS_HAS_AGP + if (rdev->fictitious_agp_range_registered) { + vm_phys_fictitious_unreg_range( + rdev->mc.agp_base, + rdev->mc.agp_base + rdev->mc.gtt_size); + } +#endif radeon_fini(rdev); #ifdef DUMBBELL_WIP Modified: stable/10/sys/dev/drm2/radeon/radeon_ttm.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_ttm.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/radeon/radeon_ttm.c Tue Dec 2 14:09:54 2014 (r275408) @@ -560,12 +560,10 @@ static struct ttm_tt *radeon_ttm_tt_crea rdev = radeon_get_rdev(bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { return ttm_agp_tt_create(bdev, rdev->ddev->agp->agpdev, size, page_flags, dummy_read_page); } -#endif /* DUMBBELL_WIP */ #endif gtt = malloc(sizeof(struct radeon_ttm_tt), @@ -610,11 +608,9 @@ static int radeon_ttm_tt_populate(struct rdev = radeon_get_rdev(ttm->bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { return ttm_agp_tt_populate(ttm); } -#endif /* DUMBBELL_WIP */ #endif #ifdef CONFIG_SWIOTLB @@ -660,12 +656,10 @@ static void radeon_ttm_tt_unpopulate(str rdev = radeon_get_rdev(ttm->bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { ttm_agp_tt_unpopulate(ttm); return; } -#endif /* DUMBBELL_WIP */ #endif #ifdef CONFIG_SWIOTLB Modified: stable/10/sys/dev/drm2/ttm/ttm_agp_backend.c ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_agp_backend.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/ttm/ttm_agp_backend.c Tue Dec 2 14:09:54 2014 (r275408) @@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$"); struct ttm_agp_backend { struct ttm_tt ttm; - struct agp_memory *mem; + vm_offset_t offset; + vm_page_t *pages; device_t bridge; }; @@ -51,31 +52,23 @@ static int ttm_agp_bind(struct ttm_tt *t { 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); + int ret; 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->pages[i] = 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); + agp_be->offset = node->start * PAGE_SIZE; + ret = -agp_bind_pages(agp_be->bridge, agp_be->pages, + ttm->num_pages << PAGE_SHIFT, agp_be->offset); if (ret) - pr_err("AGP Bind memory failed\n"); + printf("[TTM] AGP Bind memory failed\n"); return ret; } @@ -84,22 +77,16 @@ static int ttm_agp_unbind(struct ttm_tt { 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; + return -agp_unbind_pages(agp_be->bridge, ttm->num_pages << PAGE_SHIFT, + agp_be->offset); } 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->pages, M_TTM_AGP); free(agp_be, M_TTM_AGP); } @@ -118,14 +105,18 @@ struct ttm_tt *ttm_agp_tt_create(struct 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)) { + free(agp_be, M_TTM_AGP); return NULL; } + agp_be->offset = 0; + agp_be->pages = malloc(agp_be->ttm.num_pages * sizeof(*agp_be->pages), + M_TTM_AGP, M_WAITOK); + return &agp_be->ttm; } Modified: stable/10/sys/dev/drm2/ttm/ttm_bo_driver.h ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_bo_driver.h Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/ttm/ttm_bo_driver.h Tue Dec 2 14:09:54 2014 (r275408) @@ -990,9 +990,8 @@ extern vm_memattr_t ttm_io_prot(uint32_t extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; -#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) +#if __OS_HAS_AGP #define TTM_HAS_AGP -#include /** * ttm_agp_tt_create @@ -1009,7 +1008,7 @@ extern const struct ttm_mem_type_manager * bind and unbind memory backing a ttm_tt. */ extern struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, - struct agp_bridge_data *bridge, + device_t bridge, unsigned long size, uint32_t page_flags, struct vm_page *dummy_read_page); int ttm_agp_tt_populate(struct ttm_tt *ttm); Modified: stable/10/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_page_alloc.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/ttm/ttm_page_alloc.c Tue Dec 2 14:09:54 2014 (r275408) @@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef TTM_HAS_AGP -#include -#endif - #define NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(vm_page_t)) #define SMALL_ALLOCATION 16 #define FREE_ALL_PAGES (~0U) @@ -220,46 +216,34 @@ static struct ttm_pool_manager *_manager static int set_pages_array_wb(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - unmap_page_from_agp(m); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_WRITE_BACK); #endif - pmap_page_set_memattr(m, VM_MEMATTR_WRITE_BACK); - } return 0; } static int set_pages_array_wc(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - map_page_into_agp(pages[i]); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_WRITE_COMBINING); #endif - pmap_page_set_memattr(m, VM_MEMATTR_WRITE_COMBINING); - } return 0; } static int set_pages_array_uc(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - map_page_into_agp(pages[i]); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_UNCACHEABLE); #endif - pmap_page_set_memattr(m, VM_MEMATTR_UNCACHEABLE); - } return 0; } Modified: stable/10/sys/modules/drm2/drm2/Makefile ============================================================================== --- stable/10/sys/modules/drm2/drm2/Makefile Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/modules/drm2/drm2/Makefile Tue Dec 2 14:09:54 2014 (r275408) @@ -35,6 +35,7 @@ SRCS = \ drm_stub.c \ drm_sysctl.c \ drm_vm.c \ + ttm_agp_backend.c \ ttm_lock.c \ ttm_object.c \ ttm_tt.c \ @@ -46,7 +47,6 @@ SRCS = \ ttm_page_alloc.c \ ttm_bo_vm.c \ ati_pcigart.c -#ttm_agp_backend.c #ttm_page_alloc_dma.c .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-stable-10@FreeBSD.ORG Tue Dec 2 19:58:27 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D439FBF; Tue, 2 Dec 2014 19:58:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4947EB21; Tue, 2 Dec 2014 19:58:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2JwRgJ010196; Tue, 2 Dec 2014 19:58:27 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2JwRSP010195; Tue, 2 Dec 2014 19:58:27 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412021958.sB2JwRSP010195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 19:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275424 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 19:58:27 -0000 Author: brooks Date: Tue Dec 2 19:58:26 2014 New Revision: 275424 URL: https://svnweb.freebsd.org/changeset/base/275424 Log: MFC r274806: Add a guard against attempting to invoke the buildenv target with -j# as that silently exits rather than doing something useful. Sponsored by: DARPA, AFRL Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Dec 2 19:55:46 2014 (r275423) +++ stable/10/Makefile.inc1 Tue Dec 2 19:58:26 2014 (r275424) @@ -689,6 +689,11 @@ buildworld_epilogue: buildenvvars: @echo ${WMAKEENV:Q} +.if ${.TARGETS:Mbuildenv} +.if ${.MAKEFLAGS:M-j} +.error The buildenv target is incompatible with -j +.endif +.endif buildenv: @echo Entering world for ${TARGET_ARCH}:${TARGET} @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true From owner-svn-src-stable-10@FreeBSD.ORG Tue Dec 2 20:28:07 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CF3D572; Tue, 2 Dec 2014 20:28:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E43D5DE9; Tue, 2 Dec 2014 20:28:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2KS6jf024694; Tue, 2 Dec 2014 20:28:06 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2KS6Sf024692; Tue, 2 Dec 2014 20:28:06 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412022028.sB2KS6Sf024692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 20:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275426 - stable/10/sys/boot/fdt/dts/mips X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 20:28:07 -0000 Author: brooks Date: Tue Dec 2 20:28:05 2014 New Revision: 275426 URL: https://svnweb.freebsd.org/changeset/base/275426 Log: MFC r274818: Merge from CheriBSD (3422ebe71b6c06fe78b1be73623b240c219e08e3): Rename beripic to beripic0. Sponsored by: DARPA, AFRL Modified: stable/10/sys/boot/fdt/dts/mips/beri-sim.dts stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/mips/beri-sim.dts Tue Dec 2 20:23:10 2014 (r275425) +++ stable/10/sys/boot/fdt/dts/mips/beri-sim.dts Tue Dec 2 20:28:05 2014 (r275426) @@ -97,7 +97,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - beripic: beripic@7f804000 { + beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; #address-cells = <0>; @@ -115,7 +115,7 @@ compatible = "altera,jtag_uart-11_0"; reg = <0x7f000000 0x40>; interrupts = <0>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f001000 { Modified: stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts Tue Dec 2 20:23:10 2014 (r275425) +++ stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts Tue Dec 2 20:28:05 2014 (r275426) @@ -97,7 +97,7 @@ reg = <0x0 0x40000000>; // 1G at 0x0 }; - beripic: beripic@7f804000 { + beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; #address-cells = <0>; @@ -117,14 +117,14 @@ reg-shift = <2>; clock-frequency = <50000000>; interrupts = <6>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f000000 { compatible = "altera,jtag_uart-11_0"; reg = <0x7f000000 0x40>; interrupts = <0>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f001000 { @@ -198,7 +198,7 @@ 0x7f007420 0x20>; // RX, TX interrupts = <1 2>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; ethernet@7f005000 { @@ -211,7 +211,7 @@ 0x7f005420 0x20>; // RX, TX interrupts = <11 12>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; touchscreen@70400000 { @@ -227,7 +227,7 @@ 0x7f140000 0x4>; // IRQ 4 is DC, IRQ 5 is HC. interrupts = <4 5>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; avgen@0x7f009000 { From owner-svn-src-stable-10@FreeBSD.ORG Tue Dec 2 21:23:14 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 518DA15A; Tue, 2 Dec 2014 21:23:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC715F3; Tue, 2 Dec 2014 21:23:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2LNE0Y052237; Tue, 2 Dec 2014 21:23:14 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2LNEq7052236; Tue, 2 Dec 2014 21:23:14 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412022123.sB2LNEq7052236@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 21:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275428 - stable/10/sys/dev/altera/avgen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 21:23:14 -0000 Author: brooks Date: Tue Dec 2 21:23:13 2014 New Revision: 275428 URL: https://svnweb.freebsd.org/changeset/base/275428 Log: MFC r274820: Merge from CheriBSD (2e28d2a3090239b30481f35dc452ad95a5c57389): Remove initalized, but unused devname variable Sponsored by: DARPA, AFRL Modified: stable/10/sys/dev/altera/avgen/altera_avgen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- stable/10/sys/dev/altera/avgen/altera_avgen.c Tue Dec 2 20:29:29 2014 (r275427) +++ stable/10/sys/dev/altera/avgen/altera_avgen.c Tue Dec 2 21:23:13 2014 (r275428) @@ -321,7 +321,6 @@ altera_avgen_attach(struct altera_avgen_ const char *str_mmapio, const char *str_devname, int devunit) { device_t dev = sc->avg_dev; - char devname[SPECNAMELEN + 1]; int error; error = altera_avgen_process_options(sc, str_fileio, str_mmapio, @@ -329,18 +328,6 @@ altera_avgen_attach(struct altera_avgen_ if (error) return (error); - /* Select a device name. */ - if (str_devname != NULL) { - if (devunit != -1) - (void)snprintf(devname, sizeof(devname), "%s%d", - str_devname, devunit); - else - (void)snprintf(devname, sizeof(devname), "%s", - str_devname); - } else - snprintf(devname, sizeof(devname), "%s%d", "avgen", - sc->avg_unit); - if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, From owner-svn-src-stable-10@FreeBSD.ORG Tue Dec 2 22:04:28 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A999CA1; Tue, 2 Dec 2014 22:04:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4762EAA2; Tue, 2 Dec 2014 22:04:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2M4SSx071866; Tue, 2 Dec 2014 22:04:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2M4RFZ071864; Tue, 2 Dec 2014 22:04:27 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412022204.sB2M4RFZ071864@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 22:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275429 - stable/10/sys/dev/altera/jtag_uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 22:04:28 -0000 Author: brooks Date: Tue Dec 2 22:04:27 2014 New Revision: 275429 URL: https://svnweb.freebsd.org/changeset/base/275429 Log: MFC r274821: Merge from CheriBSD: commit d0c7d235c09fc65dbdb278e7016a96f79c6a49cc Make the Altera JTAG UART device driver slightly more forgiving of the foibles of a sub-par hrdware interface by increasing the timeout for spotting JTAG polling from one to two seconds. commit 19ed45a18832560dab967c179d83b71081c3a220 Update comment. commit 8edfe803f033cc8e33229f99894c2b7496a44d5f Add a comment about a device-driver race condition that could cause the BERI pipeline to wedge awaiting JTAG in the event that both the low-level console and the tty layer decide to write to the JTAG FIFO just before JTAG is disconnected. Resolving this race is a bit tricky as it looks like there isn't a way to 'give the character back' to the tty layer when we discover the race. The easy fix is to drop the character, which we don't yet do, but perhaps should as that is a better outcome than wedging the pipeline. commit 2ea26cf579c9defcf31e413e7c9b0fbc159237fc Add a comment about an inherent race with hardware in the Altera JTAG UART's low-level console code. Submitted by: rwatson Sponsored by: DARPA, AFRL Modified: stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c ============================================================================== --- stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Tue Dec 2 21:23:13 2014 (r275428) +++ stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Tue Dec 2 22:04:27 2014 (r275429) @@ -221,6 +221,9 @@ aju_cons_write(char ch) * disconnection. * * XXXRW: The polling delay may require tuning. + * + * XXXRW: Notice the inherent race with hardware: in clearing the + * bit, we may race with hardware setting the same bit. */ v = aju_cons_control_read(); if (v & ALTERA_JTAG_UART_CONTROL_AC) { Modified: stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c ============================================================================== --- stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Tue Dec 2 21:23:13 2014 (r275428) +++ stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Tue Dec 2 22:04:27 2014 (r275429) @@ -65,9 +65,9 @@ static struct ttydevsw aju_ttydevsw = { /* * When polling for the AC bit, the number of times we have to not see it - * before assuming JTAG has disappeared on us. By default, one second. + * before assuming JTAG has disappeared on us. By default, two seconds. */ -#define AJU_JTAG_MAXMISS 5 +#define AJU_JTAG_MAXMISS 10 /* * Polling intervals for input/output and JTAG connection events. @@ -255,6 +255,22 @@ aju_handle_output(struct altera_jtag_uar if (ttydisc_getc(tp, &ch, sizeof(ch)) != sizeof(ch)) panic("%s: ttydisc_getc", __func__); AJU_LOCK(sc); + + /* + * XXXRW: There is a slight race here in which we test + * for writability, drop the lock, get the character + * from the tty layer, re-acquire the lock, and then + * write. It's possible for other code -- + * specifically, the low-level console -- to have + * written in the mean time, which might mean that + * there is no longer space. The BERI memory bus will + * cause this write to block, wedging the processor + * until space is available -- which could be a while + * if JTAG is not attached! + * + * The 'easy' fix is to drop the character if WSPACE + * has become unset. Not sure what the 'hard' fix is. + */ aju_data_write(sc, ch); } else { /* From owner-svn-src-stable-10@FreeBSD.ORG Wed Dec 3 06:53:52 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4596C9C; Wed, 3 Dec 2014 06:53:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE6FD61E; Wed, 3 Dec 2014 06:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB36rqTU016263; Wed, 3 Dec 2014 06:53:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB36rnIe016248; Wed, 3 Dec 2014 06:53:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030653.sB36rnIe016248@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 06:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275439 - in stable/10/sys/dev: ahci ata ata/chipsets ichsmb ichwd sound/pci/hda uart usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 06:53:53 -0000 Author: mav Date: Wed Dec 3 06:53:49 2014 New Revision: 275439 URL: https://svnweb.freebsd.org/changeset/base/275439 Log: MFC r275101: Add bunch of PCI IDs of Intel Wildcat Point (9 Series) chipsets. Modified: stable/10/sys/dev/ahci/ahci.c stable/10/sys/dev/ata/ata-pci.h stable/10/sys/dev/ata/chipsets/ata-intel.c stable/10/sys/dev/ichsmb/ichsmb_pci.c stable/10/sys/dev/ichwd/ichwd.c stable/10/sys/dev/ichwd/ichwd.h stable/10/sys/dev/sound/pci/hda/hdac.c stable/10/sys/dev/sound/pci/hda/hdac.h stable/10/sys/dev/uart/uart_bus_pci.c stable/10/sys/dev/usb/controller/ehci_pci.c stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ahci/ahci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -226,6 +226,14 @@ static struct { {0x8c078086, 0x00, "Intel Lynx Point (RAID)", 0}, {0x8c0e8086, 0x00, "Intel Lynx Point (RAID)", 0}, {0x8c0f8086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8c828086, 0x00, "Intel Wildcat Point", 0}, + {0x8c838086, 0x00, "Intel Wildcat Point", 0}, + {0x8c848086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c858086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c868086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c878086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c8e8086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c8f8086, 0x00, "Intel Wildcat Point (RAID)", 0}, {0x8d028086, 0x00, "Intel Wellsburg", 0}, {0x8d048086, 0x00, "Intel Wellsburg (RAID)", 0}, {0x8d068086, 0x00, "Intel Wellsburg (RAID)", 0}, Modified: stable/10/sys/dev/ata/ata-pci.h ============================================================================== --- stable/10/sys/dev/ata/ata-pci.h Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ata/ata-pci.h Wed Dec 3 06:53:49 2014 (r275439) @@ -275,6 +275,19 @@ struct ata_pci_controller { #define ATA_LPT_R5 0x8c0e8086 #define ATA_LPT_R6 0x8c0f8086 +#define ATA_WCPT_S1 0x8c808086 +#define ATA_WCPT_S2 0x8c818086 +#define ATA_WCPT_AH1 0x8c828086 +#define ATA_WCPT_AH2 0x8c838086 +#define ATA_WCPT_R1 0x8c848086 +#define ATA_WCPT_R2 0x8c858086 +#define ATA_WCPT_R3 0x8c868086 +#define ATA_WCPT_R4 0x8c878086 +#define ATA_WCPT_S3 0x8c888086 +#define ATA_WCPT_S4 0x8c898086 +#define ATA_WCPT_R5 0x8c8e8086 +#define ATA_WCPT_R6 0x8c8f8086 + #define ATA_WELLS_S1 0x8d008086 #define ATA_WELLS_S2 0x8d088086 #define ATA_WELLS_S3 0x8d608086 Modified: stable/10/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/10/sys/dev/ata/chipsets/ata-intel.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ata/chipsets/ata-intel.c Wed Dec 3 06:53:49 2014 (r275439) @@ -227,6 +227,18 @@ ata_intel_probe(device_t dev) { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_WCPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, { ATA_WELLS_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, { ATA_WELLS_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Wellsburg" }, { ATA_WELLS_S3, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #define ID_AVOTON 0x1f3c8086 #define ID_COLETOCRK 0x23B08086 #define ID_LPT 0x8c228086 +#define ID_WCPT 0x8ca28086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -197,6 +198,9 @@ ichsmb_pci_probe(device_t dev) case ID_LPT: device_set_desc(dev, "Intel Lynx Point SMBus controller"); break; + case ID_WCPT: + device_set_desc(dev, "Intel Wildcat Point SMBus controller"); + break; case ID_COLETOCRK: device_set_desc(dev, "Intel Coleto Creek SMBus controller"); break; Modified: stable/10/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/10/sys/dev/ichwd/ichwd.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ichwd/ichwd.c Wed Dec 3 06:53:49 2014 (r275439) @@ -194,6 +194,9 @@ static struct ichwd_device ichwd_devices { DEVICEID_LPT0, "Intel Lynx Point watchdog timer", 10 }, { DEVICEID_LPT1, "Intel Lynx Point watchdog timer", 10 }, { DEVICEID_LPT2, "Intel Lynx Point watchdog timer", 10 }, + { DEVICEID_WCPT2, "Intel Wildcat Point watchdog timer", 10 }, + { DEVICEID_WCPT4, "Intel Wildcat Point watchdog timer", 10 }, + { DEVICEID_WCPT6, "Intel Wildcat Point watchdog timer", 10 }, { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10 }, { DEVICEID_COLETOCRK_LPC, "Intel Coleto Creek watchdog timer", 10 }, { 0, NULL, 0 }, Modified: stable/10/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/10/sys/dev/ichwd/ichwd.h Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ichwd/ichwd.h Wed Dec 3 06:53:49 2014 (r275439) @@ -210,6 +210,9 @@ struct ichwd_softc { #define DEVICEID_LPT29 0x8c5d #define DEVICEID_LPT30 0x8c5e #define DEVICEID_LPT31 0x8c5f +#define DEVICEID_WCPT2 0x8cc2 +#define DEVICEID_WCPT4 0x8cc4 +#define DEVICEID_WCPT6 0x8cc6 /* ICH LPC Interface Bridge Registers (ICH5 and older) */ #define ICH_GEN_STA 0xd4 Modified: stable/10/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/sound/pci/hda/hdac.c Wed Dec 3 06:53:49 2014 (r275439) @@ -86,6 +86,7 @@ static const struct { { HDA_INTEL_PPT1, "Intel Panther Point", 0, 0 }, { HDA_INTEL_LPT1, "Intel Lynx Point", 0, 0 }, { HDA_INTEL_LPT2, "Intel Lynx Point", 0, 0 }, + { HDA_INTEL_WCPT, "Intel Wildcat Point", 0, 0 }, { HDA_INTEL_WELLS1, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_WELLS2, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, Modified: stable/10/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 06:53:49 2014 (r275439) @@ -62,6 +62,7 @@ #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20) #define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8c21) +#define HDA_INTEL_WCPT HDA_MODEL_CONSTRUCT(INTEL, 0x8ca0) #define HDA_INTEL_WELLS1 HDA_MODEL_CONSTRUCT(INTEL, 0x8d20) #define HDA_INTEL_WELLS2 HDA_MODEL_CONSTRUCT(INTEL, 0x8d21) #define HDA_INTEL_LPTLP1 HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) Modified: stable/10/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_pci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/uart/uart_bus_pci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -126,6 +126,7 @@ static const struct pci_id pci_ns8250_id { 0x8086, 0x8813, 0xffff, 0, "Intel EG20T Serial Port 2", 0x10 }, { 0x8086, 0x8814, 0xffff, 0, "Intel EG20T Serial Port 3", 0x10 }, { 0x8086, 0x8c3d, 0xffff, 0, "Intel Lynx Point KT Controller", 0x10 }, +{ 0x8086, 0x8cbd, 0xffff, 0, "Intel Wildcat Point KT Controller", 0x10 }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, Modified: stable/10/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci_pci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/usb/controller/ehci_pci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -158,6 +158,10 @@ ehci_pci_match(device_t self) return ("Intel Lynx Point USB 2.0 controller USB-A"); case 0x8c2d8086: return ("Intel Lynx Point USB 2.0 controller USB-B"); + case 0x8ca68086: + return ("Intel Wildcat Point USB 2.0 controller USB-A"); + case 0x8cad8086: + return ("Intel Wildcat Point USB 2.0 controller USB-B"); case 0x00e01033: return ("NEC uPD 720100 USB 2.0 controller"); Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -107,6 +107,8 @@ xhci_pci_match(device_t self) return ("Intel Panther Point USB 3.0 controller"); case 0x8c318086: return ("Intel Lynx Point USB 3.0 controller"); + case 0x8cb18086: + return ("Intel Wildcat Point USB 3.0 controller"); default: break; From owner-svn-src-stable-10@FreeBSD.ORG Wed Dec 3 07:04:29 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59A99336; Wed, 3 Dec 2014 07:04:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4667D785; Wed, 3 Dec 2014 07:04:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB374T8h021214; Wed, 3 Dec 2014 07:04:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB374TPI021213; Wed, 3 Dec 2014 07:04:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030704.sB374TPI021213@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 07:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275443 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 07:04:29 -0000 Author: mav Date: Wed Dec 3 07:04:28 2014 New Revision: 275443 URL: https://svnweb.freebsd.org/changeset/base/275443 Log: MFC r275123: Fix incorrect check, blocking MULTIID functionality. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Wed Dec 3 07:02:48 2014 (r275442) +++ stable/10/sys/dev/isp/isp.c Wed Dec 3 07:04:28 2014 (r275443) @@ -1219,7 +1219,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d * work for them). */ if (IS_FC(isp) && isp->isp_nchan > 1) { - if (!IS_24XX(isp) || (fwt & ISP2400_FW_ATTR_MULTIID) == 0) { + if (!ISP_CAP_MULTI_ID(isp)) { isp_prt(isp, ISP_LOGWARN, "non-MULTIID f/w loaded, only can enable 1 of %d channels", isp->isp_nchan); isp->isp_nchan = 1; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Dec 3 07:05:18 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12CE846A; Wed, 3 Dec 2014 07:05:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F365378B; Wed, 3 Dec 2014 07:05:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB375HZs021399; Wed, 3 Dec 2014 07:05:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB375HHm021398; Wed, 3 Dec 2014 07:05:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030705.sB375HHm021398@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 07:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275444 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 07:05:18 -0000 Author: mav Date: Wed Dec 3 07:05:17 2014 New Revision: 275444 URL: https://svnweb.freebsd.org/changeset/base/275444 Log: MFC r275124: Fix WWNN/WWPN generation for virtual channels. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Dec 3 07:04:28 2014 (r275443) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Dec 3 07:05:17 2014 (r275444) @@ -6109,10 +6109,9 @@ isp_default_wwn(ispsoftc_t * isp, int ch return (seed); } return (0x400000007F000009ull); - } else { - seed = iswwnn ? fc->def_wwnn : fc->def_wwpn; } + seed = iswwnn ? fc->def_wwnn : fc->def_wwpn; /* * For channel zero just return what we have. For either ACTIVE or @@ -6135,11 +6134,9 @@ isp_default_wwn(ispsoftc_t * isp, int ch if (seed) { return (seed); } - if (isactive) { + seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn : ISP_FC_PC(isp, 0)->def_wwpn; + if (seed == 0) seed = iswwnn ? FCPARAM(isp, 0)->isp_wwnn_nvram : FCPARAM(isp, 0)->isp_wwpn_nvram; - } else { - seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn : ISP_FC_PC(isp, 0)->def_wwpn; - } if (((seed >> 60) & 0xf) == 2) { /* From owner-svn-src-stable-10@FreeBSD.ORG Wed Dec 3 08:22:13 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E41B429D; Wed, 3 Dec 2014 08:22:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D06D4F7C; Wed, 3 Dec 2014 08:22:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB38MDn3055811; Wed, 3 Dec 2014 08:22:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB38MDuG055810; Wed, 3 Dec 2014 08:22:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201412030822.sB38MDuG055810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 3 Dec 2014 08:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275445 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 08:22:14 -0000 Author: trasz Date: Wed Dec 3 08:22:13 2014 New Revision: 275445 URL: https://svnweb.freebsd.org/changeset/base/275445 Log: MFC r274703: Fix typo. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Dec 3 07:05:17 2014 (r275444) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Dec 3 08:22:13 2014 (r275445) @@ -1990,7 +1990,7 @@ cfiscsi_ioctl_port_create(struct ctl_req if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) { req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), - "target \"%s\" already exist", target); + "target \"%s\" already exists", target); cfiscsi_target_release(ct); ctl_free_opts(&opts); return; From owner-svn-src-stable-10@FreeBSD.ORG Wed Dec 3 09:08:08 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11F69104; Wed, 3 Dec 2014 09:08:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7D69628; Wed, 3 Dec 2014 09:08:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3987Ni074571; Wed, 3 Dec 2014 09:08:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB398572074554; Wed, 3 Dec 2014 09:08:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412030908.sB398572074554@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Dec 2014 09:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275448 - in stable/10/contrib/ofed: librdmacm/examples/build/cmatose librdmacm/examples/build/mckey librdmacm/examples/build/rping librdmacm/examples/build/udaddy management/infiniband... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 09:08:08 -0000 Author: hselasky Date: Wed Dec 3 09:08:04 2014 New Revision: 275448 URL: https://svnweb.freebsd.org/changeset/base/275448 Log: MFC r275328 and r275330: Add missing libraries when linking and fix building of some infiniband utilities by updating some header file locations and compiler include directives. Sponsored by: Mellanox Technologies Modified: stable/10/contrib/ofed/librdmacm/examples/build/cmatose/Makefile stable/10/contrib/ofed/librdmacm/examples/build/mckey/Makefile stable/10/contrib/ofed/librdmacm/examples/build/rping/Makefile stable/10/contrib/ofed/librdmacm/examples/build/udaddy/Makefile stable/10/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c stable/10/contrib/ofed/management/infiniband-diags/src/ibroute.c stable/10/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c stable/10/contrib/ofed/management/infiniband-diags/src/ibtracert.c stable/10/contrib/ofed/management/infiniband-diags/src/saquery.c stable/10/contrib/ofed/management/infiniband-diags/src/smpquery.c stable/10/contrib/ofed/usr.bin/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ofed/librdmacm/examples/build/cmatose/Makefile ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Wed Dec 3 09:08:04 2014 (r275448) @@ -6,5 +6,6 @@ PROG= cmatose MAN= SRCS= cmatose.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/10/contrib/ofed/librdmacm/examples/build/mckey/Makefile ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/mckey/Makefile Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/librdmacm/examples/build/mckey/Makefile Wed Dec 3 09:08:04 2014 (r275448) @@ -6,5 +6,6 @@ PROG= mckey MAN= SRCS= mckey.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/10/contrib/ofed/librdmacm/examples/build/rping/Makefile ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/rping/Makefile Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/librdmacm/examples/build/rping/Makefile Wed Dec 3 09:08:04 2014 (r275448) @@ -6,5 +6,6 @@ PROG= rping MAN= SRCS= rping.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/10/contrib/ofed/librdmacm/examples/build/udaddy/Makefile ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Wed Dec 3 09:08:04 2014 (r275448) @@ -6,5 +6,6 @@ PROG= udaddy MAN= SRCS= udaddy.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/10/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Wed Dec 3 09:08:04 2014 (r275448) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "ibnetdiscover.h" #include "grouping.h" Modified: stable/10/contrib/ofed/management/infiniband-diags/src/ibroute.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/ibroute.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/ibroute.c Wed Dec 3 09:08:04 2014 (r275448) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/10/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c Wed Dec 3 09:08:04 2014 (r275448) @@ -43,7 +43,7 @@ #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/10/contrib/ofed/management/infiniband-diags/src/ibtracert.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/ibtracert.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/ibtracert.c Wed Dec 3 09:08:04 2014 (r275448) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/10/contrib/ofed/management/infiniband-diags/src/saquery.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/saquery.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/saquery.c Wed Dec 3 09:08:04 2014 (r275448) @@ -50,12 +50,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include Modified: stable/10/contrib/ofed/management/infiniband-diags/src/smpquery.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/smpquery.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/smpquery.c Wed Dec 3 09:08:04 2014 (r275448) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/10/contrib/ofed/usr.bin/Makefile.inc ============================================================================== --- stable/10/contrib/ofed/usr.bin/Makefile.inc Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/usr.bin/Makefile.inc Wed Dec 3 09:08:04 2014 (r275448) @@ -1,4 +1,9 @@ DIAGPATH= ${.CURDIR}/../../management/infiniband-diags BINDIR?= /usr/bin CFLAGS+= -I${.CURDIR}/../../include/infiniband +CFLAGS+= -I${.CURDIR}/../../include CFLAGS+= -I${.CURDIR}/../../management/opensm/include/ +CFLAGS+= -I${.CURDIR}/../../management/opensm +CFLAGS+= -I${.CURDIR}/../../management/libibcommon/include +CFLAGS+= -I${.CURDIR}/../../management/libibumad/include +CFLAGS+= -I${.CURDIR}/../../management/libibmad/include From owner-svn-src-stable-10@FreeBSD.ORG Wed Dec 3 09:14:15 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4526040E; Wed, 3 Dec 2014 09:14:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 310A4754; Wed, 3 Dec 2014 09:14:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB39EFSi078706; Wed, 3 Dec 2014 09:14:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB39EEm7078704; Wed, 3 Dec 2014 09:14:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412030914.sB39EEm7078704@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Dec 2014 09:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275450 - in stable/10/sys/dev/usb: . quirk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 09:14:15 -0000 Author: hselasky Date: Wed Dec 3 09:14:14 2014 New Revision: 275450 URL: https://svnweb.freebsd.org/changeset/base/275450 Log: MFC r275110: Add new USB quirk. PR: 195372 Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Wed Dec 3 09:10:41 2014 (r275449) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Wed Dec 3 09:14:14 2014 (r275450) @@ -253,6 +253,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(LEXAR, CF_READER, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(LEXAR, JUMPSHOT, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(LEXAR, JUMPDRIVE, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(LOGITEC, LDR_H443SU2, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(LOGITEC, LDR_H443U2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI,), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Wed Dec 3 09:10:41 2014 (r275449) +++ stable/10/sys/dev/usb/usbdevs Wed Dec 3 09:14:14 2014 (r275450) @@ -2602,6 +2602,7 @@ product LENOVO ETHERNET 0x7203 USB 2.0 /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader product LEXAR CF_READER 0xb002 USB CF Reader +product LEXAR JUMPDRIVE 0xa833 USB Jumpdrive Flash Drive /* Lexmark products */ product LEXMARK S2450 0x0009 Optra S 2450 From owner-svn-src-stable-10@FreeBSD.ORG Wed Dec 3 10:42:11 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B988377; Wed, 3 Dec 2014 10:42:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CDDA117; Wed, 3 Dec 2014 10:42:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3AgB6T022207; Wed, 3 Dec 2014 10:42:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3AgBVO022206; Wed, 3 Dec 2014 10:42:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412031042.sB3AgBVO022206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Dec 2014 10:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275456 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 10:42:11 -0000 Author: kib Date: Wed Dec 3 10:42:10 2014 New Revision: 275456 URL: https://svnweb.freebsd.org/changeset/base/275456 Log: MFC r275120: Fix SA_SIGINFO | SA_RESETHAND handling, reset disposition after sv_sendsig() is called. Modified: stable/10/sys/kern/kern_sig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_sig.c ============================================================================== --- stable/10/sys/kern/kern_sig.c Wed Dec 3 10:39:47 2014 (r275455) +++ stable/10/sys/kern/kern_sig.c Wed Dec 3 10:42:10 2014 (r275456) @@ -1891,6 +1891,30 @@ pgsignal(struct pgrp *pgrp, int sig, int } } + +/* + * Recalculate the signal mask and reset the signal disposition after + * usermode frame for delivery is formed. Should be called after + * mach-specific routine, because sysent->sv_sendsig() needs correct + * ps_siginfo and signal mask. + */ +static void +postsig_done(int sig, struct thread *td, struct sigacts *ps) +{ + sigset_t mask; + + mtx_assert(&ps->ps_mtx, MA_OWNED); + td->td_ru.ru_nsignals++; + mask = ps->ps_catchmask[_SIG_IDX(sig)]; + if (!SIGISMEMBER(ps->ps_signodefer, sig)) + SIGADDSET(mask, sig); + kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, + SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); + if (SIGISMEMBER(ps->ps_sigreset, sig)) + sigdflt(ps, sig); +} + + /* * Send a signal caused by a trap to the current thread. If it will be * caught immediately, deliver it with correct code. Otherwise, post it @@ -1900,7 +1924,6 @@ void trapsignal(struct thread *td, ksiginfo_t *ksi) { struct sigacts *ps; - sigset_t mask; struct proc *p; int sig; int code; @@ -1915,7 +1938,6 @@ trapsignal(struct thread *td, ksiginfo_t mtx_lock(&ps->ps_mtx); if ((p->p_flag & P_TRACED) == 0 && SIGISMEMBER(ps->ps_sigcatch, sig) && !SIGISMEMBER(td->td_sigmask, sig)) { - td->td_ru.ru_nsignals++; #ifdef KTRACE if (KTRPOINT(curthread, KTR_PSIG)) ktrpsig(sig, ps->ps_sigact[_SIG_IDX(sig)], @@ -1923,13 +1945,7 @@ trapsignal(struct thread *td, ksiginfo_t #endif (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], ksi, &td->td_sigmask); - mask = ps->ps_catchmask[_SIG_IDX(sig)]; - if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(mask, sig); - kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, - SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); - if (SIGISMEMBER(ps->ps_sigreset, sig)) - sigdflt(ps, sig); + postsig_done(sig, td, ps); mtx_unlock(&ps->ps_mtx); } else { /* @@ -2811,7 +2827,7 @@ postsig(sig) struct sigacts *ps; sig_t action; ksiginfo_t ksi; - sigset_t returnmask, mask; + sigset_t returnmask; KASSERT(sig != 0, ("postsig")); @@ -2866,20 +2882,12 @@ postsig(sig) } else returnmask = td->td_sigmask; - mask = ps->ps_catchmask[_SIG_IDX(sig)]; - if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(mask, sig); - kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, - SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); - - if (SIGISMEMBER(ps->ps_sigreset, sig)) - sigdflt(ps, sig); - td->td_ru.ru_nsignals++; if (p->p_sig == sig) { p->p_code = 0; p->p_sig = 0; } (*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); + postsig_done(sig, td, ps); } return (1); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Dec 3 19:44:23 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9112F623; Wed, 3 Dec 2014 19:44:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9281BF; Wed, 3 Dec 2014 19:44:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3JiNpp070504; Wed, 3 Dec 2014 19:44:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3JiNmt070503; Wed, 3 Dec 2014 19:44:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201412031944.sB3JiNmt070503@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Dec 2014 19:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275465 - stable/10/usr.sbin/pciconf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 19:44:23 -0000 Author: markj Date: Wed Dec 3 19:44:22 2014 New Revision: 275465 URL: https://svnweb.freebsd.org/changeset/base/275465 Log: MFC r273488: Fix some bugs in the error handling of getdevice(). PR: 194506 Modified: stable/10/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.c Wed Dec 3 19:41:49 2014 (r275464) +++ stable/10/usr.sbin/pciconf/pciconf.c Wed Dec 3 19:44:22 2014 (r275465) @@ -662,16 +662,16 @@ getdevice(const char *name) * find the start of the unit. */ if (name[0] == '\0') - err(1, "Empty device name"); + errx(1, "Empty device name"); cp = strchr(name, '\0'); assert(cp != NULL && cp != name); cp--; while (cp != name && isdigit(cp[-1])) cp--; - if (cp == name) + if (cp == name || !isdigit(*cp)) errx(1, "Invalid device name"); if ((size_t)(cp - name) + 1 > sizeof(patterns[0].pd_name)) - errx(1, "Device name i2s too long"); + errx(1, "Device name is too long"); memcpy(patterns[0].pd_name, name, cp - name); patterns[0].pd_unit = strtol(cp, &cp, 10); assert(*cp == '\0'); From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 01:10:52 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53980851; Thu, 4 Dec 2014 01:10:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1954EADC; Thu, 4 Dec 2014 01:10:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB41ApMi054392; Thu, 4 Dec 2014 01:10:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB41Apaj054391; Thu, 4 Dec 2014 01:10:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412040110.sB41Apaj054391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 4 Dec 2014 01:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275471 - in stable: 10/sys/dev/ath/ath_hal/ar5212 9/sys/dev/ath/ath_hal/ar5212 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 01:10:52 -0000 Author: dim Date: Thu Dec 4 01:10:50 2014 New Revision: 275471 URL: https://svnweb.freebsd.org/changeset/base/275471 Log: MFC r274922: Fix the following -Werror warning from clang 3.5.0, while building the ath kernel module: sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] if (abs(lp[0] * EEP_SCALE - target) < EEP_DELTA) { ^ sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs' #define abs(_a) __builtin_abs(_a) ^ sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: note: remove the call to '__builtin_abs' since unsigned values cannot be negative sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs' #define abs(_a) __builtin_abs(_a) ^ 1 error generated. This warning occurs because both lp[0] and target are unsigned, so the subtraction expression is also unsigned, and calling abs() is a no-op. However, the intention was to look at the absolute difference between the two unsigned quantities. Introduce a small static function to clarify what we're doing, and call that instead. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D1212 Modified: stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Wed Dec 3 23:37:23 2014 (r275470) +++ stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Thu Dec 4 01:10:50 2014 (r275471) @@ -2605,6 +2605,12 @@ ar5212GetTargetPowers(struct ath_hal *ah powInfo[ixlo].twicePwr54, powInfo[ixhi].twicePwr54); } +static uint32_t +udiff(uint32_t u, uint32_t v) +{ + return (u >= v ? u - v : v - u); +} + /* * Search a list for a specified value v that is within * EEP_DELTA of the search values. Return the closest @@ -2639,7 +2645,7 @@ ar5212GetLowerUpperValues(uint16_t v, ui * If value is close to the current value of the list * then target is not between values, it is one of the values */ - if (abs(lp[0] * EEP_SCALE - target) < EEP_DELTA) { + if (udiff(lp[0] * EEP_SCALE, target) < EEP_DELTA) { *vlo = *vhi = lp[0]; return; } From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 01:21:58 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2370CBBA; Thu, 4 Dec 2014 01:21:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E89AC6A; Thu, 4 Dec 2014 01:21:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB41LvOf063196; Thu, 4 Dec 2014 01:21:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB41LvQv063188; Thu, 4 Dec 2014 01:21:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412040121.sB41LvQv063188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 4 Dec 2014 01:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275472 - in stable: 10/contrib/libc++/include 9/contrib/libc++/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 01:21:58 -0000 Author: dim Date: Thu Dec 4 01:21:56 2014 New Revision: 275472 URL: https://svnweb.freebsd.org/changeset/base/275472 Log: MFC r275366: Pull in r209785 from upstream libc++ trunk (by Marshall Clow): Fix a problem exposed by r208825, which caused bind (and other bits of libc++) to stop working. And tests This fix is needed to support clang 3.5.0 and higher, which are more strict about forming pointer-to-function types with cv-qualifiers or ref-qualifiers. See also the upstream PR and Reported by: amdmi3 Modified: stable/10/contrib/libc++/include/type_traits Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/libc++/include/type_traits Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/10/contrib/libc++/include/type_traits ============================================================================== --- stable/10/contrib/libc++/include/type_traits Thu Dec 4 01:10:50 2014 (r275471) +++ stable/10/contrib/libc++/include/type_traits Thu Dec 4 01:21:56 2014 (r275472) @@ -439,8 +439,26 @@ template struct _LIBCPP_TYPE // is_member_function_pointer -template struct __libcpp_is_member_function_pointer : public false_type {}; -template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +// template struct __libcpp_is_member_function_pointer : public false_type {}; +// template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +// + +template +struct __member_pointer_traits_imp +{ // forward declaration; specializations later +}; + + +namespace __libcpp_is_member_function_pointer_imp { + template + char __test(typename std::__member_pointer_traits_imp<_Tp, true, false>::_FnType *); + + template + std::__two __test(...); +}; + +template struct __libcpp_is_member_function_pointer + : public integral_constant(nullptr)) == 1> {}; template struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer : public __libcpp_is_member_function_pointer::type> {}; @@ -1593,11 +1611,6 @@ __decay_copy(const _Tp& __t) #endif -template -struct __member_pointer_traits_imp -{ -}; - #ifndef _LIBCPP_HAS_NO_VARIADICS template @@ -1605,6 +1618,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1612,6 +1626,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1619,6 +1634,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1626,6 +1642,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; #if __has_feature(cxx_reference_qualified_functions) @@ -1635,6 +1652,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1642,6 +1660,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1649,6 +1668,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1656,6 +1676,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1663,6 +1684,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1670,6 +1692,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1677,6 +1700,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1684,6 +1708,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; #endif // __has_feature(cxx_reference_qualified_functions) @@ -1695,6 +1720,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1702,6 +1728,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1709,6 +1736,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1716,6 +1744,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1723,6 +1752,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1730,6 +1760,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1737,6 +1768,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1744,6 +1776,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1751,6 +1784,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1758,6 +1792,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1765,6 +1800,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1772,6 +1808,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1779,6 +1816,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1786,6 +1824,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1793,6 +1832,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1800,6 +1840,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; #endif // _LIBCPP_HAS_NO_VARIADICS @@ -1819,6 +1860,7 @@ struct __member_pointer_traits { // typedef ... _ClassType; // typedef ... _ReturnType; +// typedef ... _FnType; }; // result_of @@ -2526,6 +2568,15 @@ template struct _LIBCPP_TYPE // is_nothrow_constructible +#if 0 +template +struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible + : public integral_constant +{ +}; + +#else + #ifndef _LIBCPP_HAS_NO_VARIADICS #if __has_feature(cxx_noexcept) @@ -2664,6 +2715,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_ }; #endif // _LIBCPP_HAS_NO_VARIADICS +#endif // __has_feature(is_nothrow_constructible) // is_nothrow_default_constructible From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 23:15:45 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C957E795; Thu, 4 Dec 2014 23:15:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5B276B8; Thu, 4 Dec 2014 23:15:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4NFjlP001364; Thu, 4 Dec 2014 23:15:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NFjCb001363; Thu, 4 Dec 2014 23:15:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042315.sB4NFjCb001363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275485 - stable/10/sbin/sysctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:15:45 -0000 Author: delphij Date: Thu Dec 4 23:15:44 2014 New Revision: 275485 URL: https://svnweb.freebsd.org/changeset/base/275485 Log: MFC r272044: Constify a parameter of name2oid. No functional change. Modified: stable/10/sbin/sysctl/sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/sysctl/sysctl.c ============================================================================== --- stable/10/sbin/sysctl/sysctl.c Thu Dec 4 22:15:22 2014 (r275484) +++ stable/10/sbin/sysctl/sysctl.c Thu Dec 4 23:15:44 2014 (r275485) @@ -78,7 +78,7 @@ static int parsefile(const char *); static int parse(const char *, int); static int show_var(int *, int); static int sysctl_all(int *oid, int len); -static int name2oid(char *, int *); +static int name2oid(const char *, int *); static int set_IK(const char *, int *); @@ -693,7 +693,7 @@ set_IK(const char *str, int *val) */ static int -name2oid(char *name, int *oidp) +name2oid(const char *name, int *oidp) { int oid[2]; int i; From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 23:17:36 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7A1C972; Thu, 4 Dec 2014 23:17:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 934C46E3; Thu, 4 Dec 2014 23:17:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4NHagO001684; Thu, 4 Dec 2014 23:17:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NHaH9001683; Thu, 4 Dec 2014 23:17:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042317.sB4NHaH9001683@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275486 - stable/10/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:17:36 -0000 Author: delphij Date: Thu Dec 4 23:17:35 2014 New Revision: 275486 URL: https://svnweb.freebsd.org/changeset/base/275486 Log: MFC r274303: Apply upstream 13597:3eac1e8e0f4c (git: illumos-gate@aa846ad9): Initialize tqent_flags in the userland taskq implementation. Without this the assertion of tq->tq_freelist != NULL may fail in taskq_destroy. The problem is that tqent_flags is never initialized in the userland implementation while the kernel one does initialize it. Without proper initialization, the flag may have its lowest bit set, making it treated as TQENT_FLAG_PREALLOC and never removing taskq_ent_t from tq_freelist. Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Thu Dec 4 23:15:44 2014 (r275485) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Thu Dec 4 23:17:35 2014 (r275486) @@ -24,6 +24,7 @@ */ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Garrett D'Amore . All rights reserved. */ #include @@ -136,6 +137,7 @@ taskq_dispatch(taskq_t *tq, task_func_t t->tqent_prev->tqent_next = t; t->tqent_func = func; t->tqent_arg = arg; + t->tqent_flags = 0; cv_signal(&tq->tq_dispatch_cv); mutex_exit(&tq->tq_lock); return (1); From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 23:19:05 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB2B5B17; Thu, 4 Dec 2014 23:19:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7AB6754; Thu, 4 Dec 2014 23:19:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4NJ5Lk001927; Thu, 4 Dec 2014 23:19:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NJ5wY001926; Thu, 4 Dec 2014 23:19:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042319.sB4NJ5wY001926@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275487 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:19:05 -0000 Author: delphij Date: Thu Dec 4 23:19:04 2014 New Revision: 275487 URL: https://svnweb.freebsd.org/changeset/base/275487 Log: MFC r274458,274523: Derive copyright year from src/COPYRIGHT. Modified: stable/10/sys/conf/newvers.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Dec 4 23:17:35 2014 (r275486) +++ stable/10/sys/conf/newvers.sh Thu Dec 4 23:19:04 2014 (r275487) @@ -52,7 +52,7 @@ else fi b=share/examples/etc/bsd-style-copyright -year=`date '+%Y'` +year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) # look for copyright template for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b do From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 23:20:45 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF963D32; Thu, 4 Dec 2014 23:20:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90D787F1; Thu, 4 Dec 2014 23:20:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4NKjT9002469; Thu, 4 Dec 2014 23:20:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NKjZ4002467; Thu, 4 Dec 2014 23:20:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042320.sB4NKjZ4002467@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275488 - in stable/10: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:20:45 -0000 Author: delphij Date: Thu Dec 4 23:20:44 2014 New Revision: 275488 URL: https://svnweb.freebsd.org/changeset/base/275488 Log: MFC r274276: MFV r274271: Improve zdb -b performance: - Reduce gethrtime() call to 1/100th of blkptr's; - Skip manipulating the size-ordered tree; - Issue more (10, previously 3) async reads; - Use lighter weight testing in traverse_visitbp(); Illumos issue: 5243 zdb -b could be much faster Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Dec 4 23:19:04 2014 (r275487) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Dec 4 23:20:44 2014 (r275488) @@ -77,9 +77,11 @@ #ifndef lint extern boolean_t zfs_recover; extern uint64_t zfs_arc_max, zfs_arc_meta_limit; +extern int zfs_vdev_async_read_max_active; #else boolean_t zfs_recover; uint64_t zfs_arc_max, zfs_arc_meta_limit; +int zfs_vdev_async_read_max_active; #endif const char cmdname[] = "zdb"; @@ -2384,8 +2386,14 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] < 5 && - gethrtime() > zcb->zcb_lastprint + NANOSEC) { + /* only call gethrtime() every 100 blocks */ + static int iters; + if (++iters > 100) + iters = 0; + else + return (0); + + if (dump_opt['b'] < 5 && gethrtime() > zcb->zcb_lastprint + NANOSEC) { uint64_t now = gethrtime(); char buf[10]; uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize; @@ -2494,6 +2502,14 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) (longlong_t)vd->vdev_ms_count); msp->ms_ops = &zdb_metaslab_ops; + + /* + * We don't want to spend the CPU + * manipulating the size-ordered + * tree, so clear the range_tree + * ops. + */ + msp->ms_tree->rt_ops = NULL; VERIFY0(space_map_load(msp->ms_sm, msp->ms_tree, SM_ALLOC)); msp->ms_loaded = B_TRUE; @@ -3508,6 +3524,13 @@ main(int argc, char **argv) */ zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024; + /* + * "zdb -c" uses checksum-verifying scrub i/os which are async reads. + * "zdb -b" uses traversal prefetch which uses async reads. + * For good performance, let several of them be active at once. + */ + zfs_vdev_async_read_max_active = 10; + kernel_init(FREAD); g_zfs = libzfs_init(); ASSERT(g_zfs != NULL); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Thu Dec 4 23:19:04 2014 (r275487) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Thu Dec 4 23:20:44 2014 (r275488) @@ -59,6 +59,7 @@ typedef struct traverse_data { int td_flags; prefetch_data_t *td_pfd; boolean_t td_paused; + uint64_t td_hole_birth_enabled_txg; blkptr_cb_t *td_func; void *td_arg; } traverse_data_t; @@ -229,25 +230,20 @@ traverse_visitbp(traverse_data_t *td, co } if (bp->blk_birth == 0) { - if (spa_feature_is_active(td->td_spa, SPA_FEATURE_HOLE_BIRTH)) { - /* - * Since this block has a birth time of 0 it must be a - * hole created before the SPA_FEATURE_HOLE_BIRTH - * feature was enabled. If SPA_FEATURE_HOLE_BIRTH - * was enabled before the min_txg for this traveral we - * know the hole must have been created before the - * min_txg for this traveral, so we can skip it. If - * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg - * for this traveral we cannot tell if the hole was - * created before or after the min_txg for this - * traversal, so we cannot skip it. - */ - uint64_t hole_birth_enabled_txg; - VERIFY(spa_feature_enabled_txg(td->td_spa, - SPA_FEATURE_HOLE_BIRTH, &hole_birth_enabled_txg)); - if (hole_birth_enabled_txg < td->td_min_txg) - return (0); - } + /* + * Since this block has a birth time of 0 it must be a + * hole created before the SPA_FEATURE_HOLE_BIRTH + * feature was enabled. If SPA_FEATURE_HOLE_BIRTH + * was enabled before the min_txg for this traveral we + * know the hole must have been created before the + * min_txg for this traveral, so we can skip it. If + * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg + * for this traveral we cannot tell if the hole was + * created before or after the min_txg for this + * traversal, so we cannot skip it. + */ + if (td->td_hole_birth_enabled_txg < td->td_min_txg) + return (0); } else if (bp->blk_birth <= td->td_min_txg) { return (0); } @@ -523,6 +519,13 @@ traverse_impl(spa_t *spa, dsl_dataset_t td.td_flags = flags; td.td_paused = B_FALSE; + if (spa_feature_is_active(spa, SPA_FEATURE_HOLE_BIRTH)) { + VERIFY(spa_feature_enabled_txg(spa, + SPA_FEATURE_HOLE_BIRTH, &td.td_hole_birth_enabled_txg)); + } else { + td.td_hole_birth_enabled_txg = 0; + } + pd.pd_blks_max = zfs_pd_blks_max; pd.pd_flags = flags; mutex_init(&pd.pd_mtx, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 23:21:43 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F943EF2; Thu, 4 Dec 2014 23:21:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BD8A809; Thu, 4 Dec 2014 23:21:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4NLgOo005400; Thu, 4 Dec 2014 23:21:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NLgpG005399; Thu, 4 Dec 2014 23:21:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042321.sB4NLgpG005399@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275489 - stable/10/sys/libkern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:21:43 -0000 Author: delphij Date: Thu Dec 4 23:21:42 2014 New Revision: 275489 URL: https://svnweb.freebsd.org/changeset/base/275489 Log: MFC r274636: Sync with userland variant. Modified: stable/10/sys/libkern/strncmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/libkern/strncmp.c ============================================================================== --- stable/10/sys/libkern/strncmp.c Thu Dec 4 23:20:44 2014 (r275488) +++ stable/10/sys/libkern/strncmp.c Thu Dec 4 23:21:42 2014 (r275489) @@ -10,7 +10,7 @@ * 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 + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -33,9 +33,7 @@ __FBSDID("$FreeBSD$"); #include int -strncmp(s1, s2, n) - register const char *s1, *s2; - register size_t n; +strncmp(const char *s1, const char *s2, size_t n) { if (n == 0) @@ -44,7 +42,7 @@ strncmp(s1, s2, n) if (*s1 != *s2++) return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); - if (*s1++ == 0) + if (*s1++ == '\0') break; } while (--n != 0); return (0); From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 23:26:16 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 369B320F; Thu, 4 Dec 2014 23:26:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20BFA84C; Thu, 4 Dec 2014 23:26:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4NQFci006678; Thu, 4 Dec 2014 23:26:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NQFNt006677; Thu, 4 Dec 2014 23:26:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042326.sB4NQFNt006677@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275490 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:26:16 -0000 Author: delphij Date: Thu Dec 4 23:26:15 2014 New Revision: 275490 URL: https://svnweb.freebsd.org/changeset/base/275490 Log: MFC r274674: Add a tunable for spa_slop_shift which controls how much space we would reserve by default. Tuning is not recommended. Relnotes: yes Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Dec 4 23:21:42 2014 (r275489) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Dec 4 23:26:15 2014 (r275490) @@ -384,6 +384,9 @@ zfs_deadman_init() * See also the comments in zfs_space_check_t. */ int spa_slop_shift = 5; +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_slop_shift, CTLFLAG_RWTUN, + &spa_slop_shift, 0, + "Shift value of reserved space (1/(2^spa_slop_shift))."); /* * ========================================================================== From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 4 23:27:30 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D26F43C; Thu, 4 Dec 2014 23:27:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 896AE869; Thu, 4 Dec 2014 23:27:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4NRUIC006884; Thu, 4 Dec 2014 23:27:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NRUbZ006883; Thu, 4 Dec 2014 23:27:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042327.sB4NRUbZ006883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275491 - stable/10/contrib/hyperv/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:27:30 -0000 Author: delphij Date: Thu Dec 4 23:27:29 2014 New Revision: 275491 URL: https://svnweb.freebsd.org/changeset/base/275491 Log: MFC r274370: Rename variable name from 'index' to 'idx' to avoid shadowing index(3). Noticed by: dim Modified: stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Thu Dec 4 23:26:15 2014 (r275490) +++ stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Thu Dec 4 23:27:29 2014 (r275491) @@ -511,25 +511,25 @@ kvp_get_value(int pool, __u8 *key, int k static int -kvp_pool_enumerate(int pool, int index, __u8 *key, int key_size, +kvp_pool_enumerate(int pool, int idx, __u8 *key, int key_size, __u8 *value, int value_size) { struct kvp_record *record; KVP_LOG(LOG_DEBUG, "kvp_pool_enumerate: pool = %d, index = %d\n,", - pool, index); + pool, idx); /* First update our in-memory state first. */ kvp_update_mem_state(pool); record = kvp_pools[pool].records; /* Index starts with 0 */ - if (index >= kvp_pools[pool].num_records) { + if (idx >= kvp_pools[pool].num_records) { return (1); } - memcpy(key, record[index].key, key_size); - memcpy(value, record[index].value, value_size); + memcpy(key, record[idx].key, key_size); + memcpy(value, record[idx].value, value_size); return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 00:32:34 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02DF2392; Fri, 5 Dec 2014 00:32:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E27F4F61; Fri, 5 Dec 2014 00:32:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB50WXfd040351; Fri, 5 Dec 2014 00:32:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB50WXki040350; Fri, 5 Dec 2014 00:32:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412050032.sB50WXki040350@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 5 Dec 2014 00:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275492 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 00:32:34 -0000 Author: delphij Date: Fri Dec 5 00:32:33 2014 New Revision: 275492 URL: https://svnweb.freebsd.org/changeset/base/275492 Log: MFC r274172 (avg) fix l2arc compression buffers leak We have observed that arc_release() can be called concurrently with a l2arc in-flight write. Also, we have observed that arc_hdr_destroy() can be called from arc_write_done() for a zio with ZIO_FLAG_IO_REWRITE flag in similar circumstances. Previously the l2arc headers would be freed while leaking their associated compression buffers. Now the buffers are placed on l2arc_free_on_write list for delayed freeing. This is similar to what was already done to arc buffers that were supposed to be freed concurrently with in-flight writes of those buffers. In addition to fixing the discovered leaks this change also adds some protective code to assert that a compression buffer associated with a l2arc header is never leaked. A new kstat l2_cdata_free_on_write is added. It keeps a count of delayed compression buffer frees which previously would have been leaks. Tested by: Vitalij Satanivskij et al Requested by: many Sponsored by: HybridCluster / ClusterHQ This is a 10.1-RELEASE errata candidate. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Dec 4 23:27:29 2014 (r275491) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Dec 5 00:32:33 2014 (r275492) @@ -390,6 +390,7 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_evict_lock_retry; kstat_named_t arcstat_l2_evict_reading; kstat_named_t arcstat_l2_free_on_write; + kstat_named_t arcstat_l2_cdata_free_on_write; kstat_named_t arcstat_l2_abort_lowmem; kstat_named_t arcstat_l2_cksum_bad; kstat_named_t arcstat_l2_io_error; @@ -467,6 +468,7 @@ static arc_stats_t arc_stats = { { "l2_evict_lock_retry", KSTAT_DATA_UINT64 }, { "l2_evict_reading", KSTAT_DATA_UINT64 }, { "l2_free_on_write", KSTAT_DATA_UINT64 }, + { "l2_cdata_free_on_write", KSTAT_DATA_UINT64 }, { "l2_abort_lowmem", KSTAT_DATA_UINT64 }, { "l2_cksum_bad", KSTAT_DATA_UINT64 }, { "l2_io_error", KSTAT_DATA_UINT64 }, @@ -1658,6 +1660,21 @@ arc_buf_add_ref(arc_buf_t *buf, void* ta data, metadata, hits); } +static void +arc_buf_free_on_write(void *data, size_t size, + void (*free_func)(void *, size_t)) +{ + l2arc_data_free_t *df; + + df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); + df->l2df_data = data; + df->l2df_size = size; + df->l2df_func = free_func; + mutex_enter(&l2arc_free_on_write_mtx); + list_insert_head(l2arc_free_on_write, df); + mutex_exit(&l2arc_free_on_write_mtx); +} + /* * Free the arc data buffer. If it is an l2arc write in progress, * the buffer is placed on l2arc_free_on_write to be freed later. @@ -1668,14 +1685,7 @@ arc_buf_data_free(arc_buf_t *buf, void ( arc_buf_hdr_t *hdr = buf->b_hdr; if (HDR_L2_WRITING(hdr)) { - l2arc_data_free_t *df; - df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); - df->l2df_data = buf->b_data; - df->l2df_size = hdr->b_size; - df->l2df_func = free_func; - mutex_enter(&l2arc_free_on_write_mtx); - list_insert_head(l2arc_free_on_write, df); - mutex_exit(&l2arc_free_on_write_mtx); + arc_buf_free_on_write(buf->b_data, hdr->b_size, free_func); ARCSTAT_BUMP(arcstat_l2_free_on_write); } else { free_func(buf->b_data, hdr->b_size); @@ -1687,6 +1697,23 @@ arc_buf_data_free(arc_buf_t *buf, void ( * arc_buf_t off of the the arc_buf_hdr_t's list and free it. */ static void +arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr) +{ + l2arc_buf_hdr_t *l2hdr = hdr->b_l2hdr; + + ASSERT(MUTEX_HELD(&l2arc_buflist_mtx)); + + if (l2hdr->b_tmp_cdata == NULL) + return; + + ASSERT(HDR_L2_WRITING(hdr)); + arc_buf_free_on_write(l2hdr->b_tmp_cdata, hdr->b_size, + zio_data_buf_free); + ARCSTAT_BUMP(arcstat_l2_cdata_free_on_write); + l2hdr->b_tmp_cdata = NULL; +} + +static void arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t remove) { arc_buf_t **bufp; @@ -1785,6 +1812,7 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr) trim_map_free(l2hdr->b_dev->l2ad_vdev, l2hdr->b_daddr, hdr->b_size, 0); list_remove(l2hdr->b_dev->l2ad_buflist, hdr); + arc_buf_l2_cdata_free(hdr); ARCSTAT_INCR(arcstat_l2_size, -hdr->b_size); ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize); vdev_space_update(l2hdr->b_dev->l2ad_vdev, @@ -3678,6 +3706,7 @@ arc_release(arc_buf_t *buf, void *tag) l2hdr = hdr->b_l2hdr; if (l2hdr) { mutex_enter(&l2arc_buflist_mtx); + arc_buf_l2_cdata_free(hdr); hdr->b_l2hdr = NULL; list_remove(l2hdr->b_dev->l2ad_buflist, hdr); } @@ -4967,6 +4996,11 @@ top: ARCSTAT_INCR(arcstat_l2_asize, -abl2->b_asize); bytes_evicted += abl2->b_asize; ab->b_l2hdr = NULL; + /* + * We are destroying l2hdr, so ensure that + * its compressed buffer, if any, is not leaked. + */ + ASSERT(abl2->b_tmp_cdata == NULL); kmem_free(abl2, sizeof (l2arc_buf_hdr_t)); ARCSTAT_INCR(arcstat_l2_size, -ab->b_size); } @@ -5205,6 +5239,14 @@ l2arc_write_buffers(spa_t *spa, l2arc_de buf_data = l2hdr->b_tmp_cdata; buf_sz = l2hdr->b_asize; + /* + * If the data has not been compressed, then clear b_tmp_cdata + * to make sure that it points only to a temporary compression + * buffer. + */ + if (!L2ARC_IS_VALID_COMPRESS(l2hdr->b_compress)) + l2hdr->b_tmp_cdata = NULL; + /* Compression may have squashed the buffer to zero length. */ if (buf_sz != 0) { uint64_t buf_p_sz; @@ -5395,15 +5437,18 @@ l2arc_release_cdata_buf(arc_buf_hdr_t *a { l2arc_buf_hdr_t *l2hdr = ab->b_l2hdr; - if (l2hdr->b_compress == ZIO_COMPRESS_LZ4) { + ASSERT(L2ARC_IS_VALID_COMPRESS(l2hdr->b_compress)); + if (l2hdr->b_compress != ZIO_COMPRESS_EMPTY) { /* * If the data was compressed, then we've allocated a * temporary buffer for it, so now we need to release it. */ ASSERT(l2hdr->b_tmp_cdata != NULL); zio_data_buf_free(l2hdr->b_tmp_cdata, ab->b_size); + l2hdr->b_tmp_cdata = NULL; + } else { + ASSERT(l2hdr->b_tmp_cdata == NULL); } - l2hdr->b_tmp_cdata = NULL; } /* From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 07:23:28 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B20728F0; Fri, 5 Dec 2014 07:23:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D926D97; Fri, 5 Dec 2014 07:23:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57NSmY037504; Fri, 5 Dec 2014 07:23:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57NP66037487; Fri, 5 Dec 2014 07:23:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050723.sB57NP66037487@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Dec 2014 07:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275493 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:23:28 -0000 Author: mav Date: Fri Dec 5 07:23:25 2014 New Revision: 275493 URL: https://svnweb.freebsd.org/changeset/base/275493 Log: MFC r274785: Partially reconstruct Active/Standby clusting. In this mode one head is in Active state, supporting all commands, while another is in Standby state, supporting only minimal LUN discovery subset. It is still incomplete since Standby state requires reservation support, which is impossible to do right without having interlink between heads. But it allows to run some basic experiments. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_internal.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_ha.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_tpc_local.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl.c Fri Dec 5 07:23:25 2014 (r275493) @@ -357,7 +357,6 @@ static struct ctl_logical_block_provisio static int rcv_sync_msg; static int persis_offset; static uint8_t ctl_pause_rtr; -static int ctl_is_single = 1; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); static int worker_threads = -1; @@ -972,12 +971,42 @@ ctl_copy_sense_data(union ctl_ha_msg *sr } static int +ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct ctl_softc *softc = (struct ctl_softc *)arg1; + struct ctl_lun *lun; + int error, value, i; + + if (softc->flags & CTL_FLAG_ACTIVE_SHELF) + value = 0; + else + value = 1; + + error = sysctl_handle_int(oidp, &value, 0, req); + if ((error != 0) || (req->newptr == NULL)) + return (error); + + mtx_lock(&softc->ctl_lock); + if (value == 0) + softc->flags |= CTL_FLAG_ACTIVE_SHELF; + else + softc->flags &= ~CTL_FLAG_ACTIVE_SHELF; + STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + for (i = 0; i < CTL_MAX_INITIATORS; i++) + lun->pending_ua[i] |= CTL_UA_ASYM_ACC_CHANGE; + mtx_unlock(&lun->lun_lock); + } + mtx_unlock(&softc->ctl_lock); + return (0); +} + +static int ctl_init(void) { struct ctl_softc *softc; struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool; struct ctl_port *port; - uint8_t sc_id =0; int i, error, retval; //int isc_retval; @@ -1035,16 +1064,17 @@ ctl_init(void) * In Copan's HA scheme, the "master" and "slave" roles are * figured out through the slot the controller is in. Although it * is an active/active system, someone has to be in charge. - */ -#ifdef NEEDTOPORT - scmicro_rw(SCMICRO_GET_SHELF_ID, &sc_id); -#endif - - if (sc_id == 0) { - softc->flags |= CTL_FLAG_MASTER_SHELF; - persis_offset = 0; + */ + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "ha_id", CTLFLAG_RDTUN, &softc->ha_id, 0, + "HA head ID (0 - no HA)"); + if (softc->ha_id == 0) { + softc->flags |= CTL_FLAG_ACTIVE_SHELF; + softc->is_single = 1; + softc->port_offset = 0; } else - persis_offset = CTL_MAX_INITIATORS; + softc->port_offset = (softc->ha_id - 1) * CTL_MAX_PORTS; + persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; /* * XXX KDM need to figure out where we want to get our target ID @@ -1157,12 +1187,15 @@ ctl_init(void) port->max_targets = 15; port->max_target_id = 15; - if (ctl_port_register(&softc->ioctl_info.port, - (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) { + if (ctl_port_register(&softc->ioctl_info.port) != 0) { printf("ctl: ioctl front end registration failed, will " "continue anyway\n"); } + SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "ha_state", CTLTYPE_INT | CTLFLAG_RWTUN, + softc, 0, ctl_ha_state_sysctl, "I", "HA state for this head"); + #ifdef CTL_IO_DELAY if (sizeof(struct callout) > CTL_TIMER_BYTES) { printf("sizeof(struct callout) %zd > CTL_TIMER_BYTES %zd\n", @@ -1264,10 +1297,10 @@ ctl_close(struct cdev *dev, int flags, i int ctl_port_enable(ctl_port_type port_type) { - struct ctl_softc *softc; + struct ctl_softc *softc = control_softc; struct ctl_port *port; - if (ctl_is_single == 0) { + if (softc->is_single == 0) { union ctl_ha_msg msg_info; int isc_retval; @@ -1292,8 +1325,6 @@ ctl_port_enable(ctl_port_type port_type) #endif } - softc = control_softc; - STAILQ_FOREACH(port, &softc->port_list, links) { if (port_type & port->port_type) { @@ -7439,8 +7470,8 @@ ctl_report_tagret_port_groups(struct ctl { struct scsi_maintenance_in *cdb; int retval; - int alloc_len, ext, total_len = 0, g, p, pc, pg; - int num_target_port_groups, num_target_ports, single; + int alloc_len, ext, total_len = 0, g, p, pc, pg, gs, os; + int num_target_port_groups, num_target_ports; struct ctl_lun *lun; struct ctl_softc *softc; struct ctl_port *port; @@ -7474,8 +7505,7 @@ ctl_report_tagret_port_groups(struct ctl return(retval); } - single = ctl_is_single; - if (single) + if (softc->is_single) num_target_port_groups = 1; else num_target_port_groups = NUM_TARGET_PORT_GROUPS; @@ -7531,18 +7561,26 @@ ctl_report_tagret_port_groups(struct ctl tpg_desc = &rtg_ptr->groups[0]; } - pg = ctsio->io_hdr.nexus.targ_port / CTL_MAX_PORTS; mtx_lock(&softc->ctl_lock); + pg = softc->port_offset / CTL_MAX_PORTS; + if (softc->flags & CTL_FLAG_ACTIVE_SHELF) { + if (softc->ha_mode == CTL_HA_MODE_ACT_STBY) { + gs = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_STANDBY; + } else if (lun->flags & CTL_LUN_PRIMARY_SC) { + gs = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; + } else { + gs = TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } + } else { + gs = TPG_ASYMMETRIC_ACCESS_STANDBY; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } for (g = 0; g < num_target_port_groups; g++) { - if (g == pg) - tpg_desc->pref_state = TPG_PRIMARY | - TPG_ASYMMETRIC_ACCESS_OPTIMIZED; - else - tpg_desc->pref_state = - TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; - tpg_desc->support = TPG_AO_SUP; - if (!single) - tpg_desc->support |= TPG_AN_SUP; + tpg_desc->pref_state = (g == pg) ? gs : os; + tpg_desc->support = TPG_AO_SUP | TPG_AN_SUP | TPG_S_SUP; scsi_ulto2b(g + 1, tpg_desc->target_port_group); tpg_desc->status = TPG_IMPLICIT; pc = 0; @@ -10181,12 +10219,11 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s struct ctl_lun *lun; struct ctl_port *port; int data_len, num_target_ports, iid_len, id_len, g, pg, p; - int num_target_port_groups, single; + int num_target_port_groups; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - single = ctl_is_single; - if (single) + if (softc->is_single) num_target_port_groups = 1; else num_target_port_groups = NUM_TARGET_PORT_GROUPS; @@ -10246,10 +10283,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s pd = &sp->design[0]; mtx_lock(&softc->ctl_lock); - if (softc->flags & CTL_FLAG_MASTER_SHELF) - pg = 0; - else - pg = 1; + pg = softc->port_offset / CTL_MAX_PORTS; for (g = 0; g < num_target_port_groups; g++) { STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) @@ -11329,15 +11363,12 @@ ctl_scsiio_lun_check(struct ctl_softc *c * If this shelf is a secondary shelf controller, we have to reject * any media access commands. */ -#if 0 - /* No longer needed for HA */ - if (((ctl_softc->flags & CTL_FLAG_MASTER_SHELF) == 0) - && ((entry->flags & CTL_CMD_FLAG_OK_ON_SECONDARY) == 0)) { + if ((ctl_softc->flags & CTL_FLAG_ACTIVE_SHELF) == 0 && + (entry->flags & CTL_CMD_FLAG_OK_ON_SECONDARY) == 0) { ctl_set_lun_standby(ctsio); retval = 1; goto bailout; } -#endif if (entry->pattern & CTL_LUN_PAT_WRITE) { if (lun->flags & CTL_LUN_READONLY) { @@ -14392,7 +14423,7 @@ ctl_isc_start(struct ctl_ha_component *c // UNKNOWN->HA or UNKNOWN->SINGLE (bootstrap) if (c->state == CTL_HA_STATE_UNKNOWN ) { - ctl_is_single = 0; + control_softc->is_single = 0; if (ctl_ha_msg_create(CTL_HA_CHAN_CTL, ctl_isc_event_handler) != CTL_HA_STATUS_SUCCESS) { printf("ctl_isc_start: ctl_ha_msg_create failed.\n"); @@ -14402,14 +14433,14 @@ ctl_isc_start(struct ctl_ha_component *c && CTL_HA_STATE_IS_SINGLE(state)){ // HA->SINGLE transition ctl_failover(); - ctl_is_single = 1; + control_softc->is_single = 1; } else { printf("ctl_isc_start:Invalid state transition %X->%X\n", c->state, state); ret = CTL_HA_COMP_STATUS_ERROR; } if (CTL_HA_STATE_IS_SINGLE(state)) - ctl_is_single = 1; + control_softc->is_single = 1; c->state = state; c->status = ret; Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Fri Dec 5 07:23:25 2014 (r275493) @@ -800,12 +800,18 @@ const struct ctl_cmd_entry ctl_cmd_table /* 3B WRITE BUFFER */ {ctl_write_buffer, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_FLAG_DATA_OUT, CTL_LUN_PAT_NONE, 10, {0x1f, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 3C READ BUFFER */ {ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend.c Fri Dec 5 07:23:25 2014 (r275493) @@ -136,7 +136,7 @@ ctl_frontend_find(char *frontend_name) } int -ctl_port_register(struct ctl_port *port, int master_shelf) +ctl_port_register(struct ctl_port *port) { struct ctl_io_pool *pool; int port_num; @@ -193,7 +193,7 @@ error: STAILQ_INIT(&port->options); mtx_lock(&control_softc->ctl_lock); - port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS); + port->targ_port = port_num + control_softc->port_offset; STAILQ_INSERT_TAIL(&port->frontend->port_list, port, fe_links); STAILQ_INSERT_TAIL(&control_softc->port_list, port, links); control_softc->ctl_ports[port_num] = port; Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend.h Fri Dec 5 07:23:25 2014 (r275493) @@ -278,7 +278,7 @@ struct ctl_frontend * ctl_frontend_find( * This may block until resources are allocated. Called at FETD module load * time. Returns 0 for success, non-zero for failure. */ -int ctl_port_register(struct ctl_port *port, int master_SC); +int ctl_port_register(struct ctl_port *port); /* * Called at FETD module unload time. Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Dec 5 07:23:25 2014 (r275493) @@ -164,7 +164,7 @@ cfcs_init(void) port->max_targets = 1; port->max_target_id = 15; - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { printf("%s: ctl_port_register() failed with error %d!\n", __func__, retval); Modified: stable/10/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_internal.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend_internal.c Fri Dec 5 07:23:25 2014 (r275493) @@ -244,8 +244,6 @@ cfi_init(void) memset(softc, 0, sizeof(*softc)); mtx_init(&softc->lock, "CTL frontend mutex", NULL, MTX_DEF); - softc->flags |= CTL_FLAG_MASTER_SHELF; - STAILQ_INIT(&softc->lun_list); STAILQ_INIT(&softc->metatask_list); sprintf(softc->fe_name, "kernel"); @@ -264,7 +262,7 @@ cfi_init(void) port->max_targets = 15; port->max_target_id = 15; - if (ctl_port_register(port, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) + if (ctl_port_register(port) != 0) { printf("%s: internal frontend registration failed\n", __func__); return (0); Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:23:25 2014 (r275493) @@ -2054,7 +2054,7 @@ cfiscsi_ioctl_port_create(struct ctl_req desc->length = idlen; strlcpy(desc->identifier, target, idlen); - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { ctl_free_opts(&port->options); cfiscsi_target_release(ct); Modified: stable/10/sys/cam/ctl/ctl_ha.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ha.h Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_ha.h Fri Dec 5 07:23:25 2014 (r275493) @@ -38,6 +38,8 @@ /* * CTL High Availability Modes: * + * CTL_HA_MODE_ACT_STBY: One side is in Active state and processing commands, + * the other side is in Standby state, returning errors. * CTL_HA_MODE_SER_ONLY: Commands are serialized to the other side. Write * mirroring and read re-direction are assumed to * happen in the back end. @@ -46,6 +48,7 @@ */ typedef enum { + CTL_HA_MODE_ACT_STBY, CTL_HA_MODE_SER_ONLY, CTL_HA_MODE_XFER } ctl_ha_mode; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_private.h Fri Dec 5 07:23:25 2014 (r275493) @@ -442,7 +442,7 @@ struct ctl_lun { typedef enum { CTL_FLAG_REAL_SYNC = 0x02, - CTL_FLAG_MASTER_SHELF = 0x04 + CTL_FLAG_ACTIVE_SHELF = 0x04 } ctl_gen_flags; #define CTL_MAX_THREADS 16 @@ -467,6 +467,10 @@ struct ctl_softc { int num_luns; ctl_gen_flags flags; ctl_ha_mode ha_mode; + int ha_id; + int ha_state; + int is_single; + int port_offset; int inquiry_pq_no_lun; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; Modified: stable/10/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc_local.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_tpc_local.c Fri Dec 5 07:23:25 2014 (r275493) @@ -87,7 +87,6 @@ CTL_FRONTEND_DECLARE(ctltpc, tpcl_fronte static int tpcl_init(void) { - struct ctl_softc *softc = control_softc; struct tpcl_softc *tsoftc = &tpcl_softc; struct ctl_port *port; struct scsi_transportid_spi *tid; @@ -112,7 +111,7 @@ tpcl_init(void) port->max_target_id = 0; port->max_initiators = 1; - if (ctl_port_register(port, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) + if (ctl_port_register(port) != 0) { printf("%s: tpc frontend registration failed\n", __func__); return (0); Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/scsi_ctl.c Fri Dec 5 07:23:25 2014 (r275493) @@ -425,7 +425,7 @@ ctlfeasync(void *callback_arg, uint32_t printf("%s: calling ctl_port_register() for %s%d\n", __func__, cpi->dev_name, cpi->unit_number); #endif - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { printf("%s: ctl_port_register() failed with " "error %d!\n", __func__, retval); From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 07:24:18 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6952BA31; Fri, 5 Dec 2014 07:24:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE60DA7; Fri, 5 Dec 2014 07:24:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57OI83037683; Fri, 5 Dec 2014 07:24:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57OILB037682; Fri, 5 Dec 2014 07:24:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050724.sB57OILB037682@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Dec 2014 07:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275494 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:24:18 -0000 Author: mav Date: Fri Dec 5 07:24:17 2014 New Revision: 275494 URL: https://svnweb.freebsd.org/changeset/base/275494 Log: MFC r274795: Close race between cfiscsi_offline() and new connection arrival. Incoming connection should be either rejected or accepted and terminated. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:23:25 2014 (r275493) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:24:17 2014 (r275494) @@ -1064,6 +1064,8 @@ cfiscsi_session_terminate_tasks(struct c union ctl_io *io; int error, last, wait; + if (cs->cs_target == NULL) + return; /* No target yet, so nothing to do. */ io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); @@ -1247,11 +1249,7 @@ cfiscsi_session_new(struct cfiscsi_softc } mtx_lock(&softc->lock); - cs->cs_id = softc->last_session_id + 1; - softc->last_session_id++; - mtx_unlock(&softc->lock); - - mtx_lock(&softc->lock); + cs->cs_id = ++softc->last_session_id; TAILQ_INSERT_TAIL(&softc->sessions, cs, cs_next); mtx_unlock(&softc->lock); @@ -1429,14 +1427,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * return; } - if (ct->ct_online == 0) { - ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), - "%s: port offline", __func__); - cfiscsi_target_release(ct); - return; - } - #ifdef ICL_KERNEL_PROXY if (cihp->socket > 0 && cihp->connection_id > 0) { snprintf(ci->error_str, sizeof(ci->error_str), @@ -1448,7 +1438,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * if (cihp->socket == 0) { mtx_lock(&cfiscsi_softc.lock); TAILQ_FOREACH(cs, &cfiscsi_softc.sessions, cs_next) { - if (cs->cs_id == cihp->socket) + if (cs->cs_id == cihp->connection_id) break; } if (cs == NULL) { @@ -1473,7 +1463,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * #ifdef ICL_KERNEL_PROXY } #endif - cs->cs_target = ct; /* * First PDU of Full Feature phase has the same CmdSN as the last @@ -1505,6 +1494,19 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_isid[2], cihp->initiator_isid[3], cihp->initiator_isid[4], cihp->initiator_isid[5]); + mtx_lock(&softc->lock); + if (ct->ct_online == 0) { + mtx_unlock(&softc->lock); + cfiscsi_session_terminate(cs); + cfiscsi_target_release(ct); + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: port offline", __func__); + return; + } + cs->cs_target = ct; + mtx_unlock(&softc->lock); + refcount_acquire(&cs->cs_outstanding_ctl_pdus); restart: if (!cs->cs_terminating) { From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 07:25:03 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D01FFB66; Fri, 5 Dec 2014 07:25:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2E7FDB1; Fri, 5 Dec 2014 07:25:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57P3ka037870; Fri, 5 Dec 2014 07:25:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57P33k037867; Fri, 5 Dec 2014 07:25:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050725.sB57P33k037867@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Dec 2014 07:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275495 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:25:03 -0000 Author: mav Date: Fri Dec 5 07:25:02 2014 New Revision: 275495 URL: https://svnweb.freebsd.org/changeset/base/275495 Log: MFC r274805: Make cfiscsi_offline() synchronous, waiting for connections termination before return. This should make ctld restart more clean and predictable. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:24:17 2014 (r275494) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:25:02 2014 (r275495) @@ -1282,6 +1282,7 @@ cfiscsi_session_delete(struct cfiscsi_se mtx_lock(&softc->lock); TAILQ_REMOVE(&softc->sessions, cs, cs_next); + cv_signal(&softc->sessions_cv); mtx_unlock(&softc->lock); free(cs, M_CFISCSI); @@ -1298,6 +1299,7 @@ cfiscsi_init(void) bzero(softc, sizeof(*softc)); mtx_init(&softc->lock, "cfiscsi", NULL, MTX_DEF); + cv_init(&softc->sessions_cv, "cfiscsi_sessions"); #ifdef ICL_KERNEL_PROXY cv_init(&softc->accept_cv, "cfiscsi_accept"); #endif @@ -1382,6 +1384,14 @@ cfiscsi_offline(void *arg) if (cs->cs_target == ct) cfiscsi_session_terminate(cs); } + do { + TAILQ_FOREACH(cs, &softc->sessions, cs_next) { + if (cs->cs_target == ct) + break; + } + if (cs != NULL) + cv_wait(&softc->sessions_cv, &softc->lock); + } while (cs != NULL && ct->ct_online == 0); mtx_unlock(&softc->lock); if (online > 0) return; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Fri Dec 5 07:24:17 2014 (r275494) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Fri Dec 5 07:25:02 2014 (r275495) @@ -115,6 +115,7 @@ struct cfiscsi_softc { unsigned int last_session_id; TAILQ_HEAD(, cfiscsi_target) targets; TAILQ_HEAD(, cfiscsi_session) sessions; + struct cv sessions_cv; #ifdef ICL_KERNEL_PROXY struct icl_listen *listener; struct cv accept_cv; From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 07:29:32 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BD23CEE; Fri, 5 Dec 2014 07:29:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8809CDDB; Fri, 5 Dec 2014 07:29:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57TW1q038669; Fri, 5 Dec 2014 07:29:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57TWPP038668; Fri, 5 Dec 2014 07:29:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050729.sB57TWPP038668@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Dec 2014 07:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275496 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:29:32 -0000 Author: mav Date: Fri Dec 5 07:29:31 2014 New Revision: 275496 URL: https://svnweb.freebsd.org/changeset/base/275496 Log: MFC r274248: Remove unused assignments, noticed by Clang analyzer. Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Fri Dec 5 07:25:02 2014 (r275495) +++ stable/10/usr.sbin/ctld/ctld.c Fri Dec 5 07:29:31 2014 (r275496) @@ -896,7 +896,7 @@ void isns_register(struct isns *isns, struct isns *oldisns) { struct conf *conf = isns->i_conf; - int s, res; + int s; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -912,8 +912,8 @@ isns_register(struct isns *isns, struct if (oldisns == NULL || TAILQ_EMPTY(&oldisns->i_conf->conf_targets)) oldisns = isns; - res = isns_do_deregister(oldisns, s, hostname); - res = isns_do_register(isns, s, hostname); + isns_do_deregister(oldisns, s, hostname); + isns_do_register(isns, s, hostname); close(s); set_timeout(0, false); } @@ -938,8 +938,8 @@ isns_check(struct isns *isns) res = isns_do_check(isns, s, hostname); if (res < 0) { - res = isns_do_deregister(isns, s, hostname); - res = isns_do_register(isns, s, hostname); + isns_do_deregister(isns, s, hostname); + isns_do_register(isns, s, hostname); } close(s); set_timeout(0, false); @@ -949,7 +949,7 @@ void isns_deregister(struct isns *isns) { struct conf *conf = isns->i_conf; - int s, res; + int s; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -961,7 +961,7 @@ isns_deregister(struct isns *isns) return; gethostname(hostname, sizeof(hostname)); - res = isns_do_deregister(isns, s, hostname); + isns_do_deregister(isns, s, hostname); close(s); set_timeout(0, false); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 07:46:29 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51229FA8; Fri, 5 Dec 2014 07:46:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D815F86; Fri, 5 Dec 2014 07:46:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57kTKA048191; Fri, 5 Dec 2014 07:46:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57kT87048190; Fri, 5 Dec 2014 07:46:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050746.sB57kT87048190@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Dec 2014 07:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275497 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:46:29 -0000 Author: mav Date: Fri Dec 5 07:46:28 2014 New Revision: 275497 URL: https://svnweb.freebsd.org/changeset/base/275497 Log: MFC r268395: Pass correct command that should be aborted to ISPCTL_ABORT_CMD. This makes XPT_ABORT to work for me on initiator side of isp(4). Previous code was trying to abort the XPT_ABORT itself and failed. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Dec 5 07:29:31 2014 (r275496) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Dec 5 07:46:28 2014 (r275497) @@ -5107,7 +5107,7 @@ isp_action(struct cam_sim *sim, union cc break; #endif case XPT_SCSI_IO: - error = isp_control(isp, ISPCTL_ABORT_CMD, ccb); + error = isp_control(isp, ISPCTL_ABORT_CMD, accb); if (error) { ccb->ccb_h.status = CAM_UA_ABORT; } else { From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 07:48:23 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09F79178; Fri, 5 Dec 2014 07:48:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAC38F92; Fri, 5 Dec 2014 07:48:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57mMWE048571; Fri, 5 Dec 2014 07:48:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57mMKJ048570; Fri, 5 Dec 2014 07:48:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050748.sB57mMKJ048570@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Dec 2014 07:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275498 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:48:23 -0000 Author: mav Date: Fri Dec 5 07:48:22 2014 New Revision: 275498 URL: https://svnweb.freebsd.org/changeset/base/275498 Log: MFC r272937: Fix r272936 build with old GCC. Modified: stable/10/sys/dev/isp/isp_library.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Dec 5 07:46:28 2014 (r275497) +++ stable/10/sys/dev/isp/isp_library.c Fri Dec 5 07:48:22 2014 (r275498) @@ -2472,7 +2472,8 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c lp = NULL; if (fcp->isp_tgt_map[nphdl]) { - lp = &fcp->portdb[fcp->isp_tgt_map[nphdl] - 1]; + i = fcp->isp_tgt_map[nphdl] - 1; + lp = &fcp->portdb[i]; } else { /* * Make sure the addition of a new target mode entry doesn't duplicate entries From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 07:51:51 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF9684AD; Fri, 5 Dec 2014 07:51:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BF05A6; Fri, 5 Dec 2014 07:51:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57ppF7052716; Fri, 5 Dec 2014 07:51:51 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57ppkS052715; Fri, 5 Dec 2014 07:51:51 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412050751.sB57ppkS052715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Fri, 5 Dec 2014 07:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275500 - stable/10/usr.sbin/gpioctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:51:51 -0000 Author: rpaulo Date: Fri Dec 5 07:51:50 2014 New Revision: 275500 URL: https://svnweb.freebsd.org/changeset/base/275500 Log: MFC r275420: gpioctl: don't print the command line arguments. PR: 195330 Submitted by: Scott Ellis jumpnowtek at gmail.com Modified: stable/10/usr.sbin/gpioctl/gpioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/gpioctl/gpioctl.c ============================================================================== --- stable/10/usr.sbin/gpioctl/gpioctl.c Fri Dec 5 07:48:25 2014 (r275499) +++ stable/10/usr.sbin/gpioctl/gpioctl.c Fri Dec 5 07:51:50 2014 (r275500) @@ -224,9 +224,6 @@ main(int argc, char **argv) } argv += optind; argc -= optind; - for (i = 0; i < argc; i++) - printf("%d/%s\n", i, argv[i]); - if (ctlfile == NULL) ctlfile = defctlfile; From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 08:46:16 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 145A8141; Fri, 5 Dec 2014 08:46:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00BEF8CB; Fri, 5 Dec 2014 08:46:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB58kF1C079124; Fri, 5 Dec 2014 08:46:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB58kFcL079123; Fri, 5 Dec 2014 08:46:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412050846.sB58kFcL079123@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 08:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275501 - stable/10/tools/regression/pjdfstest X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 08:46:16 -0000 Author: ngie Date: Fri Dec 5 08:46:15 2014 New Revision: 275501 URL: https://svnweb.freebsd.org/changeset/base/275501 Log: MFC r271796 (by will): Use 'cc' for the C compiler instead of 'gcc'. Sponsored by: Spectra Logic MFSpectraBSD: 1079507 on 2014/07/24 Modified: stable/10/tools/regression/pjdfstest/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/pjdfstest/Makefile ============================================================================== --- stable/10/tools/regression/pjdfstest/Makefile Fri Dec 5 07:51:50 2014 (r275500) +++ stable/10/tools/regression/pjdfstest/Makefile Fri Dec 5 08:46:15 2014 (r275501) @@ -18,7 +18,7 @@ ${PROG}: ${PROG}.c echo "Unsupported operating system: ${OSTYPE}."; \ exit 1; \ fi; \ - cmd="gcc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ + cmd="cc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ echo $$cmd; \ $$cmd From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 09:30:08 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE721ABC; Fri, 5 Dec 2014 09:30:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAFA1D34; Fri, 5 Dec 2014 09:30:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB59U8jE000559; Fri, 5 Dec 2014 09:30:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB59U8R6000558; Fri, 5 Dec 2014 09:30:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412050930.sB59U8R6000558@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 5 Dec 2014 09:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275502 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 09:30:08 -0000 Author: kib Date: Fri Dec 5 09:30:07 2014 New Revision: 275502 URL: https://svnweb.freebsd.org/changeset/base/275502 Log: MFC r275206: Assert the state of the process lock and sigact mutex in kern_sigprocmask() and reschedule_signals(). Modified: stable/10/sys/kern/kern_sig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_sig.c ============================================================================== --- stable/10/sys/kern/kern_sig.c Fri Dec 5 08:46:15 2014 (r275501) +++ stable/10/sys/kern/kern_sig.c Fri Dec 5 09:30:07 2014 (r275502) @@ -1003,8 +1003,12 @@ kern_sigprocmask(struct thread *td, int int error; p = td->td_proc; - if (!(flags & SIGPROCMASK_PROC_LOCKED)) + if ((flags & SIGPROCMASK_PROC_LOCKED) != 0) + PROC_LOCK_ASSERT(p, MA_OWNED); + else PROC_LOCK(p); + mtx_assert(&p->p_sigacts->ps_mtx, (flags & SIGPROCMASK_PS_LOCKED) != 0 + ? MA_OWNED : MA_NOTOWNED); if (oset != NULL) *oset = td->td_sigmask; @@ -2519,9 +2523,11 @@ reschedule_signals(struct proc *p, sigse int sig; PROC_LOCK_ASSERT(p, MA_OWNED); + ps = p->p_sigacts; + mtx_assert(&ps->ps_mtx, (flags & SIGPROCMASK_PS_LOCKED) != 0 ? + MA_OWNED : MA_NOTOWNED); if (SIGISEMPTY(p->p_siglist)) return; - ps = p->p_sigacts; SIGSETAND(block, p->p_siglist); while ((sig = sig_ffs(&block)) != 0) { SIGDELSET(block, sig); From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 11:44:27 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80C78AB6; Fri, 5 Dec 2014 11:44:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A2AAE37; Fri, 5 Dec 2014 11:44:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5BiRB9070279; Fri, 5 Dec 2014 11:44:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5BiJFN070239; Fri, 5 Dec 2014 11:44:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051144.sB5BiJFN070239@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 11:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275504 - in stable/10: . contrib/pjdfstest contrib/pjdfstest/tests/chflags contrib/pjdfstest/tests/chmod contrib/pjdfstest/tests/chown contrib/pjdfstest/tests/ftruncate contrib/pjdfste... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 11:44:27 -0000 Author: ngie Date: Fri Dec 5 11:44:18 2014 New Revision: 275504 URL: https://svnweb.freebsd.org/changeset/base/275504 Log: MFC r272057,r272083,r272084,r272087,r274016: r272057: Import pjdfstest from ^/vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91 - Remove tools/regression/pjdfstest - Add upgrade directions for contrib/pjdfstest - Add a note to UPDATING for the move (the reachover Makefiles are coming soon) Functional differences: - ftruncate testcases are added from upstream (github) Non-functional differences: - The copyright for the project has been updated to 2012 - pjd's contact information has been updated Discussed with: -testing, jmmv, pjd Sponsored by: EMC / Isilon Storage Division r272083: Expect ELOOP on Darwin/Linux with "O_NOFOLLOW was specified and the target is a symbolic link" case. Assume EMLINK on the rest of the OSes (FreeBSD, Solaris, etc) Sponsored by: EMC / Isilon Storage Division r272084: Fix the executed testplan count Sponsored by: EMC / Isilon Storage Division r272087: Increase the memory disk size in the following testcases to avoid mount failures, which would cause cascade failures in the rest of the test run: link/15.t, open/19.t, mkdir/11.t, mkfifo/11.t, symlink/11.t Fail quickly in all of the testcases if mdconfig, mount, umount, etc fails to avoid issues similar to this in the future Submitted by: Casey Peel Sponsored by: EMC / Isilon Storage Division r274016: Integrate pjdfstest test suite execution into kyua pjdfstest execution is opt-in and must be done as root due to some of the assumptions made by the test suite and lack of error checking in the non-root case A description of how to execute pjdfstest with kyua is provided in share/pjdfstest/README Phabric: D824 (an earlier prototype patch) Relnotes: yes Sponsored by: EMC / Isilon Storage Division Added: stable/10/contrib/pjdfstest/ - copied from r272057, head/contrib/pjdfstest/ stable/10/share/doc/pjdfstest/ - copied from r274016, head/share/doc/pjdfstest/ stable/10/tests/sys/pjdfstest/ - copied from r274016, head/tests/sys/pjdfstest/ Modified: stable/10/UPDATING stable/10/contrib/pjdfstest/tests/chflags/12.t stable/10/contrib/pjdfstest/tests/chmod/09.t stable/10/contrib/pjdfstest/tests/chown/09.t stable/10/contrib/pjdfstest/tests/ftruncate/00.t stable/10/contrib/pjdfstest/tests/ftruncate/10.t stable/10/contrib/pjdfstest/tests/link/05.t stable/10/contrib/pjdfstest/tests/link/14.t stable/10/contrib/pjdfstest/tests/link/15.t stable/10/contrib/pjdfstest/tests/link/16.t stable/10/contrib/pjdfstest/tests/mkdir/09.t stable/10/contrib/pjdfstest/tests/mkdir/11.t stable/10/contrib/pjdfstest/tests/mkfifo/08.t stable/10/contrib/pjdfstest/tests/mkfifo/11.t stable/10/contrib/pjdfstest/tests/open/14.t stable/10/contrib/pjdfstest/tests/open/15.t stable/10/contrib/pjdfstest/tests/open/16.t stable/10/contrib/pjdfstest/tests/open/19.t stable/10/contrib/pjdfstest/tests/rename/15.t stable/10/contrib/pjdfstest/tests/rename/16.t stable/10/contrib/pjdfstest/tests/rmdir/13.t stable/10/contrib/pjdfstest/tests/rmdir/14.t stable/10/contrib/pjdfstest/tests/symlink/10.t stable/10/contrib/pjdfstest/tests/symlink/11.t stable/10/contrib/pjdfstest/tests/truncate/10.t stable/10/contrib/pjdfstest/tests/unlink/12.t stable/10/etc/mtree/BSD.tests.dist stable/10/share/doc/Makefile stable/10/tests/sys/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/UPDATING Fri Dec 5 11:44:18 2014 (r275504) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20141205: + pjdfstest has been integrated into kyua as an opt-in test suite. + Please see share/doc/pjdfstest/README for a more details on how to + execute it. + 20141118: 10.1-RELEASE. Modified: stable/10/contrib/pjdfstest/tests/chflags/12.t ============================================================================== --- head/contrib/pjdfstest/tests/chflags/12.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/chflags/12.t Fri Dec 5 11:44:18 2014 (r275504) @@ -16,8 +16,8 @@ FreeBSD:UFS) n1=`namegen` expect 0 mkdir ${n0} 0755 - n=`mdconfig -a -n -t malloc -s 1m` - newfs /dev/md${n} >/dev/null + n=`mdconfig -a -n -t malloc -s 1m` || exit + newfs /dev/md${n} >/dev/null || exit mount /dev/md${n} ${n0} expect 0 create ${n0}/${n1} 0644 expect 0 chflags ${n0}/${n1} UF_IMMUTABLE @@ -34,7 +34,7 @@ FreeBSD:UFS) expect none stat ${n0}/${n1} flags expect 0 unlink ${n0}/${n1} umount /dev/md${n} - mdconfig -d -u ${n} + mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} ;; FreeBSD:ZFS) @@ -43,7 +43,7 @@ FreeBSD:ZFS) n0=`namegen` n1=`namegen` - n=`mdconfig -a -n -t malloc -s 128m` + n=`mdconfig -a -n -t malloc -s 128m` || exit zpool create ${n0} /dev/md${n} expect 0 create /${n0}/${n1} 0644 expect 0 chflags /${n0}/${n1} UF_NODUMP @@ -60,7 +60,7 @@ FreeBSD:ZFS) expect none stat /${n0}/${n1} flags expect 0 unlink /${n0}/${n1} zpool destroy ${n0} - mdconfig -d -u ${n} + mdconfig -d -u ${n} || exit ;; *) quick_exit Modified: stable/10/contrib/pjdfstest/tests/chmod/09.t ============================================================================== --- head/contrib/pjdfstest/tests/chmod/09.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/chmod/09.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 chmod ${n0}/${n1} 0640 expect 0640 stat ${n0}/${n1} mode @@ -33,5 +33,5 @@ expect 0 lchmod ${n0}/${n1} 0640 expect 0640 stat ${n0}/${n1} mode expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/chown/09.t ============================================================================== --- head/contrib/pjdfstest/tests/chown/09.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/chown/09.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 chown ${n0}/${n1} 65534 65534 expect 65534,65534 stat ${n0}/${n1} uid,gid @@ -28,5 +28,5 @@ expect 0 chown ${n0}/${n1} 65533 65533 expect 65533,65533 stat ${n0}/${n1} uid,gid expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/ftruncate/00.t ============================================================================== --- head/contrib/pjdfstest/tests/ftruncate/00.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/ftruncate/00.t Fri Dec 5 11:44:18 2014 (r275504) @@ -6,7 +6,7 @@ desc="ftruncate descrease/increase file dir=`dirname $0` . ${dir}/../misc.sh -echo "1..21" +echo "1..26" n0=`namegen` n1=`namegen` Modified: stable/10/contrib/pjdfstest/tests/ftruncate/10.t ============================================================================== --- head/contrib/pjdfstest/tests/ftruncate/10.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/ftruncate/10.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 truncate ${n0}/${n1} 123 expect 123 stat ${n0}/${n1} size @@ -28,5 +28,5 @@ expect 0 truncate ${n0}/${n1} 1234 expect 1234 stat ${n0}/${n1} size expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/link/05.t ============================================================================== --- head/contrib/pjdfstest/tests/link/05.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/link/05.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs -i 1 /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs -i 1 /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 i=1 while :; do @@ -32,5 +32,5 @@ test_check $i -eq 32767 expect EMLINK link ${n0}/${n1} ${n0}/${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/link/14.t ============================================================================== --- head/contrib/pjdfstest/tests/link/14.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/link/14.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect EXDEV link ${n0}/${n1} ${n2} expect 0 unlink ${n0}/${n1} @@ -25,5 +25,5 @@ expect 0 create ${n1} 0644 expect EXDEV link ${n1} ${n0}/${n2} expect 0 unlink ${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/link/15.t ============================================================================== --- head/contrib/pjdfstest/tests/link/15.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/link/15.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 i=0 while :; do @@ -29,5 +29,5 @@ while :; do done expect ENOSPC link ${n0}/${n1} ${n0}/${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/link/16.t ============================================================================== --- head/contrib/pjdfstest/tests/link/16.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/link/16.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 link ${n0}/${n1} ${n0}/${n2} @@ -30,5 +30,5 @@ expect 0 unlink ${n0}/${n2} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/mkdir/09.t ============================================================================== --- head/contrib/pjdfstest/tests/mkdir/09.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/mkdir/09.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkdir ${n0}/${n1} 0755 expect 0 rmdir ${n0}/${n1} mount -ur /dev/md${n} @@ -25,5 +25,5 @@ mount -uw /dev/md${n} expect 0 mkdir ${n0}/${n1} 0755 expect 0 rmdir ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/mkdir/11.t ============================================================================== --- head/contrib/pjdfstest/tests/mkdir/11.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/mkdir/11.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do mkdir ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC mkdir ${n0}/${n1} 0755 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/mkfifo/08.t ============================================================================== --- head/contrib/pjdfstest/tests/mkfifo/08.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/mkfifo/08.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkfifo ${n0}/${n1} 0644 expect 0 unlink ${n0}/${n1} mount -ur /dev/md${n} @@ -25,5 +25,5 @@ mount -uw /dev/md${n} expect 0 mkfifo ${n0}/${n1} 0644 expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/mkfifo/11.t ============================================================================== --- head/contrib/pjdfstest/tests/mkfifo/11.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/mkfifo/11.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do mkfifo ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC mkfifo ${n0}/${n1} 0644 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/open/14.t ============================================================================== --- head/contrib/pjdfstest/tests/open/14.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/open/14.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 open ${n0}/${n1} O_WRONLY expect 0 open ${n0}/${n1} O_RDWR @@ -28,5 +28,5 @@ expect EROFS open ${n0}/${n1} O_RDONLY,O mount -uw /dev/md${n} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/open/15.t ============================================================================== --- head/contrib/pjdfstest/tests/open/15.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/open/15.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 open ${n0}/${n1} O_RDONLY,O_CREAT 0644 expect 0 unlink ${n0}/${n1} mount -ur /dev/md${n} expect EROFS open ${n0}/${n1} O_RDONLY,O_CREAT 0644 mount -uw /dev/md${n} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/open/16.t ============================================================================== --- head/contrib/pjdfstest/tests/open/16.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/open/16.t Fri Dec 5 11:44:18 2014 (r275504) @@ -1,19 +1,27 @@ #!/bin/sh # $FreeBSD: head/tools/regression/pjdfstest/tests/open/16.t 219621 2011-03-13 19:35:13Z pjd $ -desc="open returns ELOOP when O_NOFOLLOW was specified and the target is a symbolic link" - dir=`dirname $0` . ${dir}/../misc.sh +case "${os}" in +Darwin|Linux) + error=ELOOP + ;; +*) + error=EMLINK + ;; +esac +desc="open returns $error when O_NOFOLLOW was specified and the target is a symbolic link" + echo "1..6" n0=`namegen` n1=`namegen` expect 0 symlink ${n0} ${n1} -expect ELOOP open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 -expect ELOOP open ${n1} O_RDONLY,O_NOFOLLOW -expect ELOOP open ${n1} O_WRONLY,O_NOFOLLOW -expect ELOOP open ${n1} O_RDWR,O_NOFOLLOW +expect $error open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 +expect $error open ${n1} O_RDONLY,O_NOFOLLOW +expect $error open ${n1} O_WRONLY,O_NOFOLLOW +expect $error open ${n1} O_RDWR,O_NOFOLLOW expect 0 unlink ${n1} Modified: stable/10/contrib/pjdfstest/tests/open/19.t ============================================================================== --- head/contrib/pjdfstest/tests/open/19.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/open/19.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do touch ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC open ${n0}/${i} O_RDONLY,O_CREAT 0644 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/rename/15.t ============================================================================== --- head/contrib/pjdfstest/tests/rename/15.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/rename/15.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit for type in regular dir fifo block char socket symlink; do create_file ${type} ${n0}/${n1} @@ -30,5 +30,5 @@ for type in regular dir fifo block char done umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/rename/16.t ============================================================================== --- head/contrib/pjdfstest/tests/rename/16.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/rename/16.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 mount -ur /dev/md${n} @@ -28,5 +28,5 @@ expect EROFS rename ${n2} ${n0}/${n2} expect 0 unlink ${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/rmdir/13.t ============================================================================== --- head/contrib/pjdfstest/tests/rmdir/13.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/rmdir/13.t Fri Dec 5 11:44:18 2014 (r275504) @@ -13,10 +13,10 @@ echo "1..3" n0=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect EBUSY rmdir ${n0} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/rmdir/14.t ============================================================================== --- head/contrib/pjdfstest/tests/rmdir/14.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/rmdir/14.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkdir ${n0}/${n1} 0755 mount -ur /dev/md${n} expect EROFS rmdir ${n0}/${n1} mount -uw /dev/md${n} expect 0 rmdir ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/symlink/10.t ============================================================================== --- head/contrib/pjdfstest/tests/symlink/10.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/symlink/10.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 symlink test ${n0}/${n1} expect 0 unlink ${n0}/${n1} @@ -28,5 +28,5 @@ expect 0 symlink test ${n0}/${n1} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/symlink/11.t ============================================================================== --- head/contrib/pjdfstest/tests/symlink/11.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/symlink/11.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do ln -s test ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC symlink test ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/truncate/10.t ============================================================================== --- head/contrib/pjdfstest/tests/truncate/10.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/truncate/10.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 truncate ${n0}/${n1} 123 expect 123 stat ${n0}/${n1} size @@ -28,5 +28,5 @@ expect 0 truncate ${n0}/${n1} 1234 expect 1234 stat ${n0}/${n1} size expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/unlink/12.t ============================================================================== --- head/contrib/pjdfstest/tests/unlink/12.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/unlink/12.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 mount -ur /dev/md${n} expect EROFS unlink ${n0}/${n1} mount -uw /dev/md${n} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/etc/mtree/BSD.tests.dist Fri Dec 5 11:44:18 2014 (r275504) @@ -17,6 +17,8 @@ doc atf .. + pjdfstest + .. .. .. tests @@ -131,6 +133,38 @@ .. netinet .. + pjdfstest + chflags + .. + chmod + .. + chown + .. + ftruncate + .. + granular + .. + link + .. + mkdir + .. + mkfifo + .. + mknod + .. + open + .. + rename + .. + rmdir + .. + symlink + .. + truncate + .. + unlink + .. + .. .. usr.bin apply Modified: stable/10/share/doc/Makefile ============================================================================== --- stable/10/share/doc/Makefile Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/share/doc/Makefile Fri Dec 5 11:44:18 2014 (r275504) @@ -7,10 +7,12 @@ SUBDIR= ${_IPv6} \ ${_atf} \ legal \ ${_llvm} \ + ${_pjdfstest} \ ${_roffdocs} .if ${MK_TESTS} != "no" _atf= atf +_pjdfstest= pjdfstest .endif .if ${MK_CLANG} != "no" Modified: stable/10/tests/sys/Makefile ============================================================================== --- stable/10/tests/sys/Makefile Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/tests/sys/Makefile Fri Dec 5 11:44:18 2014 (r275504) @@ -2,8 +2,12 @@ .include +TESTSDIR= ${TESTSBASE}/sys + TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= netinet -TESTSDIR= ${TESTSBASE}/sys + +# Items not integrated into kyua runs by default +SUBDIR+= pjdfstest .include Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Dec 5 11:44:18 2014 (r275504) @@ -4016,9 +4016,10 @@ OLD_FILES+=usr/share/sendmail/cf/sitecon OLD_FILES+=usr/share/sendmail/cf/siteconfig/uucp.ucbvax.m4 .endif -#.if ${MK_SHAREDOCS} == no -# to be filled in -#.endif +.if ${MK_SHAREDOCS} == no +OLD_FILES+=usr/share/doc/pjdfstest/README +OLD_DIRS+=usr/share/doc/pjdfstest +.endif #.if ${MK_SYSCONS} == no # to be filled in From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 12:23:32 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D98F29AE; Fri, 5 Dec 2014 12:23:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C32942E4; Fri, 5 Dec 2014 12:23:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5CNWhF089030; Fri, 5 Dec 2014 12:23:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5CNTfe089013; Fri, 5 Dec 2014 12:23:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051223.sB5CNTfe089013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 12:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275508 - in stable/10: contrib/telnet/arpa contrib/telnet/telnet contrib/telnet/telnetd contrib/tzcode/stdtime libexec/telnetd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:23:33 -0000 Author: ngie Date: Fri Dec 5 12:23:29 2014 New Revision: 275508 URL: https://svnweb.freebsd.org/changeset/base/275508 Log: MFC r274364: Add baud rate support to telnet(1) This implements part of RFC-2217 It's based off a patch originally written by Sujal Patel at Isilon, and contributions from other Isilon employees. PR: 173728 Phabric: D995 Reviewed by: markj, markm Sponsored by: EMC / Isilon Storage Division Added: stable/10/contrib/telnet/telnet/baud.h - copied unchanged from r274364, head/contrib/telnet/telnet/baud.h Modified: stable/10/contrib/telnet/arpa/telnet.h stable/10/contrib/telnet/telnet/commands.c stable/10/contrib/telnet/telnet/externs.h stable/10/contrib/telnet/telnet/main.c stable/10/contrib/telnet/telnet/sys_bsd.c stable/10/contrib/telnet/telnet/telnet.1 stable/10/contrib/telnet/telnet/telnet.c stable/10/contrib/telnet/telnet/types.h stable/10/contrib/telnet/telnetd/sys_term.c stable/10/contrib/tzcode/stdtime/localtime.c stable/10/libexec/telnetd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/telnet/arpa/telnet.h ============================================================================== --- stable/10/contrib/telnet/arpa/telnet.h Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/arpa/telnet.h Fri Dec 5 12:23:29 2014 (r275508) @@ -127,6 +127,7 @@ extern char *telcmds[]; #define TELOPT_KERMIT 47 /* RFC2840 - Kermit */ #define TELOPT_EXOPL 255 /* extended-options-list */ +#define COMPORT_SET_BAUDRATE 1 /* RFC2217 - Com Port Set Baud Rate */ #define NTELOPTS (1+TELOPT_KERMIT) #ifdef TELOPTS Copied: stable/10/contrib/telnet/telnet/baud.h (from r274364, head/contrib/telnet/telnet/baud.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/telnet/telnet/baud.h Fri Dec 5 12:23:29 2014 (r275508, copy of r274364, head/contrib/telnet/telnet/baud.h) @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014 EMC Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). + */ +#if B4800 != 4800 +#define DECODE_BAUD +#endif + +#ifdef DECODE_BAUD +#ifndef B7200 +#define B7200 B4800 +#endif + +#ifndef B14400 +#define B14400 B9600 +#endif + +#ifndef B19200 +#define B19200 B14400 +#endif + +#ifndef B28800 +#define B28800 B19200 +#endif + +#ifndef B38400 +#define B38400 B28800 +#endif + +#ifndef B57600 +#define B57600 B38400 +#endif + +#ifndef B76800 +#define B76800 B57600 +#endif + +#ifndef B115200 +#define B115200 B76800 +#endif + +#ifndef B115200 +#define B115200 B76800 +#endif +#endif + +#ifndef B230400 +#define B230400 B115200 +#endif + +/* + * A table of available terminal speeds + */ +struct termspeeds termspeeds[] = { + { 0, B0 }, + { 50, B50 }, + { 75, B75 }, + { 110, B110 }, + { 134, B134 }, + { 150, B150 }, + { 200, B200 }, + { 300, B300 }, + { 600, B600 }, + { 1200, B1200 }, + { 1800, B1800 }, + { 2400, B2400 }, + { 4800, B4800 }, +#ifdef B7200 + { 7200, B7200 }, +#endif + { 9600, B9600 }, +#ifdef B14400 + { 14400, B14400 }, +#endif +#ifdef B19200 + { 19200, B19200 }, +#endif +#ifdef B28800 + { 28800, B28800 }, +#endif +#ifdef B38400 + { 38400, B38400 }, +#endif +#ifdef B57600 + { 57600, B57600 }, +#endif +#ifdef B115200 + { 115200, B115200 }, +#endif +#ifdef B230400 + { 230400, B230400 }, +#endif + { -1, 0 } +}; Modified: stable/10/contrib/telnet/telnet/commands.c ============================================================================== --- stable/10/contrib/telnet/telnet/commands.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/commands.c Fri Dec 5 12:23:29 2014 (r275508) @@ -896,6 +896,7 @@ static struct setlist Setlist[] = { { "forw1", "alternate end of line character", NULL, termForw1Charp }, { "forw2", "alternate end of line character", NULL, termForw2Charp }, { "ayt", "alternate AYT character", NULL, termAytCharp }, + { "baudrate", "set remote baud rate", DoBaudRate, ComPortBaudRate }, { NULL, NULL, NULL, NULL } }; Modified: stable/10/contrib/telnet/telnet/externs.h ============================================================================== --- stable/10/contrib/telnet/telnet/externs.h Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/externs.h Fri Dec 5 12:23:29 2014 (r275508) @@ -231,6 +231,10 @@ extern unsigned char NetTraceFile[]; /* Name of file where debugging output goes */ extern void SetNetTrace(char *); /* Function to change where debugging goes */ +extern unsigned char + ComPortBaudRate[]; /* Baud rate of the remote end */ +extern void + DoBaudRate(char *); /* Function to set the baud rate of the remote end */ extern jmp_buf toplevel; /* For error conditions. */ @@ -475,6 +479,16 @@ extern cc_t termAytChar; # endif #endif +typedef struct { + int + system, /* what the current time is */ + echotoggle, /* last time user entered echo character */ + modenegotiated, /* last time operating mode negotiated */ + didnetreceive, /* last time we read data from network */ + gotDM; /* when did we last see a data mark */ +} Clocks; + +extern Clocks clocks; /* Ring buffer structures which are shared */ Modified: stable/10/contrib/telnet/telnet/main.c ============================================================================== --- stable/10/contrib/telnet/telnet/main.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/main.c Fri Dec 5 12:23:29 2014 (r275508) @@ -91,10 +91,10 @@ usage(void) fprintf(stderr, "usage: %s %s%s%s%s\n", prompt, #ifdef AUTHENTICATION - "[-4] [-6] [-8] [-E] [-K] [-L] [-N] [-S tos] [-X atype] [-c] [-d]", - "\n\t[-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] ", + "[-4] [-6] [-8] [-B baudrate] [-E] [-K] [-L] [-N] [-S tos] [-X atype]", + "\n\t[-c] [-d] [-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] ", #else - "[-4] [-6] [-8] [-E] [-L] [-N] [-S tos] [-c] [-d]", + "[-4] [-6] [-8] [-B baudrate] [-E] [-L] [-N] [-S tos] [-c] [-d]", "\n\t[-e char] [-l user] [-n tracefile] ", #endif "[-r] [-s src_addr] [-u] ", @@ -154,7 +154,7 @@ main(int argc, char *argv[]) #define IPSECOPT #endif while ((ch = getopt(argc, argv, - "468EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1) + "468B:EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1) #undef IPSECOPT { switch(ch) { @@ -169,6 +169,9 @@ main(int argc, char *argv[]) case '8': eight = 3; /* binary output and input */ break; + case 'B': + DoBaudRate(optarg); + break; case 'E': rlogin = escape = _POSIX_VDISABLE; break; Modified: stable/10/contrib/telnet/telnet/sys_bsd.c ============================================================================== --- stable/10/contrib/telnet/telnet/sys_bsd.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/sys_bsd.c Fri Dec 5 12:23:29 2014 (r275508) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "defines.h" #include "externs.h" #include "types.h" +#include "baud.h" int tout, /* Output file descriptor */ @@ -682,71 +683,6 @@ TerminalNewMode(int f) } -/* - * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). - */ -#if B4800 != 4800 -#define DECODE_BAUD -#endif - -#ifdef DECODE_BAUD -#ifndef B7200 -#define B7200 B4800 -#endif - -#ifndef B14400 -#define B14400 B9600 -#endif - -#ifndef B19200 -# define B19200 B14400 -#endif - -#ifndef B28800 -#define B28800 B19200 -#endif - -#ifndef B38400 -# define B38400 B28800 -#endif - -#ifndef B57600 -#define B57600 B38400 -#endif - -#ifndef B76800 -#define B76800 B57600 -#endif - -#ifndef B115200 -#define B115200 B76800 -#endif - -#ifndef B230400 -#define B230400 B115200 -#endif - - -/* - * This code assumes that the values B0, B50, B75... - * are in ascending order. They do not have to be - * contiguous. - */ -struct termspeeds { - long speed; - long value; -} termspeeds[] = { - { 0, B0 }, { 50, B50 }, { 75, B75 }, - { 110, B110 }, { 134, B134 }, { 150, B150 }, - { 200, B200 }, { 300, B300 }, { 600, B600 }, - { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, - { 4800, B4800 }, { 7200, B7200 }, { 9600, B9600 }, - { 14400, B14400 }, { 19200, B19200 }, { 28800, B28800 }, - { 38400, B38400 }, { 57600, B57600 }, { 115200, B115200 }, - { 230400, B230400 }, { -1, B230400 } -}; -#endif /* DECODE_BAUD */ - void TerminalSpeeds(long *ispeed, long *ospeed) { Modified: stable/10/contrib/telnet/telnet/telnet.1 ============================================================================== --- stable/10/contrib/telnet/telnet/telnet.1 Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/telnet.1 Fri Dec 5 12:23:29 2014 (r275508) @@ -43,6 +43,7 @@ protocol .Sh SYNOPSIS .Nm .Op Fl 468EFKLNacdfruxy +.Op Fl B Ar baudrate .Op Fl S Ar tos .Op Fl X Ar authtype .Op Fl e Ar escapechar @@ -89,6 +90,9 @@ This causes an attempt to negotiate the .Dv TELNET BINARY option on both input and output. +.It Fl B Ar baudrate +Sets the baud rate to +.Ar baudrate . .It Fl E Stops any character from being recognized as an escape character. .It Fl F Modified: stable/10/contrib/telnet/telnet/telnet.c ============================================================================== --- stable/10/contrib/telnet/telnet/telnet.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/telnet.c Fri Dec 5 12:23:29 2014 (r275508) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "ring.h" @@ -68,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include - + #define strip(x) ((my_want_state_is_wont(TELOPT_BINARY)) ? ((x)&0x7f) : (x)) static unsigned char subbuffer[SUBBUFSIZE], @@ -162,7 +163,7 @@ static int is_unique(char *, char **, ch */ Clocks clocks; - + /* * Initialize telnet environment. */ @@ -196,7 +197,7 @@ init_telnet(void) flushline = 1; telrcv_state = TS_DATA; } - + /* * These routines are in charge of sending option negotiations @@ -206,6 +207,42 @@ init_telnet(void) * is in disagreement as to what the current state should be. */ +unsigned char ComPortBaudRate[256]; + +void +DoBaudRate(char *arg) +{ + char *temp, temp2[10]; + int i; + uint32_t baudrate; + + errno = 0; + baudrate = (uint32_t)strtol(arg, &temp, 10); + if (temp[0] != '\0' || (baudrate == 0 && errno != 0)) + ExitString("Invalid baud rate provided.\n", 1); + + for (i = 1; termspeeds[i].speed != -1; i++) + if (baudrate == termspeeds[i].speed) + break; + if (termspeeds[i].speed == -1) + ExitString("Invalid baud rate provided.\n", 1); + + strlcpy(ComPortBaudRate, arg, sizeof(ComPortBaudRate)); + + if (NETROOM() < sizeof(temp2)) { + ExitString("No room in buffer for baud rate.\n", 1); + /* NOTREACHED */ + } + + snprintf(temp2, sizeof(temp2), "%c%c%c%c....%c%c", IAC, SB, TELOPT_COMPORT, + COMPORT_SET_BAUDRATE, IAC, SE); + + baudrate = htonl(baudrate); + memcpy(&temp2[4], &baudrate, sizeof(baudrate)); + ring_supply_data(&netoring, temp2, sizeof(temp2)); + printsub('>', &temp[2], sizeof(temp2) - 2); +} + void send_do(int c, int init) { @@ -1084,7 +1121,7 @@ lm_mode(unsigned char *cmd, int len, int setconnmode(0); /* set changed mode */ } - + /* * slc() @@ -1628,7 +1665,7 @@ env_opt_end(int emptyok) } } - + int telrcv(void) @@ -2013,7 +2050,7 @@ telsnd(void) ring_consumed(&ttyiring, count); return returnValue||count; /* Non-zero if we did anything */ } - + /* * Scheduler() * Modified: stable/10/contrib/telnet/telnet/types.h ============================================================================== --- stable/10/contrib/telnet/telnet/types.h Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/types.h Fri Dec 5 12:23:29 2014 (r275508) @@ -40,13 +40,9 @@ typedef struct { extern Modelist modelist[]; -typedef struct { - int - system, /* what the current time is */ - echotoggle, /* last time user entered echo character */ - modenegotiated, /* last time operating mode negotiated */ - didnetreceive, /* last time we read data from network */ - gotDM; /* when did we last see a data mark */ -} Clocks; +struct termspeeds { + int speed; + int value; +}; -extern Clocks clocks; +extern struct termspeeds termspeeds[]; Modified: stable/10/contrib/telnet/telnetd/sys_term.c ============================================================================== --- stable/10/contrib/telnet/telnetd/sys_term.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnetd/sys_term.c Fri Dec 5 12:23:29 2014 (r275508) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include "telnetd.h" #include "pathnames.h" +#include "types.h" +#include "baud.h" #ifdef AUTHENTICATION #include @@ -743,56 +745,6 @@ tty_iscrnl(void) #endif } -/* - * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). - */ -#if B4800 != 4800 -#define DECODE_BAUD -#endif - -#ifdef DECODE_BAUD - -/* - * A table of available terminal speeds - */ -struct termspeeds { - int speed; - int value; -} termspeeds[] = { - { 0, B0 }, { 50, B50 }, { 75, B75 }, - { 110, B110 }, { 134, B134 }, { 150, B150 }, - { 200, B200 }, { 300, B300 }, { 600, B600 }, - { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, - { 4800, B4800 }, -#ifdef B7200 - { 7200, B7200 }, -#endif - { 9600, B9600 }, -#ifdef B14400 - { 14400, B14400 }, -#endif -#ifdef B19200 - { 19200, B19200 }, -#endif -#ifdef B28800 - { 28800, B28800 }, -#endif -#ifdef B38400 - { 38400, B38400 }, -#endif -#ifdef B57600 - { 57600, B57600 }, -#endif -#ifdef B115200 - { 115200, B115200 }, -#endif -#ifdef B230400 - { 230400, B230400 }, -#endif - { -1, 0 } -}; -#endif /* DECODE_BAUD */ - void tty_tspeed(int val) { Modified: stable/10/contrib/tzcode/stdtime/localtime.c ============================================================================== --- stable/10/contrib/tzcode/stdtime/localtime.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/tzcode/stdtime/localtime.c Fri Dec 5 12:23:29 2014 (r275508) @@ -1792,7 +1792,11 @@ int delta; number0 = *number; *number += delta; - return (*number < number0) != (delta < 0); + if ((*number < number0) != (delta < 0)) { + errno = EOVERFLOW; + return (1); + } + return (0); } static int @@ -1804,7 +1808,11 @@ int delta; number0 = *number; *number += delta; - return (*number < number0) != (delta < 0); + if ((*number < number0) != (delta < 0)) { + errno = EOVERFLOW; + return (1); + } + return (0); } static int Modified: stable/10/libexec/telnetd/Makefile ============================================================================== --- stable/10/libexec/telnetd/Makefile Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/libexec/telnetd/Makefile Fri Dec 5 12:23:29 2014 (r275508) @@ -25,6 +25,7 @@ CFLAGS+= -DINET6 .endif CFLAGS+= -I${TELNETDIR} +CFLAGS+= -I${TELNETDIR}/telnet LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 12:25:37 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD5FAB75; Fri, 5 Dec 2014 12:25:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A983B30E; Fri, 5 Dec 2014 12:25:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5CPbFp089442; Fri, 5 Dec 2014 12:25:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5CPbCN089441; Fri, 5 Dec 2014 12:25:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051225.sB5CPbCN089441@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 12:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275509 - stable/10/contrib/tzcode/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:25:37 -0000 Author: ngie Date: Fri Dec 5 12:25:36 2014 New Revision: 275509 URL: https://svnweb.freebsd.org/changeset/base/275509 Log: MFC r274365: Revert WiP to contrib/tzcode accidentally committed with r274364 Modified: stable/10/contrib/tzcode/stdtime/localtime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzcode/stdtime/localtime.c ============================================================================== --- stable/10/contrib/tzcode/stdtime/localtime.c Fri Dec 5 12:23:29 2014 (r275508) +++ stable/10/contrib/tzcode/stdtime/localtime.c Fri Dec 5 12:25:36 2014 (r275509) @@ -1792,11 +1792,7 @@ int delta; number0 = *number; *number += delta; - if ((*number < number0) != (delta < 0)) { - errno = EOVERFLOW; - return (1); - } - return (0); + return (*number < number0) != (delta < 0); } static int @@ -1808,11 +1804,7 @@ int delta; number0 = *number; *number += delta; - if ((*number < number0) != (delta < 0)) { - errno = EOVERFLOW; - return (1); - } - return (0); + return (*number < number0) != (delta < 0); } static int From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 12:51:29 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3AAE78F; Fri, 5 Dec 2014 12:51:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4BAD79A; Fri, 5 Dec 2014 12:51:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5CpSgL003109; Fri, 5 Dec 2014 12:51:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5CpSrV003106; Fri, 5 Dec 2014 12:51:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051251.sB5CpSrV003106@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 12:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275511 - in stable/10: . sbin/mdconfig/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:51:29 -0000 Author: ngie Date: Fri Dec 5 12:51:27 2014 New Revision: 275511 URL: https://svnweb.freebsd.org/changeset/base/275511 Log: MFC r275170: Convert sbin/mdconfig/tests from prove format tests to ATF format tests As a side effect... 1. The tests now checks for the root user before continuing with kyua, which is more visible than the test being skipped with the TAP protocol 2. The tests work with devices that aren't /dev/md0 by caching the device attached during the test to a file, and later use the cached information to detach the device in the cleanup routine 3. The tests no longer require perl to run PR: 191191 Sponsored by: EMC / Isilon Storage Division Added: stable/10/sbin/mdconfig/tests/mdconfig_test.sh - copied unchanged from r275170, head/sbin/mdconfig/tests/mdconfig_test.sh Deleted: stable/10/sbin/mdconfig/tests/legacy_test.sh stable/10/sbin/mdconfig/tests/mdconfig.test stable/10/sbin/mdconfig/tests/run.pl Modified: stable/10/ObsoleteFiles.inc stable/10/sbin/mdconfig/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Dec 5 12:38:01 2014 (r275510) +++ stable/10/ObsoleteFiles.inc Fri Dec 5 12:51:27 2014 (r275511) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20141205: convert sbin/mdconfig/tests to ATF format tests +OLD_FILES+=usr/tests/sbin/mdconfig/legacy_test +OLD_FILES+=usr/tests/sbin/mdconfig/mdconfig.test +OLD_FILES+=usr/tests/sbin/mdconfig/run.pl # 20141028: debug files accidentally installed as directory name OLD_FILES+=usr/lib/debug/usr/lib/i18n OLD_FILES+=usr/lib/debug/usr/lib/private Modified: stable/10/sbin/mdconfig/tests/Makefile ============================================================================== --- stable/10/sbin/mdconfig/tests/Makefile Fri Dec 5 12:38:01 2014 (r275510) +++ stable/10/sbin/mdconfig/tests/Makefile Fri Dec 5 12:51:27 2014 (r275511) @@ -2,12 +2,9 @@ TESTSDIR= ${TESTSBASE}/sbin/mdconfig -TAP_TESTS_SH= legacy_test -TAP_TESTS_SH_SED_legacy_test= 's,__PERL__,${TAP_PERL_INTERPRETER},g' -TEST_METADATA.legacy_test+= required_programs="${TAP_PERL_INTERPRETER}" +ATF_TESTS_SH= mdconfig_test -FILESDIR= ${TESTSDIR} -FILES= mdconfig.test -FILES+= run.pl + +TEST_METADATA.mdconfig_test+= required_user="root" .include Copied: stable/10/sbin/mdconfig/tests/mdconfig_test.sh (from r275170, head/sbin/mdconfig/tests/mdconfig_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sbin/mdconfig/tests/mdconfig_test.sh Fri Dec 5 12:51:27 2014 (r275511, copy of r275170, head/sbin/mdconfig/tests/mdconfig_test.sh) @@ -0,0 +1,281 @@ +# Copyright (c) 2012 Edward Tomasz NapieraƂa +# 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$ +# + +check_diskinfo() +{ + local md=$1 + local mediasize_in_bytes=$2 + local mediasize_in_sectors=$3 + local sectorsize=${4:-512} + local stripesize=${5:-0} + local stripeoffset=${6:-0} + + atf_check -s exit:0 \ + -o match:"/dev/$md *$sectorsize *$mediasize_in_bytes *$mediasize_in_sectors *$stripesize *$stripeoffset" \ + -x "diskinfo /dev/$md | expand" +} + +cleanup_common() +{ + if [ -f mdconfig.out ]; then + mdconfig -d -u $(sed -e 's/md//' mdconfig.out) + fi +} + +atf_test_case attach_vnode_non_explicit_type cleanup +attach_vnode_non_explicit_type_head() +{ + atf_set "descr" "Tests out -a / -f without -t" +} +attach_vnode_non_explicit_type_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -x "truncate -s ${size_in_mb}m xxx" + atf_check -s exit:0 -o save:mdconfig.out -x 'mdconfig -af xxx' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_non_explicit_type_cleanup() +{ + cleanup_common +} + +atf_test_case attach_vnode_implicit_a_f cleanup +attach_vnode_implicit_a_f_head() +{ + atf_set "descr" "Tests out implied -a / -f without -t" +} +attach_vnode_implicit_a_f_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -x "truncate -s ${size_in_mb}m xxx" + atf_check -s exit:0 -o save:mdconfig.out -x 'mdconfig xxx' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_implicit_a_f_cleanup() +{ + cleanup_common +} + +atf_test_case attach_vnode_explicit_type cleanup +attach_vnode_explicit_type_head() +{ + atf_set "descr" "Tests out implied -a / -f with -t vnode" +} +attach_vnode_explicit_type_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -x "truncate -s ${size_in_mb}m xxx" + atf_check -s exit:0 -o save:mdconfig.out -x 'mdconfig -af xxx -t vnode' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_explicit_type_cleanup() +{ + [ -f mdconfig.out ] && mdconfig -d -u $(sed -e 's/md//' mdconfig.out) + rm -f mdconfig.out xxx +} + +atf_test_case attach_vnode_smaller_than_file cleanup +attach_vnode_smaller_than_file_head() +{ + atf_set "descr" "Tests mdconfig -s with size less than the file size" +} +attach_vnode_smaller_than_file_body() +{ + local md + local size_in_mb=128 + + atf_check -s exit:0 -x "truncate -s 1024m xxx" + atf_check -s exit:0 -o save:mdconfig.out \ + -x "mdconfig -af xxx -s ${size_in_mb}m" + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "134217728" "262144" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_smaller_than_file_cleanup() +{ + cleanup_common +} + +atf_test_case attach_vnode_larger_than_file cleanup +attach_vnode_larger_than_file_head() +{ + atf_set "descr" "Tests mdconfig -s with size greater than the file size" +} +attach_vnode_larger_than_file_body() +{ + local md + local size_in_gb=128 + + atf_check -s exit:0 -x "truncate -s 1024m xxx" + atf_check -s exit:0 -o save:mdconfig.out \ + -x "mdconfig -af xxx -s ${size_in_gb}g" + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "137438953472" "268435456" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_gb}G$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_larger_than_file_cleanup() +{ + cleanup_common +} + +atf_test_case attach_vnode_sector_size cleanup +attach_vnode_sector_size_head() +{ + atf_set "descr" "Tests mdconfig -s with size greater than the file size" +} +attach_vnode_sector_size_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -x "truncate -s ${size_in_mb}m xxx" + atf_check -s exit:0 -o save:mdconfig.out \ + -x "mdconfig -af xxx -S 2048" + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "524288" "2048" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_sector_size_cleanup() +{ + cleanup_common +} + +atf_test_case attach_malloc cleanup +attach_malloc_head() +{ + atf_set "descr" "Tests mdconfig with -t malloc" +} +attach_malloc_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -o save:mdconfig.out \ + -x 'mdconfig -a -t malloc -s 1g' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md malloc ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_malloc_cleanup() +{ + cleanup_common +} + +atf_test_case attach_swap cleanup +attach_swap_head() +{ + atf_set "descr" "Tests mdconfig with -t swap" +} +attach_swap_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -o save:mdconfig.out \ + -x 'mdconfig -a -t swap -s 1g' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md swap ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_swap_cleanup() +{ + cleanup_common +} + +atf_test_case attach_with_specific_unit_number cleanup +attach_with_specific_unit_number_head() +{ + atf_set "descr" "Tests mdconfig with a unit specified by -u" +} +attach_with_specific_unit_number_body() +{ + local md_unit=99 + local size_in_mb=10 + + local md="md${md_unit}" + + echo "$md" > mdconfig.out + + atf_check -s exit:0 -o empty \ + -x "mdconfig -a -t malloc -s ${size_in_mb}m -u $md_unit" + check_diskinfo "$md" "10485760" "20480" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md malloc "$size_in_mb"M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_with_specific_unit_number_cleanup() +{ + cleanup_common +} + +atf_init_test_cases() +{ + atf_add_test_case attach_vnode_non_explicit_type + atf_add_test_case attach_vnode_explicit_type + atf_add_test_case attach_vnode_smaller_than_file + atf_add_test_case attach_vnode_larger_than_file + atf_add_test_case attach_vnode_sector_size + atf_add_test_case attach_malloc + atf_add_test_case attach_swap + atf_add_test_case attach_with_specific_unit_number +} From owner-svn-src-stable-10@FreeBSD.ORG Fri Dec 5 18:55:32 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD1C1B29; Fri, 5 Dec 2014 18:55:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE83B783; Fri, 5 Dec 2014 18:55:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5ItWdE078953; Fri, 5 Dec 2014 18:55:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5ItWlL078945; Fri, 5 Dec 2014 18:55:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201412051855.sB5ItWlL078945@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 5 Dec 2014 18:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275516 - in stable/10/cddl/contrib/opensolaris/lib: libctf/common libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 18:55:33 -0000 Author: markj Date: Fri Dec 5 18:55:31 2014 New Revision: 275516 URL: https://svnweb.freebsd.org/changeset/base/275516 Log: MFC r271695: Fix some incorrect endianness checks. Modified: stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Dec 5 18:29:01 2014 (r275515) +++ stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Dec 5 18:55:31 2014 (r275516) @@ -274,7 +274,7 @@ ctf_fdopen(int fd, int *errp) */ if (nbytes >= (ssize_t) sizeof (Elf32_Ehdr) && bcmp(&hdr.e32.e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) { -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN uchar_t order = ELFDATA2MSB; #else uchar_t order = ELFDATA2LSB; Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Dec 5 18:29:01 2014 (r275515) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Dec 5 18:55:31 2014 (r275516) @@ -167,7 +167,7 @@ print_bitfield(dt_printarg_t *pap, ulong * to the lowest 'size' bytes in 'value', and we need to shift based on * the offset from the end of the data, not the offset of the start. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN buf += sizeof (value) - size; off += ep->cte_bits; #endif @@ -178,7 +178,7 @@ print_bitfield(dt_printarg_t *pap, ulong * Offsets are counted from opposite ends on little- and * big-endian machines. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN shift = NBBY - shift; #endif From owner-svn-src-stable-10@FreeBSD.ORG Sat Dec 6 07:30:09 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABD33790; Sat, 6 Dec 2014 07:30:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D46ED58; Sat, 6 Dec 2014 07:30:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB67U9FA029170; Sat, 6 Dec 2014 07:30:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB67U9ir029169; Sat, 6 Dec 2014 07:30:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412060730.sB67U9ir029169@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 6 Dec 2014 07:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275559 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 07:30:09 -0000 Author: mav Date: Sat Dec 6 07:30:08 2014 New Revision: 275559 URL: https://svnweb.freebsd.org/changeset/base/275559 Log: MFC r274843, r274845: Move icl_pdu_get_data() and xpt_done() out of initiator's session lock. During heavy reads data copying in icl_pdu_get_data() may consume large percent of CPU time. Moving it out of the lock significantly reduces lock hold time and respectively lock congestion on read operations. Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Sat Dec 6 04:02:56 2014 (r275558) +++ stable/10/sys/dev/iscsi/iscsi.c Sat Dec 6 07:30:08 2014 (r275559) @@ -144,6 +144,7 @@ static uma_zone_t iscsi_outstanding_zone #define ISCSI_SESSION_LOCK(X) mtx_lock(&X->is_lock) #define ISCSI_SESSION_UNLOCK(X) mtx_unlock(&X->is_lock) #define ISCSI_SESSION_LOCK_ASSERT(X) mtx_assert(&X->is_lock, MA_OWNED) +#define ISCSI_SESSION_LOCK_ASSERT_NOT(X) mtx_assert(&X->is_lock, MA_NOTOWNED) static int iscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int mode, struct thread *td); @@ -714,37 +715,46 @@ iscsi_receive_callback(struct icl_pdu *r switch (response->ip_bhs->bhs_opcode) { case ISCSI_BHS_OPCODE_NOP_IN: iscsi_pdu_handle_nop_in(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_SCSI_RESPONSE: iscsi_pdu_handle_scsi_response(response); + /* Session lock dropped inside. */ + ISCSI_SESSION_LOCK_ASSERT_NOT(is); break; case ISCSI_BHS_OPCODE_TASK_RESPONSE: iscsi_pdu_handle_task_response(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_SCSI_DATA_IN: iscsi_pdu_handle_data_in(response); + /* Session lock dropped inside. */ + ISCSI_SESSION_LOCK_ASSERT_NOT(is); break; case ISCSI_BHS_OPCODE_LOGOUT_RESPONSE: iscsi_pdu_handle_logout_response(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_R2T: iscsi_pdu_handle_r2t(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_ASYNC_MESSAGE: iscsi_pdu_handle_async_message(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_REJECT: iscsi_pdu_handle_reject(response); + ISCSI_SESSION_UNLOCK(is); break; default: ISCSI_SESSION_WARN(is, "received PDU with unsupported " "opcode 0x%x; reconnecting", response->ip_bhs->bhs_opcode); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); icl_pdu_free(response); } - - ISCSI_SESSION_UNLOCK(is); } static void @@ -833,8 +843,9 @@ iscsi_pdu_handle_scsi_response(struct ic struct iscsi_bhs_scsi_response *bhssr; struct iscsi_outstanding *io; struct iscsi_session *is; + union ccb *ccb; struct ccb_scsiio *csio; - size_t data_segment_len; + size_t data_segment_len, received; uint16_t sense_len; is = PDU_SESSION(response); @@ -845,46 +856,44 @@ iscsi_pdu_handle_scsi_response(struct ic ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhssr->bhssr_initiator_task_tag); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } + ccb = io->io_ccb; + received = io->io_received; + iscsi_outstanding_remove(is, io); + ISCSI_SESSION_UNLOCK(is); + if (bhssr->bhssr_response != BHSSR_RESPONSE_COMMAND_COMPLETED) { ISCSI_SESSION_WARN(is, "service response 0x%x", bhssr->bhssr_response); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; } else if (bhssr->bhssr_status == 0) { - io->io_ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP; } else { - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; - io->io_ccb->csio.scsi_status = bhssr->bhssr_status; + ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; + ccb->csio.scsi_status = bhssr->bhssr_status; } - if (bhssr->bhssr_flags & BHSSR_FLAGS_RESIDUAL_OVERFLOW) { - ISCSI_SESSION_WARN(is, "target indicated residual overflow"); - icl_pdu_free(response); - iscsi_session_reconnect(is); - return; - } - - csio = &io->io_ccb->csio; - + csio = &ccb->csio; data_segment_len = icl_pdu_data_segment_length(response); if (data_segment_len > 0) { if (data_segment_len < sizeof(sense_len)) { ISCSI_SESSION_WARN(is, "truncated data segment (%zd bytes)", data_segment_len); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; goto out; } icl_pdu_get_data(response, 0, &sense_len, sizeof(sense_len)); @@ -897,11 +906,11 @@ iscsi_pdu_handle_scsi_response(struct ic ISCSI_SESSION_WARN(is, "truncated data segment " "(%zd bytes, should be %zd)", data_segment_len, sizeof(sense_len) + sense_len); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; goto out; } else if (sizeof(sense_len) + sense_len < data_segment_len) ISCSI_SESSION_WARN(is, "oversize data segment " @@ -914,7 +923,7 @@ iscsi_pdu_handle_scsi_response(struct ic } icl_pdu_get_data(response, sizeof(sense_len), &csio->sense_data, sense_len); csio->sense_resid = csio->sense_len - sense_len; - io->io_ccb->ccb_h.status |= CAM_AUTOSNS_VALID; + ccb->ccb_h.status |= CAM_AUTOSNS_VALID; } out: @@ -922,21 +931,19 @@ out: csio->resid = ntohl(bhssr->bhssr_residual_count); if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - KASSERT(io->io_received <= csio->dxfer_len, - ("io->io_received > csio->dxfer_len")); - if (io->io_received < csio->dxfer_len) { - if (csio->resid != csio->dxfer_len - io->io_received) { + KASSERT(received <= csio->dxfer_len, + ("received > csio->dxfer_len")); + if (received < csio->dxfer_len) { + if (csio->resid != csio->dxfer_len - received) { ISCSI_SESSION_WARN(is, "underflow mismatch: " "target indicates %d, we calculated %zd", - csio->resid, - csio->dxfer_len - io->io_received); + csio->resid, csio->dxfer_len - received); } - csio->resid = csio->dxfer_len - io->io_received; + csio->resid = csio->dxfer_len - received; } } - xpt_done(io->io_ccb); - iscsi_outstanding_remove(is, io); + xpt_done(ccb); icl_pdu_free(response); } @@ -978,8 +985,9 @@ iscsi_pdu_handle_data_in(struct icl_pdu struct iscsi_bhs_data_in *bhsdi; struct iscsi_outstanding *io; struct iscsi_session *is; + union ccb *ccb; struct ccb_scsiio *csio; - size_t data_segment_len; + size_t data_segment_len, received, oreceived; is = PDU_SESSION(response); bhsdi = (struct iscsi_bhs_data_in *)response->ip_bhs; @@ -988,6 +996,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhsdi->bhsdi_initiator_task_tag); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } @@ -998,6 +1007,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu * but initiators and targets MUST be able to properly receive * 0 length data segments." */ + ISCSI_SESSION_UNLOCK(is); icl_pdu_free(response); return; } @@ -1012,10 +1022,12 @@ iscsi_pdu_handle_data_in(struct icl_pdu io->io_received, (size_t)ntohl(bhsdi->bhsdi_buffer_offset)); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } - csio = &io->io_ccb->csio; + ccb = io->io_ccb; + csio = &ccb->csio; if (io->io_received + data_segment_len > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "oversize data segment (%zd bytes " @@ -1023,11 +1035,18 @@ iscsi_pdu_handle_data_in(struct icl_pdu data_segment_len, io->io_received, csio->dxfer_len); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } - icl_pdu_get_data(response, 0, csio->data_ptr + io->io_received, data_segment_len); + oreceived = io->io_received; io->io_received += data_segment_len; + received = io->io_received; + if ((bhsdi->bhsdi_flags & BHSDI_FLAGS_S) != 0) + iscsi_outstanding_remove(is, io); + ISCSI_SESSION_UNLOCK(is); + + icl_pdu_get_data(response, 0, csio->data_ptr + oreceived, data_segment_len); /* * XXX: Check DataSN. @@ -1043,33 +1062,31 @@ iscsi_pdu_handle_data_in(struct icl_pdu //ISCSI_SESSION_DEBUG(is, "got S flag; status 0x%x", bhsdi->bhsdi_status); if (bhsdi->bhsdi_status == 0) { - io->io_ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP; } else { - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; csio->scsi_status = bhsdi->bhsdi_status; } if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - KASSERT(io->io_received <= csio->dxfer_len, - ("io->io_received > csio->dxfer_len")); - if (io->io_received < csio->dxfer_len) { + KASSERT(received <= csio->dxfer_len, + ("received > csio->dxfer_len")); + if (received < csio->dxfer_len) { csio->resid = ntohl(bhsdi->bhsdi_residual_count); - if (csio->resid != csio->dxfer_len - io->io_received) { + if (csio->resid != csio->dxfer_len - received) { ISCSI_SESSION_WARN(is, "underflow mismatch: " "target indicates %d, we calculated %zd", - csio->resid, - csio->dxfer_len - io->io_received); + csio->resid, csio->dxfer_len - received); } - csio->resid = csio->dxfer_len - io->io_received; + csio->resid = csio->dxfer_len - received; } } - xpt_done(io->io_ccb); - iscsi_outstanding_remove(is, io); + xpt_done(ccb); icl_pdu_free(response); } From owner-svn-src-stable-10@FreeBSD.ORG Sat Dec 6 17:50:38 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 462C7EC2; Sat, 6 Dec 2014 17:50:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 322A9C90; Sat, 6 Dec 2014 17:50:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6Hob6K033070; Sat, 6 Dec 2014 17:50:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6HoblN033069; Sat, 6 Dec 2014 17:50:37 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412061750.sB6HoblN033069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 6 Dec 2014 17:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275566 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 17:50:38 -0000 Author: brooks Date: Sat Dec 6 17:50:37 2014 New Revision: 275566 URL: https://svnweb.freebsd.org/changeset/base/275566 Log: MFC r263928: Use the correct variable name in the example code. PR: 195749 Modified: stable/10/lib/libc/sys/cap_rights_limit.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- stable/10/lib/libc/sys/cap_rights_limit.2 Sat Dec 6 12:03:09 2014 (r275565) +++ stable/10/lib/libc/sys/cap_rights_limit.2 Sat Dec 6 17:50:37 2014 (r275566) @@ -86,7 +86,7 @@ manual page. The following example demonstrates how to limit file descriptor capability rights to allow reading only. .Bd -literal -cap_rights_t rights; +cap_rights_t setrights; char buf[1]; int fd;