From owner-svn-src-stable-10@freebsd.org Sun Jan 29 10:36:44 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 527ECCC6EB5; Sun, 29 Jan 2017 10:36:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21D6169F; Sun, 29 Jan 2017 10:36:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0TAah6n014498; Sun, 29 Jan 2017 10:36:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TAahwa014497; Sun, 29 Jan 2017 10:36:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701291036.v0TAahwa014497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 29 Jan 2017 10:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312946 - 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.23 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, 29 Jan 2017 10:36:44 -0000 Author: kib Date: Sun Jan 29 10:36:43 2017 New Revision: 312946 URL: https://svnweb.freebsd.org/changeset/base/312946 Log: MFC r312647: Add comments explaining unobvious td_critnest adjustments in critical_exit(). Modified: stable/10/sys/kern/kern_switch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_switch.c ============================================================================== --- stable/10/sys/kern/kern_switch.c Sun Jan 29 10:33:42 2017 (r312945) +++ stable/10/sys/kern/kern_switch.c Sun Jan 29 10:36:43 2017 (r312946) @@ -206,7 +206,22 @@ critical_exit(void) if (td->td_critnest == 1) { td->td_critnest = 0; + + /* + * Interrupt handlers execute critical_exit() on + * leave, and td_owepreempt may be left set by an + * interrupt handler only when td_critnest > 0. If we + * are decrementing td_critnest from 1 to 0, read + * td_owepreempt after decrementing, to not miss the + * preempt. Disallow compiler to reorder operations. + */ + __compiler_membar(); if (td->td_owepreempt && !kdb_active) { + /* + * Microoptimization: we committed to switch, + * disable preemption in interrupt handlers + * while spinning for the thread lock. + */ td->td_critnest = 1; thread_lock(td); td->td_critnest--; From owner-svn-src-stable-10@freebsd.org Sun Jan 29 14:29:03 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92514CC63A8; Sun, 29 Jan 2017 14:29:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 481441707; Sun, 29 Jan 2017 14:29:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0TET28u011202; Sun, 29 Jan 2017 14:29:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0TET2Nn011201; Sun, 29 Jan 2017 14:29:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701291429.v0TET2Nn011201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 29 Jan 2017 14:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312951 - stable/10/sbin/camcontrol 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.23 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, 29 Jan 2017 14:29:03 -0000 Author: mav Date: Sun Jan 29 14:29:02 2017 New Revision: 312951 URL: https://svnweb.freebsd.org/changeset/base/312951 Log: MFC r312228: Make `camcontrol cmd ... -i ...` return only valid bytes. Previously code ignored resid field and returned extra zeroes in case of data underflow. Now it returns only real bytes received from target. Modified: stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Sun Jan 29 14:28:29 2017 (r312950) +++ stable/10/sbin/camcontrol/camcontrol.c Sun Jan 29 14:29:02 2017 (r312951) @@ -4145,7 +4145,7 @@ scsicmd(struct cam_device *device, int a u_int8_t cdb[20]; u_int8_t atacmd[12]; struct get_hook hook; - int c, data_bytes = 0; + int c, data_bytes = 0, valid_bytes; int cdb_len = 0; int atacmd_len = 0; int dmacmd = 0; @@ -4449,16 +4449,20 @@ scsicmd(struct cam_device *device, int a } } + if (cdb_len) + valid_bytes = ccb->csio.dxfer_len - ccb->csio.resid; + else + valid_bytes = ccb->ataio.dxfer_len - ccb->ataio.resid; if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) && (arglist & CAM_ARG_CMD_IN) - && (data_bytes > 0)) { + && (valid_bytes > 0)) { if (fd_data == 0) { - buff_decode_visit(data_ptr, data_bytes, datastr, + buff_decode_visit(data_ptr, valid_bytes, datastr, arg_put, NULL); fprintf(stdout, "\n"); } else { ssize_t amt_written; - int amt_to_write = data_bytes; + int amt_to_write = valid_bytes; u_int8_t *buf_ptr = data_ptr; for (amt_written = 0; (amt_to_write > 0) && @@ -4473,7 +4477,7 @@ scsicmd(struct cam_device *device, int a } else if ((amt_written == 0) && (amt_to_write > 0)) { warnx("only wrote %u bytes out of %u", - data_bytes - amt_to_write, data_bytes); + valid_bytes - amt_to_write, valid_bytes); } } } From owner-svn-src-stable-10@freebsd.org Mon Jan 30 14:34:05 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 625E6CC894A; Mon, 30 Jan 2017 14:34:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 319BEA8A; Mon, 30 Jan 2017 14:34:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UEY4U9006610; Mon, 30 Jan 2017 14:34:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UEY47m006609; Mon, 30 Jan 2017 14:34:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701301434.v0UEY47m006609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 30 Jan 2017 14:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312990 - stable/10/sys/amd64/vmm 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.23 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, 30 Jan 2017 14:34:05 -0000 Author: avg Date: Mon Jan 30 14:34:04 2017 New Revision: 312990 URL: https://svnweb.freebsd.org/changeset/base/312990 Log: MFC r312531: vmm_dev: work around a bogus error with gcc 6.3.0 Modified: stable/10/sys/amd64/vmm/vmm_dev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Mon Jan 30 14:33:53 2017 (r312989) +++ stable/10/sys/amd64/vmm/vmm_dev.c Mon Jan 30 14:34:04 2017 (r312990) @@ -258,7 +258,7 @@ alloc_memseg(struct vmmdev_softc *sc, st if (VM_MEMSEG_NAME(mseg)) { sysmem = false; name = malloc(SPECNAMELEN + 1, M_VMMDEV, M_WAITOK); - error = copystr(VM_MEMSEG_NAME(mseg), name, SPECNAMELEN + 1, 0); + error = copystr(mseg->name, name, SPECNAMELEN + 1, 0); if (error) goto done; } From owner-svn-src-stable-10@freebsd.org Wed Feb 1 04:54:24 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EA21CCA94D; Wed, 1 Feb 2017 04:54:24 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DECBD32; Wed, 1 Feb 2017 04:54:24 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v114sNqr073970; Wed, 1 Feb 2017 04:54:23 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v114sNZH073969; Wed, 1 Feb 2017 04:54:23 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201702010454.v114sNZH073969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 1 Feb 2017 04:54: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: r313039 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 01 Feb 2017 04:54:24 -0000 Author: rpokala Date: Wed Feb 1 04:54:23 2017 New Revision: 313039 URL: https://svnweb.freebsd.org/changeset/base/313039 Log: MFC r312678: Eliminate misleading comments and dead code in lacp_port_create() Variables "fast" and "active" are both constant in lacp_port_create(), but comments mispleadingly suggest that "fast" can be changed via ioctl. The constant values control the value of "lp->lp_state", so it too is constant, and the code for assigning different value to it is essentially dead. Remove both "fast" and "active", and set "lp->lp_state" unconditionally; that gets rid of the dead code and misleading comments. Modified: stable/10/sys/net/ieee8023ad_lacp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/10/sys/net/ieee8023ad_lacp.c Wed Feb 1 04:53:52 2017 (r313038) +++ stable/10/sys/net/ieee8023ad_lacp.c Wed Feb 1 04:54:23 2017 (r313039) @@ -523,9 +523,6 @@ lacp_port_create(struct lagg_port *lgp) struct ifmultiaddr *rifma = NULL; int error; - boolean_t active = TRUE; /* XXX should be configurable */ - boolean_t fast = FALSE; /* Configurable via ioctl */ - bzero((char *)&sdl, sizeof(sdl)); sdl.sdl_len = sizeof(sdl); sdl.sdl_family = AF_LINK; @@ -557,9 +554,7 @@ lacp_port_create(struct lagg_port *lgp) lacp_fill_actorinfo(lp, &lp->lp_actor); lacp_fill_markerinfo(lp, &lp->lp_marker); - lp->lp_state = - (active ? LACP_STATE_ACTIVITY : 0) | - (fast ? LACP_STATE_TIMEOUT : 0); + lp->lp_state = LACP_STATE_ACTIVITY; lp->lp_aggregator = NULL; lacp_sm_rx_set_expired(lp); LACP_UNLOCK(lsc); From owner-svn-src-stable-10@freebsd.org Wed Feb 1 21:44:51 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE841CCB57D; Wed, 1 Feb 2017 21:44:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8221E41; Wed, 1 Feb 2017 21:44:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v11LioKF004373; Wed, 1 Feb 2017 21:44:50 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v11Liooa004371; Wed, 1 Feb 2017 21:44:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201702012144.v11Liooa004371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 1 Feb 2017 21:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313066 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 01 Feb 2017 21:44:52 -0000 Author: kp Date: Wed Feb 1 21:44:50 2017 New Revision: 313066 URL: https://svnweb.freebsd.org/changeset/base/313066 Log: MFC 312782 bridge: Release the bridge lock when calling bridge_set_ifcap() This calls ioctl() handlers for the different interfaces in the bridge. These handlers expect to get called in an ioctl context where it's safe for them to sleep. We may not sleep with the bridge lock held. However, we still need to protect the interface list, to ensure it doesn't get changed while we iterate over it. Use BRIDGE_XLOCK(), which prevents bridge members from being removed. Adding bridge members is safe, because it uses LIST_INSERT_HEAD(). This caused panics when adding xen interfaces to a bridge. PR: 216304 Reviewed by: ae Sponsored by: RootBSD Differential Revision: https://reviews.freebsd.org/D9290 Modified: stable/10/sys/net/if_bridge.c stable/10/sys/net/if_bridgevar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_bridge.c ============================================================================== --- stable/10/sys/net/if_bridge.c Wed Feb 1 21:35:25 2017 (r313065) +++ stable/10/sys/net/if_bridge.c Wed Feb 1 21:44:50 2017 (r313066) @@ -860,14 +860,18 @@ bridge_mutecaps(struct bridge_softc *sc) mask &= bif->bif_savedcaps; } + BRIDGE_XLOCK(sc); LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { enabled = bif->bif_ifp->if_capenable; enabled &= ~BRIDGE_IFCAPS_STRIP; /* strip off mask bits and enable them again if allowed */ enabled &= ~BRIDGE_IFCAPS_MASK; enabled |= mask; + BRIDGE_UNLOCK(sc); bridge_set_ifcap(sc, bif, enabled); + BRIDGE_LOCK(sc); } + BRIDGE_XDROP(sc); } @@ -878,6 +882,8 @@ bridge_set_ifcap(struct bridge_softc *sc struct ifreq ifr; int error; + BRIDGE_UNLOCK_ASSERT(sc); + bzero(&ifr, sizeof(ifr)); ifr.ifr_reqcap = set; Modified: stable/10/sys/net/if_bridgevar.h ============================================================================== --- stable/10/sys/net/if_bridgevar.h Wed Feb 1 21:35:25 2017 (r313065) +++ stable/10/sys/net/if_bridgevar.h Wed Feb 1 21:44:50 2017 (r313066) @@ -280,6 +280,7 @@ struct ifbpstpconf { #define BRIDGE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define BRIDGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define BRIDGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) +#define BRIDGE_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) #define BRIDGE_LOCK2REF(_sc, _err) do { \ mtx_assert(&(_sc)->sc_mtx, MA_OWNED); \ if ((_sc)->sc_iflist_xcnt > 0) \ From owner-svn-src-stable-10@freebsd.org Thu Feb 2 00:20:55 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BB4BCCCA59; Thu, 2 Feb 2017 00:20:55 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44417182C; Thu, 2 Feb 2017 00:20:55 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v120Ksbr068070; Thu, 2 Feb 2017 00:20:54 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v120KrDY068063; Thu, 2 Feb 2017 00:20:53 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201702020020.v120KrDY068063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 2 Feb 2017 00:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313072 - stable/10/sys/dev/qlxgbe 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.23 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, 02 Feb 2017 00:20:55 -0000 Author: davidcs Date: Thu Feb 2 00:20:53 2017 New Revision: 313072 URL: https://svnweb.freebsd.org/changeset/base/313072 Log: MFC r312728 Added support for if_transmit and if_qflush Removed if_start updated version to 3.10.33 Modified: stable/10/sys/dev/qlxgbe/ql_def.h stable/10/sys/dev/qlxgbe/ql_glbl.h stable/10/sys/dev/qlxgbe/ql_hw.c stable/10/sys/dev/qlxgbe/ql_hw.h stable/10/sys/dev/qlxgbe/ql_isr.c stable/10/sys/dev/qlxgbe/ql_os.c stable/10/sys/dev/qlxgbe/ql_os.h stable/10/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_def.h ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_def.h Thu Feb 2 00:20:18 2017 (r313071) +++ stable/10/sys/dev/qlxgbe/ql_def.h Thu Feb 2 00:20:53 2017 (r313072) @@ -112,6 +112,16 @@ typedef struct _qla_tx_ring { uint64_t count; } qla_tx_ring_t; +typedef struct _qla_tx_fp { + struct mtx tx_mtx; + char tx_mtx_name[32]; + struct buf_ring *tx_br; + struct task fp_task; + struct taskqueue *fp_taskqueue; + void *ha; + uint32_t txr_idx; +} qla_tx_fp_t; + /* * Adapter structure contains the hardware independant information of the * pci function. @@ -178,10 +188,9 @@ struct qla_host { qla_tx_ring_t tx_ring[NUM_TX_RINGS]; bus_dma_tag_t tx_tag; - struct task tx_task; - struct taskqueue *tx_tq; struct callout tx_callout; - struct mtx tx_lock; + + qla_tx_fp_t tx_fp[MAX_SDS_RINGS]; qla_rx_ring_t rx_ring[MAX_RDS_RINGS]; bus_dma_tag_t rx_tag; Modified: stable/10/sys/dev/qlxgbe/ql_glbl.h ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_glbl.h Thu Feb 2 00:20:18 2017 (r313071) +++ stable/10/sys/dev/qlxgbe/ql_glbl.h Thu Feb 2 00:20:53 2017 (r313072) @@ -39,6 +39,7 @@ */ extern void ql_mbx_isr(void *arg); extern void ql_isr(void *arg); +extern uint32_t ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t count); /* * from ql_os.c @@ -66,7 +67,7 @@ extern void qla_reset_promisc(qla_host_t extern int ql_set_allmulti(qla_host_t *ha); extern void qla_reset_allmulti(qla_host_t *ha); extern void ql_update_link_state(qla_host_t *ha); -extern void ql_hw_tx_done(qla_host_t *ha); +extern void ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx); extern int ql_set_max_mtu(qla_host_t *ha, uint32_t mtu, uint16_t cntxt_id); extern void ql_hw_stop_rcv(qla_host_t *ha); extern void ql_get_stats(qla_host_t *ha); @@ -76,7 +77,7 @@ extern void qla_hw_async_event(qla_host_ extern int qla_get_nic_partition(qla_host_t *ha, uint32_t *supports_9kb, uint32_t *num_rcvq); -extern int qla_iscsi_pdu(qla_host_t *ha, struct mbuf *mp); +extern int ql_iscsi_pdu(qla_host_t *ha, struct mbuf *mp); extern void ql_minidump(qla_host_t *ha); extern int ql_minidump_init(qla_host_t *ha); Modified: stable/10/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_hw.c Thu Feb 2 00:20:18 2017 (r313071) +++ stable/10/sys/dev/qlxgbe/ql_hw.c Thu Feb 2 00:20:53 2017 (r313072) @@ -51,7 +51,6 @@ static void qla_del_rcv_cntxt(qla_host_t static int qla_init_rcv_cntxt(qla_host_t *ha); static void qla_del_xmt_cntxt(qla_host_t *ha); static int qla_init_xmt_cntxt(qla_host_t *ha); -static void qla_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx); static int qla_mbx_cmd(qla_host_t *ha, uint32_t *h_mbox, uint32_t n_hmbox, uint32_t *fw_mbox, uint32_t n_fwmbox, uint32_t no_pause); static int qla_config_intr_cntxt(qla_host_t *ha, uint32_t start_idx, @@ -2047,7 +2046,7 @@ ql_hw_send(qla_host_t *ha, bus_dma_segme ha->hw.iscsi_pkt_count++; if (hw->tx_cntxt[txr_idx].txr_free <= (num_tx_cmds + QLA_TX_MIN_FREE)) { - qla_hw_tx_done_locked(ha, txr_idx); + ql_hw_tx_done_locked(ha, txr_idx); if (hw->tx_cntxt[txr_idx].txr_free <= (num_tx_cmds + QLA_TX_MIN_FREE)) { QL_DPRINT8(ha, (dev, "%s: (hw->txr_free <= " @@ -2552,15 +2551,8 @@ qla_init_rcv_cntxt(qla_host_t *ha) qla_host_to_le64(hw->dma_buf.sds_ring[i].dma_addr); rcntxt->sds[i].size = qla_host_to_le32(NUM_STATUS_DESCRIPTORS); - if (ha->msix_count == 2) { - rcntxt->sds[i].intr_id = - qla_host_to_le16(hw->intr_id[0]); - rcntxt->sds[i].intr_src_bit = qla_host_to_le16((i)); - } else { - rcntxt->sds[i].intr_id = - qla_host_to_le16(hw->intr_id[i]); - rcntxt->sds[i].intr_src_bit = qla_host_to_le16(0); - } + rcntxt->sds[i].intr_id = qla_host_to_le16(hw->intr_id[i]); + rcntxt->sds[i].intr_src_bit = qla_host_to_le16(0); } for (i = 0; i < rcntxt_rds_rings; i++) { @@ -2672,17 +2664,11 @@ qla_add_rcv_rings(qla_host_t *ha, uint32 add_rcv->sds[i].size = qla_host_to_le32(NUM_STATUS_DESCRIPTORS); - if (ha->msix_count == 2) { - add_rcv->sds[i].intr_id = - qla_host_to_le16(hw->intr_id[0]); - add_rcv->sds[i].intr_src_bit = qla_host_to_le16(j); - } else { - add_rcv->sds[i].intr_id = - qla_host_to_le16(hw->intr_id[j]); - add_rcv->sds[i].intr_src_bit = qla_host_to_le16(0); - } + add_rcv->sds[i].intr_id = qla_host_to_le16(hw->intr_id[j]); + add_rcv->sds[i].intr_src_bit = qla_host_to_le16(0); } + for (i = 0; (i < nsds); i++) { j = i + sds_idx; @@ -2803,6 +2789,7 @@ qla_init_xmt_cntxt_i(qla_host_t *ha, uin q80_rsp_tx_cntxt_t *tcntxt_rsp; uint32_t err; qla_hw_tx_cntxt_t *hw_tx_cntxt; + uint32_t intr_idx; hw_tx_cntxt = &hw->tx_cntxt[txr_idx]; @@ -2818,6 +2805,8 @@ qla_init_xmt_cntxt_i(qla_host_t *ha, uin tcntxt->count_version = (sizeof (q80_rq_tx_cntxt_t) >> 2); tcntxt->count_version |= Q8_MBX_CMD_VERSION; + intr_idx = txr_idx; + #ifdef QL_ENABLE_ISCSI_TLV tcntxt->cap0 = Q8_TX_CNTXT_CAP0_BASEFW | Q8_TX_CNTXT_CAP0_LSO | @@ -2827,8 +2816,9 @@ qla_init_xmt_cntxt_i(qla_host_t *ha, uin tcntxt->traffic_class = 1; } -#else + intr_idx = txr_idx % (ha->hw.num_tx_rings >> 1); +#else tcntxt->cap0 = Q8_TX_CNTXT_CAP0_BASEFW | Q8_TX_CNTXT_CAP0_LSO; #endif /* #ifdef QL_ENABLE_ISCSI_TLV */ @@ -2841,10 +2831,9 @@ qla_init_xmt_cntxt_i(qla_host_t *ha, uin qla_host_to_le64(hw_tx_cntxt->tx_cons_paddr); tcntxt->tx_ring[0].nentries = qla_host_to_le16(NUM_TX_DESCRIPTORS); - tcntxt->tx_ring[0].intr_id = qla_host_to_le16(hw->intr_id[0]); + tcntxt->tx_ring[0].intr_id = qla_host_to_le16(hw->intr_id[intr_idx]); tcntxt->tx_ring[0].intr_src_bit = qla_host_to_le16(0); - hw_tx_cntxt->txr_free = NUM_TX_DESCRIPTORS; hw_tx_cntxt->txr_next = hw_tx_cntxt->txr_comp = 0; @@ -3166,11 +3155,11 @@ ql_hw_set_multi(qla_host_t *ha, uint8_t } /* - * Name: qla_hw_tx_done_locked + * Name: ql_hw_tx_done_locked * Function: Handle Transmit Completions */ -static void -qla_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx) +void +ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx) { qla_tx_buf_t *txb; qla_hw_t *hw = &ha->hw; @@ -3208,34 +3197,6 @@ qla_hw_tx_done_locked(qla_host_t *ha, ui return; } -/* - * Name: ql_hw_tx_done - * Function: Handle Transmit Completions - */ -void -ql_hw_tx_done(qla_host_t *ha) -{ - int i; - uint32_t flag = 0; - - if (!mtx_trylock(&ha->tx_lock)) { - QL_DPRINT8(ha, (ha->pci_dev, - "%s: !mtx_trylock(&ha->tx_lock)\n", __func__)); - return; - } - for (i = 0; i < ha->hw.num_tx_rings; i++) { - qla_hw_tx_done_locked(ha, i); - if (ha->hw.tx_cntxt[i].txr_free <= (NUM_TX_DESCRIPTORS >> 1)) - flag = 1; - } - - if (!flag) - ha->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - - QLA_TX_UNLOCK(ha); - return; -} - void ql_update_link_state(qla_host_t *ha) { @@ -3655,7 +3616,7 @@ qla_get_port_config(qla_host_t *ha, uint } int -qla_iscsi_pdu(qla_host_t *ha, struct mbuf *mp) +ql_iscsi_pdu(qla_host_t *ha, struct mbuf *mp) { struct ether_vlan_header *eh; uint16_t etype; Modified: stable/10/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_hw.h Thu Feb 2 00:20:18 2017 (r313071) +++ stable/10/sys/dev/qlxgbe/ql_hw.h Thu Feb 2 00:20:53 2017 (r313072) @@ -1543,7 +1543,6 @@ typedef struct _qla_hw_tx_cntxt { uint32_t tx_prod_reg; uint16_t tx_cntxt_id; - uint8_t frame_hdr[QL_FRAME_HDR_SIZE]; } qla_hw_tx_cntxt_t; Modified: stable/10/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_isr.c Thu Feb 2 00:20:18 2017 (r313071) +++ stable/10/sys/dev/qlxgbe/ql_isr.c Thu Feb 2 00:20:53 2017 (r313072) @@ -159,7 +159,12 @@ qla_rx_intr(qla_host_t *ha, qla_sgl_rcv_ ifp->if_ipackets++; mpf->m_pkthdr.flowid = sgc->rss_hash; - M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE); + +#if __FreeBSD_version >= 1100000 + M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE_HASH); +#else + M_HASHTYPE_SET(mpf, M_HASHTYPE_NONE); +#endif /* #if __FreeBSD_version >= 1100000 */ (*ifp->if_input)(ifp, mpf); @@ -450,11 +455,11 @@ qla_rcv_cont_sds(qla_host_t *ha, uint32_ } /* - * Name: qla_rcv_isr + * Name: ql_rcv_isr * Function: Main Interrupt Service Routine */ -static uint32_t -qla_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t count) +uint32_t +ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t count) { device_t dev; qla_hw_t *hw; @@ -704,7 +709,7 @@ qla_rcv_isr(qla_host_t *ha, uint32_t sds } if (ha->flags.stop_rcv) - goto qla_rcv_isr_exit; + goto ql_rcv_isr_exit; if (hw->sds[sds_idx].sdsr_next != comp_idx) { QL_UPDATE_SDS_CONSUMER_INDEX(ha, sds_idx, comp_idx); @@ -727,7 +732,7 @@ qla_rcv_isr(qla_host_t *ha, uint32_t sds if (opcode) ret = -1; -qla_rcv_isr_exit: +ql_rcv_isr_exit: hw->sds[sds_idx].rcv_active = 0; return (ret); @@ -931,7 +936,7 @@ ql_isr(void *arg) int idx; qla_hw_t *hw; struct ifnet *ifp; - uint32_t ret = 0; + qla_tx_fp_t *fp; ha = ivec->ha; hw = &ha->hw; @@ -940,17 +945,12 @@ ql_isr(void *arg) if ((idx = ivec->sds_idx) >= ha->hw.num_sds_rings) return; - if (idx == 0) - taskqueue_enqueue(ha->tx_tq, &ha->tx_task); - - ret = qla_rcv_isr(ha, idx, -1); - if (idx == 0) - taskqueue_enqueue(ha->tx_tq, &ha->tx_task); + fp = &ha->tx_fp[idx]; + + if (fp->fp_taskqueue != NULL) + taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task); - if (!ha->flags.stop_rcv) { - QL_ENABLE_INTERRUPTS(ha, idx); - } return; } Modified: stable/10/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_os.c Thu Feb 2 00:20:18 2017 (r313071) +++ stable/10/sys/dev/qlxgbe/ql_os.c Thu Feb 2 00:20:53 2017 (r313072) @@ -76,11 +76,11 @@ static void qla_release(qla_host_t *ha); static void qla_dmamap_callback(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static void qla_stop(qla_host_t *ha); -static int qla_send(qla_host_t *ha, struct mbuf **m_headp); -static void qla_tx_done(void *context, int pending); static void qla_get_peer(qla_host_t *ha); static void qla_error_recovery(void *context, int pending); static void qla_async_event(void *context, int pending); +static int qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32_t txr_idx, + uint32_t iscsi_pdu); /* * Hooks to the Operating Systems @@ -93,7 +93,14 @@ static void qla_init(void *arg); static int qla_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int qla_media_change(struct ifnet *ifp); static void qla_media_status(struct ifnet *ifp, struct ifmediareq *ifmr); -static void qla_start(struct ifnet *ifp); + +static int qla_transmit(struct ifnet *ifp, struct mbuf *mp); +static void qla_qflush(struct ifnet *ifp); +static int qla_alloc_tx_br(qla_host_t *ha, qla_tx_fp_t *tx_fp); +static void qla_free_tx_br(qla_host_t *ha, qla_tx_fp_t *tx_fp); +static int qla_create_fp_taskqueues(qla_host_t *ha); +static void qla_destroy_fp_taskqueues(qla_host_t *ha); +static void qla_drain_fp_taskqueues(qla_host_t *ha); static device_method_t qla_pci_methods[] = { /* Device interface */ @@ -225,7 +232,6 @@ qla_watchdog(void *arg) qla_hw_t *hw; struct ifnet *ifp; uint32_t i; - qla_hw_tx_cntxt_t *hw_tx_cntxt; hw = &ha->hw; ifp = ha->ifp; @@ -254,19 +260,14 @@ qla_watchdog(void *arg) &ha->async_event_task); } - for (i = 0; i < ha->hw.num_tx_rings; i++) { - hw_tx_cntxt = &hw->tx_cntxt[i]; - if (qla_le32_to_host(*(hw_tx_cntxt->tx_cons)) != - hw_tx_cntxt->txr_comp) { - taskqueue_enqueue(ha->tx_tq, - &ha->tx_task); - break; - } - } + for (i = 0; i < ha->hw.num_sds_rings; i++) { + qla_tx_fp_t *fp = &ha->tx_fp[i]; - if ((ifp->if_snd.ifq_head != NULL) && QL_RUNNING(ifp)) { - taskqueue_enqueue(ha->tx_tq, &ha->tx_task); + if (fp->fp_taskqueue != NULL) + taskqueue_enqueue(fp->fp_taskqueue, + &fp->fp_task); } + ha->qla_watchdog_paused = 0; } else { ha->qla_watchdog_paused = 0; @@ -322,9 +323,7 @@ qla_pci_attach(device_t dev) rsrc_len = (uint32_t) bus_get_resource_count(dev, SYS_RES_MEMORY, ha->reg_rid); - mtx_init(&ha->hw_lock, "qla83xx_hw_lock", MTX_NETWORK_LOCK, MTX_SPIN); - - mtx_init(&ha->tx_lock, "qla83xx_tx_lock", MTX_NETWORK_LOCK, MTX_DEF); + mtx_init(&ha->hw_lock, "qla83xx_hw_lock", MTX_NETWORK_LOCK, MTX_DEF); qla_add_sysctls(ha); ql_hw_add_sysctls(ha); @@ -344,8 +343,9 @@ qla_pci_attach(device_t dev) } QL_DPRINT2(ha, (dev, "%s: ha %p pci_func 0x%x rsrc_count 0x%08x" - " msix_count 0x%x pci_reg %p\n", __func__, ha, - ha->pci_func, rsrc_len, ha->msix_count, ha->pci_reg)); + " msix_count 0x%x pci_reg %p pci_reg1 %p\n", __func__, ha, + ha->pci_func, rsrc_len, ha->msix_count, ha->pci_reg, + ha->pci_reg1)); /* initialize hardware */ if (ql_init_hw(ha)) { @@ -366,14 +366,15 @@ qla_pci_attach(device_t dev) goto qla_pci_attach_err; } device_printf(dev, "%s: ha %p pci_func 0x%x rsrc_count 0x%08x" - " msix_count 0x%x pci_reg %p num_rcvq = %d\n", __func__, ha, - ha->pci_func, rsrc_len, ha->msix_count, ha->pci_reg, num_rcvq); + " msix_count 0x%x pci_reg %p pci_reg1 %p num_rcvq = %d\n", + __func__, ha, ha->pci_func, rsrc_len, ha->msix_count, + ha->pci_reg, ha->pci_reg1, num_rcvq); #ifdef QL_ENABLE_ISCSI_TLV if ((ha->msix_count < 64) || (num_rcvq != 32)) { ha->hw.num_sds_rings = 15; - ha->hw.num_tx_rings = 32; + ha->hw.num_tx_rings = ha->hw.num_sds_rings * 2; } #endif /* #ifdef QL_ENABLE_ISCSI_TLV */ ha->hw.num_rds_rings = ha->hw.num_sds_rings; @@ -421,8 +422,20 @@ qla_pci_attach(device_t dev) device_printf(dev, "could not setup interrupt\n"); goto qla_pci_attach_err; } + + ha->tx_fp[i].ha = ha; + ha->tx_fp[i].txr_idx = i; + + if (qla_alloc_tx_br(ha, &ha->tx_fp[i])) { + device_printf(dev, "%s: could not allocate tx_br[%d]\n", + __func__, i); + goto qla_pci_attach_err; + } } + if (qla_create_fp_taskqueues(ha) != 0) + goto qla_pci_attach_err; + printf("%s: mp__ncpus %d sds %d rds %d msi-x %d\n", __func__, mp_ncpus, ha->hw.num_sds_rings, ha->hw.num_rds_rings, ha->msix_count); @@ -452,13 +465,6 @@ qla_pci_attach(device_t dev) ha->flags.qla_watchdog_active = 1; ha->flags.qla_watchdog_pause = 0; - - TASK_INIT(&ha->tx_task, 0, qla_tx_done, ha); - ha->tx_tq = taskqueue_create("qla_txq", M_NOWAIT, - taskqueue_thread_enqueue, &ha->tx_tq); - taskqueue_start_threads(&ha->tx_tq, 1, PI_NET, "%s txq", - device_get_nameunit(ha->pci_dev)); - callout_init(&ha->tx_callout, TRUE); ha->flags.qla_callout_init = 1; @@ -584,11 +590,6 @@ qla_release(qla_host_t *ha) taskqueue_free(ha->err_tq); } - if (ha->tx_tq) { - taskqueue_drain(ha->tx_tq, &ha->tx_task); - taskqueue_free(ha->tx_tq); - } - ql_del_cdev(ha); if (ha->flags.qla_watchdog_active) { @@ -626,13 +627,15 @@ qla_release(qla_host_t *ha) ha->irq_vec[i].irq_rid, ha->irq_vec[i].irq); } + + qla_free_tx_br(ha, &ha->tx_fp[i]); } + qla_destroy_fp_taskqueues(ha); if (ha->msix_count) pci_release_msi(dev); if (ha->flags.lock_init) { - mtx_destroy(&ha->tx_lock); mtx_destroy(&ha->hw_lock); } @@ -812,7 +815,9 @@ qla_init_ifnet(device_t dev, qla_host_t ifp->if_softc = ha; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = qla_ioctl; - ifp->if_start = qla_start; + + ifp->if_transmit = qla_transmit; + ifp->if_qflush = qla_qflush; IFQ_SET_MAXLEN(&ifp->if_snd, qla_get_ifq_snd_maxlen(ha)); ifp->if_snd.ifq_drv_maxlen = qla_get_ifq_snd_maxlen(ha); @@ -822,12 +827,13 @@ qla_init_ifnet(device_t dev, qla_host_t ether_ifattach(ifp, qla_get_mac_addr(ha)); - ifp->if_capabilities = IFCAP_HWCSUM | + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | - IFCAP_JUMBO_MTU; - - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_VLAN_HWTSO; + IFCAP_JUMBO_MTU | + IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_MTU | + IFCAP_VLAN_HWTSO | + IFCAP_LRO; ifp->if_capenable = ifp->if_capabilities; @@ -922,10 +928,13 @@ qla_set_multi(qla_host_t *ha, uint32_t a if_maddr_runlock(ifp); - if (QLA_LOCK(ha, __func__, 1) == 0) { - ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); - QLA_UNLOCK(ha, __func__); - } + //if (QLA_LOCK(ha, __func__, 1) == 0) { + // ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); + // QLA_UNLOCK(ha, __func__); + //} + QLA_LOCK(ha, __func__, 1); + ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); + QLA_UNLOCK(ha, __func__); return (ret); } @@ -1130,64 +1139,10 @@ qla_media_status(struct ifnet *ifp, stru return; } -static void -qla_start(struct ifnet *ifp) -{ - struct mbuf *m_head; - qla_host_t *ha = (qla_host_t *)ifp->if_softc; - - QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); - - if (!mtx_trylock(&ha->tx_lock)) { - QL_DPRINT8(ha, (ha->pci_dev, - "%s: mtx_trylock(&ha->tx_lock) failed\n", __func__)); - return; - } - - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) { - QL_DPRINT8(ha, - (ha->pci_dev, "%s: !IFF_DRV_RUNNING\n", __func__)); - QLA_TX_UNLOCK(ha); - return; - } - - if (!ha->hw.link_up || !ha->watchdog_ticks) - ql_update_link_state(ha); - - if (!ha->hw.link_up) { - QL_DPRINT8(ha, (ha->pci_dev, "%s: link down\n", __func__)); - QLA_TX_UNLOCK(ha); - return; - } - - while (ifp->if_snd.ifq_head != NULL) { - IF_DEQUEUE(&ifp->if_snd, m_head); - - if (m_head == NULL) { - QL_DPRINT8(ha, (ha->pci_dev, "%s: m_head == NULL\n", - __func__)); - break; - } - - if (qla_send(ha, &m_head)) { - if (m_head == NULL) - break; - QL_DPRINT8(ha, (ha->pci_dev, "%s: PREPEND\n", __func__)); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_PREPEND(&ifp->if_snd, m_head); - break; - } - /* Send a copy of the frame to the BPF listener */ - ETHER_BPF_MTAP(ifp, m_head); - } - QLA_TX_UNLOCK(ha); - QL_DPRINT8(ha, (ha->pci_dev, "%s: exit\n", __func__)); - return; -} static int -qla_send(qla_host_t *ha, struct mbuf **m_headp) +qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32_t txr_idx, + uint32_t iscsi_pdu) { bus_dma_segment_t segs[QLA_MAX_SEGMENTS]; bus_dmamap_t map; @@ -1195,29 +1150,9 @@ qla_send(qla_host_t *ha, struct mbuf **m int ret = -1; uint32_t tx_idx; struct mbuf *m_head = *m_headp; - uint32_t txr_idx = ha->txr_idx; - uint32_t iscsi_pdu = 0; QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); - /* check if flowid is set */ - - if (M_HASHTYPE_GET(m_head) != M_HASHTYPE_NONE) { -#ifdef QL_ENABLE_ISCSI_TLV - if (qla_iscsi_pdu(ha, m_head) == 0) { - iscsi_pdu = 1; - txr_idx = m_head->m_pkthdr.flowid & - ((ha->hw.num_tx_rings >> 1) - 1); - } else { - txr_idx = m_head->m_pkthdr.flowid & - (ha->hw.num_tx_rings - 1); - } -#else - txr_idx = m_head->m_pkthdr.flowid & (ha->hw.num_tx_rings - 1); -#endif /* #ifdef QL_ENABLE_ISCSI_TLV */ - } - - tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map; @@ -1295,16 +1230,302 @@ qla_send(qla_host_t *ha, struct mbuf **m return (ret); } +static int +qla_alloc_tx_br(qla_host_t *ha, qla_tx_fp_t *fp) +{ + snprintf(fp->tx_mtx_name, sizeof(fp->tx_mtx_name), + "qla%d_fp%d_tx_mq_lock", ha->pci_func, fp->txr_idx); + + mtx_init(&fp->tx_mtx, fp->tx_mtx_name, NULL, MTX_DEF); + + fp->tx_br = buf_ring_alloc(NUM_TX_DESCRIPTORS, M_DEVBUF, + M_NOWAIT, &fp->tx_mtx); + if (fp->tx_br == NULL) { + QL_DPRINT1(ha, (ha->pci_dev, "buf_ring_alloc failed for " + " fp[%d, %d]\n", ha->pci_func, fp->txr_idx)); + return (-ENOMEM); + } + return 0; +} + +static void +qla_free_tx_br(qla_host_t *ha, qla_tx_fp_t *fp) +{ + struct mbuf *mp; + struct ifnet *ifp = ha->ifp; + + if (mtx_initialized(&fp->tx_mtx)) { + + if (fp->tx_br != NULL) { + + mtx_lock(&fp->tx_mtx); + + while ((mp = drbr_dequeue(ifp, fp->tx_br)) != NULL) { + m_freem(mp); + } + + mtx_unlock(&fp->tx_mtx); + + buf_ring_free(fp->tx_br, M_DEVBUF); + fp->tx_br = NULL; + } + mtx_destroy(&fp->tx_mtx); + } + return; +} + +static void +qla_fp_taskqueue(void *context, int pending) +{ + qla_tx_fp_t *fp; + qla_host_t *ha; + struct ifnet *ifp; + struct mbuf *mp; + int ret; + uint32_t txr_idx; + uint32_t iscsi_pdu = 0; + uint32_t rx_pkts_left; + + fp = context; + + if (fp == NULL) + return; + + ha = (qla_host_t *)fp->ha; + + ifp = ha->ifp; + + txr_idx = fp->txr_idx; + + mtx_lock(&fp->tx_mtx); + + if (((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) || (!ha->hw.link_up)) { + mtx_unlock(&fp->tx_mtx); + goto qla_fp_taskqueue_exit; + } + + rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); + +#ifdef QL_ENABLE_ISCSI_TLV + ql_hw_tx_done_locked(ha, fp->txr_idx); + ql_hw_tx_done_locked(ha, (fp->txr_idx + (ha->hw.num_tx_rings >> 1))); + txr_idx = txr_idx + (ha->hw.num_tx_rings >> 1); +#else + ql_hw_tx_done_locked(ha, fp->txr_idx); +#endif /* #ifdef QL_ENABLE_ISCSI_TLV */ + + mp = drbr_peek(ifp, fp->tx_br); + + while (mp != NULL) { + + if (M_HASHTYPE_GET(mp) != M_HASHTYPE_NONE) { +#ifdef QL_ENABLE_ISCSI_TLV + if (ql_iscsi_pdu(ha, mp) == 0) { + iscsi_pdu = 1; + } +#endif /* #ifdef QL_ENABLE_ISCSI_TLV */ + } + + ret = qla_send(ha, &mp, txr_idx, iscsi_pdu); + + if (ret) { + if (mp != NULL) + drbr_putback(ifp, fp->tx_br, mp); + else { + drbr_advance(ifp, fp->tx_br); + } + + mtx_unlock(&fp->tx_mtx); + + goto qla_fp_taskqueue_exit0; + } else { + drbr_advance(ifp, fp->tx_br); + } + + mp = drbr_peek(ifp, fp->tx_br); + } + + mtx_unlock(&fp->tx_mtx); + +qla_fp_taskqueue_exit0: + + if (rx_pkts_left || ((mp != NULL) && ret)) { + taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task); + } else { + if (!ha->flags.stop_rcv) { + QL_ENABLE_INTERRUPTS(ha, fp->txr_idx); + } + } + +qla_fp_taskqueue_exit: + + QL_DPRINT2(ha, (ha->pci_dev, "%s: exit ret = %d\n", __func__, ret)); + return; +} + +static int +qla_create_fp_taskqueues(qla_host_t *ha) +{ + int i; + uint8_t tq_name[32]; + + for (i = 0; i < ha->hw.num_sds_rings; i++) { + + qla_tx_fp_t *fp = &ha->tx_fp[i]; + + bzero(tq_name, sizeof (tq_name)); + snprintf(tq_name, sizeof (tq_name), "ql_fp_tq_%d", i); + + TASK_INIT(&fp->fp_task, 0, qla_fp_taskqueue, fp); + + fp->fp_taskqueue = taskqueue_create_fast(tq_name, M_NOWAIT, + taskqueue_thread_enqueue, + &fp->fp_taskqueue); + + if (fp->fp_taskqueue == NULL) + return (-1); + + taskqueue_start_threads(&fp->fp_taskqueue, 1, PI_NET, "%s", + tq_name); + + QL_DPRINT1(ha, (ha->pci_dev, "%s: %p\n", __func__, + fp->fp_taskqueue)); + } + + return (0); +} + +static void +qla_destroy_fp_taskqueues(qla_host_t *ha) +{ + int i; + + for (i = 0; i < ha->hw.num_sds_rings; i++) { + + qla_tx_fp_t *fp = &ha->tx_fp[i]; + + if (fp->fp_taskqueue != NULL) { + taskqueue_drain(fp->fp_taskqueue, &fp->fp_task); + taskqueue_free(fp->fp_taskqueue); + fp->fp_taskqueue = NULL; + } + } + return; +} + +static void +qla_drain_fp_taskqueues(qla_host_t *ha) +{ + int i; + + for (i = 0; i < ha->hw.num_sds_rings; i++) { + qla_tx_fp_t *fp = &ha->tx_fp[i]; + + if (fp->fp_taskqueue != NULL) { + taskqueue_drain(fp->fp_taskqueue, &fp->fp_task); + } + } + return; +} + +static int +qla_transmit(struct ifnet *ifp, struct mbuf *mp) +{ + qla_host_t *ha = (qla_host_t *)ifp->if_softc; + qla_tx_fp_t *fp; + int rss_id = 0; + int ret = 0; + + QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); + +#if __FreeBSD_version >= 1100000 + if (M_HASHTYPE_GET(mp) != M_HASHTYPE_NONE) +#else + if (mp->m_flags & M_FLOWID) +#endif + rss_id = (mp->m_pkthdr.flowid & Q8_RSS_IND_TBL_MAX_IDX) % + ha->hw.num_sds_rings; + fp = &ha->tx_fp[rss_id]; + + if (fp->tx_br == NULL) { + ret = EINVAL; + goto qla_transmit_exit; + } + + if (mp != NULL) { + ret = drbr_enqueue(ifp, fp->tx_br, mp); + } + + if (fp->fp_taskqueue != NULL) + taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task); + + ret = 0; + +qla_transmit_exit: + + QL_DPRINT2(ha, (ha->pci_dev, "%s: exit ret = %d\n", __func__, ret)); + return ret; +} + +static void +qla_qflush(struct ifnet *ifp) +{ + int i; + qla_tx_fp_t *fp; + struct mbuf *mp; + qla_host_t *ha; + + ha = (qla_host_t *)ifp->if_softc; + + QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); + + for (i = 0; i < ha->hw.num_sds_rings; i++) { + + fp = &ha->tx_fp[i]; + + if (fp == NULL) + continue; + + if (fp->tx_br) { + mtx_lock(&fp->tx_mtx); + + while ((mp = drbr_dequeue(ifp, fp->tx_br)) != NULL) { + m_freem(mp); + } + mtx_unlock(&fp->tx_mtx); + } + } + QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); + + return; +} + + static void qla_stop(qla_host_t *ha) { struct ifnet *ifp = ha->ifp; device_t dev; + int i = 0; dev = ha->pci_dev; ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); - QLA_TX_LOCK(ha); QLA_TX_UNLOCK(ha); + + for (i = 0; i < ha->hw.num_sds_rings; i++) { + qla_tx_fp_t *fp; + + fp = &ha->tx_fp[i]; + + if (fp == NULL) + continue; + + if (fp->tx_br != NULL) { + mtx_lock(&fp->tx_mtx); + mtx_unlock(&fp->tx_mtx); + } + } ha->flags.qla_watchdog_pause = 1; @@ -1313,6 +1534,8 @@ qla_stop(qla_host_t *ha) ha->flags.qla_interface_up = 0; + qla_drain_fp_taskqueues(ha); + ql_hw_stop_rcv(ha); ql_del_hw_if(ha); @@ -1653,25 +1876,6 @@ exit_ql_get_mbuf: return (ret); } -static void -qla_tx_done(void *context, int pending) -{ - qla_host_t *ha = context; - struct ifnet *ifp; - - ifp = ha->ifp; - - if (!ifp) - return; - - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - QL_DPRINT8(ha, (ha->pci_dev, "%s: !IFF_DRV_RUNNING\n", __func__)); - return; - } - ql_hw_tx_done(ha); - - qla_start(ha->ifp); -} static void qla_get_peer(qla_host_t *ha) @@ -1714,18 +1918,32 @@ qla_error_recovery(void *context, int pe qla_host_t *ha = context; uint32_t msecs_100 = 100; struct ifnet *ifp = ha->ifp; + int i = 0; (void)QLA_LOCK(ha, __func__, 0); if (ha->flags.qla_interface_up) { - ha->hw.imd_compl = 1; - qla_mdelay(__func__, 300); + ha->hw.imd_compl = 1; + qla_mdelay(__func__, 300); - ql_hw_stop_rcv(ha); + ql_hw_stop_rcv(ha); - ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); - QLA_TX_LOCK(ha); QLA_TX_UNLOCK(ha); + ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); + + for (i = 0; i < ha->hw.num_sds_rings; i++) { + qla_tx_fp_t *fp; + + fp = &ha->tx_fp[i]; + + if (fp == NULL) + continue; + + if (fp->tx_br != NULL) { + mtx_lock(&fp->tx_mtx); + mtx_unlock(&fp->tx_mtx); + } + } } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Feb 2 13:36:09 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44AA3CC9BFF; Thu, 2 Feb 2017 13:36:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 056C21760; Thu, 2 Feb 2017 13:36:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12Da89S000440; Thu, 2 Feb 2017 13:36:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12Da7vL000435; Thu, 2 Feb 2017 13:36:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702021336.v12Da7vL000435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Feb 2017 13:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313092 - stable/10/sys/fs/tmpfs 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.23 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, 02 Feb 2017 13:36:09 -0000 Author: kib Date: Thu Feb 2 13:36:07 2017 New Revision: 313092 URL: https://svnweb.freebsd.org/changeset/base/313092 Log: MFC r312428: Refcount tmpfs nodes and mount structures. Modified: stable/10/sys/fs/tmpfs/tmpfs.h stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vfsops.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs.h Thu Feb 2 09:19:57 2017 (r313091) +++ stable/10/sys/fs/tmpfs/tmpfs.h Thu Feb 2 13:36:07 2017 (r313092) @@ -158,9 +158,11 @@ struct tmpfs_node { * Doubly-linked list entry which links all existing nodes for * a single file system. This is provided to ease the removal * of all nodes during the unmount operation, and to support - * the implementation of VOP_VNTOCNP(). + * the implementation of VOP_VNTOCNP(). tn_attached is false + * when the node is removed from list and unlocked. */ LIST_ENTRY(tmpfs_node) tn_entries; /* (m) */ + bool tn_attached; /* (m) */ /* * The node's type. Any of 'VBLK', 'VCHR', 'VDIR', 'VFIFO', @@ -231,6 +233,9 @@ struct tmpfs_node { */ int tn_vpstate; /* (i) */ + /* Transient refcounter on this node. */ + u_int tn_refcount; /* (m) + (i) */ + /* misc data field for different tn_type node */ union { /* Valid when tn_type == VBLK || tn_type == VCHR. */ @@ -358,6 +363,9 @@ struct tmpfs_mount { /* Number of nodes currently that are in use. */ ino_t tm_nodes_inuse; + /* Refcounter on this struct tmpfs_mount. */ + uint64_t tm_refcount; + /* maximum representable file size */ u_int64_t tm_maxfilesize; @@ -402,10 +410,14 @@ struct tmpfs_dir_cursor { * Prototypes for tmpfs_subr.c. */ +void tmpfs_ref_node(struct tmpfs_node *node); +void tmpfs_ref_node_locked(struct tmpfs_node *node); int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *, char *, dev_t, struct tmpfs_node **); void tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *); +bool tmpfs_free_node_locked(struct tmpfs_mount *, struct tmpfs_node *, bool); +void tmpfs_free_tmp(struct tmpfs_mount *); int tmpfs_alloc_dirent(struct tmpfs_mount *, struct tmpfs_node *, const char *, u_int, struct tmpfs_dirent **); void tmpfs_free_dirent(struct tmpfs_mount *, struct tmpfs_dirent *); Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Thu Feb 2 09:19:57 2017 (r313091) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Thu Feb 2 13:36:07 2017 (r313092) @@ -131,6 +131,26 @@ tmpfs_pages_check_avail(struct tmpfs_mou return (1); } +void +tmpfs_ref_node(struct tmpfs_node *node) +{ + + TMPFS_NODE_LOCK(node); + tmpfs_ref_node_locked(node); + TMPFS_NODE_UNLOCK(node); +} + +void +tmpfs_ref_node_locked(struct tmpfs_node *node) +{ + + TMPFS_NODE_ASSERT_LOCKED(node); + KASSERT(node->tn_refcount > 0, ("node %p zero refcount", node)); + KASSERT(node->tn_refcount < UINT_MAX, ("node %p refcount %u", node, + node->tn_refcount)); + node->tn_refcount++; +} + /* * Allocates a new node of type 'type' inside the 'tmp' mount point, with * its owner set to 'uid', its group to 'gid' and its mode set to 'mode', @@ -205,6 +225,7 @@ tmpfs_alloc_node(struct mount *mp, struc nnode->tn_gid = gid; nnode->tn_mode = mode; nnode->tn_id = alloc_unr(tmp->tm_ino_unr); + nnode->tn_refcount = 1; /* Type-specific initialization. */ switch (nnode->tn_type) { @@ -258,7 +279,9 @@ tmpfs_alloc_node(struct mount *mp, struc TMPFS_LOCK(tmp); LIST_INSERT_HEAD(&tmp->tm_nodes_used, nnode, tn_entries); + nnode->tn_attached = true; tmp->tm_nodes_inuse++; + tmp->tm_refcount++; TMPFS_UNLOCK(tmp); *node = nnode; @@ -272,18 +295,40 @@ tmpfs_alloc_node(struct mount *mp, struc void tmpfs_free_node(struct tmpfs_mount *tmp, struct tmpfs_node *node) { + + TMPFS_LOCK(tmp); + TMPFS_NODE_LOCK(node); + if (!tmpfs_free_node_locked(tmp, node, false)) { + TMPFS_NODE_UNLOCK(node); + TMPFS_UNLOCK(tmp); + } +} + +bool +tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, + bool detach) +{ vm_object_t uobj; + TMPFS_MP_ASSERT_LOCKED(tmp); + TMPFS_NODE_ASSERT_LOCKED(node); + KASSERT(node->tn_refcount > 0, ("node %p refcount zero", node)); + + node->tn_refcount--; + if (node->tn_attached && (detach || node->tn_refcount == 0)) { + MPASS(tmp->tm_nodes_inuse > 0); + tmp->tm_nodes_inuse--; + LIST_REMOVE(node, tn_entries); + node->tn_attached = false; + } + if (node->tn_refcount > 0) + return (false); + #ifdef INVARIANTS - TMPFS_NODE_LOCK(node); MPASS(node->tn_vnode == NULL); MPASS((node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0); - TMPFS_NODE_UNLOCK(node); #endif - - TMPFS_LOCK(tmp); - LIST_REMOVE(node, tn_entries); - tmp->tm_nodes_inuse--; + TMPFS_NODE_UNLOCK(node); TMPFS_UNLOCK(tmp); switch (node->tn_type) { @@ -323,6 +368,9 @@ tmpfs_free_node(struct tmpfs_mount *tmp, free_unr(tmp->tm_ino_unr, node->tn_id); uma_zfree(tmp->tm_node_pool, node); + TMPFS_LOCK(tmp); + tmpfs_free_tmp(tmp); + return (true); } static __inline uint32_t @@ -468,13 +516,16 @@ tmpfs_alloc_vp(struct mount *mp, struct struct vnode **vpp) { struct vnode *vp; + struct tmpfs_mount *tm; vm_object_t object; int error; error = 0; -loop: + tm = VFS_TO_TMPFS(mp); TMPFS_NODE_LOCK(node); -loop1: + tmpfs_ref_node_locked(node); +loop: + TMPFS_NODE_ASSERT_LOCKED(node); if ((vp = node->tn_vnode) != NULL) { MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0); VI_LOCK(vp); @@ -494,12 +545,14 @@ loop1: msleep(&node->tn_vnode, TMPFS_NODE_MTX(node), 0, "tmpfsE", 0); } - goto loop1; + goto loop; } TMPFS_NODE_UNLOCK(node); error = vget(vp, lkflag | LK_INTERLOCK, curthread); - if (error == ENOENT) + if (error == ENOENT) { + TMPFS_NODE_LOCK(node); goto loop; + } if (error != 0) { vp = NULL; goto out; @@ -511,6 +564,7 @@ loop1: */ if (node->tn_vnode == NULL || node->tn_vnode != vp) { vput(vp); + TMPFS_NODE_LOCK(node); goto loop; } @@ -532,11 +586,9 @@ loop1: if (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) { node->tn_vpstate |= TMPFS_VNODE_WANT; error = msleep((caddr_t) &node->tn_vpstate, - TMPFS_NODE_MTX(node), PDROP | PCATCH, - "tmpfs_alloc_vp", 0); - if (error) - return error; - + TMPFS_NODE_MTX(node), 0, "tmpfs_alloc_vp", 0); + if (error != 0) + goto out; goto loop; } else node->tn_vpstate |= TMPFS_VNODE_ALLOCATING; @@ -610,16 +662,17 @@ unlock: TMPFS_NODE_UNLOCK(node); out: - *vpp = vp; + if (error == 0) { + *vpp = vp; #ifdef INVARIANTS - if (error == 0) { MPASS(*vpp != NULL && VOP_ISLOCKED(*vpp)); TMPFS_NODE_LOCK(node); MPASS(*vpp == node->tn_vnode); TMPFS_NODE_UNLOCK(node); - } #endif + } + tmpfs_free_node(tm, node); return (error); } Modified: stable/10/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Thu Feb 2 09:19:57 2017 (r313091) +++ stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Thu Feb 2 13:36:07 2017 (r313092) @@ -221,6 +221,7 @@ tmpfs_mount(struct mount *mp) mtx_init(&tmp->tm_allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF); tmp->tm_nodes_max = nodes_max; tmp->tm_nodes_inuse = 0; + tmp->tm_refcount = 1; tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : OFF_MAX; LIST_INIT(&tmp->tm_nodes_used); @@ -302,11 +303,35 @@ tmpfs_unmount(struct mount *mp, int mntf TMPFS_LOCK(tmp); while ((node = LIST_FIRST(&tmp->tm_nodes_used)) != NULL) { - TMPFS_UNLOCK(tmp); + TMPFS_NODE_LOCK(node); if (node->tn_type == VDIR) tmpfs_dir_destroy(tmp, node); - tmpfs_free_node(tmp, node); - TMPFS_LOCK(tmp); + if (tmpfs_free_node_locked(tmp, node, true)) + TMPFS_LOCK(tmp); + else + TMPFS_NODE_UNLOCK(node); + } + + mp->mnt_data = NULL; + tmpfs_free_tmp(tmp); + vfs_write_resume(mp, VR_START_WRITE); + + MNT_ILOCK(mp); + mp->mnt_flag &= ~MNT_LOCAL; + MNT_IUNLOCK(mp); + + return (0); +} + +void +tmpfs_free_tmp(struct tmpfs_mount *tmp) +{ + + MPASS(tmp->tm_refcount > 0); + tmp->tm_refcount--; + if (tmp->tm_refcount > 0) { + TMPFS_UNLOCK(tmp); + return; } TMPFS_UNLOCK(tmp); @@ -318,16 +343,7 @@ tmpfs_unmount(struct mount *mp, int mntf MPASS(tmp->tm_pages_used == 0); MPASS(tmp->tm_nodes_inuse == 0); - /* Throw away the tmpfs_mount structure. */ - free(mp->mnt_data, M_TMPFSMNT); - mp->mnt_data = NULL; - vfs_write_resume(mp, VR_START_WRITE); - - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); - - return (0); + free(tmp, M_TMPFSMNT); } static int @@ -345,36 +361,36 @@ static int tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp) { - boolean_t found; struct tmpfs_fid *tfhp; struct tmpfs_mount *tmp; struct tmpfs_node *node; + int error; tmp = VFS_TO_TMPFS(mp); tfhp = (struct tmpfs_fid *)fhp; if (tfhp->tf_len != sizeof(struct tmpfs_fid)) - return EINVAL; + return (EINVAL); if (tfhp->tf_id >= tmp->tm_nodes_max) - return EINVAL; - - found = FALSE; + return (EINVAL); TMPFS_LOCK(tmp); LIST_FOREACH(node, &tmp->tm_nodes_used, tn_entries) { if (node->tn_id == tfhp->tf_id && node->tn_gen == tfhp->tf_gen) { - found = TRUE; + tmpfs_ref_node(node); break; } } TMPFS_UNLOCK(tmp); - if (found) - return (tmpfs_alloc_vp(mp, node, LK_EXCLUSIVE, vpp)); - - return (EINVAL); + if (node != NULL) { + error = tmpfs_alloc_vp(mp, node, LK_EXCLUSIVE, vpp); + tmpfs_free_node(tmp, node); + } else + error = EINVAL; + return (error); } /* ARGSUSED2 */ Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Thu Feb 2 09:19:57 2017 (r313091) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Thu Feb 2 13:36:07 2017 (r313092) @@ -82,7 +82,8 @@ tmpfs_lookup(struct vop_cachedlookup_arg struct vnode **vpp = v->a_vpp; struct componentname *cnp = v->a_cnp; struct tmpfs_dirent *de; - struct tmpfs_node *dnode; + struct tmpfs_node *dnode, *pnode; + struct tmpfs_mount *tm; int error; dnode = VP_TO_TMPFS_DIR(dvp); @@ -104,8 +105,12 @@ tmpfs_lookup(struct vop_cachedlookup_arg goto out; } if (cnp->cn_flags & ISDOTDOT) { + tm = VFS_TO_TMPFS(dvp->v_mount); + pnode = dnode->tn_dir.tn_parent; + tmpfs_ref_node(pnode); error = vn_vget_ino_gen(dvp, tmpfs_vn_get_ino_alloc, - dnode->tn_dir.tn_parent, cnp->cn_lkflags, vpp); + pnode, cnp->cn_lkflags, vpp); + tmpfs_free_node(tm, pnode); if (error != 0) goto out; } else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { From owner-svn-src-stable-10@freebsd.org Thu Feb 2 13:37:01 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDC33CC9C85; Thu, 2 Feb 2017 13:37:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0C918CC; Thu, 2 Feb 2017 13:37:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12Db0bn000533; Thu, 2 Feb 2017 13:37:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12Db07T000532; Thu, 2 Feb 2017 13:37:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702021337.v12Db07T000532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Feb 2017 13:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313093 - stable/10/sys/fs/tmpfs 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.23 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, 02 Feb 2017 13:37:01 -0000 Author: kib Date: Thu Feb 2 13:37:00 2017 New Revision: 313093 URL: https://svnweb.freebsd.org/changeset/base/313093 Log: MFC r312429: VNON nodes cannot exist. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Thu Feb 2 13:36:07 2017 (r313092) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Thu Feb 2 13:37:00 2017 (r313093) @@ -332,11 +332,6 @@ tmpfs_free_node_locked(struct tmpfs_moun TMPFS_UNLOCK(tmp); switch (node->tn_type) { - case VNON: - /* Do not do anything. VNON is provided to let the - * allocation routine clean itself easily by avoiding - * duplicating code in it. */ - /* FALLTHROUGH */ case VBLK: /* FALLTHROUGH */ case VCHR: From owner-svn-src-stable-10@freebsd.org Thu Feb 2 13:38:03 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C53BCC9D2C; Thu, 2 Feb 2017 13:38:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16FE41A25; Thu, 2 Feb 2017 13:38:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12Dc28m000631; Thu, 2 Feb 2017 13:38:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12Dc2NW000630; Thu, 2 Feb 2017 13:38:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702021338.v12Dc2NW000630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Feb 2017 13:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313094 - stable/10/sys/fs/tmpfs 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.23 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, 02 Feb 2017 13:38:03 -0000 Author: kib Date: Thu Feb 2 13:38:01 2017 New Revision: 313094 URL: https://svnweb.freebsd.org/changeset/base/313094 Log: MFC r312430: Implement VOP_VPTOCNP() for tmpfs. Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Thu Feb 2 13:37:00 2017 (r313093) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Thu Feb 2 13:38:01 2017 (r313094) @@ -1402,6 +1402,132 @@ tmpfs_whiteout(struct vop_whiteout_args } } +static int +tmpfs_vptocnp_dir(struct tmpfs_node *tn, struct tmpfs_node *tnp, + struct tmpfs_dirent **pde) +{ + struct tmpfs_dir_cursor dc; + struct tmpfs_dirent *de; + + for (de = tmpfs_dir_first(tnp, &dc); de != NULL; + de = tmpfs_dir_next(tnp, &dc)) { + if (de->td_node == tn) { + *pde = de; + return (0); + } + } + return (ENOENT); +} + +static int +tmpfs_vptocnp_fill(struct vnode *vp, struct tmpfs_node *tn, + struct tmpfs_node *tnp, char *buf, int *buflen, struct vnode **dvp) +{ + struct tmpfs_dirent *de; + int error, i; + + error = vn_vget_ino_gen(vp, tmpfs_vn_get_ino_alloc, tnp, LK_SHARED, + dvp); + if (error != 0) + return (error); + error = tmpfs_vptocnp_dir(tn, tnp, &de); + if (error == 0) { + i = *buflen; + i -= de->td_namelen; + if (i < 0) { + error = ENOMEM; + } else { + bcopy(de->ud.td_name, buf + i, de->td_namelen); + *buflen = i; + } + } + if (error == 0) { + if (vp != *dvp) + VOP_UNLOCK(*dvp, 0); + } else { + if (vp != *dvp) + vput(*dvp); + else + vrele(vp); + } + return (error); +} + +static int +tmpfs_vptocnp(struct vop_vptocnp_args *ap) +{ + struct vnode *vp, **dvp; + struct tmpfs_node *tn, *tnp, *tnp1; + struct tmpfs_dirent *de; + struct tmpfs_mount *tm; + char *buf; + int *buflen; + int error; + + vp = ap->a_vp; + dvp = ap->a_vpp; + buf = ap->a_buf; + buflen = ap->a_buflen; + + tm = VFS_TO_TMPFS(vp->v_mount); + tn = VP_TO_TMPFS_NODE(vp); + if (tn->tn_type == VDIR) { + tnp = tn->tn_dir.tn_parent; + if (tnp == NULL) + return (ENOENT); + tmpfs_ref_node(tnp); + error = tmpfs_vptocnp_fill(vp, tn, tn->tn_dir.tn_parent, buf, + buflen, dvp); + tmpfs_free_node(tm, tnp); + return (error); + } +restart: + TMPFS_LOCK(tm); + LIST_FOREACH_SAFE(tnp, &tm->tm_nodes_used, tn_entries, tnp1) { + if (tnp->tn_type != VDIR) + continue; + TMPFS_NODE_LOCK(tnp); + tmpfs_ref_node_locked(tnp); + + /* + * tn_vnode cannot be instantiated while we hold the + * node lock, so the directory cannot be changed while + * we iterate over it. Do this to avoid instantiating + * vnode for directories which cannot point to our + * node. + */ + error = tnp->tn_vnode == NULL ? tmpfs_vptocnp_dir(tn, tnp, + &de) : 0; + + if (error == 0) { + TMPFS_NODE_UNLOCK(tnp); + TMPFS_UNLOCK(tm); + error = tmpfs_vptocnp_fill(vp, tn, tnp, buf, buflen, + dvp); + if (error == 0) { + tmpfs_free_node(tm, tnp); + return (0); + } + if ((vp->v_iflag & VI_DOOMED) != 0) { + tmpfs_free_node(tm, tnp); + return (ENOENT); + } + TMPFS_LOCK(tm); + TMPFS_NODE_LOCK(tnp); + } + if (tmpfs_free_node_locked(tm, tnp, false)) { + goto restart; + } else { + KASSERT(tnp->tn_refcount > 0, + ("node %p refcount zero", tnp)); + tnp1 = LIST_NEXT(tnp, tn_entries); + TMPFS_NODE_UNLOCK(tnp); + } + } + TMPFS_UNLOCK(tm); + return (ENOENT); +} + /* * Vnode operations vector used for files stored in a tmpfs file system. */ @@ -1434,5 +1560,6 @@ struct vop_vector tmpfs_vnodeop_entries .vop_vptofh = tmpfs_vptofh, .vop_whiteout = tmpfs_whiteout, .vop_bmap = VOP_EOPNOTSUPP, + .vop_vptocnp = tmpfs_vptocnp, }; From owner-svn-src-stable-10@freebsd.org Thu Feb 2 13:39:12 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A86C4CC9DD1; Thu, 2 Feb 2017 13:39:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82FF21BBB; Thu, 2 Feb 2017 13:39:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12DdBf6000733; Thu, 2 Feb 2017 13:39:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12DdBnC000728; Thu, 2 Feb 2017 13:39:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702021339.v12DdBnC000728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Feb 2017 13:39: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: r313095 - stable/10/sys/fs/tmpfs 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.23 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, 02 Feb 2017 13:39:12 -0000 Author: kib Date: Thu Feb 2 13:39:11 2017 New Revision: 313095 URL: https://svnweb.freebsd.org/changeset/base/313095 Log: MFC r312432: Add a mount option for tmpfs(5) to not use namecache. Modified: stable/10/sys/fs/tmpfs/tmpfs.h stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vfsops.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c stable/10/sys/fs/tmpfs/tmpfs_vnops.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs.h Thu Feb 2 13:38:01 2017 (r313094) +++ stable/10/sys/fs/tmpfs/tmpfs.h Thu Feb 2 13:39:11 2017 (r313095) @@ -383,7 +383,9 @@ struct tmpfs_mount { uma_zone_t tm_node_pool; /* Read-only status. */ - int tm_ronly; + bool tm_ronly; + /* Do not use namecache. */ + bool tm_nonc; }; #define TMPFS_LOCK(tm) mtx_lock(&(tm)->tm_allnode_lock) #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->tm_allnode_lock) @@ -528,4 +530,11 @@ VP_TO_TMPFS_DIR(struct vnode *vp) return (node); } +static inline bool +tmpfs_use_nc(struct vnode *vp) +{ + + return (!(VFS_TO_TMPFS(vp->v_mount)->tm_nonc)); +} + #endif /* _FS_TMPFS_TMPFS_H_ */ Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Thu Feb 2 13:38:01 2017 (r313094) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Thu Feb 2 13:39:11 2017 (r313095) @@ -591,7 +591,8 @@ loop: TMPFS_NODE_UNLOCK(node); /* Get a new vnode and associate it with our node. */ - error = getnewvnode("tmpfs", mp, &tmpfs_vnodeop_entries, &vp); + error = getnewvnode("tmpfs", mp, VFS_TO_TMPFS(mp)->tm_nonc ? + &tmpfs_vnodeop_nonc_entries : &tmpfs_vnodeop_entries, &vp); if (error != 0) goto unlock; MPASS(vp != NULL); Modified: stable/10/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Thu Feb 2 13:38:01 2017 (r313094) +++ stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Thu Feb 2 13:39:11 2017 (r313095) @@ -78,7 +78,7 @@ static int tmpfs_statfs(struct mount *, static const char *tmpfs_opts[] = { "from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export", - "union", NULL + "union", "nonc", NULL }; static const char *tmpfs_updateopts[] = { @@ -137,6 +137,7 @@ tmpfs_mount(struct mount *mp) struct tmpfs_node *root; struct thread *td = curthread; int error; + bool nonc; /* Size counters. */ u_quad_t pages; off_t nodes_max, size_max, maxfilesize; @@ -185,6 +186,7 @@ tmpfs_mount(struct mount *mp) size_max = 0; if (vfs_getopt_size(mp->mnt_optnew, "maxfilesize", &maxfilesize) != 0) maxfilesize = 0; + nonc = vfs_getopt(mp->mnt_optnew, "nonc", NULL, NULL) == 0; /* Do not allow mounts if we do not have enough memory to preserve * the minimum reserved pages. */ @@ -235,6 +237,7 @@ tmpfs_mount(struct mount *mp) sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor, tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; + tmp->tm_nonc = nonc; /* Allocate the root node. */ error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Thu Feb 2 13:38:01 2017 (r313094) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Thu Feb 2 13:39:11 2017 (r313095) @@ -76,11 +76,8 @@ tmpfs_vn_get_ino_alloc(struct mount *mp, } static int -tmpfs_lookup(struct vop_cachedlookup_args *v) +tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) { - struct vnode *dvp = v->a_dvp; - struct vnode **vpp = v->a_vpp; - struct componentname *cnp = v->a_cnp; struct tmpfs_dirent *de; struct tmpfs_node *dnode, *pnode; struct tmpfs_mount *tm; @@ -213,7 +210,7 @@ tmpfs_lookup(struct vop_cachedlookup_arg * request was for creation, as it does not improve timings on * emprical tests. */ - if ((cnp->cn_flags & MAKEENTRY) != 0) + if ((cnp->cn_flags & MAKEENTRY) != 0 && tmpfs_use_nc(dvp)) cache_enter(dvp, *vpp, cnp); out: @@ -227,6 +224,20 @@ out: } static int +tmpfs_cached_lookup(struct vop_cachedlookup_args *v) +{ + + return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp)); +} + +static int +tmpfs_lookup(struct vop_lookup_args *v) +{ + + return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp)); +} + +static int tmpfs_create(struct vop_create_args *v) { struct vnode *dvp = v->a_dvp; @@ -238,7 +249,7 @@ tmpfs_create(struct vop_create_args *v) MPASS(vap->va_type == VREG || vap->va_type == VSOCK); error = tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL); - if (error == 0 && (cnp->cn_flags & MAKEENTRY) != 0) + if (error == 0 && (cnp->cn_flags & MAKEENTRY) != 0 && tmpfs_use_nc(dvp)) cache_enter(dvp, *vpp, cnp); return (error); } @@ -1009,10 +1020,12 @@ tmpfs_rename(struct vop_rename_args *v) tmpfs_dir_attach(tdvp, de); - cache_purge(fvp); - if (tvp != NULL) - cache_purge(tvp); - cache_purge_negative(tdvp); + if (tmpfs_use_nc(fvp)) { + cache_purge(fvp); + if (tvp != NULL) + cache_purge(tvp); + cache_purge_negative(tdvp); + } error = 0; @@ -1125,8 +1138,10 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_NODE_MODIFIED; TMPFS_NODE_UNLOCK(dnode); - cache_purge(dvp); - cache_purge(vp); + if (tmpfs_use_nc(dvp)) { + cache_purge(dvp); + cache_purge(vp); + } /* Free the directory entry we just deleted. Note that the node * referred by it will not be removed until the vnode is really @@ -1270,7 +1285,8 @@ tmpfs_reclaim(struct vop_reclaim_args *v else vnode_destroy_vobject(vp); vp->v_object = NULL; - cache_purge(vp); + if (tmpfs_use_nc(vp)) + cache_purge(vp); TMPFS_NODE_LOCK(node); tmpfs_free_vp(vp); @@ -1534,7 +1550,7 @@ restart: struct vop_vector tmpfs_vnodeop_entries = { .vop_default = &default_vnodeops, .vop_lookup = vfs_cache_lookup, - .vop_cachedlookup = tmpfs_lookup, + .vop_cachedlookup = tmpfs_cached_lookup, .vop_create = tmpfs_create, .vop_mknod = tmpfs_mknod, .vop_open = tmpfs_open, @@ -1563,3 +1579,10 @@ struct vop_vector tmpfs_vnodeop_entries .vop_vptocnp = tmpfs_vptocnp, }; +/* + * Same vector for mounts which do not use namecache. + */ +struct vop_vector tmpfs_vnodeop_nonc_entries = { + .vop_default = &tmpfs_vnodeop_entries, + .vop_lookup = tmpfs_lookup, +}; Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.h Thu Feb 2 13:38:01 2017 (r313094) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.h Thu Feb 2 13:39:11 2017 (r313095) @@ -44,6 +44,7 @@ */ extern struct vop_vector tmpfs_vnodeop_entries; +extern struct vop_vector tmpfs_vnodeop_nonc_entries; vop_access_t tmpfs_access; vop_getattr_t tmpfs_getattr; From owner-svn-src-stable-10@freebsd.org Thu Feb 2 13:40:39 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37409CC9EB0; Thu, 2 Feb 2017 13:40:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04C121E4F; Thu, 2 Feb 2017 13:40:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12DecRU000872; Thu, 2 Feb 2017 13:40:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12DecPP000871; Thu, 2 Feb 2017 13:40:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702021340.v12DecPP000871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 Feb 2017 13:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313096 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 02 Feb 2017 13:40:39 -0000 Author: kib Date: Thu Feb 2 13:40:37 2017 New Revision: 313096 URL: https://svnweb.freebsd.org/changeset/base/313096 Log: MFC r312649: Document mount option "nonc" for tmpfs. Modified: stable/10/share/man/man5/tmpfs.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/tmpfs.5 ============================================================================== --- stable/10/share/man/man5/tmpfs.5 Thu Feb 2 13:39:11 2017 (r313095) +++ stable/10/share/man/man5/tmpfs.5 Thu Feb 2 13:40:37 2017 (r313096) @@ -54,7 +54,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2017 +.Dd January 20, 2017 .Dt TMPFS 5 .Os .Sh NAME @@ -120,6 +120,10 @@ Defaults to the mount point's UID. .It Cm mode Specifies the mode (in octal notation) of the root inode of the file system. Defaults to the mount point's mode. +.It Cm nonc +Do not use namecache to resolve names to files for the created mount. +This saves memory, but currently might impair scalability for highly +used mounts on large machines. .It Cm inodes Specifies the maximum number of nodes available to the file system. If not specified, the file system chooses a reasonable maximum based on From owner-svn-src-stable-10@freebsd.org Thu Feb 2 19:50:30 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3994CCDA87; Thu, 2 Feb 2017 19:50:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADFCE832; Thu, 2 Feb 2017 19:50:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12JoTFI053479; Thu, 2 Feb 2017 19:50:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12JoT4c053472; Thu, 2 Feb 2017 19:50:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702021950.v12JoT4c053472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 2 Feb 2017 19:50: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: r313103 - in stable/10: sbin/dhclient sys/dev/mpr usr.bin/chat usr.bin/rpcgen usr.bin/tail usr.sbin/diskinfo 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.23 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, 02 Feb 2017 19:50:30 -0000 Author: asomers Date: Thu Feb 2 19:50:28 2017 New Revision: 313103 URL: https://svnweb.freebsd.org/changeset/base/313103 Log: MFC r311160, r311210, r311288, r311292, r311298, r311340 r311160: misc minor fixes in mpr(4) sys/dev/mpr/mpr_sas.c * Fix a potential null pointer dereference (CID 1305731) * Check for overrun of the ccb_scsiio.cdb_io.cdb_bytes buffer (CID 1211934) sys/dev/mpr/mpr_sas_lsi.c * Nullify a dangling pointer in mprsas_get_sata_identify * Fix a memory leak in mprsas_SSU_to_SATA_devices (CID 1211935) Reported by: Coverity (partially) CID: 1305731 1211934 1211935 Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8880 r311210: Quell Coverity for diskinfo(8) * CID 1198994: Don't run the speed disk on a disk with no sectors * CID 1011442: Don't call close(2) if open(2) fails * CID 1011161: Use snprintf instead of sprintf * CID 1009825: Check the return value of lseek Reported by: Coverity CID: 1198994 1011442 1011161 1009825 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311288: Delete dead code in chat(8) It's always been dead, ever since first import in 1994. It's still dead in OpenBSD's version, too. Reported by: Coverity CID: 270586 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311292: Remove dead code in rpc_parse.c It's been dead ever since it was imported from TI-RPC in 1995. The dead code is still present in Illumos today, but was removed from NetBSD in 2006. Reported by: Coverity CID: 270097 Obtained from: NetBSD MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311298: Remove dead code in dhclient(8) The offending code has been dead ever since the import from OpenBSD in r195805. OpenBSD later deleted that entire function. Reported by: Coverity CID: 500059 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311340: Misc Coverity fixes for tail(1) CID 1006402: Initialize stack variable CID 271580: Don't leak memory when ENOMEM. Reported by: Coverity CID: 271580 1006402 MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: stable/10/sbin/dhclient/dispatch.c stable/10/sys/dev/mpr/mpr_sas.c stable/10/sys/dev/mpr/mpr_sas_lsi.c stable/10/usr.bin/chat/chat.c stable/10/usr.bin/rpcgen/rpc_parse.c stable/10/usr.bin/tail/reverse.c stable/10/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/dhclient/dispatch.c ============================================================================== --- stable/10/sbin/dhclient/dispatch.c Thu Feb 2 19:23:07 2017 (r313102) +++ stable/10/sbin/dhclient/dispatch.c Thu Feb 2 19:50:28 2017 (r313103) @@ -453,16 +453,12 @@ add_protocol(char *name, int fd, void (* void remove_protocol(struct protocol *proto) { - struct protocol *p, *next, *prev; + struct protocol *p, *next; - prev = NULL; for (p = protocols; p; p = next) { next = p->next; if (p == proto) { - if (prev) - prev->next = p->next; - else - protocols = p->next; + protocols = p->next; free(p); } } Modified: stable/10/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_sas.c Thu Feb 2 19:23:07 2017 (r313102) +++ stable/10/sys/dev/mpr/mpr_sas.c Thu Feb 2 19:50:28 2017 (r313103) @@ -1846,8 +1846,12 @@ mprsas_action_scsiio(struct mprsas_softc if (csio->ccb_h.flags & CAM_CDB_POINTER) bcopy(csio->cdb_io.cdb_ptr, &req->CDB.CDB32[0], csio->cdb_len); - else + else { + KASSERT(csio->cdb_len <= IOCDBLEN, + ("cdb_len %d is greater than IOCDBLEN but CAM_CDB_POINTER is not set", + csio->cdb_len)); bcopy(csio->cdb_io.cdb_bytes, &req->CDB.CDB32[0],csio->cdb_len); + } req->IoFlags = htole16(csio->cdb_len); /* @@ -2429,6 +2433,7 @@ mprsas_scsiio_complete(struct mpr_softc * driver is being shutdown. */ if ((csio->cdb_io.cdb_bytes[0] == INQUIRY) && + (csio->data_ptr != NULL) && ((csio->data_ptr[0] & 0x1f) == T_DIRECT) && (sc->mapping_table[target_id].device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE) && Modified: stable/10/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_sas_lsi.c Thu Feb 2 19:23:07 2017 (r313102) +++ stable/10/sys/dev/mpr/mpr_sas_lsi.c Thu Feb 2 19:50:28 2017 (r313103) @@ -1056,6 +1056,7 @@ out: mpr_free_command(sc, cm); else if (error == 0) error = EWOULDBLOCK; + cm->cm_data = NULL; free(buffer, M_MPR); return (error); } @@ -1196,18 +1197,18 @@ mprsas_SSU_to_SATA_devices(struct mpr_so continue; } - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - mpr_dprint(sc, MPR_FAULT, "Unable to alloc CCB to stop " - "unit.\n"); - return; - } - /* * The stop_at_shutdown flag will be set if this device is * a SATA direct-access end device. */ if (target->stop_at_shutdown) { + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + mpr_dprint(sc, MPR_FAULT, "Unable to alloc CCB to stop " + "unit.\n"); + return; + } + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { Modified: stable/10/usr.bin/chat/chat.c ============================================================================== --- stable/10/usr.bin/chat/chat.c Thu Feb 2 19:23:07 2017 (r313102) +++ stable/10/usr.bin/chat/chat.c Thu Feb 2 19:50:28 2017 (r313103) @@ -1173,7 +1173,7 @@ int get_string(char *string) { char temp[STR_LEN]; - int c, printed = 0; + int c; size_t len, minlen; char *s = temp, *end = s + STR_LEN; char *logged = temp; @@ -1306,13 +1306,6 @@ get_string(char *string) alarm(0); - if (verbose && printed) { - if (alarmed) - chat_logf(" -- read timed out"); - else - chat_logf(" -- read failed: %m"); - } - exit_code = 3; alarmed = 0; return (0); Modified: stable/10/usr.bin/rpcgen/rpc_parse.c ============================================================================== --- stable/10/usr.bin/rpcgen/rpc_parse.c Thu Feb 2 19:23:07 2017 (r313102) +++ stable/10/usr.bin/rpcgen/rpc_parse.c Thu Feb 2 19:50:28 2017 (r313103) @@ -290,7 +290,6 @@ def_union(definition *defp) declaration dec; case_list *cases; case_list **tailp; - int flag; defp->def_kind = DEF_UNION; scan(TOK_IDENT, &tok); @@ -309,7 +308,6 @@ def_union(definition *defp) cases->case_name = tok.str; scan(TOK_COLON, &tok); /* now peek at next token */ - flag = 0; if (peekscan(TOK_CASE, &tok)){ do { scan2(TOK_IDENT, TOK_CHARCONST, &tok); @@ -322,14 +320,6 @@ def_union(definition *defp) scan(TOK_COLON, &tok); } while (peekscan(TOK_CASE, &tok)); } - else - if (flag) - { - - *tailp = cases; - tailp = &cases->next; - cases = XALLOC(case_list); - }; get_declaration(&dec, DEF_UNION); cases->case_decl = dec; Modified: stable/10/usr.bin/tail/reverse.c ============================================================================== --- stable/10/usr.bin/tail/reverse.c Thu Feb 2 19:23:07 2017 (r313102) +++ stable/10/usr.bin/tail/reverse.c Thu Feb 2 19:50:28 2017 (r313103) @@ -117,6 +117,7 @@ r_reg(FILE *fp, const char *fn, enum STY map.start = NULL; map.mapoff = map.maxoff = size; map.fd = fileno(fp); + map.maplen = 0; /* * Last char is special, ignore whether newline or not. Note that @@ -205,7 +206,13 @@ r_buf(FILE *fp, const char *fn) (tl->l = malloc(BSZ)) == NULL) { if (!mark) err(1, "malloc"); - tl = enomem ? tl->next : mark; + if (enomem) + tl = tl->next; + else { + if (tl) + free(tl); + tl = mark; + } enomem += tl->len; } else if (mark) { tl->next = mark; Modified: stable/10/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/10/usr.sbin/diskinfo/diskinfo.c Thu Feb 2 19:23:07 2017 (r313102) +++ stable/10/usr.sbin/diskinfo/diskinfo.c Thu Feb 2 19:50:28 2017 (r313103) @@ -89,13 +89,12 @@ main(int argc, char **argv) for (i = 0; i < argc; i++) { fd = open(argv[i], O_RDONLY); if (fd < 0 && errno == ENOENT && *argv[i] != '/') { - sprintf(buf, "%s%s", _PATH_DEV, argv[i]); + snprintf(buf, BUFSIZ, "%s%s", _PATH_DEV, argv[i]); fd = open(buf, O_RDONLY); } if (fd < 0) { warn("%s", argv[i]); - exitval = 1; - goto out; + exit(1); } error = ioctl(fd, DIOCGMEDIASIZE, &mediasize); if (error) { @@ -176,7 +175,8 @@ rdsect(int fd, off_t blockno, u_int sect { int error; - lseek(fd, (off_t)blockno * sectorsize, SEEK_SET); + if (lseek(fd, (off_t)blockno * sectorsize, SEEK_SET) == -1) + err(1, "lseek"); error = read(fd, sector, sectorsize); if (error == -1) err(1, "read"); @@ -241,6 +241,9 @@ speeddisk(int fd, off_t mediasize, u_int off_t b0, b1, sectorcount, step; sectorcount = mediasize / sectorsize; + if (sectorcount <= 0) + return; /* Can't test devices with no sectors */ + step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1); if (step > 16384) step = 16384; From owner-svn-src-stable-10@freebsd.org Thu Feb 2 23:04:02 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1E85CCEDA3; Thu, 2 Feb 2017 23:04:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 711C41673; Thu, 2 Feb 2017 23:04:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v12N41Hm035480; Thu, 2 Feb 2017 23:04:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v12N41Hr035479; Thu, 2 Feb 2017 23:04:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201702022304.v12N41Hr035479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 2 Feb 2017 23:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313112 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 02 Feb 2017 23:04:02 -0000 Author: asomers Date: Thu Feb 2 23:04:01 2017 New Revision: 313112 URL: https://svnweb.freebsd.org/changeset/base/313112 Log: MFC r310180, r310327 r310180: Fix panic during lagg destruction with simultaneous status check If you run "ifconfig lagg0 destroy" and "ifconfig lagg0" at the same time a page fault may result. The first process will destroy ifp->if_lagg in lagg_clone_destroy (called by if_clone_destroy). Then the second process will observe that ifp->if_lagg is NULL at the top of lagg_port_ioctl and goto fallback: where it will promptly dereference ifp->if_lagg anyway. The solution is to repeat the NULL check for ifp->if_lagg MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8512 r310327: Remove stray debugging code from r310180 Reported by: rstone Pointy hat to: asomers MFC after: 3 weeks X-MFC-with: 310180 Sponsored by: Spectra Logic Corp Modified: stable/10/sys/net/if_lagg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_lagg.c ============================================================================== --- stable/10/sys/net/if_lagg.c Thu Feb 2 23:04:00 2017 (r313111) +++ stable/10/sys/net/if_lagg.c Thu Feb 2 23:04:01 2017 (r313112) @@ -858,7 +858,7 @@ lagg_port_ioctl(struct ifnet *ifp, u_lon return (error); fallback: - if (lp->lp_ioctl != NULL) + if (lp != NULL && lp->lp_ioctl != NULL) return ((*lp->lp_ioctl)(ifp, cmd, data)); return (EINVAL); From owner-svn-src-stable-10@freebsd.org Fri Feb 3 11:18:35 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81A54CCEAC7; Fri, 3 Feb 2017 11:18:35 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E659B6A; Fri, 3 Feb 2017 11:18:35 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13BIYYg038561; Fri, 3 Feb 2017 11:18:34 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13BIY8W038560; Fri, 3 Feb 2017 11:18:34 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201702031118.v13BIY8W038560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Fri, 3 Feb 2017 11:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313144 - stable/10/bin/kill 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.23 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, 03 Feb 2017 11:18:35 -0000 Author: sevan (doc committer) Date: Fri Feb 3 11:18:34 2017 New Revision: 313144 URL: https://svnweb.freebsd.org/changeset/base/313144 Log: In v3 UNIX, the kill utility is documented in category 8, not 1. Add a note of it. http://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man8/kill.8 PR: 211786 Approved by: bcr (mentor) Obtained from: TUHS Differential Revision: https://reviews.freebsd.org/D8105 Modified: stable/10/bin/kill/kill.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/kill/kill.1 ============================================================================== --- stable/10/bin/kill/kill.1 Fri Feb 3 11:17:44 2017 (r313143) +++ stable/10/bin/kill/kill.1 Fri Feb 3 11:18:34 2017 (r313144) @@ -32,7 +32,7 @@ .\" @(#)kill.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 28, 1995 +.Dd October 3, 2016 .Dt KILL 1 .Os .Sh NAME @@ -147,7 +147,8 @@ compatible. A .Nm command appeared in -.At v3 . +.At v3 +in section 8 of the manual. .Sh BUGS A replacement for the command .Dq Li kill 0 From owner-svn-src-stable-10@freebsd.org Fri Feb 3 12:20:46 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 592B8CCC95C; Fri, 3 Feb 2017 12:20:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33B177F5; Fri, 3 Feb 2017 12:20:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13CKjjR063165; Fri, 3 Feb 2017 12:20:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13CKi6n063159; Fri, 3 Feb 2017 12:20:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702031220.v13CKi6n063159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 3 Feb 2017 12:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313150 - in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/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.23 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, 03 Feb 2017 12:20:46 -0000 Author: kib Date: Fri Feb 3 12:20:44 2017 New Revision: 313150 URL: https://svnweb.freebsd.org/changeset/base/313150 Log: MFC r289894: CLFLUSH does not need barriers, the instruction is ordered WRT other writes. Use CLFLUSHOPT when available. MFC r312555: Use SFENCE for ordering CLFLUSHOPT. Modified: stable/10/sys/amd64/amd64/initcpu.c stable/10/sys/amd64/amd64/pmap.c stable/10/sys/amd64/include/cpufunc.h stable/10/sys/i386/i386/initcpu.c stable/10/sys/i386/i386/pmap.c stable/10/sys/i386/include/cpufunc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/10/sys/amd64/amd64/initcpu.c Fri Feb 3 12:13:55 2017 (r313149) +++ stable/10/sys/amd64/amd64/initcpu.c Fri Feb 3 12:20:44 2017 (r313150) @@ -253,12 +253,17 @@ initializecpucache(void) * CPUID_SS feature even though the native CPU supports it. */ TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); - if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1) + if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1) { cpu_feature &= ~CPUID_CLFSH; + cpu_stdext_feature &= ~CPUID_STDEXT_CLFLUSHOPT; + } + /* - * Allow to disable CLFLUSH feature manually by - * hw.clflush_disable tunable. + * The kernel's use of CLFLUSH{,OPT} can be disabled manually + * by setting the hw.clflush_disable tunable. */ - if (hw_clflush_disable == 1) + if (hw_clflush_disable == 1) { cpu_feature &= ~CPUID_CLFSH; + cpu_stdext_feature &= ~CPUID_STDEXT_CLFLUSHOPT; + } } Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Fri Feb 3 12:13:55 2017 (r313149) +++ stable/10/sys/amd64/amd64/pmap.c Fri Feb 3 12:20:44 2017 (r313150) @@ -1789,9 +1789,8 @@ pmap_invalidate_cache_range(vm_offset_t if ((cpu_feature & CPUID_SS) != 0 && !force) ; /* If "Self Snoop" is supported and allowed, do nothing. */ - else if ((cpu_feature & CPUID_CLFSH) != 0 && + else if ((cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { - /* * XXX: Some CPUs fault, hang, or trash the local APIC * registers if we use CLFLUSH on the local APIC @@ -1802,16 +1801,29 @@ pmap_invalidate_cache_range(vm_offset_t return; /* - * Otherwise, do per-cache line flush. Use the mfence + * Otherwise, do per-cache line flush. Use the sfence * instruction to insure that previous stores are * included in the write-back. The processor * propagates flush to other processors in the cache * coherence domain. */ - mfence(); + sfence(); + for (; sva < eva; sva += cpu_clflush_line_size) + clflushopt(sva); + sfence(); + } else if ((cpu_feature & CPUID_CLFSH) != 0 && + eva - sva < PMAP_CLFLUSH_THRESHOLD) { + if (pmap_kextract(sva) == lapic_paddr) + return; + /* + * Writes are ordered by CLFLUSH on Intel CPUs. + */ + if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); for (; sva < eva; sva += cpu_clflush_line_size) clflush(sva); - mfence(); + if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); } else { /* @@ -1835,19 +1847,31 @@ pmap_invalidate_cache_pages(vm_page_t *p { vm_offset_t daddr, eva; int i; + bool useclflushopt; + useclflushopt = (cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0; if (count >= PMAP_CLFLUSH_THRESHOLD / PAGE_SIZE || - (cpu_feature & CPUID_CLFSH) == 0) + ((cpu_feature & CPUID_CLFSH) == 0 && !useclflushopt)) pmap_invalidate_cache(); else { - mfence(); + if (useclflushopt) + sfence(); + else if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); for (i = 0; i < count; i++) { daddr = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pages[i])); eva = daddr + PAGE_SIZE; - for (; daddr < eva; daddr += cpu_clflush_line_size) - clflush(daddr); + for (; daddr < eva; daddr += cpu_clflush_line_size) { + if (useclflushopt) + clflushopt(daddr); + else + clflush(daddr); + } } - mfence(); + if (useclflushopt) + sfence(); + else if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); } } Modified: stable/10/sys/amd64/include/cpufunc.h ============================================================================== --- stable/10/sys/amd64/include/cpufunc.h Fri Feb 3 12:13:55 2017 (r313149) +++ stable/10/sys/amd64/include/cpufunc.h Fri Feb 3 12:20:44 2017 (r313150) @@ -327,6 +327,13 @@ mfence(void) } static __inline void +sfence(void) +{ + + __asm __volatile("sfence" : : : "memory"); +} + +static __inline void ia32_pause(void) { __asm __volatile("pause"); Modified: stable/10/sys/i386/i386/initcpu.c ============================================================================== --- stable/10/sys/i386/i386/initcpu.c Fri Feb 3 12:13:55 2017 (r313149) +++ stable/10/sys/i386/i386/initcpu.c Fri Feb 3 12:20:44 2017 (r313150) @@ -826,14 +826,18 @@ initializecpucache(void) * CPUID_SS feature even though the native CPU supports it. */ TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable); - if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1) + if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1) { cpu_feature &= ~CPUID_CLFSH; + cpu_stdext_feature &= ~CPUID_STDEXT_CLFLUSHOPT; + } /* - * Allow to disable CLFLUSH feature manually by - * hw.clflush_disable tunable. + * The kernel's use of CLFLUSH{,OPT} can be disabled manually + * by setting the hw.clflush_disable tunable. */ - if (hw_clflush_disable == 1) + if (hw_clflush_disable == 1) { cpu_feature &= ~CPUID_CLFSH; + cpu_stdext_feature &= ~CPUID_STDEXT_CLFLUSHOPT; + } #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) /* Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Fri Feb 3 12:13:55 2017 (r313149) +++ stable/10/sys/i386/i386/pmap.c Fri Feb 3 12:20:44 2017 (r313150) @@ -1222,9 +1222,8 @@ pmap_invalidate_cache_range(vm_offset_t if ((cpu_feature & CPUID_SS) != 0 && !force) ; /* If "Self Snoop" is supported and allowed, do nothing. */ - else if ((cpu_feature & CPUID_CLFSH) != 0 && + else if ((cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { - #ifdef DEV_APIC /* * XXX: Some CPUs fault, hang, or trash the local APIC @@ -1236,16 +1235,29 @@ pmap_invalidate_cache_range(vm_offset_t return; #endif /* - * Otherwise, do per-cache line flush. Use the mfence + * Otherwise, do per-cache line flush. Use the sfence * instruction to insure that previous stores are * included in the write-back. The processor * propagates flush to other processors in the cache * coherence domain. */ - mfence(); + sfence(); + for (; sva < eva; sva += cpu_clflush_line_size) + clflushopt(sva); + sfence(); + } else if ((cpu_feature & CPUID_CLFSH) != 0 && + eva - sva < PMAP_CLFLUSH_THRESHOLD) { + if (pmap_kextract(sva) == lapic_paddr) + return; + /* + * Writes are ordered by CLFLUSH on Intel CPUs. + */ + if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); for (; sva < eva; sva += cpu_clflush_line_size) clflush(sva); - mfence(); + if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); } else { /* @@ -5316,8 +5328,10 @@ pmap_flush_page(vm_page_t m) { struct sysmaps *sysmaps; vm_offset_t sva, eva; + bool useclflushopt; - if ((cpu_feature & CPUID_CLFSH) != 0) { + useclflushopt = (cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0; + if (useclflushopt || (cpu_feature & CPUID_CLFSH) != 0) { sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)]; mtx_lock(&sysmaps->lock); if (*sysmaps->CMAP2) @@ -5330,14 +5344,25 @@ pmap_flush_page(vm_page_t m) eva = sva + PAGE_SIZE; /* - * Use mfence despite the ordering implied by - * mtx_{un,}lock() because clflush is not guaranteed - * to be ordered by any other instruction. + * Use mfence or sfence despite the ordering implied by + * mtx_{un,}lock() because clflush on non-Intel CPUs + * and clflushopt are not guaranteed to be ordered by + * any other instruction. */ - mfence(); - for (; sva < eva; sva += cpu_clflush_line_size) - clflush(sva); - mfence(); + if (useclflushopt) + sfence(); + else if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); + for (; sva < eva; sva += cpu_clflush_line_size) { + if (useclflushopt) + clflushopt(sva); + else + clflush(sva); + } + if (useclflushopt) + sfence(); + else if (cpu_vendor_id != CPU_VENDOR_INTEL) + mfence(); *sysmaps->CMAP2 = 0; sched_unpin(); mtx_unlock(&sysmaps->lock); Modified: stable/10/sys/i386/include/cpufunc.h ============================================================================== --- stable/10/sys/i386/include/cpufunc.h Fri Feb 3 12:13:55 2017 (r313149) +++ stable/10/sys/i386/include/cpufunc.h Fri Feb 3 12:20:44 2017 (r313150) @@ -175,6 +175,13 @@ mfence(void) __asm __volatile("mfence" : : : "memory"); } +static __inline void +sfence(void) +{ + + __asm __volatile("sfence" : : : "memory"); +} + #ifdef _KERNEL #define HAVE_INLINE_FFS From owner-svn-src-stable-10@freebsd.org Fri Feb 3 16:15:08 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3569FCCF71C; Fri, 3 Feb 2017 16:15:08 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F95BC67; Fri, 3 Feb 2017 16:15:07 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13GF7Z6064838; Fri, 3 Feb 2017 16:15:07 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13GF7ds064837; Fri, 3 Feb 2017 16:15:07 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201702031615.v13GF7ds064837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Fri, 3 Feb 2017 16:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313161 - stable/10/share/misc 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.23 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, 03 Feb 2017 16:15:08 -0000 Author: sevan (doc committer) Date: Fri Feb 3 16:15:06 2017 New Revision: 313161 URL: https://svnweb.freebsd.org/changeset/base/313161 Log: MFC from r273333 to 307002. Modified: stable/10/share/misc/bsd-family-tree Modified: stable/10/share/misc/bsd-family-tree ============================================================================== --- stable/10/share/misc/bsd-family-tree Fri Feb 3 16:08:58 2017 (r313160) +++ stable/10/share/misc/bsd-family-tree Fri Feb 3 16:15:06 2017 (r313161) @@ -258,6 +258,9 @@ FreeBSD 5.2 | | | | 8.3 | | | | | | | | | | | | NetBSD | | | | | | | | 5.1.3 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 5.1.4 | | | | | | | | OpenBSD 5.1 | | | | Mac OS X | `----. | | | | | 10.8 | \ | | @@ -268,14 +271,17 @@ FreeBSD 5.2 | | | | | | | | | | | | | | | | | | | NetBSD | | | | | | | | | 5.2.1 | | + | | | | | | | | | | + | | | | | | | NetBSD | | + | | | | | | | 5.2.2 | | | | | | | | | | | | | | | | | \ | | | | | | | | NetBSD | | | | | | | | 6.0.1 | | - | | | | | | | | | + | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 | | | | | | NetBSD | | | | | | | | 6.0.2 | | - | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 + | | | | | | | | | | | | | | | NetBSD | | | | | | | | 6.0.3 | | | | | | | | | | | @@ -296,25 +302,55 @@ FreeBSD 5.2 | | | \ | | | | | *--FreeBSD | | | NetBSD 6.1.3 | | | 10.0 | | | | | | - | | | | | | DragonFly 3.6.1 - | | | | | | | - | | | | | | | - | | | | | | DragonFly 3.6.2 - | | | | NetBSD 6.1.4 | | - | | | | | | - | | | | OpenBSD 5.5 | - | | | | | DragonFly 3.8.0 - | FreeBSD | | | | - | 9.3 | | | | - | | | | | - | | | | | - | | | | | - | | | | | - | | | | | - | | | | | + | | | | | | | DragonFly 3.6.1 + | | | | | | | | + | | | | | | | | + | | | | | | | DragonFly 3.6.2 + | | | | | NetBSD 6.1.4 | | + | | | | | | | | + | | | | | | OpenBSD 5.5 | + | | | | | | | | + | | | | | | | DragonFly 3.8.0 + | | | | | | | | + | | | | | | | | + | | | | | | | DragonFly 3.8.1 + | | | | | | | | + | | | | | | | | + | | | | | | | DragonFly 3.6.3 + | | | | | | | | + | | FreeBSD | | | | | + | | 9.3 | | | | | + | | | | NetBSD 6.1.5 | DragonFly 3.8.2 + | | Mac OS X | | | + | | 10.10 | | | + | | | | OpenBSD 5.6 | + | FreeBSD | | | | + | 10.1 | | | DragonFly 4.0.1 + | | | | | | + | | | | | DragonFly 4.0.2 + | | | | | | + | | | | | DragonFly 4.0.3 + | | | | | | + | | | | | DragonFly 4.0.4 + | | | | | | + | | | | | DragonFly 4.0.5 + | | | | | | + | | | | OpenBSD 5.7 | + | | | | | DragonFly 4.2.0 + | FreeBSD | | | | + | 10.2 | | | | + | | OS X NetBSD 7.0 | | + | | 10.11 | OpenBSD 5.8 | + | | | | | DragonFly 4.4.1 + | FreeBSD | | OpenBSD 5.9 | + | 10.3 | | | | + | | NetBSD 7.0.1 | | + | | | | DragonFly 4.6.0 + *--FreeBSD | | OpenBSD 6.0 | + | 11.0 | | | | | | | | | | | | | | -FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current +FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -632,15 +668,42 @@ Mac OS X 10.9 2013-10-22 [APL] OpenBSD 5.4 2013-11-01 [OBD] DragonFly 3.6.0 2013-11-25 [DFB] FreeBSD 10.0 2014-01-20 [FBD] -NetBSD 6.0.4 2014-01-27 [NBD] -NetBSD 6.1.3 2014-01-27 [NBD] +NetBSD 5.1.4 2014-01-25 [NBD] +NetBSD 5.2.2 2014-01-25 [NBD] +NetBSD 6.0.4 2014-01-25 [NBD] +NetBSD 6.1.3 2014-01-25 [NBD] DragonFly 3.6.1 2014-02-22 [DFB] DragonFly 3.6.2 2014-04-10 [DFB] -NetBSD 6.0.5 2014-04-19 [NDB] -NetBSD 6.1.4 2014-04-19 [NDB] +NetBSD 6.0.5 2014-04-12 [NDB] +NetBSD 6.1.4 2014-04-12 [NDB] OpenBSD 5.5 2014-05-01 [OBD] DragonFly 3.8.0 2014-06-04 [DFB] +DragonFly 3.8.1 2014-06-16 [DFB] +DragonFly 3.6.3 2014-06-17 [DFB] FreeBSD 9.3 2014-07-05 [FBD] +DragonFly 3.8.2 2014-08-08 [DFB] +NetBSD 6.1.5 2014-09-22 [NBD] +Mac OS X 10.10 2014-10-16 [APL] +OpenBSD 5.6 2014-11-01 [OBD] +FreeBSD 10.1 2014-11-14 [FBD] +DragonFly 4.0.1 2014-11-25 [DFB] +DragonFly 4.0.2 2015-01-07 [DFB] +DragonFly 4.0.3 2015-01-21 [DFB] +DragonFly 4.0.4 2015-03-09 [DFB] +DragonFly 4.0.5 2015-03-23 [DFB] +OpenBSD 5.7 2015-05-01 [OBD] +DragonFly 4.2.0 2015-06-29 [DFB] +FreeBSD 10.2 2015-08-13 [FBD] +NetBSD 7.0 2015-09-25 [NBD] +OS X 10.11 2015-09-30 [APL] +OpenBSD 5.8 2015-10-18 [OBD] +DragonFly 4.4.1 2015-12-07 [DFB] +OpenBSD 5.9 2016-03-29 [OBD] +FreeBSD 10.3 2016-04-04 [FBD] +NetBSD 7.0.1 2016-05-22 [NBD] +DragonFly 4.6.0 2016-08-02 [DFB] +OpenBSD 6.0 2016-09-01 [OBD] +FreeBSD 11.0 2016-10-10 [FBD] Bibliography ------------------------ @@ -660,6 +723,10 @@ McKusick, Marshall Kirk, George Neville- Implementation of the FreeBSD Operating System. Addison-Wesley Professional, Published: Aug 2, 2004. ISBN 0-201-70245-2 +McKusick, Marshall Kirk, George Neville-Neil, Robert Watson. The +Design and Implementation of the FreeBSD Operating System, 2nd Edition. +Pearson Education, Inc., 2014. ISBN 0-321-96897-2 + Doug McIlroy. Research Unix Reader. Michael G. Brown. The Role of BSD in the Development of Unix. From owner-svn-src-stable-10@freebsd.org Fri Feb 3 16:36:15 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CCBCCCFE28; Fri, 3 Feb 2017 16:36:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BFB91056; Fri, 3 Feb 2017 16:36:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13GaE39073860; Fri, 3 Feb 2017 16:36:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13GaE9P073859; Fri, 3 Feb 2017 16:36:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702031636.v13GaE9P073859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2017 16:36: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: r313165 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 03 Feb 2017 16:36:15 -0000 Author: pfg Date: Fri Feb 3 16:36:14 2017 New Revision: 313165 URL: https://svnweb.freebsd.org/changeset/base/313165 Log: MFC r312001: Remove __nonnull() attributes from x86 machine check architecture. In this case the attributes serve little purpose as they just don't enforce run time checks, If anything the attributes would cause NULL pointer checks to be ignored but there are no such checks so the only effect is cosmetic. Reviewed by: jhb, avg Modified: stable/10/sys/x86/x86/mca.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/x86/mca.c ============================================================================== --- stable/10/sys/x86/x86/mca.c Fri Feb 3 16:35:10 2017 (r313164) +++ stable/10/sys/x86/x86/mca.c Fri Feb 3 16:36:14 2017 (r313165) @@ -249,7 +249,7 @@ mca_error_mmtype(uint16_t mca_error) return ("???"); } -static int __nonnull(1) +static int mca_mute(const struct mca_record *rec) { @@ -278,7 +278,7 @@ mca_mute(const struct mca_record *rec) } /* Dump details about a single machine check. */ -static void __nonnull(1) +static void mca_log(const struct mca_record *rec) { uint16_t mca_error; @@ -417,7 +417,7 @@ mca_log(const struct mca_record *rec) printf("MCA: Misc 0x%llx\n", (long long)rec->mr_misc); } -static int __nonnull(2) +static int mca_check_status(int bank, struct mca_record *rec) { uint64_t status; @@ -484,7 +484,7 @@ mca_refill(void *context, int pending) mca_fill_freelist(); } -static void __nonnull(2) +static void mca_record_entry(enum scan_mode mode, const struct mca_record *record) { struct mca_internal *rec; From owner-svn-src-stable-10@freebsd.org Fri Feb 3 23:33:08 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EB63CCE3CE; Fri, 3 Feb 2017 23:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAB951AA8; Fri, 3 Feb 2017 23:33:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13NX68c046620; Fri, 3 Feb 2017 23:33:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13NX6MR046615; Fri, 3 Feb 2017 23:33:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201702032333.v13NX6MR046615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 3 Feb 2017 23:33: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: r313178 - in stable: 10/sys/dev/cxgbe/tom 11/sys/dev/cxgbe/tom 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.23 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, 03 Feb 2017 23:33:08 -0000 Author: jhb Date: Fri Feb 3 23:33:06 2017 New Revision: 313178 URL: https://svnweb.freebsd.org/changeset/base/313178 Log: MFC 312906: Unregister CPL handlers for TOE-related messages when unloading TOM. Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgbe/tom/t4_connect.c stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_listen.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_connect.c Fri Feb 3 22:40:13 2017 (r313177) +++ stable/10/sys/dev/cxgbe/tom/t4_connect.c Fri Feb 3 23:33:06 2017 (r313178) @@ -275,6 +275,14 @@ t4_init_connect_cpl_handlers(void) t4_register_cpl_handler(CPL_ACT_OPEN_RPL, do_act_open_rpl); } +void +t4_uninit_connect_cpl_handlers(void) +{ + + t4_register_cpl_handler(CPL_ACT_ESTABLISH, NULL); + t4_register_cpl_handler(CPL_ACT_OPEN_RPL, NULL); +} + #define DONT_OFFLOAD_ACTIVE_OPEN(x) do { \ reason = __LINE__; \ rc = (x); \ Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Feb 3 22:40:13 2017 (r313177) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Feb 3 23:33:06 2017 (r313178) @@ -1798,11 +1798,11 @@ void t4_uninit_cpl_io_handlers(void) { - t4_register_cpl_handler(CPL_PEER_CLOSE, do_peer_close); - t4_register_cpl_handler(CPL_CLOSE_CON_RPL, do_close_con_rpl); - t4_register_cpl_handler(CPL_ABORT_REQ_RSS, do_abort_req); - t4_register_cpl_handler(CPL_ABORT_RPL_RSS, do_abort_rpl); - t4_register_cpl_handler(CPL_RX_DATA, do_rx_data); - t4_register_cpl_handler(CPL_FW4_ACK, do_fw4_ack); + t4_register_cpl_handler(CPL_PEER_CLOSE, NULL); + t4_register_cpl_handler(CPL_CLOSE_CON_RPL, NULL); + t4_register_cpl_handler(CPL_ABORT_REQ_RSS, NULL); + t4_register_cpl_handler(CPL_ABORT_RPL_RSS, NULL); + t4_register_cpl_handler(CPL_RX_DATA, NULL); + t4_register_cpl_handler(CPL_FW4_ACK, NULL); } #endif Modified: stable/10/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_listen.c Fri Feb 3 22:40:13 2017 (r313177) +++ stable/10/sys/dev/cxgbe/tom/t4_listen.c Fri Feb 3 23:33:06 2017 (r313178) @@ -1677,4 +1677,14 @@ t4_init_listen_cpl_handlers(void) t4_register_cpl_handler(CPL_PASS_ACCEPT_REQ, do_pass_accept_req); t4_register_cpl_handler(CPL_PASS_ESTABLISH, do_pass_establish); } + +void +t4_uninit_listen_cpl_handlers(void) +{ + + t4_register_cpl_handler(CPL_PASS_OPEN_RPL, NULL); + t4_register_cpl_handler(CPL_CLOSE_LISTSRV_RPL, NULL); + t4_register_cpl_handler(CPL_PASS_ACCEPT_REQ, NULL); + t4_register_cpl_handler(CPL_PASS_ESTABLISH, NULL); +} #endif Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.c Fri Feb 3 22:40:13 2017 (r313177) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.c Fri Feb 3 23:33:06 2017 (r313178) @@ -1225,6 +1225,10 @@ t4_tom_mod_unload(void) t4_ddp_mod_unload(); + t4_uninit_connect_cpl_handlers(); + t4_uninit_listen_cpl_handlers(); + t4_uninit_cpl_io_handlers(); + return (0); } #endif /* TCP_OFFLOAD */ Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.h Fri Feb 3 22:40:13 2017 (r313177) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.h Fri Feb 3 23:33:06 2017 (r313178) @@ -298,12 +298,14 @@ void release_lip(struct tom_data *, stru /* t4_connect.c */ void t4_init_connect_cpl_handlers(void); +void t4_uninit_connect_cpl_handlers(void); int t4_connect(struct toedev *, struct socket *, struct rtentry *, struct sockaddr *); void act_open_failure_cleanup(struct adapter *, u_int, u_int); /* t4_listen.c */ void t4_init_listen_cpl_handlers(void); +void t4_uninit_listen_cpl_handlers(void); int t4_listen_start(struct toedev *, struct tcpcb *); int t4_listen_stop(struct toedev *, struct tcpcb *); void t4_syncache_added(struct toedev *, void *); From owner-svn-src-stable-10@freebsd.org Sat Feb 4 15:44:50 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F97BCD02E7; Sat, 4 Feb 2017 15:44:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F2BD3C5; Sat, 4 Feb 2017 15:44:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14FinKl048126; Sat, 4 Feb 2017 15:44:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14Finuh048125; Sat, 4 Feb 2017 15:44:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041544.v14Finuh048125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 15:44: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: r313199 - stable/10/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Feb 2017 15:44:50 -0000 Author: ngie Date: Sat Feb 4 15:44:49 2017 New Revision: 313199 URL: https://svnweb.freebsd.org/changeset/base/313199 Log: MFC r312937: Fix typo in lib/Makefile The SUBDIR_DEPEND variable should be for librpcsec_gss, not liblibrpc_gss PR: 216409 Modified: stable/10/lib/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Sat Feb 4 15:43:54 2017 (r313198) +++ stable/10/lib/Makefile Sat Feb 4 15:44:49 2017 (r313199) @@ -130,7 +130,7 @@ SUBDIR_DEPEND_libdpv= libfigpar ncurses SUBDIR_DEPEND_libedit= ncurses SUBDIR_DEPEND_libg++= msun SUBDIR_DEPEND_libgeom= libexpat libsbuf -SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi +SUBDIR_DEPEND_librpcsec_gss= libgssapi SUBDIR_DEPEND_libmagic= libz SUBDIR_DEPEND_libmemstat= libkvm SUBDIR_DEPEND_libopie= libmd From owner-svn-src-stable-10@freebsd.org Sat Feb 4 15:45:52 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D016DCD03D8; Sat, 4 Feb 2017 15:45:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD4E84F; Sat, 4 Feb 2017 15:45:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14FjpEY048453; Sat, 4 Feb 2017 15:45:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14FjpRP048452; Sat, 4 Feb 2017 15:45:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041545.v14FjpRP048452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 15:45: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: r313201 - stable/10/contrib/bsnmp/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Feb 2017 15:45:52 -0000 Author: ngie Date: Sat Feb 4 15:45:51 2017 New Revision: 313201 URL: https://svnweb.freebsd.org/changeset/base/313201 Log: MFC r311263: Use calloc instead of malloc with buffers in snmp_{recv,send}_packet This doesn't fix the issue noted in the PR, but at the very least it cleans up the error so it looks a bit more sane, and in the event that bsnmp did wander off into the weeds, the likelihood of it crashing with more sensible output is greater, in my opinion MFC counter set high so I have enough time to resolve the real underlying bug in bsnmpwalk PR: 215721 Modified: stable/10/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpclient.c Sat Feb 4 15:45:39 2017 (r313200) +++ stable/10/contrib/bsnmp/lib/snmpclient.c Sat Feb 4 15:45:51 2017 (r313201) @@ -1234,7 +1234,7 @@ snmp_send_packet(struct snmp_pdu * pdu) struct asn_buf b; ssize_t ret; - if ((buf = malloc(snmp_client.txbuflen)) == NULL) { + if ((buf = calloc(1, snmp_client.txbuflen)) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); return (-1); } @@ -1259,7 +1259,7 @@ snmp_send_packet(struct snmp_pdu * pdu) } free(buf); - return pdu->request_id; + return (pdu->request_id); } /* @@ -1355,7 +1355,7 @@ snmp_receive_packet(struct snmp_pdu *pdu socklen_t optlen; #endif - if ((buf = malloc(snmp_client.rxbuflen)) == NULL) { + if ((buf = calloc(1, snmp_client.rxbuflen)) == NULL) { seterr(&snmp_client, "%s", strerror(errno)); return (-1); } From owner-svn-src-stable-10@freebsd.org Sat Feb 4 15:52:10 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B8F8CD0AFB; Sat, 4 Feb 2017 15:52:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05EEE1354; Sat, 4 Feb 2017 15:52:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14Fq8vK053051; Sat, 4 Feb 2017 15:52:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14Fq80M053049; Sat, 4 Feb 2017 15:52:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041552.v14Fq80M053049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 15:52: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: r313206 - stable/10/usr.sbin/inetd 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.23 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, 04 Feb 2017 15:52:10 -0000 Author: ngie Date: Sat Feb 4 15:52:08 2017 New Revision: 313206 URL: https://svnweb.freebsd.org/changeset/base/313206 Log: MFC r312105,r312162: r312105: Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS This will allow inetd to stand by itself without libwrap. Relnotes: yes r312162: Fix up r312105 - Only #include tcpd.h when LIBWRAP is true to avoid header include errors - Only define whichaf when LIBWRAP is true to avoid -Wunused warning and to avoid issues with structs being defined that should only be defined when tcpd.h is included. Pointyhat to: ngie Modified: stable/10/usr.sbin/inetd/Makefile stable/10/usr.sbin/inetd/inetd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/inetd/Makefile ============================================================================== --- stable/10/usr.sbin/inetd/Makefile Sat Feb 4 15:51:45 2017 (r313205) +++ stable/10/usr.sbin/inetd/Makefile Sat Feb 4 15:52:08 2017 (r313206) @@ -16,8 +16,14 @@ CFLAGS+= -DLOGIN_CAP CFLAGS+= -DINET6 .endif -DPADD= ${LIBUTIL} ${LIBWRAP} -LDADD= -lutil -lwrap +DPADD+= ${LIBUTIL} +LDADD+= -lutil + +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DLIBWRAP +DPADD+= ${LIBWRAP} +LDADD+= -lwrap +.endif # XXX for src/release/picobsd .if !defined(RELEASE_CRUNCH) Modified: stable/10/usr.sbin/inetd/inetd.c ============================================================================== --- stable/10/usr.sbin/inetd/inetd.c Sat Feb 4 15:51:45 2017 (r313205) +++ stable/10/usr.sbin/inetd/inetd.c Sat Feb 4 15:52:08 2017 (r313206) @@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef LIBWRAP #include +#endif #include #include "inetd.h" @@ -297,6 +299,7 @@ getvalue(const char *arg, int *value, co return 0; /* success */ } +#ifdef LIBWRAP static sa_family_t whichaf(struct request_info *req) { @@ -310,6 +313,7 @@ whichaf(struct request_info *req) return AF_INET; return sa->sa_family; } +#endif int main(int argc, char **argv) @@ -324,9 +328,11 @@ main(int argc, char **argv) #ifdef LOGIN_CAP login_cap_t *lc = NULL; #endif +#ifdef LIBWRAP struct request_info req; int denied; char *service = NULL; +#endif struct sockaddr_storage peer; int i; struct addrinfo hints, *res; @@ -736,6 +742,7 @@ main(int argc, char **argv) _exit(0); } } +#ifdef LIBWRAP if (ISWRAP(sep)) { inetd_setproctitle("wrapping", ctrl); service = sep->se_server_name ? @@ -764,6 +771,7 @@ main(int argc, char **argv) (whichaf(&req) == AF_INET6) ? "6" : ""); } } +#endif if (sep->se_bi) { (*sep->se_bi->bi_fn)(ctrl, sep); } else { From owner-svn-src-stable-10@freebsd.org Sat Feb 4 15:55:32 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88019CD0CBB; Sat, 4 Feb 2017 15:55:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57142196C; Sat, 4 Feb 2017 15:55:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14FtVb6053423; Sat, 4 Feb 2017 15:55:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14FtVH4053422; Sat, 4 Feb 2017 15:55:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041555.v14FtVH4053422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 15:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313209 - stable/10/usr.sbin/rpcbind 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.23 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, 04 Feb 2017 15:55:32 -0000 Author: ngie Date: Sat Feb 4 15:55:31 2017 New Revision: 313209 URL: https://svnweb.freebsd.org/changeset/base/313209 Log: MFC r311470: Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of always building support into rpcbind. Modified: stable/10/usr.sbin/rpcbind/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/Makefile ============================================================================== --- stable/10/usr.sbin/rpcbind/Makefile Sat Feb 4 15:53:34 2017 (r313208) +++ stable/10/usr.sbin/rpcbind/Makefile Sat Feb 4 15:55:31 2017 (r313209) @@ -8,19 +8,25 @@ MAN= rpcbind.8 SRCS= check_bound.c rpcb_stat.c rpcb_svc_4.c rpcbind.c pmap_svc.c \ rpcb_svc.c rpcb_svc_com.c security.c warmstart.c util.c -CFLAGS+= -DPORTMAP -DLIBWRAP +CFLAGS+= -DPORTMAP .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DLIBWRAP +DPADD+= ${LIBWRAP} +LDADD+= -lwrap +.endif + .if ${MK_TESTS} != "no" SUBDIR+= tests .endif -WARNS?= 1 +DPADD+= ${LIBUTIL} +LDADD+= -lutil -DPADD= ${LIBWRAP} ${LIBUTIL} -LDADD= -lwrap -lutil +WARNS?= 1 .include From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:00:52 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97252CD0E70; Sat, 4 Feb 2017 16:00:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1531E7D; Sat, 4 Feb 2017 16:00:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14G0pxO055549; Sat, 4 Feb 2017 16:00:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14G0pIW055547; Sat, 4 Feb 2017 16:00:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041600.v14G0pIW055547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:00: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: r313212 - in stable/10/usr.sbin/amd: amd 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.23 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, 04 Feb 2017 16:00:52 -0000 Author: ngie Date: Sat Feb 4 16:00:51 2017 New Revision: 313212 URL: https://svnweb.freebsd.org/changeset/base/313212 Log: MFC r311472: Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of always building support into amd(8). Modified: stable/10/usr.sbin/amd/amd/Makefile stable/10/usr.sbin/amd/include/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/amd/amd/Makefile ============================================================================== --- stable/10/usr.sbin/amd/amd/Makefile Sat Feb 4 16:00:19 2017 (r313211) +++ stable/10/usr.sbin/amd/amd/Makefile Sat Feb 4 16:00:51 2017 (r313212) @@ -30,8 +30,8 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/a -I${SRCTOP}/contrib/amd/include \ -I${.OBJDIR}/../../../include/rpcsvc -DPADD= ${LIBAMU} ${LIBWRAP} -LDADD= ${LIBAMU} -lwrap +DPADD= ${LIBAMU} +LDADD= ${LIBAMU} SRCS+= conf_parse.c conf_parse.h conf_tok.c SRCS+= sun_map_parse.c sun_map_parse.h sun_map_tok.c @@ -74,4 +74,10 @@ CFLAGS+= -DHAVE_MAP_HESIOD SRCS+= info_nis.c .endif +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DHAVE_LIBWRAP -DHAVE_TCPD_H +DPADD+= ${LIBWRAP} +LDADD+= -lwrap +.endif + .include Modified: stable/10/usr.sbin/amd/include/config.h ============================================================================== --- stable/10/usr.sbin/amd/include/config.h Sat Feb 4 16:00:19 2017 (r313211) +++ stable/10/usr.sbin/amd/include/config.h Sat Feb 4 16:00:51 2017 (r313212) @@ -530,7 +530,7 @@ /* #undef HAVE_LIBRT */ /* does libwrap exist? */ -#define HAVE_LIBWRAP 1 +/* #undef HAVE_LIBWRAP */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 @@ -1207,7 +1207,7 @@ #define HAVE_SYS_WAIT_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_TCPD_H 1 +/* #undef HAVE_TCPD_H */ /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:02:51 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D2EBCD001A; Sat, 4 Feb 2017 16:02:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDF2F27A; Sat, 4 Feb 2017 16:02:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14G2od3057881; Sat, 4 Feb 2017 16:02:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14G2ole057880; Sat, 4 Feb 2017 16:02:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041602.v14G2ole057880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313214 - stable/10/tests/sys/kern/acct 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.23 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, 04 Feb 2017 16:02:51 -0000 Author: ngie Date: Sat Feb 4 16:02:49 2017 New Revision: 313214 URL: https://svnweb.freebsd.org/changeset/base/313214 Log: MFC r312119,r312216,r312226: r312119: encode_long, encode_timeval: mechanically replace `exp` with `exponent` This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test, which include math.h, which in turn defines exp(3) Tested with: clang, gcc 4.2.1, gcc 4.9 r312216: Revert r312119 and reword the intent to fix -Wshadow issues between exp(3) and `exp` var. The approach taken previously was not ideal for multiple functional and stylistic reasons. Add to existing sed call in Makefile to replace `exp` with `exponent` instead. Requested by: bde r312226: Fix typo in r312216 I meant to replace "exp" with "exponent", not "expected" Pointyhat to: ngie Modified: stable/10/tests/sys/kern/acct/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/acct/Makefile ============================================================================== --- stable/10/tests/sys/kern/acct/Makefile Sat Feb 4 16:02:48 2017 (r313213) +++ stable/10/tests/sys/kern/acct/Makefile Sat Feb 4 16:02:49 2017 (r313214) @@ -13,6 +13,7 @@ acct_test.o: convert.c convert.c: ${.CURDIR:H:H:H:H}/sys/kern/kern_acct.c sed -n -e 's/log(/syslog(/g' \ + -e 's/exp/exponent/g' \ -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:09:08 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54876CD0132; Sat, 4 Feb 2017 16:09:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23BF47B5; Sat, 4 Feb 2017 16:09:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14G97kp058211; Sat, 4 Feb 2017 16:09:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14G97eC058210; Sat, 4 Feb 2017 16:09:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041609.v14G97eC058210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313215 - stable/10/lib/libnetbsd/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.23 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, 04 Feb 2017 16:09:08 -0000 Author: ngie Date: Sat Feb 4 16:09:07 2017 New Revision: 313215 URL: https://svnweb.freebsd.org/changeset/base/313215 Log: MFC r311972: Add __BIT and __BITS macros from NetBSD to help support new testcases Modified: stable/10/lib/libnetbsd/sys/cdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libnetbsd/sys/cdefs.h ============================================================================== --- stable/10/lib/libnetbsd/sys/cdefs.h Sat Feb 4 16:02:49 2017 (r313214) +++ stable/10/lib/libnetbsd/sys/cdefs.h Sat Feb 4 16:09:07 2017 (r313215) @@ -69,4 +69,13 @@ */ #define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) +/* __BIT(n): nth bit, where __BIT(0) == 0x1. */ +#define __BIT(__n) \ + (((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : \ + ((uintmax_t)1 << (uintmax_t)((__n) & (NBBY * sizeof(uintmax_t) - 1)))) + +/* __BITS(m, n): bits m through n, m < n. */ +#define __BITS(__m, __n) \ + ((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1)) + #endif /* _LIBNETBSD_SYS_CDEFS_H_ */ From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:15:27 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A22EECD0342; Sat, 4 Feb 2017 16:15:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7149CB9B; Sat, 4 Feb 2017 16:15:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14GFQph062012; Sat, 4 Feb 2017 16:15:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GFQHN062011; Sat, 4 Feb 2017 16:15:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041615.v14GFQHN062011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:15: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: r313216 - stable/10/tests/sys/mac/bsdextended 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.23 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, 04 Feb 2017 16:15:27 -0000 Author: ngie Date: Sat Feb 4 16:15:26 2017 New Revision: 313216 URL: https://svnweb.freebsd.org/changeset/base/313216 Log: MFC r312120: Fix warnings - Staticize test_num - Promote i to size_t to deal with -Wsign-compare issues Tested with: clang, gcc, gcc49 Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c ============================================================================== --- stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Sat Feb 4 16:09:07 2017 (r313215) +++ stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Sat Feb 4 16:15:26 2017 (r313216) @@ -71,7 +71,7 @@ static const char *test_groups[] = { "bin", }; -int test_num; +static int test_num; /* * List of test strings that must go in (and come out) of libugidfw intact. @@ -149,7 +149,8 @@ test_libugidfw_strings(void) struct mac_bsdextended_rule rule; char errorstr[256]; char rulestr[256]; - int error, i; + size_t i; + int error; for (i = 0; i < nitems(test_users); i++, test_num++) { if (getpwnam(test_users[i]) == NULL) @@ -171,7 +172,7 @@ test_libugidfw_strings(void) error = bsde_parse_rule_string(test_strings[i], &rule, sizeof(errorstr), errorstr); if (error == -1) - printf("not ok %d # bsde_parse_rule_string: '%s' (%d) " + printf("not ok %d # bsde_parse_rule_string: '%s' (%zu) " "failed: %s\n", test_num, test_strings[i], i, errorstr); else printf("ok %d\n", test_num); From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:16:43 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BAFACD03B9; Sat, 4 Feb 2017 16:16:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF46BCCA; Sat, 4 Feb 2017 16:16:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14GGfCN062115; Sat, 4 Feb 2017 16:16:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GGfQJ062114; Sat, 4 Feb 2017 16:16:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041616.v14GGfQJ062114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313217 - stable/10/tests/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Feb 2017 16:16:43 -0000 Author: ngie Date: Sat Feb 4 16:16:41 2017 New Revision: 313217 URL: https://svnweb.freebsd.org/changeset/base/313217 Log: MFC r312110: Fix -Wsign-compare warnings The loop index (i) doesn't need to be size_t as its comparison is signed Modified: stable/10/tests/sys/vm/mmap_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/vm/mmap_test.c ============================================================================== --- stable/10/tests/sys/vm/mmap_test.c Sat Feb 4 16:15:26 2017 (r313216) +++ stable/10/tests/sys/vm/mmap_test.c Sat Feb 4 16:16:41 2017 (r313217) @@ -192,8 +192,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_priva ATF_TC_BODY(mmap__dev_zero_private, tc) { char *p1, *p2, *p3; - size_t i; - int fd, pagesize; + int fd, i, pagesize; ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0); @@ -205,7 +204,7 @@ ATF_TC_BODY(mmap__dev_zero_private, tc) ATF_REQUIRE(p2 != MAP_FAILED); for (i = 0; i < pagesize; i++) - ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); + ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]); ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); @@ -232,8 +231,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_share ATF_TC_BODY(mmap__dev_zero_shared, tc) { char *p1, *p2, *p3; - size_t i; - int fd, pagesize; + int fd, i, pagesize; ATF_REQUIRE((pagesize = getpagesize()) > 0); ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0); @@ -245,7 +243,7 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) ATF_REQUIRE(p2 != MAP_FAILED); for (i = 0; i < pagesize; i++) - ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]); + ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]); ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0); From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:29:24 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6667ECD0696; Sat, 4 Feb 2017 16:29:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 331BC12C2; Sat, 4 Feb 2017 16:29:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14GTNsU066411; Sat, 4 Feb 2017 16:29:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GTNIB066410; Sat, 4 Feb 2017 16:29:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041629.v14GTNIB066410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:29: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: r313218 - stable/10/tests/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.23 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, 04 Feb 2017 16:29:24 -0000 Author: ngie Date: Sat Feb 4 16:29:23 2017 New Revision: 313218 URL: https://svnweb.freebsd.org/changeset/base/313218 Log: MFC r312114,r312194: r312114: Enable WARNS?= 6 across all of tests/sys r312194: Add include Makefiles for tests/sys/{fs,kern,kqueue,mac}/... The primary goal for doing this is to leverage the work done in r312114 for enabling WARNS to address trivial code quality issues with new tests Tested with: make tinderbox Added: stable/10/tests/sys/Makefile.inc - copied unchanged from r312114, head/tests/sys/Makefile.inc Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/tests/sys/Makefile.inc (from r312114, head/tests/sys/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tests/sys/Makefile.inc Sat Feb 4 16:29:23 2017 (r313218, copy of r312114, head/tests/sys/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +WARNS?= 6 From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:31:25 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE5AACD0733; Sat, 4 Feb 2017 16:31:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95EFA14E6; Sat, 4 Feb 2017 16:31:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14GVO7x069699; Sat, 4 Feb 2017 16:31:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GVO5e069698; Sat, 4 Feb 2017 16:31:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041631.v14GVO5e069698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313219 - stable/10/tests/sys/mac/bsdextended 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.23 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, 04 Feb 2017 16:31:25 -0000 Author: ngie Date: Sat Feb 4 16:31:24 2017 New Revision: 313219 URL: https://svnweb.freebsd.org/changeset/base/313219 Log: MFC r312164: Fix -Wformat issue Use %zu for printing out results from nitems, as it's size_t based Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c ============================================================================== --- stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Sat Feb 4 16:29:23 2017 (r313218) +++ stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Sat Feb 4 16:31:24 2017 (r313219) @@ -222,7 +222,7 @@ main(void) return (0); } - printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + printf("1..%zu\n", nitems(test_users) + nitems(test_groups) + 3 * nitems(test_strings) + 2); test_libugidfw_strings(); From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:34:45 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B88BCD08C5; Sat, 4 Feb 2017 16:34:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5537D1862; Sat, 4 Feb 2017 16:34:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14GYi94070635; Sat, 4 Feb 2017 16:34:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GYioI070634; Sat, 4 Feb 2017 16:34:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041634.v14GYioI070634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313220 - stable/10/usr.sbin/ypserv 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.23 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, 04 Feb 2017 16:34:45 -0000 Author: ngie Date: Sat Feb 4 16:34:44 2017 New Revision: 313220 URL: https://svnweb.freebsd.org/changeset/base/313220 Log: MFC r311469: Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of always building support into ypserv. Modified: stable/10/usr.sbin/ypserv/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ypserv/Makefile ============================================================================== --- stable/10/usr.sbin/ypserv/Makefile Sat Feb 4 16:31:24 2017 (r313219) +++ stable/10/usr.sbin/ypserv/Makefile Sat Feb 4 16:34:44 2017 (r313220) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + RPCDIR= ${.CURDIR}/../../include/rpcsvc .PATH: ${RPCDIR} @@ -8,12 +10,15 @@ MAN= ypserv.8 ypinit.8 SRCS= yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \ ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c -CFLAGS+= -DDB_CACHE -DTCP_WRAPPER -I. +CFLAGS+= -DDB_CACHE -I. WARNS?= 0 -DPADD= ${LIBWRAP} -LDADD= -lwrap +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DTCP_WRAPPER +DPADD+= ${LIBWRAP} +LDADD+= -lwrap +.endif CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:36:08 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E935CD094B; Sat, 4 Feb 2017 16:36:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B43B19D7; Sat, 4 Feb 2017 16:36:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14Ga7KG070758; Sat, 4 Feb 2017 16:36:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14Ga7K2070757; Sat, 4 Feb 2017 16:36:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041636.v14Ga7K2070757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313221 - stable/10/lib/libc/regex/grot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Feb 2017 16:36:08 -0000 Author: ngie Date: Sat Feb 4 16:36:07 2017 New Revision: 313221 URL: https://svnweb.freebsd.org/changeset/base/313221 Log: MFC r312332: Use SRCTOP where possible and use :H to manipulate .CURDIR to get rid of unnecessarily long relative path .PATH values with make Modified: stable/10/lib/libc/regex/grot/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/Makefile ============================================================================== --- stable/10/lib/libc/regex/grot/Makefile Sat Feb 4 16:34:44 2017 (r313220) +++ stable/10/lib/libc/regex/grot/Makefile Sat Feb 4 16:36:07 2017 (r313221) @@ -5,7 +5,7 @@ # Do not take -DPOSIX_MISTAKE out. REGCFLAGS isn't important to you (it's # for my use in some special contexts). -PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include +PATHS= ${.CURDIR:H} ${.CURDIR:H:H}/locale ${SRCTOP}/include .PATH: ${PATHS} CFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:37:45 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 231CDCD09D6; Sat, 4 Feb 2017 16:37:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF7671B38; Sat, 4 Feb 2017 16:37:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14Gbix3070885; Sat, 4 Feb 2017 16:37:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GbirE070884; Sat, 4 Feb 2017 16:37:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041637.v14GbirE070884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313222 - stable/10/contrib/bsnmp/snmp_usm 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.23 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, 04 Feb 2017 16:37:45 -0000 Author: ngie Date: Sat Feb 4 16:37:43 2017 New Revision: 313222 URL: https://svnweb.freebsd.org/changeset/base/313222 Log: MFC r311394: op_usm_users: don't deref uusers if it's NULL when SETting the value Add an XXX comment to note that the conditional seems suspect given how it's handled elsewhere in the SNMP_OP_SET case. CID: 1008573 Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Sat Feb 4 16:36:07 2017 (r313221) +++ stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Sat Feb 4 16:37:43 2017 (r313222) @@ -169,8 +169,12 @@ op_usm_users(struct snmp_context *ctx, s val->var.subs[sub - 1] != LEAF_usmUserCloneFrom) return (SNMP_ERR_NOSUCHNAME); + /* + * XXX (ngie): need to investigate the MIB to determine how + * this is possible given some of the transitions below. + */ if (community != COMM_INITIALIZE && - uuser->type == StorageType_readOnly) + uuser != NULL && uuser->type == StorageType_readOnly) return (SNMP_ERR_NOT_WRITEABLE); switch (val->var.subs[sub - 1]) { From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:40:30 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 966A4CD0B43; Sat, 4 Feb 2017 16:40:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7125F1D12; Sat, 4 Feb 2017 16:40:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14GeT7I071094; Sat, 4 Feb 2017 16:40:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GeTYU071089; Sat, 4 Feb 2017 16:40:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041640.v14GeTYU071089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:40: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: r313223 - in stable/10: share/mk usr.sbin/bsnmpd/modules usr.sbin/bsnmpd/modules/snmp_hostres usr.sbin/bsnmpd/modules/snmp_mibII 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.23 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, 04 Feb 2017 16:40:30 -0000 Author: ngie Date: Sat Feb 4 16:40:28 2017 New Revision: 313223 URL: https://svnweb.freebsd.org/changeset/base/313223 Log: MFC r311744,r312328,r312329,r312330: r311744: Document bsd.snmpmod.mk from a high-level r312328: Add a make target (smilint) for running smilint tool against BMIBS Running smilint against MIB definitions is useful in finding functional problems with MIB definitions/descriptions. This is inspired by the smilint targets defined in usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile Document all of the variables that are involved in running the smilint target, as well as all of the prerequisites to running it. r312329: Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328 r312330: Add smilint target to subdir targets so "make smilint" here will run the smilint target in subdirs While here, convert a path that's .CURDIR relative to SRCTOP Modified: stable/10/share/mk/bsd.README stable/10/share/mk/bsd.snmpmod.mk stable/10/usr.sbin/bsnmpd/modules/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.README ============================================================================== --- stable/10/share/mk/bsd.README Sat Feb 4 16:37:43 2017 (r313222) +++ stable/10/share/mk/bsd.README Sat Feb 4 16:40:28 2017 (r313223) @@ -350,6 +350,82 @@ If foo has multiple source files, add th =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +The include file, , handles building MIB modules for bsnmpd +from one or more source files, along with their manual pages. It has a +limited number of suffixes, consistent with the current needs of the BSD +tree. + +bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and +bsd.files.mk for installing MIB description and definition files. + +It implements the following additional targets: + + smilint: + execute smilint on the MIBs defined by BMIBS. + + The net-mgmt/libsmi package must be installed before + executing this target. The net-mgmt/net-snmp package + should be installed as well to reduce false positives + from smilint. + +It sets/uses the following variables: + +BMIBS The MIB definitions to install. + +BMIBSDIR The directory where the MIB definitions are installed. + This defaults to `${SHAREDIR}/snmp/mibs`. + +DEFS The MIB description files to install. + +DEFSDIR The directory where MIB description files are installed. + This defaults to `${SHAREDIR}/snmp/defs`. + +EXTRAMIBDEFS Extra MIB description files to use as input when + generating ${MOD}_oid.h and ${MOD}_tree.[ch]. + +EXTRAMIBSYMS Extra MIB definition files used only for extracting + symbols. + + EXTRAMIBSYMS are useful when resolving inter-module + dependencies and are useful with files containing only + enum-definitions. + + See ${MOD}_oid.h for more details. + +LOCALBASE The package root where smilint and the net-snmp + definitions can be found + +MOD The bsnmpd module name. + +SMILINT smilint binary to use with the smilint make target. + +SMILINT_FLAGS flags to pass to smilint. + +SMIPATH A colon-separated directory path where MIBs definitions + can be found. See "SMIPATH" in smi_config for more + details. + +XSYM MIB names to extract symbols for. See ${MOD}_oid.h for + more details. + +It generates the following files: + +${MOD}_tree.c A source file and header which programmatically describes +${MOD}_tree.h the MIB (type, OID name, ACCESS attributes, etc). + + The files are generated via "gensnmptree -p". + + See gensnmptree(1) for more details. + +${MOD}_oid.h A header which programmatically describes the MIB root and + MIB tables. + + The files are generated via "gensnmptree -e". + + See gensnmptree(1) for more details. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + The include file contains the default targets for building subdirectories. It has the same seven targets as : all, clean, cleandir, depend, install, lint, and tags. For all of the directories Modified: stable/10/share/mk/bsd.snmpmod.mk ============================================================================== --- stable/10/share/mk/bsd.snmpmod.mk Sat Feb 4 16:37:43 2017 (r313222) +++ stable/10/share/mk/bsd.snmpmod.mk Sat Feb 4 16:40:28 2017 (r313223) @@ -24,4 +24,18 @@ FILESGROUPS+= BMIBS BMIBSDIR= ${SHAREDIR}/snmp/mibs .endif +.if !target(smilint) && !empty(BMIBS) +LOCALBASE?= /usr/local + +SMILINT?= ${LOCALBASE}/bin/smilint + +SMIPATH?= ${BMIBSDIR}:${LOCALBASE}/share/snmp/mibs + +SMILINT_FLAGS?= -c /dev/null -l6 -i group-membership + +smilint: ${BMIBS} + SMIPATH=${SMIPATH} ${SMILINT} ${SMILINT_FLAGS} ${.ALLSRC} +.endif +smilint: .PHONY + .include Modified: stable/10/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/Makefile Sat Feb 4 16:37:43 2017 (r313222) +++ stable/10/usr.sbin/bsnmpd/modules/Makefile Sat Feb 4 16:40:28 2017 (r313223) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../../contrib/bsnmp/snmpd +.PATH: ${SRCTOP}/contrib/bsnmp/snmpd .if ${MK_ATM} != "no" _snmp_atm= snmp_atm @@ -35,4 +35,6 @@ SUBDIR+=snmp_wlan INCS= snmpmod.h INCSDIR= ${INCLUDEDIR}/bsnmp +SUBDIR_TARGETS+= smilint + .include Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Sat Feb 4 16:37:43 2017 (r313222) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Sat Feb 4 16:40:28 2017 (r313223) @@ -76,8 +76,3 @@ LDADD= -lkvm -ldevinfo -lm -lgeom -lmems printcap.So: printcap.c ${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET} - -smilint: .PHONY -smilint: ${BMIBS} - env SMIPATH=.:/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Sat Feb 4 16:37:43 2017 (r313222) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Sat Feb 4 16:40:28 2017 (r313223) @@ -21,8 +21,3 @@ INCS= snmp_${MOD}.h BMIBS= BEGEMOT-IP-MIB.txt BEGEMOT-MIB2-MIB.txt .include - -smilint: .PHONY -smilint: ${BMIBS} - env SMIPATH=/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:43:37 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05F3DCD0D92; Sat, 4 Feb 2017 16:43:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C966512B; Sat, 4 Feb 2017 16:43:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14GhZ2o074736; Sat, 4 Feb 2017 16:43:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GhZiB074735; Sat, 4 Feb 2017 16:43:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041643.v14GhZiB074735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313224 - stable/10/etc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 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, 04 Feb 2017 16:43:37 -0000 Author: ngie Date: Sat Feb 4 16:43:35 2017 New Revision: 313224 URL: https://svnweb.freebsd.org/changeset/base/313224 Log: MFC r310467: Provide some guidance when dealing with sections and variables contained within them For example, using variables designated for %usm requires uncommenting %usm section header Modified: stable/10/etc/snmpd.config Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/snmpd.config ============================================================================== --- stable/10/etc/snmpd.config Sat Feb 4 16:40:28 2017 (r313223) +++ stable/10/etc/snmpd.config Sat Feb 4 16:43:35 2017 (r313224) @@ -116,6 +116,14 @@ snmpEnableAuthenTraps = 2 # modules # +# Control configuration for the modules in the module specific sections, e.g. +# the "usm" module (begemotSnmpdModulePath."usm") can be controlled in the +# %usm specific section. You must uncomment the section specific header in +# order to use the enclosed variables, e.g. `usmUserStatus.$(engine).$(user1)` +# can only be used if %usm is uncommented. +# + +# # Bridge module # This requires the mibII module. # From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:45:45 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE078CD0E12; Sat, 4 Feb 2017 16:45:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA45F2DD; Sat, 4 Feb 2017 16:45:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14Gjiua074888; Sat, 4 Feb 2017 16:45:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GjidQ074887; Sat, 4 Feb 2017 16:45:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041645.v14GjidQ074887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313225 - stable/10/usr.sbin/sendmail 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.23 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, 04 Feb 2017 16:45:46 -0000 Author: ngie Date: Sat Feb 4 16:45:44 2017 New Revision: 313225 URL: https://svnweb.freebsd.org/changeset/base/313225 Log: MFC r311471: Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of always building support into sendmail. Modified: stable/10/usr.sbin/sendmail/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/sendmail/Makefile ============================================================================== --- stable/10/usr.sbin/sendmail/Makefile Sat Feb 4 16:43:35 2017 (r313224) +++ stable/10/usr.sbin/sendmail/Makefile Sat Feb 4 16:45:44 2017 (r313225) @@ -37,7 +37,7 @@ NIS= -DNIS MAPS= -DMAP_REGEX -DDNSMAP CFLAGS+= -I${SMDIR} -I${SENDMAIL_DIR}/include -I. -CFLAGS+= ${DBMDEF} ${NIS} -DTCPWRAPPERS ${MAPS} +CFLAGS+= ${DBMDEF} ${NIS} ${MAPS} .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DNETINET6 -DIPV6_FULL=0 @@ -45,8 +45,8 @@ CFLAGS+= -DNETINET6 -DIPV6_FULL=0 WARNS?= 0 -DPADD= ${LIBUTIL} ${LIBWRAP} -LDADD= -lutil -lwrap +DPADD= ${LIBUTIL} +LDADD= -lutil LIBSMDIR= ${.OBJDIR}/../../lib/libsm LIBSM= ${LIBSMDIR}/libsm.a @@ -67,6 +67,12 @@ DPADD+= ${LIBSSL} ${LIBCRYPTO} LDADD+= -lssl -lcrypto .endif +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DTCPWRAPPERS +DPADD+= ${LIBWRAP} +LDADD+= -lwrap +.endif + # User customizations to the sendmail build environment CFLAGS+=${SENDMAIL_CFLAGS} DPADD+=${SENDMAIL_DPADD} From owner-svn-src-stable-10@freebsd.org Sat Feb 4 16:47:36 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AEBFCD0F47; Sat, 4 Feb 2017 16:47:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F1CE75F; Sat, 4 Feb 2017 16:47:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14GlZFw075006; Sat, 4 Feb 2017 16:47:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14GlZ8A075004; Sat, 4 Feb 2017 16:47:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041647.v14GlZ8A075004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 16:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313226 - stable/10/libexec/tftpd 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.23 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, 04 Feb 2017 16:47:36 -0000 Author: ngie Date: Sat Feb 4 16:47:35 2017 New Revision: 313226 URL: https://svnweb.freebsd.org/changeset/base/313226 Log: MFC r311473: Conditionalize all code that uses tcpd.h behind `LIBWRAP` guard This will allow the code to stand by itself without libwrap Modified: stable/10/libexec/tftpd/Makefile stable/10/libexec/tftpd/tftpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/tftpd/Makefile ============================================================================== --- stable/10/libexec/tftpd/Makefile Sat Feb 4 16:45:44 2017 (r313225) +++ stable/10/libexec/tftpd/Makefile Sat Feb 4 16:47:35 2017 (r313226) @@ -1,13 +1,18 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ +.include + PROG= tftpd MAN= tftpd.8 SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c SRCS+= tftpd.c WFORMAT=0 -DPADD= ${LIBWRAP} -LDADD= -lwrap +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DLIBWRAP +DPADD+= ${LIBWRAP} +LDADD+= -lwrap +.endif .include Modified: stable/10/libexec/tftpd/tftpd.c ============================================================================== --- stable/10/libexec/tftpd/tftpd.c Sat Feb 4 16:45:44 2017 (r313225) +++ stable/10/libexec/tftpd/tftpd.c Sat Feb 4 16:47:35 2017 (r313226) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "tftp-file.h" @@ -75,6 +74,10 @@ __FBSDID("$FreeBSD$"); #include "tftp-transfer.h" #include "tftp-options.h" +#ifdef LIBWRAP +#include +#endif + static void tftp_wrq(int peer, char *, ssize_t); static void tftp_rrq(int peer, char *, ssize_t); @@ -281,6 +284,7 @@ main(int argc, char *argv[]) } } +#ifdef LIBWRAP /* * See if the client is allowed to talk to me. * (This needs to be done before the chroot()) @@ -329,6 +333,7 @@ main(int argc, char *argv[]) "Full access allowed" "in /etc/hosts.allow"); } +#endif /* * Since we exit here, we should do that only after the above From owner-svn-src-stable-10@freebsd.org Sat Feb 4 17:00:49 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C819CD07AC; Sat, 4 Feb 2017 17:00:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 123B71598; Sat, 4 Feb 2017 17:00:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14H0m4E079623; Sat, 4 Feb 2017 17:00:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14H0m1B079621; Sat, 4 Feb 2017 17:00:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041700.v14H0m1B079621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 17:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313234 - in stable/10: crypto/openssh secure/usr.sbin/sshd 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.23 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, 04 Feb 2017 17:00:49 -0000 Author: ngie Date: Sat Feb 4 17:00:47 2017 New Revision: 313234 URL: https://svnweb.freebsd.org/changeset/base/313234 Log: MFC r311585: Conditionalize building libwrap support into sshd Only build libwrap support into sshd if MK_TCP_WRAPPERS != no This will unbreak the build if libwrap has been removed from the system PR: 210141 Modified: stable/10/crypto/openssh/config.h stable/10/secure/usr.sbin/sshd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/openssh/config.h ============================================================================== --- stable/10/crypto/openssh/config.h Sat Feb 4 16:58:06 2017 (r313233) +++ stable/10/crypto/openssh/config.h Sat Feb 4 17:00:47 2017 (r313234) @@ -1408,7 +1408,7 @@ /* #undef LASTLOG_WRITE_PUTUTXLINE */ /* Define if you want TCP Wrappers support */ -#define LIBWRAP 1 +/* #undef LIBWRAP */ /* Define to whatever link() returns for "not supported" if it doesn't return EOPNOTSUPP. */ Modified: stable/10/secure/usr.sbin/sshd/Makefile ============================================================================== --- stable/10/secure/usr.sbin/sshd/Makefile Sat Feb 4 16:58:06 2017 (r313233) +++ stable/10/secure/usr.sbin/sshd/Makefile Sat Feb 4 17:00:47 2017 (r313234) @@ -25,8 +25,8 @@ MAN= sshd.8 sshd_config.5 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h SRCS+= ssh_namespace.h -DPADD= ${LIBSSH} ${LIBUTIL} ${LIBWRAP} ${LIBPAM} -LDADD= -lssh -lutil -lwrap ${MINUSLPAM} +DPADD= ${LIBSSH} ${LIBUTIL} ${LIBPAM} +LDADD= -lssh -lutil ${MINUSLPAM} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" @@ -51,6 +51,12 @@ LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 - -lcom_err -lroken -lwind -lheimbase -lheimipcc .endif +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DLIBWRAP +DPADD+= ${LIBWRAP} +LDADD+= -lwrap +.endif + DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} LDADD+= -lcrypt -lcrypto -lz