From owner-svn-src-stable@FreeBSD.ORG Sun May 24 00:53:45 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61B095AE; Sun, 24 May 2015 00:53:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9C8139E; Sun, 24 May 2015 00:53:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4O0rjDa013443; Sun, 24 May 2015 00:53:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4O0rhpe013434; Sun, 24 May 2015 00:53:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505240053.t4O0rhpe013434@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 00:53: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: r283341 - in stable/10/sys: dev/usb/serial kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 00:53:45 -0000 Author: ian Date: Sun May 24 00:53:43 2015 New Revision: 283341 URL: https://svnweb.freebsd.org/changeset/base/283341 Log: MFC r279728, r279729, r279756, r279773, r282424, r281367: Add mutex support to the pps_ioctl() API in the kernel. Add PPS support to USB serial drivers. Use correct mode variable for PPS support. Switch polarity of USB serial PPS events. The ftdi "get latency" and "get bitmode" device commands are read operations, not writes. Implement a mechanism for making changes in the kernel<->driver PPS interface without breaking ABI or API compatibility with existing drivers. Bump version number to indicate the new PPS ABI version changes in the pps_state structure. Modified: stable/10/sys/dev/usb/serial/uftdi.c stable/10/sys/dev/usb/serial/usb_serial.c stable/10/sys/dev/usb/serial/usb_serial.h stable/10/sys/kern/kern_tc.c stable/10/sys/sys/param.h stable/10/sys/sys/timepps.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Sat May 23 23:35:19 2015 (r283340) +++ stable/10/sys/dev/usb/serial/uftdi.c Sun May 24 00:53:43 2015 (r283341) @@ -1703,7 +1703,7 @@ uftdi_get_bitmode(struct ucom_softc *uco struct uftdi_softc *sc = ucom->sc_parent; usb_device_request_t req; - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = FTDI_SIO_GET_BITMODE; USETW(req.wIndex, sc->sc_ucom.sc_portno); @@ -1740,7 +1740,7 @@ uftdi_get_latency(struct ucom_softc *uco usb_error_t err; uint8_t buf; - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = FTDI_SIO_GET_LATENCY; USETW(req.wIndex, sc->sc_ucom.sc_portno); Modified: stable/10/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/10/sys/dev/usb/serial/usb_serial.c Sat May 23 23:35:19 2015 (r283340) +++ stable/10/sys/dev/usb/serial/usb_serial.c Sun May 24 00:53:43 2015 (r283341) @@ -96,6 +96,11 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom"); +static int ucom_pps_mode; + +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, pps_mode, CTLFLAG_RWTUN, + &ucom_pps_mode, 0, "pulse capturing mode - 0/1/2 - disabled/CTS/DCD"); + #ifdef USB_DEBUG static int ucom_debug = 0; @@ -412,6 +417,11 @@ ucom_attach_tty(struct ucom_super_softc sc->sc_tty = tp; + sc->sc_pps.ppscap = PPS_CAPTUREBOTH; + sc->sc_pps.driver_abi = PPS_ABI_VERSION; + sc->sc_pps.driver_mtx = sc->sc_mtx; + pps_init_abi(&sc->sc_pps); + DPRINTF("ttycreate: %s\n", buf); /* Check if this device should be a console */ @@ -861,6 +871,8 @@ ucom_ioctl(struct tty *tp, u_long cmd, c } else { error = ENOIOCTL; } + if (error == ENOIOCTL) + error = pps_ioctl(cmd, data, &sc->sc_pps); break; } return (error); @@ -1064,7 +1076,7 @@ ucom_cfg_status_change(struct usb_proc_m struct tty *tp; uint8_t new_msr; uint8_t new_lsr; - uint8_t onoff; + uint8_t msr_delta; uint8_t lsr_delta; tp = sc->sc_tty; @@ -1088,15 +1100,42 @@ ucom_cfg_status_change(struct usb_proc_m /* TTY device closed */ return; } - onoff = ((sc->sc_msr ^ new_msr) & SER_DCD); + msr_delta = (sc->sc_msr ^ new_msr); lsr_delta = (sc->sc_lsr ^ new_lsr); sc->sc_msr = new_msr; sc->sc_lsr = new_lsr; - if (onoff) { + /* + * Time pulse counting support. Note that both CTS and DCD are + * active-low signals. The status bit is high to indicate that + * the signal on the line is low, which corresponds to a PPS + * clear event. + */ + switch(ucom_pps_mode) { + case 1: + if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) && + (msr_delta & SER_CTS)) { + pps_capture(&sc->sc_pps); + pps_event(&sc->sc_pps, (sc->sc_msr & SER_CTS) ? + PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); + } + break; + case 2: + if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) && + (msr_delta & SER_DCD)) { + pps_capture(&sc->sc_pps); + pps_event(&sc->sc_pps, (sc->sc_msr & SER_DCD) ? + PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); + } + break; + default: + break; + } + + if (msr_delta & SER_DCD) { - onoff = (sc->sc_msr & SER_DCD) ? 1 : 0; + int onoff = (sc->sc_msr & SER_DCD) ? 1 : 0; DPRINTF("DCD changed to %d\n", onoff); Modified: stable/10/sys/dev/usb/serial/usb_serial.h ============================================================================== --- stable/10/sys/dev/usb/serial/usb_serial.h Sat May 23 23:35:19 2015 (r283340) +++ stable/10/sys/dev/usb/serial/usb_serial.h Sun May 24 00:53:43 2015 (r283341) @@ -64,6 +64,7 @@ #include #include #include +#include /* Module interface related macros */ #define UCOM_MODVER 1 @@ -155,6 +156,8 @@ struct ucom_softc { struct ucom_cfg_task sc_line_state_task[2]; struct ucom_cfg_task sc_status_task[2]; struct ucom_param_task sc_param_task[2]; + /* pulse capturing support, PPS */ + struct pps_state sc_pps; /* Used to set "UCOM_FLAG_GP_DATA" flag: */ struct usb_proc_msg *sc_last_start_xfer; const struct ucom_callback *sc_callback; Modified: stable/10/sys/kern/kern_tc.c ============================================================================== --- stable/10/sys/kern/kern_tc.c Sat May 23 23:35:19 2015 (r283340) +++ stable/10/sys/kern/kern_tc.c Sun May 24 00:53:43 2015 (r283341) @@ -23,10 +23,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef FFCLOCK #include #include -#endif #include #include #include @@ -1462,6 +1460,17 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, * RFC 2783 PPS-API implementation. */ +/* + * Return true if the driver is aware of the abi version extensions in the + * pps_state structure, and it supports at least the given abi version number. + */ +static inline int +abi_aware(struct pps_state *pps, int vers) +{ + + return ((pps->kcmode & KCMODE_ABIFLAG) && pps->driver_abi >= vers); +} + static int pps_fetch(struct pps_fetch_args *fapi, struct pps_state *pps) { @@ -1491,7 +1500,17 @@ pps_fetch(struct pps_fetch_args *fapi, s cseq = pps->ppsinfo.clear_sequence; while (aseq == pps->ppsinfo.assert_sequence && cseq == pps->ppsinfo.clear_sequence) { - err = tsleep(pps, PCATCH, "ppsfch", timo); + if (abi_aware(pps, 1) && pps->driver_mtx != NULL) { + if (pps->flags & PPSFLAG_MTX_SPIN) { + err = msleep_spin(pps, pps->driver_mtx, + "ppsfch", timo); + } else { + err = msleep(pps, pps->driver_mtx, PCATCH, + "ppsfch", timo); + } + } else { + err = tsleep(pps, PCATCH, "ppsfch", timo); + } if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { continue; } else if (err != 0) { @@ -1581,7 +1600,8 @@ pps_ioctl(u_long cmd, caddr_t data, stru return (EINVAL); if (kapi->edge & ~pps->ppscap) return (EINVAL); - pps->kcmode = kapi->edge; + pps->kcmode = (kapi->edge & KCMODE_EDGEMASK) | + (pps->kcmode & KCMODE_ABIFLAG); return (0); #else return (EOPNOTSUPP); @@ -1602,6 +1622,18 @@ pps_init(struct pps_state *pps) #ifdef FFCLOCK pps->ppscap |= PPS_TSCLK_MASK; #endif + pps->kcmode &= ~KCMODE_ABIFLAG; +} + +void +pps_init_abi(struct pps_state *pps) +{ + + pps_init(pps); + if (pps->driver_abi > 0) { + pps->kcmode |= KCMODE_ABIFLAG; + pps->kernel_abi = PPS_ABI_VERSION; + } } void Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Sat May 23 23:35:19 2015 (r283340) +++ stable/10/sys/sys/param.h Sun May 24 00:53:43 2015 (r283341) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1001515 /* Master, propagated to newvers */ +#define __FreeBSD_version 1001516 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: stable/10/sys/sys/timepps.h ============================================================================== --- stable/10/sys/sys/timepps.h Sat May 23 23:35:19 2015 (r283340) +++ stable/10/sys/sys/timepps.h Sun May 24 00:53:43 2015 (r283341) @@ -133,6 +133,15 @@ struct pps_kcbind_args { #ifdef _KERNEL +struct mtx; + +#define KCMODE_EDGEMASK 0x03 +#define KCMODE_ABIFLAG 0x80000000 /* Internal use: abi-aware driver. */ + +#define PPS_ABI_VERSION 1 + +#define PPSFLAG_MTX_SPIN 0x01 /* Driver mtx is MTX_SPIN type. */ + struct pps_state { /* Capture information. */ struct timehands *capth; @@ -148,11 +157,19 @@ struct pps_state { int ppscap; struct timecounter *ppstc; unsigned ppscount[3]; + /* + * The following fields are valid if the driver calls pps_init_abi(). + */ + uint16_t driver_abi; /* Driver sets before pps_init_abi(). */ + uint16_t kernel_abi; /* Kernel sets during pps_init_abi(). */ + struct mtx *driver_mtx; /* Optional, valid if non-NULL. */ + uint32_t flags; }; void pps_capture(struct pps_state *pps); void pps_event(struct pps_state *pps, int event); void pps_init(struct pps_state *pps); +void pps_init_abi(struct pps_state *pps); int pps_ioctl(unsigned long cmd, caddr_t data, struct pps_state *pps); void hardpps(struct timespec *tsp, long nsec); From owner-svn-src-stable@FreeBSD.ORG Sun May 24 01:09:52 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FCE1782; Sun, 24 May 2015 01:09:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E08114E5; Sun, 24 May 2015 01:09:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4O19q4M019197; Sun, 24 May 2015 01:09:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4O19qET019196; Sun, 24 May 2015 01:09:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505240109.t4O19qET019196@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 01:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283342 - stable/10/share/man/man4 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 01:09:52 -0000 Author: ian Date: Sun May 24 01:09:51 2015 New Revision: 283342 URL: https://svnweb.freebsd.org/changeset/base/283342 Log: MFC r280221: Update ucom(4) with information about the new PPS capture abilities. Modified: stable/10/share/man/man4/ucom.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ucom.4 ============================================================================== --- stable/10/share/man/man4/ucom.4 Sun May 24 00:53:43 2015 (r283341) +++ stable/10/share/man/man4/ucom.4 Sun May 24 01:09:51 2015 (r283342) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2008 +.Dd March 11, 2015 .Dt UCOM 4 .Os .Sh NAME @@ -63,11 +63,34 @@ This means that normal programs such as or .Xr ppp 8 can be used to access the device. +.Sh Pulse Per Second (PPS) Timing Interface +The +.Nm +driver can capture PPS timing information as defined in RFC 2783. +The API, accessed via +.Xr ioctl 8 , +is available on the tty device. +To use the PPS capture feature with +.Xr ntpd 8 , +symlink the tty device to +.Va /dev/pps0. .Pp The -.Va portno -locater can be used to decide which port to use for devices that have -multiple external ports. +.Va hw.usb.ucom.pps_mode +sysctl configures the PPS capture mode. +It can be set in +.Xr loader.conf 5 +or +.Xr sysctl.conf 5 . +The following capture modes are available: +.Bl -tag -compact -offset "mmmm" -width "mmmm" +.It 0 +Capture disabled (default). +.It 1 +Capture pulses on the CTS line. +.It 2 +Capture pulses on the DCD line. +.El .Sh FILES .Bl -tag -width ".Pa /dev/cuaU?" .It Pa /dev/cuaU? From owner-svn-src-stable@FreeBSD.ORG Sun May 24 01:48:34 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50B97C85; Sun, 24 May 2015 01:48:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 321FE1897; Sun, 24 May 2015 01:48:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4O1mYFS038527; Sun, 24 May 2015 01:48:34 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4O1mYVM038526; Sun, 24 May 2015 01:48:34 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201505240148.t4O1mYVM038526@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 24 May 2015 01:48: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: r283343 - stable/10/sys/dev/netmap 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 01:48:34 -0000 Author: pkelsey Date: Sun May 24 01:48:33 2015 New Revision: 283343 URL: https://svnweb.freebsd.org/changeset/base/283343 Log: MFC r282978: When a netmap process terminates without the full set of buffers it was granted via rings and ni_bufs_list_head represented in those rings and lists (e.g., via SIGKILL), those buffers are no longer available for subsequent users for the lifetime of the system. To mitigate this resource leak, reset the allocator state when the last ref to that allocator is released. Note that this only recovers leaked resources for an allocator when there are no longer any users of that allocator, so there remain circumstances in which leaked allocator resources may not ever be recovered - consider a set of multiple netmap processes that are all using the same allocator (say, the global allocator) where members of that set may be killed and restarted over time but at any given point there is one member of that set running. Modified: stable/10/sys/dev/netmap/netmap_mem2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_mem2.c Sun May 24 01:09:51 2015 (r283342) +++ stable/10/sys/dev/netmap/netmap_mem2.c Sun May 24 01:48:33 2015 (r283343) @@ -130,9 +130,9 @@ struct netmap_mem_d { /* the three allocators */ struct netmap_obj_pool pools[NETMAP_POOLS_NR]; - netmap_mem_config_t config; - netmap_mem_finalize_t finalize; - netmap_mem_deref_t deref; + netmap_mem_config_t config; /* called with NMA_LOCK held */ + netmap_mem_finalize_t finalize; /* called with NMA_LOCK held */ + netmap_mem_deref_t deref; /* called with NMA_LOCK held */ nm_memid_t nm_id; /* allocator identifier */ int nm_grp; /* iommu groupd id */ @@ -751,6 +751,12 @@ netmap_reset_obj_allocator(struct netmap u_int i; size_t sz = p->_clustsize; + /* + * Free each cluster allocated in + * netmap_finalize_obj_allocator(). The cluster start + * addresses are stored at multiples of p->_clusterentries + * in the lut. + */ for (i = 0; i < p->objtotal; i += p->_clustentries) { if (p->lut[i].vaddr) contigfree(p->lut[i].vaddr, sz, M_NETMAP); @@ -929,6 +935,7 @@ netmap_finalize_obj_allocator(struct net if (i % p->_clustentries == 0 && p->lut[i].vaddr) contigfree(p->lut[i].vaddr, n, M_NETMAP); + p->lut[i].vaddr = NULL; } out: p->objtotal = i; @@ -936,6 +943,17 @@ netmap_finalize_obj_allocator(struct net p->numclusters = (i + p->_clustentries - 1) / p->_clustentries; break; } + /* + * Set bitmap and lut state for all buffers in the current + * cluster. + * + * [i, lim) is the set of buffer indexes that cover the + * current cluster. + * + * 'clust' is really the address of the current buffer in + * the current cluster as we index through it with a stride + * of p->_objsize. + */ for (; i < lim; i++, clust += p->_objsize) { p->bitmap[ (i>>5) ] |= ( 1 << (i & 31) ); p->lut[i].vaddr = clust; @@ -1092,10 +1110,8 @@ static int netmap_mem_private_finalize(struct netmap_mem_d *nmd) { int err; - NMA_LOCK(nmd); nmd->refcount++; err = netmap_mem_finalize_all(nmd); - NMA_UNLOCK(nmd); return err; } @@ -1103,10 +1119,8 @@ netmap_mem_private_finalize(struct netma static void netmap_mem_private_deref(struct netmap_mem_d *nmd) { - NMA_LOCK(nmd); if (--nmd->refcount <= 0) netmap_mem_reset_all(nmd); - NMA_UNLOCK(nmd); } @@ -1242,10 +1256,7 @@ static int netmap_mem_global_finalize(struct netmap_mem_d *nmd) { int err; - - NMA_LOCK(nmd); - - + /* update configuration if changed */ if (netmap_mem_global_config(nmd)) goto out; @@ -1268,8 +1279,6 @@ out: nmd->refcount--; err = nmd->lasterr; - NMA_UNLOCK(nmd); - return err; } @@ -1518,7 +1527,6 @@ netmap_mem_if_delete(struct netmap_adapt static void netmap_mem_global_deref(struct netmap_mem_d *nmd) { - NMA_LOCK(nmd); nmd->refcount--; if (!nmd->refcount) @@ -1526,7 +1534,6 @@ netmap_mem_global_deref(struct netmap_me if (netmap_verbose) D("refcount = %d", nmd->refcount); - NMA_UNLOCK(nmd); } int @@ -1535,7 +1542,9 @@ netmap_mem_finalize(struct netmap_mem_d if (nm_mem_assign_group(nmd, na->pdev) < 0) { return ENOMEM; } else { + NMA_LOCK(nmd); nmd->finalize(nmd); + NMA_UNLOCK(nmd); } if (!nmd->lasterr && na->pdev) @@ -1549,6 +1558,48 @@ netmap_mem_deref(struct netmap_mem_d *nm { NMA_LOCK(nmd); netmap_mem_unmap(&nmd->pools[NETMAP_BUF_POOL], na); + if (nmd->refcount == 1) { + u_int i; + + /* + * Reset the allocator when it falls out of use so that any + * pool resources leaked by unclean application exits are + * reclaimed. + */ + for (i = 0; i < NETMAP_POOLS_NR; i++) { + struct netmap_obj_pool *p; + u_int j; + + p = &nmd->pools[i]; + p->objfree = p->objtotal; + /* + * Reproduce the net effect of the M_ZERO malloc() + * and marking of free entries in the bitmap that + * occur in finalize_obj_allocator() + */ + memset(p->bitmap, + '\0', + sizeof(uint32_t) * ((p->objtotal + 31) / 32)); + + /* + * Set all the bits in the bitmap that have + * corresponding buffers to 1 to indicate they are + * free. + */ + for (j = 0; j < p->objtotal; j++) { + if (p->lut[j].vaddr != NULL) { + p->bitmap[ (j>>5) ] |= ( 1 << (j & 31) ); + } + } + } + + /* + * Per netmap_mem_finalize_all(), + * buffers 0 and 1 are reserved + */ + nmd->pools[NETMAP_BUF_POOL].objfree -= 2; + nmd->pools[NETMAP_BUF_POOL].bitmap[0] = ~3; + } + nmd->deref(nmd); NMA_UNLOCK(nmd); - return nmd->deref(nmd); } From owner-svn-src-stable@FreeBSD.ORG Sun May 24 01:52:23 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CF15DD4; Sun, 24 May 2015 01:52:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDAE51958; Sun, 24 May 2015 01:52:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4O1qMcg042657; Sun, 24 May 2015 01:52:22 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4O1qMst042656; Sun, 24 May 2015 01:52:22 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201505240152.t4O1qMst042656@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 24 May 2015 01:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283344 - stable/10/share/man/man3 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 01:52:23 -0000 Author: pkelsey Date: Sun May 24 01:52:22 2015 New Revision: 283344 URL: https://svnweb.freebsd.org/changeset/base/283344 Log: MFC r283093: Added description of POSIX-specified behavior when invoked on a key from within that key's destructor. Modified: stable/10/share/man/man3/pthread_getspecific.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man3/pthread_getspecific.3 ============================================================================== --- stable/10/share/man/man3/pthread_getspecific.3 Sun May 24 01:48:33 2015 (r283343) +++ stable/10/share/man/man3/pthread_getspecific.3 Sun May 24 01:52:22 2015 (r283344) @@ -64,6 +64,11 @@ is undefined. The .Fn pthread_getspecific function may be called from a thread-specific data destructor function. +A call to +.Fn pthread_getspecific +for the thread-specific data key being destroyed returns the value NULL, +unless the value is changed (after the destructor starts) by a call to +.Fn pthread_setspecific . .Sh RETURN VALUES The .Fn pthread_getspecific From owner-svn-src-stable@FreeBSD.ORG Sun May 24 02:15:19 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08DFF122; Sun, 24 May 2015 02:15:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB8721B58; Sun, 24 May 2015 02:15:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4O2FImt053298; Sun, 24 May 2015 02:15:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4O2FIN6053297; Sun, 24 May 2015 02:15:18 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505240215.t4O2FIN6053297@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 24 May 2015 02:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283345 - stable/10/release 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 02:15:19 -0000 Author: gjb Date: Sun May 24 02:15:18 2015 New Revision: 283345 URL: https://svnweb.freebsd.org/changeset/base/283345 Log: MFC r283252: Include the TARGET in the EC2 AMI name. Without this, AWS rejects subsequent image uploads of a different architecture because the name conflicts. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile.ec2 Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile.ec2 ============================================================================== --- stable/10/release/Makefile.ec2 Sun May 24 01:52:22 2015 (r283344) +++ stable/10/release/Makefile.ec2 Sun May 24 02:15:18 2015 (r283345) @@ -53,7 +53,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} .endif /usr/local/bin/bsdec2-image-upload ${PUBLISH} \ ${.OBJDIR}/ec2.raw \ - "${TYPE} ${REVISION}-${BRANCH}${AMINAMESUFFIX}" \ - "${TYPE} ${REVISION}-${BRANCH}" \ + "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ + "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} @touch ${.TARGET} From owner-svn-src-stable@FreeBSD.ORG Sun May 24 04:14:11 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C0BA241; Sun, 24 May 2015 04:14:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F9DB17B9; Sun, 24 May 2015 04:14:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4O4EAYP013542; Sun, 24 May 2015 04:14:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4O4EATu013539; Sun, 24 May 2015 04:14:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201505240414.t4O4EATu013539@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 24 May 2015 04:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283349 - stable/10/sys/cam 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 04:14:11 -0000 Author: trasz Date: Sun May 24 04:14:09 2015 New Revision: 283349 URL: https://svnweb.freebsd.org/changeset/base/283349 Log: MFC r279554: Make periphdriver_register() take XPT lock when modifying the periph_drivers array. This fixes a panic that sometimes occured when kldloading ctl.ko. PR: 200384 Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/cam_periph.c stable/10/sys/cam/cam_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_periph.c ============================================================================== --- stable/10/sys/cam/cam_periph.c Sun May 24 02:46:08 2015 (r283348) +++ stable/10/sys/cam/cam_periph.c Sun May 24 04:14:09 2015 (r283349) @@ -108,9 +108,19 @@ periphdriver_register(void *data) struct periph_driver **newdrivers, **old; int ndrivers; +again: ndrivers = nperiph_drivers + 2; newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_CAMPERIPH, M_WAITOK); + xpt_lock_buses(); + if (ndrivers != nperiph_drivers + 2) { + /* + * Lost race against itself; go around. + */ + xpt_unlock_buses(); + free(newdrivers, M_CAMPERIPH); + goto again; + } if (periph_drivers) bcopy(periph_drivers, newdrivers, sizeof(*newdrivers) * nperiph_drivers); @@ -118,9 +128,10 @@ periphdriver_register(void *data) newdrivers[nperiph_drivers + 1] = NULL; old = periph_drivers; periph_drivers = newdrivers; + nperiph_drivers++; + xpt_unlock_buses(); if (old) free(old, M_CAMPERIPH); - nperiph_drivers++; /* If driver marked as early or it is late now, initialize it. */ if (((drv->flags & CAM_PERIPH_DRV_EARLY) != 0 && initialized > 0) || initialized > 1) Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Sun May 24 02:46:08 2015 (r283348) +++ stable/10/sys/cam/cam_xpt.c Sun May 24 04:14:09 2015 (r283349) @@ -149,6 +149,8 @@ typedef int xpt_pdrvfunc_t (struct perip /* Transport layer configuration information */ static struct xpt_softc xsoftc; +MTX_SYSINIT(xpt_topo_init, &xsoftc.xpt_topo_lock, "XPT topology lock", MTX_DEF); + TUNABLE_INT("kern.cam.boot_delay", &xsoftc.boot_delay); SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, &xsoftc.boot_delay, 0, "Bus registration wait time"); @@ -850,7 +852,6 @@ xpt_init(void *dummy) mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF); mtx_init(&xsoftc.xpt_highpower_lock, "XPT highpower lock", NULL, MTX_DEF); - mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF); xsoftc.xpt_taskq = taskqueue_create("CAM XPT task", M_WAITOK, taskqueue_thread_enqueue, /*context*/&xsoftc.xpt_taskq); From owner-svn-src-stable@FreeBSD.ORG Sun May 24 06:53:10 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E488E31B; Sun, 24 May 2015 06:53:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B6618B5; Sun, 24 May 2015 06:53:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4O6rAEp091392; Sun, 24 May 2015 06:53:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4O6rAa0091391; Sun, 24 May 2015 06:53:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201505240653.t4O6rAa0091391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sun, 24 May 2015 06:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283350 - stable/10/sys/dev/sfxge 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 06:53:11 -0000 Author: arybchik Date: Sun May 24 06:53:10 2015 New Revision: 283350 URL: https://svnweb.freebsd.org/changeset/base/283350 Log: MFC: r283278 sfxge: relax assertion to allow RST flag in TSO packets Kernel under stress load, mixed MC reboot and sfupdate really generates TSO packet with RST flag. It will generate many TCP packets with RST flag set. May be RST flag should be set in the last segment only, but it could be dropped. So, it is safer to keep the flag in all packets to be sure that connection is reset. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Sun May 24 04:14:09 2015 (r283349) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Sun May 24 06:53:10 2015 (r283350) @@ -865,8 +865,14 @@ static void tso_start(struct sfxge_tso_s tso->seqnum = ntohl(th->th_seq); /* These flags must not be duplicated */ - KASSERT(!(th->th_flags & (TH_URG | TH_SYN | TH_RST)), - ("incompatible TCP flag on TSO packet")); + /* + * RST should not be duplicated as well, but FreeBSD kernel + * generates TSO packets with RST flag. So, do not assert + * its absence. + */ + KASSERT(!(th->th_flags & (TH_URG | TH_SYN)), + ("incompatible TCP flag 0x%x on TSO packet", + th->th_flags & (TH_URG | TH_SYN))); tso->out_len = mbuf->m_pkthdr.len - tso->header_len; } From owner-svn-src-stable@FreeBSD.ORG Sun May 24 07:32:05 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1463A30; Sun, 24 May 2015 07:32:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 931831CE6; Sun, 24 May 2015 07:32:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4O7W5w8016200; Sun, 24 May 2015 07:32:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4O7W3Xj016178; Sun, 24 May 2015 07:32:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505240732.t4O7W3Xj016178@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 24 May 2015 07:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283359 - in stable/10/sys: amd64/linux32 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 07:32:05 -0000 Author: kib Date: Sun May 24 07:32:02 2015 New Revision: 283359 URL: https://svnweb.freebsd.org/changeset/base/283359 Log: MFC r282708: On exec, single-threading must be enforced before arguments space is allocated from exec_map. Modified: stable/10/sys/amd64/linux32/linux32_machdep.c stable/10/sys/compat/freebsd32/freebsd32_misc.c stable/10/sys/compat/svr4/svr4_misc.c stable/10/sys/i386/ibcs2/ibcs2_misc.c stable/10/sys/i386/linux/linux_machdep.c stable/10/sys/kern/kern_exec.c stable/10/sys/sys/imgact.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sun May 24 07:23:16 2015 (r283358) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sun May 24 07:32:02 2015 (r283359) @@ -137,6 +137,7 @@ int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; + struct vmspace *oldvmspace; char *path; int error; @@ -147,12 +148,17 @@ linux_execve(struct thread *td, struct l printf(ARGS(execve, "%s"), path); #endif + error = pre_execve(td, &oldvmspace); + if (error != 0) { + free(path, M_TEMP); + return (error); + } error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, args->envp); free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - if (error == 0) + if (error == 0) { /* Linux process can execute FreeBSD one, do not attempt * to create emuldata for such process using * linux_proc_init, this leads to a panic on KASSERT @@ -160,6 +166,8 @@ linux_execve(struct thread *td, struct l */ if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) error = linux_proc_init(td, 0, 0); + } + post_execve(td, error, oldvmspace); return (error); } Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_misc.c Sun May 24 07:23:16 2015 (r283358) +++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Sun May 24 07:32:02 2015 (r283359) @@ -400,12 +400,17 @@ int freebsd32_execve(struct thread *td, struct freebsd32_execve_args *uap) { struct image_args eargs; + struct vmspace *oldvmspace; int error; + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = freebsd32_exec_copyin_args(&eargs, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) error = kern_execve(td, &eargs, NULL); + post_execve(td, error, oldvmspace); return (error); } @@ -413,14 +418,19 @@ int freebsd32_fexecve(struct thread *td, struct freebsd32_fexecve_args *uap) { struct image_args eargs; + struct vmspace *oldvmspace; int error; + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = freebsd32_exec_copyin_args(&eargs, NULL, UIO_SYSSPACE, uap->argv, uap->envv); if (error == 0) { eargs.fd = uap->fd; error = kern_execve(td, &eargs, NULL); } + post_execve(td, error, oldvmspace); return (error); } Modified: stable/10/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_misc.c Sun May 24 07:23:16 2015 (r283358) +++ stable/10/sys/compat/svr4/svr4_misc.c Sun May 24 07:32:02 2015 (r283359) @@ -167,15 +167,22 @@ svr4_sys_execv(td, uap) struct svr4_sys_execv_args *uap; { struct image_args eargs; + struct vmspace *oldvmspace; char *path; int error; CHECKALTEXIST(td, uap->path, &path); + error = pre_execve(td, &oldvmspace); + if (error != 0) { + free(path, M_TEMP); + return (error); + } error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, NULL); free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); + post_execve(td, error, oldvmspace); return (error); } @@ -185,16 +192,23 @@ svr4_sys_execve(td, uap) struct svr4_sys_execve_args *uap; { struct image_args eargs; + struct vmspace *oldvmspace; char *path; int error; CHECKALTEXIST(td, uap->path, &path); + error = pre_execve(td, &oldvmspace); + if (error != 0) { + free(path, M_TEMP); + return (error); + } error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, uap->envp); free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); + post_execve(td, error, oldvmspace); return (error); } Modified: stable/10/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- stable/10/sys/i386/ibcs2/ibcs2_misc.c Sun May 24 07:23:16 2015 (r283358) +++ stable/10/sys/i386/ibcs2/ibcs2_misc.c Sun May 24 07:32:02 2015 (r283359) @@ -200,15 +200,22 @@ ibcs2_execv(td, uap) struct ibcs2_execv_args *uap; { struct image_args eargs; + struct vmspace *oldvmspace; char *path; int error; CHECKALTEXIST(td, uap->path, &path); + error = pre_execve(td, &oldvmspace); + if (error != 0) { + free(path, M_TEMP); + return (error); + } error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, NULL); free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); + post_execve(td, error, oldvmspace); return (error); } @@ -218,16 +225,23 @@ ibcs2_execve(td, uap) struct ibcs2_execve_args *uap; { struct image_args eargs; + struct vmspace *oldvmspace; char *path; int error; CHECKALTEXIST(td, uap->path, &path); + error = pre_execve(td, &oldvmspace); + if (error != 0) { + free(path, M_TEMP); + return (error); + } error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, uap->envp); free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); + post_execve(td, error, oldvmspace); return (error); } Modified: stable/10/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/10/sys/i386/linux/linux_machdep.c Sun May 24 07:23:16 2015 (r283358) +++ stable/10/sys/i386/linux/linux_machdep.c Sun May 24 07:32:02 2015 (r283359) @@ -126,9 +126,10 @@ bsd_to_linux_sigaltstack(int bsa) int linux_execve(struct thread *td, struct linux_execve_args *args) { - int error; - char *newpath; struct image_args eargs; + struct vmspace *oldvmspace; + char *newpath; + int error; LCONVPATHEXIST(td, args->path, &newpath); @@ -137,12 +138,17 @@ linux_execve(struct thread *td, struct l printf(ARGS(execve, "%s"), newpath); #endif + error = pre_execve(td, &oldvmspace); + if (error != 0) { + free(newpath, M_TEMP); + return (error); + } error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE, args->argp, args->envp); free(newpath, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - if (error == 0) + if (error == 0) { /* linux process can exec fbsd one, dont attempt * to create emuldata for such process using * linux_proc_init, this leads to a panic on KASSERT @@ -150,6 +156,8 @@ linux_execve(struct thread *td, struct l */ if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) error = linux_proc_init(td, 0, 0); + } + post_execve(td, error, oldvmspace); return (error); } Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Sun May 24 07:23:16 2015 (r283358) +++ stable/10/sys/kern/kern_exec.c Sun May 24 07:32:02 2015 (r283359) @@ -196,21 +196,20 @@ struct execve_args { #endif int -sys_execve(td, uap) - struct thread *td; - struct execve_args /* { - char *fname; - char **argv; - char **envv; - } */ *uap; +sys_execve(struct thread *td, struct execve_args *uap) { - int error; struct image_args args; + struct vmspace *oldvmspace; + int error; + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) error = kern_execve(td, &args, NULL); + post_execve(td, error, oldvmspace); return (error); } @@ -224,15 +223,20 @@ struct fexecve_args { int sys_fexecve(struct thread *td, struct fexecve_args *uap) { - int error; struct image_args args; + struct vmspace *oldvmspace; + int error; + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = exec_copyin_args(&args, NULL, UIO_SYSSPACE, uap->argv, uap->envv); if (error == 0) { args.fd = uap->fd; error = kern_execve(td, &args, NULL); } + post_execve(td, error, oldvmspace); return (error); } @@ -246,65 +250,56 @@ struct __mac_execve_args { #endif int -sys___mac_execve(td, uap) - struct thread *td; - struct __mac_execve_args /* { - char *fname; - char **argv; - char **envv; - struct mac *mac_p; - } */ *uap; +sys___mac_execve(struct thread *td, struct __mac_execve_args *uap) { #ifdef MAC - int error; struct image_args args; + struct vmspace *oldvmspace; + int error; + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); if (error == 0) error = kern_execve(td, &args, uap->mac_p); + post_execve(td, error, oldvmspace); return (error); #else return (ENOSYS); #endif } -/* - * XXX: kern_execve has the astonishing property of not always returning to - * the caller. If sufficiently bad things happen during the call to - * do_execve(), it can end up calling exit1(); as a result, callers must - * avoid doing anything which they might need to undo (e.g., allocating - * memory). - */ int -kern_execve(td, args, mac_p) - struct thread *td; - struct image_args *args; - struct mac *mac_p; +pre_execve(struct thread *td, struct vmspace **oldvmspace) { - struct proc *p = td->td_proc; - struct vmspace *oldvmspace; + struct proc *p; int error; - AUDIT_ARG_ARGV(args->begin_argv, args->argc, - args->begin_envv - args->begin_argv); - AUDIT_ARG_ENVV(args->begin_envv, args->envc, - args->endp - args->begin_envv); - if (p->p_flag & P_HADTHREADS) { + KASSERT(td == curthread, ("non-current thread %p", td)); + error = 0; + p = td->td_proc; + if ((p->p_flag & P_HADTHREADS) != 0) { PROC_LOCK(p); - if (thread_single(p, SINGLE_BOUNDARY)) { - PROC_UNLOCK(p); - exec_free_args(args); - return (ERESTART); /* Try again later. */ - } + if (thread_single(p, SINGLE_BOUNDARY) != 0) + error = ERESTART; PROC_UNLOCK(p); } + KASSERT(error != 0 || (td->td_pflags & TDP_EXECVMSPC) == 0, + ("nested execve")); + *oldvmspace = p->p_vmspace; + return (error); +} - KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); - oldvmspace = td->td_proc->p_vmspace; - error = do_execve(td, args, mac_p); +void +post_execve(struct thread *td, int error, struct vmspace *oldvmspace) +{ + struct proc *p; - if (p->p_flag & P_HADTHREADS) { + KASSERT(td == curthread, ("non-current thread %p", td)); + p = td->td_proc; + if ((p->p_flag & P_HADTHREADS) != 0) { PROC_LOCK(p); /* * If success, we upgrade to SINGLE_EXIT state to @@ -317,13 +312,29 @@ kern_execve(td, args, mac_p) PROC_UNLOCK(p); } if ((td->td_pflags & TDP_EXECVMSPC) != 0) { - KASSERT(td->td_proc->p_vmspace != oldvmspace, + KASSERT(p->p_vmspace != oldvmspace, ("oldvmspace still used")); vmspace_free(oldvmspace); td->td_pflags &= ~TDP_EXECVMSPC; } +} - return (error); +/* + * XXX: kern_execve has the astonishing property of not always returning to + * the caller. If sufficiently bad things happen during the call to + * do_execve(), it can end up calling exit1(); as a result, callers must + * avoid doing anything which they might need to undo (e.g., allocating + * memory). + */ +int +kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p) +{ + + AUDIT_ARG_ARGV(args->begin_argv, args->argc, + args->begin_envv - args->begin_argv); + AUDIT_ARG_ENVV(args->begin_envv, args->envc, + args->endp - args->begin_envv); + return (do_execve(td, args, mac_p)); } /* Modified: stable/10/sys/sys/imgact.h ============================================================================== --- stable/10/sys/sys/imgact.h Sun May 24 07:23:16 2015 (r283358) +++ stable/10/sys/sys/imgact.h Sun May 24 07:32:02 2015 (r283359) @@ -86,6 +86,7 @@ struct image_params { #ifdef _KERNEL struct sysentvec; struct thread; +struct vmspace; #define IMGACT_CORE_COMPRESS 0x01 @@ -98,6 +99,8 @@ void exec_setregs(struct thread *, struc int exec_shell_imgact(struct image_params *); int exec_copyin_args(struct image_args *, char *, enum uio_seg, char **, char **); +int pre_execve(struct thread *td, struct vmspace **oldvmspace); +void post_execve(struct thread *td, int error, struct vmspace *oldvmspace); #endif #endif /* !_SYS_IMGACT_H_ */ From owner-svn-src-stable@FreeBSD.ORG Sun May 24 14:25:08 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2276D7D5; Sun, 24 May 2015 14:25:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1062E159C; Sun, 24 May 2015 14:25:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OEP8cg018802; Sun, 24 May 2015 14:25:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OEP3J1018776; Sun, 24 May 2015 14:25:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241425.t4OEP3J1018776@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 14:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283368 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 14:25:08 -0000 Author: ian Date: Sun May 24 14:25:03 2015 New Revision: 283368 URL: https://svnweb.freebsd.org/changeset/base/283368 Log: MFC r276004: Fix the indentation to simplify comparing the ARM config files. Modified: stable/10/sys/arm/conf/BEAGLEBONE stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/CUBIEBOARD stable/10/sys/arm/conf/CUBIEBOARD2 stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/conf/DOCKSTAR stable/10/sys/arm/conf/DREAMPLUG-1001 stable/10/sys/arm/conf/EFIKA_MX stable/10/sys/arm/conf/EXYNOS5.common stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/IMX53 stable/10/sys/arm/conf/IMX53-QSB stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/conf/SAM9260EK stable/10/sys/arm/conf/VERSATILEPB stable/10/sys/arm/conf/VYBRID Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/BEAGLEBONE ============================================================================== --- stable/10/sys/arm/conf/BEAGLEBONE Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/BEAGLEBONE Sun May 24 14:25:03 2015 (r283368) @@ -77,7 +77,7 @@ options DDB # Enable the kernel debug #options DIAGNOSTIC # NFS server support -#options NFSD +#options NFSD # NFS root from boopt/dhcp #options BOOTP Modified: stable/10/sys/arm/conf/CNS11XXNAS ============================================================================== --- stable/10/sys/arm/conf/CNS11XXNAS Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/CNS11XXNAS Sun May 24 14:25:03 2015 (r283368) @@ -103,7 +103,7 @@ device bpf device loop device md -device random # Entropy device +device random # Entropy device device usb @@ -114,12 +114,12 @@ device umass device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device pass -device cfi +device cfi #device udav # Davicom DM9601E USB device geom_label device geom_journal -device geom_part_bsd +device geom_part_bsd options ROOTDEVNAME=\"ufs:da0s1a\" Modified: stable/10/sys/arm/conf/CUBIEBOARD ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/CUBIEBOARD Sun May 24 14:25:03 2015 (r283368) @@ -92,7 +92,7 @@ options ROOTDEVNAME=\"ufs:/dev/da0s2\" # ATA controllers #device ahci # AHCI-compatible SATA controllers #device ata # Legacy ATA/SATA controllers -#options ATA_STATIC_ID # Static device numbering +#options ATA_STATIC_ID # Static device numbering # Console and misc device uart Modified: stable/10/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD2 Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/CUBIEBOARD2 Sun May 24 14:25:03 2015 (r283368) @@ -93,7 +93,7 @@ options ROOTDEVNAME=\"ufs:/dev/da0s2\" # ATA controllers #device ahci # AHCI-compatible SATA controllers #device ata # Legacy ATA/SATA controllers -#options ATA_STATIC_ID # Static device numbering +#options ATA_STATIC_ID # Static device numbering # Console and misc device uart Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- stable/10/sys/arm/conf/DIGI-CCWMX53 Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/DIGI-CCWMX53 Sun May 24 14:25:03 2015 (r283368) @@ -22,7 +22,7 @@ include "IMX53" ident DIGI-CCWMX53 -makeoptions WITHOUT_MODULES="ahc" +makeoptions WITHOUT_MODULES="ahc" # required for netbooting #options BOOTP @@ -34,5 +34,5 @@ makeoptions WITHOUT_MODULES="ahc" #options ROOTDEVNAME=\"ufs:ada0s2a\" # Flattened Device Tree -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=digi-ccwmx53.dts +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=digi-ccwmx53.dts Modified: stable/10/sys/arm/conf/DOCKSTAR ============================================================================== --- stable/10/sys/arm/conf/DOCKSTAR Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/DOCKSTAR Sun May 24 14:25:03 2015 (r283368) @@ -58,12 +58,12 @@ device faith # IPv6-to-IPv4 relaying device firmware # firmware(9) required for USB wlan device gif # IPv6 and IPv4 tunneling device loop # Network loopback -device md # Memory/malloc disk +device md # Memory/malloc disk device pty # BSD-style compatibility pseudo ttys device random # Entropy device -device tun # Packet tunnel. +device tun # Packet tunnel. device ether # Required for all ethernet devices -device vlan # 802.1Q VLAN support +device vlan # 802.1Q VLAN support device wlan # 802.11 WLAN support # cam support for umass and ahci @@ -81,66 +81,66 @@ device e1000phy # USB options USB_HOST_ALIGN=32 # Align DMA to cacheline -#options USB_DEBUG # Compile in USB debug support -device usb # Basic usb support -device ehci # USB host controller -device umass # Mass storage -device uhid # Human-interface devices -device rum # Ralink Technology RT2501USB wireless NICs -device uath # Atheros AR5523 wireless NICs -device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs -device urtw # Realtek RTL8187B/L USB -device upgt # Conexant/Intersil PrismGT SoftMAC USB -device u3g # USB-based 3G modems (Option, Huawei, Sierra) +#options USB_DEBUG # Compile in USB debug support +device usb # Basic usb support +device ehci # USB host controller +device umass # Mass storage +device uhid # Human-interface devices +device rum # Ralink Technology RT2501USB wireless NICs +device uath # Atheros AR5523 wireless NICs +device ural # Ralink Technology RT2500USB wireless NICs +device zyd # ZyDAS zb1211/zb1211b wireless NICs +device urtw # Realtek RTL8187B/L USB +device upgt # Conexant/Intersil PrismGT SoftMAC USB +device u3g # USB-based 3G modems (Option, Huawei, Sierra) # I2C (TWSI) device iic device iicbus # Sound -device sound -device snd_uaudio +device sound +device snd_uaudio #crypto -device cesa # Marvell security engine -device crypto -device cryptodev +device cesa # Marvell security engine +device crypto +device cryptodev # IPSec -device enc -options IPSEC -options IPSEC_NAT_T -options TCP_SIGNATURE # include support for RFC 2385 +device enc +options IPSEC +options IPSEC_NAT_T +options TCP_SIGNATURE # include support for RFC 2385 # IPFW -options IPFIREWALL -options IPFIREWALL_DEFAULT_TO_ACCEPT -options IPFIREWALL_VERBOSE -options IPFIREWALL_VERBOSE_LIMIT=100 -options IPFIREWALL_NAT -options LIBALIAS -options DUMMYNET -options IPDIVERT +options IPFIREWALL +options IPFIREWALL_DEFAULT_TO_ACCEPT +options IPFIREWALL_VERBOSE +options IPFIREWALL_VERBOSE_LIMIT=100 +options IPFIREWALL_NAT +options LIBALIAS +options DUMMYNET +options IPDIVERT #PF -device pf -device pflog -device pfsync +device pf +device pflog +device pfsync # ALTQ, required for PF -options ALTQ # Basic ALTQ support -options ALTQ_CBQ # Class Based Queueing -options ALTQ_RED # Random Early Detection -options ALTQ_RIO # RED In/Out -options ALTQ_HFSC # Hierarchical Packet Scheduler -options ALTQ_CDNR # Traffic conditioner -options ALTQ_PRIQ # Priority Queueing -options ALTQ_NOPCC # Required if the TSC is unusable +options ALTQ # Basic ALTQ support +options ALTQ_CBQ # Class Based Queueing +options ALTQ_RED # Random Early Detection +options ALTQ_RIO # RED In/Out +options ALTQ_HFSC # Hierarchical Packet Scheduler +options ALTQ_CDNR # Traffic conditioner +options ALTQ_PRIQ # Priority Queueing +options ALTQ_NOPCC # Required if the TSC is unusable #options ALTQ_DEBUG # Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER options DDB Modified: stable/10/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- stable/10/sys/arm/conf/DREAMPLUG-1001 Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/DREAMPLUG-1001 Sun May 24 14:25:03 2015 (r283368) @@ -58,22 +58,22 @@ options FDT_DTB_STATIC # Misc pseudo devices device bpf # Required for DHCP device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware(9) required for USB wlan -device gif # IPv6 and IPv4 tunneling +device firmware # firmware(9) required for USB wlan +device gif # IPv6 and IPv4 tunneling device loop # Network loopback -device md # Memory/malloc disk +device md # Memory/malloc disk device pty # BSD-style compatibility pseudo ttys device random # Entropy device -device tun # Packet tunnel. +device tun # Packet tunnel. device ether # Required for all ethernet devices -device vlan # 802.1Q VLAN support +device vlan # 802.1Q VLAN support device wlan # 802.11 WLAN support # cam support for umass and ahci device scbus device pass device da -device cd +device cd # Serial ports device uart @@ -85,18 +85,18 @@ device e1000phy # USB options USB_HOST_ALIGN=32 # Align DMA to cacheline -#options USB_DEBUG # Compile in USB debug support -device usb # Basic usb support -device ehci # USB host controller -device umass # Mass storage -device uhid # Human-interface devices -device rum # Ralink Technology RT2501USB wireless NICs -device uath # Atheros AR5523 wireless NICs -device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs -device urtw # Realtek RTL8187B/L USB -device upgt # Conexant/Intersil PrismGT SoftMAC USB -device u3g # USB-based 3G modems (Option, Huawei, Sierra) +#options USB_DEBUG # Compile in USB debug support +device usb # Basic usb support +device ehci # USB host controller +device umass # Mass storage +device uhid # Human-interface devices +device rum # Ralink Technology RT2501USB wireless NICs +device uath # Atheros AR5523 wireless NICs +device ural # Ralink Technology RT2500USB wireless NICs +device zyd # ZyDAS zb1211/zb1211b wireless NICs +device urtw # Realtek RTL8187B/L USB +device upgt # Conexant/Intersil PrismGT SoftMAC USB +device u3g # USB-based 3G modems (Option, Huawei, Sierra) # I2C (TWSI) device iic @@ -107,48 +107,48 @@ device mvs device ahci # Sound -device sound -device snd_uaudio +device sound +device snd_uaudio #crypto -device cesa # Marvell security engine -device crypto -device cryptodev +device cesa # Marvell security engine +device crypto +device cryptodev # IPSec -device enc -options IPSEC -options IPSEC_NAT_T -options TCP_SIGNATURE # include support for RFC 2385 +device enc +options IPSEC +options IPSEC_NAT_T +options TCP_SIGNATURE # include support for RFC 2385 # IPFW -options IPFIREWALL -options IPFIREWALL_DEFAULT_TO_ACCEPT -options IPFIREWALL_VERBOSE -options IPFIREWALL_VERBOSE_LIMIT=100 -options IPFIREWALL_NAT -options LIBALIAS -options DUMMYNET -options IPDIVERT +options IPFIREWALL +options IPFIREWALL_DEFAULT_TO_ACCEPT +options IPFIREWALL_VERBOSE +options IPFIREWALL_VERBOSE_LIMIT=100 +options IPFIREWALL_NAT +options LIBALIAS +options DUMMYNET +options IPDIVERT #PF -device pf -device pflog -device pfsync +device pf +device pflog +device pfsync # ALTQ, required for PF -options ALTQ # Basic ALTQ support -options ALTQ_CBQ # Class Based Queueing -options ALTQ_RED # Random Early Detection -options ALTQ_RIO # RED In/Out -options ALTQ_HFSC # Hierarchical Packet Scheduler -options ALTQ_CDNR # Traffic conditioner -options ALTQ_PRIQ # Priority Queueing -options ALTQ_NOPCC # Required if the TSC is unusable +options ALTQ # Basic ALTQ support +options ALTQ_CBQ # Class Based Queueing +options ALTQ_RED # Random Early Detection +options ALTQ_RIO # RED In/Out +options ALTQ_HFSC # Hierarchical Packet Scheduler +options ALTQ_CDNR # Traffic conditioner +options ALTQ_PRIQ # Priority Queueing +options ALTQ_NOPCC # Required if the TSC is unusable #options ALTQ_DEBUG # Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER options DDB @@ -179,7 +179,7 @@ options ROOTDEVNAME=\"ufs:/dev/da1s1a\" # create a kernel config file that looks like this: # # include DREAMPLUG-1001 -# nomakeoptions FDT_DTS_FILE +# nomakeoptions FDT_DTS_FILE # makeoptions FDT_DTS_FILE=dreamplug-1001N.dts # device nand Modified: stable/10/sys/arm/conf/EFIKA_MX ============================================================================== --- stable/10/sys/arm/conf/EFIKA_MX Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/EFIKA_MX Sun May 24 14:25:03 2015 (r283368) @@ -22,7 +22,7 @@ ident EFIKA_MX include "../freescale/imx/std.imx51" -makeoptions WITHOUT_MODULES="ahc" +makeoptions WITHOUT_MODULES="ahc" options SCHED_4BSD # 4BSD scheduler options PREEMPTION # Enable kernel thread preemption @@ -187,7 +187,7 @@ makeoptions FDT_DTS_FILE=efikamx.dts # Uncomment following lines for framebuffer/syscons support device sc device kbdmux -options SC_DFLT_FONT # compile font in -makeoptions SC_DFLT_FONT=cp437 +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 device ukbd # Allow keyboard like HIDs to control console device ums Modified: stable/10/sys/arm/conf/EXYNOS5.common ============================================================================== --- stable/10/sys/arm/conf/EXYNOS5.common Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/EXYNOS5.common Sun May 24 14:25:03 2015 (r283368) @@ -99,8 +99,8 @@ device gpio options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE +#options USB_REQ_DEBUG +#options USB_VERBOSE #device musb device ehci #device ohci Modified: stable/10/sys/arm/conf/HL201 ============================================================================== --- stable/10/sys/arm/conf/HL201 Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/HL201 Sun May 24 14:25:03 2015 (r283368) @@ -133,5 +133,5 @@ device nand # NAND interface on CS3 #makeoptions FDT_DTS_FILE=hl201.dts options EARLY_PRINTF -options SOCDEV_PA=0xfc000000 +options SOCDEV_PA=0xfc000000 options SOCDEV_VA=0xdc000000 Modified: stable/10/sys/arm/conf/IMX53 ============================================================================== --- stable/10/sys/arm/conf/IMX53 Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/IMX53 Sun May 24 14:25:03 2015 (r283368) @@ -170,5 +170,5 @@ options FDT # Configure using FDT/DTB #device sc #device vt #device kbdmux -#options SC_DFLT_FONT # compile font in -#makeoptions SC_DFLT_FONT=cp437 +#options SC_DFLT_FONT # compile font in +#makeoptions SC_DFLT_FONT=cp437 Modified: stable/10/sys/arm/conf/IMX53-QSB ============================================================================== --- stable/10/sys/arm/conf/IMX53-QSB Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/IMX53-QSB Sun May 24 14:25:03 2015 (r283368) @@ -34,5 +34,5 @@ options HZ=250 # 4ms scheduling quant #options ROOTDEVNAME=\"ufs:ada0s2a\" # Flattened Device Tree -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=imx53-qsb.dts +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=imx53-qsb.dts Modified: stable/10/sys/arm/conf/IMX6 ============================================================================== --- stable/10/sys/arm/conf/IMX6 Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/IMX6 Sun May 24 14:25:03 2015 (r283368) @@ -98,7 +98,7 @@ device miibus # Required for ethernet device bpf # Berkeley packet filter (required for DHCP) # General-purpose input/output -device gpio +device gpio # Serial (COM) ports device uart # Multi-uart driver Modified: stable/10/sys/arm/conf/SAM9260EK ============================================================================== --- stable/10/sys/arm/conf/SAM9260EK Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/SAM9260EK Sun May 24 14:25:03 2015 (r283368) @@ -181,5 +181,5 @@ device nand # NAND interface on CS3 #makeoptions FDT_DTS_FILE=sam9260ek.dts options EARLY_PRINTF -options SOCDEV_PA=0xfc000000 +options SOCDEV_PA=0xfc000000 options SOCDEV_VA=0xdc000000 Modified: stable/10/sys/arm/conf/VERSATILEPB ============================================================================== --- stable/10/sys/arm/conf/VERSATILEPB Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/VERSATILEPB Sun May 24 14:25:03 2015 (r283368) @@ -106,8 +106,8 @@ device pass # Passthrough device (dir # Comment following lines for headless setup device sc device kbdmux -options SC_DFLT_FONT # compile font in -makeoptions SC_DFLT_FONT=cp437 +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 options KDB options DDB # Enable the kernel debugger Modified: stable/10/sys/arm/conf/VYBRID ============================================================================== --- stable/10/sys/arm/conf/VYBRID Sun May 24 12:33:12 2015 (r283367) +++ stable/10/sys/arm/conf/VYBRID Sun May 24 14:25:03 2015 (r283368) @@ -110,8 +110,8 @@ device gpio options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE +#options USB_REQ_DEBUG +#options USB_VERBOSE #device musb device ehci #device ohci From owner-svn-src-stable@FreeBSD.ORG Sun May 24 14:57:20 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2EC34C9; Sun, 24 May 2015 14:57:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEB8618EB; Sun, 24 May 2015 14:57:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OEvKuB035201; Sun, 24 May 2015 14:57:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OEvIL5035187; Sun, 24 May 2015 14:57:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241457.t4OEvIL5035187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 14:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283387 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 14:57:20 -0000 Author: ian Date: Sun May 24 14:57:17 2015 New Revision: 283387 URL: https://svnweb.freebsd.org/changeset/base/283387 Log: MFC r279837: Remove MODULES_OVERRIDE="" and WITHOUT_MODULES="ahc" from armv6 configs. Modified: stable/10/sys/arm/conf/ARMADAXP stable/10/sys/arm/conf/CUBIEBOARD stable/10/sys/arm/conf/CUBIEBOARD2 stable/10/sys/arm/conf/EXYNOS5.common stable/10/sys/arm/conf/PANDABOARD stable/10/sys/arm/conf/TS7800 stable/10/sys/arm/conf/VYBRID stable/10/sys/arm/conf/ZEDBOARD Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/ARMADAXP ============================================================================== --- stable/10/sys/arm/conf/ARMADAXP Sun May 24 14:56:21 2015 (r283386) +++ stable/10/sys/arm/conf/ARMADAXP Sun May 24 14:57:17 2015 (r283387) @@ -22,7 +22,6 @@ ident MV-88F78XX0 include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP -makeoptions MODULES_OVERRIDE="" makeoptions WERROR="-Werror" Modified: stable/10/sys/arm/conf/CUBIEBOARD ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD Sun May 24 14:56:21 2015 (r283386) +++ stable/10/sys/arm/conf/CUBIEBOARD Sun May 24 14:57:17 2015 (r283387) @@ -23,9 +23,6 @@ ident CUBIEBOARD include "../allwinner/std.a10" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options HZ=100 options SCHED_4BSD # 4BSD scheduler options PREEMPTION # Enable kernel thread preemption Modified: stable/10/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD2 Sun May 24 14:56:21 2015 (r283386) +++ stable/10/sys/arm/conf/CUBIEBOARD2 Sun May 24 14:57:17 2015 (r283387) @@ -23,9 +23,6 @@ ident CUBIEBOARD2 include "../allwinner/a20/std.a20" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: stable/10/sys/arm/conf/EXYNOS5.common ============================================================================== --- stable/10/sys/arm/conf/EXYNOS5.common Sun May 24 14:56:21 2015 (r283386) +++ stable/10/sys/arm/conf/EXYNOS5.common Sun May 24 14:57:17 2015 (r283387) @@ -18,9 +18,6 @@ # # $FreeBSD$ -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - makeoptions WERROR="-Werror" options HZ=100 Modified: stable/10/sys/arm/conf/PANDABOARD ============================================================================== --- stable/10/sys/arm/conf/PANDABOARD Sun May 24 14:56:21 2015 (r283386) +++ stable/10/sys/arm/conf/PANDABOARD Sun May 24 14:57:17 2015 (r283387) @@ -29,9 +29,6 @@ hints "PANDABOARD.hints" include "../ti/omap4/pandaboard/std.pandaboard" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: stable/10/sys/arm/conf/TS7800 ============================================================================== --- stable/10/sys/arm/conf/TS7800 Sun May 24 14:56:21 2015 (r283386) +++ stable/10/sys/arm/conf/TS7800 Sun May 24 14:57:17 2015 (r283387) @@ -8,7 +8,6 @@ ident TS7800 include "../mv/orion/std.ts7800" options SOC_MV_ORION -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" Modified: stable/10/sys/arm/conf/VYBRID ============================================================================== --- stable/10/sys/arm/conf/VYBRID Sun May 24 14:56:21 2015 (r283386) +++ stable/10/sys/arm/conf/VYBRID Sun May 24 14:57:17 2015 (r283387) @@ -21,9 +21,6 @@ ident VYBRID include "../freescale/vybrid/std.vybrid" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - makeoptions WERROR="-Werror" options HZ=100 Modified: stable/10/sys/arm/conf/ZEDBOARD ============================================================================== --- stable/10/sys/arm/conf/ZEDBOARD Sun May 24 14:56:21 2015 (r283386) +++ stable/10/sys/arm/conf/ZEDBOARD Sun May 24 14:57:17 2015 (r283387) @@ -23,9 +23,6 @@ ident ZEDBOARD include "../xilinx/zedboard/std.zedboard" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking From owner-svn-src-stable@FreeBSD.ORG Sun May 24 15:21:49 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A526F1CC; Sun, 24 May 2015 15:21:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92FB41CAD; Sun, 24 May 2015 15:21:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OFLntS050530; Sun, 24 May 2015 15:21:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OFLmgC050522; Sun, 24 May 2015 15:21:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241521.t4OFLmgC050522@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 15:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283404 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 15:21:49 -0000 Author: ian Date: Sun May 24 15:21:47 2015 New Revision: 283404 URL: https://svnweb.freebsd.org/changeset/base/283404 Log: MFC r279850: Remove MODULES_OVERRIDE="" for Marvel-based armv5 systems. Also add some #NO_UNIVERSE to configs that essentially duplicate DB-88F6XXX. Modified: stable/10/sys/arm/conf/DB-78XXX stable/10/sys/arm/conf/DB-88F5XXX stable/10/sys/arm/conf/DB-88F6XXX stable/10/sys/arm/conf/DOCKSTAR stable/10/sys/arm/conf/DREAMPLUG-1001 stable/10/sys/arm/conf/SHEEVAPLUG Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/DB-78XXX ============================================================================== --- stable/10/sys/arm/conf/DB-78XXX Sun May 24 15:21:25 2015 (r283403) +++ stable/10/sys/arm/conf/DB-78XXX Sun May 24 15:21:47 2015 (r283404) @@ -8,7 +8,6 @@ ident DB-88F78XX include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" Modified: stable/10/sys/arm/conf/DB-88F5XXX ============================================================================== --- stable/10/sys/arm/conf/DB-88F5XXX Sun May 24 15:21:25 2015 (r283403) +++ stable/10/sys/arm/conf/DB-88F5XXX Sun May 24 15:21:47 2015 (r283404) @@ -8,7 +8,6 @@ ident DB-88F5XXX include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" Modified: stable/10/sys/arm/conf/DB-88F6XXX ============================================================================== --- stable/10/sys/arm/conf/DB-88F6XXX Sun May 24 15:21:25 2015 (r283403) +++ stable/10/sys/arm/conf/DB-88F6XXX Sun May 24 15:21:47 2015 (r283404) @@ -8,7 +8,6 @@ ident DB-88F6XXX include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" Modified: stable/10/sys/arm/conf/DOCKSTAR ============================================================================== --- stable/10/sys/arm/conf/DOCKSTAR Sun May 24 15:21:25 2015 (r283403) +++ stable/10/sys/arm/conf/DOCKSTAR Sun May 24 15:21:47 2015 (r283404) @@ -17,6 +17,7 @@ # # $FreeBSD$ # +#NO_UNIVERSE ident DOCKSTAR @@ -24,8 +25,6 @@ include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dockstar.dts -makeoptions MODULES_OVERRIDE="" - options SOC_MV_KIRKWOOD options SCHED_4BSD # 4BSD scheduler Modified: stable/10/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- stable/10/sys/arm/conf/DREAMPLUG-1001 Sun May 24 15:21:25 2015 (r283403) +++ stable/10/sys/arm/conf/DREAMPLUG-1001 Sun May 24 15:21:47 2015 (r283404) @@ -20,6 +20,7 @@ # # $FreeBSD$ # +#NO_UNIVERSE ident DREAMPLUG-1001 @@ -27,8 +28,6 @@ include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dreamplug-1001.dts -makeoptions MODULES_OVERRIDE="" - options SOC_MV_KIRKWOOD options SCHED_4BSD # 4BSD scheduler Modified: stable/10/sys/arm/conf/SHEEVAPLUG ============================================================================== --- stable/10/sys/arm/conf/SHEEVAPLUG Sun May 24 15:21:25 2015 (r283403) +++ stable/10/sys/arm/conf/SHEEVAPLUG Sun May 24 15:21:47 2015 (r283404) @@ -3,12 +3,12 @@ # # $FreeBSD$ # +#NO_UNIVERSE ident SHEEVAPLUG include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" From owner-svn-src-stable@FreeBSD.ORG Sun May 24 15:29:57 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55D5C8D5; Sun, 24 May 2015 15:29:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D501D15; Sun, 24 May 2015 15:29:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OFTvvG051927; Sun, 24 May 2015 15:29:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OFTuXV051925; Sun, 24 May 2015 15:29:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241529.t4OFTuXV051925@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 15:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283409 - in stable/10/sys/boot/uboot: fdt 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 15:29:57 -0000 Author: ian Date: Sun May 24 15:29:56 2015 New Revision: 283409 URL: https://svnweb.freebsd.org/changeset/base/283409 Log: MFC r280194: Fix fdt_platform_fixups() mem region handling. Modified: stable/10/sys/boot/uboot/fdt/uboot_fdt.c stable/10/sys/boot/uboot/lib/glue.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/uboot/fdt/uboot_fdt.c ============================================================================== --- stable/10/sys/boot/uboot/fdt/uboot_fdt.c Sun May 24 15:29:20 2015 (r283408) +++ stable/10/sys/boot/uboot/fdt/uboot_fdt.c Sun May 24 15:29:56 2015 (r283409) @@ -88,7 +88,7 @@ fdt_platform_load_dtb(void) void fdt_platform_fixups(void) { - struct fdt_mem_region regions[3]; + static struct fdt_mem_region regions[UB_MAX_MR]; const char *env, *str; char *end, *ethstr; int eth_no, i, len, n; @@ -165,17 +165,15 @@ fdt_platform_fixups(void) /* Modify cpu(s) and bus clock frequenties in /cpus node [Hz] */ fdt_fixup_cpubusfreqs(si->clk_cpu, si->clk_bus); - /* Copy the data into a useful form */ - for (i = 0; i < si->mr_no; i++) { - if (i > nitems(regions)) { - i = nitems(regions); - break; + /* Extract the DRAM regions into fdt_mem_region format. */ + for (i = 0, n = 0; i < si->mr_no && n < nitems(regions); i++) { + if (si->mr[i].flags == MR_ATTR_DRAM) { + regions[n].start = si->mr[i].start; + regions[n].size = si->mr[i].size; + n++; } - - regions[i].start = si->mr[i].start; - regions[i].size = si->mr[i].size; } /* Fixup memory regions */ - fdt_fixup_memory(regions, i); + fdt_fixup_memory(regions, n); } Modified: stable/10/sys/boot/uboot/lib/glue.h ============================================================================== --- stable/10/sys/boot/uboot/lib/glue.h Sun May 24 15:29:20 2015 (r283408) +++ stable/10/sys/boot/uboot/lib/glue.h Sun May 24 15:29:56 2015 (r283409) @@ -40,7 +40,7 @@ void *syscall_ptr; int api_search_sig(struct api_signature **sig); -#define UB_MAX_MR 5 /* max mem regions number */ +#define UB_MAX_MR 16 /* max mem regions number */ #define UB_MAX_DEV 6 /* max devices number */ /* From owner-svn-src-stable@FreeBSD.ORG Sun May 24 17:16:31 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7C25AB0; Sun, 24 May 2015 17:16:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4E801A62; Sun, 24 May 2015 17:16:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OHGVH9013614; Sun, 24 May 2015 17:16:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OHGVxv013613; Sun, 24 May 2015 17:16:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505241716.t4OHGVxv013613@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 24 May 2015 17:16: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: r283457 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 17:16:32 -0000 Author: mav Date: Sun May 24 17:16:30 2015 New Revision: 283457 URL: https://svnweb.freebsd.org/changeset/base/283457 Log: MFC r282881: Do not promote large async writes to sync. Present implementation of large sync writes is too strict and so can be quite slow. Instead of doing that, execute large async write in chunks, syncing each chunk separately. It would be good to fix large sync writes too, but I leave it to somebody with more skills in this area. Modified: stable/10/sys/fs/nfsclient/nfs_clbio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clbio.c Sun May 24 17:09:07 2015 (r283456) +++ stable/10/sys/fs/nfsclient/nfs_clbio.c Sun May 24 17:16:30 2015 (r283457) @@ -875,7 +875,7 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount, noncontig_write, obcount; - int bp_cached, n, on, error = 0, error1; + int bp_cached, n, on, error = 0, error1, wouldcommit; size_t orig_resid, local_resid; off_t orig_size, tmp_off; @@ -919,7 +919,6 @@ ncl_write(struct vop_write_args *ap) if (ioflag & IO_NDELAY) return (EAGAIN); #endif -flush_and_restart: np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = ncl_vinvalbuf(vp, V_SAVE, td, 1); @@ -976,27 +975,14 @@ flush_and_restart: * IO_UNIT -- we just make all writes atomic anyway, as there's * no point optimizing for something that really won't ever happen. */ + wouldcommit = 0; if (!(ioflag & IO_SYNC)) { int nflag; mtx_lock(&np->n_mtx); nflag = np->n_flag; mtx_unlock(&np->n_mtx); - int needrestart = 0; - if (nmp->nm_wcommitsize < uio->uio_resid) { - /* - * If this request could not possibly be completed - * without exceeding the maximum outstanding write - * commit size, see if we can convert it into a - * synchronous write operation. - */ - if (ioflag & IO_NDELAY) - return (EAGAIN); - ioflag |= IO_SYNC; - if (nflag & NMODIFIED) - needrestart = 1; - } else if (nflag & NMODIFIED) { - int wouldcommit = 0; + if (nflag & NMODIFIED) { BO_LOCK(&vp->v_bufobj); if (vp->v_bufobj.bo_dirty.bv_cnt != 0) { TAILQ_FOREACH(bp, &vp->v_bufobj.bo_dirty.bv_hd, @@ -1006,27 +992,22 @@ flush_and_restart: } } BO_UNLOCK(&vp->v_bufobj); - /* - * Since we're not operating synchronously and - * bypassing the buffer cache, we are in a commit - * and holding all of these buffers whether - * transmitted or not. If not limited, this - * will lead to the buffer cache deadlocking, - * as no one else can flush our uncommitted buffers. - */ - wouldcommit += uio->uio_resid; - /* - * If we would initially exceed the maximum - * outstanding write commit size, flush and restart. - */ - if (wouldcommit > nmp->nm_wcommitsize) - needrestart = 1; } - if (needrestart) - goto flush_and_restart; } do { + if (!(ioflag & IO_SYNC)) { + wouldcommit += biosize; + if (wouldcommit > nmp->nm_wcommitsize) { + np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + error = ncl_vinvalbuf(vp, V_SAVE, td, 1); + if (error) + return (error); + wouldcommit = biosize; + } + } + NFSINCRGLOBAL(newnfsstats.biocache_writes); lbn = uio->uio_offset / biosize; on = uio->uio_offset - (lbn * biosize); From owner-svn-src-stable@FreeBSD.ORG Sun May 24 17:16:56 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C6E6BE6; Sun, 24 May 2015 17:16:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 098E71A67; Sun, 24 May 2015 17:16:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OHGtsn013719; Sun, 24 May 2015 17:16:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OHGtCh013718; Sun, 24 May 2015 17:16:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505241716.t4OHGtCh013718@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 24 May 2015 17:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r283458 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 17:16:56 -0000 Author: mav Date: Sun May 24 17:16:55 2015 New Revision: 283458 URL: https://svnweb.freebsd.org/changeset/base/283458 Log: MFC r282881: Do not promote large async writes to sync. Present implementation of large sync writes is too strict and so can be quite slow. Instead of doing that, execute large async write in chunks, syncing each chunk separately. It would be good to fix large sync writes too, but I leave it to somebody with more skills in this area. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Sun May 24 17:16:30 2015 (r283457) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Sun May 24 17:16:55 2015 (r283458) @@ -874,7 +874,7 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount, noncontig_write, obcount; - int bp_cached, n, on, error = 0, error1; + int bp_cached, n, on, error = 0, error1, wouldcommit; size_t orig_resid, local_resid; off_t orig_size, tmp_off; @@ -918,7 +918,6 @@ ncl_write(struct vop_write_args *ap) if (ioflag & IO_NDELAY) return (EAGAIN); #endif -flush_and_restart: np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = ncl_vinvalbuf(vp, V_SAVE, td, 1); @@ -975,27 +974,14 @@ flush_and_restart: * IO_UNIT -- we just make all writes atomic anyway, as there's * no point optimizing for something that really won't ever happen. */ + wouldcommit = 0; if (!(ioflag & IO_SYNC)) { int nflag; mtx_lock(&np->n_mtx); nflag = np->n_flag; mtx_unlock(&np->n_mtx); - int needrestart = 0; - if (nmp->nm_wcommitsize < uio->uio_resid) { - /* - * If this request could not possibly be completed - * without exceeding the maximum outstanding write - * commit size, see if we can convert it into a - * synchronous write operation. - */ - if (ioflag & IO_NDELAY) - return (EAGAIN); - ioflag |= IO_SYNC; - if (nflag & NMODIFIED) - needrestart = 1; - } else if (nflag & NMODIFIED) { - int wouldcommit = 0; + if (nflag & NMODIFIED) { BO_LOCK(&vp->v_bufobj); if (vp->v_bufobj.bo_dirty.bv_cnt != 0) { TAILQ_FOREACH(bp, &vp->v_bufobj.bo_dirty.bv_hd, @@ -1005,27 +991,22 @@ flush_and_restart: } } BO_UNLOCK(&vp->v_bufobj); - /* - * Since we're not operating synchronously and - * bypassing the buffer cache, we are in a commit - * and holding all of these buffers whether - * transmitted or not. If not limited, this - * will lead to the buffer cache deadlocking, - * as no one else can flush our uncommitted buffers. - */ - wouldcommit += uio->uio_resid; - /* - * If we would initially exceed the maximum - * outstanding write commit size, flush and restart. - */ - if (wouldcommit > nmp->nm_wcommitsize) - needrestart = 1; } - if (needrestart) - goto flush_and_restart; } do { + if (!(ioflag & IO_SYNC)) { + wouldcommit += biosize; + if (wouldcommit > nmp->nm_wcommitsize) { + np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + error = ncl_vinvalbuf(vp, V_SAVE, td, 1); + if (error) + return (error); + wouldcommit = biosize; + } + } + NFSINCRGLOBAL(newnfsstats.biocache_writes); lbn = uio->uio_offset / biosize; on = uio->uio_offset & (biosize-1); From owner-svn-src-stable@FreeBSD.ORG Sun May 24 17:51:59 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73174C50; Sun, 24 May 2015 17:51:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F33A1E95; Sun, 24 May 2015 17:51:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OHpx38034894; Sun, 24 May 2015 17:51:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OHpwq8034885; Sun, 24 May 2015 17:51:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241751.t4OHpwq8034885@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 17:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283477 - in stable/10/sys: conf dev/fdt dev/ofw 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 17:51:59 -0000 Author: ian Date: Sun May 24 17:51:57 2015 New Revision: 283477 URL: https://svnweb.freebsd.org/changeset/base/283477 Log: MFC r279368, r280772, r280848: Allow creating subclass of FDT simplebus Make simplebus a base class of ofwbus. Fix bug in xrefinfo_find() for 64-bit platforms Added: stable/10/sys/dev/fdt/simplebus.h - copied, changed from r279368, head/sys/dev/fdt/simplebus.h Modified: stable/10/sys/conf/files.powerpc stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/ofw/ofwbus.c stable/10/sys/dev/ofw/openfirm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Sun May 24 17:49:09 2015 (r283476) +++ stable/10/sys/conf/files.powerpc Sun May 24 17:51:57 2015 (r283477) @@ -29,6 +29,8 @@ dev/adb/adb_buttons.c optional adb dev/agp/agp_apple.c optional agp powermac dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt +# ofwbus depends on simplebus. +dev/fdt/simplebus.c optional aim | fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc dev/hwpmc/hwpmc_ppc970.c optional hwpmc Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Sun May 24 17:49:09 2015 (r283476) +++ stable/10/sys/dev/fdt/simplebus.c Sun May 24 17:51:57 2015 (r283477) @@ -38,26 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct simplebus_range { - uint64_t bus; - uint64_t host; - uint64_t size; -}; - -struct simplebus_softc { - device_t dev; - phandle_t node; - - struct simplebus_range *ranges; - int nranges; - - pcell_t acells, scells; -}; - -struct simplebus_devinfo { - struct ofw_bus_devinfo obdinfo; - struct resource_list rl; -}; +#include /* * Bus interface. @@ -68,7 +49,10 @@ static struct resource *simplebus_alloc_ int *, u_long, u_long, u_long, u_int); static void simplebus_probe_nomatch(device_t bus, device_t child); static int simplebus_print_child(device_t bus, device_t child); - +static device_t simplebus_add_child(device_t dev, u_int order, + const char *name, int unit); +static struct resource_list *simplebus_get_resource_list(device_t bus, + device_t child); /* * ofw_bus interface */ @@ -81,8 +65,6 @@ static const struct ofw_bus_devinfo *sim static int simplebus_fill_ranges(phandle_t node, struct simplebus_softc *sc); -static struct simplebus_devinfo *simplebus_setup_dinfo(device_t dev, - phandle_t node); /* * Driver methods. @@ -91,10 +73,17 @@ static device_method_t simplebus_methods /* Device interface */ DEVMETHOD(device_probe, simplebus_probe), DEVMETHOD(device_attach, simplebus_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ + DEVMETHOD(bus_add_child, simplebus_add_child), DEVMETHOD(bus_print_child, simplebus_print_child), DEVMETHOD(bus_probe_nomatch, simplebus_probe_nomatch), + DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), + DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, simplebus_alloc_resource), @@ -102,7 +91,10 @@ static device_method_t simplebus_methods DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, simplebus_get_devinfo), @@ -115,11 +107,9 @@ static device_method_t simplebus_methods DEVMETHOD_END }; -static driver_t simplebus_driver = { - "simplebus", - simplebus_methods, - sizeof(struct simplebus_softc) -}; +DEFINE_CLASS_0(simplebus, simplebus_driver, simplebus_methods, + sizeof(struct simplebus_softc)); + static devclass_t simplebus_devclass; EARLY_DRIVER_MODULE(simplebus, ofwbus, simplebus_driver, simplebus_devclass, 0, 0, BUS_PASS_BUS); @@ -153,13 +143,33 @@ static int simplebus_attach(device_t dev) { struct simplebus_softc *sc; - struct simplebus_devinfo *di; phandle_t node; - device_t cdev; - node = ofw_bus_get_node(dev); sc = device_get_softc(dev); + simplebus_init(dev, 0); + if (simplebus_fill_ranges(sc->node, sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + /* + * In principle, simplebus could have an interrupt map, but ignore that + * for now + */ + + for (node = OF_child(sc->node); node > 0; node = OF_peer(node)) + simplebus_add_device(dev, node, 0, NULL, -1, NULL); + return (bus_generic_attach(dev)); +} + +void +simplebus_init(device_t dev, phandle_t node) +{ + struct simplebus_softc *sc; + + sc = device_get_softc(dev); + if (node == 0) + node = ofw_bus_get_node(dev); sc->dev = dev; sc->node = node; @@ -170,33 +180,6 @@ simplebus_attach(device_t dev) OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); sc->scells = 1; OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); - - if (simplebus_fill_ranges(node, sc) < 0) { - device_printf(dev, "could not get ranges\n"); - return (ENXIO); - } - - /* - * In principle, simplebus could have an interrupt map, but ignore that - * for now - */ - - for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if ((di = simplebus_setup_dinfo(dev, node)) == NULL) - continue; - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - di->obdinfo.obd_name); - resource_list_free(&di->rl); - ofw_bus_gen_destroy_devinfo(&di->obdinfo); - free(di, M_DEVBUF); - continue; - } - device_set_ivars(cdev, di); - } - - return (bus_generic_attach(dev)); } static int @@ -248,17 +231,21 @@ simplebus_fill_ranges(phandle_t node, st return (sc->nranges); } -static struct simplebus_devinfo * -simplebus_setup_dinfo(device_t dev, phandle_t node) +struct simplebus_devinfo * +simplebus_setup_dinfo(device_t dev, phandle_t node, + struct simplebus_devinfo *di) { struct simplebus_softc *sc; struct simplebus_devinfo *ndi; sc = device_get_softc(dev); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + if (di == NULL) + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + else + ndi = di; if (ofw_bus_gen_setup_devinfo(&ndi->obdinfo, node) != 0) { - free(ndi, M_DEVBUF); + if (di == NULL) + free(ndi, M_DEVBUF); return (NULL); } @@ -269,6 +256,48 @@ simplebus_setup_dinfo(device_t dev, phan return (ndi); } +device_t +simplebus_add_device(device_t dev, phandle_t node, u_int order, + const char *name, int unit, struct simplebus_devinfo *di) +{ + struct simplebus_devinfo *ndi; + device_t cdev; + + if ((ndi = simplebus_setup_dinfo(dev, node, di)) == NULL) + return (NULL); + cdev = device_add_child_ordered(dev, order, name, unit); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + ndi->obdinfo.obd_name); + resource_list_free(&ndi->rl); + ofw_bus_gen_destroy_devinfo(&ndi->obdinfo); + if (di == NULL) + free(ndi, M_DEVBUF); + return (NULL); + } + device_set_ivars(cdev, ndi); + + return(cdev); +} + +static device_t +simplebus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t cdev; + struct simplebus_devinfo *ndi; + + cdev = device_add_child_ordered(dev, order, name, unit); + if (cdev == NULL) + return (NULL); + + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + ndi->obdinfo.obd_node = -1; + resource_list_init(&ndi->rl); + device_set_ivars(cdev, ndi); + + return (cdev); +} + static const struct ofw_bus_devinfo * simplebus_get_devinfo(device_t bus __unused, device_t child) { @@ -278,6 +307,15 @@ simplebus_get_devinfo(device_t bus __unu return (&ndi->obdinfo); } +static struct resource_list * +simplebus_get_resource_list(device_t bus __unused, device_t child) +{ + struct simplebus_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->rl); +} + static struct resource * simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -356,9 +394,11 @@ simplebus_probe_nomatch(device_t bus, de if (!bootverbose) return; + compat = ofw_bus_get_compat(child); + if (compat == NULL) + return; name = ofw_bus_get_name(child); type = ofw_bus_get_type(child); - compat = ofw_bus_get_compat(child); device_printf(bus, "<%s>", name != NULL ? name : "unknown"); simplebus_print_res(device_get_ivars(child)); @@ -366,9 +406,7 @@ simplebus_probe_nomatch(device_t bus, de printf(" disabled"); if (type) printf(" type %s", type); - if (compat) - printf(" compat %s", compat); - printf(" (no driver attached)\n"); + printf(" compat %s (no driver attached)\n", compat); } static int Copied and modified: stable/10/sys/dev/fdt/simplebus.h (from r279368, head/sys/dev/fdt/simplebus.h) ============================================================================== --- head/sys/dev/fdt/simplebus.h Fri Feb 27 20:11:02 2015 (r279368, copy source) +++ stable/10/sys/dev/fdt/simplebus.h Sun May 24 17:51:57 2015 (r283477) @@ -26,8 +26,10 @@ * $FreeBSD$ */ -#ifndef _FDT_SIMPLEBUS_PRIVATE_H -#define _FDT_SIMPLEBUS_PRIVATE_H +#ifndef _FDT_SIMPLEBUS_H +#define _FDT_SIMPLEBUS_H + +#include /* FDT simplebus */ DECLARE_CLASS(simplebus_driver); @@ -53,4 +55,10 @@ struct simplebus_devinfo { struct ofw_bus_devinfo obdinfo; struct resource_list rl; }; -#endif /* _FDT_SIMPLEBUS_PRIVATE_H */ + +void simplebus_init(device_t dev, phandle_t node); +device_t simplebus_add_device(device_t dev, phandle_t node, u_int order, + const char *name, int unit, struct simplebus_devinfo *di); +struct simplebus_devinfo *simplebus_setup_dinfo(device_t dev, phandle_t node, + struct simplebus_devinfo *di); +#endif /* _FDT_SIMPLEBUS_H */ Modified: stable/10/sys/dev/ofw/ofwbus.c ============================================================================== --- stable/10/sys/dev/ofw/ofwbus.c Sun May 24 17:49:09 2015 (r283476) +++ stable/10/sys/dev/ofw/ofwbus.c Sun May 24 17:51:57 2015 (r283477) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -62,13 +63,8 @@ __FBSDID("$FreeBSD$"); * */ -struct ofwbus_devinfo { - struct ofw_bus_devinfo ndi_obdinfo; - struct resource_list ndi_rl; -}; - struct ofwbus_softc { - uint32_t acells, scells; + struct simplebus_softc simplebus_sc; struct rman sc_intr_rman; struct rman sc_mem_rman; }; @@ -76,113 +72,31 @@ struct ofwbus_softc { static device_identify_t ofwbus_identify; static device_probe_t ofwbus_probe; static device_attach_t ofwbus_attach; -static bus_print_child_t ofwbus_print_child; -static bus_add_child_t ofwbus_add_child; -static bus_probe_nomatch_t ofwbus_probe_nomatch; static bus_alloc_resource_t ofwbus_alloc_resource; static bus_adjust_resource_t ofwbus_adjust_resource; static bus_release_resource_t ofwbus_release_resource; -static bus_get_resource_list_t ofwbus_get_resource_list; -static ofw_bus_get_devinfo_t ofwbus_get_devinfo; - -static int ofwbus_inlist(const char *, const char *const *); -static struct ofwbus_devinfo * ofwbus_setup_dinfo(device_t, phandle_t); -static void ofwbus_destroy_dinfo(struct ofwbus_devinfo *); -static int ofwbus_print_res(struct ofwbus_devinfo *); static device_method_t ofwbus_methods[] = { /* Device interface */ DEVMETHOD(device_identify, ofwbus_identify), DEVMETHOD(device_probe, ofwbus_probe), DEVMETHOD(device_attach, ofwbus_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, ofwbus_print_child), - DEVMETHOD(bus_probe_nomatch, ofwbus_probe_nomatch), - DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), - DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), - DEVMETHOD(bus_add_child, ofwbus_add_child), - DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), DEVMETHOD(bus_alloc_resource, ofwbus_alloc_resource), DEVMETHOD(bus_adjust_resource, ofwbus_adjust_resource), DEVMETHOD(bus_release_resource, ofwbus_release_resource), - DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_get_resource_list, ofwbus_get_resource_list), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_config_intr, bus_generic_config_intr), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - - /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, ofwbus_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), DEVMETHOD_END }; -static driver_t ofwbus_driver = { - "ofwbus", - ofwbus_methods, - sizeof(struct ofwbus_softc) -}; +DEFINE_CLASS_1(ofwbus, ofwbus_driver, ofwbus_methods, + sizeof(struct ofwbus_softc), simplebus_driver); static devclass_t ofwbus_devclass; EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, ofwbus_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(ofwbus, 1); -static const char *const ofwbus_excl_name[] = { - "FJSV,system", - "aliases", - "associations", - "chosen", - "cmp", - "counter-timer", /* No separate device; handled by psycho/sbus */ - "failsafe", - "memory", - "openprom", - "options", - "packages", - "physical-memory", - "rsc", - "sgcn", - "todsg", - "virtual-memory", - NULL -}; - -static const char *const ofwbus_excl_type[] = { - "core", - "cpu", - NULL -}; - -static int -ofwbus_inlist(const char *name, const char *const *list) -{ - int i; - - if (name == NULL) - return (0); - for (i = 0; list[i] != NULL; i++) - if (strcmp(name, list[i]) == 0) - return (1); - return (0); -} - -#define OFWBUS_EXCLUDED(name, type) \ - (ofwbus_inlist((name), ofwbus_excl_name) || \ - ((type) != NULL && ofwbus_inlist((type), ofwbus_excl_type))) - static void ofwbus_identify(driver_t *driver, device_t parent) { @@ -190,7 +104,7 @@ ofwbus_identify(driver_t *driver, device /* Check if Open Firmware has been instantiated */ if (OF_peer(0) == -1) return; - + if (device_find_child(parent, "ofwbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "ofwbus", -1); } @@ -206,10 +120,9 @@ ofwbus_probe(device_t dev) static int ofwbus_attach(device_t dev) { - struct ofwbus_devinfo *ndi; struct ofwbus_softc *sc; - device_t cdev; phandle_t node; + struct ofw_bus_devinfo obd; sc = device_get_softc(dev); @@ -221,6 +134,11 @@ ofwbus_attach(device_t dev) if (node == -1) return (ENXIO); + /* + * ofwbus bus starts on unamed node in FDT, so we cannot make + * ofw_bus_devinfo from it. Pass node to simplebus_init directly. + */ + simplebus_init(dev, node); sc->sc_intr_rman.rm_type = RMAN_ARRAY; sc->sc_intr_rman.rm_descr = "Interrupts"; sc->sc_mem_rman.rm_type = RMAN_ARRAY; @@ -237,78 +155,16 @@ ofwbus_attach(device_t dev) bus_generic_probe(dev); /* - * Some important numbers - */ - sc->acells = 2; - OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); - sc->scells = 1; - OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); - - /* * Now walk the OFW tree and attach top-level devices. */ for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if ((ndi = ofwbus_setup_dinfo(dev, node)) == NULL) + if (ofw_bus_gen_setup_devinfo(&obd, node) != 0) continue; - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - ndi->ndi_obdinfo.obd_name); - ofwbus_destroy_dinfo(ndi); - continue; - } - device_set_ivars(cdev, ndi); + simplebus_add_device(dev, node, 0, NULL, -1, NULL); } return (bus_generic_attach(dev)); } -static device_t -ofwbus_add_child(device_t dev, u_int order, const char *name, int unit) -{ - device_t cdev; - struct ofwbus_devinfo *ndi; - - cdev = device_add_child_ordered(dev, order, name, unit); - if (cdev == NULL) - return (NULL); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); - ndi->ndi_obdinfo.obd_node = -1; - resource_list_init(&ndi->ndi_rl); - device_set_ivars(cdev, ndi); - - return (cdev); -} - -static int -ofwbus_print_child(device_t bus, device_t child) -{ - int rv; - - rv = bus_print_child_header(bus, child); - rv += ofwbus_print_res(device_get_ivars(child)); - rv += bus_print_child_footer(bus, child); - return (rv); -} - -static void -ofwbus_probe_nomatch(device_t bus, device_t child) -{ - const char *name, *type; - - if (!bootverbose) - return; - - name = ofw_bus_get_name(child); - type = ofw_bus_get_type(child); - - device_printf(bus, "<%s>", - name != NULL ? name : "unknown"); - ofwbus_print_res(device_get_ivars(child)); - printf(" type %s (no driver attached)\n", - type != NULL ? type : "unknown"); -} - static struct resource * ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -323,14 +179,15 @@ ofwbus_alloc_resource(device_t bus, devi passthrough = (device_get_parent(child) != bus); sc = device_get_softc(bus); rle = NULL; - if (!passthrough && isdefault) { rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, *rid); - if (rle == NULL) + if (rle == NULL) { + if (bootverbose) + device_printf(bus, "no default resources for " + "rid = %d, type = %d\n", *rid, type); return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); + } start = rle->start; count = ulmax(count, rle->count); end = ulmax(rle->end, start + count - 1); @@ -417,72 +274,3 @@ ofwbus_release_resource(device_t bus, de } return (rman_release_resource(r)); } - -static struct resource_list * -ofwbus_get_resource_list(device_t bus __unused, device_t child) -{ - struct ofwbus_devinfo *ndi; - - ndi = device_get_ivars(child); - return (&ndi->ndi_rl); -} - -static const struct ofw_bus_devinfo * -ofwbus_get_devinfo(device_t bus __unused, device_t child) -{ - struct ofwbus_devinfo *ndi; - - ndi = device_get_ivars(child); - return (&ndi->ndi_obdinfo); -} - -static struct ofwbus_devinfo * -ofwbus_setup_dinfo(device_t dev, phandle_t node) -{ - struct ofwbus_softc *sc; - struct ofwbus_devinfo *ndi; - const char *nodename; - - sc = device_get_softc(dev); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&ndi->ndi_obdinfo, node) != 0) { - free(ndi, M_DEVBUF); - return (NULL); - } - nodename = ndi->ndi_obdinfo.obd_name; - if (OFWBUS_EXCLUDED(nodename, ndi->ndi_obdinfo.obd_type)) { - ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); - free(ndi, M_DEVBUF); - return (NULL); - } - - resource_list_init(&ndi->ndi_rl); - ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &ndi->ndi_rl); - ofw_bus_intr_to_rl(dev, node, &ndi->ndi_rl); - - return (ndi); -} - -static void -ofwbus_destroy_dinfo(struct ofwbus_devinfo *ndi) -{ - - resource_list_free(&ndi->ndi_rl); - ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); - free(ndi, M_DEVBUF); -} - -static int -ofwbus_print_res(struct ofwbus_devinfo *ndi) -{ - int rv; - - rv = 0; - rv += resource_list_print_type(&ndi->ndi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&ndi->ndi_rl, "irq", SYS_RES_IRQ, - "%ld"); - return (rv); -} - Modified: stable/10/sys/dev/ofw/openfirm.c ============================================================================== --- stable/10/sys/dev/ofw/openfirm.c Sun May 24 17:49:09 2015 (r283476) +++ stable/10/sys/dev/ofw/openfirm.c Sun May 24 17:51:57 2015 (r283477) @@ -154,16 +154,16 @@ xrefinfo_init(void *unsed) SYSINIT(xrefinfo, SI_SUB_KMEM, SI_ORDER_ANY, xrefinfo_init, NULL); static struct xrefinfo * -xrefinfo_find(phandle_t phandle, int find_by) +xrefinfo_find(uintptr_t key, int find_by) { struct xrefinfo *rv, *xi; rv = NULL; mtx_lock(&xreflist_lock); SLIST_FOREACH(xi, &xreflist, next_entry) { - if ((find_by == FIND_BY_XREF && phandle == xi->xref) || - (find_by == FIND_BY_NODE && phandle == xi->node) || - (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev)) { + if ((find_by == FIND_BY_XREF && (phandle_t)key == xi->xref) || + (find_by == FIND_BY_NODE && (phandle_t)key == xi->node) || + (find_by == FIND_BY_DEV && key == (uintptr_t)xi->dev)) { rv = xi; break; } From owner-svn-src-stable@FreeBSD.ORG Sun May 24 17:57:31 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E69DF330; Sun, 24 May 2015 17:57:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3C1C1ED5; Sun, 24 May 2015 17:57:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OHvUgQ035936; Sun, 24 May 2015 17:57:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OHvUqj035933; Sun, 24 May 2015 17:57:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241757.t4OHvUqj035933@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 17:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283481 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 17:57:31 -0000 Author: ian Date: Sun May 24 17:57:29 2015 New Revision: 283481 URL: https://svnweb.freebsd.org/changeset/base/283481 Log: MFC r281073, r281074, r281077, r281200: Use OF_getencprop over OF_getprop and fdt32_to_cpu. The latter may give us the wrong data in the failure case if shift was not zero. Remove the extra copy of uart_fdt_get_clock and uart_fdt_get_shift. While here also use OF_getencprop in uart_fdt_get_clock. Move uart_fdt_get_clock and uart_fdt_get_shift to uart_bus_fdt.c, we may not build uart_cpu_fdt.c in all configs. Fix uart_fdt_get_clock. It should have been using the cell variable passed in, not value on the stack. Modified: stable/10/sys/dev/uart/uart_bus_fdt.c stable/10/sys/dev/uart/uart_cpu_fdt.c stable/10/sys/dev/uart/uart_cpu_fdt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_fdt.c Sun May 24 17:57:07 2015 (r283480) +++ stable/10/sys/dev/uart/uart_bus_fdt.c Sun May 24 17:57:29 2015 (r283481) @@ -63,37 +63,29 @@ static driver_t uart_fdt_driver = { sizeof(struct uart_softc), }; -static int +int uart_fdt_get_clock(phandle_t node, pcell_t *cell) { - pcell_t clock; - - /* - * clock-frequency is a FreeBSD-specific hack. Make its presence optional. - */ - if ((OF_getprop(node, "clock-frequency", &clock, - sizeof(clock))) <= 0) - clock = 0; - if (clock == 0) + /* clock-frequency is a FreeBSD-only extention. */ + if ((OF_getencprop(node, "clock-frequency", cell, + sizeof(*cell))) <= 0) { /* Try to retrieve parent 'bus-frequency' */ /* XXX this should go to simple-bus fixup or so */ - if ((OF_getprop(OF_parent(node), "bus-frequency", &clock, - sizeof(clock))) <= 0) - clock = 0; + if ((OF_getencprop(OF_parent(node), "bus-frequency", cell, + sizeof(*cell))) <= 0) + *cell = 0; + } - *cell = fdt32_to_cpu(clock); return (0); } -static int +int uart_fdt_get_shift(phandle_t node, pcell_t *cell) { - pcell_t shift; - if ((OF_getprop(node, "reg-shift", &shift, sizeof(shift))) <= 0) - shift = 0; - *cell = fdt32_to_cpu(shift); + if ((OF_getencprop(node, "reg-shift", cell, sizeof(*cell))) <= 0) + *cell = 0; return (0); } Modified: stable/10/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_cpu_fdt.c Sun May 24 17:57:07 2015 (r283480) +++ stable/10/sys/dev/uart/uart_cpu_fdt.c Sun May 24 17:57:29 2015 (r283481) @@ -58,38 +58,6 @@ __FBSDID("$FreeBSD$"); bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; -static int -uart_fdt_get_clock(phandle_t node, pcell_t *cell) -{ - pcell_t clock; - - /* clock-frequency is a FreeBSD-only extention. */ - if ((OF_getprop(node, "clock-frequency", &clock, - sizeof(clock))) <= 0) - clock = 0; - - if (clock == 0) - /* Try to retrieve parent 'bus-frequency' */ - /* XXX this should go to simple-bus fixup or so */ - if ((OF_getprop(OF_parent(node), "bus-frequency", &clock, - sizeof(clock))) <= 0) - clock = 0; - - *cell = fdt32_to_cpu(clock); - return (0); -} - -static int -uart_fdt_get_shift(phandle_t node, pcell_t *cell) -{ - pcell_t shift; - - if ((OF_getprop(node, "reg-shift", &shift, sizeof(shift))) <= 0) - shift = 0; - *cell = fdt32_to_cpu(shift); - return (0); -} - int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { Modified: stable/10/sys/dev/uart/uart_cpu_fdt.h ============================================================================== --- stable/10/sys/dev/uart/uart_cpu_fdt.h Sun May 24 17:57:07 2015 (r283480) +++ stable/10/sys/dev/uart/uart_cpu_fdt.h Sun May 24 17:57:29 2015 (r283481) @@ -50,5 +50,7 @@ SET_DECLARE(uart_fdt_class_set, struct o #define UART_FDT_CLASS(data) \ DATA_SET(uart_fdt_class_set, data) +int uart_fdt_get_clock(phandle_t node, pcell_t *cell); +int uart_fdt_get_shift(phandle_t node, pcell_t *cell); #endif /* _DEV_UART_CPU_FDT_H_ */ From owner-svn-src-stable@FreeBSD.ORG Sun May 24 18:00:30 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F83A896; Sun, 24 May 2015 18:00:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC641FB9; Sun, 24 May 2015 18:00:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OI0UJC036757; Sun, 24 May 2015 18:00:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OI0U5D036756; Sun, 24 May 2015 18:00:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241800.t4OI0U5D036756@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 18:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283485 - stable/10/sys/dev/fdt 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 18:00:30 -0000 Author: ian Date: Sun May 24 18:00:29 2015 New Revision: 283485 URL: https://svnweb.freebsd.org/changeset/base/283485 Log: MFC r281371: Use OF_getencpropalloc() to handle endianess of the properties. Modified: stable/10/sys/dev/fdt/fdt_pinctrl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/fdt/fdt_pinctrl.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_pinctrl.c Sun May 24 18:00:14 2015 (r283484) +++ stable/10/sys/dev/fdt/fdt_pinctrl.c Sun May 24 18:00:29 2015 (r283485) @@ -46,7 +46,7 @@ fdt_pinctrl_configure(device_t client, u char name[16]; snprintf(name, sizeof(name), "pinctrl-%u", index); - nconfigs = OF_getprop_alloc(ofw_bus_get_node(client), name, + nconfigs = OF_getencprop_alloc(ofw_bus_get_node(client), name, sizeof(*configs), (void **)&configs); if (nconfigs < 0) return (ENOENT); @@ -122,12 +122,12 @@ pinctrl_configure_children(device_t pinc if (!fdt_is_enabled(node)) continue; pinctrl_configure_children(pinctrl, node); - nconfigs = OF_getencprop_alloc(node, "pinctrl-0", + nconfigs = OF_getencprop_alloc(node, "pinctrl-0", sizeof(*configs), (void **)&configs); if (nconfigs <= 0) continue; if (bootverbose) { - char name[32]; + char name[32]; OF_getprop(node, "name", &name, sizeof(name)); printf("Processing %d pin-config node(s) in pinctrl-0 for %s\n", nconfigs, name); From owner-svn-src-stable@FreeBSD.ORG Sun May 24 18:23:58 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CA8028B; Sun, 24 May 2015 18:23:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AA061243; Sun, 24 May 2015 18:23:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OINw1e051991; Sun, 24 May 2015 18:23:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OINwl3051989; Sun, 24 May 2015 18:23:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241823.t4OINwl3051989@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 18:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283499 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 18:23:58 -0000 Author: ian Date: Sun May 24 18:23:57 2015 New Revision: 283499 URL: https://svnweb.freebsd.org/changeset/base/283499 Log: MFC r282418: On an icache sync by address/len, round the length up if the operation spans a cacheline boundary. Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sun May 24 18:14:38 2015 (r283498) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sun May 24 18:23:57 2015 (r283499) @@ -266,6 +266,9 @@ END(armv7_icache_sync_all) ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_icache_line_size ldr ip, [ip] + sub r3, ip, #1 /* Address need not be aligned, but */ + and r2, r0, r3 /* round length up if op spans line */ + add r1, r1, r2 /* boundary: len += addr & linemask; */ .Larmv7_sync_next: mcr CP15_DCCMVAC(r0) mcr CP15_ICIMVAU(r0) From owner-svn-src-stable@FreeBSD.ORG Sun May 24 18:59:48 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8128C74A; Sun, 24 May 2015 18:59:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9B315E9; Sun, 24 May 2015 18:59:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OIxmcC071797; Sun, 24 May 2015 18:59:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OIxjIQ071786; Sun, 24 May 2015 18:59:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241859.t4OIxjIQ071786@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 18:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283500 - in stable/10/sys: arm/conf arm/freescale/imx boot/fdt/dts/arm 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 18:59:48 -0000 Author: ian Date: Sun May 24 18:59:45 2015 New Revision: 283500 URL: https://svnweb.freebsd.org/changeset/base/283500 Log: MFC r268838, r277644: Add support for Toradex Apalis i.MX6 development board. Add support for imx6 audio transmitting, include drivers for: o Digital Audio Multiplexer (AUDMUX) o Smart Direct Memory Access Controller (SDMA) o Synchronous Serial Interface (SSI) Added: stable/10/sys/arm/conf/APALIS-IMX6 - copied, changed from r268838, head/sys/arm/conf/APALIS-IMX6 stable/10/sys/arm/freescale/imx/imx6_audmux.c - copied unchanged from r277644, head/sys/arm/freescale/imx/imx6_audmux.c stable/10/sys/arm/freescale/imx/imx6_sdma.c - copied unchanged from r277644, head/sys/arm/freescale/imx/imx6_sdma.c stable/10/sys/arm/freescale/imx/imx6_sdma.h - copied unchanged from r277644, head/sys/arm/freescale/imx/imx6_sdma.h stable/10/sys/arm/freescale/imx/imx6_ssi.c - copied unchanged from r277644, head/sys/arm/freescale/imx/imx6_ssi.c stable/10/sys/boot/fdt/dts/arm/apalis-imx6.dts - copied, changed from r268838, head/sys/boot/fdt/dts/arm/apalis-imx6.dts Modified: stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx6_anatopreg.h stable/10/sys/arm/freescale/imx/imx6_anatopvar.h stable/10/sys/arm/freescale/imx/imx6_ccm.c stable/10/sys/arm/freescale/imx/imx6_ccmreg.h stable/10/sys/arm/freescale/imx/imx_ccmvar.h stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Directory Properties: stable/10/ (props changed) Copied and modified: stable/10/sys/arm/conf/APALIS-IMX6 (from r268838, head/sys/arm/conf/APALIS-IMX6) ============================================================================== --- head/sys/arm/conf/APALIS-IMX6 Fri Jul 18 08:23:53 2014 (r268838, copy source) +++ stable/10/sys/arm/conf/APALIS-IMX6 Sun May 24 18:59:45 2015 (r283500) @@ -19,13 +19,13 @@ #NO_UNIVERSE -include "IMX6" +include "IMX6" ident APALIS-IMX6 makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" # Flattened Device Tree -options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=apalis-imx6.dts +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=apalis-imx6.dts Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Sun May 24 18:23:57 2015 (r283499) +++ stable/10/sys/arm/freescale/imx/files.imx6 Sun May 24 18:59:45 2015 (r283500) @@ -28,6 +28,9 @@ arm/freescale/imx/imx_machdep.c standar arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio arm/freescale/imx/imx_i2c.c optional fsliic +arm/freescale/imx/imx6_sdma.c optional sdma +arm/freescale/imx/imx6_audmux.c optional sound +arm/freescale/imx/imx6_ssi.c optional sound # # Optional devices. @@ -52,3 +55,19 @@ arm/freescale/imx/imx6_usbphy.c optiona # Not ready yet... # #arm/freescale/imx/imx51_ipuv3.c optional sc + +# SDMA firmware +sdma_fw.c optional sdma_fw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk sdma-imx6q-to1.bin:sdma_fw -msdma -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "sdma_fw.c" +sdma-imx6q-to1.fwo optional sdma_fw \ + dependency "sdma-imx6q-to1.bin" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} sdma-imx6q-to1.bin" \ + no-implicit-rule \ + clean "sdma-imx6q-to1.fwo" +sdma-imx6q-to1.bin optional sdma_fw \ + dependency "$S/contrib/dev/imx/sdma-imx6q-to1.bin.uu" \ + compile-with "uudecode < $S/contrib/dev/imx/sdma-imx6q-to1.bin.uu" \ + no-obj no-implicit-rule \ + clean "sdma-imx6q-to1.bin" Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun May 24 18:23:57 2015 (r283499) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun May 24 18:59:45 2015 (r283500) @@ -713,6 +713,27 @@ out: return (err); } +uint32_t +pll4_configure_output(uint32_t mfi, uint32_t mfn, uint32_t mfd) +{ + int reg; + + /* + * Audio PLL (PLL4). + * PLL output frequency = Fref * (DIV_SELECT + NUM/DENOM) + */ + + reg = (IMX6_ANALOG_CCM_PLL_AUDIO_ENABLE); + reg &= ~(IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_MASK << \ + IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_SHIFT); + reg |= (mfi << IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_SHIFT); + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_AUDIO, reg); + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_AUDIO_NUM, mfn); + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_AUDIO_DENOM, mfd); + + return (0); +} + static int imx6_anatop_probe(device_t dev) { Modified: stable/10/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Sun May 24 18:23:57 2015 (r283499) +++ stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Sun May 24 18:59:45 2015 (r283500) @@ -58,6 +58,9 @@ #define IMX6_ANALOG_CCM_PLL_SYS_NUM 0x050 #define IMX6_ANALOG_CCM_PLL_SYS_DENOM 0x060 #define IMX6_ANALOG_CCM_PLL_AUDIO 0x070 +#define IMX6_ANALOG_CCM_PLL_AUDIO_ENABLE (1 << 13) +#define IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_SHIFT 0 +#define IMX6_ANALOG_CCM_PLL_AUDIO_DIV_SELECT_MASK 0x7f #define IMX6_ANALOG_CCM_PLL_AUDIO_SET 0x074 #define IMX6_ANALOG_CCM_PLL_AUDIO_CLR 0x078 #define IMX6_ANALOG_CCM_PLL_AUDIO_TOG 0x07C Modified: stable/10/sys/arm/freescale/imx/imx6_anatopvar.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatopvar.h Sun May 24 18:23:57 2015 (r283499) +++ stable/10/sys/arm/freescale/imx/imx6_anatopvar.h Sun May 24 18:59:45 2015 (r283500) @@ -42,4 +42,6 @@ void imx6_anatop_write_4(bus_size_t _off uint32_t imx6_get_cpu_clock(void); +uint32_t pll4_configure_output(uint32_t mfi, uint32_t mfn, uint32_t mfd); + #endif Copied: stable/10/sys/arm/freescale/imx/imx6_audmux.c (from r277644, head/sys/arm/freescale/imx/imx6_audmux.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_audmux.c Sun May 24 18:59:45 2015 (r283500, copy of r277644, head/sys/arm/freescale/imx/imx6_audmux.c) @@ -0,0 +1,159 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * i.MX6 Digital Audio Multiplexer (AUDMUX) + * Chapter 16, i.MX 6Dual/6Quad Applications Processor Reference Manual, + * Rev. 1, 04/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) + +#define AUDMUX_PTCR(n) (0x8 * (n - 1)) /* Port Timing Control Register */ +#define PTCR_TFS_DIR (1 << 31) /* Transmit Frame Sync Direction Control */ +#define PTCR_TFSEL_S 27 /* Transmit Frame Sync Select */ +#define PTCR_TFSEL_M 0xf +#define PTCR_TCLKDIR (1 << 26) /* Transmit Clock Direction Control */ +#define PTCR_TCSEL_S 22 /* Transmit Clock Select. */ +#define PTCR_TCSEL_M 0xf +#define PTCR_RFS_DIR (1 << 21) /* Receive Frame Sync Direction Control */ +#define PTCR_SYN (1 << 11) +#define AUDMUX_PDCR(n) (0x8 * (n - 1) + 0x4) /* Port Data Control Reg */ +#define PDCR_RXDSEL_S 13 /* Receive Data Select */ +#define PDCR_RXDSEL_M 0x3 +#define PDCR_RXDSEL_PORT(n) (n - 1) + +struct audmux_softc { + struct resource *res[1]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih; +}; + +static struct resource_spec audmux_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +audmux_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,imx6q-audmux")) + return (ENXIO); + + device_set_desc(dev, "i.MX6 Digital Audio Multiplexer"); + return (BUS_PROBE_DEFAULT); +} + +static int +audmux_configure(struct audmux_softc *sc, + int ssi_port, int audmux_port) +{ + uint32_t reg; + + /* Direction: output */ + reg = (PTCR_TFS_DIR | PTCR_TCLKDIR | PTCR_SYN); + WRITE4(sc, AUDMUX_PTCR(audmux_port), reg); + + /* Select source */ + reg = (PDCR_RXDSEL_PORT(ssi_port) << PDCR_RXDSEL_S); + WRITE4(sc, AUDMUX_PDCR(audmux_port), reg); + + return (0); +} + +static int +audmux_attach(device_t dev) +{ + struct audmux_softc *sc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, audmux_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* + * Direct SSI1 output to AUDMUX5 pins. + * TODO: dehardcore this. + */ + audmux_configure(sc, 1, 5); + + return (0); +}; + +static device_method_t audmux_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, audmux_probe), + DEVMETHOD(device_attach, audmux_attach), + { 0, 0 } +}; + +static driver_t audmux_driver = { + "audmux", + audmux_methods, + sizeof(struct audmux_softc), +}; + +static devclass_t audmux_devclass; + +DRIVER_MODULE(audmux, simplebus, audmux_driver, audmux_devclass, 0, 0); Modified: stable/10/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccm.c Sun May 24 18:23:57 2015 (r283499) +++ stable/10/sys/arm/freescale/imx/imx6_ccm.c Sun May 24 18:59:45 2015 (r283500) @@ -94,7 +94,7 @@ ccm_init_gates(struct ccm_softc *sc) WR4(sc, CCM_CCGR2, 0x0fffffc0); /* ipmux & ipsync (bridges), iomux, i2c */ WR4(sc, CCM_CCGR3, 0x3ff00000); /* DDR memory controller */ WR4(sc, CCM_CCGR4, 0x0000f300); /* pl301 bus crossbar */ - WR4(sc, CCM_CCGR5, 0x0f000000); /* uarts */ + WR4(sc, CCM_CCGR5, 0x0ffc00c0); /* uarts, ssi, sdma */ WR4(sc, CCM_CCGR6, 0x000000ff); /* usdhc 1-4 */ } @@ -180,6 +180,58 @@ ccm_probe(device_t dev) } void +imx_ccm_ssi_configure(device_t _ssidev) +{ + struct ccm_softc *sc; + uint32_t reg; + + sc = ccm_sc; + + /* + * Select PLL4 (Audio PLL) clock multiplexer as source. + * PLL output frequency = Fref * (DIV_SELECT + NUM/DENOM). + */ + + reg = RD4(sc, CCM_CSCMR1); + reg &= ~(SSI_CLK_SEL_M << SSI1_CLK_SEL_S); + reg |= (SSI_CLK_SEL_PLL4 << SSI1_CLK_SEL_S); + reg &= ~(SSI_CLK_SEL_M << SSI2_CLK_SEL_S); + reg |= (SSI_CLK_SEL_PLL4 << SSI2_CLK_SEL_S); + reg &= ~(SSI_CLK_SEL_M << SSI3_CLK_SEL_S); + reg |= (SSI_CLK_SEL_PLL4 << SSI3_CLK_SEL_S); + WR4(sc, CCM_CSCMR1, reg); + + /* + * Ensure we have set hardware-default values + * for pre and post dividers. + */ + + /* SSI1 and SSI3 */ + reg = RD4(sc, CCM_CS1CDR); + /* Divide by 2 */ + reg &= ~(SSI_CLK_PODF_MASK << SSI1_CLK_PODF_SHIFT); + reg &= ~(SSI_CLK_PODF_MASK << SSI3_CLK_PODF_SHIFT); + reg |= (0x1 << SSI1_CLK_PODF_SHIFT); + reg |= (0x1 << SSI3_CLK_PODF_SHIFT); + /* Divide by 4 */ + reg &= ~(SSI_CLK_PRED_MASK << SSI1_CLK_PRED_SHIFT); + reg &= ~(SSI_CLK_PRED_MASK << SSI3_CLK_PRED_SHIFT); + reg |= (0x3 << SSI1_CLK_PRED_SHIFT); + reg |= (0x3 << SSI3_CLK_PRED_SHIFT); + WR4(sc, CCM_CS1CDR, reg); + + /* SSI2 */ + reg = RD4(sc, CCM_CS2CDR); + /* Divide by 2 */ + reg &= ~(SSI_CLK_PODF_MASK << SSI2_CLK_PODF_SHIFT); + reg |= (0x1 << SSI2_CLK_PODF_SHIFT); + /* Divide by 4 */ + reg &= ~(SSI_CLK_PRED_MASK << SSI2_CLK_PRED_SHIFT); + reg |= (0x3 << SSI2_CLK_PRED_SHIFT); + WR4(sc, CCM_CS2CDR, reg); +} + +void imx_ccm_usb_enable(device_t _usbdev) { Modified: stable/10/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccmreg.h Sun May 24 18:23:57 2015 (r283499) +++ stable/10/sys/arm/freescale/imx/imx6_ccmreg.h Sun May 24 18:59:45 2015 (r283500) @@ -29,6 +29,26 @@ #ifndef IMX6_CCMREG_H #define IMX6_CCMREG_H +#define CCM_CSCMR1 0x01C +#define SSI1_CLK_SEL_S 10 +#define SSI2_CLK_SEL_S 12 +#define SSI3_CLK_SEL_S 14 +#define SSI_CLK_SEL_M 0x3 +#define SSI_CLK_SEL_508_PFD 0 +#define SSI_CLK_SEL_454_PFD 1 +#define SSI_CLK_SEL_PLL4 2 +#define CCM_CSCMR2 0x020 +#define CCM_CS1CDR 0x028 +#define SSI1_CLK_PODF_SHIFT 0 +#define SSI1_CLK_PRED_SHIFT 6 +#define SSI3_CLK_PODF_SHIFT 16 +#define SSI3_CLK_PRED_SHIFT 22 +#define SSI_CLK_PODF_MASK 0x3f +#define SSI_CLK_PRED_MASK 0x7 +#define CCM_CS2CDR 0x02C +#define SSI2_CLK_PODF_SHIFT 0 +#define SSI2_CLK_PRED_SHIFT 6 +#define CCM_CSCDR2 0x038 #define CCM_CLPCR 0x054 #define CCM_CLPCR_LPM_MASK 0x03 #define CCM_CLPCR_LPM_RUN 0x00 Copied: stable/10/sys/arm/freescale/imx/imx6_sdma.c (from r277644, head/sys/arm/freescale/imx/imx6_sdma.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_sdma.c Sun May 24 18:59:45 2015 (r283500, copy of r277644, head/sys/arm/freescale/imx/imx6_sdma.c) @@ -0,0 +1,518 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * i.MX6 Smart Direct Memory Access Controller (sDMA) + * Chapter 41, i.MX 6Dual/6Quad Applications Processor Reference Manual, + * Rev. 1, 04/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define MAX_BD (PAGE_SIZE / sizeof(struct sdma_buffer_descriptor)) + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) + +struct sdma_softc *sdma_sc; + +static struct resource_spec sdma_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static void +sdma_intr(void *arg) +{ + struct sdma_buffer_descriptor *bd; + struct sdma_channel *channel; + struct sdma_conf *conf; + struct sdma_softc *sc; + int pending; + int i; + int j; + + sc = arg; + + pending = READ4(sc, SDMAARM_INTR); + + /* Ack intr */ + WRITE4(sc, SDMAARM_INTR, pending); + + for (i = 0; i < SDMA_N_CHANNELS; i++) { + if ((pending & (1 << i)) == 0) + continue; + channel = &sc->channel[i]; + conf = channel->conf; + if (!conf) + continue; + for (j = 0; j < conf->num_bd; j++) { + bd = &channel->bd[j]; + bd->mode.status |= BD_DONE; + if (bd->mode.status & BD_RROR) + printf("sDMA error\n"); + } + + conf->ih(conf->ih_user, 1); + + WRITE4(sc, SDMAARM_HSTART, (1 << i)); + } +} + +static int +sdma_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,imx6q-sdma")) + return (ENXIO); + + device_set_desc(dev, "i.MX6 Smart Direct Memory Access Controller"); + return (BUS_PROBE_DEFAULT); +} + +int +sdma_start(int chn) +{ + struct sdma_softc *sc; + + sc = sdma_sc; + + WRITE4(sc, SDMAARM_HSTART, (1 << chn)); + + return (0); +} + +int +sdma_stop(int chn) +{ + struct sdma_softc *sc; + + sc = sdma_sc; + + WRITE4(sc, SDMAARM_STOP_STAT, (1 << chn)); + + return (0); +} + +int +sdma_alloc(void) +{ + struct sdma_channel *channel; + struct sdma_softc *sc; + int found; + int chn; + int i; + + sc = sdma_sc; + found = 0; + + /* Channel 0 can't be used */ + for (i = 1; i < SDMA_N_CHANNELS; i++) { + channel = &sc->channel[i]; + if (channel->in_use == 0) { + channel->in_use = 1; + found = 1; + break; + } + } + + if (!found) + return (-1); + + chn = i; + + /* Allocate area for buffer descriptors */ + channel->bd = (void *)kmem_alloc_contig(kernel_arena, + PAGE_SIZE, M_ZERO, 0, ~0, PAGE_SIZE, 0, + VM_MEMATTR_UNCACHEABLE); + + return (chn); +} + +int +sdma_free(int chn) +{ + struct sdma_channel *channel; + struct sdma_softc *sc; + + sc = sdma_sc; + + channel = &sc->channel[chn]; + channel->in_use = 0; + + kmem_free(kernel_arena, (vm_offset_t)channel->bd, + PAGE_SIZE); + + return (0); +} + +static int +sdma_overrides(struct sdma_softc *sc, int chn, + int evt, int host, int dsp) +{ + int reg; + + /* Ignore sDMA requests */ + reg = READ4(sc, SDMAARM_EVTOVR); + if (evt) + reg |= (1 << chn); + else + reg &= ~(1 << chn); + WRITE4(sc, SDMAARM_EVTOVR, reg); + + /* Ignore enable bit (HE) */ + reg = READ4(sc, SDMAARM_HOSTOVR); + if (host) + reg |= (1 << chn); + else + reg &= ~(1 << chn); + WRITE4(sc, SDMAARM_HOSTOVR, reg); + + /* Prevent sDMA channel from starting */ + reg = READ4(sc, SDMAARM_DSPOVR); + if (!dsp) + reg |= (1 << chn); + else + reg &= ~(1 << chn); + WRITE4(sc, SDMAARM_DSPOVR, reg); + + return (0); +} + +int +sdma_configure(int chn, struct sdma_conf *conf) +{ + struct sdma_buffer_descriptor *bd0; + struct sdma_buffer_descriptor *bd; + struct sdma_context_data *context; + struct sdma_channel *channel; + struct sdma_softc *sc; +#if 0 + int timeout; + int ret; +#endif + int i; + + sc = sdma_sc; + + channel = &sc->channel[chn]; + channel->conf = conf; + + /* Ensure operation has stopped */ + sdma_stop(chn); + + /* Set priority and enable the channel */ + WRITE4(sc, SDMAARM_SDMA_CHNPRI(chn), 1); + WRITE4(sc, SDMAARM_CHNENBL(conf->event), (1 << chn)); + + sdma_overrides(sc, chn, 0, 0, 0); + + if (conf->num_bd > MAX_BD) { + device_printf(sc->dev, "Error: too much buffer" + " descriptors requested\n"); + return (-1); + } + + for (i = 0; i < conf->num_bd; i++) { + bd = &channel->bd[i]; + bd->mode.command = conf->command; + bd->mode.status = BD_DONE | BD_EXTD | BD_CONT | BD_INTR; + if (i == (conf->num_bd - 1)) + bd->mode.status |= BD_WRAP; + bd->mode.count = conf->period; + bd->buffer_addr = conf->saddr + (conf->period * i); + bd->ext_buffer_addr = 0; + } + + sc->ccb[chn].base_bd_ptr = vtophys(channel->bd); + sc->ccb[chn].current_bd_ptr = vtophys(channel->bd); + + /* + * Load context. + * + * i.MX6 Reference Manual: Appendix A SDMA Scripts + * A.3.1.7.1 (mcu_2_app) + */ + + /* + * TODO: allow using other scripts + */ + context = sc->context; + memset(context, 0, sizeof(*context)); + context->channel_state.pc = sc->fw_scripts->mcu_2_app_addr; + + /* + * Tx FIFO 0 address (r6) + * Event_mask (r1) + * Event2_mask (r0) + * Watermark level (r7) + */ + + if (conf->event > 32) { + context->gReg[0] = (1 << (conf->event % 32)); + context->gReg[1] = 0; + } else { + context->gReg[0] = 0; + context->gReg[1] = (1 << conf->event); + } + + context->gReg[6] = conf->daddr; + context->gReg[7] = conf->word_length; + + bd0 = sc->bd0; + bd0->mode.command = C0_SETDM; + bd0->mode.status = BD_DONE | BD_INTR | BD_WRAP | BD_EXTD; + bd0->mode.count = sizeof(*context) / 4; + bd0->buffer_addr = sc->context_phys; + bd0->ext_buffer_addr = 2048 + (sizeof(*context) / 4) * chn; + + WRITE4(sc, SDMAARM_HSTART, 1); + +#if 0 + /* Debug purposes */ + + timeout = 1000; + while (!(ret = READ4(sc, SDMAARM_INTR) & 1)) { + if (timeout-- <= 0) + break; + DELAY(10); + }; + + if (!ret) { + device_printf(sc->dev, "Failed to load context.\n"); + return (-1); + } + + WRITE4(sc, SDMAARM_INTR, ret); + + device_printf(sc->dev, "Context loaded successfully.\n"); +#endif + + return (0); +} + +static int +load_firmware(struct sdma_softc *sc) +{ + struct sdma_firmware_header *header; + const struct firmware *fp; + + fp = firmware_get("sdma_fw"); + if (fp == NULL) { + device_printf(sc->dev, "Can't get firmware.\n"); + return (-1); + } + + header = (struct sdma_firmware_header *)fp->data; + if (header->magic != FW_HEADER_MAGIC) { + device_printf(sc->dev, "Can't use firmware.\n"); + return (-1); + } + + sc->fw_header = header; + sc->fw_scripts = (void *)((char *)header + + header->script_addrs_start); + + return (0); +} + +static int +boot_firmware(struct sdma_softc *sc) +{ + struct sdma_buffer_descriptor *bd0; + uint32_t *ram_code; + int timeout; + int ret; + int chn; + int sz; + int i; + + ram_code = (void *)((char *)sc->fw_header + + sc->fw_header->ram_code_start); + + /* Make sure SDMA has not started yet */ + WRITE4(sc, SDMAARM_MC0PTR, 0); + + sz = SDMA_N_CHANNELS * sizeof(struct sdma_channel_control) + \ + sizeof(struct sdma_context_data); + sc->ccb = (void *)kmem_alloc_contig(kernel_arena, + sz, M_ZERO, 0, ~0, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); + sc->ccb_phys = vtophys(sc->ccb); + + sc->context = (void *)((char *)sc->ccb + \ + SDMA_N_CHANNELS * sizeof(struct sdma_channel_control)); + sc->context_phys = vtophys(sc->context); + + /* Disable all the channels */ + for (i = 0; i < SDMA_N_EVENTS; i++) + WRITE4(sc, SDMAARM_CHNENBL(i), 0); + + /* All channels have priority 0 */ + for (i = 0; i < SDMA_N_CHANNELS; i++) + WRITE4(sc, SDMAARM_SDMA_CHNPRI(i), 0); + + /* Channel 0 is used for booting firmware */ + chn = 0; + + sc->bd0 = (void *)kmem_alloc_contig(kernel_arena, + PAGE_SIZE, M_ZERO, 0, ~0, PAGE_SIZE, 0, + VM_MEMATTR_UNCACHEABLE); + bd0 = sc->bd0; + sc->ccb[chn].base_bd_ptr = vtophys(bd0); + sc->ccb[chn].current_bd_ptr = vtophys(bd0); + + WRITE4(sc, SDMAARM_SDMA_CHNPRI(chn), 1); + + sdma_overrides(sc, chn, 1, 0, 0); + + /* XXX: not sure what is that */ + WRITE4(sc, SDMAARM_CHN0ADDR, 0x4050); + + WRITE4(sc, SDMAARM_CONFIG, 0); + WRITE4(sc, SDMAARM_MC0PTR, sc->ccb_phys); + WRITE4(sc, SDMAARM_CONFIG, CONFIG_CSM); + WRITE4(sc, SDMAARM_SDMA_CHNPRI(chn), 1); + + bd0->mode.command = C0_SETPM; + bd0->mode.status = BD_DONE | BD_INTR | BD_WRAP | BD_EXTD; + bd0->mode.count = sc->fw_header->ram_code_size / 2; + bd0->buffer_addr = vtophys(ram_code); + bd0->ext_buffer_addr = sc->fw_scripts->ram_code_start_addr; + + WRITE4(sc, SDMAARM_HSTART, 1); + + timeout = 100; + while (!(ret = READ4(sc, SDMAARM_INTR) & 1)) { + if (timeout-- <= 0) + break; + DELAY(10); + }; + + if (ret == 0) { + device_printf(sc->dev, "SDMA failed to boot\n"); + return (-1); + } + + WRITE4(sc, SDMAARM_INTR, ret); + +#if 0 + device_printf(sc->dev, "SDMA booted successfully.\n"); +#endif + + /* Debug is disabled */ + WRITE4(sc, SDMAARM_ONCE_ENB, 0); + + return (0); +} + +static int +sdma_attach(device_t dev) +{ + struct sdma_softc *sc; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, sdma_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + sdma_sc = sc; + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, sdma_intr, sc, &sc->ih); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + if (load_firmware(sc) == -1) + return (ENXIO); + + if (boot_firmware(sc) == -1) + return (ENXIO); + + return (0); +}; + +static device_method_t sdma_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, sdma_probe), + DEVMETHOD(device_attach, sdma_attach), + { 0, 0 } +}; + +static driver_t sdma_driver = { + "sdma", + sdma_methods, + sizeof(struct sdma_softc), +}; + +static devclass_t sdma_devclass; + +DRIVER_MODULE(sdma, simplebus, sdma_driver, sdma_devclass, 0, 0); Copied: stable/10/sys/arm/freescale/imx/imx6_sdma.h (from r277644, head/sys/arm/freescale/imx/imx6_sdma.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_sdma.h Sun May 24 18:59:45 2015 (r283500, copy of r277644, head/sys/arm/freescale/imx/imx6_sdma.h) @@ -0,0 +1,245 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define SDMAARM_MC0PTR 0x00 /* ARM platform Channel 0 Pointer */ +#define SDMAARM_INTR 0x04 /* Channel Interrupts */ +#define SDMAARM_STOP_STAT 0x08 /* Channel Stop/Channel Status */ +#define SDMAARM_HSTART 0x0C /* Channel Start */ +#define SDMAARM_EVTOVR 0x10 /* Channel Event Override */ +#define SDMAARM_DSPOVR 0x14 /* Channel BP Override */ +#define SDMAARM_HOSTOVR 0x18 /* Channel ARM platform Override */ +#define SDMAARM_EVTPEND 0x1C /* Channel Event Pending */ +#define SDMAARM_RESET 0x24 /* Reset Register */ +#define SDMAARM_EVTERR 0x28 /* DMA Request Error Register */ +#define SDMAARM_INTRMASK 0x2C /* Channel ARM platform Interrupt Mask */ +#define SDMAARM_PSW 0x30 /* Schedule Status */ +#define SDMAARM_EVTERRDBG 0x34 /* DMA Request Error Register */ +#define SDMAARM_CONFIG 0x38 /* Configuration Register */ +#define CONFIG_CSM 0x3 +#define SDMAARM_SDMA_LOCK 0x3C /* SDMA LOCK */ +#define SDMAARM_ONCE_ENB 0x40 /* OnCE Enable */ +#define SDMAARM_ONCE_DATA 0x44 /* OnCE Data Register */ +#define SDMAARM_ONCE_INSTR 0x48 /* OnCE Instruction Register */ +#define SDMAARM_ONCE_STAT 0x4C /* OnCE Status Register */ +#define SDMAARM_ONCE_CMD 0x50 /* OnCE Command Register */ +#define SDMAARM_ILLINSTADDR 0x58 /* Illegal Instruction Trap Address */ +#define SDMAARM_CHN0ADDR 0x5C /* Channel 0 Boot Address */ +#define SDMAARM_EVT_MIRROR 0x60 /* DMA Requests */ +#define SDMAARM_EVT_MIRROR2 0x64 /* DMA Requests 2 */ +#define SDMAARM_XTRIG_CONF1 0x70 /* Cross-Trigger Events Configuration Register 1 */ +#define SDMAARM_XTRIG_CONF2 0x74 /* Cross-Trigger Events Configuration Register 2 */ +#define SDMAARM_SDMA_CHNPRI(n) (0x100 + 0x4 * n) /* Channel Priority Registers */ +#define SDMAARM_CHNENBL(n) (0x200 + 0x4 * n) /* Channel Enable RAM */ + +/* SDMA Event Mappings */ +#define SSI1_RX_1 35 +#define SSI1_TX_1 36 +#define SSI1_RX_0 37 +#define SSI1_TX_0 38 +#define SSI2_RX_1 39 +#define SSI2_TX_1 40 +#define SSI2_RX_0 41 +#define SSI2_TX_0 42 +#define SSI3_RX_1 43 +#define SSI3_TX_1 44 +#define SSI3_RX_0 45 +#define SSI3_TX_0 46 + +#define C0_ADDR 0x01 +#define C0_LOAD 0x02 +#define C0_DUMP 0x03 +#define C0_SETCTX 0x07 +#define C0_GETCTX 0x03 +#define C0_SETDM 0x01 +#define C0_SETPM 0x04 +#define C0_GETDM 0x02 +#define C0_GETPM 0x08 + +#define BD_DONE 0x01 +#define BD_WRAP 0x02 +#define BD_CONT 0x04 +#define BD_INTR 0x08 +#define BD_RROR 0x10 +#define BD_LAST 0x20 +#define BD_EXTD 0x80 + +/* sDMA data transfer length */ +#define CMD_4BYTES 0 +#define CMD_3BYTES 3 +#define CMD_2BYTES 2 +#define CMD_1BYTES 1 + +struct sdma_firmware_header { + uint32_t magic; + uint32_t version_major; + uint32_t version_minor; + uint32_t script_addrs_start; + uint32_t num_script_addrs; + uint32_t ram_code_start; + uint32_t ram_code_size; +}; + +struct sdma_mode_count { + uint16_t count; + uint8_t status; + uint8_t command; +}; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sun May 24 19:00:47 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAB888A9; Sun, 24 May 2015 19:00:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7FF515F9; Sun, 24 May 2015 19:00:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4OJ0lwS073296; Sun, 24 May 2015 19:00:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4OJ0kJw073292; Sun, 24 May 2015 19:00:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505241900.t4OJ0kJw073292@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 May 2015 19:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283501 - stable/10/sys/arm/freescale/imx 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2015 19:00:47 -0000 Author: ian Date: Sun May 24 19:00:46 2015 New Revision: 283501 URL: https://svnweb.freebsd.org/changeset/base/283501 Log: MFC r282516: Add the code necessary to run the imx6 chip at its lowest clock/power operating point (396MHz/950mV). Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx6_ccm.c stable/10/sys/arm/freescale/imx/imx6_ccmreg.h stable/10/sys/arm/freescale/imx/imx_ccmvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun May 24 18:59:45 2015 (r283500) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun May 24 19:00:46 2015 (r283501) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -117,12 +118,16 @@ static struct imx6_anatop_softc *imx6_an /* * Table of "operating points". * These are combinations of frequency and voltage blessed by Freescale. + * While the datasheet says the ARM voltage can be as low as 925mV at + * 396MHz, it also says that the ARM and SOC voltages can't differ by + * more than 200mV, and the minimum SOC voltage is 1150mV, so that + * dictates the 950mV entry in this table. */ static struct oppt { uint32_t mhz; uint32_t mv; } imx6_oppt_table[] = { -/* { 396, 925}, XXX: need functional ccm code for this speed */ + { 396, 950}, { 792, 1150}, { 852, 1225}, { 996, 1225}, @@ -159,14 +164,15 @@ imx6_anatop_write_4(bus_size_t offset, u static void vdd_set(struct imx6_anatop_softc *sc, int mv) { - int newtarg, oldtarg; + int newtarg, newtargSoc, oldtarg; uint32_t delay, pmureg; static boolean_t init_done = false; /* * The datasheet says VDD_PU and VDD_SOC must be equal, and VDD_ARM - * can't be more than 50mV above or 200mV below them. For now to keep - * things simple we set all three to the same value. + * can't be more than 50mV above or 200mV below them. We keep them the + * same except in the case of the lowest operating point, which is + * handled as a special case below. */ pmureg = imx6_anatop_read_4(IMX6_ANALOG_PMU_REG_CORE); @@ -181,19 +187,29 @@ vdd_set(struct imx6_anatop_softc *sc, in newtarg = (mv - 700) / 25; /* + * The SOC voltage can't go below 1150mV, and thus because of the 200mV + * rule, the ARM voltage can't go below 950mV. The 950 is encoded in + * our oppt table, here we handle the SOC 1150 rule as a special case. + * (1150-700/25=18). + */ + newtargSoc = (newtarg < 18) ? 18 : newtarg; + + /* * The first time through the 3 voltages might not be equal so use a * long conservative delay. After that we need to delay 3uS for every - * 25mV step upward. No need to delay at all when lowering. + * 25mV step upward; we actually delay 6uS because empirically, it works + * and the 3uS per step recommended by the docs doesn't (3uS fails when + * going from 400->1200, but works for smaller changes). */ if (init_done) { if (newtarg == oldtarg) return; else if (newtarg > oldtarg) - delay = (newtarg - oldtarg) * 3; + delay = (newtarg - oldtarg) * 6; else delay = 0; } else { - delay = 700 / 25 * 3; + delay = (700 / 25) * 6; init_done = true; } @@ -206,7 +222,7 @@ vdd_set(struct imx6_anatop_softc *sc, in pmureg |= newtarg << IMX6_ANALOG_PMU_REG0_TARG_SHIFT; pmureg |= newtarg << IMX6_ANALOG_PMU_REG1_TARG_SHIFT; - pmureg |= newtarg << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; + pmureg |= newtargSoc << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); DELAY(delay); @@ -214,24 +230,29 @@ vdd_set(struct imx6_anatop_softc *sc, in } static inline uint32_t -cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t corediv, + uint32_t plldiv) { - return (sc->refosc_mhz * (div / 2)); + return ((sc->refosc_mhz * (plldiv / 2)) / (corediv + 1)); } -static inline uint32_t -cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) +static inline void +cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz, + uint32_t *corediv, uint32_t *plldiv) { - return (cpu_mhz / (sc->refosc_mhz / 2)); + *corediv = (cpu_mhz < 650) ? 1 : 0; + *plldiv = ((*corediv + 1) * cpu_mhz) / (sc->refosc_mhz / 2); } static inline uint32_t cpufreq_actual_mhz(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) { + uint32_t corediv, plldiv; - return (cpufreq_mhz_from_div(sc, cpufreq_mhz_to_div(sc, cpu_mhz))); + cpufreq_mhz_to_div(sc, cpu_mhz, &corediv, &plldiv); + return (cpufreq_mhz_from_div(sc, corediv, plldiv)); } static struct oppt * @@ -257,7 +278,7 @@ cpufreq_nearest_oppt(struct imx6_anatop_ static void cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) { - uint32_t timeout, wrk32; + uint32_t corediv, plldiv, timeout, wrk32; /* If increasing the frequency, we must first increase the voltage. */ if (op->mhz > sc->cpu_curmhz) { @@ -273,6 +294,7 @@ cpufreq_set_clock(struct imx6_anatop_sof * - Wait for the LOCK bit to come on; it takes ~50 loop iterations. * - Turn off bypass mode; cpu should now be running at the new speed. */ + cpufreq_mhz_to_div(sc, op->mhz, &corediv, &plldiv); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_SET, @@ -280,7 +302,7 @@ cpufreq_set_clock(struct imx6_anatop_sof wrk32 = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM); wrk32 &= ~IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - wrk32 |= cpufreq_mhz_to_div(sc, op->mhz); + wrk32 |= plldiv; imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM, wrk32); timeout = 10000; @@ -291,6 +313,7 @@ cpufreq_set_clock(struct imx6_anatop_sof imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_BYPASS); + imx_ccm_set_cacrr(corediv); /* If lowering the frequency, it is now safe to lower the voltage. */ if (op->mhz < sc->cpu_curmhz) @@ -298,7 +321,7 @@ cpufreq_set_clock(struct imx6_anatop_sof sc->cpu_curmhz = op->mhz; /* Tell the mpcore timer that its frequency has changed. */ - arm_tmr_change_frequency( + arm_tmr_change_frequency( cpufreq_actual_mhz(sc, sc->cpu_curmhz) * 1000000 / 2); } @@ -752,11 +775,12 @@ imx6_anatop_probe(device_t dev) uint32_t imx6_get_cpu_clock() { - uint32_t div; + uint32_t corediv, plldiv; - div = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & + corediv = imx_ccm_get_cacrr(); + plldiv = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - return (cpufreq_mhz_from_div(imx6_anatop_sc, div)); + return (cpufreq_mhz_from_div(imx6_anatop_sc, corediv, plldiv)); } static device_method_t imx6_anatop_methods[] = { Modified: stable/10/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccm.c Sun May 24 18:59:45 2015 (r283500) +++ stable/10/sys/arm/freescale/imx/imx6_ccm.c Sun May 24 19:00:46 2015 (r283501) @@ -320,6 +320,20 @@ imx_ccm_ahb_hz(void) return (132000000); } +uint32_t +imx_ccm_get_cacrr(void) +{ + + return (RD4(ccm_sc, CCM_CACCR)); +} + +void +imx_ccm_set_cacrr(uint32_t divisor) +{ + + WR4(ccm_sc, CCM_CACCR, divisor); +} + static device_method_t ccm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ccm_probe), Modified: stable/10/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccmreg.h Sun May 24 18:59:45 2015 (r283500) +++ stable/10/sys/arm/freescale/imx/imx6_ccmreg.h Sun May 24 19:00:46 2015 (r283501) @@ -29,6 +29,7 @@ #ifndef IMX6_CCMREG_H #define IMX6_CCMREG_H +#define CCM_CACCR 0x010 #define CCM_CSCMR1 0x01C #define SSI1_CLK_SEL_S 10 #define SSI2_CLK_SEL_S 12 @@ -64,6 +65,5 @@ #define CCM_CCGR5 0x07C #define CCM_CCGR6 0x080 #define CCM_CMEOR 0x088 - #endif Modified: stable/10/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_ccmvar.h Sun May 24 18:59:45 2015 (r283500) +++ stable/10/sys/arm/freescale/imx/imx_ccmvar.h Sun May 24 19:00:46 2015 (r283501) @@ -53,4 +53,8 @@ void imx_ccm_usb_enable(device_t _usbdev void imx_ccm_usbphy_enable(device_t _phydev); void imx_ccm_ssi_configure(device_t _ssidev); +/* Routines to get and set the arm clock root divisor register. */ +uint32_t imx_ccm_get_cacrr(void); +void imx_ccm_set_cacrr(uint32_t _divisor); + #endif From owner-svn-src-stable@FreeBSD.ORG Mon May 25 00:30:27 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DF7CB4F; Mon, 25 May 2015 00:30:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B243EDE; Mon, 25 May 2015 00:30:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4P0UQRg045392; Mon, 25 May 2015 00:30:26 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4P0UQnx045391; Mon, 25 May 2015 00:30:26 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201505250030.t4P0UQnx045391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 25 May 2015 00:30: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: r283504 - stable/10/sys/dev/e1000 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 00:30:27 -0000 Author: sbruno Date: Mon May 25 00:30:26 2015 New Revision: 283504 URL: https://svnweb.freebsd.org/changeset/base/283504 Log: MFC r283290 Bump rx_overruns when indicated by the ICR mask. PR: 199716 Sponsored by: Limelight Networks Modified: stable/10/sys/dev/e1000/if_em.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Sun May 24 23:53:10 2015 (r283503) +++ stable/10/sys/dev/e1000/if_em.c Mon May 25 00:30:26 2015 (r283504) @@ -1620,6 +1620,9 @@ em_msix_link(void *arg) ++adapter->link_irq; reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); + if (reg_icr & E1000_ICR_RXO) + adapter->rx_overruns++; + if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { adapter->hw.mac.get_link_status = 1; em_handle_link(adapter, 0); From owner-svn-src-stable@FreeBSD.ORG Mon May 25 01:06:58 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 576B440B; Mon, 25 May 2015 01:06:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42A1C261; Mon, 25 May 2015 01:06:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4P16wj6061401; Mon, 25 May 2015 01:06:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4P16tCn061384; Mon, 25 May 2015 01:06:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505250106.t4P16tCn061384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 May 2015 01:06:55 +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: r283505 - in stable/10/sys/boot: arm/uboot common uboot/common uboot/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 01:06:58 -0000 Author: ian Date: Mon May 25 01:06:55 2015 New Revision: 283505 URL: https://svnweb.freebsd.org/changeset/base/283505 Log: MFC r277962, r277988, r282661, r282727, r282731, r283013, r283035: Add support for booting relocatable kernels on PowerPC. Add code to support loading relocatable kernels at offsets that are not zero. Move ubldr text section to the start of the output file, so that when you create a stripped .bin file from it the entry point is the first byte of the file. (Will allow "load $addr $file ; go $addr" in u-boot.) Create a relocatable instance of ubldr for ARM (ubldr.bin). Re-link ubldr when any of its libraries change. An ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that. Added: stable/10/sys/boot/common/self_reloc.c - copied unchanged from r282727, head/sys/boot/common/self_reloc.c Modified: stable/10/sys/boot/arm/uboot/Makefile stable/10/sys/boot/arm/uboot/ldscript.arm stable/10/sys/boot/arm/uboot/start.S stable/10/sys/boot/common/load_elf.c stable/10/sys/boot/uboot/common/main.c stable/10/sys/boot/uboot/lib/copy.c stable/10/sys/boot/uboot/lib/elf_freebsd.c stable/10/sys/boot/uboot/lib/libuboot.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/10/sys/boot/arm/uboot/Makefile Mon May 25 00:30:26 2015 (r283504) +++ stable/10/sys/boot/arm/uboot/Makefile Mon May 25 01:06:55 2015 (r283505) @@ -2,7 +2,8 @@ .include -PROG= ubldr +FILES= ubldr ubldr.bin + NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} BINDIR?= /boot INSTALLFLAGS= -b @@ -12,7 +13,7 @@ WARNS?= 1 UBLDR_LOADADDR?= 0x1000000 # Architecture-specific loader code -SRCS= start.S conf.c vers.c +SRCS= start.S conf.c self_reloc.c vers.c .if !defined(LOADER_NO_DISK_SUPPORT) LOADER_DISK_SUPPORT?= yes @@ -93,9 +94,7 @@ CLEANFILES+= vers.c loader.help CFLAGS+= -ffreestanding -msoft-float -LDFLAGS= -nostdlib -static -LDFLAGS+= -T ldscript.generated -LDFLAGS+= -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} +LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} # Pull in common loader code .PATH: ${.CURDIR}/../../uboot/common @@ -116,6 +115,8 @@ NO_WERROR.clang= DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand +OBJS+= ${SRCS:N*.h:R:S/$/.o/g} + vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} @@ -123,17 +124,24 @@ loader.help: help.common help.uboot ${.C cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} -${PROG}: ldscript.generated ${.CURDIR}/ldscript.${MACHINE_CPUARCH} +ldscript.abs: + echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} + +ldscript.pie: + echo "UBLDR_LOADADDR = 0;" >${.TARGET} + +ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} + ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ + -o ${.TARGET} ${OBJS} ${LDADD} + +ubldr.pie: ${OBJS} ldscript.pie ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} + ${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \ + -o ${.TARGET} ${OBJS} ${LDADD} + +ubldr.bin: ubldr.pie + ${OBJCOPY} -S -O binary ubldr.pie ${.TARGET} -ldscript.generated:: - rm -f ldscript.generated.tmp - echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >ldscript.generated.tmp - if diff ldscript.generated ldscript.generated.tmp > /dev/null; then \ - true; \ - else \ - rm -f ldscript.generated; \ - mv ldscript.generated.tmp ldscript.generated; \ - fi +CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin .if !defined(LOADER_ONLY) .PATH: ${.CURDIR}/../../forth Modified: stable/10/sys/boot/arm/uboot/ldscript.arm ============================================================================== --- stable/10/sys/boot/arm/uboot/ldscript.arm Mon May 25 00:30:26 2015 (r283504) +++ stable/10/sys/boot/arm/uboot/ldscript.arm Mon May 25 01:06:55 2015 (r283505) @@ -6,6 +6,15 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = UBLDR_LOADADDR + SIZEOF_HEADERS; + .text : + { + *(.text) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + _etext = .; + PROVIDE (etext = .); .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } @@ -32,15 +41,6 @@ SECTIONS .rela.sbss : { *(.rela.sbss) } .rela.sdata2 : { *(.rela.sdata2) } .rela.sbss2 : { *(.rela.sbss2) } - .text : - { - *(.text) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - } =0 - _etext = .; - PROVIDE (etext = .); .init : { *(.init) } =0 .fini : { *(.fini) } =0 .rodata : { *(.rodata) *(.gnu.linkonce.r*) } Modified: stable/10/sys/boot/arm/uboot/start.S ============================================================================== --- stable/10/sys/boot/arm/uboot/start.S Mon May 25 00:30:26 2015 (r283504) +++ stable/10/sys/boot/arm/uboot/start.S Mon May 25 01:06:55 2015 (r283505) @@ -29,12 +29,38 @@ #include #include + .text + .extern _C_LABEL(self_reloc), _C_LABEL(main) + .weak _DYNAMIC + /* * Entry point to the loader that U-Boot passes control to. */ - .text .globl _start _start: + +#ifdef _ARM_ARCH_6 + mrc p15, 0, ip, c1, c0, 0 + orr ip, ip, #(CPU_CONTROL_UNAL_ENABLE) + orr ip, ip, #(CPU_CONTROL_AFLT_ENABLE) + mcr p15, 0, ip, c1, c0, 0 +#endif + /* + * Do self-relocation when the weak external symbol _DYNAMIC is non-NULL. + * When linked as a dynamic relocatable file, the linker automatically + * defines _DYNAMIC with a value that is the offset of the dynamic + * relocation info section. + * Note that we're still on u-boot's stack here, but the self_reloc + * code uses only a couple dozen bytes of stack space. + */ + adr ip, .here_off /* .here_off is a symbol whose value */ + ldr r0, [ip] /* is its own offset in the text seg. */ + sub r0, ip, r0 /* Get its pc-relative address and */ + ldr r1, .dynamic_off /* subtract its value and we get */ + teq r1, #0 /* r0 = physaddr we were loaded at. */ + addne r1, r1, r0 /* r1 = dynamic section physaddr. */ + blne _C_LABEL(self_reloc) /* Do reloc if _DYNAMIC is non-NULL. */ + /* Hint where to look for the API signature */ ldr ip, =uboot_address str sp, [ip] @@ -44,16 +70,20 @@ _start: str r8, [ip, #0] str r9, [ip, #4] -#ifdef _ARM_ARCH_6 - mrc p15, 0, r2, c1, c0, 0 - orr r2, r2, #(CPU_CONTROL_UNAL_ENABLE) - orr r2, r2, #(CPU_CONTROL_AFLT_ENABLE) - mcr p15, 0, r2, c1, c0, 0 -#endif - - /* Start loader */ + /* + * Start loader. This is basically a tail-recursion call; if main() + * returns, it returns to u-boot (which reports the value returned r0). + */ b main + /* + * Data for self-relocation, in the text segment for pc-rel access. + */ +.here_off: + .word . +.dynamic_off: + .word _DYNAMIC + /* * syscall() */ Modified: stable/10/sys/boot/common/load_elf.c ============================================================================== --- stable/10/sys/boot/common/load_elf.c Mon May 25 00:30:26 2015 (r283504) +++ stable/10/sys/boot/common/load_elf.c Mon May 25 01:06:55 2015 (r283505) @@ -141,22 +141,15 @@ __elfN(loadfile)(char *filename, u_int64 * Check to see what sort of module we are. */ kfp = file_findfile(NULL, NULL); - if (ehdr->e_type == ET_DYN) { - /* Looks like a kld module */ - if (kfp == NULL) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module before kernel\n"); - err = EPERM; - goto oerr; - } - if (strcmp(__elfN(kerneltype), kfp->f_type)) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module with kernel type '%s'\n", kfp->f_type); - err = EPERM; - goto oerr; - } - /* Looks OK, got ahead */ - ef.kernel = 0; - - } else if (ehdr->e_type == ET_EXEC) { +#ifdef __powerpc__ + /* + * Kernels can be ET_DYN, so just assume the first loaded object is the + * kernel. This assumption will be checked later. + */ + if (kfp == NULL) + ef.kernel = 1; +#endif + if (ef.kernel || ehdr->e_type == ET_EXEC) { /* Looks like a kernel */ if (kfp != NULL) { printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: kernel already loaded\n"); @@ -164,16 +157,39 @@ __elfN(loadfile)(char *filename, u_int64 goto oerr; } /* - * Calculate destination address based on kernel entrypoint + * Calculate destination address based on kernel entrypoint. + * + * For ARM, the destination address is independent of any values in the + * elf header (an ARM kernel can be loaded at any 2MB boundary), so we + * leave dest set to the value calculated by archsw.arch_loadaddr() and + * passed in to this function. */ - dest = (ehdr->e_entry & ~PAGE_MASK); - if (dest == 0) { +#ifndef __arm__ + if (ehdr->e_type == ET_EXEC) + dest = (ehdr->e_entry & ~PAGE_MASK); +#endif + if ((ehdr->e_entry & ~PAGE_MASK) == 0) { printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: not a kernel (maybe static binary?)\n"); err = EPERM; goto oerr; } ef.kernel = 1; + } else if (ehdr->e_type == ET_DYN) { + /* Looks like a kld module */ + if (kfp == NULL) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module before kernel\n"); + err = EPERM; + goto oerr; + } + if (strcmp(__elfN(kerneltype), kfp->f_type)) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module with kernel type '%s'\n", kfp->f_type); + err = EPERM; + goto oerr; + } + /* Looks OK, got ahead */ + ef.kernel = 0; + } else { err = EFTYPE; goto oerr; @@ -259,7 +275,7 @@ __elfN(loadimage)(struct preloaded_file ret = 0; firstaddr = lastaddr = 0; ehdr = ef->ehdr; - if (ef->kernel) { + if (ehdr->e_type == ET_EXEC) { #if defined(__i386__) || defined(__amd64__) #if __ELF_WORD_SIZE == 64 off = - (off & 0xffffffffff000000ull);/* x86_64 relocates after locore */ @@ -291,32 +307,30 @@ __elfN(loadimage)(struct preloaded_file off = 0; #elif defined(__arm__) /* - * The elf headers in some kernels specify virtual addresses in all - * header fields. More recently, the e_entry and p_paddr fields are the - * proper physical addresses. Even when the p_paddr fields are correct, - * the MI code below uses the p_vaddr fields with an offset added for - * loading (doing so is arguably wrong). To make loading work, we need - * an offset that represents the difference between physical and virtual - * addressing. ARM kernels are always linked at 0xCnnnnnnn. Depending - * on the headers, the offset value passed in may be physical or virtual - * (because it typically comes from e_entry), but we always replace - * whatever is passed in with the va<->pa offset. On the other hand, we - * always remove the high-order part of the entry address whether it's - * physical or virtual, because it will be adjusted later for the actual - * physical entry point based on where the image gets loaded. + * The elf headers in arm kernels specify virtual addresses in all + * header fields, even the ones that should be physical addresses. + * We assume the entry point is in the first page, and masking the page + * offset will leave us with the virtual address the kernel was linked + * at. We subtract that from the load offset, making 'off' into the + * value which, when added to a virtual address in an elf header, + * translates it to a physical address. We do the va->pa conversion on + * the entry point address in the header now, so that later we can + * launch the kernel by just jumping to that address. */ - off = -0xc0000000; - ehdr->e_entry &= ~0xf0000000; + off -= ehdr->e_entry & ~PAGE_MASK; + ehdr->e_entry += off; #ifdef ELF_VERBOSE printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", ehdr->e_entry, off); #endif #else off = 0; /* other archs use direct mapped kernels */ #endif - __elfN(relocation_offset) = off; } ef->off = off; + if (ef->kernel) + __elfN(relocation_offset) = off; + if ((ehdr->e_phoff + ehdr->e_phnum * sizeof(*phdr)) > ef->firstlen) { printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadimage: program header not within first page\n"); goto out; Copied: stable/10/sys/boot/common/self_reloc.c (from r282727, head/sys/boot/common/self_reloc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/common/self_reloc.c Mon May 25 01:06:55 2015 (r283505, copy of r282727, head/sys/boot/common/self_reloc.c) @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 2008-2010 Rui Paulo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#if defined(__aarch64__) +#define ElfW_Rel Elf64_Rela +#define ElfW_Dyn Elf64_Dyn +#define ELFW_R_TYPE ELF64_R_TYPE +#define ELF_RELA +#elif defined(__arm__) || defined(__i386__) +#define ElfW_Rel Elf32_Rel +#define ElfW_Dyn Elf32_Dyn +#define ELFW_R_TYPE ELF32_R_TYPE +#elif defined(__amd64__) +#define ElfW_Rel Elf64_Rel +#define ElfW_Dyn Elf64_Dyn +#define ELFW_R_TYPE ELF64_R_TYPE +#else +#error architecture not supported +#endif +#if defined(__aarch64__) +#define RELOC_TYPE_NONE R_AARCH64_NONE +#define RELOC_TYPE_RELATIVE R_AARCH64_RELATIVE +#elif defined(__amd64__) +#define RELOC_TYPE_NONE R_X86_64_NONE +#define RELOC_TYPE_RELATIVE R_X86_64_RELATIVE +#elif defined(__arm__) +#define RELOC_TYPE_NONE R_ARM_NONE +#define RELOC_TYPE_RELATIVE R_ARM_RELATIVE +#elif defined(__i386__) +#define RELOC_TYPE_NONE R_386_NONE +#define RELOC_TYPE_RELATIVE R_386_RELATIVE +#endif + +/* + * A simple elf relocator. + */ +void +self_reloc(Elf_Addr baseaddr, ElfW_Dyn *dynamic) +{ + Elf_Word relsz, relent; + Elf_Addr *newaddr; + ElfW_Rel *rel; + ElfW_Dyn *dynp; + + /* + * Find the relocation address, its size and the relocation entry. + */ + relsz = 0; + relent = 0; + for (dynp = dynamic; dynp->d_tag != DT_NULL; dynp++) { + switch (dynp->d_tag) { + case DT_REL: + case DT_RELA: + rel = (ElfW_Rel *)(dynp->d_un.d_ptr + baseaddr); + break; + case DT_RELSZ: + case DT_RELASZ: + relsz = dynp->d_un.d_val; + break; + case DT_RELENT: + case DT_RELAENT: + relent = dynp->d_un.d_val; + break; + default: + break; + } + } + + /* + * Perform the actual relocation. + */ + for (; relsz > 0; relsz -= relent) { + switch (ELFW_R_TYPE(rel->r_info)) { + case RELOC_TYPE_NONE: + /* No relocation needs be performed. */ + break; + + case RELOC_TYPE_RELATIVE: + /* Address relative to the base address. */ + newaddr = (Elf_Addr *)(rel->r_offset + baseaddr); + *newaddr += baseaddr; + /* Add the addend when the ABI uses them */ +#ifdef ELF_RELA + *newaddr += rel->r_addend; +#endif + break; + default: + /* XXX: do we need other relocations ? */ + break; + } + rel = (ElfW_Rel *) ((caddr_t) rel + relent); + } +} Modified: stable/10/sys/boot/uboot/common/main.c ============================================================================== --- stable/10/sys/boot/uboot/common/main.c Mon May 25 00:30:26 2015 (r283504) +++ stable/10/sys/boot/uboot/common/main.c Mon May 25 01:06:55 2015 (r283505) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include @@ -44,6 +45,9 @@ struct uboot_devdesc currdev; struct arch_switch archsw; /* MI/MD interface boundary */ int devs_no; +uintptr_t uboot_heap_start; +uintptr_t uboot_heap_end; + struct device_type { const char *name; int type; @@ -414,7 +418,9 @@ main(void) * Initialise the heap as early as possible. Once this is done, * alloc() is usable. The stack is buried inside us, so this is safe. */ - setheap((void *)end, (void *)(end + 512 * 1024)); + uboot_heap_start = round_page((uintptr_t)end); + uboot_heap_end = uboot_heap_start + 512 * 1024; + setheap((void *)uboot_heap_start, (void *)uboot_heap_end); /* * Set up console. @@ -487,6 +493,7 @@ main(void) setenv("LINES", "24", 1); /* optional */ setenv("prompt", "loader>", 1); + archsw.arch_loadaddr = uboot_loadaddr; archsw.arch_getdev = uboot_getdev; archsw.arch_copyin = uboot_copyin; archsw.arch_copyout = uboot_copyout; Modified: stable/10/sys/boot/uboot/lib/copy.c ============================================================================== --- stable/10/sys/boot/uboot/lib/copy.c Mon May 25 00:30:26 2015 (r283504) +++ stable/10/sys/boot/uboot/lib/copy.c Mon May 25 01:06:55 2015 (r283505) @@ -27,66 +27,131 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include "api_public.h" #include "glue.h" +#include "libuboot.h" /* * MD primitives supporting placement of module data */ -void * -uboot_vm_translate(vm_offset_t o) { +#ifdef __arm__ +#define KERN_ALIGN (2 * 1024 * 1024) +#else +#define KERN_ALIGN PAGE_SIZE +#endif + +/* + * Avoid low memory, u-boot puts things like args and dtb blobs there. + */ +#define KERN_MINADDR max(KERN_ALIGN, (1024 * 1024)) + +extern void _start(void); /* ubldr entry point address. */ + +/* + * This is called for every object loaded (kernel, module, dtb file, etc). The + * expected return value is the next address at or after the given addr which is + * appropriate for loading the given object described by type and data. On each + * call the addr is the next address following the previously loaded object. + * + * The first call is for loading the kernel, and the addr argument will be zero, + * and we search for a big block of ram to load the kernel and modules. + * + * On subsequent calls the addr will be non-zero, and we just round it up so + * that each object begins on a page boundary. + */ +uint64_t +uboot_loadaddr(u_int type, void *data, uint64_t addr) +{ struct sys_info *si; - static uintptr_t start = 0; - static size_t size = 0; + uintptr_t sblock, eblock, subldr, eubldr; + uintptr_t biggest_block, this_block; + size_t biggest_size, this_size; int i; + char * envstr; + + if (addr == 0) { + /* + * If the loader_kernaddr environment variable is set, blindly + * honor it. It had better be right. We force interpretation + * of the value in base-16 regardless of any leading 0x prefix, + * because that's the U-Boot convention. + */ + envstr = ub_env_get("loader_kernaddr"); + if (envstr != NULL) + return (strtoul(envstr, NULL, 16)); - if (size == 0) { + /* + * Find addr/size of largest DRAM block. Carve our own address + * range out of the block, because loading the kernel over the + * top ourself is a poor memory-conservation strategy. Avoid + * memory at beginning of the first block of physical ram, + * since u-boot likes to pass args and data there. Assume that + * u-boot has moved itself to the very top of ram and + * optimistically assume that we won't run into it up there. + */ if ((si = ub_get_sys_info()) == NULL) panic("could not retrieve system info"); - /* Find start/size of largest DRAM block. */ + biggest_block = 0; + biggest_size = 0; + subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); + eubldr = roundup2(uboot_heap_end, KERN_ALIGN); for (i = 0; i < si->mr_no; i++) { - if (si->mr[i].flags == MR_ATTR_DRAM - && si->mr[i].size > size) { - start = si->mr[i].start; - size = si->mr[i].size; + if (si->mr[i].flags != MR_ATTR_DRAM) + continue; + sblock = roundup2(si->mr[i].start, KERN_ALIGN); + eblock = rounddown2(si->mr[i].start + si->mr[i].size, + KERN_ALIGN); + if (biggest_size == 0) + sblock += KERN_MINADDR; + if (subldr >= sblock && subldr < eblock) { + if (subldr - sblock > eblock - eubldr) { + this_block = sblock; + this_size = subldr - sblock; + } else { + this_block = eubldr; + this_size = eblock - eubldr; + } + } + if (biggest_size < this_size) { + biggest_block = this_block; + biggest_size = this_size; } } - - if (size <= 0) - panic("No suitable DRAM?\n"); - /* - printf("Loading into memory region 0x%08X-0x%08X (%d MiB)\n", - start, start + size, size / 1024 / 1024); - */ + if (biggest_size == 0) + panic("Not enough DRAM to load kernel\n"); +#if 0 + printf("Loading kernel into region 0x%08x-0x%08x (%u MiB)\n", + biggest_block, biggest_block + biggest_size - 1, + biggest_size / 1024 / 1024); +#endif + return (biggest_block); } - if (o > size) - panic("Address offset 0x%08jX bigger than size 0x%08X\n", - (intmax_t)o, size); - return (void *)(start + o); + return roundup2(addr, PAGE_SIZE); } ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len) { - bcopy(src, uboot_vm_translate(dest), len); + bcopy(src, (void *)dest, len); return (len); } ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len) { - bcopy(uboot_vm_translate(src), dest, len); + bcopy((void *)src, dest, len); return (len); } ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len) { - return (read(fd, uboot_vm_translate(dest), len)); + return (read(fd, (void *)dest, len)); } Modified: stable/10/sys/boot/uboot/lib/elf_freebsd.c ============================================================================== --- stable/10/sys/boot/uboot/lib/elf_freebsd.c Mon May 25 00:30:26 2015 (r283504) +++ stable/10/sys/boot/uboot/lib/elf_freebsd.c Mon May 25 01:06:55 2015 (r283505) @@ -80,7 +80,7 @@ __elfN(uboot_exec)(struct preloaded_file if ((error = md_load(fp->f_args, &mdp)) != 0) return (error); - entry = uboot_vm_translate(e->e_entry); + entry = (void *)e->e_entry; printf("Kernel entry at 0x%x...\n", (unsigned)entry); dev_cleanup(); Modified: stable/10/sys/boot/uboot/lib/libuboot.h ============================================================================== --- stable/10/sys/boot/uboot/lib/libuboot.h Mon May 25 00:30:26 2015 (r283504) +++ stable/10/sys/boot/uboot/lib/libuboot.h Mon May 25 01:06:55 2015 (r283505) @@ -57,7 +57,10 @@ extern int devs_no; extern struct netif_driver uboot_net; extern struct devsw uboot_storage; -void *uboot_vm_translate(vm_offset_t); +extern uintptr_t uboot_heap_start; +extern uintptr_t uboot_heap_end; + +uint64_t uboot_loadaddr(u_int type, void *data, uint64_t addr); ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len); ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len); ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len); From owner-svn-src-stable@FreeBSD.ORG Mon May 25 01:29:47 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A5B2E4F; Mon, 25 May 2015 01:29:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B3A065E; Mon, 25 May 2015 01:29:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4P1TlCK073596; Mon, 25 May 2015 01:29:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4P1TkvP073591; Mon, 25 May 2015 01:29:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505250129.t4P1TkvP073591@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 May 2015 01:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283510 - in stable/10/sys: arm/arm boot/arm/uboot boot/common boot/uboot/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 01:29:47 -0000 Author: ian Date: Mon May 25 01:29:45 2015 New Revision: 283510 URL: https://svnweb.freebsd.org/changeset/base/283510 Log: MFC r283033, r283062, r283066, r283069: Do not set preload_addr_relocate for ARM. Refactor net_getparams() to make it easier to get params from sources other than bootp and rarp. Add a routine to obtain netboot parameters from the U-Boot env vars Enable the NETIF_OPEN_CLOSE_ONCE option for ubldr. Modified: stable/10/sys/arm/arm/machdep.c stable/10/sys/boot/arm/uboot/Makefile stable/10/sys/boot/common/dev_net.c stable/10/sys/boot/common/dev_net.h stable/10/sys/boot/uboot/lib/net.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Mon May 25 01:22:56 2015 (r283509) +++ stable/10/sys/arm/arm/machdep.c Mon May 25 01:29:45 2015 (r283510) @@ -939,7 +939,6 @@ freebsd_parse_boot_param(struct arm_boot ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); #endif - preload_addr_relocate = KERNVIRTADDR - abp->abp_physaddr; return lastaddr; } #endif Modified: stable/10/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/10/sys/boot/arm/uboot/Makefile Mon May 25 01:22:56 2015 (r283509) +++ stable/10/sys/boot/arm/uboot/Makefile Mon May 25 01:29:45 2015 (r283510) @@ -77,6 +77,8 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif +CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE + .if ${MK_FORTH} != "no" # Enable BootForth BOOT_FORTH= yes Modified: stable/10/sys/boot/common/dev_net.c ============================================================================== --- stable/10/sys/boot/common/dev_net.c Mon May 25 01:22:56 2015 (r283509) +++ stable/10/sys/boot/common/dev_net.c Mon May 25 01:29:45 2015 (r283510) @@ -111,6 +111,8 @@ net_init(void) static int net_open(struct open_file *f, ...) { + char temp[FNAME_SIZE]; + struct iodesc *d; va_list args; char *devname; /* Device part of file name (or NULL). */ int error = 0; @@ -140,6 +142,10 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() succeeded\n"); #endif } + /* + * If network params were not set by netif_open(), try to get + * them via bootp, rarp, etc. + */ if (rootip.s_addr == 0) { /* Get root IP address, and path, etc. */ error = net_getparams(netdev_sock); @@ -151,6 +157,20 @@ net_open(struct open_file *f, ...) return (error); } } + /* + * Set the variables required by the kernel's nfs_diskless + * mechanism. This is the minimum set of variables required to + * mount a root filesystem without needing to obtain additional + * info from bootp or other sources. + */ + d = socktodesc(netdev_sock); + sprintf(temp, "%6D", d->myea, ":"); + setenv("boot.netif.hwaddr", temp, 1); + setenv("boot.netif.ip", inet_ntoa(myip), 1); + setenv("boot.netif.netmask", intoa(netmask), 1); + setenv("boot.netif.gateway", inet_ntoa(gateip), 1); + setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); + setenv("boot.nfsroot.path", rootpath, 1); } netdev_opens++; f->f_devdata = &netdev_sock; @@ -232,10 +252,7 @@ static int net_getparams(int sock) { char buf[MAXHOSTNAMELEN]; - char temp[FNAME_SIZE]; - struct iodesc *d; - int i; - n_long smask; + n_long rootaddr, smask; #ifdef SUPPORT_BOOTP /* @@ -302,21 +319,9 @@ net_getparams(int sock) return (EIO); } exit: - /* - * If present, strip the server's address off of the rootpath - * before passing it along. This allows us to be compatible with - * the kernel's diskless (BOOTP_NFSROOT) booting conventions - */ - for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) - if (rootpath[i] == ':') - break; - if (i && i != FNAME_SIZE && rootpath[i] == ':') { - rootpath[i++] = '\0'; - if (inet_addr(&rootpath[0]) != INADDR_NONE) - rootip.s_addr = inet_addr(&rootpath[0]); - bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); - bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); - } + if ((rootaddr = net_parse_rootpath()) != INADDR_NONE) + rootip.s_addr = rootaddr; + #ifdef NETIF_DEBUG if (debug) { printf("net_open: server addr: %s\n", inet_ntoa(rootip)); @@ -324,15 +329,6 @@ exit: } #endif - d = socktodesc(sock); - sprintf(temp, "%6D", d->myea, ":"); - setenv("boot.netif.ip", inet_ntoa(myip), 1); - setenv("boot.netif.netmask", intoa(netmask), 1); - setenv("boot.netif.gateway", inet_ntoa(gateip), 1); - setenv("boot.netif.hwaddr", temp, 1); - setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); - setenv("boot.nfsroot.path", rootpath, 1); - return (0); } @@ -354,3 +350,24 @@ net_print(int verbose) } printf("\n"); } + +/* + * Strip the server's address off of the rootpath if present and return it in + * network byte order, leaving just the pathname part in the global rootpath. + */ +uint32_t +net_parse_rootpath() +{ + int i; + n_long addr = INADDR_NONE; + + for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) + if (rootpath[i] == ':') + break; + if (i && i != FNAME_SIZE && rootpath[i] == ':') { + rootpath[i++] = '\0'; + addr = inet_addr(&rootpath[0]); + bcopy(&rootpath[i], rootpath, strlen(&rootpath[i])+1); + } + return (addr); +} Modified: stable/10/sys/boot/common/dev_net.h ============================================================================== --- stable/10/sys/boot/common/dev_net.h Mon May 25 01:22:56 2015 (r283509) +++ stable/10/sys/boot/common/dev_net.h Mon May 25 01:29:45 2015 (r283510) @@ -26,5 +26,11 @@ * $FreeBSD$ */ +#ifndef _BOOT_DEV_NET_H_ +#define _BOOT_DEV_NET_H_ + extern struct devsw netdev; +uint32_t net_parse_rootpath(void); + +#endif Modified: stable/10/sys/boot/uboot/lib/net.c ============================================================================== --- stable/10/sys/boot/uboot/lib/net.c Mon May 25 01:22:56 2015 (r283509) +++ stable/10/sys/boot/uboot/lib/net.c Mon May 25 01:29:45 2015 (r283510) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "api_public.h" #include "glue.h" #include "libuboot.h" +#include "dev_net.h" static int net_probe(struct netif *, void *); static int net_match(struct netif *, void *); @@ -84,6 +85,109 @@ struct uboot_softc { static struct uboot_softc uboot_softc; +/* + * get_env_net_params() + * + * Attempt to obtain all the parms we need for netbooting from the U-Boot + * environment. If we fail to obtain the values it may still be possible to + * netboot; the net_dev code will attempt to get the values from bootp, rarp, + * and other such sources. + * + * If rootip.s_addr is non-zero net_dev assumes the required global variables + * are set and skips the bootp inquiry. For that reason, we don't set rootip + * until we've verified that we have at least the minimum required info. + * + * This is called from netif_init() which can result in it getting called + * multiple times, by design. The network code at higher layers zeroes out + * rootip when it closes a network interface, so if it gets opened again we have + * to obtain all this info again. + */ +static void +get_env_net_params() +{ + char *envstr; + in_addr_t rootaddr, serveraddr; + + /* Silently get out right away if we don't have rootpath. */ + if (ub_env_get("rootpath") == NULL) + return; + + /* + * Our own IP address must be valid. Silently get out if it's not set, + * but whine if it's there and we can't parse it. + */ + if ((envstr = ub_env_get("ipaddr")) == NULL) + return; + if ((myip.s_addr = inet_addr(envstr)) == INADDR_NONE) { + printf("Could not parse ipaddr '%s'\n", envstr); + return; + } + + /* + * Netmask is optional, default to the "natural" netmask for our IP, but + * whine if it was provided and we couldn't parse it. + */ + if ((envstr = ub_env_get("netmask")) != NULL && + (netmask = inet_addr(envstr)) == INADDR_NONE) { + printf("Could not parse netmask '%s'\n", envstr); + } + if (netmask == INADDR_NONE) { + if (IN_CLASSA(myip.s_addr)) + netmask = IN_CLASSA_NET; + else if (IN_CLASSB(myip.s_addr)) + netmask = IN_CLASSB_NET; + else + netmask = IN_CLASSC_NET; + } + + /* + * Get optional serverip before rootpath; the latter can override it. + * Whine only if it's present but can't be parsed. + */ + serveraddr = INADDR_NONE; + if ((envstr = ub_env_get("serverip")) != NULL) { + if ((serveraddr = inet_addr(envstr)) == INADDR_NONE) + printf("Could not parse serverip '%s'\n", envstr); + } + + /* + * There must be a rootpath. It may be ip:/path or it may be just the + * path in which case the ip needs to be in serverip. + */ + if ((envstr = ub_env_get("rootpath")) == NULL) + return; + strncpy(rootpath, envstr, sizeof(rootpath) - 1); + rootaddr = net_parse_rootpath(); + if (rootaddr == INADDR_NONE) + rootaddr = serveraddr; + if (rootaddr == INADDR_NONE) { + printf("No server address for rootpath '%s'\n", envstr); + return; + } + rootip.s_addr = rootaddr; + + /* + * Gateway IP is optional unless rootip is on a different net in which + * case whine if it's missing or we can't parse it, and set rootip addr + * to zero, which signals to other network code that network params + * aren't set (so it will try dhcp, bootp, etc). + */ + envstr = ub_env_get("gatewayip"); + if (!SAMENET(myip, rootip, netmask)) { + if (envstr == NULL) { + printf("Need gatewayip for a root server on a " + "different network.\n"); + rootip.s_addr = 0; + return; + } + if ((gateip.s_addr = inet_addr(envstr) == INADDR_NONE)) { + printf("Could not parse gatewayip '%s'\n", envstr); + rootip.s_addr = 0; + return; + } + } +} + static int net_match(struct netif *nif, void *machdep_hint) { @@ -222,6 +326,11 @@ net_init(struct iodesc *desc, void *mach nif->nif_driver->netif_bname, nif->nif_unit); } + /* Attempt to get netboot params from the u-boot env. */ + get_env_net_params(); + if (myip.s_addr != 0) + desc->myip = myip; + #if defined(NETIF_DEBUG) printf("network: %s%d attached to %s\n", nif->nif_driver->netif_bname, nif->nif_unit, ether_sprintf(desc->myea)); From owner-svn-src-stable@FreeBSD.ORG Mon May 25 11:30:37 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA07ED3F; Mon, 25 May 2015 11:30:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6FBDC58; Mon, 25 May 2015 11:30:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4PBUbE2069511; Mon, 25 May 2015 11:30:37 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4PBUbPh069510; Mon, 25 May 2015 11:30:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505251130.t4PBUbPh069510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 May 2015 11:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r283518 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 11:30:37 -0000 Author: avg Date: Mon May 25 11:30:36 2015 New Revision: 283518 URL: https://svnweb.freebsd.org/changeset/base/283518 Log: MFC r282632: MFV r282630: 5809 Blowaway full receive in v1 pool causes kernel panic Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 10:51:40 2015 (r283517) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:30:36 2015 (r283518) @@ -996,7 +996,8 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t } dsobj = dsl_dataset_create_sync(ds->ds_dir, recv_clone_name, snap, crflags, drba->drba_cred, tx); - dsl_dataset_rele(snap, FTAG); + if (drba->drba_snapobj != 0) + dsl_dataset_rele(snap, FTAG); dsl_dataset_rele(ds, FTAG); } else { dsl_dir_t *dd; From owner-svn-src-stable@FreeBSD.ORG Mon May 25 11:32:11 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06C01E88; Mon, 25 May 2015 11:32:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7919DE3; Mon, 25 May 2015 11:32:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4PBWAok073437; Mon, 25 May 2015 11:32:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4PBWAox073436; Mon, 25 May 2015 11:32:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505251132.t4PBWAox073436@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 May 2015 11:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283519 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 11:32:11 -0000 Author: avg Date: Mon May 25 11:32:10 2015 New Revision: 283519 URL: https://svnweb.freebsd.org/changeset/base/283519 Log: MFC r282632: MFV r282630: 5809 Blowaway full receive in v1 pool causes kernel panic Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:30:36 2015 (r283518) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:32:10 2015 (r283519) @@ -1142,7 +1142,8 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t } dsobj = dsl_dataset_create_sync(ds->ds_dir, recv_clone_name, snap, crflags, drba->drba_cred, tx); - dsl_dataset_rele(snap, FTAG); + if (drba->drba_snapobj != 0) + dsl_dataset_rele(snap, FTAG); dsl_dataset_rele(ds, FTAG); } else { dsl_dir_t *dd; From owner-svn-src-stable@FreeBSD.ORG Mon May 25 11:33:46 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E565A9; Mon, 25 May 2015 11:33:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF9AFE15; Mon, 25 May 2015 11:33:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4PBXj0U073733; Mon, 25 May 2015 11:33:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4PBXj2F073732; Mon, 25 May 2015 11:33:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505251133.t4PBXj2F073732@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 May 2015 11:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283520 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 11:33:46 -0000 Author: avg Date: Mon May 25 11:33:45 2015 New Revision: 283520 URL: https://svnweb.freebsd.org/changeset/base/283520 Log: MFC r282473: dmu_recv_end_check: don't leak hold if dsl_destroy_snapshot_check_impl fails Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:32:10 2015 (r283519) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:33:45 2015 (r283520) @@ -2011,7 +2011,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold_obj(dp, obj, FTAG, &snap); if (error != 0) - return (error); + break; if (snap->ds_dir != origin_head->ds_dir) error = SET_ERROR(EINVAL); if (error == 0) { @@ -2021,7 +2021,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t * obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); if (error != 0) - return (error); + break; + } + if (error != 0) { + dsl_dataset_rele(origin_head, FTAG); + return (error); } } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, From owner-svn-src-stable@FreeBSD.ORG Mon May 25 11:33:58 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1379B1E0; Mon, 25 May 2015 11:33:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00C18E1D; Mon, 25 May 2015 11:33:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4PBXvp9073809; Mon, 25 May 2015 11:33:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4PBXvYG073808; Mon, 25 May 2015 11:33:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505251133.t4PBXvYG073808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 May 2015 11:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r283521 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 11:33:58 -0000 Author: avg Date: Mon May 25 11:33:57 2015 New Revision: 283521 URL: https://svnweb.freebsd.org/changeset/base/283521 Log: MFC r282473: dmu_recv_end_check: don't leak hold if dsl_destroy_snapshot_check_impl fails Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:33:45 2015 (r283520) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon May 25 11:33:57 2015 (r283521) @@ -1755,7 +1755,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold_obj(dp, obj, FTAG, &snap); if (error != 0) - return (error); + break; if (snap->ds_dir != origin_head->ds_dir) error = SET_ERROR(EINVAL); if (error == 0) { @@ -1765,7 +1765,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t * obj = snap->ds_phys->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); if (error != 0) - return (error); + break; + } + if (error != 0) { + dsl_dataset_rele(origin_head, FTAG); + return (error); } } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, From owner-svn-src-stable@FreeBSD.ORG Mon May 25 11:35:28 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE360359; Mon, 25 May 2015 11:35:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2303E3E; Mon, 25 May 2015 11:35:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4PBZSRm074141; Mon, 25 May 2015 11:35:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4PBZSYT074138; Mon, 25 May 2015 11:35:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505251135.t4PBZSYT074138@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 May 2015 11:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283522 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 11:35:28 -0000 Author: avg Date: Mon May 25 11:35:27 2015 New Revision: 283522 URL: https://svnweb.freebsd.org/changeset/base/283522 Log: MFC r282475: zfs: do not hold an extra reference on a root vnode Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon May 25 11:33:57 2015 (r283521) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon May 25 11:35:27 2015 (r283522) @@ -261,10 +261,6 @@ VTOZ(vnode_t *vp) } \ } -/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ -#define ZFS_ENTER_NOERROR(zfsvfs) \ - rrm_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) - /* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrm_exit(&(zfsvfs)->z_teardown_lock, FTAG) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 25 11:33:57 2015 (r283521) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 25 11:35:27 2015 (r283522) @@ -1222,9 +1222,6 @@ zfs_domount(vfs_t *vfsp, char *osname) } vfs_mountedfrom(vfsp, osname); - /* Grab extra reference. */ - VERIFY(VFS_ROOT(vfsp, LK_EXCLUSIVE, &vp) == 0); - VOP_UNLOCK(vp, 0); if (!zfsvfs->z_issnap) zfsctl_create(zfsvfs); @@ -1802,7 +1799,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t znode_t *rootzp; int error; - ZFS_ENTER_NOERROR(zfsvfs); + ZFS_ENTER(zfsvfs); error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); if (error == 0) @@ -1977,7 +1974,7 @@ zfs_umount(vfs_t *vfsp, int fflag) /* * Flush all the files. */ - ret = vflush(vfsp, 1, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); + ret = vflush(vfsp, 0, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); if (ret != 0) { if (!zfsvfs->z_issnap) { zfsctl_create(zfsvfs); From owner-svn-src-stable@FreeBSD.ORG Mon May 25 11:36:15 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C70C0496; Mon, 25 May 2015 11:36:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A34DE4B; Mon, 25 May 2015 11:36:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4PBaFik074309; Mon, 25 May 2015 11:36:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4PBaFgZ074307; Mon, 25 May 2015 11:36:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505251136.t4PBaFgZ074307@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 May 2015 11:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r283523 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 11:36:15 -0000 Author: avg Date: Mon May 25 11:36:14 2015 New Revision: 283523 URL: https://svnweb.freebsd.org/changeset/base/283523 Log: MFC r282475: zfs: do not hold an extra reference on a root vnode Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon May 25 11:35:27 2015 (r283522) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon May 25 11:36:14 2015 (r283523) @@ -263,10 +263,6 @@ VTOZ(vnode_t *vp) } \ } -/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ -#define ZFS_ENTER_NOERROR(zfsvfs) \ - rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) - /* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 25 11:35:27 2015 (r283522) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 25 11:36:14 2015 (r283523) @@ -1224,9 +1224,6 @@ zfs_domount(vfs_t *vfsp, char *osname) } vfs_mountedfrom(vfsp, osname); - /* Grab extra reference. */ - VERIFY(VFS_ROOT(vfsp, LK_EXCLUSIVE, &vp) == 0); - VOP_UNLOCK(vp, 0); if (!zfsvfs->z_issnap) zfsctl_create(zfsvfs); @@ -1804,7 +1801,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t znode_t *rootzp; int error; - ZFS_ENTER_NOERROR(zfsvfs); + ZFS_ENTER(zfsvfs); error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); if (error == 0) @@ -1979,7 +1976,7 @@ zfs_umount(vfs_t *vfsp, int fflag) /* * Flush all the files. */ - ret = vflush(vfsp, 1, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); + ret = vflush(vfsp, 0, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); if (ret != 0) { if (!zfsvfs->z_issnap) { zfsctl_create(zfsvfs); From owner-svn-src-stable@FreeBSD.ORG Mon May 25 22:12:31 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5593571A; Mon, 25 May 2015 22:12:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4171FCCD; Mon, 25 May 2015 22:12:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4PMCVre098842; Mon, 25 May 2015 22:12:31 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4PMCVZW098841; Mon, 25 May 2015 22:12:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505252212.t4PMCVZW098841@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 25 May 2015 22:12: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: r283545 - stable/10/release 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 22:12:31 -0000 Author: gjb Date: Mon May 25 22:12:30 2015 New Revision: 283545 URL: https://svnweb.freebsd.org/changeset/base/283545 Log: MFC r282785, r282787, r282789, r282790, r282791, r282792, r282793, r282794, r282795, r282796, r282797, r282798, r282799, r283265, r283266, r283268, r283271, r283272, r283298, r283302: Add a new file, Makefile.mirrors, which is intended to replace a 474-line kludge of a shell script to pre-create the directory hierarchy on ftp-master. This is not in any way connected to the build, and there is no intention to do so. This only intent here is to try to make things a little bit easier. Always use the 'make install' directory as the source for images. For RE purposes, we use the default (/R within the chroot), so this helps avoid copying files multiple times and xz(1)-compressing additional times when not needed. Fix staging virtual machine images for ftp propagation. This Makefile is not for general consumption. Sponsored by: The FreeBSD Foundation Added: stable/10/release/Makefile.mirrors - copied, changed from r282785, head/release/Makefile.mirrors Modified: Directory Properties: stable/10/ (props changed) Copied and modified: stable/10/release/Makefile.mirrors (from r282785, head/release/Makefile.mirrors) ============================================================================== --- head/release/Makefile.mirrors Mon May 11 22:14:03 2015 (r282785, copy source) +++ stable/10/release/Makefile.mirrors Mon May 25 22:12:30 2015 (r283545) @@ -5,27 +5,29 @@ # You probably do not want to use this. Really. # You have been warned. # +# Seriously. +# +# Don't use this unless you know why you're using it. +# # $FreeBSD$ # .include "${.CURDIR}/Makefile" -FTPDIR?= /ftp +RELEASEDIR?= /R +FTPDIR?= ${RELEASEDIR}/ftp-stage STAGE_TARGETS?= iso-images-stage +.if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD)) +. if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm" +EMBEDDED= 1 +. endif +.endif + # snapshot .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" SNAPSHOT= 1 TLD?= ${FTPDIR}/snapshots -BUILDDATE!= date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d -. if ${TARGET} == "arm" && ${TARGET_ARCH} == "armv6" -. if !defined(BOARDNAME) || empty(BOARDNAME) -BOARDNAME= ${KERNCONF} -. endif -_SNAP_SUFFIX:= -${BOARDNAME}-${BUILDDATE} -. else # not arm/armv6 -_SNAP_SUFFIX:= -${BUILDDATE} -. endif . for _D in /usr/bin /usr/local/bin . for _S in svnversion svnliteversion . if exists(${_D}/${_S}) @@ -33,9 +35,16 @@ SVNVERSION?= ${_D}/${_S} . endif . endfor . endfor +. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh) +BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d +. else +BUILDDATE!= date +%Y%m%d +. endif . if exists(${SVNVERSION}) && !empty(SVNVERSION) SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile -_SNAP_SUFFIX:= ${_SNAP_SUFFIX}-r${SVNREVISION} +_SNAP_SUFFIX:= -r${SVNREVISION}-${BUILDDATE} +. else +_SNAP_SUFFIX:= -${BUILDDATE} . endif .else # release @@ -43,6 +52,20 @@ SNAPSHOT= TLD?= ${FTPDIR}/releases .endif +.if defined(EMBEDDED) && !empty(EMBEDDED) +. if ${TARGET} == "arm" && ${TARGET_ARCH} == "armv6" +. if !defined(BOARDNAME) && empty(BOARDNAME) +BOARDNAME:= ${KERNCONF} +. else +OLDNAME:= ${KERNCONF} +. endif +. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" +SNAPSHOT= 1 +. endif +IMAGES:= img +. endif # arm/armv6 +.endif # embedded + .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) STAGE_TARGETS+= vm-images-stage VM_DIR= ${TLD}/VM-IMAGES/${REVISION}-${BRANCH}/${TARGET_ARCH} @@ -54,75 +77,177 @@ SNAP_SUFFIX!= echo ${_SNAP_SUFFIX:S,^-, ISO_DIR= ${TLD}/${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION} FTP_DIR= ${TLD}/${TARGET}/${TARGET_ARCH}/${REVISION}-${BRANCH} +remove-old-bits: + rm -rf ${FTPDIR} + iso-images-stage: mkdir -p ${ISO_DIR} mkdir -p ${TLD}/ISO-IMAGES/${REVISION} -.for IMAGE in ${IMAGES} - cp -p ${.OBJDIR}/${IMAGE} ${ISO_DIR}/${OSRELEASE}-${IMAGE} -. if exists(/R/${IMAGE}.xz) - cp -p ${.OBJDIR}/${IMAGE}.xz ${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz -. endif -.endfor -.if defined(SNAPSHOT) && !empty(SNAPSHOT) -. for IMAGE in ${IMAGES} - cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE} \ - ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} +.if exists(${RELEASEDIR}) + @# Assume we have images to copy. +. if defined(SNAPSHOT) && !empty(SNAPSHOT) + cd ${RELEASEDIR} && rm -f CHECKSUM.* +. for IMAGE in ${IMAGES} +. if defined(EMBEDDED) && !empty(EMBEDDED) +. if defined(OLDNAME) && !empty(OLDNAME) + @# arm/armv6 IMX6 -> WANDBOARD, for example. + cd ${RELEASEDIR} && \ + mv ${OSRELEASE}-${OLDNAME}.${IMAGE}.xz \ + ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz +. endif + cd ${RELEASEDIR} && \ + mv ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \ + ${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz + cp -p ${RELEASEDIR}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz \ + ${ISO_DIR}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ - ../../${TARGET}/${TARGET_ARCH}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} -. endfor -. for CHECKSUM in ${CHECKSUM_FILES} -. if exists(${ISO_DIR}/CHECKSUM.${CHECKSUM}) - rm -f ${ISO_DIR}/CHECKSUM.${CHECKSUM} -. endif - cd ${ISO_DIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ - CHECKSUM.${CHECKSUM}-${REVISION}-${BRANCH}-${SNAP_SUFFIX} -. endfor -.else # !snapshot - cd ${TLD}/ISO-IMAGES/${REVISION} && ln -s \ - ../../${TARGET}/${TARGET_ARCH}/${OSRELEASE}-${IMAGE} . - cd ${ISO_DIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ - CHECKSUM.${CHECKSUM}-${REVISION}-${BRANCH}-${SNAP_SUFFIX} -.endif -.if exists(${.OBJDIR}/ftp) + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz +. endif # not embedded +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}) + cd ${RELEASEDIR} && \ + mv ${OSRELEASE}-${IMAGE} \ + ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} || true + cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} \ + ${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} +. endif +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz) + cd ${RELEASEDIR} && \ + mv ${OSRELEASE}-${IMAGE}.xz \ + ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz || true + cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz \ + ${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz +. endif +. endfor # images loop + cd ${RELEASEDIR} && rm -f CHECKSUM.* +. for CHECKSUM in ${CHECKSUM_FILES} +. if defined(EMBEDDED) && !empty(EMBEDDED) + cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ + CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} + cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} \ + ${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} +. else # not embedded + cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ + CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} + cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} \ + ${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} +. endif # +. endfor # checksum files +. else # not snapshot +. for IMAGE in ${IMAGES} +. if defined(EMBEDDED) && !empty(EMBEDDED) +. if defined(OLDNAME) && !empty(OLDNAME) + @# arm/armv6 IMX6 -> WANDBOARD, for example. + cd ${RELEASEDIR} && \ + mv ${OSRELEASE}-${OLDNAME}.${IMAGE}.xz \ + ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz +. endif + cp -p ${RELEASEDIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \ + ${ISO_DIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz +. endif # not embedded +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}) + cd ${RELEASEDIR} && \ + cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \ + ${ISO_DIR}/${OSRELEASE}-${IMAGE} + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE} +. endif +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz) + cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \ + ${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}.xz +. endif +. endfor # images loop + cd ${RELEASEDIR} && rm -f CHECKSUM.* +. for CHECKSUM in ${CHECKSUM_FILES} +. if defined(EMBEDDED) && !empty(EMBEDDED) + cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ + CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} + cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} \ + ${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} +. else # not embedded + cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ + CHECKSUM.${CHECKSUM}-${OSRELEASE} + cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE} \ + ${ISO_DIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE} + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE} +. endif +. endfor # checksum files +. endif # release +. if exists(${RELEASEDIR}/ftp) mkdir -p ${FTP_DIR} - cp ${.OBJDIR}/ftp/*.txz ${.OBJDIR}/ftp/MANIFEST ${FTP_DIR} + cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR} cd ${TLD}/${TARGET} && \ ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \ ${REVISION}-${BRANCH} -.endif +. endif +.endif # no RELEASEDIR vm-images-stage: - @true -# mkdir -p ${VM_DIR} -#.if defined(SNAPSHOT) && !empty(SNAPSHOT) -# mkdir -p ${VM_DIR}/${BUILDDATE} -#. if exists(${VM_DIR}/Latest) -# unlink ${VM_DIR}/Latest -# cd ${VM_DIR} && ln -s ${BUILDDATE} Latest -#. endif -#. for VMIMAGE in ${VMIMAGES} -# cd /R/vmimages && cp -p ${VMIMAGE}.xz \ -# ${VM_DIR}/${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}-${VMIMAGE}.xz -# cd ${VM_DIR}/Latest && ln -s \ -# ../${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}-${VMIMAGE}.xz \ -# ${OSRELEASE}-${VMIMAGE}.xz -#. endfor -#. for CHECKSUM in ${CHECKSUM_FILES} -#. if exists(${VM_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM}) -# rm -f ${VM_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM} -#. endif -# cd ${VM_DIR}/${BUILDDATE} && ${CHECKSUM:tl} ${OSRELEASE}* > \ -# CHECKSUM.${CHECKSUM}-${REVISION}-${BRANCH}-${SNAP_SUFFIX} -# cd ${VM_DIR}/Latest && ln -s \ -# ${VM_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \ -# CHECKSUM.${CHECKSUM} -#. endfor -#.else # !snapshot -#. for CHECKSUM in ${CHECKSUM_FILES} -# cd /R/vmimages && cp -p CHECKSUM.${CHECKSUM}* \ -# ${VM_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} -#.endif + mkdir -p ${VM_DIR} +.if defined(SNAPSHOT) && !empty(SNAPSHOT) +. if exists(${VM_DIR}/Latest) + rm -rf ${VM_DIR}/Latest +. endif + mkdir -p ${VM_DIR}/Latest + mkdir -p ${VM_DIR}/${BUILDDATE} +. for VMFORMAT in ${VMFORMATS} + cd ${RELEASEDIR}/vmimages && \ + mv ${OSRELEASE}.${VMFORMAT}.xz \ + ${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz + cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz \ + ${VM_DIR}/${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz + cd ${VM_DIR}/Latest && \ + ln -s ../${BUILDDATE}/${OSRELEASE}-${SNAP_SUFFIX}.${VMFORMAT}.xz \ + ${OSRELEASE}.${VMFORMAT}.xz +. endfor + cd ${RELEASEDIR}/vmimages && rm -f CHECKSUM.* +. for CHECKSUM in ${CHECKSUM_FILES} + cd ${RELEASEDIR}/vmimages && \ + ${CHECKSUM:tl} ${OSRELEASE}* > CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} + cp -p ${RELEASEDIR}/vmimages/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \ + ${VM_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} + cd ${VM_DIR}/Latest && \ + ln -s ../${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \ + CHECKSUM.${CHECKSUM} +. endfor +.else # not snapshot +. if exists(${VM_DIR}/Latest) + rm -rf ${VM_DIR}/Latest +. endif + mkdir -p ${VM_DIR}/Latest +. for VMFORMAT in ${VMFORMATS} + cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}.${VMFORMAT}.xz \ + ${VM_DIR}/Latest/${OSRELEASE}.${VMFORMAT}.xz +. endfor +. for CHECKSUM in ${CHECKSUM_FILES} + cp -p ${RELEASEDIR}/vmimages/CHECKSUM.${CHECKSUM} \ + ${VM_DIR}/Latest/CHECKSUM.${CHECKSUM} +. endfor +.endif -ftp-stage: ${STAGE_TARGETS} +ftp-stage: remove-old-bits ${STAGE_TARGETS} From owner-svn-src-stable@FreeBSD.ORG Tue May 26 00:44:30 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B10A868D; Tue, 26 May 2015 00:44:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2BF20E; Tue, 26 May 2015 00:44:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4Q0iUh5074821; Tue, 26 May 2015 00:44:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4Q0iUvk074820; Tue, 26 May 2015 00:44:30 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505260044.t4Q0iUvk074820@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 26 May 2015 00:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283548 - stable/10/release/i386 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 00:44:30 -0000 Author: gjb Date: Tue May 26 00:44:29 2015 New Revision: 283548 URL: https://svnweb.freebsd.org/changeset/base/283548 Log: MFC r283307: Use mkimg(1) to create the i386 memstick images, similar to how is done for amd64. The exception here is there is no EFI partition for i386. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/i386/make-memstick.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/i386/make-memstick.sh ============================================================================== --- stable/10/release/i386/make-memstick.sh Mon May 25 23:27:13 2015 (r283547) +++ stable/10/release/i386/make-memstick.sh Tue May 26 00:44:29 2015 (r283548) @@ -29,20 +29,13 @@ if [ -e ${2} ]; then fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab -makefs -B little -o label=FreeBSD_Install ${2} ${1} +makefs -B little -o label=FreeBSD_Install ${2}.part ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab -unit=$(mdconfig -a -t vnode -f ${2}) -if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 -fi -gpart create -s BSD ${unit} -gpart bootcode -b ${1}/boot/boot ${unit} -gpart add -t freebsd-ufs ${unit} -mdconfig -d -u ${unit} +mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} +rm ${2}.part From owner-svn-src-stable@FreeBSD.ORG Tue May 26 02:18:11 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0C87749; Tue, 26 May 2015 02:18:11 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74A48A49; Tue, 26 May 2015 02:18:11 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4Q2IB48020185; Tue, 26 May 2015 02:18:11 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4Q2IBld020184; Tue, 26 May 2015 02:18:11 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201505260218.t4Q2IBld020184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Tue, 26 May 2015 02:18: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: r283552 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 02:18:11 -0000 Author: julian Date: Tue May 26 02:18:10 2015 New Revision: 283552 URL: https://svnweb.freebsd.org/changeset/base/283552 Log: MFH: r283105 Only several years late, catch the psignal man page up to the fact that psignal has been renamed to kern_psignal since 9.0. Modified: stable/10/share/man/man9/psignal.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/psignal.9 ============================================================================== --- stable/10/share/man/man9/psignal.9 Tue May 26 01:40:33 2015 (r283551) +++ stable/10/share/man/man9/psignal.9 Tue May 26 02:18:10 2015 (r283552) @@ -33,6 +33,7 @@ .Os .Sh NAME .Nm psignal , +.Nm kern_psignal , .Nm pgsignal , .Nm gsignal , .Nm tdsignal @@ -41,7 +42,7 @@ .In sys/types.h .In sys/signalvar.h .Ft void -.Fn psignal "struct proc *p" "int signum" +.Fn kern_psignal "struct proc *p" "int signum" .Ft void .Fn pgsignal "struct pgrp *pgrp" "int signum" "int checkctty" .Ft void @@ -56,16 +57,21 @@ common to all three functions should be .Bq 1- Ns Dv NSIG . .Pp The -.Fn psignal +.Fn kern_psignal function posts signal number .Fa signum to the process represented by the process structure .Fa p . +The +.Fn kernel_psignal +function used to be called +.Fn psignal +but was renamed. With a few exceptions noted below, the target process signal disposition is updated and is marked as runnable, so further handling of the signal is done in the context of the target process after a context switch. Note that -.Fn psignal +.Fn kern_psignal does not by itself cause a context switch to happen. .Pp The target process is not marked as runnable in the following cases: @@ -91,7 +97,7 @@ regardless of the signal action .El .Pp If the target process is being traced -.Fn psignal +.Fn kern_psignal behaves as if the target process were taking the default action for .Fa signum . This allows the tracing process to be notified of the signal. @@ -113,7 +119,7 @@ of the process group structure pointed at by .Fa pgrp and calling -.Fn psignal +.Fn kern_psignal as appropriate. If .Fa pgrp @@ -149,3 +155,10 @@ to the thread represented by the thread .Xr sigaction 2 , .Xr signal 9 , .Xr tsleep 9 +.Sh HISTORY +The +.Fn psignal +call was renamed to +.Fn kern_psignal +in +.Fx 9.0 . From owner-svn-src-stable@FreeBSD.ORG Tue May 26 02:50:11 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11B1FBAF; Tue, 26 May 2015 02:50:11 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED37122; Tue, 26 May 2015 02:50:10 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by wgme6 with SMTP id e6so16200968wgm.2; Mon, 25 May 2015 19:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KZTp6ShwudY8ztIXOw9r3wrJjZjplbtVKubq56HdjsM=; b=JLJAp8rOgrsfPRa4ChilqAdnTvOu3qBNbb46TLcKOtZs1sH8CIapRk/MjL+wRRgXtz 68waD+VHBnjFLNidYm0xFYl3QGCc/5eUWIvKMHiTLhaCF/AdjYQM8kO7HcJZLOxoou3B Lne6uePjNt59obdAi1m9OersnkN/to0cze5KMdE5Ujx6jqexguI7G+xv93pIrRy/KFvL Qpcu9qJ3fADeVcQxKfof72iPsUlLhd3+FmMq+JtzFphxb8/CJ+REs5LQbJgLUlaH3Gk4 J0KGeyMCnq8Vx5OqIlZuuXpB2kMD+K8nPm4Fj0T2rwUfKDfuKuFyvmNVYKGdMUlNczrM Dwog== MIME-Version: 1.0 X-Received: by 10.180.14.135 with SMTP id p7mr36149776wic.8.1432608609036; Mon, 25 May 2015 19:50:09 -0700 (PDT) Received: by 10.27.77.201 with HTTP; Mon, 25 May 2015 19:50:08 -0700 (PDT) In-Reply-To: <201505260218.t4Q2IBld020184@svn.freebsd.org> References: <201505260218.t4Q2IBld020184@svn.freebsd.org> Date: Mon, 25 May 2015 22:50:08 -0400 Message-ID: Subject: Re: svn commit: r283552 - stable/10/share/man/man9 From: Benjamin Kaduk To: Julian Elischer Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 02:50:11 -0000 On Mon, May 25, 2015 at 10:18 PM, Julian Elischer wrote: > Author: julian > Date: Tue May 26 02:18:10 2015 > New Revision: 283552 > URL: https://svnweb.freebsd.org/changeset/base/283552 > > Log: > MFH: r283105 > Only several years late, catch the psignal man page up to the > fact that psignal has been renamed to kern_psignal since 9.0. > Why did you not merge r283114 as well? -Ben From owner-svn-src-stable@FreeBSD.ORG Tue May 26 02:50:31 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7ECD3CDF; Tue, 26 May 2015 02:50:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D49D15F; Tue, 26 May 2015 02:50:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4Q2oVh9035947; Tue, 26 May 2015 02:50:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4Q2oVrq035946; Tue, 26 May 2015 02:50:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201505260250.t4Q2oVrq035946@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 May 2015 02:50: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: r283553 - stable/10/sys/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 02:50:31 -0000 Author: emaste Date: Tue May 26 02:50:30 2015 New Revision: 283553 URL: https://svnweb.freebsd.org/changeset/base/283553 Log: MFC r283110: Add GRP_COMDAT section group flag to ELF header Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/sys/elf_common.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/elf_common.h ============================================================================== --- stable/10/sys/sys/elf_common.h Tue May 26 02:18:10 2015 (r283552) +++ stable/10/sys/sys/elf_common.h Tue May 26 02:50:30 2015 (r283553) @@ -329,6 +329,9 @@ typedef struct { #define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */ #define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */ +/* Flags for section groups. */ +#define GRP_COMDAT 0x1 /* COMDAT semantics. */ + /* Values for p_type. */ #define PT_NULL 0 /* Unused entry. */ #define PT_LOAD 1 /* Loadable segment. */ From owner-svn-src-stable@FreeBSD.ORG Tue May 26 03:55:28 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2850890B; Tue, 26 May 2015 03:55:28 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E7EAB405; Tue, 26 May 2015 03:55:27 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-225-35.lns20.per1.internode.on.net [121.45.225.35]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t4Q3tFiT064438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 25 May 2015 20:55:19 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5563EE9E.6030002@freebsd.org> Date: Tue, 26 May 2015 11:55:10 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Benjamin Kaduk CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r283552 - stable/10/share/man/man9 References: <201505260218.t4Q2IBld020184@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 03:55:28 -0000 On 5/26/15 10:50 AM, Benjamin Kaduk wrote: > On Mon, May 25, 2015 at 10:18 PM, Julian Elischer > > wrote: > > Author: julian > Date: Tue May 26 02:18:10 2015 > New Revision: 283552 > URL: https://svnweb.freebsd.org/changeset/base/283552 > > Log: > MFH: r283105 > Only several years late, catch the psignal man page up to the > fact that psignal has been renamed to kern_psignal since 9.0. > > > Why did you not merge r283114 as well? > > -Ben I didn't do it.. didn't even see it. From owner-svn-src-stable@FreeBSD.ORG Tue May 26 03:58:19 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1322DAE5; Tue, 26 May 2015 03:58:19 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0096B5FE; Tue, 26 May 2015 03:58:19 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4Q3wIYr070047; Tue, 26 May 2015 03:58:18 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4Q3wIld070046; Tue, 26 May 2015 03:58:18 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201505260358.t4Q3wIld070046@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Tue, 26 May 2015 03:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283554 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 03:58:19 -0000 Author: julian Date: Tue May 26 03:58:18 2015 New Revision: 283554 URL: https://svnweb.freebsd.org/changeset/base/283554 Log: MFH: r283114 Fixup to the kern_psignal manpage r283105 misspelled kern_psignal as kernel_psignal in one occurrence, and added trailing whitespace. While here, change 'call' to the more standard 'function', and say why the name was changed (taken from the commit message for r225617). Modified: stable/10/share/man/man9/psignal.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/psignal.9 ============================================================================== --- stable/10/share/man/man9/psignal.9 Tue May 26 02:50:30 2015 (r283553) +++ stable/10/share/man/man9/psignal.9 Tue May 26 03:58:18 2015 (r283554) @@ -63,10 +63,11 @@ function posts signal number to the process represented by the process structure .Fa p . The -.Fn kernel_psignal -function used to be called +.Fn kern_psignal +function used to be called .Fn psignal -but was renamed. +but was renamed in order to eliminate a name collision with the libc +function of that name and facilitate code reuse. With a few exceptions noted below, the target process signal disposition is updated and is marked as runnable, so further handling of the signal is done in the context of the target process after a context switch. @@ -158,7 +159,7 @@ to the thread represented by the thread .Sh HISTORY The .Fn psignal -call was renamed to +function was renamed to .Fn kern_psignal -in +in .Fx 9.0 . From owner-svn-src-stable@FreeBSD.ORG Tue May 26 17:15:25 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47A76ABF; Tue, 26 May 2015 17:15:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20939A03; Tue, 26 May 2015 17:15:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2F6F0B97E; Tue, 26 May 2015 13:15:24 -0400 (EDT) From: John Baldwin To: Julian Elischer Cc: Benjamin Kaduk , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r283552 - stable/10/share/man/man9 Date: Tue, 26 May 2015 13:06:55 -0400 Message-ID: <8588022.SvtbAhTXay@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <5563EE9E.6030002@freebsd.org> References: <201505260218.t4Q2IBld020184@svn.freebsd.org> <5563EE9E.6030002@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 26 May 2015 13:15:24 -0400 (EDT) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 17:15:25 -0000 On Tuesday, May 26, 2015 11:55:10 AM Julian Elischer wrote: > On 5/26/15 10:50 AM, Benjamin Kaduk wrote: > > On Mon, May 25, 2015 at 10:18 PM, Julian Elischer > > > wrote: > > > > Author: julian > > Date: Tue May 26 02:18:10 2015 > > New Revision: 283552 > > URL: https://svnweb.freebsd.org/changeset/base/283552 > > > > Log: > > MFH: r283105 > > Only several years late, catch the psignal man page up to the > > fact that psignal has been renamed to kern_psignal since 9.0. > > > > > > Why did you not merge r283114 as well? > > > > -Ben > I didn't do it.. didn't even see it. Part of my standing practice with merges is to actually open the link to the change in viewvc in a web browser and open the revision logs of each changed file in a new tab. In each tab I clear the sticky revision and then check for any followup commits that might have fixed issues in the previous change. For smaller changes where I know there wasn't a followup I will skip this, but if I'm not sure I use this to check for followups. -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Tue May 26 21:12:02 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8CB0466; Tue, 26 May 2015 21:12:02 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6717C00; Tue, 26 May 2015 21:12:02 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4QLC2sZ088370; Tue, 26 May 2015 21:12:02 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4QLC2xr088369; Tue, 26 May 2015 21:12:02 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201505262112.t4QLC2xr088369@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 26 May 2015 21:12: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: r283583 - stable/10/contrib/tcpdump 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 21:12:03 -0000 Author: luigi Date: Tue May 26 21:12:02 2015 New Revision: 283583 URL: https://svnweb.freebsd.org/changeset/base/283583 Log: MFC: 272451, 272653 add CAP_EVENT so that we can poll() on netmap and pcap file descriptors Modified: stable/10/contrib/tcpdump/tcpdump.c Modified: stable/10/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/10/contrib/tcpdump/tcpdump.c Tue May 26 21:03:41 2015 (r283582) +++ stable/10/contrib/tcpdump/tcpdump.c Tue May 26 21:12:02 2015 (r283583) @@ -1486,7 +1486,12 @@ main(int argc, char **argv) if (RFileName == NULL && VFileName == NULL) { static const unsigned long cmds[] = { BIOCGSTATS }; - cap_rights_init(&rights, CAP_IOCTL, CAP_READ); + /* + * The various libpcap devices use a combination of + * read (bpf), ioctl (bpf, netmap), poll (netmap). + * Grant the relevant access rights, sorted by name. + */ + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ); if (cap_rights_limit(pcap_fileno(pd), &rights) < 0 && errno != ENOSYS) { error("unable to limit pcap descriptor"); From owner-svn-src-stable@FreeBSD.ORG Wed May 27 08:23:24 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13E6D358; Wed, 27 May 2015 08:23:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 016BCC70; Wed, 27 May 2015 08:23:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4R8NN12035166; Wed, 27 May 2015 08:23:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4R8NNVV035165; Wed, 27 May 2015 08:23:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505270823.t4R8NNVV035165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 May 2015 08:23: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: r283597 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 08:23:24 -0000 Author: kib Date: Wed May 27 08:23:23 2015 New Revision: 283597 URL: https://svnweb.freebsd.org/changeset/base/283597 Log: MFC r283153: Remove the write-only variable phent. Modified: stable/10/lib/libc/gen/dlfcn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/dlfcn.c ============================================================================== --- stable/10/lib/libc/gen/dlfcn.c Wed May 27 07:05:56 2015 (r283596) +++ stable/10/lib/libc/gen/dlfcn.c Wed May 27 08:23:23 2015 (r283597) @@ -149,10 +149,8 @@ static void dl_init_phdr_info(void) { Elf_Auxinfo *auxp; - size_t phent; unsigned int i; - phent = 0; for (auxp = __elf_aux_vector; auxp->a_type != AT_NULL; auxp++) { switch (auxp->a_type) { case AT_BASE: @@ -165,9 +163,6 @@ dl_init_phdr_info(void) phdr_info.dlpi_phdr = (const Elf_Phdr *)auxp->a_un.a_ptr; break; - case AT_PHENT: - phent = auxp->a_un.a_val; - break; case AT_PHNUM: phdr_info.dlpi_phnum = (Elf_Half)auxp->a_un.a_val; break; From owner-svn-src-stable@FreeBSD.ORG Wed May 27 08:30:17 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C7BE50A; Wed, 27 May 2015 08:30:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0B7D7D; Wed, 27 May 2015 08:30:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4R8UGwQ036708; Wed, 27 May 2015 08:30:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4R8UG7R036707; Wed, 27 May 2015 08:30:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505270830.t4R8UG7R036707@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 May 2015 08:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283598 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 08:30:17 -0000 Author: kib Date: Wed May 27 08:30:16 2015 New Revision: 283598 URL: https://svnweb.freebsd.org/changeset/base/283598 Log: MFC r283162: Set VPO_UNMANAGED on the freed page when insertion of the page into the object queue failed, to satisfy the assertion. MFC r283163: Do grammar fix in the comment to record the right commit message for r283162. Modified: stable/10/sys/vm/vm_page.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_page.c ============================================================================== --- stable/10/sys/vm/vm_page.c Wed May 27 08:23:23 2015 (r283597) +++ stable/10/sys/vm/vm_page.c Wed May 27 08:30:16 2015 (r283598) @@ -1639,6 +1639,7 @@ vm_page_alloc(vm_object_t object, vm_pin m->wire_count = 0; } m->object = NULL; + m->oflags = VPO_UNMANAGED; vm_page_free(m); return (NULL); } @@ -3037,8 +3038,8 @@ vm_page_zero_invalid(vm_page_t m, boolea VM_OBJECT_ASSERT_WLOCKED(m->object); /* * Scan the valid bits looking for invalid sections that - * must be zerod. Invalid sub-DEV_BSIZE'd areas ( where the - * valid bit may be set ) have already been zerod by + * must be zeroed. Invalid sub-DEV_BSIZE'd areas ( where the + * valid bit may be set ) have already been zeroed by * vm_page_set_validclean(). */ for (b = i = 0; i <= PAGE_SIZE / DEV_BSIZE; ++i) { From owner-svn-src-stable@FreeBSD.ORG Wed May 27 13:23:03 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6EB83C3; Wed, 27 May 2015 13:23:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94330A3; Wed, 27 May 2015 13:23:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4RDN3Bx088768; Wed, 27 May 2015 13:23:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4RDN38U088767; Wed, 27 May 2015 13:23:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505271323.t4RDN38U088767@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 May 2015 13:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283609 - stable/10/sys/dev/sound/pci/hda 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 13:23:03 -0000 Author: hselasky Date: Wed May 27 13:23:02 2015 New Revision: 283609 URL: https://svnweb.freebsd.org/changeset/base/283609 Log: MFC r283064: Fix an off-by-one error by adding proper range checks when parsing the HDA association descriptors. This fixes a crash during device probe for some HDA PCI devices. Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdaa.c Wed May 27 12:58:22 2015 (r283608) +++ stable/10/sys/dev/sound/pci/hda/hdaa.c Wed May 27 13:23:02 2015 (r283609) @@ -3203,7 +3203,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo /* Scan associations skipping as=0. */ cnt = 0; - for (j = 1; j < 16; j++) { + for (j = 1; j < 16 && cnt < max; j++) { first = 16; hpredir = 0; for (i = devinfo->startnode; i < devinfo->endnode; i++) { From owner-svn-src-stable@FreeBSD.ORG Wed May 27 13:25:26 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D96D852E; Wed, 27 May 2015 13:25:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C659EC7; Wed, 27 May 2015 13:25:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4RDPQdM089181; Wed, 27 May 2015 13:25:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4RDPQ5d089180; Wed, 27 May 2015 13:25:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505271325.t4RDPQ5d089180@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 May 2015 13:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r283610 - stable/9/sys/dev/sound/pci/hda X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 13:25:27 -0000 Author: hselasky Date: Wed May 27 13:25:26 2015 New Revision: 283610 URL: https://svnweb.freebsd.org/changeset/base/283610 Log: MFC r283064: Fix an off-by-one error by adding proper range checks when parsing the HDA association descriptors. This fixes a crash during device probe for some HDA PCI devices. Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa.c Wed May 27 13:23:02 2015 (r283609) +++ stable/9/sys/dev/sound/pci/hda/hdaa.c Wed May 27 13:25:26 2015 (r283610) @@ -2809,7 +2809,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo /* Scan associations skipping as=0. */ cnt = 0; - for (j = 1; j < 16; j++) { + for (j = 1; j < 16 && cnt < max; j++) { first = 16; hpredir = 0; for (i = devinfo->startnode; i < devinfo->endnode; i++) { From owner-svn-src-stable@FreeBSD.ORG Wed May 27 13:27:40 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABE9D699; Wed, 27 May 2015 13:27:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99404EA; Wed, 27 May 2015 13:27:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4RDRe0b089718; Wed, 27 May 2015 13:27:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4RDRegN089717; Wed, 27 May 2015 13:27:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505271327.t4RDRegN089717@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 May 2015 13:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r283611 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 13:27:40 -0000 Author: hselasky Date: Wed May 27 13:27:39 2015 New Revision: 283611 URL: https://svnweb.freebsd.org/changeset/base/283611 Log: MFC r283064: Fix an off-by-one error by adding proper range checks when parsing the HDA association descriptors. This fixes a crash during device probe for some HDA PCI devices. Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.c Wed May 27 13:25:26 2015 (r283610) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Wed May 27 13:27:39 2015 (r283611) @@ -2811,7 +2811,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo /* Scan associations skipping as=0. */ cnt = 0; - for (j = 1; j < 16; j++) { + for (j = 1; j < 16 && cnt < max; j++) { first = 16; hpredir = 0; for (i = devinfo->startnode; i < devinfo->endnode; i++) { From owner-svn-src-stable@FreeBSD.ORG Wed May 27 14:29:40 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C8BD5B0; Wed, 27 May 2015 14:29:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79D9636C; Wed, 27 May 2015 14:29:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4RETeUh021848; Wed, 27 May 2015 14:29:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4RETebp021847; Wed, 27 May 2015 14:29:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505271429.t4RETebp021847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 May 2015 14:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283617 - stable/10/sys/dev/virtio/network 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 14:29:40 -0000 Author: jhb Date: Wed May 27 14:29:39 2015 New Revision: 283617 URL: https://svnweb.freebsd.org/changeset/base/283617 Log: MFC 282241: Don't free mbufs when stopping an interface in netmap mode. Currently if you ifconfig down a vtnet interface while it is being used via netmap, the kernel panics due to trying to treat the cookie values in the virtio rings as mbufs to be freed. When netmap is enabled, these cookie values are pointers to something else. Note that other netmap-aware drivers don't seem to need this as they store the mbuf pointers in the software rings that mirror the hardware descriptor rings, and since netmap doesn't touch those, the software state always has NULL mbuf pointers causing the loops to free mbufs to not do anything. However, vtnet reuses the same state area for both netmap and non-netmap mode, so it needs to explicitly avoid looking at the rings and treating the cookie values as mbufs if netmap is enabled. Sponsored by: Norse Corp, Inc. Modified: stable/10/sys/dev/virtio/network/if_vtnet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/10/sys/dev/virtio/network/if_vtnet.c Wed May 27 14:28:19 2015 (r283616) +++ stable/10/sys/dev/virtio/network/if_vtnet.c Wed May 27 14:29:39 2015 (r283617) @@ -2756,6 +2756,11 @@ vtnet_drain_rxtx_queues(struct vtnet_sof struct vtnet_txq *txq; int i; +#ifdef DEV_NETMAP + if (nm_native_on(NA(sc->vtnet_ifp))) + return; +#endif /* DEV_NETMAP */ + for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { rxq = &sc->vtnet_rxqs[i]; vtnet_rxq_free_mbufs(rxq); From owner-svn-src-stable@FreeBSD.ORG Wed May 27 17:44:13 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A335DD45; Wed, 27 May 2015 17:44:13 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F067D03; Wed, 27 May 2015 17:44:13 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4RHiDqb024532; Wed, 27 May 2015 17:44:13 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4RHiC04024525; Wed, 27 May 2015 17:44:12 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201505271744.t4RHiC04024525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 27 May 2015 17:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 17:44:13 -0000 Author: erj Date: Wed May 27 17:44:11 2015 New Revision: 283620 URL: https://svnweb.freebsd.org/changeset/base/283620 Log: MFC ixgbe commits for 10.2: - r280182 - Split the driver into independent pf/vf loadables - r280197 - Resolve build issues - r280204 - Fix multiple same-name devclasses - r280228 - Fix i386 LINT build issues / remove unused variable - r280252 - Fix building ixgbe with gcc - r280962 - Make changes to busdma code similar to r257541 - r281772 & r281773 - Remove unused variable - partial r282280 - stats counter update (ix-only) - r282289 - Add X550 support - r282290 - Add X550 makefile updates - r282293 - Add ixgbe_x550.c to conf/files - r282299 - Fix gcc compile (extraneous extern declaration) Finally, add ix_txrx.c to conf/files because it's required for compile in stable/10. Approved by: jfv (mentor) Added: stable/10/sys/dev/ixgbe/if_ix.c - copied, changed from r280182, head/sys/dev/ixgbe/if_ix.c stable/10/sys/dev/ixgbe/if_ixv.c - copied, changed from r280182, head/sys/dev/ixgbe/if_ixv.c stable/10/sys/dev/ixgbe/ix_txrx.c - copied, changed from r280182, head/sys/dev/ixgbe/ix_txrx.c stable/10/sys/dev/ixgbe/ixgbe_x550.c - copied unchanged from r282289, head/sys/dev/ixgbe/ixgbe_x550.c stable/10/sys/dev/ixgbe/ixgbe_x550.h - copied unchanged from r282289, head/sys/dev/ixgbe/ixgbe_x550.h stable/10/sys/modules/ix/ - copied from r280182, head/sys/modules/ix/ stable/10/sys/modules/ixv/ - copied from r280182, head/sys/modules/ixv/ Deleted: stable/10/sys/dev/ixgbe/ixgbe.c stable/10/sys/dev/ixgbe/ixv.c stable/10/sys/dev/ixgbe/ixv.h Modified: stable/10/sys/amd64/conf/GENERIC stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/dev/ixgbe/LICENSE stable/10/sys/dev/ixgbe/ixgbe.h stable/10/sys/dev/ixgbe/ixgbe_82598.c stable/10/sys/dev/ixgbe/ixgbe_82598.h stable/10/sys/dev/ixgbe/ixgbe_82599.c stable/10/sys/dev/ixgbe/ixgbe_82599.h stable/10/sys/dev/ixgbe/ixgbe_api.c stable/10/sys/dev/ixgbe/ixgbe_api.h stable/10/sys/dev/ixgbe/ixgbe_common.c stable/10/sys/dev/ixgbe/ixgbe_common.h stable/10/sys/dev/ixgbe/ixgbe_dcb.c stable/10/sys/dev/ixgbe/ixgbe_dcb.h stable/10/sys/dev/ixgbe/ixgbe_dcb_82598.c stable/10/sys/dev/ixgbe/ixgbe_dcb_82598.h stable/10/sys/dev/ixgbe/ixgbe_dcb_82599.c stable/10/sys/dev/ixgbe/ixgbe_dcb_82599.h stable/10/sys/dev/ixgbe/ixgbe_mbx.c stable/10/sys/dev/ixgbe/ixgbe_mbx.h stable/10/sys/dev/ixgbe/ixgbe_osdep.h stable/10/sys/dev/ixgbe/ixgbe_phy.c stable/10/sys/dev/ixgbe/ixgbe_phy.h stable/10/sys/dev/ixgbe/ixgbe_type.h stable/10/sys/dev/ixgbe/ixgbe_vf.c stable/10/sys/dev/ixgbe/ixgbe_vf.h stable/10/sys/dev/ixgbe/ixgbe_x540.c stable/10/sys/dev/ixgbe/ixgbe_x540.h stable/10/sys/modules/Makefile stable/10/sys/modules/ix/Makefile stable/10/sys/modules/ixv/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Wed May 27 17:42:23 2015 (r283619) +++ stable/10/sys/amd64/conf/GENERIC Wed May 27 17:44:11 2015 (r283620) @@ -211,7 +211,8 @@ device bxe # Broadcom NetXtreme II BC device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel PRO/1000 Gigabit Ethernet Family device igb # Intel PRO/1000 PCIE Server Gigabit Family -device ixgbe # Intel PRO/10GbE PCIE Ethernet Family +device ix # Intel PRO/10GbE PCIE PF Ethernet +device ixv # Intel PRO/10GbE PCIE VF Ethernet device ixl # Intel XL710 40Gbe PCIE Ethernet device ixlv # Intel XL710 40Gbe VF PCIE Ethernet device le # AMD Am7900 LANCE and Am79C9xx PCnet Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Wed May 27 17:42:23 2015 (r283619) +++ stable/10/sys/conf/NOTES Wed May 27 17:44:11 2015 (r283620) @@ -2089,7 +2089,8 @@ device de # DEC/Intel DC21x4x (``Tulip device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet device ixgb # Intel Pro/10Gbe PCI-X Ethernet -device ixgbe # Intel Pro/10Gbe PCIE Ethernet +device ix # Intel Pro/10Gbe PCIE Ethernet +device ixv # Intel Pro/10Gbe PCIE Ethernet VF device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device nxge # Neterion Xframe 10GbE Server/Storage Adapter Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Wed May 27 17:42:23 2015 (r283619) +++ stable/10/sys/conf/files Wed May 27 17:44:11 2015 (r283620) @@ -1716,31 +1716,35 @@ iwn6050.fw optional iwn6050fw | iwnfw dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb -dev/ixgbe/ixgbe.c optional ixgbe inet \ +dev/ixgbe/if_ix.c optional ix inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" -dev/ixgbe/ixv.c optional ixgbe inet \ +dev/ixgbe/if_ixv.c optional ixv inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" +dev/ixgbe/ix_txrx.c optional ixv inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_phy.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_phy.c optional ixgbe inet \ +dev/ixgbe/ixgbe_api.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_api.c optional ixgbe inet \ +dev/ixgbe/ixgbe_common.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_common.c optional ixgbe inet \ +dev/ixgbe/ixgbe_mbx.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_mbx.c optional ixgbe inet \ +dev/ixgbe/ixgbe_vf.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_vf.c optional ixgbe inet \ +dev/ixgbe/ixgbe_82598.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_82598.c optional ixgbe inet \ +dev/ixgbe/ixgbe_82599.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_82599.c optional ixgbe inet \ +dev/ixgbe/ixgbe_x540.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_x540.c optional ixgbe inet \ +dev/ixgbe/ixgbe_x550.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb.c optional ixgbe inet \ +dev/ixgbe/ixgbe_dcb.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb_82598.c optional ixgbe inet \ +dev/ixgbe/ixgbe_dcb_82598.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb_82599.c optional ixgbe inet \ +dev/ixgbe/ixgbe_dcb_82599.c optional ix ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixl/if_ixl.c optional ixl inet \ compile-with "${NORMAL_C} -I$S/dev/ixl" Modified: stable/10/sys/dev/ixgbe/LICENSE ============================================================================== --- stable/10/sys/dev/ixgbe/LICENSE Wed May 27 17:42:23 2015 (r283619) +++ stable/10/sys/dev/ixgbe/LICENSE Wed May 27 17:44:11 2015 (r283620) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Copied and modified: stable/10/sys/dev/ixgbe/if_ix.c (from r280182, head/sys/dev/ixgbe/if_ix.c) ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Tue Mar 17 18:32:28 2015 (r280182, copy source) +++ stable/10/sys/dev/ixgbe/if_ix.c Wed May 27 17:44:11 2015 (r283620) @@ -36,15 +36,10 @@ #ifndef IXGBE_STANDALONE_BUILD #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_rss.h" #endif #include "ixgbe.h" -#ifdef RSS -#include -#endif - /********************************************************************* * Set this to one to display debug statistics *********************************************************************/ @@ -53,7 +48,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.7.4"; +char ixgbe_driver_version[] = "2.8.3"; /********************************************************************* * PCI Device ID Table @@ -116,6 +111,8 @@ static int ixgbe_probe(device_t); static int ixgbe_attach(device_t); static int ixgbe_detach(device_t); static int ixgbe_shutdown(device_t); +static int ixgbe_suspend(device_t); +static int ixgbe_resume(device_t); static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); static void ixgbe_init(void *); static void ixgbe_init_locked(struct adapter *); @@ -135,7 +132,12 @@ static int ixgbe_setup_msix(struct adapt static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); static int ixgbe_setup_interface(device_t, struct adapter *); +static void ixgbe_config_dmac(struct adapter *); +static void ixgbe_config_delay_values(struct adapter *); static void ixgbe_config_link(struct adapter *); +static void ixgbe_check_eee_support(struct adapter *); +static void ixgbe_check_wol_support(struct adapter *); +static int ixgbe_setup_low_power_mode(struct adapter *); static void ixgbe_rearm_queues(struct adapter *, u64); static void ixgbe_initialize_transmit_units(struct adapter *); @@ -149,9 +151,6 @@ static void ixgbe_update_stats_count static void ixgbe_set_promisc(struct adapter *); static void ixgbe_set_multi(struct adapter *); static void ixgbe_update_link_status(struct adapter *); -static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); -static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); -static int ixgbe_set_thermal_test(SYSCTL_HANDLER_ARGS); static void ixgbe_set_ivar(struct adapter *, u8, u8, s8); static void ixgbe_configure_ivars(struct adapter *); static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); @@ -160,7 +159,22 @@ static void ixgbe_setup_vlan_hw_support( static void ixgbe_register_vlan(void *, struct ifnet *, u16); static void ixgbe_unregister_vlan(void *, struct ifnet *, u16); -static void ixgbe_add_hw_stats(struct adapter *adapter); +static void ixgbe_add_device_sysctls(struct adapter *); +static void ixgbe_add_hw_stats(struct adapter *); + +/* Sysctl handlers */ +static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); +static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_eee_negotiated(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_eee_rx_lpi_status(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_eee_tx_lpi_status(SYSCTL_HANDLER_ARGS); /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); @@ -178,37 +192,36 @@ static void ixgbe_handle_que(void *, int static void ixgbe_handle_link(void *, int); static void ixgbe_handle_msf(void *, int); static void ixgbe_handle_mod(void *, int); +static void ixgbe_handle_phy(void *, int); #ifdef IXGBE_FDIR static void ixgbe_reinit_fdir(void *, int); #endif - -/* Missing shared code prototype */ -extern void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw); - /********************************************************************* * FreeBSD Device Interface Entry Points *********************************************************************/ -static device_method_t ixgbe_methods[] = { +static device_method_t ix_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ixgbe_probe), DEVMETHOD(device_attach, ixgbe_attach), DEVMETHOD(device_detach, ixgbe_detach), DEVMETHOD(device_shutdown, ixgbe_shutdown), + DEVMETHOD(device_suspend, ixgbe_suspend), + DEVMETHOD(device_resume, ixgbe_resume), DEVMETHOD_END }; -static driver_t ixgbe_driver = { - "ix", ixgbe_methods, sizeof(struct adapter), +static driver_t ix_driver = { + "ix", ix_methods, sizeof(struct adapter), }; -devclass_t ixgbe_devclass; -DRIVER_MODULE(ixgbe, pci, ixgbe_driver, ixgbe_devclass, 0, 0); +devclass_t ix_devclass; +DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0); -MODULE_DEPEND(ixgbe, pci, 1, 1, 1); -MODULE_DEPEND(ixgbe, ether, 1, 1, 1); +MODULE_DEPEND(ix, pci, 1, 1, 1); +MODULE_DEPEND(ix, ether, 1, 1, 1); /* ** TUNEABLE PARAMETERS: @@ -403,32 +416,6 @@ ixgbe_attach(device_t dev) /* Core Lock Init*/ IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); - /* SYSCTL APIs */ - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, - adapter, 0, ixgbe_set_flowcntl, "I", IXGBE_SYSCTL_DESC_SET_FC); - - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "enable_aim", CTLFLAG_RW, - &ixgbe_enable_aim, 1, "Interrupt Moderation"); - - /* - ** Allow a kind of speed control by forcing the autoneg - ** advertised speed list to only a certain value, this - ** supports 1G on 82599 devices, and 100Mb on x540. - */ - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, - adapter, 0, ixgbe_set_advertise, "I", IXGBE_SYSCTL_DESC_ADV_SPEED); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "ts", CTLTYPE_INT | CTLFLAG_RW, adapter, - 0, ixgbe_set_thermal_test, "I", "Thermal Test"); - /* Set up the timer callout */ callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); @@ -558,22 +545,26 @@ ixgbe_attach(device_t dev) adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); - /* - ** Check PCIE slot type/speed/width - */ + /* Check PCIE slot type/speed/width */ ixgbe_get_slot_info(hw); /* Set an initial default flow control value */ adapter->fc = ixgbe_fc_full; + /* Check for certain supported features */ + ixgbe_check_wol_support(adapter); + ixgbe_check_eee_support(adapter); + + /* Add sysctls */ + ixgbe_add_device_sysctls(adapter); + ixgbe_add_hw_stats(adapter); + /* let hardware know driver is loaded */ ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); ctrl_ext |= IXGBE_CTRL_EXT_DRV_LOAD; IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext); - ixgbe_add_hw_stats(adapter); - #ifdef DEV_NETMAP ixgbe_netmap_attach(adapter); #endif /* DEV_NETMAP */ @@ -617,8 +608,9 @@ ixgbe_detach(device_t dev) return (EBUSY); } + /* Stop the adapter */ IXGBE_CORE_LOCK(adapter); - ixgbe_stop(adapter); + ixgbe_setup_low_power_mode(adapter); IXGBE_CORE_UNLOCK(adapter); for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { @@ -636,6 +628,7 @@ ixgbe_detach(device_t dev) taskqueue_drain(adapter->tq, &adapter->link_task); taskqueue_drain(adapter->tq, &adapter->mod_task); taskqueue_drain(adapter->tq, &adapter->msf_task); + taskqueue_drain(adapter->tq, &adapter->phy_task); #ifdef IXGBE_FDIR taskqueue_drain(adapter->tq, &adapter->fdir_task); #endif @@ -680,9 +673,77 @@ static int ixgbe_shutdown(device_t dev) { struct adapter *adapter = device_get_softc(dev); + int error = 0; + + INIT_DEBUGOUT("ixgbe_shutdown: begin"); + + IXGBE_CORE_LOCK(adapter); + error = ixgbe_setup_low_power_mode(adapter); + IXGBE_CORE_UNLOCK(adapter); + + return (error); +} + +/** + * Methods for going from: + * D0 -> D3: ixgbe_suspend + * D3 -> D0: ixgbe_resume + */ +static int +ixgbe_suspend(device_t dev) +{ + struct adapter *adapter = device_get_softc(dev); + int error = 0; + + INIT_DEBUGOUT("ixgbe_suspend: begin"); + + IXGBE_CORE_LOCK(adapter); + + error = ixgbe_setup_low_power_mode(adapter); + + /* Save state and power down */ + pci_save_state(dev); + pci_set_powerstate(dev, PCI_POWERSTATE_D3); + + IXGBE_CORE_UNLOCK(adapter); + + return (error); +} + +static int +ixgbe_resume(device_t dev) +{ + struct adapter *adapter = device_get_softc(dev); + struct ifnet *ifp = adapter->ifp; + struct ixgbe_hw *hw = &adapter->hw; + u32 wus; + + INIT_DEBUGOUT("ixgbe_resume: begin"); + IXGBE_CORE_LOCK(adapter); - ixgbe_stop(adapter); + + pci_set_powerstate(dev, PCI_POWERSTATE_D0); + pci_restore_state(dev); + + /* Read & clear WUS register */ + wus = IXGBE_READ_REG(hw, IXGBE_WUS); + if (wus) + device_printf(dev, "Woken up by (WUS): %#010x\n", + IXGBE_READ_REG(hw, IXGBE_WUS)); + IXGBE_WRITE_REG(hw, IXGBE_WUS, 0xffffffff); + /* And clear WUFC until next low-power transition */ + IXGBE_WRITE_REG(hw, IXGBE_WUFC, 0); + + /* + * Required after D3->D0 transition; + * will re-advertise all previous advertised speeds + */ + if (ifp->if_flags & IFF_UP) + ixgbe_init_locked(adapter); + IXGBE_CORE_UNLOCK(adapter); + + INIT_DEBUGOUT("ixgbe_resume: end"); return (0); } @@ -735,13 +796,13 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c break; case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)"); - if (ifr->ifr_mtu > IXGBE_MAX_FRAME_SIZE - ETHER_HDR_LEN) { + if (ifr->ifr_mtu > IXGBE_MAX_MTU) { error = EINVAL; } else { IXGBE_CORE_LOCK(adapter); ifp->if_mtu = ifr->ifr_mtu; adapter->max_frame_size = - ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + ifp->if_mtu + IXGBE_MTU_HDR; ixgbe_init_locked(adapter); IXGBE_CORE_UNLOCK(adapter); } @@ -890,7 +951,7 @@ ixgbe_init_locked(struct adapter *adapte /* Prepare transmit descriptors and buffers */ if (ixgbe_setup_transmit_structures(adapter)) { - device_printf(dev,"Could not setup transmit structures\n"); + device_printf(dev, "Could not setup transmit structures\n"); ixgbe_stop(adapter); return; } @@ -916,7 +977,7 @@ ixgbe_init_locked(struct adapter *adapte /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { - device_printf(dev,"Could not setup receive structures\n"); + device_printf(dev, "Could not setup receive structures\n"); ixgbe_stop(adapter); return; } @@ -931,11 +992,16 @@ ixgbe_init_locked(struct adapter *adapte /* Add for Module detection */ if (hw->mac.type == ixgbe_mac_82599EB) - gpie |= IXGBE_SDP2_GPIEN_BY_MAC(hw); + gpie |= IXGBE_SDP2_GPIEN; - /* Thermal Failure Detection */ - if (hw->mac.type == ixgbe_mac_X540) - gpie |= IXGBE_SDP0_GPIEN_BY_MAC(hw); + /* + * Thermal Failure Detection (X540) + * Link Detection (X552) + */ + if (hw->mac.type == ixgbe_mac_X540 || + hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || + hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) + gpie |= IXGBE_SDP0_GPIEN_X540; if (adapter->msix > 1) { /* Enable Enhanced MSIX mode */ @@ -947,6 +1013,7 @@ ixgbe_init_locked(struct adapter *adapte /* Set MTU size */ if (ifp->if_mtu > ETHERMTU) { + /* aka IXGBE_MAXFRS on 82599 and newer */ mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD); mhadd &= ~IXGBE_MHADD_MFS_MASK; mhadd |= adapter->max_frame_size << IXGBE_MHADD_MFS_SHIFT; @@ -954,7 +1021,6 @@ ixgbe_init_locked(struct adapter *adapte } /* Now enable all the queues */ - for (int i = 0; i < adapter->num_queues; i++) { txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i)); txdctl |= IXGBE_TXDCTL_ENABLE; @@ -1071,55 +1137,25 @@ ixgbe_init_locked(struct adapter *adapte /* Set moderation on the Link interrupt */ IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); + /* Configure Energy Efficient Ethernet for supported devices */ + if (adapter->eee_support) + ixgbe_setup_eee(hw, adapter->eee_enabled); + /* Config/Enable Link */ ixgbe_config_link(adapter); /* Hardware Packet Buffer & Flow Control setup */ - { - u32 rxpb, frame, size, tmp; - - frame = adapter->max_frame_size; - - /* Calculate High Water */ - switch (hw->mac.type) { - case ixgbe_mac_X540: - case ixgbe_mac_X550: - case ixgbe_mac_X550EM_a: - case ixgbe_mac_X550EM_x: - tmp = IXGBE_DV_X540(frame, frame); - break; - default: - tmp = IXGBE_DV(frame, frame); - break; - } - size = IXGBE_BT2KB(tmp); - rxpb = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) >> 10; - hw->fc.high_water[0] = rxpb - size; + ixgbe_config_delay_values(adapter); - /* Now calculate Low Water */ - switch (hw->mac.type) { - case ixgbe_mac_X540: - case ixgbe_mac_X550: - case ixgbe_mac_X550EM_a: - case ixgbe_mac_X550EM_x: - tmp = IXGBE_LOW_DV_X540(frame); - break; - default: - tmp = IXGBE_LOW_DV(frame); - break; - } - hw->fc.low_water[0] = IXGBE_BT2KB(tmp); - - hw->fc.requested_mode = adapter->fc; - hw->fc.pause_time = IXGBE_FC_PAUSE; - hw->fc.send_xon = TRUE; - } /* Initialize the FC settings */ ixgbe_start_hw(hw); /* Set up VLAN support and filter */ ixgbe_setup_vlan_hw_support(adapter); + /* Setup DMA Coalescing */ + ixgbe_config_dmac(adapter); + /* And now turn on interrupts */ ixgbe_enable_intr(adapter); @@ -1140,6 +1176,46 @@ ixgbe_init(void *arg) return; } +static void +ixgbe_config_delay_values(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + u32 rxpb, frame, size, tmp; + + frame = adapter->max_frame_size; + + /* Calculate High Water */ + switch (hw->mac.type) { + case ixgbe_mac_X540: + case ixgbe_mac_X550: + case ixgbe_mac_X550EM_x: + tmp = IXGBE_DV_X540(frame, frame); + break; + default: + tmp = IXGBE_DV(frame, frame); + break; + } + size = IXGBE_BT2KB(tmp); + rxpb = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) >> 10; + hw->fc.high_water[0] = rxpb - size; + + /* Now calculate Low Water */ + switch (hw->mac.type) { + case ixgbe_mac_X540: + case ixgbe_mac_X550: + case ixgbe_mac_X550EM_x: + tmp = IXGBE_LOW_DV_X540(frame); + break; + default: + tmp = IXGBE_LOW_DV(frame); + break; + } + hw->fc.low_water[0] = IXGBE_BT2KB(tmp); + + hw->fc.requested_mode = adapter->fc; + hw->fc.pause_time = IXGBE_FC_PAUSE; + hw->fc.send_xon = TRUE; +} /* ** @@ -1270,6 +1346,11 @@ ixgbe_legacy_irq(void *arg) if (reg_eicr & IXGBE_EICR_LSC) taskqueue_enqueue(adapter->tq, &adapter->link_task); + /* External PHY interrupt */ + if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T && + (reg_eicr & IXGBE_EICR_GPI_SDP0_X540)) + taskqueue_enqueue(adapter->tq, &adapter->phy_task); + if (more) taskqueue_enqueue(que->tq, &que->que_task); else @@ -1378,9 +1459,9 @@ ixgbe_msix_link(void *arg) { struct adapter *adapter = arg; struct ixgbe_hw *hw = &adapter->hw; - u32 reg_eicr; + u32 reg_eicr, mod_mask; - ++adapter->vector_irq; + ++adapter->link_irq; /* First get the cause */ reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICS); @@ -1408,42 +1489,46 @@ ixgbe_msix_link(void *arg) device_printf(adapter->dev, "\nCRITICAL: ECC ERROR!! " "Please Reboot!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC); - } else + } - if (ixgbe_is_sfp(hw)) { - if (reg_eicr & IXGBE_EICR_GPI_SDP1) { - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); - } else if (reg_eicr & IXGBE_EICR_GPI_SDP2) { - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP2_BY_MAC(hw)); - taskqueue_enqueue(adapter->tq, &adapter->mod_task); - } + /* Check for over temp condition */ + if (reg_eicr & IXGBE_EICR_TS) { + device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " + "PHY IS SHUT DOWN!!\n"); + device_printf(adapter->dev, "System shutdown required!\n"); + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); + } + } + + /* Pluggable optics-related interrupt */ + if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP) + mod_mask = IXGBE_EICR_GPI_SDP0_X540; + else + mod_mask = IXGBE_EICR_GPI_SDP2_BY_MAC(hw); + + if (ixgbe_is_sfp(hw)) { + if (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw)) { + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); + taskqueue_enqueue(adapter->tq, &adapter->msf_task); + } else if (reg_eicr & mod_mask) { + IXGBE_WRITE_REG(hw, IXGBE_EICR, mod_mask); + taskqueue_enqueue(adapter->tq, &adapter->mod_task); } - } + } /* Check for fan failure */ if ((hw->device_id == IXGBE_DEV_ID_82598AT) && - (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { + (reg_eicr & IXGBE_EICR_GPI_SDP1)) { + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1); device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! " "REPLACE IMMEDIATELY!!\n"); - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); } - /* Check for over temp condition */ - switch (hw->mac.type) { - case ixgbe_mac_X540: - case ixgbe_mac_X550: - case ixgbe_mac_X550EM_a: - if (reg_eicr & IXGBE_EICR_TS) { - device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " - "PHY IS SHUT DOWN!!\n"); - device_printf(adapter->dev, "System shutdown required\n"); - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); - } - break; - default: - /* Other MACs have no thermal sensor interrupt */ - break; + /* External PHY interrupt */ + if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T && + (reg_eicr & IXGBE_EICR_GPI_SDP0_X540)) { + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0_X540); + taskqueue_enqueue(adapter->tq, &adapter->phy_task); } IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); @@ -1542,20 +1627,26 @@ ixgbe_media_status(struct ifnet * ifp, s if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: - ifmr->ifm_active |= IFM_10_T | IFM_FDX; + ifmr->ifm_active |= IFM_10G_SR | IFM_FDX; + break; + case IXGBE_LINK_SPEED_2_5GB_FULL: + ifmr->ifm_active |= IFM_2500_SX | IFM_FDX; break; case IXGBE_LINK_SPEED_1GB_FULL: - ifmr->ifm_active |= IFM_10_5 | IFM_FDX; + ifmr->ifm_active |= IFM_1000_CX | IFM_FDX; break; } - if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4 + else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4 || layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: - ifmr->ifm_active |= IFM_10_2 | IFM_FDX; + ifmr->ifm_active |= IFM_10G_CX4 | IFM_FDX; + break; + case IXGBE_LINK_SPEED_2_5GB_FULL: + ifmr->ifm_active |= IFM_2500_SX | IFM_FDX; break; case IXGBE_LINK_SPEED_1GB_FULL: - ifmr->ifm_active |= IFM_10_5 | IFM_FDX; + ifmr->ifm_active |= IFM_1000_CX | IFM_FDX; break; } @@ -1564,10 +1655,12 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_active |= IFM_UNKNOWN; #if __FreeBSD_version >= 900025 - /* Flow control setting */ - if (adapter->fc == ixgbe_fc_rx_pause || adapter->fc == ixgbe_fc_full) + /* Display current flow control setting used on link */ + if (hw->fc.current_mode == ixgbe_fc_rx_pause || + hw->fc.current_mode == ixgbe_fc_full) ifmr->ifm_active |= IFM_ETH_RXPAUSE; - if (adapter->fc == ixgbe_fc_tx_pause || adapter->fc == ixgbe_fc_full) + if (hw->fc.current_mode == ixgbe_fc_tx_pause || + hw->fc.current_mode == ixgbe_fc_full) ifmr->ifm_active |= IFM_ETH_TXPAUSE; #endif @@ -1597,21 +1690,22 @@ ixgbe_media_change(struct ifnet * ifp) if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) return (EINVAL); + if (hw->phy.media_type == ixgbe_media_type_backplane) + return (EPERM); + /* ** We don't actually need to check against the supported ** media types of the adapter; ifmedia will take care of ** that for us. - ** NOTE: this relies on falling thru the switch - ** to get all the values set, it can be confusing. */ switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: case IFM_10G_T: speed |= IXGBE_LINK_SPEED_100_FULL; case IFM_10G_LRM: - case IFM_10G_SR: /* KR, too */ + case IFM_10G_SR: /* KR, too */ case IFM_10G_LR: - case IFM_10G_CX4: /* KX4 for now */ + case IFM_10G_CX4: /* KX4 */ speed |= IXGBE_LINK_SPEED_1GB_FULL; case IFM_10G_TWINAX: speed |= IXGBE_LINK_SPEED_10GB_FULL; @@ -1620,7 +1714,7 @@ ixgbe_media_change(struct ifnet * ifp) speed |= IXGBE_LINK_SPEED_100_FULL; case IFM_1000_LX: case IFM_1000_SX: - case IFM_1000_CX: /* KX until there's real support */ + case IFM_1000_CX: /* KX */ speed |= IXGBE_LINK_SPEED_1GB_FULL; break; case IFM_100_TX: @@ -1640,7 +1734,7 @@ ixgbe_media_change(struct ifnet * ifp) return (0); invalid: - device_printf(adapter->dev, "Invalid media type\n"); + device_printf(adapter->dev, "Invalid media type!\n"); return (EINVAL); } @@ -1865,7 +1959,6 @@ ixgbe_update_link_status(struct adapter struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; - if (adapter->link_up){ if (adapter->link_active == FALSE) { if (bootverbose) @@ -1875,6 +1968,8 @@ ixgbe_update_link_status(struct adapter adapter->link_active = TRUE; /* Update any Flow Control changes */ ixgbe_fc_enable(&adapter->hw); + /* Update DMA coalescing config */ + ixgbe_config_dmac(adapter); if_link_state_change(ifp, LINK_STATE_UP); } } else { /* Link down */ @@ -1961,7 +2056,7 @@ ixgbe_identify_hardware(struct adapter * /* We need this here to set the num_segs below */ ixgbe_set_mac_type(hw); - /* Pick up the 82599 and VF settings */ + /* Pick up the 82599 settings */ if (hw->mac.type != ixgbe_mac_82598EB) { hw->phy.smart_speed = ixgbe_smart_speed; adapter->num_segs = IXGBE_82599_SCATTER; @@ -2071,6 +2166,7 @@ ixgbe_allocate_legacy(struct adapter *ad TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); + TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter); #ifdef IXGBE_FDIR TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); #endif @@ -2111,30 +2207,6 @@ ixgbe_allocate_msix(struct adapter *adap int error, rid, vector = 0; int cpu_id = 0; -#ifdef RSS - /* - * If we're doing RSS, the number of queues needs to - * match the number of RSS buckets that are configured. - * - * + If there's more queues than RSS buckets, we'll end - * up with queues that get no traffic. - * - * + If there's more RSS buckets than queues, we'll end - * up having multiple RSS buckets map to the same queue, - * so there'll be some contention. - */ - if (adapter->num_queues != rss_getnumbuckets()) { - device_printf(dev, - "%s: number of queues (%d) != number of RSS buckets (%d)" - "; performance will be impacted.\n", - __func__, - adapter->num_queues, - rss_getnumbuckets()); - } -#endif - - - for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) { rid = vector + 1; que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -2158,14 +2230,6 @@ ixgbe_allocate_msix(struct adapter *adap #endif que->msix = vector; adapter->active_queues |= (u64)(1 << que->msix); -#ifdef RSS - /* - * The queue ID is used as the RSS layer bucket ID. - * We look up the queue ID -> RSS CPU ID and select - * that. - */ - cpu_id = rss_getcpu(i % rss_getnumbuckets()); -#else /* * Bind the msix vector, and thus the * rings to the corresponding cpu. @@ -2175,39 +2239,18 @@ ixgbe_allocate_msix(struct adapter *adap */ if (adapter->num_queues > 1) cpu_id = i; -#endif + if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, cpu_id); -#ifdef RSS - device_printf(dev, - "Bound RSS bucket %d to CPU %d\n", - i, cpu_id); -#else -#if 0 // This is too noisy - device_printf(dev, - "Bound queue %d to cpu %d\n", - i, cpu_id); -#endif -#endif - - #ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); -#ifdef RSS - taskqueue_start_threads_pinned(&que->tq, 1, PI_NET, - cpu_id, - "%s (bucket %d)", - device_get_nameunit(adapter->dev), - cpu_id); -#else taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", device_get_nameunit(adapter->dev)); -#endif } /* and Link */ @@ -2236,6 +2279,7 @@ ixgbe_allocate_msix(struct adapter *adap TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); + TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter); #ifdef IXGBE_FDIR TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); #endif @@ -2282,12 +2326,6 @@ ixgbe_setup_msix(struct adapter *adapter /* Figure out a reasonable auto config value */ queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; -#ifdef RSS - /* If we're doing RSS, clamp at the number of RSS buckets */ - if (queues > rss_getnumbuckets()) - queues = rss_getnumbuckets(); -#endif - if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; @@ -2461,6 +2499,12 @@ ixgbe_setup_interface(device_t dev, stru #if __FreeBSD_version >= 1100036 if_setgetcounterfn(ifp, ixgbe_get_counter); #endif +#if __FreeBSD_version >= 1100045 + /* TSO parameters */ + ifp->if_hw_tsomax = 65518; + ifp->if_hw_tsomaxsegcount = IXGBE_82599_SCATTER; + ifp->if_hw_tsomaxsegsize = 2048; +#endif #ifndef IXGBE_LEGACY_TX ifp->if_transmit = ixgbe_mq_start; ifp->if_qflush = ixgbe_qflush; @@ -2544,10 +2588,6 @@ ixgbe_add_media_types(struct adapter *ad ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_CX4, 0, NULL); if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); -#if 0 - if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_LX) - ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_LX, 0, NULL); -#endif /* ** Other (no matching FreeBSD media type): @@ -2556,25 +2596,24 @@ ixgbe_add_media_types(struct adapter *ad */ if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) { device_printf(dev, "Media supported: 10GbaseKR\n"); - device_printf(dev, "10GbaseKR mapped to 10baseT\n"); - ifmedia_add(&adapter->media, IFM_ETHER | IFM_10_T, 0, NULL); + device_printf(dev, "10GbaseKR mapped to 10GbaseSR\n"); + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_SR, 0, NULL); } if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) { device_printf(dev, "Media supported: 10GbaseKX4\n"); - device_printf(dev, "10GbaseKX4 mapped to 10base2\n"); - ifmedia_add(&adapter->media, IFM_ETHER | IFM_10_2, 0, NULL); + device_printf(dev, "10GbaseKX4 mapped to 10GbaseCX4\n"); + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_CX4, 0, NULL); } if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) { device_printf(dev, "Media supported: 1000baseKX\n"); - device_printf(dev, "1000baseKX mapped to 10base5\n"); - ifmedia_add(&adapter->media, IFM_ETHER | IFM_10_5, 0, NULL); + device_printf(dev, "1000baseKX mapped to 1000baseCX\n"); + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_CX, 0, NULL); } if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) { /* Someday, someone will care about you... */ device_printf(dev, "Media supported: 1000baseBX\n"); } - /* Very old */ if (hw->device_id == IXGBE_DEV_ID_82598AT) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); @@ -2702,38 +2741,36 @@ ixgbe_initialise_rss_mapping(struct adap { struct ixgbe_hw *hw = &adapter->hw; uint32_t reta; - int i, j, queue_id; + int i, j, queue_id, table_size; + int index_mult; uint32_t rss_key[10]; uint32_t mrqc; -#ifdef RSS - uint32_t rss_hash_config; -#endif /* Setup RSS */ reta = 0; -#ifdef RSS - /* Fetch the configured RSS key */ - rss_getkey((uint8_t *) &rss_key); -#else /* set up random bits */ arc4rand(&rss_key, sizeof(rss_key), 0); -#endif + + /* Set multiplier for RETA setup and table size based on MAC */ + index_mult = 0x1; + table_size = 128; + switch (adapter->hw.mac.type) { + case ixgbe_mac_82598EB: + index_mult = 0x11; + break; + case ixgbe_mac_X550: + case ixgbe_mac_X550EM_x: + table_size = 512; + break; + default: + break; + } /* Set up the redirection table */ - for (i = 0, j = 0; i < 128; i++, j++) { + for (i = 0, j = 0; i < table_size; i++, j++) { if (j == adapter->num_queues) j = 0; -#ifdef RSS - /* - * Fetch the RSS bucket id for the given indirection entry. - * Cap it at the number of configured buckets (which is - * num_queues.) - */ - queue_id = rss_get_indirection_to_bucket(i); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Wed May 27 19:09:19 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74ABC9D5; Wed, 27 May 2015 19:09:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E685666; Wed, 27 May 2015 19:09:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 530B0B939; Wed, 27 May 2015 15:09:17 -0400 (EDT) From: John Baldwin To: Eric Joyner Cc: 'Jack F Vogel' , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv Date: Wed, 27 May 2015 15:09:13 -0400 Message-ID: <16669147.Y9s9XdOlga@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201505271744.t4RHiC04024525@svn.freebsd.org> References: <201505271744.t4RHiC04024525@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 27 May 2015 15:09:17 -0400 (EDT) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 19:09:19 -0000 On Wednesday, May 27, 2015 05:44:12 PM Eric Joyner wrote: > Author: erj > Date: Wed May 27 17:44:11 2015 > New Revision: 283620 > URL: https://svnweb.freebsd.org/changeset/base/283620 > > Log: > MFC ixgbe commits for 10.2: > > - r280182 - Split the driver into independent pf/vf loadables > - r280197 - Resolve build issues > - r280204 - Fix multiple same-name devclasses > - r280228 - Fix i386 LINT build issues / remove unused variable > - r280252 - Fix building ixgbe with gcc > - r280962 - Make changes to busdma code similar to r257541 > - r281772 & r281773 - Remove unused variable > - partial r282280 - stats counter update (ix-only) > - r282289 - Add X550 support > - r282290 - Add X550 makefile updates > - r282293 - Add ixgbe_x550.c to conf/files > - r282299 - Fix gcc compile (extraneous extern declaration) > > Finally, add ix_txrx.c to conf/files because it's required for compile in stable/10. > > Approved by: jfv (mentor) It would be better to not break existing kernel configs for 10. You could hack the lines in sys/conf/files to allow either 'device ix' or 'device ixgbe' to work by using 'optional ixgbe ix', etc. You wouldn't need to document it in NOTES and you could leave your existing changes in GENERIC, but this would avoid surprises for folks who were using custom kernel configs. Similarly, you probably want to allow 'kldload ixgbe' or 'ixgbe_load="YES"' in loader.conf to still work. You can try just installing an 'ixgbe.ko' symlink via the module's Makefile, though I'm not sure that will work correctly for the loader.conf case. If it doesn't, then the other route is to create a stub ixgbe.c file that MODULE_DEPEND()'s on the ix and ixv driver modules so that it autoloads if_ix.ko and if_ixv.ko as dependencies when it is loaded. -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Wed May 27 19:30:36 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22BED7DF; Wed, 27 May 2015 19:30:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D02BFCAA; Wed, 27 May 2015 19:30:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qchk10 with SMTP id k10so8402679qch.2; Wed, 27 May 2015 12:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=irGtmwiHldn0fMgv7X2+Isk54+TrBuZ5mDtMqVfU+j0=; b=H8jkrwdY5aiSGX3sb+/NjJr5cj8hAExvup3FVXyECTzKwfa+ID8xq8VJyxhpM9pTLH wRuriDalPEDNsShrW/4M5hReTxsU7uWXNaRWp+/7M/IeAMORHFms+Z72NqPqy/d+vjmk +wd3SWBDgjNVEKQad7ZrHHwaWoWHFK1Q/A4Kmg6fulmffR5/vyO57KCjDKIQRfe8Zp3J KVtvgXoU7c9TgkU2dQr9dawiUKZ7wjuJMtce1pCNC2TOLfuLLgmdLwAq0EceXxYbULUO IyKm+Aqc7dg86IHWOjK7O8n+zlHDuR7PxJaRdgBYEJLL2MtP3YeNq6nDLOxd3ftKYOGb Irqw== MIME-Version: 1.0 X-Received: by 10.140.90.99 with SMTP id w90mr41451597qgd.57.1432755035032; Wed, 27 May 2015 12:30:35 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Wed, 27 May 2015 12:30:34 -0700 (PDT) In-Reply-To: <16669147.Y9s9XdOlga@ralph.baldwin.cx> References: <201505271744.t4RHiC04024525@svn.freebsd.org> <16669147.Y9s9XdOlga@ralph.baldwin.cx> Date: Wed, 27 May 2015 12:30:34 -0700 Message-ID: Subject: Re: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv From: NGie Cooper To: John Baldwin Cc: Eric Joyner , Jack F Vogel , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 19:30:36 -0000 On Wed, May 27, 2015 at 12:09 PM, John Baldwin wrote: > On Wednesday, May 27, 2015 05:44:12 PM Eric Joyner wrote: >> Author: erj >> Date: Wed May 27 17:44:11 2015 >> New Revision: 283620 >> URL: https://svnweb.freebsd.org/changeset/base/283620 >> >> Log: >> MFC ixgbe commits for 10.2: >> >> - r280182 - Split the driver into independent pf/vf loadables >> - r280197 - Resolve build issues >> - r280204 - Fix multiple same-name devclasses >> - r280228 - Fix i386 LINT build issues / remove unused variable >> - r280252 - Fix building ixgbe with gcc >> - r280962 - Make changes to busdma code similar to r257541 >> - r281772 & r281773 - Remove unused variable >> - partial r282280 - stats counter update (ix-only) >> - r282289 - Add X550 support >> - r282290 - Add X550 makefile updates >> - r282293 - Add ixgbe_x550.c to conf/files >> - r282299 - Fix gcc compile (extraneous extern declaration) >> >> Finally, add ix_txrx.c to conf/files because it's required for compile in stable/10. >> >> Approved by: jfv (mentor) > > It would be better to not break existing kernel configs for 10. You could > hack the lines in sys/conf/files to allow either 'device ix' or 'device ixgbe' > to work by using 'optional ixgbe ix', etc. You wouldn't need to document it > in NOTES and you could leave your existing changes in GENERIC, but this would > avoid surprises for folks who were using custom kernel configs. > > Similarly, you probably want to allow 'kldload ixgbe' or 'ixgbe_load="YES"' > in loader.conf to still work. You can try just installing an 'ixgbe.ko' > symlink via the module's Makefile, though I'm not sure that will work > correctly for the loader.conf case. If it doesn't, then the other route is > to create a stub ixgbe.c file that MODULE_DEPEND()'s on the ix and ixv driver > modules so that it autoloads if_ix.ko and if_ixv.ko as dependencies when it > is loaded. +100 From owner-svn-src-stable@FreeBSD.ORG Thu May 28 00:11:38 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34F16C22; Thu, 28 May 2015 00:11:38 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 007C59BE; Thu, 28 May 2015 00:11:38 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4S0BbvA029417; Thu, 28 May 2015 00:11:37 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4S0BbiQ029414; Thu, 28 May 2015 00:11:37 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201505280011.t4S0BbiQ029414@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 28 May 2015 00:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283640 - in stable/10/sys/ufs: ffs ufs 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 00:11:38 -0000 Author: mckusick Date: Thu May 28 00:11:36 2015 New Revision: 283640 URL: https://svnweb.freebsd.org/changeset/base/283640 Log: MFC of 269533: Limit the number of cylinder groups that will be searched when trying to build a cluster. The limit is tunable using the sysctl vfs.ffs.maxclustersearch. The current limit is 10 cylinder groups per block allocation. It was previously limited to the number of cylinder groups in the filesystem per block allocation. When there were no clusters of the needed size left, it repeatedly searched the whole filesystem for a non-existent cluster on every block allocation. The result was very slow filesystem allocation with 100% CPU utilization. The old behavior can be had by setting vfs.ffs.maxclustersearch to a huge number (1,000,000). This change affects only the layout policy routines so is not able to interfere with the integrity of the filesystem. Reported by: Dmitry Sivachenko (demon@) Tested by: Dmitry Sivachenko (demon@) Modified: stable/10/sys/ufs/ffs/ffs_alloc.c stable/10/sys/ufs/ffs/ffs_vfsops.c stable/10/sys/ufs/ufs/inode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_alloc.c Wed May 27 22:30:21 2015 (r283639) +++ stable/10/sys/ufs/ffs/ffs_alloc.c Thu May 28 00:11:36 2015 (r283640) @@ -112,8 +112,7 @@ static void ffs_blkfree_trim_task(void * #ifdef INVARIANTS static int ffs_checkblk(struct inode *, ufs2_daddr_t, long); #endif -static ufs2_daddr_t ffs_clusteralloc(struct inode *, u_int, ufs2_daddr_t, int, - int); +static ufs2_daddr_t ffs_clusteralloc(struct inode *, u_int, ufs2_daddr_t, int); static ino_t ffs_dirpref(struct inode *); static ufs2_daddr_t ffs_fragextend(struct inode *, u_int, ufs2_daddr_t, int, int); @@ -460,10 +459,16 @@ nospace: SYSCTL_NODE(_vfs, OID_AUTO, ffs, CTLFLAG_RW, 0, "FFS filesystem"); static int doasyncfree = 1; -SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, ""); +SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, +"do not force synchronous writes when blocks are reallocated"); static int doreallocblks = 1; -SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, ""); +SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, +"enable block reallocation"); + +static int maxclustersearch = 10; +SYSCTL_INT(_vfs_ffs, OID_AUTO, maxclustersearch, CTLFLAG_RW, &maxclustersearch, +0, "max number of cylinder group to search for contigous blocks"); #ifdef DEBUG static volatile int prtrealloc = 0; @@ -510,7 +515,7 @@ ffs_reallocblks_ufs1(ap) ufs1_daddr_t soff, newblk, blkno; ufs2_daddr_t pref; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; - int i, len, start_lvl, end_lvl, ssize; + int i, cg, len, start_lvl, end_lvl, ssize; vp = ap->a_vp; ip = VTOI(vp); @@ -597,18 +602,39 @@ ffs_reallocblks_ufs1(ap) ebap = (ufs1_daddr_t *)ebp->b_data; } /* - * Find the preferred location for the cluster. + * Find the preferred location for the cluster. If we have not + * previously failed at this endeavor, then follow our standard + * preference calculation. If we have failed at it, then pick up + * where we last ended our search. */ UFS_LOCK(ump); - pref = ffs_blkpref_ufs1(ip, start_lbn, soff, sbap); + if (ip->i_nextclustercg == -1) + pref = ffs_blkpref_ufs1(ip, start_lbn, soff, sbap); + else + pref = cgdata(fs, ip->i_nextclustercg); /* * Search the block map looking for an allocation of the desired size. + * To avoid wasting too much time, we limit the number of cylinder + * groups that we will search. + */ + cg = dtog(fs, pref); + for (i = min(maxclustersearch, fs->fs_ncg); i > 0; i--) { + if ((newblk = ffs_clusteralloc(ip, cg, pref, len)) != 0) + break; + cg += 1; + if (cg >= fs->fs_ncg) + cg = 0; + } + /* + * If we have failed in our search, record where we gave up for + * next time. Otherwise, fall back to our usual search citerion. */ - if ((newblk = ffs_hashalloc(ip, dtog(fs, pref), pref, - len, len, ffs_clusteralloc)) == 0) { + if (newblk == 0) { + ip->i_nextclustercg = cg; UFS_UNLOCK(ump); goto fail; } + ip->i_nextclustercg = -1; /* * We have found a new contiguous block. * @@ -737,7 +763,7 @@ ffs_reallocblks_ufs2(ap) ufs_lbn_t start_lbn, end_lbn; ufs2_daddr_t soff, newblk, blkno, pref; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; - int i, len, start_lvl, end_lvl, ssize; + int i, cg, len, start_lvl, end_lvl, ssize; vp = ap->a_vp; ip = VTOI(vp); @@ -824,18 +850,39 @@ ffs_reallocblks_ufs2(ap) ebap = (ufs2_daddr_t *)ebp->b_data; } /* - * Find the preferred location for the cluster. + * Find the preferred location for the cluster. If we have not + * previously failed at this endeavor, then follow our standard + * preference calculation. If we have failed at it, then pick up + * where we last ended our search. */ UFS_LOCK(ump); - pref = ffs_blkpref_ufs2(ip, start_lbn, soff, sbap); + if (ip->i_nextclustercg == -1) + pref = ffs_blkpref_ufs2(ip, start_lbn, soff, sbap); + else + pref = cgdata(fs, ip->i_nextclustercg); /* * Search the block map looking for an allocation of the desired size. + * To avoid wasting too much time, we limit the number of cylinder + * groups that we will search. + */ + cg = dtog(fs, pref); + for (i = min(maxclustersearch, fs->fs_ncg); i > 0; i--) { + if ((newblk = ffs_clusteralloc(ip, cg, pref, len)) != 0) + break; + cg += 1; + if (cg >= fs->fs_ncg) + cg = 0; + } + /* + * If we have failed in our search, record where we gave up for + * next time. Otherwise, fall back to our usual search citerion. */ - if ((newblk = ffs_hashalloc(ip, dtog(fs, pref), pref, - len, len, ffs_clusteralloc)) == 0) { + if (newblk == 0) { + ip->i_nextclustercg = cg; UFS_UNLOCK(ump); goto fail; } + ip->i_nextclustercg = -1; /* * We have found a new contiguous block. * @@ -1785,12 +1832,11 @@ gotit: * take the first one that we find following bpref. */ static ufs2_daddr_t -ffs_clusteralloc(ip, cg, bpref, len, unused) +ffs_clusteralloc(ip, cg, bpref, len) struct inode *ip; u_int cg; ufs2_daddr_t bpref; int len; - int unused; { struct fs *fs; struct cg *cgp; Modified: stable/10/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vfsops.c Wed May 27 22:30:21 2015 (r283639) +++ stable/10/sys/ufs/ffs/ffs_vfsops.c Thu May 28 00:11:36 2015 (r283640) @@ -1687,6 +1687,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags ip->i_dev = dev; ip->i_number = ino; ip->i_ea_refs = 0; + ip->i_nextclustercg = -1; #ifdef QUOTA { int i; Modified: stable/10/sys/ufs/ufs/inode.h ============================================================================== --- stable/10/sys/ufs/ufs/inode.h Wed May 27 22:30:21 2015 (r283639) +++ stable/10/sys/ufs/ufs/inode.h Thu May 28 00:11:36 2015 (r283640) @@ -87,6 +87,8 @@ struct inode { daddr_t *snapblklist; /* Collect expunged snapshot blocks. */ } i_un; + int i_nextclustercg; /* last cg searched for cluster */ + /* * Data for extended attribute modification. */ From owner-svn-src-stable@FreeBSD.ORG Thu May 28 06:45:14 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7C20142; Thu, 28 May 2015 06:45:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB1A58C; Thu, 28 May 2015 06:45:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4S6jE9m024174; Thu, 28 May 2015 06:45:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4S6jEr7024173; Thu, 28 May 2015 06:45:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201505280645.t4S6jEr7024173@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 May 2015 06:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r283642 - in stable: 10/sys/sys 7/sys/sys 8/sys/sys 9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 06:45:15 -0000 Author: dim Date: Thu May 28 06:45:13 2015 New Revision: 283642 URL: https://svnweb.freebsd.org/changeset/base/283642 Log: MFC r283254: Ensure that the static structs emitted by the MODULE_DEPEND() and MODULE_VERSION() macros don't end up as .comm symbols, when all the version fields are zero. Normally, such symbols will end up in .bss, but for kernel module version objects, this can lead to "garbage" version numbers. Fix this by instructing the compiler to always put these structs in the .data segment instead. Reported by: delphij, ae Modified: stable/9/sys/sys/module.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/module.h stable/7/sys/sys/module.h stable/8/sys/sys/module.h Directory Properties: stable/10/ (props changed) stable/7/ (props changed) stable/7/sys/ (props changed) stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/9/sys/sys/module.h ============================================================================== --- stable/9/sys/sys/module.h Thu May 28 05:38:07 2015 (r283641) +++ stable/9/sys/sys/module.h Thu May 28 06:45:13 2015 (r283642) @@ -106,7 +106,8 @@ struct mod_metadata { DATA_SET(modmetadata_set, _mod_metadata##uniquifier) #define MODULE_DEPEND(module, mdepend, vmin, vpref, vmax) \ - static struct mod_depend _##module##_depend_on_##mdepend = { \ + static struct mod_depend _##module##_depend_on_##mdepend \ + __section(".data") = { \ vmin, \ vpref, \ vmax \ @@ -146,7 +147,8 @@ struct mod_metadata { DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version) #define MODULE_VERSION(module, version) \ - static struct mod_version _##module##_version = { \ + static struct mod_version _##module##_version \ + __section(".data") = { \ version \ }; \ MODULE_METADATA(_##module##_version, MDT_VERSION, \ From owner-svn-src-stable@FreeBSD.ORG Thu May 28 06:45:15 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AC59143; Thu, 28 May 2015 06:45:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7638D; Thu, 28 May 2015 06:45:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4S6jFTl024185; Thu, 28 May 2015 06:45:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4S6jFTB024184; Thu, 28 May 2015 06:45:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201505280645.t4S6jFTB024184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 May 2015 06:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r283642 - in stable: 10/sys/sys 7/sys/sys 8/sys/sys 9/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 06:45:15 -0000 Author: dim Date: Thu May 28 06:45:13 2015 New Revision: 283642 URL: https://svnweb.freebsd.org/changeset/base/283642 Log: MFC r283254: Ensure that the static structs emitted by the MODULE_DEPEND() and MODULE_VERSION() macros don't end up as .comm symbols, when all the version fields are zero. Normally, such symbols will end up in .bss, but for kernel module version objects, this can lead to "garbage" version numbers. Fix this by instructing the compiler to always put these structs in the .data segment instead. Reported by: delphij, ae Modified: stable/8/sys/sys/module.h Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/module.h stable/7/sys/sys/module.h stable/9/sys/sys/module.h Directory Properties: stable/10/ (props changed) stable/7/ (props changed) stable/7/sys/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/8/sys/sys/module.h ============================================================================== --- stable/8/sys/sys/module.h Thu May 28 05:38:07 2015 (r283641) +++ stable/8/sys/sys/module.h Thu May 28 06:45:13 2015 (r283642) @@ -106,7 +106,8 @@ struct mod_metadata { DATA_SET(modmetadata_set, _mod_metadata##uniquifier) #define MODULE_DEPEND(module, mdepend, vmin, vpref, vmax) \ - static struct mod_depend _##module##_depend_on_##mdepend = { \ + static struct mod_depend _##module##_depend_on_##mdepend \ + __section(".data") = { \ vmin, \ vpref, \ vmax \ @@ -146,7 +147,8 @@ struct mod_metadata { DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version) #define MODULE_VERSION(module, version) \ - static struct mod_version _##module##_version = { \ + static struct mod_version _##module##_version \ + __section(".data") = { \ version \ }; \ MODULE_METADATA(_##module##_version, MDT_VERSION, \ From owner-svn-src-stable@FreeBSD.ORG Thu May 28 06:45:16 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C2EB144; Thu, 28 May 2015 06:45:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E42018E; Thu, 28 May 2015 06:45:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4S6jFWg024197; Thu, 28 May 2015 06:45:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4S6jF62024196; Thu, 28 May 2015 06:45:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201505280645.t4S6jF62024196@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 May 2015 06:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283642 - in stable: 10/sys/sys 7/sys/sys 8/sys/sys 9/sys/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 06:45:16 -0000 Author: dim Date: Thu May 28 06:45:13 2015 New Revision: 283642 URL: https://svnweb.freebsd.org/changeset/base/283642 Log: MFC r283254: Ensure that the static structs emitted by the MODULE_DEPEND() and MODULE_VERSION() macros don't end up as .comm symbols, when all the version fields are zero. Normally, such symbols will end up in .bss, but for kernel module version objects, this can lead to "garbage" version numbers. Fix this by instructing the compiler to always put these structs in the .data segment instead. Reported by: delphij, ae Modified: stable/10/sys/sys/module.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/sys/module.h stable/8/sys/sys/module.h stable/9/sys/sys/module.h Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/10/sys/sys/module.h ============================================================================== --- stable/10/sys/sys/module.h Thu May 28 05:38:07 2015 (r283641) +++ stable/10/sys/sys/module.h Thu May 28 06:45:13 2015 (r283642) @@ -106,7 +106,8 @@ struct mod_metadata { DATA_SET(modmetadata_set, _mod_metadata##uniquifier) #define MODULE_DEPEND(module, mdepend, vmin, vpref, vmax) \ - static struct mod_depend _##module##_depend_on_##mdepend = { \ + static struct mod_depend _##module##_depend_on_##mdepend \ + __section(".data") = { \ vmin, \ vpref, \ vmax \ @@ -146,7 +147,8 @@ struct mod_metadata { DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version) #define MODULE_VERSION(module, version) \ - static struct mod_version _##module##_version = { \ + static struct mod_version _##module##_version \ + __section(".data") = { \ version \ }; \ MODULE_METADATA(_##module##_version, MDT_VERSION, \ From owner-svn-src-stable@FreeBSD.ORG Thu May 28 06:45:17 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D89301A9; Thu, 28 May 2015 06:45:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 831488F; Thu, 28 May 2015 06:45:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4S6jGiB024208; Thu, 28 May 2015 06:45:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4S6jGku024207; Thu, 28 May 2015 06:45:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201505280645.t4S6jGku024207@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 May 2015 06:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r283642 - in stable: 10/sys/sys 7/sys/sys 8/sys/sys 9/sys/sys X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 06:45:17 -0000 Author: dim Date: Thu May 28 06:45:13 2015 New Revision: 283642 URL: https://svnweb.freebsd.org/changeset/base/283642 Log: MFC r283254: Ensure that the static structs emitted by the MODULE_DEPEND() and MODULE_VERSION() macros don't end up as .comm symbols, when all the version fields are zero. Normally, such symbols will end up in .bss, but for kernel module version objects, this can lead to "garbage" version numbers. Fix this by instructing the compiler to always put these structs in the .data segment instead. Reported by: delphij, ae Modified: stable/7/sys/sys/module.h Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/module.h stable/8/sys/sys/module.h stable/9/sys/sys/module.h Directory Properties: stable/10/ (props changed) stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/7/sys/sys/module.h ============================================================================== --- stable/7/sys/sys/module.h Thu May 28 05:38:07 2015 (r283641) +++ stable/7/sys/sys/module.h Thu May 28 06:45:13 2015 (r283642) @@ -106,7 +106,8 @@ struct mod_metadata { DATA_SET(modmetadata_set, _mod_metadata##uniquifier) #define MODULE_DEPEND(module, mdepend, vmin, vpref, vmax) \ - static struct mod_depend _##module##_depend_on_##mdepend = { \ + static struct mod_depend _##module##_depend_on_##mdepend \ + __section(".data") = { \ vmin, \ vpref, \ vmax \ @@ -120,7 +121,8 @@ struct mod_metadata { struct __hack #define MODULE_VERSION(module, version) \ - static struct mod_version _##module##_version = { \ + static struct mod_version _##module##_version \ + __section(".data") = { \ version \ }; \ MODULE_METADATA(_##module##_version, MDT_VERSION, \ From owner-svn-src-stable@FreeBSD.ORG Thu May 28 09:20:36 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3794A376; Thu, 28 May 2015 09:20:36 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25570AFB; Thu, 28 May 2015 09:20:36 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4S9KaAw099399; Thu, 28 May 2015 09:20:36 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4S9KZWR099397; Thu, 28 May 2015 09:20:35 GMT (envelope-from whu@FreeBSD.org) Message-Id: <201505280920.t4S9KZWR099397@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Thu, 28 May 2015 09:20: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: r283644 - stable/10/sys/dev/hyperv/storvsc 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 09:20:36 -0000 Author: whu Date: Thu May 28 09:20:35 2015 New Revision: 283644 URL: https://svnweb.freebsd.org/changeset/base/283644 Log: MFC r283053 Submitted by: whu Reviewed by: royger Approved by: royger Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D2661 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu May 28 08:00:11 2015 (r283643) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu May 28 09:20:35 2015 (r283644) @@ -87,6 +87,8 @@ __FBSDID("$FreeBSD$"); #define STORVSC_WIN8_MAJOR 5 #define STORVSC_WIN8_MINOR 1 +#define VSTOR_PKT_SIZE (sizeof(struct vstor_packet) - vmscsi_size_delta) + #define HV_ALIGN(x, a) roundup2(x, a) struct storvsc_softc; @@ -202,6 +204,21 @@ static struct storvsc_driver_props g_drv STORVSC_RINGBUFFER_SIZE} }; +/* + * Sense buffer size changed in win8; have a run-time + * variable to track the size we should use. + */ +static int sense_buffer_size; + +/* + * The size of the vmscsi_request has changed in win8. The + * additional size is for the newly added elements in the + * structure. These elements are valid only when we are talking + * to a win8 host. + * Track the correct size we need to apply. + */ +static int vmscsi_size_delta; + static int storvsc_current_major; static int storvsc_current_minor; @@ -214,6 +231,7 @@ static void storvsc_action(struct cam_si static int create_storvsc_request(union ccb *ccb, struct hv_storvsc_request *reqp); static void storvsc_free_request(struct storvsc_softc *sc, struct hv_storvsc_request *reqp); static enum hv_storage_type storvsc_get_storage_type(device_t dev); +static void hv_storvsc_rescan_target(struct storvsc_softc *sc); static void hv_storvsc_on_channel_callback(void *context); static void hv_storvsc_on_iocompletion( struct storvsc_softc *sc, struct vstor_packet *vstor_packet, @@ -381,7 +399,7 @@ storvsc_send_multichannel_request(struct ret = hv_vmbus_channel_send_packet( dev->channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -448,7 +466,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev->channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -481,7 +499,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev->channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -510,7 +528,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev->channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -546,7 +564,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev->channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -644,7 +662,7 @@ hv_storvsc_host_reset(struct hv_device * ret = hv_vmbus_channel_send_packet(dev->channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)&sc->hs_reset_req, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -695,9 +713,9 @@ hv_storvsc_io_request(struct hv_device * vstor_packet->flags |= REQUEST_COMPLETION_FLAG; - vstor_packet->u.vm_srb.length = sizeof(struct vmscsi_req); + vstor_packet->u.vm_srb.length = VSTOR_PKT_SIZE; - vstor_packet->u.vm_srb.sense_info_len = SENSE_BUFFER_SIZE; + vstor_packet->u.vm_srb.sense_info_len = sense_buffer_size; vstor_packet->u.vm_srb.transfer_len = request->data_buf.length; @@ -711,14 +729,14 @@ hv_storvsc_io_request(struct hv_device * outgoing_channel, &request->data_buf, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request); } else { ret = hv_vmbus_channel_send_packet( outgoing_channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -772,6 +790,41 @@ hv_storvsc_on_iocompletion(struct storvs } static void +hv_storvsc_rescan_target(struct storvsc_softc *sc) +{ + path_id_t pathid; + target_id_t targetid; + union ccb *ccb; + + pathid = cam_sim_path(sc->hs_sim); + targetid = CAM_TARGET_WILDCARD; + + /* + * Allocate a CCB and schedule a rescan. + */ + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + printf("unable to alloc CCB for rescan\n"); + return; + } + + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, targetid, + CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + printf("unable to create path for rescan, pathid: %d," + "targetid: %d\n", pathid, targetid); + xpt_free_ccb(ccb); + return; + } + + if (targetid == CAM_TARGET_WILDCARD) + ccb->ccb_h.func_code = XPT_SCAN_BUS; + else + ccb->ccb_h.func_code = XPT_SCAN_TGT; + + xpt_rescan(ccb); +} + +static void hv_storvsc_on_channel_callback(void *context) { int ret = 0; @@ -801,7 +854,7 @@ hv_storvsc_on_channel_callback(void *con ret = hv_vmbus_channel_recv_packet( channel, packet, - roundup2(sizeof(struct vstor_packet), 8), + roundup2(VSTOR_PKT_SIZE, 8), &bytes_recvd, &request_id); @@ -826,11 +879,13 @@ hv_storvsc_on_channel_callback(void *con vstor_packet, request); break; case VSTOR_OPERATION_REMOVEDEVICE: - case VSTOR_OPERATION_ENUMERATE_BUS: printf("VMBUS: storvsc operation %d not " "implemented.\n", vstor_packet->operation); /* TODO: implement */ break; + case VSTOR_OPERATION_ENUMERATE_BUS: + hv_storvsc_rescan_target(sc); + break; default: break; } @@ -838,7 +893,7 @@ hv_storvsc_on_channel_callback(void *con ret = hv_vmbus_channel_recv_packet( channel, packet, - roundup2(sizeof(struct vstor_packet), 8), + roundup2(VSTOR_PKT_SIZE, 8), &bytes_recvd, &request_id); } @@ -861,13 +916,17 @@ storvsc_probe(device_t dev) int ata_disk_enable = 0; int ret = ENXIO; - if ((HV_VMBUS_VERSION_WIN8 == hv_vmbus_protocal_version) || - (HV_VMBUS_VERSION_WIN8_1 == hv_vmbus_protocal_version)){ - storvsc_current_major = STORVSC_WIN8_MAJOR; - storvsc_current_minor = STORVSC_WIN8_MINOR; - } else { + if (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008 || + hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7) { + sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE; + vmscsi_size_delta = sizeof(struct vmscsi_win8_extension); storvsc_current_major = STORVSC_WIN7_MAJOR; storvsc_current_minor = STORVSC_WIN7_MINOR; + } else { + sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE; + vmscsi_size_delta = 0; + storvsc_current_major = STORVSC_WIN8_MAJOR; + storvsc_current_minor = STORVSC_WIN8_MINOR; } switch (storvsc_get_storage_type(dev)) { Modified: stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Thu May 28 08:00:11 2015 (r283643) +++ stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Thu May 28 09:20:35 2015 (r283644) @@ -51,6 +51,8 @@ * V1 Beta 0.1 * V1 RC < 2008/1/31 1.0 * V1 RC > 2008/1/31 2.0 + * Win7: 4.2 + * Win8: 5.1 */ #define VMSTOR_PROTOCOL_VERSION_CURRENT VMSTOR_PROTOCOL_VERSION(5, 1) @@ -83,9 +85,25 @@ enum vstor_packet_ops { */ #define CDB16GENERIC_LENGTH 0x10 -#define SENSE_BUFFER_SIZE 0x12 +#define SENSE_BUFFER_SIZE 0x14 #define MAX_DATA_BUFFER_LENGTH_WITH_PADDING 0x14 +#define POST_WIN7_STORVSC_SENSE_BUFFER_SIZE 0x14 +#define PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE 0x12 + + +struct vmscsi_win8_extension { + /* + * The following were added in Windows 8 + */ + uint16_t reserve; + uint8_t queue_tag; + uint8_t queue_action; + uint32_t srb_flags; + uint32_t time_out_value; + uint32_t queue_sort_ey; +} __packed; + struct vmscsi_req { uint16_t length; uint8_t srb_status; @@ -114,6 +132,11 @@ struct vmscsi_req { uint8_t reserved_array[MAX_DATA_BUFFER_LENGTH_WITH_PADDING]; } u; + /* + * The following was added in win8. + */ + struct vmscsi_win8_extension win8_extension; + } __packed; /** From owner-svn-src-stable@FreeBSD.ORG Thu May 28 13:12:06 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 564ED8FA; Thu, 28 May 2015 13:12:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43E3CE41; Thu, 28 May 2015 13:12:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4SDC64Z018523; Thu, 28 May 2015 13:12:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4SDC6Ok018522; Thu, 28 May 2015 13:12:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505281312.t4SDC6Ok018522@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 May 2015 13:12: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: r283646 - stable/10/sys/compat/ia32 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 13:12:06 -0000 Author: jhb Date: Thu May 28 13:12:05 2015 New Revision: 283646 URL: https://svnweb.freebsd.org/changeset/base/283646 Log: Fix COMPAT_FREEBSD32 build on ia64. This is a direct commit to stable/10 since ia64 is not present in head. Modified: stable/10/sys/compat/ia32/ia32_sysvec.c Modified: stable/10/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/10/sys/compat/ia32/ia32_sysvec.c Thu May 28 12:33:21 2015 (r283645) +++ stable/10/sys/compat/ia32/ia32_sysvec.c Thu May 28 13:12:05 2015 (r283646) @@ -192,6 +192,7 @@ SYSINIT(kia32, SI_SUB_EXEC, SI_ORDER_ANY void elf32_dump_thread(struct thread *td, void *dst, size_t *off) { +#ifdef __amd64__ void *buf; size_t len; @@ -209,6 +210,7 @@ elf32_dump_thread(struct thread *td, voi cpu_max_ext_state_size, NULL); } *off = len; +#endif } void From owner-svn-src-stable@FreeBSD.ORG Thu May 28 15:49:18 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCA218E9; Thu, 28 May 2015 15:49:18 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94874AB8; Thu, 28 May 2015 15:49:17 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0C7B0B962; Thu, 28 May 2015 11:49:17 -0400 (EDT) From: John Baldwin To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv Date: Thu, 28 May 2015 11:49:10 -0400 Message-ID: <1987595.JGalSDZ3Rh@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201505271744.t4RHiC04024525@svn.freebsd.org> References: <201505271744.t4RHiC04024525@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 28 May 2015 11:49:17 -0400 (EDT) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 15:49:18 -0000 On Wednesday, May 27, 2015 05:44:12 PM Eric Joyner wrote: > Author: erj > Date: Wed May 27 17:44:11 2015 > New Revision: 283620 > URL: https://svnweb.freebsd.org/changeset/base/283620 > > Log: > MFC ixgbe commits for 10.2: > > - r280182 - Split the driver into independent pf/vf loadables > - r280197 - Resolve build issues > - r280204 - Fix multiple same-name devclasses > - r280228 - Fix i386 LINT build issues / remove unused variable > - r280252 - Fix building ixgbe with gcc > - r280962 - Make changes to busdma code similar to r257541 > - r281772 & r281773 - Remove unused variable > - partial r282280 - stats counter update (ix-only) > - r282289 - Add X550 support > - r282290 - Add X550 makefile updates > - r282293 - Add ixgbe_x550.c to conf/files > - r282299 - Fix gcc compile (extraneous extern declaration) > > Finally, add ix_txrx.c to conf/files because it's required for compile in stable/10. FYI, this has broken 'make tinderbox' for all 32-bit kernels that include ix or ixgbe: /usr/home/john/work/freebsd/stable/10/sys/dev/ixgbe/if_ix.c:2494:21: error: impl icit conversion from 'unsigned long long' to 'u_long' (aka 'unsigned long') chan ges value from 10000000000 to 1410065408 [-Werror,-Wconstant-conversion] ifp->if_baudrate = IF_Gbps(10); ~ ^~~~~~~~~~~ /usr/home/john/work/freebsd/stable/10/sys/net/if.h:187:21: note: expanded from m acro 'IF_Gbps' #define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ ^~~~~~~~~~~~~~~~~~~ /usr/home/john/work/freebsd/stable/10/sys/net/if.h:186:21: note: expanded from m acro 'IF_Mbps' #define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ ^~~~~~~~~~~~~~~~~~~ /usr/home/john/work/freebsd/stable/10/sys/net/if.h:185:36: note: expanded from macro 'IF_Kbps' #define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ ~~~~~~~~~~~~~~~^~~~~~ 1 error generated. *** [if_ix.o] Error code 1 On 10.x you need to use if_initbaudrate() instead of setting if_baudrate directly. -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Thu May 28 16:23:57 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FB42603; Thu, 28 May 2015 16:23:57 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com [209.85.213.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFA8061C; Thu, 28 May 2015 16:23:56 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by igbpi8 with SMTP id pi8so118188399igb.0; Thu, 28 May 2015 09:23:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=O7e9tre+gbbwuSRaTH3pm5qusuNwdpWAp3SEc9K9rgE=; b=ffCj3FtydZUt8RYrs9LDb2lM3PCCwQs6/Tuit4GfyzbFJGqc2bnCZ37xRI/7rFR/JC uAO8Rklgo4DrkYDd41cmXfGdm8fmN33hozm2Gtah6gWt832E8F+MFGw5o0ExrrfYXfff Zd/UnLM6QuueVwXmM7cGmx0C1NDOCza5QP7QxEuFSFfa1kQxdi5McHrjOF7h1jfuw02Q zCME0uhgonF9CD2lUZU6286dIjy3tvKs6jYkHG17bCUzZOZT1VGDV7lZPM8cgrf2Tk4q g3pgwrKPjdDSkIkIpLRjbegjFICPXdMYSWwagwOsht4s/Kdv6nSMp3s5B7qqoKK+Fnxi tugA== X-Received: by 10.42.176.8 with SMTP id bc8mr9900826icb.22.1432830230268; Thu, 28 May 2015 09:23:50 -0700 (PDT) Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com. [209.85.223.172]) by mx.google.com with ESMTPSA id u35sm2094627iou.7.2015.05.28.09.23.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 09:23:50 -0700 (PDT) Received: by iebgx4 with SMTP id gx4so42421600ieb.0; Thu, 28 May 2015 09:23:49 -0700 (PDT) X-Received: by 10.107.152.14 with SMTP id a14mr4497055ioe.59.1432830229782; Thu, 28 May 2015 09:23:49 -0700 (PDT) MIME-Version: 1.0 References: <201505271744.t4RHiC04024525@svn.freebsd.org> <1987595.JGalSDZ3Rh@ralph.baldwin.cx> In-Reply-To: <1987595.JGalSDZ3Rh@ralph.baldwin.cx> From: Eric Joyner Date: Thu, 28 May 2015 16:23:49 +0000 Message-ID: Subject: Re: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 16:23:57 -0000 Ok; I'm working on it now. I've implemented your recommendation for an ixgbe stub that loads both if_ix and if_ixv, but Jack offered an alternative of just letting sys/dev/ixgbe/Makefile make an if_ixgbe module that combines if_ix and if_ixv. Looking at conf files for other architectures, it sounds like it would be a better idea to just do that for stable/10, and completely remove the ix and ixv Makefiles and module directories. I don't think anyone really cares to have a separate if_ix and if_ixv modules over just one if_ixgbe module. On Thu, May 28, 2015 at 8:49 AM John Baldwin wrote: > On Wednesday, May 27, 2015 05:44:12 PM Eric Joyner wrote: > > Author: erj > > Date: Wed May 27 17:44:11 2015 > > New Revision: 283620 > > URL: https://svnweb.freebsd.org/changeset/base/283620 > > > > Log: > > MFC ixgbe commits for 10.2: > > > > - r280182 - Split the driver into independent pf/vf loadables > > - r280197 - Resolve build issues > > - r280204 - Fix multiple same-name devclasses > > - r280228 - Fix i386 LINT build issues / remove unused variable > > - r280252 - Fix building ixgbe with gcc > > - r280962 - Make changes to busdma code similar to r257541 > > - r281772 & r281773 - Remove unused variable > > - partial r282280 - stats counter update (ix-only) > > - r282289 - Add X550 support > > - r282290 - Add X550 makefile updates > > - r282293 - Add ixgbe_x550.c to conf/files > > - r282299 - Fix gcc compile (extraneous extern declaration) > > > > Finally, add ix_txrx.c to conf/files because it's required for compile > in stable/10. > > FYI, this has broken 'make tinderbox' for all 32-bit kernels that include > ix or ixgbe: > > /usr/home/john/work/freebsd/stable/10/sys/dev/ixgbe/if_ix.c:2494:21: > error: impl > icit conversion from 'unsigned long long' to 'u_long' (aka 'unsigned > long') chan > ges value from 10000000000 to 1410065408 [-Werror,-Wconstant-conversion] > ifp->if_baudrate = IF_Gbps(10); > ~ ^~~~~~~~~~~ > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:187:21: note: expanded > from m > acro 'IF_Gbps' > #define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ > ^~~~~~~~~~~~~~~~~~~ > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:186:21: note: expanded > from m > acro 'IF_Mbps' > #define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ > ^~~~~~~~~~~~~~~~~~~ > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:185:36: note: expanded > from macro 'IF_Kbps' > #define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ > ~~~~~~~~~~~~~~~^~~~~~ > 1 error generated. > *** [if_ix.o] Error code 1 > > On 10.x you need to use if_initbaudrate() instead of setting if_baudrate > directly. > > -- > John Baldwin > > From owner-svn-src-stable@FreeBSD.ORG Thu May 28 16:27:13 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63CDF775; Thu, 28 May 2015 16:27:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2CD648; Thu, 28 May 2015 16:27:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2B65BB91F; Thu, 28 May 2015 12:27:12 -0400 (EDT) From: John Baldwin To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv Date: Thu, 28 May 2015 12:27:10 -0400 Message-ID: <4977499.IGj0rLHqPU@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201505271744.t4RHiC04024525@svn.freebsd.org> <1987595.JGalSDZ3Rh@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 28 May 2015 12:27:12 -0400 (EDT) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 16:27:13 -0000 On Thursday, May 28, 2015 04:23:49 PM Eric Joyner wrote: > Ok; I'm working on it now. I've implemented your recommendation for an > ixgbe stub that loads both if_ix and if_ixv, but Jack offered an > alternative of just letting sys/dev/ixgbe/Makefile make an if_ixgbe module > that combines if_ix and if_ixv. Looking at conf files for other > architectures, it sounds like it would be a better idea to just do that for > stable/10, and completely remove the ix and ixv Makefiles and module > directories. I don't think anyone really cares to have a separate if_ix and > if_ixv modules over just one if_ixgbe module. I probably prefer that you do actually have if_ix and if_ixv. There's always the ifconfig hack for NIC drivers that wants to autoload if_.ko to consider. I think it is also more friendly to users if 10 supports both the old and new models as it gives them more time to transition. However, reverting back to a single if_ixgbe.ko is also ok. > On Thu, May 28, 2015 at 8:49 AM John Baldwin wrote: > > > On Wednesday, May 27, 2015 05:44:12 PM Eric Joyner wrote: > > > Author: erj > > > Date: Wed May 27 17:44:11 2015 > > > New Revision: 283620 > > > URL: https://svnweb.freebsd.org/changeset/base/283620 > > > > > > Log: > > > MFC ixgbe commits for 10.2: > > > > > > - r280182 - Split the driver into independent pf/vf loadables > > > - r280197 - Resolve build issues > > > - r280204 - Fix multiple same-name devclasses > > > - r280228 - Fix i386 LINT build issues / remove unused variable > > > - r280252 - Fix building ixgbe with gcc > > > - r280962 - Make changes to busdma code similar to r257541 > > > - r281772 & r281773 - Remove unused variable > > > - partial r282280 - stats counter update (ix-only) > > > - r282289 - Add X550 support > > > - r282290 - Add X550 makefile updates > > > - r282293 - Add ixgbe_x550.c to conf/files > > > - r282299 - Fix gcc compile (extraneous extern declaration) > > > > > > Finally, add ix_txrx.c to conf/files because it's required for compile > > in stable/10. > > > > FYI, this has broken 'make tinderbox' for all 32-bit kernels that include > > ix or ixgbe: > > > > /usr/home/john/work/freebsd/stable/10/sys/dev/ixgbe/if_ix.c:2494:21: > > error: impl > > icit conversion from 'unsigned long long' to 'u_long' (aka 'unsigned > > long') chan > > ges value from 10000000000 to 1410065408 [-Werror,-Wconstant-conversion] > > ifp->if_baudrate = IF_Gbps(10); > > ~ ^~~~~~~~~~~ > > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:187:21: note: expanded > > from m > > acro 'IF_Gbps' > > #define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ > > ^~~~~~~~~~~~~~~~~~~ > > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:186:21: note: expanded > > from m > > acro 'IF_Mbps' > > #define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ > > ^~~~~~~~~~~~~~~~~~~ > > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:185:36: note: expanded > > from macro 'IF_Kbps' > > #define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ > > ~~~~~~~~~~~~~~~^~~~~~ > > 1 error generated. > > *** [if_ix.o] Error code 1 > > > > On 10.x you need to use if_initbaudrate() instead of setting if_baudrate > > directly. > > > > -- > > John Baldwin > > > > -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Thu May 28 20:56:14 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 357F1EAC; Thu, 28 May 2015 20:56:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 186A5136; Thu, 28 May 2015 20:56:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4SKuDp5055754; Thu, 28 May 2015 20:56:13 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4SKuCIX055744; Thu, 28 May 2015 20:56:12 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201505282056.t4SKuCIX055744@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 28 May 2015 20:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283668 - in stable/10/sys: conf dev/ixgbe modules modules/ix modules/ixgbe modules/ixv 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 20:56:14 -0000 Author: erj Date: Thu May 28 20:56:11 2015 New Revision: 283668 URL: https://svnweb.freebsd.org/changeset/base/283668 Log: Fix build issue and incompatibilites introduced by r283620. - Re-introduce "device ixgbe" option for kernel configs. This allows users to continue using existing kernel configurations, while still letting if_ix and if_ixv exist to allow ifconfig magic to work. Though the amd64 GENERIC config has "device ix" and "device ixv" instead of "device ixgbe". This is achieved by making the if_ixgbe module a stub that depends on if_ix and if_ixv. - Replace if_baudrate assignment with if_initbaudrate() call. Thanks to jhb@ for the stub module suggestion and pointing out the if_baudrate error. Approved by: jfv (mentor) Added: stable/10/sys/dev/ixgbe/ixgbe.c (contents, props changed) Modified: stable/10/sys/conf/files stable/10/sys/dev/ixgbe/if_ix.c stable/10/sys/modules/Makefile stable/10/sys/modules/ix/Makefile stable/10/sys/modules/ixgbe/Makefile stable/10/sys/modules/ixv/Makefile Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu May 28 20:36:37 2015 (r283667) +++ stable/10/sys/conf/files Thu May 28 20:56:11 2015 (r283668) @@ -1716,35 +1716,37 @@ iwn6050.fw optional iwn6050fw | iwnfw dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb -dev/ixgbe/if_ix.c optional ix inet \ +dev/ixgbe/ixgbe.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" -dev/ixgbe/if_ixv.c optional ixv inet \ +dev/ixgbe/if_ix.c optional ix inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" -dev/ixgbe/ix_txrx.c optional ixv inet \ +dev/ixgbe/if_ixv.c optional ixv inet | ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" +dev/ixgbe/ix_txrx.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_phy.c optional ix ixv inet \ +dev/ixgbe/ixgbe_phy.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_api.c optional ix ixv inet \ +dev/ixgbe/ixgbe_api.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_common.c optional ix ixv inet \ +dev/ixgbe/ixgbe_common.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_mbx.c optional ix ixv inet \ +dev/ixgbe/ixgbe_mbx.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_vf.c optional ix ixv inet \ +dev/ixgbe/ixgbe_vf.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_82598.c optional ix ixv inet \ +dev/ixgbe/ixgbe_82598.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_82599.c optional ix ixv inet \ +dev/ixgbe/ixgbe_82599.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_x540.c optional ix ixv inet \ +dev/ixgbe/ixgbe_x540.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_x550.c optional ix ixv inet \ +dev/ixgbe/ixgbe_x550.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb.c optional ix ixv inet \ +dev/ixgbe/ixgbe_dcb.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb_82598.c optional ix ixv inet \ +dev/ixgbe/ixgbe_dcb_82598.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb_82599.c optional ix ixv inet \ +dev/ixgbe/ixgbe_dcb_82599.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixl/if_ixl.c optional ixl inet \ compile-with "${NORMAL_C} -I$S/dev/ixl" Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu May 28 20:36:37 2015 (r283667) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu May 28 20:56:11 2015 (r283668) @@ -2491,20 +2491,11 @@ ixgbe_setup_interface(device_t dev, stru return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_baudrate = IF_Gbps(10); + if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixgbe_ioctl; -#if __FreeBSD_version >= 1100036 - if_setgetcounterfn(ifp, ixgbe_get_counter); -#endif -#if __FreeBSD_version >= 1100045 - /* TSO parameters */ - ifp->if_hw_tsomax = 65518; - ifp->if_hw_tsomaxsegcount = IXGBE_82599_SCATTER; - ifp->if_hw_tsomaxsegsize = 2048; -#endif #ifndef IXGBE_LEGACY_TX ifp->if_transmit = ixgbe_mq_start; ifp->if_qflush = ixgbe_qflush; Added: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/ixgbe/ixgbe.c Thu May 28 20:56:11 2015 (r283668) @@ -0,0 +1,50 @@ +/****************************************************************************** + + Copyright (c) 2001-2015, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include +#include +#include +#include + +static int +mod_event(module_t mod, int cmd, void *arg) +{ + return (0); +} + +static moduledata_t ixgbe_mod = {"if_ixgbe", mod_event}; +DECLARE_MODULE(ixgbe, ixgbe_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_DEPEND(ixgbe, ix, 1, 1, 1); +MODULE_DEPEND(ixgbe, ixv, 1, 1, 1); + Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Thu May 28 20:36:37 2015 (r283667) +++ stable/10/sys/modules/Makefile Thu May 28 20:56:11 2015 (r283668) @@ -171,9 +171,10 @@ SUBDIR= \ ${_iwifw} \ ${_iwn} \ ${_iwnfw} \ - ${_ixgb} \ ${_ix} \ ${_ixv} \ + ${_ixgb} \ + ${_ixgbe} \ ${_ixl} \ ${_ixlv} \ jme \ @@ -616,6 +617,8 @@ _iwn= iwn .if ${MK_SOURCELESS_UCODE} != "no" _iwnfw= iwnfw .endif +_ix= ix +_ixv= ixv _ixgb= ixgb _ixgbe= ixgbe _mly= mly @@ -722,6 +725,8 @@ _iwn= iwn .if ${MK_SOURCELESS_UCODE} != "no" _iwnfw= iwnfw .endif +_ix= ix +_ixv= ixv _ixgb= ixgb _ixgbe= ixgbe _ixl= ixl Modified: stable/10/sys/modules/ix/Makefile ============================================================================== --- stable/10/sys/modules/ix/Makefile Thu May 28 20:36:37 2015 (r283667) +++ stable/10/sys/modules/ix/Makefile Thu May 28 20:56:11 2015 (r283668) @@ -4,7 +4,7 @@ KMOD = if_ix SRCS = device_if.h bus_if.h pci_if.h -SRCS += opt_inet.h opt_inet6.h opt_rss.h +SRCS += opt_inet.h opt_inet6.h SRCS += if_ix.c ix_txrx.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c Modified: stable/10/sys/modules/ixgbe/Makefile ============================================================================== --- stable/10/sys/modules/ixgbe/Makefile Thu May 28 20:36:37 2015 (r283667) +++ stable/10/sys/modules/ixgbe/Makefile Thu May 28 20:56:11 2015 (r283668) @@ -1,29 +1,10 @@ #$FreeBSD$ -.include - .PATH: ${.CURDIR}/../../dev/ixgbe KMOD = if_ixgbe SRCS = device_if.h bus_if.h pci_if.h -SRCS += opt_inet.h opt_inet6.h -SRCS += ixgbe.c ixv.c -# Shared source -SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c -SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c -SRCS += ixgbe_82599.c ixgbe_82598.c ixgbe_x540.c +SRCS += ixgbe.c CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: stable/10/sys/modules/ixv/Makefile ============================================================================== --- stable/10/sys/modules/ixv/Makefile Thu May 28 20:36:37 2015 (r283667) +++ stable/10/sys/modules/ixv/Makefile Thu May 28 20:56:11 2015 (r283668) @@ -4,7 +4,7 @@ KMOD = if_ixv SRCS = device_if.h bus_if.h pci_if.h -SRCS += opt_inet.h opt_inet6.h opt_rss.h +SRCS += opt_inet.h opt_inet6.h SRCS += if_ixv.c ix_txrx.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c From owner-svn-src-stable@FreeBSD.ORG Thu May 28 21:31:48 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB4946BC; Thu, 28 May 2015 21:31:48 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6D23C87; Thu, 28 May 2015 21:31:48 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by igbpi8 with SMTP id pi8so148505igb.1; Thu, 28 May 2015 14:31:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=Wvj9ytgNa+uVg71vxSDQpPvH110dVJUxbBdnY2+BJQE=; b=aq2fYGzs/yCgb0FqJpN16gCVJ9qQWlro476QHjSyYMt+mpDaStc9AKQmS/Iuh9OE8X gQCZMDkG7txjUXqOm7MpPEAjZP10pBcwmeP45MiZi6KYw/RI1wYU3upjW/I1yMrv/UZ1 wtTQQU5waFzBBe2F8ieHBwKgySevDtXOmOctinTpccMZyhtyEsOMRW9tpSFS8FKHlAdR e9DM0I0LtIij1FnVOFLK5wlXN5KievJi594nGztgjYwdhPHvcpPKv2whuRmLh28sC1tu zOe2jtl33g32SYzifGq+Mi4dC2YTJXvMgBZ3gC6FIzm66bRCVzyv+FpKxzflJKNDWxeo PnNA== X-Received: by 10.50.103.97 with SMTP id fv1mr14033482igb.27.1432846982715; Thu, 28 May 2015 14:03:02 -0700 (PDT) Received: from mail-ie0-f176.google.com (mail-ie0-f176.google.com. [209.85.223.176]) by mx.google.com with ESMTPSA id x10sm2987708igl.0.2015.05.28.14.03.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 14:03:02 -0700 (PDT) Received: by iesa3 with SMTP id a3so48410060ies.2; Thu, 28 May 2015 14:03:02 -0700 (PDT) X-Received: by 10.50.36.72 with SMTP id o8mr13896562igj.16.1432846982287; Thu, 28 May 2015 14:03:02 -0700 (PDT) MIME-Version: 1.0 References: <201505271744.t4RHiC04024525@svn.freebsd.org> <1987595.JGalSDZ3Rh@ralph.baldwin.cx> <4977499.IGj0rLHqPU@ralph.baldwin.cx> In-Reply-To: <4977499.IGj0rLHqPU@ralph.baldwin.cx> From: Eric Joyner Date: Thu, 28 May 2015 21:03:01 +0000 Message-ID: Subject: Re: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 21:31:49 -0000 On Thu, May 28, 2015 at 9:27 AM John Baldwin wrote: > On Thursday, May 28, 2015 04:23:49 PM Eric Joyner wrote: > > Ok; I'm working on it now. I've implemented your recommendation for an > > ixgbe stub that loads both if_ix and if_ixv, but Jack offered an > > alternative of just letting sys/dev/ixgbe/Makefile make an if_ixgbe > module > > that combines if_ix and if_ixv. Looking at conf files for other > > architectures, it sounds like it would be a better idea to just do that > for > > stable/10, and completely remove the ix and ixv Makefiles and module > > directories. I don't think anyone really cares to have a separate if_ix > and > > if_ixv modules over just one if_ixgbe module. > > I probably prefer that you do actually have if_ix and if_ixv. There's > always > the ifconfig hack for NIC drivers that wants to autoload if_.ko to > consider. I think it is also more friendly to users if 10 supports both > the > old and new models as it gives them more time to transition. However, > reverting back to a single if_ixgbe.ko is also ok. > > > On Thu, May 28, 2015 at 8:49 AM John Baldwin wrote: > > > > > On Wednesday, May 27, 2015 05:44:12 PM Eric Joyner wrote: > > > > Author: erj > > > > Date: Wed May 27 17:44:11 2015 > > > > New Revision: 283620 > > > > URL: https://svnweb.freebsd.org/changeset/base/283620 > > > > > > > > Log: > > > > MFC ixgbe commits for 10.2: > > > > > > > > - r280182 - Split the driver into independent pf/vf loadables > > > > - r280197 - Resolve build issues > > > > - r280204 - Fix multiple same-name devclasses > > > > - r280228 - Fix i386 LINT build issues / remove unused variable > > > > - r280252 - Fix building ixgbe with gcc > > > > - r280962 - Make changes to busdma code similar to r257541 > > > > - r281772 & r281773 - Remove unused variable > > > > - partial r282280 - stats counter update (ix-only) > > > > - r282289 - Add X550 support > > > > - r282290 - Add X550 makefile updates > > > > - r282293 - Add ixgbe_x550.c to conf/files > > > > - r282299 - Fix gcc compile (extraneous extern declaration) > > > > > > > > Finally, add ix_txrx.c to conf/files because it's required for > compile > > > in stable/10. > > > > > > FYI, this has broken 'make tinderbox' for all 32-bit kernels that > include > > > ix or ixgbe: > > > > > > /usr/home/john/work/freebsd/stable/10/sys/dev/ixgbe/if_ix.c:2494:21: > > > error: impl > > > icit conversion from 'unsigned long long' to 'u_long' (aka 'unsigned > > > long') chan > > > ges value from 10000000000 to 1410065408 > [-Werror,-Wconstant-conversion] > > > ifp->if_baudrate = IF_Gbps(10); > > > ~ ^~~~~~~~~~~ > > > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:187:21: note: > expanded > > > from m > > > acro 'IF_Gbps' > > > #define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ > > > ^~~~~~~~~~~~~~~~~~~ > > > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:186:21: note: > expanded > > > from m > > > acro 'IF_Mbps' > > > #define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ > > > ^~~~~~~~~~~~~~~~~~~ > > > /usr/home/john/work/freebsd/stable/10/sys/net/if.h:185:36: note: > expanded > > > from macro 'IF_Kbps' > > > #define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ > > > ~~~~~~~~~~~~~~~^~~~~~ > > > 1 error generated. > > > *** [if_ix.o] Error code 1 > > > > > > On 10.x you need to use if_initbaudrate() instead of setting > if_baudrate > > > directly. > > > > > > -- > > > John Baldwin > > > > > > > -- > John Baldwin > I put the stub module in and removed the direct if_baudrate assignment in r283668. From owner-svn-src-stable@FreeBSD.ORG Fri May 29 00:46:15 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A941393D; Fri, 29 May 2015 00:46:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 950181E4E; Fri, 29 May 2015 00:46:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4T0kF79071389; Fri, 29 May 2015 00:46:15 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4T0kF4b071388; Fri, 29 May 2015 00:46:15 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505290046.t4T0kF4b071388@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 29 May 2015 00:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283672 - stable/10/release 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 00:46:15 -0000 Author: gjb Date: Fri May 29 00:46:14 2015 New Revision: 283672 URL: https://svnweb.freebsd.org/changeset/base/283672 Log: MFC r283573, r283574, r283575, r283576, r283580, r283593, r283618: r283573: Remove a continuation on error, since the relevant behavior can only occur if a particular file exists. r283574: Set STAGE_TARGETS only if RELEASEDIR exists. r283575: Remove duplicate exists() sanity check. r283576: Reindent after previous commit. r283580: Use SVNREVISION and BUILDDATE if passed into the make(1) environment, fallback to trying to figure it out otherwise. r283593: Fix a typo in a comment. r283618: Invert the build date and svn revision to match the namimg convention that has been in use for a while. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile.mirrors Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile.mirrors ============================================================================== --- stable/10/release/Makefile.mirrors Thu May 28 22:06:05 2015 (r283671) +++ stable/10/release/Makefile.mirrors Fri May 29 00:46:14 2015 (r283672) @@ -16,7 +16,9 @@ RELEASEDIR?= /R FTPDIR?= ${RELEASEDIR}/ftp-stage +.if exists(${RELEASEDIR}) STAGE_TARGETS?= iso-images-stage +.endif .if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD)) . if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm" @@ -28,24 +30,26 @@ EMBEDDED= 1 .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" SNAPSHOT= 1 TLD?= ${FTPDIR}/snapshots -. for _D in /usr/bin /usr/local/bin -. for _S in svnversion svnliteversion -. if exists(${_D}/${_S}) +. if !defined(SVNREVISION) || empty(SVNREVISION) +. for _D in /usr/bin /usr/local/bin +. for _S in svnversion svnliteversion +. if exists(${_D}/${_S}) SVNVERSION?= ${_D}/${_S} -. endif +. endif +. endfor . endfor -. endfor -. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh) +. if exists(${SVNVERSION}) && !empty(SVNVERSION) +SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile +. endif +. endif # !defined(SVNREVISION) +. if !defined(BUILDDATE) || empty(BUILDDATE) +. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh) BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d -. else +. else BUILDDATE!= date +%Y%m%d +. endif . endif -. if exists(${SVNVERSION}) && !empty(SVNVERSION) -SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile -_SNAP_SUFFIX:= -r${SVNREVISION}-${BUILDDATE} -. else -_SNAP_SUFFIX:= -${BUILDDATE} -. endif +_SNAP_SUFFIX:= ${BUILDDATE}-r${SVNREVISION} .else # release SNAPSHOT= @@ -83,18 +87,16 @@ remove-old-bits: iso-images-stage: mkdir -p ${ISO_DIR} mkdir -p ${TLD}/ISO-IMAGES/${REVISION} -.if exists(${RELEASEDIR}) - @# Assume we have images to copy. -. if defined(SNAPSHOT) && !empty(SNAPSHOT) +.if defined(SNAPSHOT) && !empty(SNAPSHOT) cd ${RELEASEDIR} && rm -f CHECKSUM.* -. for IMAGE in ${IMAGES} -. if defined(EMBEDDED) && !empty(EMBEDDED) -. if defined(OLDNAME) && !empty(OLDNAME) +. for IMAGE in ${IMAGES} +. if defined(EMBEDDED) && !empty(EMBEDDED) +. if defined(OLDNAME) && !empty(OLDNAME) @# arm/armv6 IMX6 -> WANDBOARD, for example. cd ${RELEASEDIR} && \ mv ${OSRELEASE}-${OLDNAME}.${IMAGE}.xz \ ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz -. endif +. endif cd ${RELEASEDIR} && \ mv ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \ ${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz @@ -103,31 +105,31 @@ iso-images-stage: cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz -. endif # not embedded -. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}) +. endif # not embedded +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}) cd ${RELEASEDIR} && \ mv ${OSRELEASE}-${IMAGE} \ - ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} || true + ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} \ ${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} -. endif -. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz) +. endif +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz) cd ${RELEASEDIR} && \ mv ${OSRELEASE}-${IMAGE}.xz \ - ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz || true + ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz \ ${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz -. endif -. endfor # images loop +. endif +. endfor # images loop cd ${RELEASEDIR} && rm -f CHECKSUM.* -. for CHECKSUM in ${CHECKSUM_FILES} -. if defined(EMBEDDED) && !empty(EMBEDDED) +. for CHECKSUM in ${CHECKSUM_FILES} +. if defined(EMBEDDED) && !empty(EMBEDDED) cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} \ @@ -135,7 +137,7 @@ iso-images-stage: cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} -. else # not embedded +. else # not embedded cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} \ @@ -143,42 +145,42 @@ iso-images-stage: cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} -. endif # -. endfor # checksum files -. else # not snapshot -. for IMAGE in ${IMAGES} -. if defined(EMBEDDED) && !empty(EMBEDDED) -. if defined(OLDNAME) && !empty(OLDNAME) +. endif # +. endfor # checksum files +.else # not snapshot +. for IMAGE in ${IMAGES} +. if defined(EMBEDDED) && !empty(EMBEDDED) +. if defined(OLDNAME) && !empty(OLDNAME) @# arm/armv6 IMX6 -> WANDBOARD, for example. cd ${RELEASEDIR} && \ mv ${OSRELEASE}-${OLDNAME}.${IMAGE}.xz \ ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz -. endif +. endif cp -p ${RELEASEDIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \ ${ISO_DIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz -. endif # not embedded -. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}) +. endif # not embedded +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}) cd ${RELEASEDIR} && \ cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \ ${ISO_DIR}/${OSRELEASE}-${IMAGE} cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE} -. endif -. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz) +. endif +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz) cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \ ${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}.xz -. endif -. endfor # images loop +. endif +. endfor # images loop cd ${RELEASEDIR} && rm -f CHECKSUM.* -. for CHECKSUM in ${CHECKSUM_FILES} -. if defined(EMBEDDED) && !empty(EMBEDDED) +. for CHECKSUM in ${CHECKSUM_FILES} +. if defined(EMBEDDED) && !empty(EMBEDDED) cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} \ @@ -186,7 +188,7 @@ iso-images-stage: cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} -. else # not embedded +. else # not embedded cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ CHECKSUM.${CHECKSUM}-${OSRELEASE} cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE} \ @@ -194,17 +196,16 @@ iso-images-stage: cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE} -. endif -. endfor # checksum files -. endif # release -. if exists(${RELEASEDIR}/ftp) +. endif +. endfor # checksum files +.endif # release +.if exists(${RELEASEDIR}/ftp) mkdir -p ${FTP_DIR} cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR} cd ${TLD}/${TARGET} && \ ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \ ${REVISION}-${BRANCH} -. endif -.endif # no RELEASEDIR +.endif vm-images-stage: mkdir -p ${VM_DIR} From owner-svn-src-stable@FreeBSD.ORG Fri May 29 03:47:36 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDB1D131; Fri, 29 May 2015 03:47:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABEB3176B; Fri, 29 May 2015 03:47:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4T3lajB060473; Fri, 29 May 2015 03:47:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4T3lZ2p060468; Fri, 29 May 2015 03:47:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201505290347.t4T3lZ2p060468@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 May 2015 03: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: r283675 - stable/10/sys/ofed/include/linux 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 03:47:37 -0000 Author: markj Date: Fri May 29 03:47:35 2015 New Revision: 283675 URL: https://svnweb.freebsd.org/changeset/base/283675 Log: MFC r282331: Don't drop the idr lock before verifying that the newly-inserted element is present in the tree. MFC r282741: find_next_bit() and find_next_zero_bit(): if the caller-specified offset lies within the last block of the bit set and no bits are set beyond the offset, terminate the search immediately instead of continuing as though there are further blocks in the set and subsequently returning an incorrect result. MFC r282743: Ensure that msecs_to_jiffies(0) == 0. Modified: stable/10/sys/ofed/include/linux/bitops.h stable/10/sys/ofed/include/linux/jiffies.h stable/10/sys/ofed/include/linux/linux_idr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/bitops.h ============================================================================== --- stable/10/sys/ofed/include/linux/bitops.h Fri May 29 02:16:40 2015 (r283674) +++ stable/10/sys/ofed/include/linux/bitops.h Fri May 29 03:47:35 2015 (r283675) @@ -165,6 +165,8 @@ find_next_bit(unsigned long *addr, unsig mask = (*addr) & ~BIT_MASK(offs); if (mask) return (bit + __ffsl(mask)); + if (size - bit <= BITS_PER_LONG) + return (size); bit += BITS_PER_LONG; addr++; } @@ -203,6 +205,8 @@ find_next_zero_bit(unsigned long *addr, mask = ~(*addr) & ~BIT_MASK(offs); if (mask) return (bit + __ffsl(mask)); + if (size - bit <= BITS_PER_LONG) + return (size); bit += BITS_PER_LONG; addr++; } Modified: stable/10/sys/ofed/include/linux/jiffies.h ============================================================================== --- stable/10/sys/ofed/include/linux/jiffies.h Fri May 29 02:16:40 2015 (r283674) +++ stable/10/sys/ofed/include/linux/jiffies.h Fri May 29 03:47:35 2015 (r283675) @@ -42,7 +42,7 @@ msecs_to_jiffies(int msec) tv.tv_sec = msec / 1000; tv.tv_usec = (msec % 1000) * 1000; - return (tvtohz(&tv)); + return (tvtohz(&tv) - 1); } #define jiffies ticks Modified: stable/10/sys/ofed/include/linux/linux_idr.c ============================================================================== --- stable/10/sys/ofed/include/linux/linux_idr.c Fri May 29 02:16:40 2015 (r283674) +++ stable/10/sys/ofed/include/linux/linux_idr.c Fri May 29 03:47:35 2015 (r283675) @@ -185,27 +185,37 @@ out: return (res); } -void * -idr_find(struct idr *idr, int id) +static inline void * +idr_find_locked(struct idr *idr, int id) { struct idr_layer *il; void *res; int layer; - res = NULL; + mtx_assert(&idr->lock, MA_OWNED); + id &= MAX_ID_MASK; - mtx_lock(&idr->lock); + res = NULL; il = idr->top; layer = idr->layers - 1; if (il == NULL || id > idr_max(idr)) - goto out; + return (NULL); while (layer && il) { il = il->ary[idr_pos(id, layer)]; layer--; } if (il != NULL) res = il->ary[id & IDR_MASK]; -out: + return (res); +} + +void * +idr_find(struct idr *idr, int id) +{ + void *res; + + mtx_lock(&idr->lock); + res = idr_find_locked(idr, id); mtx_unlock(&idr->lock); return (res); } @@ -331,13 +341,13 @@ idr_get_new(struct idr *idr, void *ptr, } error = 0; out: - mtx_unlock(&idr->lock); #ifdef INVARIANTS - if (error == 0 && idr_find(idr, id) != ptr) { + if (error == 0 && idr_find_locked(idr, id) != ptr) { panic("idr_get_new: Failed for idr %p, id %d, ptr %p\n", idr, id, ptr); } #endif + mtx_unlock(&idr->lock); return (error); } @@ -438,12 +448,12 @@ restart: } error = 0; out: - mtx_unlock(&idr->lock); #ifdef INVARIANTS - if (error == 0 && idr_find(idr, id) != ptr) { + if (error == 0 && idr_find_locked(idr, id) != ptr) { panic("idr_get_new_above: Failed for idr %p, id %d, ptr %p\n", idr, id, ptr); } #endif + mtx_unlock(&idr->lock); return (error); } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 04:01:42 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB0BF2D9; Fri, 29 May 2015 04:01:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A69A21B2A; Fri, 29 May 2015 04:01:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4T41gkn069579; Fri, 29 May 2015 04:01:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4T41dJg069548; Fri, 29 May 2015 04:01:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201505290401.t4T41dJg069548@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 May 2015 04:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283676 - in stable/10: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace sys/cddl/dev/dtrace/amd64 sys/cddl/dev/dtrace/i386 sys/cddl/dev/dtrace/mips 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 04:01:42 -0000 Author: markj Date: Fri May 29 04:01:39 2015 New Revision: 283676 URL: https://svnweb.freebsd.org/changeset/base/283676 Log: MFC r281915: Make vpanic() externally visible. MFC r281916: Fix DTrace's panic() action. Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/panic.9 stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/10/sys/cddl/dev/dtrace/amd64/dtrace_asm.S stable/10/sys/cddl/dev/dtrace/dtrace_hacks.c stable/10/sys/cddl/dev/dtrace/i386/dtrace_asm.S stable/10/sys/cddl/dev/dtrace/mips/dtrace_asm.S stable/10/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S stable/10/sys/kern/kern_shutdown.c stable/10/sys/sys/systm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Fri May 29 03:47:35 2015 (r283675) +++ stable/10/share/man/man9/Makefile Fri May 29 04:01:39 2015 (r283676) @@ -1002,6 +1002,7 @@ MLINKS+=mutex.9 mtx_assert.9 \ mutex.9 mtx_unlock_spin_flags.9 MLINKS+=namei.9 NDFREE.9 \ namei.9 NDINIT.9 +MLINKS+=panic.9 vpanic.9 MLINKS+=pbuf.9 getpbuf.9 \ pbuf.9 relpbuf.9 \ pbuf.9 trypbuf.9 Modified: stable/10/share/man/man9/panic.9 ============================================================================== --- stable/10/share/man/man9/panic.9 Fri May 29 03:47:35 2015 (r283675) +++ stable/10/share/man/man9/panic.9 Fri May 29 04:01:39 2015 (r283676) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 11, 1995 +.Dd April 23, 2015 .Dt PANIC 9 .Os .Sh NAME @@ -42,10 +42,14 @@ .In sys/systm.h .Ft void .Fn panic "const char *fmt" ... +.Ft void +.Fn vpanic "const char *fmt" "va_list ap" .Sh DESCRIPTION The .Fn panic -function terminates the running system. +and +.Fn vpanic +functions terminate the running system. The message .Fa fmt is a Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri May 29 03:47:35 2015 (r283675) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri May 29 04:01:39 2015 (r283676) @@ -606,7 +606,11 @@ dtrace_panic(const char *format, ...) va_list alist; va_start(alist, format); +#ifdef __FreeBSD__ + vpanic(format, alist); +#else dtrace_vpanic(format, alist); +#endif va_end(alist); } Modified: stable/10/sys/cddl/dev/dtrace/amd64/dtrace_asm.S ============================================================================== --- stable/10/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Fri May 29 03:47:35 2015 (r283675) +++ stable/10/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Fri May 29 04:01:39 2015 (r283676) @@ -363,211 +363,3 @@ dtrace_interrupt_enable(dtrace_icookie_t popfq ret END(dtrace_interrupt_enable) - -/* - * The panic() and cmn_err() functions invoke vpanic() as a common entry point - * into the panic code implemented in panicsys(). vpanic() is responsible - * for passing through the format string and arguments, and constructing a - * regs structure on the stack into which it saves the current register - * values. If we are not dying due to a fatal trap, these registers will - * then be preserved in panicbuf as the current processor state. Before - * invoking panicsys(), vpanic() activates the first panic trigger (see - * common/os/panic.c) and switches to the panic_stack if successful. Note that - * DTrace takes a slightly different panic path if it must panic from probe - * context. Instead of calling panic, it calls into dtrace_vpanic(), which - * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and - * branches back into vpanic(). - */ - -/* -void -vpanic(const char *format, va_list alist) -*/ - ENTRY(vpanic) /* Initial stack layout: */ - - pushq %rbp /* | %rip | 0x60 */ - movq %rsp, %rbp /* | %rbp | 0x58 */ - pushfq /* | rfl | 0x50 */ - pushq %r11 /* | %r11 | 0x48 */ - pushq %r10 /* | %r10 | 0x40 */ - pushq %rbx /* | %rbx | 0x38 */ - pushq %rax /* | %rax | 0x30 */ - pushq %r9 /* | %r9 | 0x28 */ - pushq %r8 /* | %r8 | 0x20 */ - pushq %rcx /* | %rcx | 0x18 */ - pushq %rdx /* | %rdx | 0x10 */ - pushq %rsi /* | %rsi | 0x8 alist */ - pushq %rdi /* | %rdi | 0x0 format */ - - movq %rsp, %rbx /* %rbx = current %rsp */ - - leaq panic_quiesce(%rip), %rdi /* %rdi = &panic_quiesce */ - call panic_trigger /* %eax = panic_trigger() */ - -vpanic_common: - /* - * The panic_trigger result is in %eax from the call above, and - * dtrace_panic places it in %eax before branching here. - * The rdmsr instructions that follow below will clobber %eax so - * we stash the panic_trigger result in %r11d. - */ - movl %eax, %r11d - cmpl $0, %r11d - je 0f - - /* - * If panic_trigger() was successful, we are the first to initiate a - * panic: we now switch to the reserved panic_stack before continuing. - */ - leaq panic_stack(%rip), %rsp - addq $PANICSTKSIZE, %rsp -0: subq $REGSIZE, %rsp - /* - * Now that we've got everything set up, store the register values as - * they were when we entered vpanic() to the designated location in - * the regs structure we allocated on the stack. - */ -#ifdef notyet - movq 0x0(%rbx), %rcx - movq %rcx, REGOFF_RDI(%rsp) - movq 0x8(%rbx), %rcx - movq %rcx, REGOFF_RSI(%rsp) - movq 0x10(%rbx), %rcx - movq %rcx, REGOFF_RDX(%rsp) - movq 0x18(%rbx), %rcx - movq %rcx, REGOFF_RCX(%rsp) - movq 0x20(%rbx), %rcx - - movq %rcx, REGOFF_R8(%rsp) - movq 0x28(%rbx), %rcx - movq %rcx, REGOFF_R9(%rsp) - movq 0x30(%rbx), %rcx - movq %rcx, REGOFF_RAX(%rsp) - movq 0x38(%rbx), %rcx - movq %rcx, REGOFF_RBX(%rsp) - movq 0x58(%rbx), %rcx - - movq %rcx, REGOFF_RBP(%rsp) - movq 0x40(%rbx), %rcx - movq %rcx, REGOFF_R10(%rsp) - movq 0x48(%rbx), %rcx - movq %rcx, REGOFF_R11(%rsp) - movq %r12, REGOFF_R12(%rsp) - - movq %r13, REGOFF_R13(%rsp) - movq %r14, REGOFF_R14(%rsp) - movq %r15, REGOFF_R15(%rsp) - - xorl %ecx, %ecx - movw %ds, %cx - movq %rcx, REGOFF_DS(%rsp) - movw %es, %cx - movq %rcx, REGOFF_ES(%rsp) - movw %fs, %cx - movq %rcx, REGOFF_FS(%rsp) - movw %gs, %cx - movq %rcx, REGOFF_GS(%rsp) - - movq $0, REGOFF_TRAPNO(%rsp) - - movq $0, REGOFF_ERR(%rsp) - leaq vpanic(%rip), %rcx - movq %rcx, REGOFF_RIP(%rsp) - movw %cs, %cx - movzwq %cx, %rcx - movq %rcx, REGOFF_CS(%rsp) - movq 0x50(%rbx), %rcx - movq %rcx, REGOFF_RFL(%rsp) - movq %rbx, %rcx - addq $0x60, %rcx - movq %rcx, REGOFF_RSP(%rsp) - movw %ss, %cx - movzwq %cx, %rcx - movq %rcx, REGOFF_SS(%rsp) - - /* - * panicsys(format, alist, rp, on_panic_stack) - */ - movq REGOFF_RDI(%rsp), %rdi /* format */ - movq REGOFF_RSI(%rsp), %rsi /* alist */ - movq %rsp, %rdx /* struct regs */ - movl %r11d, %ecx /* on_panic_stack */ - call panicsys - addq $REGSIZE, %rsp -#endif - popq %rdi - popq %rsi - popq %rdx - popq %rcx - popq %r8 - popq %r9 - popq %rax - popq %rbx - popq %r10 - popq %r11 - popfq - leave - ret - END(vpanic) - -/* -void -dtrace_vpanic(const char *format, va_list alist) -*/ - ENTRY(dtrace_vpanic) /* Initial stack layout: */ - - pushq %rbp /* | %rip | 0x60 */ - movq %rsp, %rbp /* | %rbp | 0x58 */ - pushfq /* | rfl | 0x50 */ - pushq %r11 /* | %r11 | 0x48 */ - pushq %r10 /* | %r10 | 0x40 */ - pushq %rbx /* | %rbx | 0x38 */ - pushq %rax /* | %rax | 0x30 */ - pushq %r9 /* | %r9 | 0x28 */ - pushq %r8 /* | %r8 | 0x20 */ - pushq %rcx /* | %rcx | 0x18 */ - pushq %rdx /* | %rdx | 0x10 */ - pushq %rsi /* | %rsi | 0x8 alist */ - pushq %rdi /* | %rdi | 0x0 format */ - - movq %rsp, %rbx /* %rbx = current %rsp */ - - leaq panic_quiesce(%rip), %rdi /* %rdi = &panic_quiesce */ - call dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ - jmp vpanic_common - - END(dtrace_vpanic) - -/* -int -panic_trigger(int *tp) -*/ - ENTRY(panic_trigger) - xorl %eax, %eax - movl $0xdefacedd, %edx - lock - xchgl %edx, (%rdi) - cmpl $0, %edx - je 0f - movl $0, %eax - ret -0: movl $1, %eax - ret - END(panic_trigger) - -/* -int -dtrace_panic_trigger(int *tp) -*/ - ENTRY(dtrace_panic_trigger) - xorl %eax, %eax - movl $0xdefacedd, %edx - lock - xchgl %edx, (%rdi) - cmpl $0, %edx - je 0f - movl $0, %eax - ret -0: movl $1, %eax - ret - END(dtrace_panic_trigger) Modified: stable/10/sys/cddl/dev/dtrace/dtrace_hacks.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_hacks.c Fri May 29 03:47:35 2015 (r283675) +++ stable/10/sys/cddl/dev/dtrace/dtrace_hacks.c Fri May 29 04:01:39 2015 (r283676) @@ -3,9 +3,6 @@ dtrace_cacheid_t dtrace_predcache_id; -int panic_quiesce; -char panic_stack[PANICSTKSIZE]; - boolean_t priv_policy_only(const cred_t *a, int b, boolean_t c) { Modified: stable/10/sys/cddl/dev/dtrace/i386/dtrace_asm.S ============================================================================== --- stable/10/sys/cddl/dev/dtrace/i386/dtrace_asm.S Fri May 29 03:47:35 2015 (r283675) +++ stable/10/sys/cddl/dev/dtrace/i386/dtrace_asm.S Fri May 29 04:01:39 2015 (r283676) @@ -355,167 +355,3 @@ void dtrace_interrupt_enable(dtrace_icoo popfl ret END(dtrace_interrupt_enable) - -/* - * The panic() and cmn_err() functions invoke vpanic() as a common entry point - * into the panic code implemented in panicsys(). vpanic() is responsible - * for passing through the format string and arguments, and constructing a - * regs structure on the stack into which it saves the current register - * values. If we are not dying due to a fatal trap, these registers will - * then be preserved in panicbuf as the current processor state. Before - * invoking panicsys(), vpanic() activates the first panic trigger (see - * common/os/panic.c) and switches to the panic_stack if successful. Note that - * DTrace takes a slightly different panic path if it must panic from probe - * context. Instead of calling panic, it calls into dtrace_vpanic(), which - * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and - * branches back into vpanic(). - */ -/* -void vpanic(const char *format, va_list alist) -*/ - ENTRY(vpanic) /* Initial stack layout: */ - - pushl %ebp /* | %eip | 20 */ - movl %esp, %ebp /* | %ebp | 16 */ - pushl %eax /* | %eax | 12 */ - pushl %ebx /* | %ebx | 8 */ - pushl %ecx /* | %ecx | 4 */ - pushl %edx /* | %edx | 0 */ - - movl %esp, %ebx /* %ebx = current stack pointer */ - - lea panic_quiesce, %eax /* %eax = &panic_quiesce */ - pushl %eax /* push &panic_quiesce */ - call panic_trigger /* %eax = panic_trigger() */ - addl $4, %esp /* reset stack pointer */ - -vpanic_common: - cmpl $0, %eax /* if (%eax == 0) */ - je 0f /* goto 0f; */ - - /* - * If panic_trigger() was successful, we are the first to initiate a - * panic: we now switch to the reserved panic_stack before continuing. - */ - lea panic_stack, %esp /* %esp = panic_stack */ - addl $PANICSTKSIZE, %esp /* %esp += PANICSTKSIZE */ - -0: subl $REGSIZE, %esp /* allocate struct regs */ - - /* - * Now that we've got everything set up, store the register values as - * they were when we entered vpanic() to the designated location in - * the regs structure we allocated on the stack. - */ -#ifdef notyet - mov %gs, %edx - mov %edx, REGOFF_GS(%esp) - mov %fs, %edx - mov %edx, REGOFF_FS(%esp) - mov %es, %edx - mov %edx, REGOFF_ES(%esp) - mov %ds, %edx - mov %edx, REGOFF_DS(%esp) - movl %edi, REGOFF_EDI(%esp) - movl %esi, REGOFF_ESI(%esp) - movl 16(%ebx), %ecx - movl %ecx, REGOFF_EBP(%esp) - movl %ebx, %ecx - addl $20, %ecx - movl %ecx, REGOFF_ESP(%esp) - movl 8(%ebx), %ecx - movl %ecx, REGOFF_EBX(%esp) - movl 0(%ebx), %ecx - movl %ecx, REGOFF_EDX(%esp) - movl 4(%ebx), %ecx - movl %ecx, REGOFF_ECX(%esp) - movl 12(%ebx), %ecx - movl %ecx, REGOFF_EAX(%esp) - movl $0, REGOFF_TRAPNO(%esp) - movl $0, REGOFF_ERR(%esp) - lea vpanic, %ecx - movl %ecx, REGOFF_EIP(%esp) - mov %cs, %edx - movl %edx, REGOFF_CS(%esp) - pushfl - popl %ecx - movl %ecx, REGOFF_EFL(%esp) - movl $0, REGOFF_UESP(%esp) - mov %ss, %edx - movl %edx, REGOFF_SS(%esp) - - movl %esp, %ecx /* %ecx = ®s */ - pushl %eax /* push on_panic_stack */ - pushl %ecx /* push ®s */ - movl 12(%ebp), %ecx /* %ecx = alist */ - pushl %ecx /* push alist */ - movl 8(%ebp), %ecx /* %ecx = format */ - pushl %ecx /* push format */ - call panicsys /* panicsys(); */ - addl $16, %esp /* pop arguments */ - - addl $REGSIZE, %esp -#endif - popl %edx - popl %ecx - popl %ebx - popl %eax - leave - ret - END(vpanic) - -/* -void dtrace_vpanic(const char *format, va_list alist) -*/ - ENTRY(dtrace_vpanic) /* Initial stack layout: */ - - pushl %ebp /* | %eip | 20 */ - movl %esp, %ebp /* | %ebp | 16 */ - pushl %eax /* | %eax | 12 */ - pushl %ebx /* | %ebx | 8 */ - pushl %ecx /* | %ecx | 4 */ - pushl %edx /* | %edx | 0 */ - - movl %esp, %ebx /* %ebx = current stack pointer */ - - lea panic_quiesce, %eax /* %eax = &panic_quiesce */ - pushl %eax /* push &panic_quiesce */ - call dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ - addl $4, %esp /* reset stack pointer */ - jmp vpanic_common /* jump back to common code */ - - END(dtrace_vpanic) - -/* -int -panic_trigger(int *tp) -*/ - ENTRY(panic_trigger) - xorl %eax, %eax - movl $0xdefacedd, %edx - lock - xchgl %edx, (%edi) - cmpl $0, %edx - je 0f - movl $0, %eax - ret -0: movl $1, %eax - ret - END(panic_trigger) - -/* -int -dtrace_panic_trigger(int *tp) -*/ - ENTRY(dtrace_panic_trigger) - xorl %eax, %eax - movl $0xdefacedd, %edx - lock - xchgl %edx, (%edi) - cmpl $0, %edx - je 0f - movl $0, %eax - ret -0: movl $1, %eax - ret - END(dtrace_panic_trigger) Modified: stable/10/sys/cddl/dev/dtrace/mips/dtrace_asm.S ============================================================================== --- stable/10/sys/cddl/dev/dtrace/mips/dtrace_asm.S Fri May 29 03:47:35 2015 (r283675) +++ stable/10/sys/cddl/dev/dtrace/mips/dtrace_asm.S Fri May 29 04:01:39 2015 (r283676) @@ -249,49 +249,6 @@ LEAF(dtrace_invop_uninit) END(dtrace_invop_uninit) /* - * The panic() and cmn_err() functions invoke vpanic() as a common entry point - * into the panic code implemented in panicsys(). vpanic() is responsible - * for passing through the format string and arguments, and constructing a - * regs structure on the stack into which it saves the current register - * values. If we are not dying due to a fatal trap, these registers will - * then be preserved in panicbuf as the current processor state. Before - * invoking panicsys(), vpanic() activates the first panic trigger (see - * common/os/panic.c) and switches to the panic_stack if successful. Note that - * DTrace takes a slightly different panic path if it must panic from probe - * context. Instead of calling panic, it calls into dtrace_vpanic(), which - * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and - * branches back into vpanic(). - */ - -/* -void -vpanic(const char *format, va_list alist) -*/ -LEAF(vpanic) /* Initial stack layout: */ - -vpanic_common: - j ra - nop -END(vpanic) - - - -/* -void -dtrace_vpanic(const char *format, va_list alist) -*/ -LEAF(dtrace_vpanic) /* Initial stack layout: */ - -#if 0 - jal dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ - nop -#endif - j vpanic_common - nop - -END(dtrace_vpanic) - -/* uintptr_t dtrace_caller(int aframes) */ @@ -300,4 +257,3 @@ LEAF(dtrace_caller) j ra nop END(dtrace_caller) - Modified: stable/10/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S ============================================================================== --- stable/10/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Fri May 29 03:47:35 2015 (r283675) +++ stable/10/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Fri May 29 04:01:39 2015 (r283676) @@ -161,45 +161,6 @@ ASENTRY_NOPROF(dtrace_copystr) END(dtrace_copystr) /* - * The panic() and cmn_err() functions invoke vpanic() as a common entry point - * into the panic code implemented in panicsys(). vpanic() is responsible - * for passing through the format string and arguments, and constructing a - * regs structure on the stack into which it saves the current register - * values. If we are not dying due to a fatal trap, these registers will - * then be preserved in panicbuf as the current processor state. Before - * invoking panicsys(), vpanic() activates the first panic trigger (see - * common/os/panic.c) and switches to the panic_stack if successful. Note that - * DTrace takes a slightly different panic path if it must panic from probe - * context. Instead of calling panic, it calls into dtrace_vpanic(), which - * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and - * branches back into vpanic(). - */ - -/* -void -vpanic(const char *format, va_list alist) -*/ -ASENTRY_NOPROF(vpanic) /* Initial stack layout: */ - -vpanic_common: - blr -END(vpanic) - - - -/* -void -dtrace_vpanic(const char *format, va_list alist) -*/ -ASENTRY_NOPROF(dtrace_vpanic) /* Initial stack layout: */ - -#if 0 - bl dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ -#endif - b vpanic_common -END(dtrace_vpanic) - -/* uintptr_t dtrace_caller(int aframes) */ @@ -207,4 +168,3 @@ ASENTRY_NOPROF(dtrace_caller) li %r3, -1 blr END(dtrace_caller) - Modified: stable/10/sys/kern/kern_shutdown.c ============================================================================== --- stable/10/sys/kern/kern_shutdown.c Fri May 29 03:47:35 2015 (r283675) +++ stable/10/sys/kern/kern_shutdown.c Fri May 29 04:01:39 2015 (r283676) @@ -157,7 +157,6 @@ static void poweroff_wait(void *, int); static void shutdown_halt(void *junk, int howto); static void shutdown_panic(void *junk, int howto); static void shutdown_reset(void *junk, int howto); -static void vpanic(const char *fmt, va_list ap) __dead2; /* register various local shutdown events */ static void @@ -688,7 +687,7 @@ panic(const char *fmt, ...) vpanic(fmt, ap); } -static void +void vpanic(const char *fmt, va_list ap) { #ifdef SMP Modified: stable/10/sys/sys/systm.h ============================================================================== --- stable/10/sys/sys/systm.h Fri May 29 03:47:35 2015 (r283675) +++ stable/10/sys/sys/systm.h Fri May 29 04:01:39 2015 (r283676) @@ -187,6 +187,7 @@ void *phashinit(int count, struct malloc void g_waitidle(void); void panic(const char *, ...) __dead2 __printflike(1, 2); +void vpanic(const char *, __va_list) __dead2 __printflike(1, 0); void cpu_boot(int); void cpu_flush_dcache(void *, size_t); From owner-svn-src-stable@FreeBSD.ORG Fri May 29 04:22:58 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 647695A8; Fri, 29 May 2015 04:22:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5297C1FB4; Fri, 29 May 2015 04:22:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4T4Mw2r079547; Fri, 29 May 2015 04:22:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4T4MwKt079546; Fri, 29 May 2015 04:22:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201505290422.t4T4MwKt079546@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 29 May 2015 04:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283677 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 04:22:58 -0000 Author: markj Date: Fri May 29 04:22:57 2015 New Revision: 283677 URL: https://svnweb.freebsd.org/changeset/base/283677 Log: MFC r277915: Don't attempt to disable enabled fasttrap probes in an exiting process. MFC r277914: fasttrap_sigtrap(): use tdsendsignal() to send SIGTRAP. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri May 29 04:01:39 2015 (r283676) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri May 29 04:22:57 2015 (r283677) @@ -295,7 +295,7 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t ksi->ksi_code = TRAP_DTRACE; ksi->ksi_addr = (caddr_t)pc; PROC_LOCK(p); - (void) tdksignal(t, SIGTRAP, ksi); + (void) tdsendsignal(p, t, SIGTRAP, ksi); PROC_UNLOCK(p); #endif } @@ -1296,8 +1296,13 @@ fasttrap_pid_disable(void *arg, dtrace_i */ if ((p = pfind(probe->ftp_pid)) != NULL) { #ifdef __FreeBSD__ - _PHOLD(p); - PROC_UNLOCK(p); + if (p->p_flag & P_WEXIT) { + PROC_UNLOCK(p); + p = NULL; + } else { + _PHOLD(p); + PROC_UNLOCK(p); + } #endif } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 05:58:22 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04C9562A; Fri, 29 May 2015 05:58:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5DC11368; Fri, 29 May 2015 05:58:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4T5wL96027203; Fri, 29 May 2015 05:58:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4T5wL8q027202; Fri, 29 May 2015 05:58:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201505290558.t4T5wL8q027202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 29 May 2015 05:58:21 +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: r283682 - stable/10/sys/dev/sfxge 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 05:58:22 -0000 Author: arybchik Date: Fri May 29 05:58:21 2015 New Revision: 283682 URL: https://svnweb.freebsd.org/changeset/base/283682 Log: MFC: r283599 sfxge: mask ifmedia options (pauses) when looking for matching mode Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Fri May 29 05:50:33 2015 (r283681) +++ stable/10/sys/dev/sfxge/sfxge_port.c Fri May 29 05:58:21 2015 (r283682) @@ -710,6 +710,8 @@ sfxge_link_mode_to_phy_cap(efx_link_mode static int sfxge_phy_cap_mask(struct sfxge_softc *sc, int ifmedia, uint32_t *phy_cap_mask) { + /* Get global options (duplex), type and subtype bits */ + int ifmedia_masked = ifmedia & (IFM_GMASK | IFM_NMASK | IFM_TMASK); efx_phy_media_type_t medium_type; boolean_t mode_found = B_FALSE; uint32_t cap_mask, mode_cap_mask; @@ -725,7 +727,7 @@ sfxge_phy_cap_mask(struct sfxge_softc *s efx_phy_adv_cap_get(sc->enp, EFX_PHY_CAP_PERM, &cap_mask); for (mode = EFX_LINK_10HDX; mode < EFX_LINK_NMODES; mode++) { - if (ifmedia == sfxge_link_mode[medium_type][mode]) { + if (ifmedia_masked == sfxge_link_mode[medium_type][mode]) { mode_found = B_TRUE; break; } @@ -736,8 +738,8 @@ sfxge_phy_cap_mask(struct sfxge_softc *s * If media is not in the table, it must be IFM_AUTO. */ KASSERT((cap_mask & (1 << EFX_PHY_CAP_AN)) && - ifmedia == (IFM_ETHER | IFM_AUTO), - ("%s: no mode for media %d", __func__, ifmedia)); + ifmedia_masked == (IFM_ETHER | IFM_AUTO), + ("%s: no mode for media %#x", __func__, ifmedia)); *phy_cap_mask = (cap_mask & ~(1 << EFX_PHY_CAP_ASYM)); return (0); } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 07:48:31 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14336681; Fri, 29 May 2015 07:48:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 008C91C7D; Fri, 29 May 2015 07:48:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4T7mUDk081222; Fri, 29 May 2015 07:48:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4T7mU6k081221; Fri, 29 May 2015 07:48:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505290748.t4T7mU6k081221@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 29 May 2015 07:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283690 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 07:48:31 -0000 Author: kib Date: Fri May 29 07:48:30 2015 New Revision: 283690 URL: https://svnweb.freebsd.org/changeset/base/283690 Log: MFC r282948: Use bare mmap(2) to allocate space for the per-thread keys, instead of malloc(). This allows third party mallocs, which use pthread_setspecific(3) on the allocation path, to work. Modified: stable/10/lib/libthr/thread/thr_spec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/10/lib/libthr/thread/thr_spec.c Fri May 29 06:45:32 2015 (r283689) +++ stable/10/lib/libthr/thread/thr_spec.c Fri May 29 07:48:30 2015 (r283690) @@ -30,6 +30,7 @@ */ #include "namespace.h" +#include #include #include #include @@ -40,7 +41,6 @@ #include "thr_private.h" -/* Static variables: */ struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; __weak_reference(_pthread_key_create, pthread_key_create); @@ -50,7 +50,7 @@ __weak_reference(_pthread_setspecific, p int -_pthread_key_create(pthread_key_t *key, void (*destructor) (void *)) +_pthread_key_create(pthread_key_t *key, void (*destructor)(void *)) { struct pthread *curthread; int i; @@ -59,7 +59,6 @@ _pthread_key_create(pthread_key_t *key, curthread = _get_curthread(); - /* Lock the key table: */ THR_LOCK_ACQUIRE(curthread, &_keytable_lock); for (i = 0; i < PTHREAD_KEYS_MAX; i++) { @@ -68,14 +67,12 @@ _pthread_key_create(pthread_key_t *key, _thread_keytable[i].destructor = destructor; _thread_keytable[i].seqno++; - /* Unlock the key table: */ THR_LOCK_RELEASE(curthread, &_keytable_lock); *key = i + 1; return (0); } } - /* Unlock the key table: */ THR_LOCK_RELEASE(curthread, &_keytable_lock); return (EAGAIN); } @@ -83,44 +80,40 @@ _pthread_key_create(pthread_key_t *key, int _pthread_key_delete(pthread_key_t userkey) { - struct pthread *curthread = _get_curthread(); - int key = userkey - 1; - int ret = 0; - - if ((unsigned int)key < PTHREAD_KEYS_MAX) { - /* Lock the key table: */ - THR_LOCK_ACQUIRE(curthread, &_keytable_lock); - - if (_thread_keytable[key].allocated) - _thread_keytable[key].allocated = 0; - else - ret = EINVAL; - - /* Unlock the key table: */ - THR_LOCK_RELEASE(curthread, &_keytable_lock); - } else + struct pthread *curthread; + int key, ret; + + key = userkey - 1; + if ((unsigned int)key >= PTHREAD_KEYS_MAX) + return (EINVAL); + curthread = _get_curthread(); + THR_LOCK_ACQUIRE(curthread, &_keytable_lock); + if (_thread_keytable[key].allocated) { + _thread_keytable[key].allocated = 0; + ret = 0; + } else { ret = EINVAL; + } + THR_LOCK_RELEASE(curthread, &_keytable_lock); return (ret); } void _thread_cleanupspecific(void) { - struct pthread *curthread = _get_curthread(); - void (*destructor)( void *); - const void *data = NULL; - int key; - int i; + struct pthread *curthread; + void (*destructor)(void *); + const void *data; + int i, key; + curthread = _get_curthread(); if (curthread->specific == NULL) return; - - /* Lock the key table: */ THR_LOCK_ACQUIRE(curthread, &_keytable_lock); - for (i = 0; (i < PTHREAD_DESTRUCTOR_ITERATIONS) && - (curthread->specific_data_count > 0); i++) { - for (key = 0; (key < PTHREAD_KEYS_MAX) && - (curthread->specific_data_count > 0); key++) { + for (i = 0; i < PTHREAD_DESTRUCTOR_ITERATIONS && + curthread->specific_data_count > 0; i++) { + for (key = 0; key < PTHREAD_KEYS_MAX && + curthread->specific_data_count > 0; key++) { destructor = NULL; if (_thread_keytable[key].allocated && @@ -128,31 +121,29 @@ _thread_cleanupspecific(void) if (curthread->specific[key].seqno == _thread_keytable[key].seqno) { data = curthread->specific[key].data; - destructor = _thread_keytable[key].destructor; + destructor = _thread_keytable[key]. + destructor; } curthread->specific[key].data = NULL; curthread->specific_data_count--; - } - else if (curthread->specific[key].data != NULL) { + } else if (curthread->specific[key].data != NULL) { /* - * This can happen if the key is deleted via - * pthread_key_delete without first setting the value - * to NULL in all threads. POSIX says that the - * destructor is not invoked in this case. + * This can happen if the key is + * deleted via pthread_key_delete + * without first setting the value to + * NULL in all threads. POSIX says + * that the destructor is not invoked + * in this case. */ curthread->specific[key].data = NULL; curthread->specific_data_count--; } /* - * If there is a destructor, call it - * with the key table entry unlocked: + * If there is a destructor, call it with the + * key table entry unlocked. */ if (destructor != NULL) { - /* - * Don't hold the lock while calling the - * destructor: - */ THR_LOCK_RELEASE(curthread, &_keytable_lock); destructor(__DECONST(void *, data)); THR_LOCK_ACQUIRE(curthread, &_keytable_lock); @@ -160,102 +151,92 @@ _thread_cleanupspecific(void) } } THR_LOCK_RELEASE(curthread, &_keytable_lock); - free(curthread->specific); + munmap(curthread->specific, PTHREAD_KEYS_MAX * sizeof(struct + pthread_specific_elem)); curthread->specific = NULL; - if (curthread->specific_data_count > 0) + if (curthread->specific_data_count > 0) { stderr_debug("Thread %p has exited with leftover " "thread-specific data after %d destructor iterations\n", curthread, PTHREAD_DESTRUCTOR_ITERATIONS); -} - -static inline struct pthread_specific_elem * -pthread_key_allocate_data(void) -{ - struct pthread_specific_elem *new_data; - - new_data = (struct pthread_specific_elem *) - calloc(1, sizeof(struct pthread_specific_elem) * PTHREAD_KEYS_MAX); - return (new_data); + } } int _pthread_setspecific(pthread_key_t userkey, const void *value) { - struct pthread *pthread; - pthread_key_t key = userkey - 1; - int ret = 0; + struct pthread *pthread; + void *tmp; + pthread_key_t key; + + key = userkey - 1; + if ((unsigned int)key >= PTHREAD_KEYS_MAX || + !_thread_keytable[key].allocated) + return (EINVAL); - /* Point to the running thread: */ pthread = _get_curthread(); - - if ((pthread->specific) || - (pthread->specific = pthread_key_allocate_data())) { - if ((unsigned int)key < PTHREAD_KEYS_MAX) { - if (_thread_keytable[key].allocated) { - if (pthread->specific[key].data == NULL) { - if (value != NULL) - pthread->specific_data_count++; - } else if (value == NULL) - pthread->specific_data_count--; - pthread->specific[key].data = value; - pthread->specific[key].seqno = - _thread_keytable[key].seqno; - ret = 0; - } else - ret = EINVAL; - } else - ret = EINVAL; - } else - ret = ENOMEM; - return (ret); + if (pthread->specific == NULL) { + tmp = mmap(NULL, PTHREAD_KEYS_MAX * + sizeof(struct pthread_specific_elem), + PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); + if (tmp == MAP_FAILED) + return (ENOMEM); + pthread->specific = tmp; + } + if (pthread->specific[key].data == NULL) { + if (value != NULL) + pthread->specific_data_count++; + } else if (value == NULL) + pthread->specific_data_count--; + pthread->specific[key].data = value; + pthread->specific[key].seqno = _thread_keytable[key].seqno; + return (0); } void * _pthread_getspecific(pthread_key_t userkey) { - struct pthread *pthread; - pthread_key_t key = userkey - 1; - const void *data; + struct pthread *pthread; + const void *data; + pthread_key_t key; + + /* Check if there is specific data. */ + key = userkey - 1; + if ((unsigned int)key >= PTHREAD_KEYS_MAX) + return (NULL); - /* Point to the running thread: */ pthread = _get_curthread(); - - /* Check if there is specific data: */ - if (pthread->specific != NULL && (unsigned int)key < PTHREAD_KEYS_MAX) { - /* Check if this key has been used before: */ - if (_thread_keytable[key].allocated && - (pthread->specific[key].seqno == _thread_keytable[key].seqno)) { - /* Return the value: */ - data = pthread->specific[key].data; - } else { - /* - * This key has not been used before, so return NULL - * instead: - */ - data = NULL; - } - } else - /* No specific data has been created, so just return NULL: */ + /* Check if this key has been used before. */ + if (_thread_keytable[key].allocated && pthread->specific != NULL && + pthread->specific[key].seqno == _thread_keytable[key].seqno) { + /* Return the value: */ + data = pthread->specific[key].data; + } else { + /* + * This key has not been used before, so return NULL + * instead. + */ data = NULL; + } return (__DECONST(void *, data)); } void _thr_tsd_unload(struct dl_phdr_info *phdr_info) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; void (*destructor)(void *); int key; + curthread = _get_curthread(); THR_LOCK_ACQUIRE(curthread, &_keytable_lock); for (key = 0; key < PTHREAD_KEYS_MAX; key++) { - if (_thread_keytable[key].allocated) { - destructor = _thread_keytable[key].destructor; - if (destructor != NULL) { - if (__elf_phdr_match_addr(phdr_info, destructor)) - _thread_keytable[key].destructor = NULL; - } - } + if (!_thread_keytable[key].allocated) + continue; + destructor = _thread_keytable[key].destructor; + if (destructor == NULL) + continue; + if (__elf_phdr_match_addr(phdr_info, destructor)) + _thread_keytable[key].destructor = NULL; } THR_LOCK_RELEASE(curthread, &_keytable_lock); } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:01:46 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1959502; Fri, 29 May 2015 11:01:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFC2D1ADE; Fri, 29 May 2015 11:01:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TB1kVs078739; Fri, 29 May 2015 11:01:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TB1kT2078738; Fri, 29 May 2015 11:01:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291101.t4TB1kT2078738@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283697 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:01:46 -0000 Author: tuexen Date: Fri May 29 11:01:46 2015 New Revision: 283697 URL: https://svnweb.freebsd.org/changeset/base/283697 Log: MFC r273634: Fix a use of an uninitialized variable by makeing sure that sctp_med_chunk_output() always initialized the reason_code instead of relying on the caller. The variable is only used for debugging purpose. This issue was reported by Peter Bostroem from Google. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Fri May 29 10:24:16 2015 (r283696) +++ stable/10/sys/netinet/sctp_output.c Fri May 29 11:01:46 2015 (r283697) @@ -6734,7 +6734,7 @@ sctp_sendall_iterator(struct sctp_inpcb if (do_chunk_output) sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_USR_SEND, SCTP_SO_NOT_LOCKED); else if (added_control) { - int num_out = 0, reason = 0, now_filled = 0; + int num_out, reason, now_filled = 0; struct timeval now; int frag_point; @@ -7800,6 +7800,7 @@ sctp_med_chunk_output(struct sctp_inpcb int quit_now = 0; *num_out = 0; + *reason_code = 0; auth_keyid = stcb->asoc.authinfo.active_keyid; if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || (asoc->state & SCTP_STATE_SHUTDOWN_RECEIVED) || @@ -9931,7 +9932,7 @@ sctp_chunk_output(struct sctp_inpcb *inp */ struct sctp_association *asoc; struct sctp_nets *net; - int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0; + int error = 0, num_out, tot_out = 0, ret = 0, reason_code; unsigned int burst_cnt = 0; struct timeval now; int now_filled = 0; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:04:56 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E85CCADE; Fri, 29 May 2015 11:04:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCFF61B4A; Fri, 29 May 2015 11:04:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TB4u0Q080243; Fri, 29 May 2015 11:04:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TB4uCD080242; Fri, 29 May 2015 11:04:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291104.t4TB4uCD080242@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283698 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:04:57 -0000 Author: tuexen Date: Fri May 29 11:04:55 2015 New Revision: 283698 URL: https://svnweb.freebsd.org/changeset/base/283698 Log: MFC r273925: Don't zero the stats before they are read out. Modified: stable/10/sys/netinet/sctp_sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/10/sys/netinet/sctp_sysctl.c Fri May 29 11:01:46 2015 (r283697) +++ stable/10/sys/netinet/sctp_sysctl.c Fri May 29 11:04:55 2015 (r283698) @@ -636,26 +636,27 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ int error; #if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - struct sctpstat sb_temp; struct sctpstat *sarry; struct sctpstat sb; int cpu; + #endif + struct sctpstat sb_temp; if ((req->newptr != NULL) && (req->newlen != sizeof(struct sctpstat))) { return (EINVAL); } - -#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - memset(&sb, 0, sizeof(sb)); - memset(&sb_temp, 0, sizeof(sb_temp)); + memset(&sb_temp, 0, sizeof(struct sctpstat)); if (req->newptr != NULL) { - error = SYSCTL_IN(req, &sb_temp, sizeof(sb_temp)); - if (error != 0) + error = SYSCTL_IN(req, &sb_temp, sizeof(struct sctpstat)); + if (error != 0) { return (error); + } } +#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + memset(&sb, 0, sizeof(sb)); for (cpu = 0; cpu < mp_maxid; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { @@ -783,15 +784,19 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; - if (req->newptr != NULL) + if (req->newptr != NULL) { memcpy(sarry, &sb_temp, sizeof(struct sctpstat)); + } } error = SYSCTL_OUT(req, &sb, sizeof(struct sctpstat)); #else - error = SYSCTL_IN(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); - if (error) - return (error); error = SYSCTL_OUT(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); + if (error != 0) { + return (error); + } + if (req->newptr != NULL) { + memcpy(&SCTP_BASE_STATS, &sb_temp, sizeof(struct sctpstat)); + } #endif return (error); } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:15:02 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 098BD5E9; Fri, 29 May 2015 11:15:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB67C1DC5; Fri, 29 May 2015 11:15:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBF1dY086497; Fri, 29 May 2015 11:15:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBF1Yh086492; Fri, 29 May 2015 11:15:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291115.t4TBF1Yh086492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:15: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: r283699 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:15:02 -0000 Author: tuexen Date: Fri May 29 11:15:00 2015 New Revision: 283699 URL: https://svnweb.freebsd.org/changeset/base/283699 Log: MFC r275567: Fix the support of mapped IPv4 addresses. Thanks to Mark Bonnekessel and Markus Boese for making me aware of the problems. Modified: stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 11:04:55 2015 (r283698) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 11:15:00 2015 (r283699) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef INET6 +#include #endif #include #include @@ -1373,10 +1374,14 @@ sctp_count_max_addresses_vrf(struct sctp switch (sctp_ifa->address.sa.sa_family) { #ifdef INET case AF_INET: +#ifdef INET6 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) cnt += sizeof(struct sockaddr_in6); else cnt += sizeof(struct sockaddr_in); +#else + cnt += sizeof(struct sockaddr_in); +#endif break; #endif #ifdef INET6 @@ -1396,10 +1401,14 @@ sctp_count_max_addresses_vrf(struct sctp switch (laddr->ifa->address.sa.sa_family) { #ifdef INET case AF_INET: +#ifdef INET6 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) cnt += sizeof(struct sockaddr_in6); else cnt += sizeof(struct sockaddr_in); +#else + cnt += sizeof(struct sockaddr_in); +#endif break; #endif #ifdef INET6 @@ -2217,23 +2226,27 @@ flags_out: size = 0; /* Count the sizes */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { - size += sizeof(struct sockaddr_in6); - } else { - switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) { + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: + case AF_INET: +#ifdef INET6 + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + size += sizeof(struct sockaddr_in6); + } else { size += sizeof(struct sockaddr_in); - break; + } +#else + size += sizeof(struct sockaddr_in); +#endif + break; #endif #ifdef INET6 - case AF_INET6: - size += sizeof(struct sockaddr_in6); - break; + case AF_INET6: + size += sizeof(struct sockaddr_in6); + break; #endif - default: - break; - } + default: + break; } } SCTP_TCB_UNLOCK(stcb); @@ -2265,24 +2278,28 @@ flags_out: sas = (struct sockaddr_storage *)&saddr->addr[0]; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { - cpsz = sizeof(struct sockaddr_in6); - } else { - switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) { + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: + case AF_INET: +#ifdef INET6 + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + cpsz = sizeof(struct sockaddr_in6); + } else { cpsz = sizeof(struct sockaddr_in); - break; + } +#else + cpsz = sizeof(struct sockaddr_in); +#endif + break; #endif #ifdef INET6 - case AF_INET6: - cpsz = sizeof(struct sockaddr_in6); - break; + case AF_INET6: + cpsz = sizeof(struct sockaddr_in6); + break; #endif - default: - cpsz = 0; - break; - } + default: + cpsz = 0; + break; } if (cpsz == 0) { break; @@ -2293,15 +2310,15 @@ flags_out: } #if defined(INET) && defined(INET6) if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) && - (((struct sockaddr *)&net->ro._l_addr)->sa_family == AF_INET)) { + (net->ro._l_addr.sa.sa_family == AF_INET)) { /* Must map the address */ - in6_sin_2_v4mapsin6((struct sockaddr_in *)&net->ro._l_addr, + in6_sin_2_v4mapsin6(&net->ro._l_addr.sin, (struct sockaddr_in6 *)sas); } else { -#endif memcpy(sas, &net->ro._l_addr, cpsz); -#if defined(INET) && defined(INET6) } +#else + memcpy(sas, &net->ro._l_addr, cpsz); #endif ((struct sockaddr_in *)sas)->sin_port = stcb->rport; @@ -2338,13 +2355,35 @@ flags_out: { struct sctp_paddrparams *paddrp; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(paddrp, optval, struct sctp_paddrparams, *optsize); SCTP_FIND_STCB(inp, stcb, paddrp->spp_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&paddrp->spp_address); +#if defined(INET) && defined(INET6) + if (paddrp->spp_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&paddrp->spp_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&paddrp->spp_address; + } + } else { + addr = (struct sockaddr *)&paddrp->spp_address; + } +#else + addr = (struct sockaddr *)&paddrp->spp_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -2353,22 +2392,20 @@ flags_out: * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&paddrp->spp_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&paddrp->spp_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); @@ -2377,10 +2414,10 @@ flags_out: } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); @@ -2396,10 +2433,10 @@ flags_out: break; } } - if (stcb) { + if (stcb != NULL) { /* Applies to the specific association */ paddrp->spp_flags = 0; - if (net) { + if (net != NULL) { int ovh; if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { @@ -2515,13 +2552,35 @@ flags_out: { struct sctp_paddrinfo *paddri; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(paddri, optval, struct sctp_paddrinfo, *optsize); SCTP_FIND_STCB(inp, stcb, paddri->spinfo_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&paddri->spinfo_address); +#if defined(INET) && defined(INET6) + if (paddri->spinfo_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&paddri->spinfo_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&paddri->spinfo_address; + } + } else { + addr = (struct sockaddr *)&paddri->spinfo_address; + } +#else + addr = (struct sockaddr *)&paddri->spinfo_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -2530,14 +2589,15 @@ flags_out: * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&paddri->spinfo_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if ((stcb) && (net)) { + if ((stcb != NULL) && (net != NULL)) { if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { /* It's unconfirmed */ paddri->spinfo_state = SCTP_UNCONFIRMED; @@ -2556,7 +2616,7 @@ flags_out: SCTP_TCB_UNLOCK(stcb); *optsize = sizeof(struct sctp_paddrinfo); } else { - if (stcb) { + if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT); @@ -2773,16 +2833,32 @@ flags_out: SCTP_FIND_STCB(inp, stcb, ssp->ssp_assoc_id); if (stcb) { - /* simply copy out the sockaddr_storage... */ - size_t len; + union sctp_sockstore *addr; - len = *optsize; - if (len > stcb->asoc.primary_destination->ro._l_addr.sa.sa_len) - len = stcb->asoc.primary_destination->ro._l_addr.sa.sa_len; - - memcpy(&ssp->ssp_addr, - &stcb->asoc.primary_destination->ro._l_addr, - len); + addr = &stcb->asoc.primary_destination->ro._l_addr; + switch (addr->sa.sa_family) { +#ifdef INET + case AF_INET: +#ifdef INET6 + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + in6_sin_2_v4mapsin6(&addr->sin, + (struct sockaddr_in6 *)&ssp->ssp_addr); + } else { + memcpy(&ssp->ssp_addr, &addr->sin, sizeof(struct sockaddr_in)); + } +#else + memcpy(&ssp->ssp_addr, &addr->sin, sizeof(struct sockaddr_in)); +#endif + break; +#endif +#ifdef INET6 + case AF_INET6: + memcpy(&ssp->ssp_addr, &addr->sin6, sizeof(struct sockaddr_in6)); + break; +#endif + default: + break; + } SCTP_TCB_UNLOCK(stcb); *optsize = sizeof(struct sctp_setprim); } else { @@ -3122,13 +3198,35 @@ flags_out: { struct sctp_paddrthlds *thlds; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(thlds, optval, struct sctp_paddrthlds, *optsize); SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_address); +#if defined(INET) && defined(INET6) + if (thlds->spt_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&thlds->spt_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&thlds->spt_address; + } + } else { + addr = (struct sockaddr *)&thlds->spt_address; + } +#else + addr = (struct sockaddr *)&thlds->spt_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -3137,22 +3235,20 @@ flags_out: * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&thlds->spt_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&thlds->spt_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); @@ -3161,10 +3257,10 @@ flags_out: } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); @@ -3180,8 +3276,8 @@ flags_out: break; } } - if (stcb) { - if (net) { + if (stcb != NULL) { + if (net != NULL) { thlds->spt_pathmaxrxt = net->failure_threshold; thlds->spt_pathpfthld = net->pf_threshold; } else { @@ -3213,12 +3309,35 @@ flags_out: { struct sctp_udpencaps *encaps; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, *optsize); SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); +#if defined(INET) && defined(INET6) + if (encaps->sue_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&encaps->sue_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&encaps->sue_address; + } + } else { + addr = (struct sockaddr *)&encaps->sue_address; + } +#else + addr = (struct sockaddr *)&encaps->sue_address; +#endif if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -3229,21 +3348,18 @@ flags_out: */ net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&encaps->sue_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); @@ -3252,10 +3368,10 @@ flags_out: } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); @@ -3271,7 +3387,7 @@ flags_out: break; } } - if (stcb) { + if (stcb != NULL) { if (net) { encaps->sue_port = net->port; } else { @@ -4950,12 +5066,35 @@ sctp_setopt(struct socket *so, int optna { struct sctp_paddrparams *paddrp; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(paddrp, optval, struct sctp_paddrparams, optsize); SCTP_FIND_STCB(inp, stcb, paddrp->spp_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&paddrp->spp_address); + +#if defined(INET) && defined(INET6) + if (paddrp->spp_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&paddrp->spp_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&paddrp->spp_address; + } + } else { + addr = (struct sockaddr *)&paddrp->spp_address; + } +#else + addr = (struct sockaddr *)&paddrp->spp_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -4964,25 +5103,22 @@ sctp_setopt(struct socket *so, int optna * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, - (struct sockaddr *)&paddrp->spp_address, + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&paddrp->spp_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); error = EINVAL; @@ -4991,10 +5127,10 @@ sctp_setopt(struct socket *so, int optna } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); @@ -5023,7 +5159,7 @@ sctp_setopt(struct socket *so, int optna SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } - if (stcb) { + if (stcb != NULL) { /************************TCB SPECIFIC SET ******************/ /* * do we change the timer for HB, we run @@ -5038,7 +5174,7 @@ sctp_setopt(struct socket *so, int optna } /* network sets ? */ - if (net) { + if (net != NULL) { /************************NET SPECIFIC SET ******************/ if (paddrp->spp_flags & SPP_HB_DISABLE) { if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED) && @@ -5123,7 +5259,7 @@ sctp_setopt(struct socket *so, int optna #endif } else { /************************ASSOC ONLY -- NO NET SPECIFIC SET ******************/ - if (paddrp->spp_pathmaxrxt) { + if (paddrp->spp_pathmaxrxt != 0) { stcb->asoc.def_net_failure = paddrp->spp_pathmaxrxt; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net->dest_state & SCTP_ADDR_PF) { @@ -5154,14 +5290,14 @@ sctp_setopt(struct socket *so, int optna } } if (paddrp->spp_flags & SPP_HB_ENABLE) { - if (paddrp->spp_hbinterval) { + if (paddrp->spp_hbinterval != 0) { stcb->asoc.heart_beat_delay = paddrp->spp_hbinterval; } else if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO) { stcb->asoc.heart_beat_delay = 0; } /* Turn back on the timer */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (paddrp->spp_hbinterval) { + if (paddrp->spp_hbinterval != 0) { net->heart_beat_delay = paddrp->spp_hbinterval; } else if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO) { net->heart_beat_delay = 0; @@ -5242,12 +5378,12 @@ sctp_setopt(struct socket *so, int optna * set it with the options on the * socket */ - if (paddrp->spp_pathmaxrxt) { + if (paddrp->spp_pathmaxrxt != 0) { inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt; } if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO) inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = 0; - else if (paddrp->spp_hbinterval) { + else if (paddrp->spp_hbinterval != 0) { if (paddrp->spp_hbinterval > SCTP_MAX_HB_INTERVAL) paddrp->spp_hbinterval = SCTP_MAX_HB_INTERVAL; inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(paddrp->spp_hbinterval); @@ -5413,13 +5549,35 @@ sctp_setopt(struct socket *so, int optna { struct sctp_setprim *spa; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(spa, optval, struct sctp_setprim, optsize); SCTP_FIND_STCB(inp, stcb, spa->ssp_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&spa->ssp_addr); +#if defined(INET) && defined(INET6) + if (spa->ssp_addr.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&spa->ssp_addr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&spa->ssp_addr; + } + } else { + addr = (struct sockaddr *)&spa->ssp_addr; + } +#else + addr = (struct sockaddr *)&spa->ssp_addr; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -5428,16 +5586,16 @@ sctp_setopt(struct socket *so, int optna * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, - (struct sockaddr *)&spa->ssp_addr, + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if ((stcb) && (net)) { + if ((stcb != NULL) && (net != NULL)) { if ((net != stcb->asoc.primary_destination) && (!(net->dest_state & SCTP_ADDR_UNCONFIRMED))) { /* Ok we need to set it */ @@ -5454,7 +5612,7 @@ sctp_setopt(struct socket *so, int optna SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } - if (stcb) { + if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } break; @@ -5476,14 +5634,36 @@ sctp_setopt(struct socket *so, int optna case SCTP_SET_PEER_PRIMARY_ADDR: { struct sctp_setpeerprim *sspp; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(sspp, optval, struct sctp_setpeerprim, optsize); SCTP_FIND_STCB(inp, stcb, sspp->sspp_assoc_id); if (stcb != NULL) { struct sctp_ifa *ifa; - ifa = sctp_find_ifa_by_addr((struct sockaddr *)&sspp->sspp_addr, - stcb->asoc.vrf_id, SCTP_ADDR_NOT_LOCKED); +#if defined(INET) && defined(INET6) + if (sspp->sspp_addr.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&sspp->sspp_addr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&sspp->sspp_addr; + } + } else { + addr = (struct sockaddr *)&sspp->sspp_addr; + } +#else + addr = (struct sockaddr *)&sspp->sspp_addr; +#endif + ifa = sctp_find_ifa_by_addr(addr, stcb->asoc.vrf_id, SCTP_ADDR_NOT_LOCKED); if (ifa == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; @@ -5514,13 +5694,13 @@ sctp_setopt(struct socket *so, int optna goto out_of_it; } } else { - switch (sspp->sspp_addr.ss_family) { + switch (addr->sa_family) { #ifdef INET case AF_INET: { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&sspp->sspp_addr; + sin = (struct sockaddr_in *)addr; if (prison_check_ip4(inp->ip_inp.inp.inp_cred, &sin->sin_addr) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -5535,7 +5715,7 @@ sctp_setopt(struct socket *so, int optna { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&sspp->sspp_addr; + sin6 = (struct sockaddr_in6 *)addr; if (prison_check_ip6(inp->ip_inp.inp.inp_cred, &sin6->sin6_addr) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -5551,8 +5731,7 @@ sctp_setopt(struct socket *so, int optna goto out_of_it; } } - if (sctp_set_primary_ip_address_sa(stcb, - (struct sockaddr *)&sspp->sspp_addr) != 0) { + if (sctp_set_primary_ip_address_sa(stcb, addr) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } @@ -5903,12 +6082,35 @@ sctp_setopt(struct socket *so, int optna { struct sctp_paddrthlds *thlds; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(thlds, optval, struct sctp_paddrthlds, optsize); SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_address); + +#if defined(INET) && defined(INET6) + if (thlds->spt_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&thlds->spt_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&thlds->spt_address; + } + } else { + addr = (struct sockaddr *)&thlds->spt_address; + } +#else + addr = (struct sockaddr *)&thlds->spt_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -5917,25 +6119,22 @@ sctp_setopt(struct socket *so, int optna * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, - (struct sockaddr *)&thlds->spt_address, + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&thlds->spt_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); error = EINVAL; @@ -5944,10 +6143,10 @@ sctp_setopt(struct socket *so, int optna } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); @@ -5963,8 +6162,8 @@ sctp_setopt(struct socket *so, int optna break; } } - if (stcb) { - if (net) { + if (stcb != NULL) { + if (net != NULL) { if (net->dest_state & SCTP_ADDR_PF) { if ((net->failure_threshold > thlds->spt_pathmaxrxt) || (net->failure_threshold <= thlds->spt_pathpfthld)) { @@ -6044,11 +6243,35 @@ sctp_setopt(struct socket *so, int optna { struct sctp_udpencaps *encaps; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, optsize); SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + +#if defined(INET) && defined(INET6) + if (encaps->sue_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&encaps->sue_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&encaps->sue_address; + } + } else { + addr = (struct sockaddr *)&encaps->sue_address; + } +#else + addr = (struct sockaddr *)&encaps->sue_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -6059,22 +6282,19 @@ sctp_setopt(struct socket *so, int optna */ net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&encaps->sue_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); error = EINVAL; @@ -6083,10 +6303,10 @@ sctp_setopt(struct socket *so, int optna } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); @@ -6102,8 +6322,8 @@ sctp_setopt(struct socket *so, int optna break; } } - if (stcb) { - if (net) { + if (stcb != NULL) { + if (net != NULL) { net->port = encaps->sue_port; } else { stcb->asoc.port = encaps->sue_port; Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Fri May 29 11:04:55 2015 (r283698) +++ stable/10/sys/netinet/sctputil.c Fri May 29 11:15:00 2015 (r283699) @@ -2760,7 +2760,16 @@ sctp_notify_peer_addr_change(struct sctp switch (sa->sa_family) { #ifdef INET case AF_INET: +#ifdef INET6 + if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:18:07 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66D3E28B; Fri, 29 May 2015 11:18:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54A431E2A; Fri, 29 May 2015 11:18:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBI7jS090501; Fri, 29 May 2015 11:18:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBI7Vj090499; Fri, 29 May 2015 11:18:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291118.t4TBI7Vj090499@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:18: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: r283700 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:18:07 -0000 Author: tuexen Date: Fri May 29 11:18:06 2015 New Revision: 283700 URL: https://svnweb.freebsd.org/changeset/base/283700 Log: MFC r275574: Include the received chunk padding when reporting an unknown chunk. Modified: stable/10/sys/netinet/sctp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Fri May 29 11:15:00 2015 (r283699) +++ stable/10/sys/netinet/sctp_input.c Fri May 29 11:18:06 2015 (r283700) @@ -5503,10 +5503,12 @@ process_control_chunks: if ((ch->chunk_type & 0x40) && (stcb != NULL)) { struct mbuf *mm; struct sctp_paramhdr *phd; + int len; mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); if (mm) { + len = min(SCTP_SIZE32(chk_length), (uint32_t) (length - *offset)); phd = mtod(mm, struct sctp_paramhdr *); /* * We cheat and use param type since @@ -5516,11 +5518,11 @@ process_control_chunks: * names. */ phd->param_type = htons(SCTP_CAUSE_UNRECOG_CHUNK); - phd->param_length = htons(chk_length + sizeof(*phd)); + phd->param_length = htons(len + sizeof(*phd)); SCTP_BUF_LEN(mm) = sizeof(*phd); - SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT); + SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, len, M_NOWAIT); if (SCTP_BUF_NEXT(mm)) { - if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(mm), SCTP_SIZE32(chk_length) - chk_length, NULL) == NULL) { + if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(mm), SCTP_SIZE32(len) - len, NULL) == NULL) { sctp_m_freem(mm); } else { #ifdef SCTP_MBUF_LOGGING From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:19:30 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E15079E4; Fri, 29 May 2015 11:19:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF64D1E41; Fri, 29 May 2015 11:19:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBJUlN091561; Fri, 29 May 2015 11:19:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBJUnW091560; Fri, 29 May 2015 11:19:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291119.t4TBJUnW091560@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283701 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:19:31 -0000 Author: tuexen Date: Fri May 29 11:19:30 2015 New Revision: 283701 URL: https://svnweb.freebsd.org/changeset/base/283701 Log: MFC r275682: Fix a typo reported by Lennart Grahl. Modified: stable/10/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/10/lib/libc/net/sctp_sys_calls.c Fri May 29 11:18:06 2015 (r283700) +++ stable/10/lib/libc/net/sctp_sys_calls.c Fri May 29 11:19:30 2015 (r283701) @@ -886,7 +886,7 @@ sctp_recvv(int sd, struct sctp_rcvinfo *rcvinfo; struct sctp_nxtinfo *nxtinfo; - if (((info != NULL) && (infolen == NULL)) | + if (((info != NULL) && (infolen == NULL)) || ((info == NULL) && (infolen != NULL) && (*infolen != 0)) || ((info != NULL) && (infotype == NULL))) { errno = EINVAL; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:21:35 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D08BB34; Fri, 29 May 2015 11:21:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D55DB1FDE; Fri, 29 May 2015 11:21:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBLYDO095065; Fri, 29 May 2015 11:21:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBLYYH095064; Fri, 29 May 2015 11:21:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291121.t4TBLYYH095064@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:21: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: r283702 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:21:35 -0000 Author: tuexen Date: Fri May 29 11:21:34 2015 New Revision: 283702 URL: https://svnweb.freebsd.org/changeset/base/283702 Log: MFC r275857: Initilize the msg_flags field consistently in all code paths. Reported by: Coverity CID: 1018726 Modified: stable/10/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/10/lib/libc/net/sctp_sys_calls.c Fri May 29 11:19:30 2015 (r283701) +++ stable/10/lib/libc/net/sctp_sys_calls.c Fri May 29 11:21:34 2015 (r283702) @@ -597,6 +597,7 @@ sctp_sendmsg(int s, msg.msg_iovlen = 1; msg.msg_control = cmsgbuf; msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + msg.msg_flags = 0; cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; @@ -663,6 +664,7 @@ sctp_send(int sd, const void *data, size msg.msg_iovlen = 1; msg.msg_control = cmsgbuf; msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + msg.msg_flags = 0; cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; @@ -820,7 +822,6 @@ sctp_recvmsg(int s, errno = EINVAL; return (-1); } - msg.msg_flags = 0; iov.iov_base = dbuf; iov.iov_len = len; msg.msg_name = (caddr_t)from; @@ -832,6 +833,7 @@ sctp_recvmsg(int s, msg.msg_iovlen = 1; msg.msg_control = cmsgbuf; msg.msg_controllen = sizeof(cmsgbuf); + msg.msg_flags = 0; sz = recvmsg(s, &msg, *msg_flags); *msg_flags = msg.msg_flags; if (sz <= 0) { @@ -905,6 +907,7 @@ sctp_recvv(int sd, msg.msg_iovlen = iovlen; msg.msg_control = cmsgbuf; msg.msg_controllen = sizeof(cmsgbuf); + msg.msg_flags = 0; ret = recvmsg(sd, &msg, *flags); *flags = msg.msg_flags; if ((ret > 0) && From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:25:39 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B0D6CBB; Fri, 29 May 2015 11:25:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 398B9106D; Fri, 29 May 2015 11:25:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBPdGj096206; Fri, 29 May 2015 11:25:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBPdcW096205; Fri, 29 May 2015 11:25:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291125.t4TBPdcW096205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283703 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:25:39 -0000 Author: tuexen Date: Fri May 29 11:25:38 2015 New Revision: 283703 URL: https://svnweb.freebsd.org/changeset/base/283703 Log: MFC r275868: Plug a memory leak in an error code path. Reported by: Coverity CID: 1018936 Modified: stable/10/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/sctp6_usrreq.c Fri May 29 11:21:34 2015 (r283702) +++ stable/10/sys/netinet6/sctp6_usrreq.c Fri May 29 11:25:38 2015 (r283703) @@ -1129,8 +1129,11 @@ sctp6_peeraddr(struct socket *so, struct SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT); return (ENOENT); } - if ((error = sa6_recoverscope(sin6)) != 0) + if ((error = sa6_recoverscope(sin6)) != 0) { + SCTP_FREE_SONAME(sin6); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, error); return (error); + } *addr = (struct sockaddr *)sin6; return (0); } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:40:51 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F4F13CF; Fri, 29 May 2015 11:40:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D808138F; Fri, 29 May 2015 11:40:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBepcj003127; Fri, 29 May 2015 11:40:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBepvT003126; Fri, 29 May 2015 11:40:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291140.t4TBepvT003126@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:40: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: r283704 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:40:51 -0000 Author: tuexen Date: Fri May 29 11:40:50 2015 New Revision: 283704 URL: https://svnweb.freebsd.org/changeset/base/283704 Log: MFC r275869: Add a missing break. Reported by: Coverity CID: 1232014 Modified: stable/10/sys/netinet/sctp_pcb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Fri May 29 11:25:38 2015 (r283703) +++ stable/10/sys/netinet/sctp_pcb.c Fri May 29 11:40:50 2015 (r283704) @@ -6466,6 +6466,7 @@ sctp_load_addresses_from_init(struct sct switch (pr_supported->chunk_types[i]) { case SCTP_ASCONF: peer_supports_asconf = 1; + break; case SCTP_ASCONF_ACK: peer_supports_asconf_ack = 1; break; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:43:52 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D03B534; Fri, 29 May 2015 11:43:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE2761578; Fri, 29 May 2015 11:43:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBhpPC006452; Fri, 29 May 2015 11:43:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBhpHB006451; Fri, 29 May 2015 11:43:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291143.t4TBhpHB006451@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:43: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: r283705 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:43:52 -0000 Author: tuexen Date: Fri May 29 11:43:51 2015 New Revision: 283705 URL: https://svnweb.freebsd.org/changeset/base/283705 Log: MFC r275954: Cleanup the code. Reported by: Coverity CID: 1232003 Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 11:40:50 2015 (r283704) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 11:43:51 2015 (r283705) @@ -3644,12 +3644,6 @@ flags_out: (sid < stcb->asoc.streamoutcnt) && ((policy == SCTP_PR_SCTP_ALL) || (PR_SCTP_VALID_POLICY(policy)))) { -#else - if ((stcb != NULL) && - (policy != SCTP_PR_SCTP_NONE) && - (sid < stcb->asoc.streamoutcnt) && - (policy == SCTP_PR_SCTP_ALL)) { -#endif if (policy == SCTP_PR_SCTP_ALL) { sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; @@ -3657,6 +3651,13 @@ flags_out: sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[policy]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[policy]; } +#else + if ((stcb != NULL) && + (policy == SCTP_PR_SCTP_ALL) && + (sid < stcb->asoc.streamoutcnt)) { + sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; + sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; +#endif SCTP_TCB_UNLOCK(stcb); *optsize = sizeof(struct sctp_prstatus); } else { From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:47:55 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 870D26C0; Fri, 29 May 2015 11:47:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AE8515B2; Fri, 29 May 2015 11:47:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBlt7W007062; Fri, 29 May 2015 11:47:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBltt8007061; Fri, 29 May 2015 11:47:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291147.t4TBltt8007061@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:47:55 +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: r283706 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:47:55 -0000 Author: tuexen Date: Fri May 29 11:47:54 2015 New Revision: 283706 URL: https://svnweb.freebsd.org/changeset/base/283706 Log: MFC r275967: Fix and harmonize the validation of PR-SCTP policies. Reported by: Coverity CID: 1232044 Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 11:43:51 2015 (r283705) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 11:47:54 2015 (r283706) @@ -3640,10 +3640,10 @@ flags_out: policy = sprstat->sprstat_policy; #if defined(SCTP_DETAILED_STR_STATS) if ((stcb != NULL) && - (policy != SCTP_PR_SCTP_NONE) && (sid < stcb->asoc.streamoutcnt) && - ((policy == SCTP_PR_SCTP_ALL) || - (PR_SCTP_VALID_POLICY(policy)))) { + (policy != SCTP_PR_SCTP_NONE) && + ((policy <= SCTP_PR_SCTP_MAX) || + (policy == SCTP_PR_SCTP_ALL))) { if (policy == SCTP_PR_SCTP_ALL) { sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; @@ -3653,8 +3653,8 @@ flags_out: } #else if ((stcb != NULL) && - (policy == SCTP_PR_SCTP_ALL) && - (sid < stcb->asoc.streamoutcnt)) { + (sid < stcb->asoc.streamoutcnt) && + (policy == SCTP_PR_SCTP_ALL)) { sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; #endif @@ -3677,8 +3677,8 @@ flags_out: policy = sprstat->sprstat_policy; if ((stcb != NULL) && (policy != SCTP_PR_SCTP_NONE) && - ((policy == SCTP_PR_SCTP_ALL) || - (PR_SCTP_VALID_POLICY(policy)))) { + ((policy <= SCTP_PR_SCTP_MAX) || + (policy == SCTP_PR_SCTP_ALL))) { if (policy == SCTP_PR_SCTP_ALL) { sprstat->sprstat_abandoned_unsent = stcb->asoc.abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.abandoned_sent[0]; @@ -6042,7 +6042,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, optsize); SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); - if (PR_SCTP_INVALID_POLICY(info->pr_policy)) { + if (info->pr_policy > SCTP_PR_SCTP_MAX) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 11:52:33 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75DCC857; Fri, 29 May 2015 11:52:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49D7A17AD; Fri, 29 May 2015 11:52:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TBqXng011284; Fri, 29 May 2015 11:52:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TBqXgT011283; Fri, 29 May 2015 11:52:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291152.t4TBqXgT011283@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 11:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283707 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 11:52:33 -0000 Author: tuexen Date: Fri May 29 11:52:32 2015 New Revision: 283707 URL: https://svnweb.freebsd.org/changeset/base/283707 Log: MFC r276009: Don't check twice that inp is not NULL. Reported by: Coverity CID: 748671 Modified: stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Fri May 29 11:47:54 2015 (r283706) +++ stable/10/sys/netinet/sctputil.c Fri May 29 11:52:32 2015 (r283707) @@ -1949,7 +1949,7 @@ sctp_timer_start(int t_type, struct sctp * though we use a different timer. We also add the HB timer * PLUS a random jitter. */ - if ((inp == NULL) || (stcb == NULL) || (net == NULL)) { + if ((stcb == NULL) || (net == NULL)) { return; } else { uint32_t rndval; @@ -2004,9 +2004,6 @@ sctp_timer_start(int t_type, struct sctp * nothing needed but the endpoint here ususually about 60 * minutes. */ - if (inp == NULL) { - return; - } tmr = &inp->sctp_ep.signature_change; to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_SIGNATURE]; break; @@ -2023,9 +2020,6 @@ sctp_timer_start(int t_type, struct sctp * timer since that has stopped and we are in the GONE * state. */ - if (inp == NULL) { - return; - } tmr = &inp->sctp_ep.signature_change; to_ticks = MSEC_TO_TICKS(SCTP_INP_KILL_TIMEOUT); break; @@ -2034,10 +2028,7 @@ sctp_timer_start(int t_type, struct sctp * Here we use the value found in the EP for PMTU ususually * about 10 minutes. */ - if ((stcb == NULL) || (inp == NULL)) { - return; - } - if (net == NULL) { + if ((stcb == NULL) || (net == NULL)) { return; } if (net->dest_state & SCTP_ADDR_NO_PMTUD) { @@ -2063,7 +2054,7 @@ sctp_timer_start(int t_type, struct sctp * Here we use the endpoints shutdown guard timer usually * about 3 minutes. */ - if ((inp == NULL) || (stcb == NULL)) { + if (stcb == NULL) { return; } to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN]; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:03:05 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8388BCEB; Fri, 29 May 2015 12:03:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 649421A24; Fri, 29 May 2015 12:03:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TC35tl016547; Fri, 29 May 2015 12:03:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TC33UC016536; Fri, 29 May 2015 12:03:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291203.t4TC33UC016536@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283708 - in stable/10/sys: netinet netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:03:05 -0000 Author: tuexen Date: Fri May 29 12:03:02 2015 New Revision: 283708 URL: https://svnweb.freebsd.org/changeset/base/283708 Log: MFC r276914: Minimize the usage of SCTP_BUF_IS_EXTENDED. This should help Robert... Modified: stable/10/sys/netinet/sctp_bsd_addr.c stable/10/sys/netinet/sctp_indata.c stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctputil.c stable/10/sys/netinet/sctputil.h stable/10/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/10/sys/netinet/sctp_bsd_addr.c Fri May 29 11:52:32 2015 (r283707) +++ stable/10/sys/netinet/sctp_bsd_addr.c Fri May 29 12:03:02 2015 (r283708) @@ -402,9 +402,7 @@ sctp_get_mbuf_for_msg(unsigned int space } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - if (SCTP_BUF_IS_EXTENDED(m)) { - sctp_log_mb(m, SCTP_MBUF_IALLOC); - } + sctp_log_mb(m, SCTP_MBUF_IALLOC); } #endif return (m); Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Fri May 29 11:52:32 2015 (r283707) +++ stable/10/sys/netinet/sctp_indata.c Fri May 29 12:03:02 2015 (r283708) @@ -1493,13 +1493,7 @@ sctp_process_a_data_chunk(struct sctp_tc the_len, M_NOWAIT); #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = dmbuf; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(dmbuf, SCTP_MBUF_ICOPY); } #endif } else { Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Fri May 29 11:52:32 2015 (r283707) +++ stable/10/sys/netinet/sctp_input.c Fri May 29 12:03:02 2015 (r283708) @@ -2443,13 +2443,7 @@ sctp_handle_cookie_echo(struct mbuf *m, } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = m_sig; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_SPLIT); - } - } + sctp_log_mbc(m_sig, SCTP_MBUF_SPLIT); } #endif @@ -5527,13 +5521,7 @@ process_control_chunks: } else { #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = SCTP_BUF_NEXT(mm); mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(SCTP_BUF_NEXT(mm), SCTP_MBUF_ICOPY); } #endif sctp_queue_op_err(stcb, mm); @@ -6038,13 +6026,7 @@ sctp_input_with_port(struct mbuf *i_pak, #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_INPUT); - } - } + sctp_log_mbc(m, SCTP_MBUF_INPUT); } #endif #ifdef SCTP_PACKET_LOGGING Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Fri May 29 11:52:32 2015 (r283707) +++ stable/10/sys/netinet/sctp_output.c Fri May 29 12:03:02 2015 (r283708) @@ -3846,13 +3846,7 @@ sctp_add_cookie(struct mbuf *init, int i } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = copy_init; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(copy_init, SCTP_MBUF_ICOPY); } #endif copy_initack = SCTP_M_COPYM(initack, initack_offset, M_COPYALL, @@ -3864,13 +3858,7 @@ sctp_add_cookie(struct mbuf *init, int i } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = copy_initack; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(copy_initack, SCTP_MBUF_ICOPY); } #endif /* easy side we just drop it on the end */ @@ -6482,13 +6470,7 @@ error_out: appendchain = SCTP_M_COPYM(clonechain, 0, M_COPYALL, M_NOWAIT); #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = appendchain; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(appendchain, SCTP_MBUF_ICOPY); } #endif } @@ -6581,13 +6563,7 @@ sctp_sendall_iterator(struct sctp_inpcb } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(m, SCTP_MBUF_ICOPY); } #endif } else { @@ -7371,13 +7347,7 @@ dont_do_it: } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = chk->data; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(chk->data, SCTP_MBUF_ICOPY); } #endif /* Pull off the data */ @@ -8973,13 +8943,7 @@ sctp_send_cookie_echo(struct mbuf *m, } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = cookie; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(cookie, SCTP_MBUF_ICOPY); } #endif break; @@ -9045,13 +9009,7 @@ sctp_send_heartbeat_ack(struct sctp_tcb } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = outchain; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(outchain, SCTP_MBUF_ICOPY); } #endif chdr = mtod(outchain, struct sctp_chunkhdr *); @@ -9330,13 +9288,7 @@ sctp_send_asconf_ack(struct sctp_tcb *st } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = m_ack; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_ICOPY); - } - } + sctp_log_mbc(m_ack, SCTP_MBUF_ICOPY); } #endif Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Fri May 29 11:52:32 2015 (r283707) +++ stable/10/sys/netinet/sctputil.c Fri May 29 12:03:02 2015 (r283708) @@ -217,6 +217,7 @@ sctp_log_fr(uint32_t biggest_tsn, uint32 sctp_clog.x.misc.log4); } +#ifdef SCTP_MBUF_LOGGING void sctp_log_mb(struct mbuf *m, int from) { @@ -243,6 +244,18 @@ sctp_log_mb(struct mbuf *m, int from) } void +sctp_log_mbc(struct mbuf *m, int from) +{ + struct mbuf *mat; + + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { + sctp_log_mb(mat, from); + } +} + +#endif + +void sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, int from) { struct sctp_cwnd_log sctp_clog; @@ -413,7 +426,8 @@ sctp_log_rwnd_set(uint8_t from, uint32_t sctp_clog.x.misc.log4); } -void +#ifdef SCTP_MBCNT_LOGGING +static void sctp_log_mbcnt(uint8_t from, uint32_t total_oq, uint32_t book, uint32_t total_mbcnt_q, uint32_t mbcnt) { struct sctp_cwnd_log sctp_clog; @@ -431,6 +445,8 @@ sctp_log_mbcnt(uint8_t from, uint32_t to sctp_clog.x.misc.log4); } +#endif + void sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d) { @@ -6157,9 +6173,7 @@ struct mbuf * sctp_m_free(struct mbuf *m) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - if (SCTP_BUF_IS_EXTENDED(m)) { - sctp_log_mb(m, SCTP_MBUF_IFREE); - } + sctp_log_mb(m, SCTP_MBUF_IFREE); } return (m_free(m)); } Modified: stable/10/sys/netinet/sctputil.h ============================================================================== --- stable/10/sys/netinet/sctputil.h Fri May 29 11:52:32 2015 (r283707) +++ stable/10/sys/netinet/sctputil.h Fri May 29 12:03:02 2015 (r283708) @@ -349,10 +349,16 @@ void sctp_log_strm_del_alt(struct sctp_t void sctp_log_nagle_event(struct sctp_tcb *stcb, int action); +#ifdef SCTP_MBUF_LOGGING void sctp_log_mb(struct mbuf *m, int from); void + sctp_log_mbc(struct mbuf *m, int from); + +#endif + +void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr); @@ -369,7 +375,6 @@ void sctp_log_lock(struct sctp_inpcb *in void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *, int, int, uint8_t); void sctp_log_block(uint8_t, struct sctp_association *, int); void sctp_log_rwnd(uint8_t, uint32_t, uint32_t, uint32_t); -void sctp_log_mbcnt(uint8_t, uint32_t, uint32_t, uint32_t, uint32_t); void sctp_log_rwnd_set(uint8_t, uint32_t, uint32_t, uint32_t, uint32_t); int sctp_fill_stat_log(void *, size_t *); void sctp_log_fr(uint32_t, uint32_t, uint32_t, int); Modified: stable/10/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/sctp6_usrreq.c Fri May 29 11:52:32 2015 (r283707) +++ stable/10/sys/netinet6/sctp6_usrreq.c Fri May 29 12:03:02 2015 (r283708) @@ -94,13 +94,7 @@ sctp6_input_with_port(struct mbuf **i_pa #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - struct mbuf *mat; - - for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { - if (SCTP_BUF_IS_EXTENDED(mat)) { - sctp_log_mb(mat, SCTP_MBUF_INPUT); - } - } + sctp_log_mbc(m, SCTP_MBUF_INPUT); } #endif #ifdef SCTP_PACKET_LOGGING From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:06:01 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E813F51; Fri, 29 May 2015 12:06:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CEC31A4E; Fri, 29 May 2015 12:06:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TC61ZO017105; Fri, 29 May 2015 12:06:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TC61A8017104; Fri, 29 May 2015 12:06:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291206.t4TC61A8017104@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:06: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: r283709 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:06:01 -0000 Author: tuexen Date: Fri May 29 12:06:00 2015 New Revision: 283709 URL: https://svnweb.freebsd.org/changeset/base/283709 Log: MFC r277030: Remove dead code. Reported by: Coverity CID: 748666 Modified: stable/10/sys/netinet/sctp_pcb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Fri May 29 12:03:02 2015 (r283708) +++ stable/10/sys/netinet/sctp_pcb.c Fri May 29 12:06:00 2015 (r283709) @@ -2166,11 +2166,6 @@ sctp_findassoc_by_vtag(struct sockaddr * SCTP_INP_INFO_RLOCK(); head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(vtag, SCTP_BASE_INFO(hashasocmark))]; - if (head == NULL) { - /* invalid vtag */ - SCTP_INP_INFO_RUNLOCK(); - return (NULL); - } LIST_FOREACH(stcb, head, sctp_asocs) { SCTP_INP_RLOCK(stcb->sctp_ep); if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { @@ -6755,10 +6750,6 @@ sctp_is_vtag_good(uint32_t tag, uint16_t SCTP_INP_INFO_RLOCK(); head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(tag, SCTP_BASE_INFO(hashasocmark))]; - if (head == NULL) { - /* invalid vtag */ - goto skip_vtag_check; - } LIST_FOREACH(stcb, head, sctp_asocs) { /* * We choose not to lock anything here. TCB's can't be @@ -6782,8 +6773,6 @@ sctp_is_vtag_good(uint32_t tag, uint16_t return (0); } } -skip_vtag_check: - chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; /* Now what about timed wait ? */ LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:08:50 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 976BE287; Fri, 29 May 2015 12:08:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 859141A81; Fri, 29 May 2015 12:08:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TC8o5C017634; Fri, 29 May 2015 12:08:50 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TC8oV4017633; Fri, 29 May 2015 12:08:50 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291208.t4TC8oV4017633@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:08: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: r283710 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:08:50 -0000 Author: tuexen Date: Fri May 29 12:08:49 2015 New Revision: 283710 URL: https://svnweb.freebsd.org/changeset/base/283710 Log: MFC r277031 Remove dead code. Reported by: Coverity CID: 748665 Modified: stable/10/sys/netinet/sctp_pcb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Fri May 29 12:06:00 2015 (r283709) +++ stable/10/sys/netinet/sctp_pcb.c Fri May 29 12:08:49 2015 (r283710) @@ -1441,9 +1441,6 @@ sctp_findassociation_ep_addr(struct sctp } head = &inp->sctp_tcbhash[SCTP_PCBHASH_ALLADDR(rport, inp->sctp_hashmark)]; - if (head == NULL) { - goto null_return; - } LIST_FOREACH(stcb, head, sctp_tcbhash) { if (stcb->rport != rport) { /* remote port does not match */ From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:11:15 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FD563DD; Fri, 29 May 2015 12:11:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7D621C19; Fri, 29 May 2015 12:11:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCBEpm020513; Fri, 29 May 2015 12:11:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCBEPv020512; Fri, 29 May 2015 12:11:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291211.t4TCBEPv020512@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:11: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: r283711 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:11:15 -0000 Author: tuexen Date: Fri May 29 12:11:14 2015 New Revision: 283711 URL: https://svnweb.freebsd.org/changeset/base/283711 Log: MFC r277033: Remove dead code. Reported by: Coverity CID: 748660, 748661 Modified: stable/10/sys/netinet/sctp_asconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_asconf.c ============================================================================== --- stable/10/sys/netinet/sctp_asconf.c Fri May 29 12:08:49 2015 (r283710) +++ stable/10/sys/netinet/sctp_asconf.c Fri May 29 12:11:14 2015 (r283711) @@ -1419,7 +1419,6 @@ sctp_asconf_queue_sa_delete(struct sctp_ { struct sctp_ifa *ifa; struct sctp_asconf_addr *aa, *aa_next; - uint32_t vrf_id; if (stcb == NULL) { return (-1); @@ -1451,12 +1450,7 @@ sctp_asconf_queue_sa_delete(struct sctp_ } /* for each aa */ /* find any existing ifa-- NOTE ifa CAN be allowed to be NULL */ - if (stcb) { - vrf_id = stcb->asoc.vrf_id; - } else { - vrf_id = SCTP_DEFAULT_VRFID; - } - ifa = sctp_find_ifa_by_addr(sa, vrf_id, SCTP_ADDR_NOT_LOCKED); + ifa = sctp_find_ifa_by_addr(sa, stcb->asoc.vrf_id, SCTP_ADDR_NOT_LOCKED); /* adding new request to the queue */ SCTP_MALLOC(aa, struct sctp_asconf_addr *, sizeof(*aa), @@ -2782,7 +2776,6 @@ sctp_process_initack_addresses(struct sc struct sctp_ipv4addr_param addr4_store; #endif - uint32_t vrf_id; SCTPDBG(SCTP_DEBUG_ASCONF2, "processing init-ack addresses\n"); if (stcb == NULL) /* Un-needed check for SA */ @@ -2850,12 +2843,7 @@ sctp_process_initack_addresses(struct sc } /* see if this address really (still) exists */ - if (stcb) { - vrf_id = stcb->asoc.vrf_id; - } else { - vrf_id = SCTP_DEFAULT_VRFID; - } - sctp_ifa = sctp_find_ifa_by_addr(&store.sa, vrf_id, + sctp_ifa = sctp_find_ifa_by_addr(&store.sa, stcb->asoc.vrf_id, SCTP_ADDR_NOT_LOCKED); if (sctp_ifa == NULL) { /* address doesn't exist anymore */ From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:13:52 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAD06704; Fri, 29 May 2015 12:13:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C90F71CC4; Fri, 29 May 2015 12:13:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCDqaW022054; Fri, 29 May 2015 12:13:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCDqqw022053; Fri, 29 May 2015 12:13:52 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291213.t4TCDqqw022053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283712 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:13:53 -0000 Author: tuexen Date: Fri May 29 12:13:52 2015 New Revision: 283712 URL: https://svnweb.freebsd.org/changeset/base/283712 Log: MFC r277034: Remove dead code. Reported by: Coverity CID: 748663 Modified: stable/10/sys/netinet/sctp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Fri May 29 12:11:14 2015 (r283711) +++ stable/10/sys/netinet/sctp_input.c Fri May 29 12:13:52 2015 (r283712) @@ -2595,7 +2595,7 @@ sctp_handle_cookie_echo(struct mbuf *m, /* This should not happen */ return (NULL); } - if ((*stcb == NULL) && to) { + if (*stcb == NULL) { /* Yep, lets check */ *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, dst, NULL); if (*stcb == NULL) { @@ -2634,9 +2634,6 @@ sctp_handle_cookie_echo(struct mbuf *m, } } } - if (to == NULL) { - return (NULL); - } cookie_len -= SCTP_SIGNATURE_SIZE; if (*stcb == NULL) { /* this is the "normal" case... get a new TCB */ From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:17:21 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAB439E8; Fri, 29 May 2015 12:17:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8A311CFB; Fri, 29 May 2015 12:17:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCHLYb022799; Fri, 29 May 2015 12:17:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCHL3D022798; Fri, 29 May 2015 12:17:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291217.t4TCHL3D022798@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:17:21 +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: r283713 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:17:22 -0000 Author: tuexen Date: Fri May 29 12:17:21 2015 New Revision: 283713 URL: https://svnweb.freebsd.org/changeset/base/283713 Log: MFC r277046: Remove dead code. Reported by: Coverity CID: 1018053 Modified: stable/10/sys/netinet/sctp_asconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_asconf.c ============================================================================== --- stable/10/sys/netinet/sctp_asconf.c Fri May 29 12:13:52 2015 (r283712) +++ stable/10/sys/netinet/sctp_asconf.c Fri May 29 12:17:21 2015 (r283713) @@ -596,7 +596,7 @@ sctp_handle_asconf(struct mbuf *m, unsig uint32_t serial_num; struct mbuf *n, *m_ack, *m_result, *m_tail; struct sctp_asconf_ack_chunk *ack_cp; - struct sctp_asconf_paramhdr *aph, *ack_aph; + struct sctp_asconf_paramhdr *aph; struct sctp_ipv6addr_param *p_addr; unsigned int asconf_limit, cnt; int error = 0; /* did an error occur? */ @@ -679,13 +679,6 @@ sctp_handle_asconf(struct mbuf *m, unsig } /* param_length is already validated in process_control... */ offset += ntohs(p_addr->ph.param_length); /* skip lookup addr */ - - /* get pointer to first asconf param in ASCONF-ACK */ - ack_aph = (struct sctp_asconf_paramhdr *)(mtod(m_ack, caddr_t)+sizeof(struct sctp_asconf_ack_chunk)); - if (ack_aph == NULL) { - SCTPDBG(SCTP_DEBUG_ASCONF1, "Gak in asconf2\n"); - return; - } /* get pointer to first asconf param in ASCONF */ aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, sizeof(struct sctp_asconf_paramhdr), (uint8_t *) & aparam_buf); if (aph == NULL) { From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:19:42 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FD9CB38; Fri, 29 May 2015 12:19:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DB3B1D06; Fri, 29 May 2015 12:19:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCJgfV023156; Fri, 29 May 2015 12:19:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCJgRp023155; Fri, 29 May 2015 12:19:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291219.t4TCJgRp023155@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283714 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:19:42 -0000 Author: tuexen Date: Fri May 29 12:19:41 2015 New Revision: 283714 URL: https://svnweb.freebsd.org/changeset/base/283714 Log: MFC r277049: Remove dead code. Reported by: Coverity CID: 1018052 Modified: stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Fri May 29 12:17:21 2015 (r283713) +++ stable/10/sys/netinet/sctputil.c Fri May 29 12:19:41 2015 (r283714) @@ -5047,7 +5047,6 @@ sctp_find_ifa_by_addr(struct sockaddr *a vrf = sctp_find_vrf(vrf_id); if (vrf == NULL) { -stage_right: if (holds_lock == 0) SCTP_IPI_ADDR_RUNLOCK(); return (NULL); @@ -5067,15 +5066,6 @@ stage_right: return (NULL); } LIST_FOREACH(sctp_ifap, hash_head, next_bucket) { - if (sctp_ifap == NULL) { -#ifdef INVARIANTS - panic("Huh LIST_FOREACH corrupt"); - goto stage_right; -#else - SCTP_PRINTF("LIST corrupt of sctp_ifap's?\n"); - goto stage_right; -#endif - } if (addr->sa_family != sctp_ifap->address.sa.sa_family) continue; #ifdef INET From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:22:36 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63884C82; Fri, 29 May 2015 12:22:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 513D41EEB; Fri, 29 May 2015 12:22:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCMa4q027285; Fri, 29 May 2015 12:22:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCMaqZ027284; Fri, 29 May 2015 12:22:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291222.t4TCMaqZ027284@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283715 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:22:36 -0000 Author: tuexen Date: Fri May 29 12:22:35 2015 New Revision: 283715 URL: https://svnweb.freebsd.org/changeset/base/283715 Log: MFC r277053: Remove dead code. Reported by: Coverity CID: 748664 Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Fri May 29 12:19:41 2015 (r283714) +++ stable/10/sys/netinet/sctp_output.c Fri May 29 12:22:35 2015 (r283715) @@ -8917,12 +8917,11 @@ sctp_send_cookie_echo(struct mbuf *m, struct sctp_tmit_chunk *chk; uint16_t ptype, plen; + SCTP_TCB_LOCK_ASSERT(stcb); /* First find the cookie in the param area */ cookie = NULL; at = offset + sizeof(struct sctp_init_chunk); - - SCTP_TCB_LOCK_ASSERT(stcb); - do { + for (;;) { phdr = sctp_get_next_param(m, at, &parm, sizeof(parm)); if (phdr == NULL) { return (-3); @@ -8949,13 +8948,8 @@ sctp_send_cookie_echo(struct mbuf *m, break; } at += SCTP_SIZE32(plen); - } while (phdr); - if (cookie == NULL) { - /* Did not find the cookie */ - return (-3); } /* ok, we got the cookie lets change it into a cookie echo chunk */ - /* first the change from param to cookie */ hdr = mtod(cookie, struct sctp_chunkhdr *); hdr->chunk_type = SCTP_COOKIE_ECHO; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:25:11 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D75AEEEA; Fri, 29 May 2015 12:25:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C53541F0A; Fri, 29 May 2015 12:25:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCPBGl027714; Fri, 29 May 2015 12:25:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCPBwe027713; Fri, 29 May 2015 12:25:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291225.t4TCPBwe027713@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:25: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: r283716 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:25:12 -0000 Author: tuexen Date: Fri May 29 12:25:11 2015 New Revision: 283716 URL: https://svnweb.freebsd.org/changeset/base/283716 Log: MFC r277337: Remove an unused variable. Reported by: Coverity CID: 750999 Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:22:35 2015 (r283715) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:25:11 2015 (r283716) @@ -4724,7 +4724,6 @@ sctp_setopt(struct socket *so, int optna case SCTP_CONNECT_X_COMPLETE: { struct sockaddr *sa; - struct sctp_nets *net; /* FIXME MT: check correct? */ SCTP_CHECK_AND_CAST(sa, optval, struct sockaddr, optsize); @@ -4735,7 +4734,6 @@ sctp_setopt(struct socket *so, int optna stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb) { SCTP_TCB_LOCK(stcb); - net = sctp_findnet(stcb, sa); } SCTP_INP_RUNLOCK(inp); } else { @@ -4747,7 +4745,7 @@ sctp_setopt(struct socket *so, int optna * TCB.. aka NULL. */ SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, sa, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, sa, NULL, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:27:46 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47853B0; Fri, 29 May 2015 12:27:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 358A91F20; Fri, 29 May 2015 12:27:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCRkw3028082; Fri, 29 May 2015 12:27:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCRkcD028081; Fri, 29 May 2015 12:27:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291227.t4TCRkcD028081@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283717 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:27:46 -0000 Author: tuexen Date: Fri May 29 12:27:45 2015 New Revision: 283717 URL: https://svnweb.freebsd.org/changeset/base/283717 Log: MFC r277347: Add protection code to free memory in case of processing an address which is neither IPv4 or IPv6. Reported by: Coverity CID: 749311 Modified: stable/10/sys/netinet/sctp_asconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_asconf.c ============================================================================== --- stable/10/sys/netinet/sctp_asconf.c Fri May 29 12:25:11 2015 (r283716) +++ stable/10/sys/netinet/sctp_asconf.c Fri May 29 12:27:45 2015 (r283717) @@ -3346,6 +3346,11 @@ sctp_asconf_send_nat_state_update(struct TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next); break; #endif + default: + SCTPDBG(SCTP_DEBUG_ASCONF1, + "sctp_asconf_send_nat_state_update: unknown address family\n"); + SCTP_FREE(aa, SCTP_M_ASC_ADDR); + return; } SCTP_MALLOC(aa, struct sctp_asconf_addr *, sizeof(*aa), SCTP_M_ASC_ADDR); @@ -3379,6 +3384,11 @@ sctp_asconf_send_nat_state_update(struct TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next); break; #endif + default: + SCTPDBG(SCTP_DEBUG_ASCONF1, + "sctp_asconf_send_nat_state_update: unknown address family\n"); + SCTP_FREE(aa, SCTP_M_ASC_ADDR); + return; } /* Now we must hunt the addresses and add all global addresses */ if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:30:20 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8430D213; Fri, 29 May 2015 12:30:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 721F8100A; Fri, 29 May 2015 12:30:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCUKc7028555; Fri, 29 May 2015 12:30:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCUKAe028554; Fri, 29 May 2015 12:30:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291230.t4TCUKAe028554@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283718 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:30:20 -0000 Author: tuexen Date: Fri May 29 12:30:19 2015 New Revision: 283718 URL: https://svnweb.freebsd.org/changeset/base/283718 Log: MFC r277348: Remove an unnecessary check. Reported by: Coverity CID: 749576 Modified: stable/10/sys/netinet/sctp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Fri May 29 12:27:45 2015 (r283717) +++ stable/10/sys/netinet/sctp_input.c Fri May 29 12:30:19 2015 (r283718) @@ -3108,7 +3108,6 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun uint32_t cwr_tsn; cwr_tsn = ntohl(cp->tsn); - override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE; TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) { @@ -3124,10 +3123,8 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, sctp_next); - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } + sctp_m_freem(chk->data); + chk->data = NULL; stcb->asoc.ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (override == 0) { From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:33:03 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B05C371; Fri, 29 May 2015 12:33:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18C5C1134; Fri, 29 May 2015 12:33:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCX2vJ032525; Fri, 29 May 2015 12:33:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCX2UP032524; Fri, 29 May 2015 12:33:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291233.t4TCX2UP032524@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:33: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: r283719 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:33:03 -0000 Author: tuexen Date: Fri May 29 12:33:02 2015 New Revision: 283719 URL: https://svnweb.freebsd.org/changeset/base/283719 Log: MFC r277350: Fix a bug which only shows up when an mbuf allocation failed. Therefore chances are low that we hit this. Reported by: Coverity CID: 1018886 Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Fri May 29 12:30:19 2015 (r283718) +++ stable/10/sys/netinet/sctp_output.c Fri May 29 12:33:02 2015 (r283719) @@ -7420,7 +7420,7 @@ dont_do_it: SCTP_TCB_SEND_LOCK(stcb); send_lock_up = 1; } - if (chk->data == NULL) { + if (sp->data == NULL) { /* unsteal the data */ sp->data = chk->data; sp->tail_mbuf = chk->last_mbuf; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:35:21 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D59B54E3; Fri, 29 May 2015 12:35:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2DEE1158; Fri, 29 May 2015 12:35:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCZLei032915; Fri, 29 May 2015 12:35:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCZLZm032914; Fri, 29 May 2015 12:35:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291235.t4TCZLZm032914@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:35:21 +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: r283720 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:35:22 -0000 Author: tuexen Date: Fri May 29 12:35:21 2015 New Revision: 283720 URL: https://svnweb.freebsd.org/changeset/base/283720 Log: MFC r277380: Code cleanup. Reported by: Coverity CID: 749578 Modified: stable/10/sys/netinet/sctp_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_timer.c ============================================================================== --- stable/10/sys/netinet/sctp_timer.c Fri May 29 12:33:02 2015 (r283719) +++ stable/10/sys/netinet/sctp_timer.c Fri May 29 12:35:21 2015 (r283720) @@ -337,7 +337,7 @@ sctp_find_alternate_net(struct sctp_tcb return (NULL); } } - do { + for (;;) { alt = TAILQ_NEXT(mnet, sctp_next); if (alt == NULL) { once++; @@ -356,7 +356,6 @@ sctp_find_alternate_net(struct sctp_tcb } alt->src_addr_selected = 0; } - /* sa_ignore NO_NULL_CHK */ if (((alt->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE) && (alt->ro.ro_rt != NULL) && (!(alt->dest_state & SCTP_ADDR_UNCONFIRMED))) { @@ -364,14 +363,14 @@ sctp_find_alternate_net(struct sctp_tcb break; } mnet = alt; - } while (alt != NULL); + } if (alt == NULL) { /* Case where NO insv network exists (dormant state) */ /* we rotate destinations */ once = 0; mnet = net; - do { + for (;;) { if (mnet == NULL) { return (TAILQ_FIRST(&stcb->asoc.nets)); } @@ -382,15 +381,17 @@ sctp_find_alternate_net(struct sctp_tcb break; } alt = TAILQ_FIRST(&stcb->asoc.nets); + if (alt == NULL) { + break; + } } - /* sa_ignore NO_NULL_CHK */ if ((!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) && (alt != net)) { /* Found an alternate address */ break; } mnet = alt; - } while (alt != NULL); + } } if (alt == NULL) { return (net); From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:45:56 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E803385D; Fri, 29 May 2015 12:45:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC00D13AF; Fri, 29 May 2015 12:45:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCju7i037924; Fri, 29 May 2015 12:45:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCjuOZ037923; Fri, 29 May 2015 12:45:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291245.t4TCjuOZ037923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283721 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:45:57 -0000 Author: tuexen Date: Fri May 29 12:45:55 2015 New Revision: 283721 URL: https://svnweb.freebsd.org/changeset/base/283721 Log: MFC r277424: Remove comparisons which are not necessary. With manual intervention. Reported by: Coverity CID: 1237826, 1237844, 1237847 Modified: stable/10/sys/netinet/sctp_sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/10/sys/netinet/sctp_sysctl.c Fri May 29 12:35:21 2015 (r283720) +++ stable/10/sys/netinet/sctp_sysctl.c Fri May 29 12:45:55 2015 (r283721) @@ -569,8 +569,12 @@ sctp_sysctl_handle_udp_tunneling(SYSCTL_ error = sysctl_handle_int(oidp, &new, 0, req); if ((error == 0) && (req->newptr != NULL)) { +#if (SCTPCTL_UDP_TUNNELING_PORT_MIN == 0) + if (new > SCTPCTL_UDP_TUNNELING_PORT_MAX) { +#else if ((new < SCTPCTL_UDP_TUNNELING_PORT_MIN) || (new > SCTPCTL_UDP_TUNNELING_PORT_MAX)) { +#endif error = EINVAL; } else { SCTP_INP_INFO_WLOCK(); @@ -598,9 +602,14 @@ sctp_sysctl_handle_auth(SYSCTL_HANDLER_A error = sysctl_handle_int(oidp, &new, 0, req); if ((error == 0) && (req->newptr != NULL)) { +#if (SCTPCTL_AUTH_DISABLE_MIN ==0) + if ((new > SCTPCTL_AUTH_DISABLE_MAX) || + ((new == 1) && (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1))) { +#else if ((new < SCTPCTL_AUTH_DISABLE_MIN) || (new > SCTPCTL_AUTH_DISABLE_MAX) || ((new == 1) && (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1))) { +#endif error = EINVAL; } else { SCTP_BASE_SYSCTL(sctp_auth_disable) = new; @@ -619,9 +628,14 @@ sctp_sysctl_handle_asconf(SYSCTL_HANDLER error = sysctl_handle_int(oidp, &new, 0, req); if ((error == 0) && (req->newptr != NULL)) { +#if (SCTPCTL_ASCONF_ENABLE_MIN == 0) + if ((new > SCTPCTL_ASCONF_ENABLE_MAX) || + ((new == 1) && (SCTP_BASE_SYSCTL(sctp_auth_disable) == 1))) { +#else if ((new < SCTPCTL_ASCONF_ENABLE_MIN) || (new > SCTPCTL_ASCONF_ENABLE_MAX) || ((new == 1) && (SCTP_BASE_SYSCTL(sctp_auth_disable) == 1))) { +#endif error = EINVAL; } else { SCTP_BASE_SYSCTL(sctp_asconf_enable) = new; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:48:15 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FD47AA1; Fri, 29 May 2015 12:48:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DDBB13C4; Fri, 29 May 2015 12:48:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCmFgj038305; Fri, 29 May 2015 12:48:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCmFk1038304; Fri, 29 May 2015 12:48:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291248.t4TCmFk1038304@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283722 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:48:15 -0000 Author: tuexen Date: Fri May 29 12:48:14 2015 New Revision: 283722 URL: https://svnweb.freebsd.org/changeset/base/283722 Log: MFC r277815: Whitespace change. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:45:55 2015 (r283721) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:48:14 2015 (r283722) @@ -4054,7 +4054,6 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_UNLOCK(stcb); } SCTP_INP_RUNLOCK(inp); - } else { /* * Can't set stream value without From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:50:53 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB514C0C; Fri, 29 May 2015 12:50:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8F0714B2; Fri, 29 May 2015 12:50:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCorWM041151; Fri, 29 May 2015 12:50:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCorU1041150; Fri, 29 May 2015 12:50:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291250.t4TCorU1041150@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:50: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: r283723 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:50:53 -0000 Author: tuexen Date: Fri May 29 12:50:53 2015 New Revision: 283723 URL: https://svnweb.freebsd.org/changeset/base/283723 Log: MFC r279841: Fix a typo. Modified: stable/10/sys/netinet/sctp_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_timer.c ============================================================================== --- stable/10/sys/netinet/sctp_timer.c Fri May 29 12:48:14 2015 (r283722) +++ stable/10/sys/netinet/sctp_timer.c Fri May 29 12:50:53 2015 (r283723) @@ -152,7 +152,7 @@ sctp_threshold_management(struct sctp_in struct mbuf *op_err; op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, - "Association error couter exceeded"); + "Association error counter exceeded"); inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_1; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (1); From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:54:33 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5404DA0; Fri, 29 May 2015 12:54:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1DD11657; Fri, 29 May 2015 12:54:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCsXmO042851; Fri, 29 May 2015 12:54:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCsVEX042831; Fri, 29 May 2015 12:54:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291254.t4TCsVEX042831@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:54: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: r283724 - in stable/10: lib/libc/net sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:54:33 -0000 Author: tuexen Date: Fri May 29 12:54:30 2015 New Revision: 283724 URL: https://svnweb.freebsd.org/changeset/base/283724 Log: MFC r279859: Add a SCTP socket option to limit the cwnd for each path. Modified: stable/10/lib/libc/net/sctp_sys_calls.c stable/10/sys/netinet/sctp.h stable/10/sys/netinet/sctp_cc_functions.c stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_pcb.h stable/10/sys/netinet/sctp_peeloff.c stable/10/sys/netinet/sctp_structs.h stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/10/lib/libc/net/sctp_sys_calls.c Fri May 29 12:50:53 2015 (r283723) +++ stable/10/lib/libc/net/sctp_sys_calls.c Fri May 29 12:54:30 2015 (r283724) @@ -383,6 +383,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PR_ASSOC_STATUS: ((struct sctp_prstatus *)arg)->sprstat_assoc_id = id; break; + case SCTP_MAX_CWND: + ((struct sctp_assoc_value *)arg)->assoc_id = id; + break; default: break; } Modified: stable/10/sys/netinet/sctp.h ============================================================================== --- stable/10/sys/netinet/sctp.h Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctp.h Fri May 29 12:54:30 2015 (r283724) @@ -128,6 +128,7 @@ struct sctp_paramhdr { #define SCTP_RECONFIG_SUPPORTED 0x00000029 #define SCTP_NRSACK_SUPPORTED 0x00000030 #define SCTP_PKTDROP_SUPPORTED 0x00000031 +#define SCTP_MAX_CWND 0x00000032 /* * read-only options Modified: stable/10/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/10/sys/netinet/sctp_cc_functions.c Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctp_cc_functions.c Fri May 29 12:54:30 2015 (r283724) @@ -53,6 +53,19 @@ __FBSDID("$FreeBSD$"); #define SHIFT_MPTCP_MULTI 8 static void +sctp_enforce_cwnd_limit(struct sctp_association *assoc, struct sctp_nets *net) +{ + if ((assoc->max_cwnd > 0) && + (net->cwnd > assoc->max_cwnd) && + (net->cwnd > (net->mtu - sizeof(struct sctphdr)))) { + net->cwnd = assoc->max_cwnd; + if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { + net->cwnd = net->mtu - sizeof(struct sctphdr); + } + } +} + +static void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *assoc; @@ -80,6 +93,7 @@ sctp_set_initial_cc_param(struct sctp_tc net->cwnd = net->mtu - sizeof(struct sctphdr); } } + sctp_enforce_cwnd_limit(assoc, net); net->ssthresh = assoc->peers_rwnd; SDT_PROBE(sctp, cwnd, net, init, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, @@ -178,6 +192,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } net->cwnd = net->ssthresh; + sctp_enforce_cwnd_limit(asoc, net); SDT_PROBE(sctp, cwnd, net, fr, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, old_cwnd, net->cwnd); @@ -426,6 +441,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net->cc_mod.rtcc.vol_reduce) && (inst_ind != SCTP_INST_GAINING)) { net->cwnd += net->mtu; + sctp_enforce_cwnd_limit(&stcb->asoc, net); net->cc_mod.rtcc.vol_reduce--; } net->cc_mod.rtcc.last_step_state = 2; @@ -457,6 +473,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net->cc_mod.rtcc.vol_reduce) && (inst_ind != SCTP_INST_GAINING)) { net->cwnd += net->mtu; + sctp_enforce_cwnd_limit(&stcb->asoc, net); net->cc_mod.rtcc.vol_reduce--; } net->cc_mod.rtcc.last_step_state = 3; @@ -488,6 +505,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net->cc_mod.rtcc.vol_reduce) && (inst_ind != SCTP_INST_GAINING)) { net->cwnd += net->mtu; + sctp_enforce_cwnd_limit(&stcb->asoc, net); net->cc_mod.rtcc.vol_reduce--; } net->cc_mod.rtcc.last_step_state = 4; @@ -882,6 +900,7 @@ sctp_cwnd_update_after_sack_common(struc break; } net->cwnd += incr; + sctp_enforce_cwnd_limit(asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, incr, SCTP_CWND_LOG_FROM_SS); @@ -948,6 +967,7 @@ sctp_cwnd_update_after_sack_common(struc break; } net->cwnd += incr; + sctp_enforce_cwnd_limit(asoc, net); SDT_PROBE(sctp, cwnd, net, ack, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), @@ -1227,6 +1247,7 @@ sctp_cwnd_update_after_packet_dropped(st /* We always have 1 MTU */ net->cwnd = net->mtu; } + sctp_enforce_cwnd_limit(&stcb->asoc, net); if (net->cwnd - old_cwnd != 0) { /* log only changes */ SDT_PROBE(sctp, cwnd, net, pd, @@ -1251,6 +1272,7 @@ sctp_cwnd_update_after_output(struct sct net->ssthresh = net->cwnd; if (burst_limit) { net->cwnd = (net->flight_size + (burst_limit * net->mtu)); + sctp_enforce_cwnd_limit(&stcb->asoc, net); SDT_PROBE(sctp, cwnd, net, bl, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), @@ -1589,6 +1611,7 @@ static void sctp_hs_cwnd_increase(struct sctp_tcb *stcb, struct sctp_nets *net) { int cur_val, i, indx, incr; + int old_cwnd = net->cwnd; cur_val = net->cwnd >> 10; indx = SCTP_HS_TABLE_SIZE - 1; @@ -1597,14 +1620,8 @@ sctp_hs_cwnd_increase(struct sctp_tcb *s /* normal mode */ if (net->net_ack > net->mtu) { net->cwnd += net->mtu; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_SS); - } } else { net->cwnd += net->net_ack; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->net_ack, SCTP_CWND_LOG_FROM_SS); - } } } else { for (i = net->last_hs_used; i < SCTP_HS_TABLE_SIZE; i++) { @@ -1616,9 +1633,10 @@ sctp_hs_cwnd_increase(struct sctp_tcb *s net->last_hs_used = indx; incr = ((sctp_cwnd_adjust[indx].increase) << 10); net->cwnd += incr; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, incr, SCTP_CWND_LOG_FROM_SS); - } + } + sctp_enforce_cwnd_limit(&stcb->asoc, net); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SS); } } @@ -1657,6 +1675,7 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s net->last_hs_used = indx; } } + sctp_enforce_cwnd_limit(&stcb->asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_FR); } @@ -1788,9 +1807,7 @@ sctp_hs_cwnd_update_after_sack(struct sc if (net->cwnd <= net->ssthresh) { /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { - sctp_hs_cwnd_increase(stcb, net); - } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, @@ -1804,6 +1821,7 @@ sctp_hs_cwnd_update_after_sack(struct sc (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; net->cwnd += net->mtu; + sctp_enforce_cwnd_limit(asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_CA); @@ -2042,6 +2060,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s SCTP_CWND_LOG_FROM_SS); } } + sctp_enforce_cwnd_limit(&stcb->asoc, net); } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, @@ -2063,6 +2082,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s */ net->cwnd += net->mtu; net->partial_bytes_acked = 0; + sctp_enforce_cwnd_limit(&stcb->asoc, net); htcp_alpha_update(&net->cc_mod.htcp_ca); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, @@ -2109,6 +2129,7 @@ sctp_htcp_set_initial_cc_param(struct sc */ net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); net->ssthresh = stcb->asoc.peers_rwnd; + sctp_enforce_cwnd_limit(&stcb->asoc, net); htcp_init(net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { @@ -2212,6 +2233,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc htcp_reset(&net->cc_mod.htcp_ca); net->ssthresh = htcp_recalc_ssthresh(net); net->cwnd = net->ssthresh; + sctp_enforce_cwnd_limit(asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_FR); @@ -2291,6 +2313,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str net->RTO <<= 1; } net->cwnd = net->ssthresh; + sctp_enforce_cwnd_limit(&stcb->asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctp_input.c Fri May 29 12:54:30 2015 (r283724) @@ -2763,6 +2763,7 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->sctp_mobility_features = (*inp_p)->sctp_mobility_features; inp->sctp_socket = so; inp->sctp_frag_point = (*inp_p)->sctp_frag_point; + inp->max_cwnd = (*inp_p)->max_cwnd; inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; inp->ecn_supported = (*inp_p)->ecn_supported; inp->prsctp_supported = (*inp_p)->prsctp_supported; Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctp_pcb.c Fri May 29 12:54:30 2015 (r283724) @@ -2474,6 +2474,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_associd_counter = 1; inp->partial_delivery_point = SCTP_SB_LIMIT_RCV(so) >> SCTP_PARTIAL_DELIVERY_SHIFT; inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT; + inp->max_cwnd = 0; inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); inp->ecn_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_ecn_enable); inp->prsctp_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pr_enable); Modified: stable/10/sys/netinet/sctp_pcb.h ============================================================================== --- stable/10/sys/netinet/sctp_pcb.h Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctp_pcb.h Fri May 29 12:54:30 2015 (r283724) @@ -404,6 +404,7 @@ struct sctp_inpcb { uint32_t sctp_frag_point; uint32_t partial_delivery_point; uint32_t sctp_context; + uint32_t max_cwnd; uint8_t local_strreset_support; uint32_t sctp_cmt_on_off; uint8_t ecn_supported; Modified: stable/10/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/10/sys/netinet/sctp_peeloff.c Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctp_peeloff.c Fri May 29 12:54:30 2015 (r283724) @@ -127,6 +127,7 @@ sctp_do_peeloff(struct socket *head, str n_inp->pktdrop_supported = inp->pktdrop_supported; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; + n_inp->max_cwnd = inp->max_cwnd; n_inp->local_strreset_support = inp->local_strreset_support; n_inp->inp_starting_point_for_iterator = NULL; /* copy in the authentication parameters from the original endpoint */ Modified: stable/10/sys/netinet/sctp_structs.h ============================================================================== --- stable/10/sys/netinet/sctp_structs.h Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctp_structs.h Fri May 29 12:54:30 2015 (r283724) @@ -1199,6 +1199,7 @@ struct sctp_association { uint8_t sctp_cmt_pf; uint8_t use_precise_time; uint64_t sctp_features; + uint32_t max_cwnd; uint16_t port; /* remote UDP encapsulation port */ /* * The mapping array is used to track out of order sequences above Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:54:30 2015 (r283724) @@ -3694,6 +3694,33 @@ flags_out: } break; } + case SCTP_MAX_CWND: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + av->assoc_value = stcb->asoc.max_cwnd; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->max_cwnd; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_assoc_value); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -6572,6 +6599,42 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_MAX_CWND: + { + struct sctp_assoc_value *av; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + stcb->asoc.max_cwnd = av->assoc_value; + if (stcb->asoc.max_cwnd > 0) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + if ((net->cwnd > stcb->asoc.max_cwnd) && + (net->cwnd > (net->mtu - sizeof(struct sctphdr)))) { + net->cwnd = stcb->asoc.max_cwnd; + if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { + net->cwnd = net->mtu - sizeof(struct sctphdr); + } + } + } + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->max_cwnd = av->assoc_value; + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Fri May 29 12:50:53 2015 (r283723) +++ stable/10/sys/netinet/sctputil.c Fri May 29 12:54:30 2015 (r283724) @@ -936,6 +936,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s asoc->sctp_frag_point = inp->sctp_frag_point; asoc->sctp_features = inp->sctp_features; asoc->default_dscp = inp->sctp_ep.default_dscp; + asoc->max_cwnd = inp->max_cwnd; #ifdef INET6 if (inp->sctp_ep.default_flowlabel) { asoc->default_flowlabel = inp->sctp_ep.default_flowlabel; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:57:05 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 520EFF14; Fri, 29 May 2015 12:57:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FE6F167F; Fri, 29 May 2015 12:57:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCv53K043271; Fri, 29 May 2015 12:57:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCv56Z043270; Fri, 29 May 2015 12:57:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291257.t4TCv56Z043270@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283725 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:57:05 -0000 Author: tuexen Date: Fri May 29 12:57:04 2015 New Revision: 283725 URL: https://svnweb.freebsd.org/changeset/base/283725 Log: MFC r279863: Unlock the stcb when using setsockopt() for the SCTP_PEER_ADDR_THLDS option. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:54:30 2015 (r283724) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:57:04 2015 (r283725) @@ -6249,6 +6249,7 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.def_net_failure = thlds->spt_pathmaxrxt; stcb->asoc.def_net_pf_threshold = thlds->spt_pathpfthld; } + SCTP_TCB_UNLOCK(stcb); } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || From owner-svn-src-stable@FreeBSD.ORG Fri May 29 12:59:19 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50823E7; Fri, 29 May 2015 12:59:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2431E1696; Fri, 29 May 2015 12:59:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TCxJPk043618; Fri, 29 May 2015 12:59:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TCxItT043617; Fri, 29 May 2015 12:59:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291259.t4TCxItT043617@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 12:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283726 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:59:19 -0000 Author: tuexen Date: Fri May 29 12:59:18 2015 New Revision: 283726 URL: https://svnweb.freebsd.org/changeset/base/283726 Log: MFC r279867: Keep track on the socket lock state. This fixes a bug showing up on Mac OS X. Modified: stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Fri May 29 12:57:04 2015 (r283725) +++ stable/10/sys/netinet/sctputil.c Fri May 29 12:59:18 2015 (r283726) @@ -2745,7 +2745,11 @@ set_error: static void sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state, - struct sockaddr *sa, uint32_t error) + struct sockaddr *sa, uint32_t error, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct mbuf *m_notify; struct sctp_paddr_change *spc; @@ -2828,7 +2832,7 @@ sctp_notify_peer_addr_change(struct sctp control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, - SCTP_SO_NOT_LOCKED); + so_locked); } @@ -3592,7 +3596,7 @@ sctp_ulp_notify(uint32_t notification, s net = (struct sctp_nets *)data; sctp_notify_peer_addr_change(stcb, SCTP_ADDR_UNREACHABLE, - (struct sockaddr *)&net->ro._l_addr, error); + (struct sockaddr *)&net->ro._l_addr, error, so_locked); break; } case SCTP_NOTIFY_INTERFACE_UP: @@ -3601,7 +3605,7 @@ sctp_ulp_notify(uint32_t notification, s net = (struct sctp_nets *)data; sctp_notify_peer_addr_change(stcb, SCTP_ADDR_AVAILABLE, - (struct sockaddr *)&net->ro._l_addr, error); + (struct sockaddr *)&net->ro._l_addr, error, so_locked); break; } case SCTP_NOTIFY_INTERFACE_CONFIRMED: @@ -3610,7 +3614,7 @@ sctp_ulp_notify(uint32_t notification, s net = (struct sctp_nets *)data; sctp_notify_peer_addr_change(stcb, SCTP_ADDR_CONFIRMED, - (struct sockaddr *)&net->ro._l_addr, error); + (struct sockaddr *)&net->ro._l_addr, error, so_locked); break; } case SCTP_NOTIFY_SPECIAL_SP_FAIL: @@ -3681,15 +3685,15 @@ sctp_ulp_notify(uint32_t notification, s break; case SCTP_NOTIFY_ASCONF_ADD_IP: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_ADDED, data, - error); + error, so_locked); break; case SCTP_NOTIFY_ASCONF_DELETE_IP: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_REMOVED, data, - error); + error, so_locked); break; case SCTP_NOTIFY_ASCONF_SET_PRIMARY: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_MADE_PRIM, data, - error); + error, so_locked); break; case SCTP_NOTIFY_PEER_SHUTDOWN: sctp_notify_shutdown_event(stcb); From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:02:00 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B213726F; Fri, 29 May 2015 13:02:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A01A21885; Fri, 29 May 2015 13:02:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TD20cs047717; Fri, 29 May 2015 13:02:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TD206q047715; Fri, 29 May 2015 13:02:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291302.t4TD206q047715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:02: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: r283727 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:02:00 -0000 Author: tuexen Date: Fri May 29 13:02:00 2015 New Revision: 283727 URL: https://svnweb.freebsd.org/changeset/base/283727 Log: MFC r279886: Fix the adaptation of the path state when thresholds are changed using the SCTP_PEER_ADDR_THLDS socket option. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 12:59:18 2015 (r283726) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 13:02:00 2015 (r283727) @@ -6189,14 +6189,16 @@ sctp_setopt(struct socket *so, int optna } if (stcb != NULL) { if (net != NULL) { + net->failure_threshold = thlds->spt_pathmaxrxt; + net->pf_threshold = thlds->spt_pathpfthld; if (net->dest_state & SCTP_ADDR_PF) { - if ((net->failure_threshold > thlds->spt_pathmaxrxt) || - (net->failure_threshold <= thlds->spt_pathpfthld)) { + if ((net->error_count > net->failure_threshold) || + (net->error_count <= net->pf_threshold)) { net->dest_state &= ~SCTP_ADDR_PF; } } else { - if ((net->failure_threshold > thlds->spt_pathpfthld) && - (net->failure_threshold <= thlds->spt_pathmaxrxt)) { + if ((net->error_count > net->pf_threshold) && + (net->error_count <= net->failure_threshold)) { net->dest_state |= SCTP_ADDR_PF; sctp_send_hb(stcb, net, SCTP_SO_LOCKED); sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3); @@ -6204,28 +6206,28 @@ sctp_setopt(struct socket *so, int optna } } if (net->dest_state & SCTP_ADDR_REACHABLE) { - if (net->failure_threshold > thlds->spt_pathmaxrxt) { + if (net->error_count > net->failure_threshold) { net->dest_state &= ~SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { - if (net->failure_threshold <= thlds->spt_pathmaxrxt) { + if (net->error_count <= net->failure_threshold) { net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } - net->failure_threshold = thlds->spt_pathmaxrxt; - net->pf_threshold = thlds->spt_pathpfthld; } else { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->failure_threshold = thlds->spt_pathmaxrxt; + net->pf_threshold = thlds->spt_pathpfthld; if (net->dest_state & SCTP_ADDR_PF) { - if ((net->failure_threshold > thlds->spt_pathmaxrxt) || - (net->failure_threshold <= thlds->spt_pathpfthld)) { + if ((net->error_count > net->failure_threshold) || + (net->error_count <= net->pf_threshold)) { net->dest_state &= ~SCTP_ADDR_PF; } } else { - if ((net->failure_threshold > thlds->spt_pathpfthld) && - (net->failure_threshold <= thlds->spt_pathmaxrxt)) { + if ((net->error_count > net->pf_threshold) && + (net->error_count <= net->failure_threshold)) { net->dest_state |= SCTP_ADDR_PF; sctp_send_hb(stcb, net, SCTP_SO_LOCKED); sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3); @@ -6233,18 +6235,16 @@ sctp_setopt(struct socket *so, int optna } } if (net->dest_state & SCTP_ADDR_REACHABLE) { - if (net->failure_threshold > thlds->spt_pathmaxrxt) { + if (net->error_count > net->failure_threshold) { net->dest_state &= ~SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { - if (net->failure_threshold <= thlds->spt_pathmaxrxt) { + if (net->error_count <= net->failure_threshold) { net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } - net->failure_threshold = thlds->spt_pathmaxrxt; - net->pf_threshold = thlds->spt_pathpfthld; } stcb->asoc.def_net_failure = thlds->spt_pathmaxrxt; stcb->asoc.def_net_pf_threshold = thlds->spt_pathpfthld; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:06:16 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30A183EA; Fri, 29 May 2015 13:06:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E82418B8; Fri, 29 May 2015 13:06:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TD6Fs2048323; Fri, 29 May 2015 13:06:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TD6FqB048322; Fri, 29 May 2015 13:06:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291306.t4TD6FqB048322@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283728 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:06:16 -0000 Author: tuexen Date: Fri May 29 13:06:15 2015 New Revision: 283728 URL: https://svnweb.freebsd.org/changeset/base/283728 Log: MFC r280371: Remove a useless assignment. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Fri May 29 13:02:00 2015 (r283727) +++ stable/10/sys/netinet/sctp_output.c Fri May 29 13:06:15 2015 (r283728) @@ -9302,8 +9302,6 @@ sctp_send_asconf_ack(struct sctp_tcb *st atomic_add_int(&chk->whoTo->ref_count, 1); } chk->data = m_ack; - chk->send_size = 0; - /* Get size */ chk->send_size = ack->len; chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:08:44 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 395D0708; Fri, 29 May 2015 13:08:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 270AB18ED; Fri, 29 May 2015 13:08:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TD8iYf048800; Fri, 29 May 2015 13:08:44 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TD8iBP048799; Fri, 29 May 2015 13:08:44 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291308.t4TD8iBP048799@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:08: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: r283729 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:08:44 -0000 Author: tuexen Date: Fri May 29 13:08:43 2015 New Revision: 283729 URL: https://svnweb.freebsd.org/changeset/base/283729 Log: MFC r280404: When an ICMP message is received and the MTU shrinks, only mark outstanding chunks for retransmissions. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 13:06:15 2015 (r283728) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 13:08:43 2015 (r283729) @@ -125,21 +125,19 @@ sctp_pathmtu_adjustment(struct sctp_tcb if (chk->sent < SCTP_DATAGRAM_RESEND) { sctp_flight_size_decrease(chk); sctp_total_flight_decrease(stcb, chk); - } - if (chk->sent != SCTP_DATAGRAM_RESEND) { + chk->sent = SCTP_DATAGRAM_RESEND; sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); + chk->rec.data.doing_fast_retransmit = 0; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { + sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PMTU, + chk->whoTo->flight_size, + chk->book_size, + (uintptr_t) chk->whoTo, + chk->rec.data.TSN_seq); + } + /* Clear any time so NO RTT is being done */ + chk->do_rtt = 0; } - chk->sent = SCTP_DATAGRAM_RESEND; - chk->rec.data.doing_fast_retransmit = 0; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { - sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PMTU, - chk->whoTo->flight_size, - chk->book_size, - (uintptr_t) chk->whoTo, - chk->rec.data.TSN_seq); - } - /* Clear any time so NO RTT is being done */ - chk->do_rtt = 0; } } } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:11:14 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34B5A87F; Fri, 29 May 2015 13:11:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22CC91A65; Fri, 29 May 2015 13:11:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDBDBe052335; Fri, 29 May 2015 13:11:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDBD8Z052334; Fri, 29 May 2015 13:11:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291311.t4TDBD8Z052334@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283730 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:11:14 -0000 Author: tuexen Date: Fri May 29 13:11:13 2015 New Revision: 283730 URL: https://svnweb.freebsd.org/changeset/base/283730 Log: MFC r280439: Fix an accounting bug related to the per stream chunk counter. While there, don't refer to a net articifically. Modified: stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Fri May 29 13:08:43 2015 (r283729) +++ stable/10/sys/netinet/sctputil.c Fri May 29 13:11:13 2015 (r283730) @@ -4891,13 +4891,9 @@ sctp_release_pr_sctp_chunk(struct sctp_t chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; chk->flags = sp->act_flags; - if (sp->net) - chk->whoTo = sp->net; - else - chk->whoTo = stcb->asoc.primary_destination; - atomic_add_int(&chk->whoTo->ref_count, 1); + chk->whoTo = NULL; chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); - stcb->asoc.pr_sctp_cnt++; + strq->chunks_on_queues++; TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); stcb->asoc.sent_queue_cnt++; stcb->asoc.pr_sctp_cnt++; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:13:13 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99301AD5; Fri, 29 May 2015 13:13:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86C4B1B0F; Fri, 29 May 2015 13:13:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDDDwW053277; Fri, 29 May 2015 13:13:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDDD7e053276; Fri, 29 May 2015 13:13:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291313.t4TDDD7e053276@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283731 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:13:13 -0000 Author: tuexen Date: Fri May 29 13:13:12 2015 New Revision: 283731 URL: https://svnweb.freebsd.org/changeset/base/283731 Log: MFC r280440: Fix the bug in the handling of fragmented abandoned SCTP user messages reported in https://code.google.com/p/sctp-refimpl/issues/detail?id=11 Thanks to Lally Singh for reporting it. Modified: stable/10/sys/netinet/sctp_indata.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Fri May 29 13:11:13 2015 (r283730) +++ stable/10/sys/netinet/sctp_indata.c Fri May 29 13:13:12 2015 (r283731) @@ -2597,12 +2597,14 @@ sctp_process_segment_range(struct sctp_t * cumack trackers for first transmissions, * and retransmissions. */ - if ((tp1->whoTo->find_pseudo_cumack == 1) && (tp1->sent < SCTP_DATAGRAM_RESEND) && + if ((tp1->sent < SCTP_DATAGRAM_RESEND) && + (tp1->whoTo->find_pseudo_cumack == 1) && (tp1->snd_count == 1)) { tp1->whoTo->pseudo_cumack = tp1->rec.data.TSN_seq; tp1->whoTo->find_pseudo_cumack = 0; } - if ((tp1->whoTo->find_rtx_pseudo_cumack == 1) && (tp1->sent < SCTP_DATAGRAM_RESEND) && + if ((tp1->sent < SCTP_DATAGRAM_RESEND) && + (tp1->whoTo->find_rtx_pseudo_cumack == 1) && (tp1->snd_count > 1)) { tp1->whoTo->rtx_pseudo_cumack = tp1->rec.data.TSN_seq; tp1->whoTo->find_rtx_pseudo_cumack = 0; @@ -3512,7 +3514,7 @@ sctp_window_probe_recovery(struct sctp_t if ((tp1->sent >= SCTP_DATAGRAM_ACKED) || (tp1->data == NULL)) { /* TSN's skipped we do NOT move back. */ sctp_misc_ints(SCTP_FLIGHT_LOG_DWN_WP_FWD, - tp1->whoTo->flight_size, + tp1->whoTo ? tp1->whoTo->flight_size : 0, tp1->book_size, (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:18:12 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AC07CA9; Fri, 29 May 2015 13:18:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E00A01B7A; Fri, 29 May 2015 13:18:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDIBQl054007; Fri, 29 May 2015 13:18:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDIBH0054005; Fri, 29 May 2015 13:18:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291318.t4TDIBH0054005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:18: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: r283732 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:18:12 -0000 Author: tuexen Date: Fri May 29 13:18:10 2015 New Revision: 283732 URL: https://svnweb.freebsd.org/changeset/base/283732 Log: MFC r280459: Fix two bugs which resulted in a screwed up end point list: * Use a save way to walk throught a list while manipulting it. * Have to appropiate locks in place. Joint work with rrs@ Modified: stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Fri May 29 13:13:12 2015 (r283731) +++ stable/10/sys/netinet/sctp_pcb.c Fri May 29 13:18:10 2015 (r283732) @@ -1867,7 +1867,7 @@ sctp_swap_inpcb_for_listen(struct sctp_i { /* For 1-2-1 with port reuse */ struct sctppcbhead *head; - struct sctp_inpcb *tinp; + struct sctp_inpcb *tinp, *ninp; if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE)) { /* only works with port reuse on */ @@ -1877,10 +1877,11 @@ sctp_swap_inpcb_for_listen(struct sctp_i return (0); } SCTP_INP_RUNLOCK(inp); + SCTP_INP_INFO_WLOCK(); head = &SCTP_BASE_INFO(sctp_ephash)[SCTP_PCBHASH_ALLADDR(inp->sctp_lport, SCTP_BASE_INFO(hashmark))]; /* Kick out all non-listeners to the TCP hash */ - LIST_FOREACH(tinp, head, sctp_hash) { + LIST_FOREACH_SAFE(tinp, head, sctp_hash, ninp) { if (tinp->sctp_lport != inp->sctp_lport) { continue; } @@ -1908,6 +1909,7 @@ sctp_swap_inpcb_for_listen(struct sctp_i LIST_INSERT_HEAD(head, inp, sctp_hash); SCTP_INP_WUNLOCK(inp); SCTP_INP_RLOCK(inp); + SCTP_INP_INFO_WUNLOCK(); return (0); } Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 13:13:12 2015 (r283731) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 13:18:10 2015 (r283732) @@ -6965,8 +6965,8 @@ sctp_listen(struct socket *so, int backl #endif SOCK_LOCK(so); error = solisten_proto_check(so); + SOCK_UNLOCK(so); if (error) { - SOCK_UNLOCK(so); SCTP_INP_RUNLOCK(inp); return (error); } @@ -6979,28 +6979,27 @@ sctp_listen(struct socket *so, int backl * move the guy that was listener to the TCP Pool. */ if (sctp_swap_inpcb_for_listen(inp)) { - goto in_use; + SCTP_INP_RUNLOCK(inp); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE); + return (EADDRINUSE); } } if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) { /* We are already connected AND the TCP model */ -in_use: SCTP_INP_RUNLOCK(inp); - SOCK_UNLOCK(so); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EADDRINUSE); return (EADDRINUSE); } SCTP_INP_RUNLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { /* We must do a bind. */ - SOCK_UNLOCK(so); if ((error = sctp_inpcb_bind(so, NULL, NULL, p))) { /* bind error, probably perm */ return (error); } - SOCK_LOCK(so); } + SOCK_LOCK(so); /* It appears for 7.0 and on, we must always call this. */ solisten_proto(so, backlog); if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:20:40 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B6CBF50; Fri, 29 May 2015 13:20:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDC371C1E; Fri, 29 May 2015 13:20:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDKdKv055073; Fri, 29 May 2015 13:20:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDKd8N055072; Fri, 29 May 2015 13:20:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291320.t4TDKd8N055072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283733 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:20:40 -0000 Author: tuexen Date: Fri May 29 13:20:39 2015 New Revision: 283733 URL: https://svnweb.freebsd.org/changeset/base/283733 Log: MFC r280634: Use the reference count of the right SCTP inp. Joint work with rrs@ Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Fri May 29 13:18:10 2015 (r283732) +++ stable/10/sys/netinet/sctp_usrreq.c Fri May 29 13:20:39 2015 (r283733) @@ -6953,7 +6953,7 @@ sctp_listen(struct socket *so, int backl SCTP_INP_DECR_REF(tinp); return (EADDRINUSE); } else if (tinp) { - SCTP_INP_DECR_REF(inp); + SCTP_INP_DECR_REF(tinp); } } } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:23:17 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A11D9183; Fri, 29 May 2015 13:23:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F0AE1DC0; Fri, 29 May 2015 13:23:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDNHUt058549; Fri, 29 May 2015 13:23:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDNHto058548; Fri, 29 May 2015 13:23:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291323.t4TDNHto058548@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283734 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:23:17 -0000 Author: tuexen Date: Fri May 29 13:23:16 2015 New Revision: 283734 URL: https://svnweb.freebsd.org/changeset/base/283734 Log: MFC r280642: Make sure that we don't free an SCTP shared key too early. Thanks to Pouyan Sepehrdad from Qualcomm Product Security Initiative for reporting the issue. Modified: stable/10/sys/netinet/sctp_auth.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_auth.c ============================================================================== --- stable/10/sys/netinet/sctp_auth.c Fri May 29 13:20:39 2015 (r283733) +++ stable/10/sys/netinet/sctp_auth.c Fri May 29 13:23:16 2015 (r283734) @@ -576,13 +576,12 @@ sctp_auth_key_release(struct sctp_tcb *s /* decrement the ref count */ if (skey) { - sctp_free_sharedkey(skey); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u refcount release to %d\n", __FUNCTION__, (void *)stcb, key_id, skey->refcount); /* see if a notification should be generated */ - if ((skey->refcount <= 1) && (skey->deactivated)) { + if ((skey->refcount <= 2) && (skey->deactivated)) { /* notify ULP that key is no longer used */ sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, key_id, 0, so_locked); @@ -590,6 +589,7 @@ sctp_auth_key_release(struct sctp_tcb *s "%s: stcb %p key %u no longer used, %d\n", __FUNCTION__, (void *)stcb, key_id, skey->refcount); } + sctp_free_sharedkey(skey); } } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:26:07 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09127455; Fri, 29 May 2015 13:26:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D01D71DFF; Fri, 29 May 2015 13:26:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDQ67Q059162; Fri, 29 May 2015 13:26:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDQ66m059159; Fri, 29 May 2015 13:26:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291326.t4TDQ66m059159@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:26: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: r283736 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:26:07 -0000 Author: tuexen Date: Fri May 29 13:26:05 2015 New Revision: 283736 URL: https://svnweb.freebsd.org/changeset/base/283736 Log: MFC r280714: Improve the selection of the destination address of SACK chunks. This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196755 and is joint work with rrs@. Modified: stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_structs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Fri May 29 13:24:17 2015 (r283735) +++ stable/10/sys/netinet/sctp_output.c Fri May 29 13:26:05 2015 (r283736) @@ -10425,32 +10425,17 @@ sctp_send_sack(struct sctp_tcb *stcb, in a_chk->sent = SCTP_DATAGRAM_UNSENT; a_chk->whoTo = NULL; - if ((asoc->numduptsns) || - (!(asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE))) { + if (!(asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE)) { /*- - * Ok, we have some duplicates or the destination for the - * sack is unreachable, lets see if we can select an - * alternate than asoc->last_data_chunk_from + * Ok, the destination for the SACK is unreachable, lets see if + * we can select an alternate to asoc->last_data_chunk_from */ - if ((asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE) && - (asoc->used_alt_onsack > asoc->numnets)) { - /* We used an alt last time, don't this time */ - a_chk->whoTo = NULL; - } else { - asoc->used_alt_onsack++; - a_chk->whoTo = sctp_find_alternate_net(stcb, asoc->last_data_chunk_from, 0); - } + a_chk->whoTo = sctp_find_alternate_net(stcb, asoc->last_data_chunk_from, 0); if (a_chk->whoTo == NULL) { /* Nope, no alternate */ a_chk->whoTo = asoc->last_data_chunk_from; - asoc->used_alt_onsack = 0; } } else { - /* - * No duplicates so we use the last place we received data - * from. - */ - asoc->used_alt_onsack = 0; a_chk->whoTo = asoc->last_data_chunk_from; } if (a_chk->whoTo) { Modified: stable/10/sys/netinet/sctp_structs.h ============================================================================== --- stable/10/sys/netinet/sctp_structs.h Fri May 29 13:24:17 2015 (r283735) +++ stable/10/sys/netinet/sctp_structs.h Fri May 29 13:26:05 2015 (r283736) @@ -1174,7 +1174,6 @@ struct sctp_association { struct sctp_scoping scope; /* flags to handle send alternate net tracking */ - uint8_t used_alt_onsack; uint8_t used_alt_asconfack; uint8_t fast_retran_loss_recovery; uint8_t sat_t3_loss_recovery; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:28:25 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA5EE64E; Fri, 29 May 2015 13:28:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 983C11E2D; Fri, 29 May 2015 13:28:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDSPZl059498; Fri, 29 May 2015 13:28:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDSPVx059497; Fri, 29 May 2015 13:28:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291328.t4TDSPVx059497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283737 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:28:25 -0000 Author: tuexen Date: Fri May 29 13:28:24 2015 New Revision: 283737 URL: https://svnweb.freebsd.org/changeset/base/283737 Log: MFC r280782: Add an SCTP symbol which was missed in https://svnweb.freebsd.org/base?view=revision&revision=169622 This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197783 Thanks to Jukka Ukkonen for reporting the bug and providing a fix. Modified: stable/10/lib/libc/net/Symbol.map Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/Symbol.map ============================================================================== --- stable/10/lib/libc/net/Symbol.map Fri May 29 13:26:05 2015 (r283736) +++ stable/10/lib/libc/net/Symbol.map Fri May 29 13:28:24 2015 (r283737) @@ -124,6 +124,7 @@ FBSD_1.0 { in6addr_nodelocal_allnodes; in6addr_linklocal_allnodes; sctp_getaddrlen; + sctp_getassocid; sctp_bindx; sctp_connectx; sctp_peeloff; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:30:38 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4E9A7C5; Fri, 29 May 2015 13:30:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A31F51E97; Fri, 29 May 2015 13:30:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDUcJF060621; Fri, 29 May 2015 13:30:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDUcYZ060620; Fri, 29 May 2015 13:30:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291330.t4TDUcYZ060620@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:30: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: r283738 - stable/10/usr.bin/sockstat 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:30:38 -0000 Author: tuexen Date: Fri May 29 13:30:37 2015 New Revision: 283738 URL: https://svnweb.freebsd.org/changeset/base/283738 Log: MFC r281202: The code says "or", not "either or". So fix the documentation. Modified: stable/10/usr.bin/sockstat/sockstat.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sockstat/sockstat.1 ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.1 Fri May 29 13:28:24 2015 (r283737) +++ stable/10/usr.bin/sockstat/sockstat.1 Fri May 29 13:30:37 2015 (r283738) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2012 +.Dd April 7, 2015 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -69,7 +69,7 @@ or do not contain the IPv6 loopback addr .It Fl l Show listening sockets. .It Fl p Ar ports -Only show Internet sockets if either the local or foreign port number +Only show Internet sockets if the local or foreign port number is on the specified list. The .Ar ports From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:32:09 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FF0A9EE; Fri, 29 May 2015 13:32:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1A481043; Fri, 29 May 2015 13:32:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDW8xk063778; Fri, 29 May 2015 13:32:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDW80S063777; Fri, 29 May 2015 13:32:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291332.t4TDW80S063777@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:32: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: r283739 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:32:09 -0000 Author: tuexen Date: Fri May 29 13:32:08 2015 New Revision: 283739 URL: https://svnweb.freebsd.org/changeset/base/283739 Log: MFC r281884: A complete user message is signalled with the MSG_EOR flag, not the MSG_EOF flag. Thanks to Valentin Nechayev for reporting the issue. Modified: stable/10/lib/libc/net/sctp_recvmsg.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- stable/10/lib/libc/net/sctp_recvmsg.3 Fri May 29 13:30:37 2015 (r283738) +++ stable/10/lib/libc/net/sctp_recvmsg.3 Fri May 29 13:32:08 2015 (r283739) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd April 23, 2015 .Dt SCTP_RECVMSG 3 .Os .Sh NAME @@ -98,13 +98,13 @@ receive buffer, then the argument will .Em not have the -.Dv MSG_EOF +.Dv MSG_EOR flag applied. If the message is a complete message then the .Fa flags argument will have -.Dv MSG_EOF +.Dv MSG_EOR set. Locally detected errors are indicated by a return value of -1 with From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:34:32 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43147CCD; Fri, 29 May 2015 13:34:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 176291075; Fri, 29 May 2015 13:34:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDYVhX064154; Fri, 29 May 2015 13:34:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDYV9m064153; Fri, 29 May 2015 13:34:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291334.t4TDYV9m064153@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:34: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: r283740 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:34:32 -0000 Author: tuexen Date: Fri May 29 13:34:31 2015 New Revision: 283740 URL: https://svnweb.freebsd.org/changeset/base/283740 Log: MFC r282042: Don't panic under INVARIANTS when receiving a SACK which cumacks a TSN never sent. While there, fix two typos. Modified: stable/10/sys/netinet/sctp_indata.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Fri May 29 13:32:08 2015 (r283739) +++ stable/10/sys/netinet/sctp_indata.c Fri May 29 13:34:31 2015 (r283740) @@ -3614,24 +3614,17 @@ sctp_express_handle_sack(struct sctp_tcb send_s = asoc->sending_seq; } if (SCTP_TSN_GE(cumack, send_s)) { -#ifndef INVARIANTS struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; -#endif -#ifdef INVARIANTS - panic("Impossible sack 1"); -#else - *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal then TSN %8.8x", + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", cumack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; -#endif } } asoc->this_sack_highest_gap = cumack; @@ -4195,7 +4188,7 @@ sctp_handle_sack(struct mbuf *m, int off hopeless_peer: *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal then TSN %8.8x", + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", cum_ack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 13:37:05 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3779A13B; Fri, 29 May 2015 13:37:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2552C10D9; Fri, 29 May 2015 13:37:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TDb5me064570; Fri, 29 May 2015 13:37:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TDb5Cg064569; Fri, 29 May 2015 13:37:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201505291337.t4TDb5Cg064569@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 May 2015 13:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283741 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 13:37:05 -0000 Author: tuexen Date: Fri May 29 13:37:04 2015 New Revision: 283741 URL: https://svnweb.freebsd.org/changeset/base/283741 Log: MFC r282810: Ensure that the COOKIE-ACK can be sent over UDP if the COOKIE-ECHO was received over UDP. Thanks to Felix Weinrank for makeing me aware of the problem and to Irene Ruengeler for providing the fix. Modified: stable/10/sys/netinet/sctp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Fri May 29 13:34:31 2015 (r283740) +++ stable/10/sys/netinet/sctp_input.c Fri May 29 13:37:04 2015 (r283741) @@ -2325,12 +2325,13 @@ sctp_process_cookie_new(struct mbuf *m, sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) { sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL); } - /* calculate the RTT */ (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); if ((netp) && (*netp)) { + /* calculate the RTT and set the encaps port */ (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, &cookie->time_entered, sctp_align_unsafe_makecopy, SCTP_RTT_FROM_NON_DATA); + (*netp)->port = port; } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); From owner-svn-src-stable@FreeBSD.ORG Fri May 29 17:43:15 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57D9FC78; Fri, 29 May 2015 17:43:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 458AC1E62; Fri, 29 May 2015 17:43:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4THhFIl092044; Fri, 29 May 2015 17:43:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4THhF0V092043; Fri, 29 May 2015 17:43:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201505291743.t4THhF0V092043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 29 May 2015 17:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283748 - stable/10/contrib/ipfilter/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 17:43:15 -0000 Author: emaste Date: Fri May 29 17:43:14 2015 New Revision: 283748 URL: https://svnweb.freebsd.org/changeset/base/283748 Log: MFC r283295: ipf(1): Use strchr(3) instead of deprecated index(3) Sponsored by: The FreeBSD Foundation Modified: stable/10/contrib/ipfilter/tools/ipf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/tools/ipf.c ============================================================================== --- stable/10/contrib/ipfilter/tools/ipf.c Fri May 29 17:01:15 2015 (r283747) +++ stable/10/contrib/ipfilter/tools/ipf.c Fri May 29 17:43:14 2015 (r283748) @@ -296,7 +296,7 @@ static void packetlogon(opt) printf("set log flag: nomatch\n"); change = 1; } - if (strstr(opt, "block") || index(opt, 'd')) { + if (strstr(opt, "block") || strchr(opt, 'd')) { flag |= FF_LOGBLOCK; if (opts & OPT_VERBOSE) printf("set log flag: block\n"); From owner-svn-src-stable@FreeBSD.ORG Fri May 29 20:00:03 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05E5D306; Fri, 29 May 2015 20:00:03 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E81E91FCC; Fri, 29 May 2015 20:00:02 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TK025i060597; Fri, 29 May 2015 20:00:02 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TK028Q060596; Fri, 29 May 2015 20:00:02 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292000.t4TK028Q060596@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 20:00: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: r283752 - stable/10/sys/dev/bxe 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 20:00:03 -0000 Author: davidcs Date: Fri May 29 20:00:02 2015 New Revision: 283752 URL: https://svnweb.freebsd.org/changeset/base/283752 Log: MFC r283269 Submitted by:gary.zambrano@qlogic.com Approved by:davidcs@freebsd.org Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Fri May 29 19:42:55 2015 (r283751) +++ stable/10/sys/dev/bxe/bxe.c Fri May 29 20:00:02 2015 (r283752) @@ -3111,7 +3111,7 @@ static inline void bxe_update_sge_prod(struct bxe_softc *sc, struct bxe_fastpath *fp, uint16_t sge_len, - struct eth_end_agg_rx_cqe *cqe) + union eth_sgl_or_raw_data *cqe) { uint16_t last_max, last_elem, first_elem; uint16_t delta = 0; @@ -3124,17 +3124,17 @@ bxe_update_sge_prod(struct bxe_softc /* first mark all used pages */ for (i = 0; i < sge_len; i++) { BIT_VEC64_CLEAR_BIT(fp->sge_mask, - RX_SGE(le16toh(cqe->sgl_or_raw_data.sgl[i]))); + RX_SGE(le16toh(cqe->sgl[i]))); } BLOGD(sc, DBG_LRO, "fp[%02d] fp_cqe->sgl[%d] = %d\n", fp->index, sge_len - 1, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); /* assume that the last SGE index is the biggest */ bxe_update_last_max_sge(fp, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); last_max = RX_SGE(fp->last_max_sge); last_elem = last_max >> BIT_VEC64_ELEM_SHIFT; @@ -3250,6 +3250,53 @@ bxe_tpa_stop_exit: } static uint8_t +bxe_service_rxsgl( + struct bxe_fastpath *fp, + uint16_t len, + uint16_t lenonbd, + struct mbuf *m, + struct eth_fast_path_rx_cqe *cqe_fp) +{ + struct mbuf *m_frag; + uint16_t frags, frag_len; + uint16_t sge_idx = 0; + uint16_t j; + uint8_t i, rc = 0; + uint32_t frag_size; + + /* adjust the mbuf */ + m->m_len = lenonbd; + + frag_size = len - lenonbd; + frags = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; + + for (i = 0, j = 0; i < frags; i += PAGES_PER_SGE, j++) { + sge_idx = RX_SGE(le16toh(cqe_fp->sgl_or_raw_data.sgl[j])); + + m_frag = fp->rx_sge_mbuf_chain[sge_idx].m; + frag_len = min(frag_size, (uint32_t)(SGE_PAGE_SIZE)); + m_frag->m_len = frag_len; + + /* allocate a new mbuf for the SGE */ + rc = bxe_alloc_rx_sge_mbuf(fp, sge_idx); + if (rc) { + /* Leave all remaining SGEs in the ring! */ + return (rc); + } + fp->eth_q_stats.mbuf_alloc_sge--; + + /* concatenate the fragment to the head mbuf */ + m_cat(m, m_frag); + + frag_size -= frag_len; + } + + bxe_update_sge_prod(fp->sc, fp, frags, &cqe_fp->sgl_or_raw_data); + + return rc; +} + +static uint8_t bxe_rxeof(struct bxe_softc *sc, struct bxe_fastpath *fp) { @@ -3289,7 +3336,7 @@ bxe_rxeof(struct bxe_softc *sc, struct eth_fast_path_rx_cqe *cqe_fp; uint8_t cqe_fp_flags; enum eth_rx_cqe_type cqe_fp_type; - uint16_t len, pad; + uint16_t len, lenonbd, pad; struct mbuf *m = NULL; comp_ring_cons = RCQ(sw_cq_cons); @@ -3304,7 +3351,7 @@ bxe_rxeof(struct bxe_softc *sc, BLOGD(sc, DBG_RX, "fp[%02d] Rx hw_cq_cons=%d hw_sw_cons=%d " "BD prod=%d cons=%d CQE type=0x%x err=0x%x " - "status=0x%x rss_hash=0x%x vlan=0x%x len=%u\n", + "status=0x%x rss_hash=0x%x vlan=0x%x len=%u lenonbd=%u\n", fp->index, hw_cq_cons, sw_cq_cons, @@ -3315,7 +3362,8 @@ bxe_rxeof(struct bxe_softc *sc, cqe_fp->status_flags, le32toh(cqe_fp->rss_hash_result), le16toh(cqe_fp->vlan_tag), - le16toh(cqe_fp->pkt_len_or_gro_seg_len)); + le16toh(cqe_fp->pkt_len_or_gro_seg_len), + le16toh(cqe_fp->len_on_bd)); /* is this a slowpath msg? */ if (__predict_false(CQE_TYPE_SLOW(cqe_fp_type))) { @@ -3362,7 +3410,7 @@ bxe_rxeof(struct bxe_softc *sc, bxe_tpa_stop(sc, fp, tpa_info, queue, pages, &cqe->end_agg_cqe, comp_ring_cons); - bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe); + bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe.sgl_or_raw_data); goto next_cqe; } @@ -3378,6 +3426,7 @@ bxe_rxeof(struct bxe_softc *sc, } len = le16toh(cqe_fp->pkt_len_or_gro_seg_len); + lenonbd = le16toh(cqe_fp->len_on_bd); pad = cqe_fp->placement_offset; m = rx_buf->m; @@ -3424,6 +3473,12 @@ bxe_rxeof(struct bxe_softc *sc, m_adj(m, pad); m->m_pkthdr.len = m->m_len = len; + if (len != lenonbd){ + rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); + if (rc) + break; + } + /* assign packet to this interface interface */ m->m_pkthdr.rcvif = ifp; @@ -6217,30 +6272,27 @@ static void bxe_set_fp_rx_buf_size(struct bxe_softc *sc) { int i; + uint32_t rx_buf_size; - BLOGD(sc, DBG_LOAD, "mtu = %d\n", sc->mtu); + rx_buf_size = (IP_HEADER_ALIGNMENT_PADDING + ETH_OVERHEAD + sc->mtu); for (i = 0; i < sc->num_queues; i++) { - /* get the Rx buffer size for RX frames */ - sc->fp[i].rx_buf_size = - (IP_HEADER_ALIGNMENT_PADDING + - ETH_OVERHEAD + - sc->mtu); - - BLOGD(sc, DBG_LOAD, "rx_buf_size for fp[%02d] = %d\n", - i, sc->fp[i].rx_buf_size); - - /* get the mbuf allocation size for RX frames */ - if (sc->fp[i].rx_buf_size <= MCLBYTES) { + if(rx_buf_size <= MCLBYTES){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= MJUMPAGESIZE){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else if (rx_buf_size <= (MJUMPAGESIZE + MCLBYTES)){ + sc->fp[i].rx_buf_size = MCLBYTES; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= (2 * MJUMPAGESIZE)){ + sc->fp[i].rx_buf_size = MJUMPAGESIZE; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else { + sc->fp[i].rx_buf_size = MCLBYTES; sc->fp[i].mbuf_alloc_size = MCLBYTES; - } else if (sc->fp[i].rx_buf_size <= BCM_PAGE_SIZE) { - sc->fp[i].mbuf_alloc_size = PAGE_SIZE; - } else { - sc->fp[i].mbuf_alloc_size = MJUM9BYTES; } - - BLOGD(sc, DBG_LOAD, "mbuf_alloc_size for fp[%02d] = %d\n", - i, sc->fp[i].mbuf_alloc_size); } } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 21:30:12 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EC1032B; Fri, 29 May 2015 21:30:12 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 602441863; Fri, 29 May 2015 21:30:12 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TLUC2s006841; Fri, 29 May 2015 21:30:12 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TLUBmf006829; Fri, 29 May 2015 21:30:11 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292130.t4TLUBmf006829@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 21:30: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: r283755 - stable/10/sys/dev/bxe 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 21:30:12 -0000 Author: davidcs Date: Fri May 29 21:30:11 2015 New Revision: 283755 URL: https://svnweb.freebsd.org/changeset/base/283755 Log: MFC r283274 Submitted by: gary.zambrano@qlogic.com Approved by:davidcs@freebsd.org Modified: stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe_stats.c stable/10/sys/dev/bxe/bxe_stats.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Fri May 29 20:50:41 2015 (r283754) +++ stable/10/sys/dev/bxe/bxe.c Fri May 29 21:30:11 2015 (r283755) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.78" +#define BXE_DRIVER_VERSION "1.78.79" #include "bxe.h" #include "ecore_sp.h" @@ -483,6 +483,8 @@ static const struct { 4, STATS_FLAGS_FUNC, "rx_pkts"}, { STATS_OFFSET32(rx_tpa_pkts), 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"}, + { STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"}, { STATS_OFFSET32(rx_soft_errors), 4, STATS_FLAGS_FUNC, "rx_soft_errors"}, { STATS_OFFSET32(rx_hw_csum_errors), @@ -594,6 +596,8 @@ static const struct { 4, "rx_pkts"}, { Q_STATS_OFFSET32(rx_tpa_pkts), 4, "rx_tpa_pkts"}, + { Q_STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, "rx_jumbo_sge_pkts"}, { Q_STATS_OFFSET32(rx_soft_errors), 4, "rx_soft_errors"}, { Q_STATS_OFFSET32(rx_hw_csum_errors), @@ -3477,6 +3481,7 @@ bxe_rxeof(struct bxe_softc *sc, rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); if (rc) break; + fp->eth_q_stats.rx_jumbo_sge_pkts++; } /* assign packet to this interface interface */ @@ -6851,42 +6856,40 @@ bxe_alloc_fp_buffers(struct bxe_softc *s fp->rx_cq_prod = cqe_ring_prod; fp->eth_q_stats.rx_calls = fp->eth_q_stats.rx_pkts = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - max_agg_queues = MAX_AGG_QS(sc); + max_agg_queues = MAX_AGG_QS(sc); - fp->tpa_enable = TRUE; + fp->tpa_enable = TRUE; - /* fill the TPA pool */ - for (j = 0; j < max_agg_queues; j++) { - rc = bxe_alloc_rx_tpa_mbuf(fp, j); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", + /* fill the TPA pool */ + for (j = 0; j < max_agg_queues; j++) { + rc = bxe_alloc_rx_tpa_mbuf(fp, j); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", i, j); - fp->tpa_enable = FALSE; - goto bxe_alloc_fp_buffers_error; - } - - fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + fp->tpa_enable = FALSE; + goto bxe_alloc_fp_buffers_error; } - if (fp->tpa_enable) { - /* fill the RX SGE chain */ - ring_prod = 0; - for (j = 0; j < RX_SGE_USABLE; j++) { - rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", - i, ring_prod); - fp->tpa_enable = FALSE; - ring_prod = 0; - goto bxe_alloc_fp_buffers_error; - } + fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + } - ring_prod = RX_SGE_NEXT(ring_prod); + if (fp->tpa_enable) { + /* fill the RX SGE chain */ + ring_prod = 0; + for (j = 0; j < RX_SGE_USABLE; j++) { + rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", + i, ring_prod); + fp->tpa_enable = FALSE; + ring_prod = 0; + goto bxe_alloc_fp_buffers_error; } - fp->rx_sge_prod = ring_prod; + ring_prod = RX_SGE_NEXT(ring_prod); } + + fp->rx_sge_prod = ring_prod; } } @@ -11770,28 +11773,26 @@ bxe_pf_rx_q_prep(struct bxe_softc uint16_t sge_sz = 0; uint16_t tpa_agg_size = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - pause->sge_th_lo = SGE_TH_LO(sc); - pause->sge_th_hi = SGE_TH_HI(sc); + pause->sge_th_lo = SGE_TH_LO(sc); + pause->sge_th_hi = SGE_TH_HI(sc); - /* validate SGE ring has enough to cross high threshold */ - if (sc->dropless_fc && + /* validate SGE ring has enough to cross high threshold */ + if (sc->dropless_fc && (pause->sge_th_hi + FW_PREFETCH_CNT) > (RX_SGE_USABLE_PER_PAGE * RX_SGE_NUM_PAGES)) { - BLOGW(sc, "sge ring threshold limit\n"); - } + BLOGW(sc, "sge ring threshold limit\n"); + } - /* minimum max_aggregation_size is 2*MTU (two full buffers) */ - tpa_agg_size = (2 * sc->mtu); - if (tpa_agg_size < sc->max_aggregation_size) { - tpa_agg_size = sc->max_aggregation_size; - } + /* minimum max_aggregation_size is 2*MTU (two full buffers) */ + tpa_agg_size = (2 * sc->mtu); + if (tpa_agg_size < sc->max_aggregation_size) { + tpa_agg_size = sc->max_aggregation_size; + } - max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; - max_sge = ((max_sge + PAGES_PER_SGE - 1) & + max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; + max_sge = ((max_sge + PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> PAGES_PER_SGE_SHIFT; - sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); - } + sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); /* pause - not for e1 */ if (!CHIP_IS_E1(sc)) { Modified: stable/10/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.c Fri May 29 20:50:41 2015 (r283754) +++ stable/10/sys/dev/bxe/bxe_stats.c Fri May 29 21:30:11 2015 (r283755) @@ -1227,6 +1227,7 @@ bxe_drv_stats_update(struct bxe_softc *s UPDATE_ESTAT_QSTAT(rx_calls); UPDATE_ESTAT_QSTAT(rx_pkts); UPDATE_ESTAT_QSTAT(rx_tpa_pkts); + UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts); UPDATE_ESTAT_QSTAT(rx_soft_errors); UPDATE_ESTAT_QSTAT(rx_hw_csum_errors); UPDATE_ESTAT_QSTAT(rx_ofld_frames_csum_ip); Modified: stable/10/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.h Fri May 29 20:50:41 2015 (r283754) +++ stable/10/sys/dev/bxe/bxe_stats.h Fri May 29 21:30:11 2015 (r283755) @@ -218,6 +218,7 @@ struct bxe_eth_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -318,6 +319,7 @@ struct bxe_eth_q_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -411,6 +413,7 @@ struct bxe_eth_q_stats_old { uint32_t rx_calls_old; uint32_t rx_pkts_old; uint32_t rx_tpa_pkts_old; + uint32_t rx_jumbo_sge_pkts_old; uint32_t rx_soft_errors_old; uint32_t rx_hw_csum_errors_old; uint32_t rx_ofld_frames_csum_ip_old; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 22:27:48 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB6945E7; Fri, 29 May 2015 22:27:48 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C87A21875; Fri, 29 May 2015 22:27:48 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TMRmgW037064; Fri, 29 May 2015 22:27:48 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TMRm1A037063; Fri, 29 May 2015 22:27:48 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292227.t4TMRm1A037063@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 22:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r283756 - stable/9/sys/dev/bxe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 22:27:49 -0000 Author: davidcs Date: Fri May 29 22:27:48 2015 New Revision: 283756 URL: https://svnweb.freebsd.org/changeset/base/283756 Log: MFC r283269 Submitted by: gary.zambrano@qlogic.com Approved by:davidcs@freebsd.org Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Fri May 29 21:30:11 2015 (r283755) +++ stable/9/sys/dev/bxe/bxe.c Fri May 29 22:27:48 2015 (r283756) @@ -3111,7 +3111,7 @@ static inline void bxe_update_sge_prod(struct bxe_softc *sc, struct bxe_fastpath *fp, uint16_t sge_len, - struct eth_end_agg_rx_cqe *cqe) + union eth_sgl_or_raw_data *cqe) { uint16_t last_max, last_elem, first_elem; uint16_t delta = 0; @@ -3124,17 +3124,17 @@ bxe_update_sge_prod(struct bxe_softc /* first mark all used pages */ for (i = 0; i < sge_len; i++) { BIT_VEC64_CLEAR_BIT(fp->sge_mask, - RX_SGE(le16toh(cqe->sgl_or_raw_data.sgl[i]))); + RX_SGE(le16toh(cqe->sgl[i]))); } BLOGD(sc, DBG_LRO, "fp[%02d] fp_cqe->sgl[%d] = %d\n", fp->index, sge_len - 1, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); /* assume that the last SGE index is the biggest */ bxe_update_last_max_sge(fp, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); last_max = RX_SGE(fp->last_max_sge); last_elem = last_max >> BIT_VEC64_ELEM_SHIFT; @@ -3250,6 +3250,53 @@ bxe_tpa_stop_exit: } static uint8_t +bxe_service_rxsgl( + struct bxe_fastpath *fp, + uint16_t len, + uint16_t lenonbd, + struct mbuf *m, + struct eth_fast_path_rx_cqe *cqe_fp) +{ + struct mbuf *m_frag; + uint16_t frags, frag_len; + uint16_t sge_idx = 0; + uint16_t j; + uint8_t i, rc = 0; + uint32_t frag_size; + + /* adjust the mbuf */ + m->m_len = lenonbd; + + frag_size = len - lenonbd; + frags = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; + + for (i = 0, j = 0; i < frags; i += PAGES_PER_SGE, j++) { + sge_idx = RX_SGE(le16toh(cqe_fp->sgl_or_raw_data.sgl[j])); + + m_frag = fp->rx_sge_mbuf_chain[sge_idx].m; + frag_len = min(frag_size, (uint32_t)(SGE_PAGE_SIZE)); + m_frag->m_len = frag_len; + + /* allocate a new mbuf for the SGE */ + rc = bxe_alloc_rx_sge_mbuf(fp, sge_idx); + if (rc) { + /* Leave all remaining SGEs in the ring! */ + return (rc); + } + fp->eth_q_stats.mbuf_alloc_sge--; + + /* concatenate the fragment to the head mbuf */ + m_cat(m, m_frag); + + frag_size -= frag_len; + } + + bxe_update_sge_prod(fp->sc, fp, frags, &cqe_fp->sgl_or_raw_data); + + return rc; +} + +static uint8_t bxe_rxeof(struct bxe_softc *sc, struct bxe_fastpath *fp) { @@ -3289,7 +3336,7 @@ bxe_rxeof(struct bxe_softc *sc, struct eth_fast_path_rx_cqe *cqe_fp; uint8_t cqe_fp_flags; enum eth_rx_cqe_type cqe_fp_type; - uint16_t len, pad; + uint16_t len, lenonbd, pad; struct mbuf *m = NULL; comp_ring_cons = RCQ(sw_cq_cons); @@ -3304,7 +3351,7 @@ bxe_rxeof(struct bxe_softc *sc, BLOGD(sc, DBG_RX, "fp[%02d] Rx hw_cq_cons=%d hw_sw_cons=%d " "BD prod=%d cons=%d CQE type=0x%x err=0x%x " - "status=0x%x rss_hash=0x%x vlan=0x%x len=%u\n", + "status=0x%x rss_hash=0x%x vlan=0x%x len=%u lenonbd=%u\n", fp->index, hw_cq_cons, sw_cq_cons, @@ -3315,7 +3362,8 @@ bxe_rxeof(struct bxe_softc *sc, cqe_fp->status_flags, le32toh(cqe_fp->rss_hash_result), le16toh(cqe_fp->vlan_tag), - le16toh(cqe_fp->pkt_len_or_gro_seg_len)); + le16toh(cqe_fp->pkt_len_or_gro_seg_len), + le16toh(cqe_fp->len_on_bd)); /* is this a slowpath msg? */ if (__predict_false(CQE_TYPE_SLOW(cqe_fp_type))) { @@ -3362,7 +3410,7 @@ bxe_rxeof(struct bxe_softc *sc, bxe_tpa_stop(sc, fp, tpa_info, queue, pages, &cqe->end_agg_cqe, comp_ring_cons); - bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe); + bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe.sgl_or_raw_data); goto next_cqe; } @@ -3378,6 +3426,7 @@ bxe_rxeof(struct bxe_softc *sc, } len = le16toh(cqe_fp->pkt_len_or_gro_seg_len); + lenonbd = le16toh(cqe_fp->len_on_bd); pad = cqe_fp->placement_offset; m = rx_buf->m; @@ -3424,6 +3473,12 @@ bxe_rxeof(struct bxe_softc *sc, m_adj(m, pad); m->m_pkthdr.len = m->m_len = len; + if (len != lenonbd){ + rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); + if (rc) + break; + } + /* assign packet to this interface interface */ m->m_pkthdr.rcvif = ifp; @@ -6226,30 +6281,27 @@ static void bxe_set_fp_rx_buf_size(struct bxe_softc *sc) { int i; + uint32_t rx_buf_size; - BLOGD(sc, DBG_LOAD, "mtu = %d\n", sc->mtu); + rx_buf_size = (IP_HEADER_ALIGNMENT_PADDING + ETH_OVERHEAD + sc->mtu); for (i = 0; i < sc->num_queues; i++) { - /* get the Rx buffer size for RX frames */ - sc->fp[i].rx_buf_size = - (IP_HEADER_ALIGNMENT_PADDING + - ETH_OVERHEAD + - sc->mtu); - - BLOGD(sc, DBG_LOAD, "rx_buf_size for fp[%02d] = %d\n", - i, sc->fp[i].rx_buf_size); - - /* get the mbuf allocation size for RX frames */ - if (sc->fp[i].rx_buf_size <= MCLBYTES) { + if(rx_buf_size <= MCLBYTES){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= MJUMPAGESIZE){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else if (rx_buf_size <= (MJUMPAGESIZE + MCLBYTES)){ + sc->fp[i].rx_buf_size = MCLBYTES; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= (2 * MJUMPAGESIZE)){ + sc->fp[i].rx_buf_size = MJUMPAGESIZE; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else { + sc->fp[i].rx_buf_size = MCLBYTES; sc->fp[i].mbuf_alloc_size = MCLBYTES; - } else if (sc->fp[i].rx_buf_size <= BCM_PAGE_SIZE) { - sc->fp[i].mbuf_alloc_size = PAGE_SIZE; - } else { - sc->fp[i].mbuf_alloc_size = MJUM9BYTES; } - - BLOGD(sc, DBG_LOAD, "mbuf_alloc_size for fp[%02d] = %d\n", - i, sc->fp[i].mbuf_alloc_size); } } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 22:33:08 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6092E803; Fri, 29 May 2015 22:33:08 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 425B31A9C; Fri, 29 May 2015 22:33:08 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TMX8we041703; Fri, 29 May 2015 22:33:08 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TMX77g041700; Fri, 29 May 2015 22:33:07 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292233.t4TMX77g041700@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 22:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r283757 - stable/9/sys/dev/bxe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 22:33:08 -0000 Author: davidcs Date: Fri May 29 22:33:06 2015 New Revision: 283757 URL: https://svnweb.freebsd.org/changeset/base/283757 Log: MFC r283274 Submitted by: gary.zambrano@qlogic.com Approved by:davidcs@freebsd.org Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe_stats.c stable/9/sys/dev/bxe/bxe_stats.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Fri May 29 22:27:48 2015 (r283756) +++ stable/9/sys/dev/bxe/bxe.c Fri May 29 22:33:06 2015 (r283757) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.78" +#define BXE_DRIVER_VERSION "1.78.79" #include "bxe.h" #include "ecore_sp.h" @@ -483,6 +483,8 @@ static const struct { 4, STATS_FLAGS_FUNC, "rx_pkts"}, { STATS_OFFSET32(rx_tpa_pkts), 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"}, + { STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"}, { STATS_OFFSET32(rx_soft_errors), 4, STATS_FLAGS_FUNC, "rx_soft_errors"}, { STATS_OFFSET32(rx_hw_csum_errors), @@ -594,6 +596,8 @@ static const struct { 4, "rx_pkts"}, { Q_STATS_OFFSET32(rx_tpa_pkts), 4, "rx_tpa_pkts"}, + { Q_STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, "rx_jumbo_sge_pkts"}, { Q_STATS_OFFSET32(rx_soft_errors), 4, "rx_soft_errors"}, { Q_STATS_OFFSET32(rx_hw_csum_errors), @@ -3477,6 +3481,7 @@ bxe_rxeof(struct bxe_softc *sc, rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); if (rc) break; + fp->eth_q_stats.rx_jumbo_sge_pkts++; } /* assign packet to this interface interface */ @@ -6860,42 +6865,40 @@ bxe_alloc_fp_buffers(struct bxe_softc *s fp->rx_cq_prod = cqe_ring_prod; fp->eth_q_stats.rx_calls = fp->eth_q_stats.rx_pkts = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - max_agg_queues = MAX_AGG_QS(sc); + max_agg_queues = MAX_AGG_QS(sc); - fp->tpa_enable = TRUE; + fp->tpa_enable = TRUE; - /* fill the TPA pool */ - for (j = 0; j < max_agg_queues; j++) { - rc = bxe_alloc_rx_tpa_mbuf(fp, j); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", + /* fill the TPA pool */ + for (j = 0; j < max_agg_queues; j++) { + rc = bxe_alloc_rx_tpa_mbuf(fp, j); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", i, j); - fp->tpa_enable = FALSE; - goto bxe_alloc_fp_buffers_error; - } - - fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + fp->tpa_enable = FALSE; + goto bxe_alloc_fp_buffers_error; } - if (fp->tpa_enable) { - /* fill the RX SGE chain */ - ring_prod = 0; - for (j = 0; j < RX_SGE_USABLE; j++) { - rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", - i, ring_prod); - fp->tpa_enable = FALSE; - ring_prod = 0; - goto bxe_alloc_fp_buffers_error; - } + fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + } - ring_prod = RX_SGE_NEXT(ring_prod); + if (fp->tpa_enable) { + /* fill the RX SGE chain */ + ring_prod = 0; + for (j = 0; j < RX_SGE_USABLE; j++) { + rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", + i, ring_prod); + fp->tpa_enable = FALSE; + ring_prod = 0; + goto bxe_alloc_fp_buffers_error; } - fp->rx_sge_prod = ring_prod; + ring_prod = RX_SGE_NEXT(ring_prod); } + + fp->rx_sge_prod = ring_prod; } } @@ -11779,28 +11782,26 @@ bxe_pf_rx_q_prep(struct bxe_softc uint16_t sge_sz = 0; uint16_t tpa_agg_size = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - pause->sge_th_lo = SGE_TH_LO(sc); - pause->sge_th_hi = SGE_TH_HI(sc); + pause->sge_th_lo = SGE_TH_LO(sc); + pause->sge_th_hi = SGE_TH_HI(sc); - /* validate SGE ring has enough to cross high threshold */ - if (sc->dropless_fc && + /* validate SGE ring has enough to cross high threshold */ + if (sc->dropless_fc && (pause->sge_th_hi + FW_PREFETCH_CNT) > (RX_SGE_USABLE_PER_PAGE * RX_SGE_NUM_PAGES)) { - BLOGW(sc, "sge ring threshold limit\n"); - } + BLOGW(sc, "sge ring threshold limit\n"); + } - /* minimum max_aggregation_size is 2*MTU (two full buffers) */ - tpa_agg_size = (2 * sc->mtu); - if (tpa_agg_size < sc->max_aggregation_size) { - tpa_agg_size = sc->max_aggregation_size; - } + /* minimum max_aggregation_size is 2*MTU (two full buffers) */ + tpa_agg_size = (2 * sc->mtu); + if (tpa_agg_size < sc->max_aggregation_size) { + tpa_agg_size = sc->max_aggregation_size; + } - max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; - max_sge = ((max_sge + PAGES_PER_SGE - 1) & + max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; + max_sge = ((max_sge + PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> PAGES_PER_SGE_SHIFT; - sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); - } + sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); /* pause - not for e1 */ if (!CHIP_IS_E1(sc)) { Modified: stable/9/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/9/sys/dev/bxe/bxe_stats.c Fri May 29 22:27:48 2015 (r283756) +++ stable/9/sys/dev/bxe/bxe_stats.c Fri May 29 22:33:06 2015 (r283757) @@ -1227,6 +1227,7 @@ bxe_drv_stats_update(struct bxe_softc *s UPDATE_ESTAT_QSTAT(rx_calls); UPDATE_ESTAT_QSTAT(rx_pkts); UPDATE_ESTAT_QSTAT(rx_tpa_pkts); + UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts); UPDATE_ESTAT_QSTAT(rx_soft_errors); UPDATE_ESTAT_QSTAT(rx_hw_csum_errors); UPDATE_ESTAT_QSTAT(rx_ofld_frames_csum_ip); Modified: stable/9/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/9/sys/dev/bxe/bxe_stats.h Fri May 29 22:27:48 2015 (r283756) +++ stable/9/sys/dev/bxe/bxe_stats.h Fri May 29 22:33:06 2015 (r283757) @@ -218,6 +218,7 @@ struct bxe_eth_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -318,6 +319,7 @@ struct bxe_eth_q_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -411,6 +413,7 @@ struct bxe_eth_q_stats_old { uint32_t rx_calls_old; uint32_t rx_pkts_old; uint32_t rx_tpa_pkts_old; + uint32_t rx_jumbo_sge_pkts_old; uint32_t rx_soft_errors_old; uint32_t rx_hw_csum_errors_old; uint32_t rx_ofld_frames_csum_ip_old; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 23:02:14 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9A22CC5; Fri, 29 May 2015 23:02:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9615B116F; Fri, 29 May 2015 23:02:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TN2EnW056674; Fri, 29 May 2015 23:02:14 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TN2DrI056654; Fri, 29 May 2015 23:02:13 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201505292302.t4TN2DrI056654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 29 May 2015 23:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283758 - in stable/10: sbin/ifconfig sys/net sys/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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 23:02:14 -0000 Author: erj Date: Fri May 29 23:02:12 2015 New Revision: 283758 URL: https://svnweb.freebsd.org/changeset/base/283758 Log: MFC r281236 -- extended media types in if_media.h. Approved by: jfv (mentor) Modified: stable/10/sbin/ifconfig/ifmedia.c stable/10/sys/net/ieee8023ad_lacp.c stable/10/sys/net/if.c stable/10/sys/net/if_media.c stable/10/sys/net/if_media.h stable/10/sys/sys/sockio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/10/sbin/ifconfig/ifmedia.c Fri May 29 22:33:06 2015 (r283757) +++ stable/10/sbin/ifconfig/ifmedia.c Fri May 29 23:02:12 2015 (r283758) @@ -109,11 +109,17 @@ media_status(int s) { struct ifmediareq ifmr; int *media_list, i; + int xmedia = 1; (void) memset(&ifmr, 0, sizeof(ifmr)); (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { + /* + * Check if interface supports extended media types. + */ + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) + xmedia = 0; + if (xmedia == 0 && ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { /* * Interface doesn't support SIOC{G,S}IFMEDIA. */ @@ -130,8 +136,13 @@ media_status(int s) err(1, "malloc"); ifmr.ifm_ulist = media_list; - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) - err(1, "SIOCGIFMEDIA"); + if (xmedia) { + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) + err(1, "SIOCGIFXMEDIA"); + } else { + if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) + err(1, "SIOCGIFMEDIA"); + } printf("\tmedia: "); print_media_word(ifmr.ifm_current, 1); @@ -194,6 +205,7 @@ ifmedia_getstate(int s) { static struct ifmediareq *ifmr = NULL; int *mwords; + int xmedia = 1; if (ifmr == NULL) { ifmr = (struct ifmediareq *)malloc(sizeof(struct ifmediareq)); @@ -213,7 +225,10 @@ ifmedia_getstate(int s) * the current media type and the top-level type. */ - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) < 0) { + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) < 0) { + xmedia = 0; + } + if (xmedia == 0 && ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) < 0) { err(1, "SIOCGIFMEDIA"); } @@ -225,8 +240,13 @@ ifmedia_getstate(int s) err(1, "malloc"); ifmr->ifm_ulist = mwords; - if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) < 0) - err(1, "SIOCGIFMEDIA"); + if (xmedia) { + if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)ifmr) < 0) + err(1, "SIOCGIFXMEDIA"); + } else { + if (ioctl(s, SIOCGIFMEDIA, (caddr_t)ifmr) < 0) + err(1, "SIOCGIFMEDIA"); + } } return ifmr; Modified: stable/10/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/10/sys/net/ieee8023ad_lacp.c Fri May 29 22:33:06 2015 (r283757) +++ stable/10/sys/net/ieee8023ad_lacp.c Fri May 29 23:02:12 2015 (r283758) @@ -1114,12 +1114,16 @@ lacp_compose_key(struct lacp_port *lp) case IFM_100_T4: case IFM_100_VG: case IFM_100_T2: + case IFM_100_T: key = IFM_100_TX; break; case IFM_1000_SX: case IFM_1000_LX: case IFM_1000_CX: case IFM_1000_T: + case IFM_1000_KX: + case IFM_1000_SGMII: + case IFM_1000_CX_SGMII: key = IFM_1000_SX; break; case IFM_10G_LR: @@ -1129,15 +1133,53 @@ lacp_compose_key(struct lacp_port *lp) case IFM_10G_TWINAX_LONG: case IFM_10G_LRM: case IFM_10G_T: + case IFM_10G_KX4: + case IFM_10G_KR: + case IFM_10G_CR1: + case IFM_10G_ER: + case IFM_10G_SFI: key = IFM_10G_LR; break; + case IFM_20G_KR2: + key = IFM_20G_KR2; + break; + case IFM_2500_KX: + case IFM_2500_T: + key = IFM_2500_KX; + break; + case IFM_5000_T: + key = IFM_5000_T; + break; + case IFM_50G_PCIE: + case IFM_50G_CR2: + case IFM_50G_KR2: + key = IFM_50G_PCIE; + break; + case IFM_56G_R4: + key = IFM_56G_R4; + break; + case IFM_25G_PCIE: + case IFM_25G_CR: + case IFM_25G_KR: + case IFM_25G_SR: + key = IFM_25G_PCIE; + break; case IFM_40G_CR4: case IFM_40G_SR4: case IFM_40G_LR4: + case IFM_40G_XLPPI: + case IFM_40G_KR4: key = IFM_40G_CR4; break; + case IFM_100G_CR4: + case IFM_100G_SR4: + case IFM_100G_KR4: + case IFM_100G_LR4: + key = IFM_100G_CR4; + break; default: key = subtype; + break; } /* bit 5..14: (some bits of) if_index of lagg device */ key |= 0x7fe0 & ((sc->sc_ifp->if_index) << 5); Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Fri May 29 22:33:06 2015 (r283757) +++ stable/10/sys/net/if.c Fri May 29 23:02:12 2015 (r283758) @@ -2571,6 +2571,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, case SIOCGIFPDSTADDR: case SIOCGLIFPHYADDR: case SIOCGIFMEDIA: + case SIOCGIFXMEDIA: case SIOCGIFGENERIC: if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); Modified: stable/10/sys/net/if_media.c ============================================================================== --- stable/10/sys/net/if_media.c Fri May 29 22:33:06 2015 (r283757) +++ stable/10/sys/net/if_media.c Fri May 29 23:02:12 2015 (r283758) @@ -68,6 +68,7 @@ static struct ifmedia_entry *ifmedia_mat int flags, int mask); #ifdef IFMEDIA_DEBUG +#include int ifmedia_debug = 0; SYSCTL_INT(_debug, OID_AUTO, ifmedia, CTLFLAG_RW, &ifmedia_debug, 0, "if_media debugging msgs"); @@ -193,6 +194,21 @@ ifmedia_set(ifm, target) } /* + * Given a media word, return one suitable for an application + * using the original encoding. + */ +static int +compat_media(int media) +{ + + if (IFM_TYPE(media) == IFM_ETHER && IFM_SUBTYPE(media) > IFM_OTHER) { + media &= ~(IFM_ETH_XTYPE|IFM_TMASK); + media |= IFM_OTHER; + } + return (media); +} + +/* * Device-independent media ioctl support function. */ int @@ -271,6 +287,7 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd) * Get list of available media and current media on interface. */ case SIOCGIFMEDIA: + case SIOCGIFXMEDIA: { struct ifmedia_entry *ep; int *kptr, count; @@ -278,8 +295,13 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd) kptr = NULL; /* XXX gcc */ - ifmr->ifm_active = ifmr->ifm_current = ifm->ifm_cur ? - ifm->ifm_cur->ifm_media : IFM_NONE; + if (cmd == SIOCGIFMEDIA) { + ifmr->ifm_active = ifmr->ifm_current = ifm->ifm_cur ? + compat_media(ifm->ifm_cur->ifm_media) : IFM_NONE; + } else { + ifmr->ifm_active = ifmr->ifm_current = ifm->ifm_cur ? + ifm->ifm_cur->ifm_media : IFM_NONE; + } ifmr->ifm_mask = ifm->ifm_mask; ifmr->ifm_status = 0; (*ifm->ifm_status)(ifp, ifmr); @@ -398,8 +420,7 @@ ifmedia_baudrate(int mword) int i; for (i = 0; ifmedia_baudrate_descriptions[i].ifmb_word != 0; i++) { - if ((mword & (IFM_NMASK|IFM_TMASK)) == - ifmedia_baudrate_descriptions[i].ifmb_word) + if (IFM_TYPE_MATCH(mword, ifmedia_baudrate_descriptions[i].ifmb_word)) return (ifmedia_baudrate_descriptions[i].ifmb_baudrate); } @@ -505,7 +526,7 @@ ifmedia_printword(ifmw) printf("\n"); return; } - printf(desc->ifmt_string); + printf("%s", desc->ifmt_string); /* Any mode. */ for (desc = ttos->modes; desc && desc->ifmt_string != NULL; desc++) Modified: stable/10/sys/net/if_media.h ============================================================================== --- stable/10/sys/net/if_media.h Fri May 29 22:33:06 2015 (r283757) +++ stable/10/sys/net/if_media.h Fri May 29 23:02:12 2015 (r283758) @@ -115,7 +115,7 @@ uint64_t ifmedia_baudrate(int); * ---- ------- * 0-4 Media variant * 5-7 Media type - * 8-15 Type specific options + * 8-15 Type specific options (includes added variant bits on Ethernet) * 16-18 Mode (for multi-mode devices) * 19 RFU * 20-27 Shared (global) options @@ -124,8 +124,18 @@ uint64_t ifmedia_baudrate(int); /* * Ethernet + * In order to use more than 31 subtypes, Ethernet uses some of the option + * bits as part of the subtype field. See the options section below for + * relevant definitions */ #define IFM_ETHER 0x00000020 +#define IFM_ETHER_SUBTYPE(x) (((x) & IFM_TMASK) | \ + (((x) & (IFM_ETH_XTYPE >> IFM_ETH_XSHIFT)) << IFM_ETH_XSHIFT)) +#define IFM_X(x) IFM_ETHER_SUBTYPE(x) /* internal shorthand */ +#define IFM_ETHER_SUBTYPE_SET(x) (IFM_ETHER_SUBTYPE(x) | IFM_ETHER) +#define IFM_ETHER_SUBTYPE_GET(x) ((x) & (IFM_TMASK|IFM_ETH_XTYPE)) +#define IFM_ETHER_IS_EXTENDED(x) ((x) & IFM_ETH_XTYPE) + #define IFM_10_T 3 /* 10BaseT - RJ45 */ #define IFM_10_2 4 /* 10Base2 - Thinnet */ #define IFM_10_5 5 /* 10Base5 - AUI */ @@ -153,15 +163,49 @@ uint64_t ifmedia_baudrate(int); #define IFM_40G_CR4 27 /* 40GBase-CR4 */ #define IFM_40G_SR4 28 /* 40GBase-SR4 */ #define IFM_40G_LR4 29 /* 40GBase-LR4 */ +#define IFM_1000_KX 30 /* 1000Base-KX backplane */ +#define IFM_OTHER 31 /* Other: one of the following */ + +/* following types are not visible to old binaries using only IFM_TMASK */ +#define IFM_10G_KX4 IFM_X(32) /* 10GBase-KX4 backplane */ +#define IFM_10G_KR IFM_X(33) /* 10GBase-KR backplane */ +#define IFM_10G_CR1 IFM_X(34) /* 10GBase-CR1 Twinax splitter */ +#define IFM_20G_KR2 IFM_X(35) /* 20GBase-KR2 backplane */ +#define IFM_2500_KX IFM_X(36) /* 2500Base-KX backplane */ +#define IFM_2500_T IFM_X(37) /* 2500Base-T - RJ45 (NBaseT) */ +#define IFM_5000_T IFM_X(38) /* 5000Base-T - RJ45 (NBaseT) */ +#define IFM_50G_PCIE IFM_X(39) /* 50G Ethernet over PCIE */ +#define IFM_25G_PCIE IFM_X(40) /* 25G Ethernet over PCIE */ +#define IFM_1000_SGMII IFM_X(41) /* 1G media interface */ +#define IFM_10G_SFI IFM_X(42) /* 10G media interface */ +#define IFM_40G_XLPPI IFM_X(43) /* 40G media interface */ +#define IFM_1000_CX_SGMII IFM_X(44) /* 1000Base-CX-SGMII */ +#define IFM_40G_KR4 IFM_X(45) /* 40GBase-KR4 */ +#define IFM_10G_ER IFM_X(46) /* 10GBase-ER */ +#define IFM_100G_CR4 IFM_X(47) /* 100GBase-CR4 */ +#define IFM_100G_SR4 IFM_X(48) /* 100GBase-SR4 */ +#define IFM_100G_KR4 IFM_X(49) /* 100GBase-KR4 */ +#define IFM_100G_LR4 IFM_X(50) /* 100GBase-LR4 */ +#define IFM_56G_R4 IFM_X(51) /* 56GBase-R4 */ +#define IFM_100_T IFM_X(52) /* 100BaseT - RJ45 */ +#define IFM_25G_CR IFM_X(53) /* 25GBase-CR */ +#define IFM_25G_KR IFM_X(54) /* 25GBase-KR */ +#define IFM_25G_SR IFM_X(55) /* 25GBase-SR */ +#define IFM_50G_CR2 IFM_X(56) /* 50GBase-CR2 */ +#define IFM_50G_KR2 IFM_X(57) /* 50GBase-KR2 */ + /* * Please update ieee8023ad_lacp.c:lacp_compose_key() * after adding new Ethernet media types. */ -/* note 31 is the max! */ +/* Note IFM_X(511) is the max! */ +/* Ethernet option values; includes bits used for extended variant field */ #define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseT) */ #define IFM_ETH_RXPAUSE 0x00000200 /* receive PAUSE frames */ #define IFM_ETH_TXPAUSE 0x00000400 /* transmit PAUSE frames */ +#define IFM_ETH_XTYPE 0x00007800 /* extended media variants */ +#define IFM_ETH_XSHIFT 6 /* shift XTYPE next to TMASK */ /* * Token ring @@ -304,7 +348,10 @@ uint64_t ifmedia_baudrate(int); * Macros to extract various bits of information from the media word. */ #define IFM_TYPE(x) ((x) & IFM_NMASK) -#define IFM_SUBTYPE(x) ((x) & IFM_TMASK) +#define IFM_SUBTYPE(x) \ + (IFM_TYPE(x) == IFM_ETHER ? IFM_ETHER_SUBTYPE_GET(x) : ((x) & IFM_TMASK)) +#define IFM_TYPE_MATCH(x,y) \ + (IFM_TYPE(x) == IFM_TYPE(y) && IFM_SUBTYPE(x) == IFM_SUBTYPE(y)) #define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK) #define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) #define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK)) @@ -369,6 +416,34 @@ struct ifmedia_description { { IFM_40G_CR4, "40Gbase-CR4" }, \ { IFM_40G_SR4, "40Gbase-SR4" }, \ { IFM_40G_LR4, "40Gbase-LR4" }, \ + { IFM_1000_KX, "1000Base-KX" }, \ + { IFM_OTHER, "Other" }, \ + { IFM_10G_KX4, "10GBase-KX4" }, \ + { IFM_10G_KR, "10GBase-KR" }, \ + { IFM_10G_CR1, "10GBase-CR1" }, \ + { IFM_20G_KR2, "20GBase-KR2" }, \ + { IFM_2500_KX, "2500Base-KX" }, \ + { IFM_2500_T, "2500Base-T" }, \ + { IFM_5000_T, "5000Base-T" }, \ + { IFM_50G_PCIE, "PCIExpress-50G" }, \ + { IFM_25G_PCIE, "PCIExpress-25G" }, \ + { IFM_1000_SGMII, "1000Base-SGMII" }, \ + { IFM_10G_SFI, "10GBase-SFI" }, \ + { IFM_40G_XLPPI, "40GBase-XLPPI" }, \ + { IFM_1000_CX_SGMII, "1000Base-CX-SGMII" }, \ + { IFM_40G_KR4, "40GBase-KR4" }, \ + { IFM_10G_ER, "10GBase-ER" }, \ + { IFM_100G_CR4, "100GBase-CR4" }, \ + { IFM_100G_SR4, "100GBase-SR4" }, \ + { IFM_100G_KR4, "100GBase-KR4" }, \ + { IFM_100G_LR4, "100GBase-LR4" }, \ + { IFM_56G_R4, "56GBase-R4" }, \ + { IFM_100_T, "100BaseT" }, \ + { IFM_25G_CR, "25GBase-CR" }, \ + { IFM_25G_KR, "25GBase-KR" }, \ + { IFM_25G_SR, "25GBase-SR" }, \ + { IFM_50G_CR2, "50GBase-CR2" }, \ + { IFM_50G_KR2, "50GBase-KR2" }, \ { 0, NULL }, \ } @@ -670,6 +745,33 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_40G_CR4, IF_Gbps(40ULL) }, \ { IFM_ETHER | IFM_40G_SR4, IF_Gbps(40ULL) }, \ { IFM_ETHER | IFM_40G_LR4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_1000_KX, IF_Mbps(1000) }, \ + { IFM_ETHER | IFM_10G_KX4, IF_Gbps(10ULL) }, \ + { IFM_ETHER | IFM_10G_KR, IF_Gbps(10ULL) }, \ + { IFM_ETHER | IFM_10G_CR1, IF_Gbps(10ULL) }, \ + { IFM_ETHER | IFM_20G_KR2, IF_Gbps(20ULL) }, \ + { IFM_ETHER | IFM_2500_KX, IF_Mbps(2500) }, \ + { IFM_ETHER | IFM_2500_T, IF_Mbps(2500) }, \ + { IFM_ETHER | IFM_5000_T, IF_Mbps(5000) }, \ + { IFM_ETHER | IFM_50G_PCIE, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_25G_PCIE, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_1000_SGMII, IF_Mbps(1000) }, \ + { IFM_ETHER | IFM_10G_SFI, IF_Gbps(10ULL) }, \ + { IFM_ETHER | IFM_40G_XLPPI, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_1000_CX_SGMII, IF_Mbps(1000) }, \ + { IFM_ETHER | IFM_40G_KR4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_10G_ER, IF_Gbps(10ULL) }, \ + { IFM_ETHER | IFM_100G_CR4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_SR4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_KR4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_LR4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_56G_R4, IF_Gbps(56ULL) }, \ + { IFM_ETHER | IFM_100_T, IF_Mbps(100ULL) }, \ + { IFM_ETHER | IFM_25G_CR, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_25G_KR, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_25G_SR, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_50G_CR2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_KR2, IF_Gbps(50ULL) }, \ \ { IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_STP16, IF_Mbps(16) }, \ Modified: stable/10/sys/sys/sockio.h ============================================================================== --- stable/10/sys/sys/sockio.h Fri May 29 22:33:06 2015 (r283757) +++ stable/10/sys/sys/sockio.h Fri May 29 23:02:12 2015 (r283758) @@ -127,5 +127,6 @@ #define SIOCGIFGROUP _IOWR('i', 136, struct ifgroupreq) /* get ifgroups */ #define SIOCDIFGROUP _IOW('i', 137, struct ifgroupreq) /* delete ifgroup */ #define SIOCGIFGMEMB _IOWR('i', 138, struct ifgroupreq) /* get members */ +#define SIOCGIFXMEDIA _IOWR('i', 139, struct ifmediareq) /* get net xmedia */ #endif /* !_SYS_SOCKIO_H_ */ From owner-svn-src-stable@FreeBSD.ORG Fri May 29 23:28:56 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42F9D186; Fri, 29 May 2015 23:28:56 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD2D1676; Fri, 29 May 2015 23:28:56 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TNSuXj067478; Fri, 29 May 2015 23:28:56 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TNSuQ2067477; Fri, 29 May 2015 23:28:56 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292328.t4TNSuQ2067477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 23:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r283759 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 23:28:56 -0000 Author: davidcs Date: Fri May 29 23:28:55 2015 New Revision: 283759 URL: https://svnweb.freebsd.org/changeset/base/283759 Log: MFC r283269 Submitted by: gary.zambrano@qlogic.com Approved by:davidcs@freebsd.org Modified: stable/8/sys/dev/bxe/bxe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Fri May 29 23:02:12 2015 (r283758) +++ stable/8/sys/dev/bxe/bxe.c Fri May 29 23:28:55 2015 (r283759) @@ -3111,7 +3111,7 @@ static inline void bxe_update_sge_prod(struct bxe_softc *sc, struct bxe_fastpath *fp, uint16_t sge_len, - struct eth_end_agg_rx_cqe *cqe) + union eth_sgl_or_raw_data *cqe) { uint16_t last_max, last_elem, first_elem; uint16_t delta = 0; @@ -3124,17 +3124,17 @@ bxe_update_sge_prod(struct bxe_softc /* first mark all used pages */ for (i = 0; i < sge_len; i++) { BIT_VEC64_CLEAR_BIT(fp->sge_mask, - RX_SGE(le16toh(cqe->sgl_or_raw_data.sgl[i]))); + RX_SGE(le16toh(cqe->sgl[i]))); } BLOGD(sc, DBG_LRO, "fp[%02d] fp_cqe->sgl[%d] = %d\n", fp->index, sge_len - 1, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); /* assume that the last SGE index is the biggest */ bxe_update_last_max_sge(fp, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); last_max = RX_SGE(fp->last_max_sge); last_elem = last_max >> BIT_VEC64_ELEM_SHIFT; @@ -3250,6 +3250,53 @@ bxe_tpa_stop_exit: } static uint8_t +bxe_service_rxsgl( + struct bxe_fastpath *fp, + uint16_t len, + uint16_t lenonbd, + struct mbuf *m, + struct eth_fast_path_rx_cqe *cqe_fp) +{ + struct mbuf *m_frag; + uint16_t frags, frag_len; + uint16_t sge_idx = 0; + uint16_t j; + uint8_t i, rc = 0; + uint32_t frag_size; + + /* adjust the mbuf */ + m->m_len = lenonbd; + + frag_size = len - lenonbd; + frags = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; + + for (i = 0, j = 0; i < frags; i += PAGES_PER_SGE, j++) { + sge_idx = RX_SGE(le16toh(cqe_fp->sgl_or_raw_data.sgl[j])); + + m_frag = fp->rx_sge_mbuf_chain[sge_idx].m; + frag_len = min(frag_size, (uint32_t)(SGE_PAGE_SIZE)); + m_frag->m_len = frag_len; + + /* allocate a new mbuf for the SGE */ + rc = bxe_alloc_rx_sge_mbuf(fp, sge_idx); + if (rc) { + /* Leave all remaining SGEs in the ring! */ + return (rc); + } + fp->eth_q_stats.mbuf_alloc_sge--; + + /* concatenate the fragment to the head mbuf */ + m_cat(m, m_frag); + + frag_size -= frag_len; + } + + bxe_update_sge_prod(fp->sc, fp, frags, &cqe_fp->sgl_or_raw_data); + + return rc; +} + +static uint8_t bxe_rxeof(struct bxe_softc *sc, struct bxe_fastpath *fp) { @@ -3289,7 +3336,7 @@ bxe_rxeof(struct bxe_softc *sc, struct eth_fast_path_rx_cqe *cqe_fp; uint8_t cqe_fp_flags; enum eth_rx_cqe_type cqe_fp_type; - uint16_t len, pad; + uint16_t len, lenonbd, pad; struct mbuf *m = NULL; comp_ring_cons = RCQ(sw_cq_cons); @@ -3304,7 +3351,7 @@ bxe_rxeof(struct bxe_softc *sc, BLOGD(sc, DBG_RX, "fp[%02d] Rx hw_cq_cons=%d hw_sw_cons=%d " "BD prod=%d cons=%d CQE type=0x%x err=0x%x " - "status=0x%x rss_hash=0x%x vlan=0x%x len=%u\n", + "status=0x%x rss_hash=0x%x vlan=0x%x len=%u lenonbd=%u\n", fp->index, hw_cq_cons, sw_cq_cons, @@ -3315,7 +3362,8 @@ bxe_rxeof(struct bxe_softc *sc, cqe_fp->status_flags, le32toh(cqe_fp->rss_hash_result), le16toh(cqe_fp->vlan_tag), - le16toh(cqe_fp->pkt_len_or_gro_seg_len)); + le16toh(cqe_fp->pkt_len_or_gro_seg_len), + le16toh(cqe_fp->len_on_bd)); /* is this a slowpath msg? */ if (__predict_false(CQE_TYPE_SLOW(cqe_fp_type))) { @@ -3362,7 +3410,7 @@ bxe_rxeof(struct bxe_softc *sc, bxe_tpa_stop(sc, fp, tpa_info, queue, pages, &cqe->end_agg_cqe, comp_ring_cons); - bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe); + bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe.sgl_or_raw_data); goto next_cqe; } @@ -3378,6 +3426,7 @@ bxe_rxeof(struct bxe_softc *sc, } len = le16toh(cqe_fp->pkt_len_or_gro_seg_len); + lenonbd = le16toh(cqe_fp->len_on_bd); pad = cqe_fp->placement_offset; m = rx_buf->m; @@ -3424,6 +3473,12 @@ bxe_rxeof(struct bxe_softc *sc, m_adj(m, pad); m->m_pkthdr.len = m->m_len = len; + if (len != lenonbd){ + rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); + if (rc) + break; + } + /* assign packet to this interface interface */ m->m_pkthdr.rcvif = ifp; @@ -6226,30 +6281,27 @@ static void bxe_set_fp_rx_buf_size(struct bxe_softc *sc) { int i; + uint32_t rx_buf_size; - BLOGD(sc, DBG_LOAD, "mtu = %d\n", sc->mtu); + rx_buf_size = (IP_HEADER_ALIGNMENT_PADDING + ETH_OVERHEAD + sc->mtu); for (i = 0; i < sc->num_queues; i++) { - /* get the Rx buffer size for RX frames */ - sc->fp[i].rx_buf_size = - (IP_HEADER_ALIGNMENT_PADDING + - ETH_OVERHEAD + - sc->mtu); - - BLOGD(sc, DBG_LOAD, "rx_buf_size for fp[%02d] = %d\n", - i, sc->fp[i].rx_buf_size); - - /* get the mbuf allocation size for RX frames */ - if (sc->fp[i].rx_buf_size <= MCLBYTES) { + if(rx_buf_size <= MCLBYTES){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= MJUMPAGESIZE){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else if (rx_buf_size <= (MJUMPAGESIZE + MCLBYTES)){ + sc->fp[i].rx_buf_size = MCLBYTES; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= (2 * MJUMPAGESIZE)){ + sc->fp[i].rx_buf_size = MJUMPAGESIZE; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else { + sc->fp[i].rx_buf_size = MCLBYTES; sc->fp[i].mbuf_alloc_size = MCLBYTES; - } else if (sc->fp[i].rx_buf_size <= BCM_PAGE_SIZE) { - sc->fp[i].mbuf_alloc_size = PAGE_SIZE; - } else { - sc->fp[i].mbuf_alloc_size = MJUM9BYTES; } - - BLOGD(sc, DBG_LOAD, "mbuf_alloc_size for fp[%02d] = %d\n", - i, sc->fp[i].mbuf_alloc_size); } } From owner-svn-src-stable@FreeBSD.ORG Fri May 29 23:33:50 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E34140C; Fri, 29 May 2015 23:33:50 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F66B1891; Fri, 29 May 2015 23:33:50 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TNXoEU071844; Fri, 29 May 2015 23:33:50 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TNXnOR071840; Fri, 29 May 2015 23:33:49 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292333.t4TNXnOR071840@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 23:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r283760 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 23:33:50 -0000 Author: davidcs Date: Fri May 29 23:33:49 2015 New Revision: 283760 URL: https://svnweb.freebsd.org/changeset/base/283760 Log: MFC r283274 Submitted by:gary.zambrano@qlogic.com Modified: stable/8/sys/dev/bxe/bxe.c stable/8/sys/dev/bxe/bxe_stats.c stable/8/sys/dev/bxe/bxe_stats.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Fri May 29 23:28:55 2015 (r283759) +++ stable/8/sys/dev/bxe/bxe.c Fri May 29 23:33:49 2015 (r283760) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.78" +#define BXE_DRIVER_VERSION "1.78.79" #include "bxe.h" #include "ecore_sp.h" @@ -483,6 +483,8 @@ static const struct { 4, STATS_FLAGS_FUNC, "rx_pkts"}, { STATS_OFFSET32(rx_tpa_pkts), 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"}, + { STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"}, { STATS_OFFSET32(rx_soft_errors), 4, STATS_FLAGS_FUNC, "rx_soft_errors"}, { STATS_OFFSET32(rx_hw_csum_errors), @@ -594,6 +596,8 @@ static const struct { 4, "rx_pkts"}, { Q_STATS_OFFSET32(rx_tpa_pkts), 4, "rx_tpa_pkts"}, + { Q_STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, "rx_jumbo_sge_pkts"}, { Q_STATS_OFFSET32(rx_soft_errors), 4, "rx_soft_errors"}, { Q_STATS_OFFSET32(rx_hw_csum_errors), @@ -3477,6 +3481,7 @@ bxe_rxeof(struct bxe_softc *sc, rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); if (rc) break; + fp->eth_q_stats.rx_jumbo_sge_pkts++; } /* assign packet to this interface interface */ @@ -6860,42 +6865,40 @@ bxe_alloc_fp_buffers(struct bxe_softc *s fp->rx_cq_prod = cqe_ring_prod; fp->eth_q_stats.rx_calls = fp->eth_q_stats.rx_pkts = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - max_agg_queues = MAX_AGG_QS(sc); + max_agg_queues = MAX_AGG_QS(sc); - fp->tpa_enable = TRUE; + fp->tpa_enable = TRUE; - /* fill the TPA pool */ - for (j = 0; j < max_agg_queues; j++) { - rc = bxe_alloc_rx_tpa_mbuf(fp, j); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", + /* fill the TPA pool */ + for (j = 0; j < max_agg_queues; j++) { + rc = bxe_alloc_rx_tpa_mbuf(fp, j); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", i, j); - fp->tpa_enable = FALSE; - goto bxe_alloc_fp_buffers_error; - } - - fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + fp->tpa_enable = FALSE; + goto bxe_alloc_fp_buffers_error; } - if (fp->tpa_enable) { - /* fill the RX SGE chain */ - ring_prod = 0; - for (j = 0; j < RX_SGE_USABLE; j++) { - rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", - i, ring_prod); - fp->tpa_enable = FALSE; - ring_prod = 0; - goto bxe_alloc_fp_buffers_error; - } + fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + } - ring_prod = RX_SGE_NEXT(ring_prod); + if (fp->tpa_enable) { + /* fill the RX SGE chain */ + ring_prod = 0; + for (j = 0; j < RX_SGE_USABLE; j++) { + rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", + i, ring_prod); + fp->tpa_enable = FALSE; + ring_prod = 0; + goto bxe_alloc_fp_buffers_error; } - fp->rx_sge_prod = ring_prod; + ring_prod = RX_SGE_NEXT(ring_prod); } + + fp->rx_sge_prod = ring_prod; } } @@ -11779,28 +11782,26 @@ bxe_pf_rx_q_prep(struct bxe_softc uint16_t sge_sz = 0; uint16_t tpa_agg_size = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - pause->sge_th_lo = SGE_TH_LO(sc); - pause->sge_th_hi = SGE_TH_HI(sc); + pause->sge_th_lo = SGE_TH_LO(sc); + pause->sge_th_hi = SGE_TH_HI(sc); - /* validate SGE ring has enough to cross high threshold */ - if (sc->dropless_fc && + /* validate SGE ring has enough to cross high threshold */ + if (sc->dropless_fc && (pause->sge_th_hi + FW_PREFETCH_CNT) > (RX_SGE_USABLE_PER_PAGE * RX_SGE_NUM_PAGES)) { - BLOGW(sc, "sge ring threshold limit\n"); - } + BLOGW(sc, "sge ring threshold limit\n"); + } - /* minimum max_aggregation_size is 2*MTU (two full buffers) */ - tpa_agg_size = (2 * sc->mtu); - if (tpa_agg_size < sc->max_aggregation_size) { - tpa_agg_size = sc->max_aggregation_size; - } + /* minimum max_aggregation_size is 2*MTU (two full buffers) */ + tpa_agg_size = (2 * sc->mtu); + if (tpa_agg_size < sc->max_aggregation_size) { + tpa_agg_size = sc->max_aggregation_size; + } - max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; - max_sge = ((max_sge + PAGES_PER_SGE - 1) & + max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; + max_sge = ((max_sge + PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> PAGES_PER_SGE_SHIFT; - sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); - } + sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); /* pause - not for e1 */ if (!CHIP_IS_E1(sc)) { Modified: stable/8/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/8/sys/dev/bxe/bxe_stats.c Fri May 29 23:28:55 2015 (r283759) +++ stable/8/sys/dev/bxe/bxe_stats.c Fri May 29 23:33:49 2015 (r283760) @@ -1227,6 +1227,7 @@ bxe_drv_stats_update(struct bxe_softc *s UPDATE_ESTAT_QSTAT(rx_calls); UPDATE_ESTAT_QSTAT(rx_pkts); UPDATE_ESTAT_QSTAT(rx_tpa_pkts); + UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts); UPDATE_ESTAT_QSTAT(rx_soft_errors); UPDATE_ESTAT_QSTAT(rx_hw_csum_errors); UPDATE_ESTAT_QSTAT(rx_ofld_frames_csum_ip); Modified: stable/8/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/8/sys/dev/bxe/bxe_stats.h Fri May 29 23:28:55 2015 (r283759) +++ stable/8/sys/dev/bxe/bxe_stats.h Fri May 29 23:33:49 2015 (r283760) @@ -218,6 +218,7 @@ struct bxe_eth_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -318,6 +319,7 @@ struct bxe_eth_q_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -411,6 +413,7 @@ struct bxe_eth_q_stats_old { uint32_t rx_calls_old; uint32_t rx_pkts_old; uint32_t rx_tpa_pkts_old; + uint32_t rx_jumbo_sge_pkts_old; uint32_t rx_soft_errors_old; uint32_t rx_hw_csum_errors_old; uint32_t rx_ofld_frames_csum_ip_old; From owner-svn-src-stable@FreeBSD.ORG Fri May 29 23:37:28 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D53F607; Fri, 29 May 2015 23:37:28 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A00018BC; Fri, 29 May 2015 23:37:28 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4TNbSiw072420; Fri, 29 May 2015 23:37:28 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4TNbS8p072419; Fri, 29 May 2015 23:37:28 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505292337.t4TNbS8p072419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Fri, 29 May 2015 23:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r283761 - stable/7/sys/dev/bxe X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 23:37:28 -0000 Author: davidcs Date: Fri May 29 23:37:27 2015 New Revision: 283761 URL: https://svnweb.freebsd.org/changeset/base/283761 Log: MFC r283269 Submitted by: gary.zambrano@qlogic.com Modified: stable/7/sys/dev/bxe/bxe.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe.c ============================================================================== --- stable/7/sys/dev/bxe/bxe.c Fri May 29 23:33:49 2015 (r283760) +++ stable/7/sys/dev/bxe/bxe.c Fri May 29 23:37:27 2015 (r283761) @@ -3111,7 +3111,7 @@ static inline void bxe_update_sge_prod(struct bxe_softc *sc, struct bxe_fastpath *fp, uint16_t sge_len, - struct eth_end_agg_rx_cqe *cqe) + union eth_sgl_or_raw_data *cqe) { uint16_t last_max, last_elem, first_elem; uint16_t delta = 0; @@ -3124,17 +3124,17 @@ bxe_update_sge_prod(struct bxe_softc /* first mark all used pages */ for (i = 0; i < sge_len; i++) { BIT_VEC64_CLEAR_BIT(fp->sge_mask, - RX_SGE(le16toh(cqe->sgl_or_raw_data.sgl[i]))); + RX_SGE(le16toh(cqe->sgl[i]))); } BLOGD(sc, DBG_LRO, "fp[%02d] fp_cqe->sgl[%d] = %d\n", fp->index, sge_len - 1, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); /* assume that the last SGE index is the biggest */ bxe_update_last_max_sge(fp, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); last_max = RX_SGE(fp->last_max_sge); last_elem = last_max >> BIT_VEC64_ELEM_SHIFT; @@ -3250,6 +3250,53 @@ bxe_tpa_stop_exit: } static uint8_t +bxe_service_rxsgl( + struct bxe_fastpath *fp, + uint16_t len, + uint16_t lenonbd, + struct mbuf *m, + struct eth_fast_path_rx_cqe *cqe_fp) +{ + struct mbuf *m_frag; + uint16_t frags, frag_len; + uint16_t sge_idx = 0; + uint16_t j; + uint8_t i, rc = 0; + uint32_t frag_size; + + /* adjust the mbuf */ + m->m_len = lenonbd; + + frag_size = len - lenonbd; + frags = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; + + for (i = 0, j = 0; i < frags; i += PAGES_PER_SGE, j++) { + sge_idx = RX_SGE(le16toh(cqe_fp->sgl_or_raw_data.sgl[j])); + + m_frag = fp->rx_sge_mbuf_chain[sge_idx].m; + frag_len = min(frag_size, (uint32_t)(SGE_PAGE_SIZE)); + m_frag->m_len = frag_len; + + /* allocate a new mbuf for the SGE */ + rc = bxe_alloc_rx_sge_mbuf(fp, sge_idx); + if (rc) { + /* Leave all remaining SGEs in the ring! */ + return (rc); + } + fp->eth_q_stats.mbuf_alloc_sge--; + + /* concatenate the fragment to the head mbuf */ + m_cat(m, m_frag); + + frag_size -= frag_len; + } + + bxe_update_sge_prod(fp->sc, fp, frags, &cqe_fp->sgl_or_raw_data); + + return rc; +} + +static uint8_t bxe_rxeof(struct bxe_softc *sc, struct bxe_fastpath *fp) { @@ -3289,7 +3336,7 @@ bxe_rxeof(struct bxe_softc *sc, struct eth_fast_path_rx_cqe *cqe_fp; uint8_t cqe_fp_flags; enum eth_rx_cqe_type cqe_fp_type; - uint16_t len, pad; + uint16_t len, lenonbd, pad; struct mbuf *m = NULL; comp_ring_cons = RCQ(sw_cq_cons); @@ -3304,7 +3351,7 @@ bxe_rxeof(struct bxe_softc *sc, BLOGD(sc, DBG_RX, "fp[%02d] Rx hw_cq_cons=%d hw_sw_cons=%d " "BD prod=%d cons=%d CQE type=0x%x err=0x%x " - "status=0x%x rss_hash=0x%x vlan=0x%x len=%u\n", + "status=0x%x rss_hash=0x%x vlan=0x%x len=%u lenonbd=%u\n", fp->index, hw_cq_cons, sw_cq_cons, @@ -3315,7 +3362,8 @@ bxe_rxeof(struct bxe_softc *sc, cqe_fp->status_flags, le32toh(cqe_fp->rss_hash_result), le16toh(cqe_fp->vlan_tag), - le16toh(cqe_fp->pkt_len_or_gro_seg_len)); + le16toh(cqe_fp->pkt_len_or_gro_seg_len), + le16toh(cqe_fp->len_on_bd)); /* is this a slowpath msg? */ if (__predict_false(CQE_TYPE_SLOW(cqe_fp_type))) { @@ -3362,7 +3410,7 @@ bxe_rxeof(struct bxe_softc *sc, bxe_tpa_stop(sc, fp, tpa_info, queue, pages, &cqe->end_agg_cqe, comp_ring_cons); - bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe); + bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe.sgl_or_raw_data); goto next_cqe; } @@ -3378,6 +3426,7 @@ bxe_rxeof(struct bxe_softc *sc, } len = le16toh(cqe_fp->pkt_len_or_gro_seg_len); + lenonbd = le16toh(cqe_fp->len_on_bd); pad = cqe_fp->placement_offset; m = rx_buf->m; @@ -3424,6 +3473,12 @@ bxe_rxeof(struct bxe_softc *sc, m_adj(m, pad); m->m_pkthdr.len = m->m_len = len; + if (len != lenonbd){ + rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); + if (rc) + break; + } + /* assign packet to this interface interface */ m->m_pkthdr.rcvif = ifp; @@ -6228,30 +6283,27 @@ static void bxe_set_fp_rx_buf_size(struct bxe_softc *sc) { int i; + uint32_t rx_buf_size; - BLOGD(sc, DBG_LOAD, "mtu = %d\n", sc->mtu); + rx_buf_size = (IP_HEADER_ALIGNMENT_PADDING + ETH_OVERHEAD + sc->mtu); for (i = 0; i < sc->num_queues; i++) { - /* get the Rx buffer size for RX frames */ - sc->fp[i].rx_buf_size = - (IP_HEADER_ALIGNMENT_PADDING + - ETH_OVERHEAD + - sc->mtu); - - BLOGD(sc, DBG_LOAD, "rx_buf_size for fp[%02d] = %d\n", - i, sc->fp[i].rx_buf_size); - - /* get the mbuf allocation size for RX frames */ - if (sc->fp[i].rx_buf_size <= MCLBYTES) { + if(rx_buf_size <= MCLBYTES){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= MJUMPAGESIZE){ + sc->fp[i].rx_buf_size = rx_buf_size; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else if (rx_buf_size <= (MJUMPAGESIZE + MCLBYTES)){ + sc->fp[i].rx_buf_size = MCLBYTES; + sc->fp[i].mbuf_alloc_size = MCLBYTES; + }else if (rx_buf_size <= (2 * MJUMPAGESIZE)){ + sc->fp[i].rx_buf_size = MJUMPAGESIZE; + sc->fp[i].mbuf_alloc_size = MJUMPAGESIZE; + }else { + sc->fp[i].rx_buf_size = MCLBYTES; sc->fp[i].mbuf_alloc_size = MCLBYTES; - } else if (sc->fp[i].rx_buf_size <= BCM_PAGE_SIZE) { - sc->fp[i].mbuf_alloc_size = PAGE_SIZE; - } else { - sc->fp[i].mbuf_alloc_size = MJUM9BYTES; } - - BLOGD(sc, DBG_LOAD, "mbuf_alloc_size for fp[%02d] = %d\n", - i, sc->fp[i].mbuf_alloc_size); } } From owner-svn-src-stable@FreeBSD.ORG Sat May 30 01:04:46 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42DDE3AE; Sat, 30 May 2015 01:04:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 300581E22; Sat, 30 May 2015 01:04:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4U14kmv019396; Sat, 30 May 2015 01:04:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4U14kHi019395; Sat, 30 May 2015 01:04:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201505300104.t4U14kHi019395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 30 May 2015 01:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283762 - stable/10/usr.sbin/mountd 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 01:04:46 -0000 Author: rmacklem Date: Sat May 30 01:04:45 2015 New Revision: 283762 URL: https://svnweb.freebsd.org/changeset/base/283762 Log: MFC: r283008 Add a warning message to mountd for exported file systems that are automounted, since that configuration isn't supported. This still allows the export, since two emails I received felt that this should not be disabled. It sends the message to syslog(LOG_ERR..), so that it goes to the same places as the other messages related to /etc/exports problems, even though it is a warning and not an error. Modified: stable/10/usr.sbin/mountd/mountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mountd/mountd.c ============================================================================== --- stable/10/usr.sbin/mountd/mountd.c Fri May 29 23:37:27 2015 (r283761) +++ stable/10/usr.sbin/mountd/mountd.c Sat May 30 01:04:45 2015 (r283762) @@ -1424,6 +1424,9 @@ get_exportlist_one(void) } if (check_dirpath(cp) && statfs(cp, &fsb) >= 0) { + if ((fsb.f_flags & MNT_AUTOMOUNTED) != 0) + syslog(LOG_ERR, "Warning: exporting of " + "automounted fs %s not supported", cp); if (got_nondir) { syslog(LOG_ERR, "dirs must be first"); getexp_err(ep, tgrp); From owner-svn-src-stable@FreeBSD.ORG Sat May 30 04:15:10 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59326899; Sat, 30 May 2015 04:15:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x236.google.com (mail-qk0-x236.google.com [IPv6:2607:f8b0:400d:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1477718AF; Sat, 30 May 2015 04:15:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkhq76 with SMTP id q76so27330995qkh.2; Fri, 29 May 2015 21:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mOlimapsK0GV6DRg2N/VfDwIYQQiVods9dEZi5OLkEk=; b=oAjffUVn5oU5Xx+6RTbS2nvicQas2ZtOUWWUdLBsEhEn39Ydxzrik4OUDeBlPiOy+F rEFaY1UFTIQshWpiBHd4e2Ns/fS+fJNso/g2l6HywH7S0uyd2V6m/xYsuVQ28Fn1Jh+D QmmFGyIJwk9HkAoJxe+/vitSTqNgGG9l+ROtPGy5iptR/ORteXKU5kqnDIV0oGheZQJv +6l1zil4bBBFbmyTA7yeUYXAdIZFDX5eFj/n4OqW9TgyFo2Agc3ZmzAnvcy+vGogj0U8 NsjyozEUfDRTnRl6sILwMq/w+bhdVQGg/Q6gCcfnPUNHH2gS/1tPX1EgoQbIfUxYk9+v 79ow== MIME-Version: 1.0 X-Received: by 10.140.90.99 with SMTP id w90mr13106907qgd.57.1432959308932; Fri, 29 May 2015 21:15:08 -0700 (PDT) Received: by 10.140.98.73 with HTTP; Fri, 29 May 2015 21:15:08 -0700 (PDT) In-Reply-To: References: <201505271744.t4RHiC04024525@svn.freebsd.org> <16669147.Y9s9XdOlga@ralph.baldwin.cx> Date: Fri, 29 May 2015 21:15:08 -0700 Message-ID: Subject: Re: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv From: NGie Cooper To: John Baldwin Cc: Eric Joyner , Jack F Vogel , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 04:15:10 -0000 On Wed, May 27, 2015 at 12:30 PM, NGie Cooper wrote: > On Wed, May 27, 2015 at 12:09 PM, John Baldwin wrote: >> On Wednesday, May 27, 2015 05:44:12 PM Eric Joyner wrote: >>> Author: erj >>> Date: Wed May 27 17:44:11 2015 >>> New Revision: 283620 >>> URL: https://svnweb.freebsd.org/changeset/base/283620 >>> >>> Log: >>> MFC ixgbe commits for 10.2: >>> >>> - r280182 - Split the driver into independent pf/vf loadables >>> - r280197 - Resolve build issues >>> - r280204 - Fix multiple same-name devclasses >>> - r280228 - Fix i386 LINT build issues / remove unused variable >>> - r280252 - Fix building ixgbe with gcc >>> - r280962 - Make changes to busdma code similar to r257541 >>> - r281772 & r281773 - Remove unused variable >>> - partial r282280 - stats counter update (ix-only) >>> - r282289 - Add X550 support >>> - r282290 - Add X550 makefile updates >>> - r282293 - Add ixgbe_x550.c to conf/files >>> - r282299 - Fix gcc compile (extraneous extern declaration) >>> >>> Finally, add ix_txrx.c to conf/files because it's required for compile in stable/10. >>> >>> Approved by: jfv (mentor) >> >> It would be better to not break existing kernel configs for 10. You could >> hack the lines in sys/conf/files to allow either 'device ix' or 'device ixgbe' >> to work by using 'optional ixgbe ix', etc. You wouldn't need to document it >> in NOTES and you could leave your existing changes in GENERIC, but this would >> avoid surprises for folks who were using custom kernel configs. >> >> Similarly, you probably want to allow 'kldload ixgbe' or 'ixgbe_load="YES"' >> in loader.conf to still work. You can try just installing an 'ixgbe.ko' >> symlink via the module's Makefile, though I'm not sure that will work >> correctly for the loader.conf case. If it doesn't, then the other route is >> to create a stub ixgbe.c file that MODULE_DEPEND()'s on the ix and ixv driver >> modules so that it autoloads if_ix.ko and if_ixv.ko as dependencies when it >> is loaded. > > +100 This change also makes things slightly annoying if you used `MODULES_OVERRIDE+=ixgbe` previously in src.conf or $KERNCONF stable/9 and stable/10. I'll see if I can implement a backwards compatibility shim for stable/9 and stable/10 at least, because I've been bitten by this once today with a dumbed down kernel config.. Thanks, -NGie From owner-svn-src-stable@FreeBSD.ORG Sat May 30 04:49:21 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39ABFBD1; Sat, 30 May 2015 04:49:21 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B1AF1F67; Sat, 30 May 2015 04:49:21 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4U4nKhg030277; Sat, 30 May 2015 04:49:20 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4U4nKFO030271; Sat, 30 May 2015 04:49:20 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201505300449.t4U4nKFO030271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Sat, 30 May 2015 04:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r283763 - stable/7/sys/dev/bxe X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 04:49:21 -0000 Author: davidcs Date: Sat May 30 04:49:19 2015 New Revision: 283763 URL: https://svnweb.freebsd.org/changeset/base/283763 Log: MFC r283274 Add stat counters for Jumbo Frames using SGE ring. Also remove the checks for IFCAP_LRO in bxe_alloc_fp_buffers() and bxe_pf_rx_q_prep() since both TPA and Jumbo can use SGE ring. Submitted by:gary.zambrano@qlogic.com Modified: stable/7/sys/dev/bxe/bxe.c stable/7/sys/dev/bxe/bxe_stats.c stable/7/sys/dev/bxe/bxe_stats.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe.c ============================================================================== --- stable/7/sys/dev/bxe/bxe.c Sat May 30 01:04:45 2015 (r283762) +++ stable/7/sys/dev/bxe/bxe.c Sat May 30 04:49:19 2015 (r283763) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.78" +#define BXE_DRIVER_VERSION "1.78.79" #include "bxe.h" #include "ecore_sp.h" @@ -483,6 +483,8 @@ static const struct { 4, STATS_FLAGS_FUNC, "rx_pkts"}, { STATS_OFFSET32(rx_tpa_pkts), 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"}, + { STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"}, { STATS_OFFSET32(rx_soft_errors), 4, STATS_FLAGS_FUNC, "rx_soft_errors"}, { STATS_OFFSET32(rx_hw_csum_errors), @@ -594,6 +596,8 @@ static const struct { 4, "rx_pkts"}, { Q_STATS_OFFSET32(rx_tpa_pkts), 4, "rx_tpa_pkts"}, + { Q_STATS_OFFSET32(rx_jumbo_sge_pkts), + 4, "rx_jumbo_sge_pkts"}, { Q_STATS_OFFSET32(rx_soft_errors), 4, "rx_soft_errors"}, { Q_STATS_OFFSET32(rx_hw_csum_errors), @@ -3477,6 +3481,7 @@ bxe_rxeof(struct bxe_softc *sc, rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); if (rc) break; + fp->eth_q_stats.rx_jumbo_sge_pkts++; } /* assign packet to this interface interface */ @@ -6862,42 +6867,40 @@ bxe_alloc_fp_buffers(struct bxe_softc *s fp->rx_cq_prod = cqe_ring_prod; fp->eth_q_stats.rx_calls = fp->eth_q_stats.rx_pkts = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - max_agg_queues = MAX_AGG_QS(sc); + max_agg_queues = MAX_AGG_QS(sc); - fp->tpa_enable = TRUE; + fp->tpa_enable = TRUE; - /* fill the TPA pool */ - for (j = 0; j < max_agg_queues; j++) { - rc = bxe_alloc_rx_tpa_mbuf(fp, j); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", + /* fill the TPA pool */ + for (j = 0; j < max_agg_queues; j++) { + rc = bxe_alloc_rx_tpa_mbuf(fp, j); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] TPA queue %d\n", i, j); - fp->tpa_enable = FALSE; - goto bxe_alloc_fp_buffers_error; - } - - fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + fp->tpa_enable = FALSE; + goto bxe_alloc_fp_buffers_error; } - if (fp->tpa_enable) { - /* fill the RX SGE chain */ - ring_prod = 0; - for (j = 0; j < RX_SGE_USABLE; j++) { - rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); - if (rc != 0) { - BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", - i, ring_prod); - fp->tpa_enable = FALSE; - ring_prod = 0; - goto bxe_alloc_fp_buffers_error; - } + fp->rx_tpa_info[j].state = BXE_TPA_STATE_STOP; + } - ring_prod = RX_SGE_NEXT(ring_prod); + if (fp->tpa_enable) { + /* fill the RX SGE chain */ + ring_prod = 0; + for (j = 0; j < RX_SGE_USABLE; j++) { + rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); + if (rc != 0) { + BLOGE(sc, "mbuf alloc fail for fp[%02d] SGE %d\n", + i, ring_prod); + fp->tpa_enable = FALSE; + ring_prod = 0; + goto bxe_alloc_fp_buffers_error; } - fp->rx_sge_prod = ring_prod; + ring_prod = RX_SGE_NEXT(ring_prod); } + + fp->rx_sge_prod = ring_prod; } } @@ -11781,28 +11784,26 @@ bxe_pf_rx_q_prep(struct bxe_softc uint16_t sge_sz = 0; uint16_t tpa_agg_size = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { - pause->sge_th_lo = SGE_TH_LO(sc); - pause->sge_th_hi = SGE_TH_HI(sc); + pause->sge_th_lo = SGE_TH_LO(sc); + pause->sge_th_hi = SGE_TH_HI(sc); - /* validate SGE ring has enough to cross high threshold */ - if (sc->dropless_fc && + /* validate SGE ring has enough to cross high threshold */ + if (sc->dropless_fc && (pause->sge_th_hi + FW_PREFETCH_CNT) > (RX_SGE_USABLE_PER_PAGE * RX_SGE_NUM_PAGES)) { - BLOGW(sc, "sge ring threshold limit\n"); - } + BLOGW(sc, "sge ring threshold limit\n"); + } - /* minimum max_aggregation_size is 2*MTU (two full buffers) */ - tpa_agg_size = (2 * sc->mtu); - if (tpa_agg_size < sc->max_aggregation_size) { - tpa_agg_size = sc->max_aggregation_size; - } + /* minimum max_aggregation_size is 2*MTU (two full buffers) */ + tpa_agg_size = (2 * sc->mtu); + if (tpa_agg_size < sc->max_aggregation_size) { + tpa_agg_size = sc->max_aggregation_size; + } - max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; - max_sge = ((max_sge + PAGES_PER_SGE - 1) & + max_sge = SGE_PAGE_ALIGN(sc->mtu) >> SGE_PAGE_SHIFT; + max_sge = ((max_sge + PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> PAGES_PER_SGE_SHIFT; - sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); - } + sge_sz = (uint16_t)min(SGE_PAGES, 0xffff); /* pause - not for e1 */ if (!CHIP_IS_E1(sc)) { Modified: stable/7/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/7/sys/dev/bxe/bxe_stats.c Sat May 30 01:04:45 2015 (r283762) +++ stable/7/sys/dev/bxe/bxe_stats.c Sat May 30 04:49:19 2015 (r283763) @@ -1227,6 +1227,7 @@ bxe_drv_stats_update(struct bxe_softc *s UPDATE_ESTAT_QSTAT(rx_calls); UPDATE_ESTAT_QSTAT(rx_pkts); UPDATE_ESTAT_QSTAT(rx_tpa_pkts); + UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts); UPDATE_ESTAT_QSTAT(rx_soft_errors); UPDATE_ESTAT_QSTAT(rx_hw_csum_errors); UPDATE_ESTAT_QSTAT(rx_ofld_frames_csum_ip); Modified: stable/7/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/7/sys/dev/bxe/bxe_stats.h Sat May 30 01:04:45 2015 (r283762) +++ stable/7/sys/dev/bxe/bxe_stats.h Sat May 30 04:49:19 2015 (r283763) @@ -218,6 +218,7 @@ struct bxe_eth_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -318,6 +319,7 @@ struct bxe_eth_q_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; uint32_t rx_ofld_frames_csum_ip; @@ -411,6 +413,7 @@ struct bxe_eth_q_stats_old { uint32_t rx_calls_old; uint32_t rx_pkts_old; uint32_t rx_tpa_pkts_old; + uint32_t rx_jumbo_sge_pkts_old; uint32_t rx_soft_errors_old; uint32_t rx_hw_csum_errors_old; uint32_t rx_ofld_frames_csum_ip_old; From owner-svn-src-stable@FreeBSD.ORG Sat May 30 08:54:43 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD599FA1; Sat, 30 May 2015 08:54:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B2F71686; Sat, 30 May 2015 08:54:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4U8shJS053885; Sat, 30 May 2015 08:54:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4U8shXM053884; Sat, 30 May 2015 08:54:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505300854.t4U8shXM053884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 30 May 2015 08:54: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: r283765 - 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@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 08:54:43 -0000 Author: kib Date: Sat May 30 08:54:42 2015 New Revision: 283765 URL: https://svnweb.freebsd.org/changeset/base/283765 Log: MFC r283320: Always obey thread request to not stop on non-boundary. Modified: stable/10/sys/kern/kern_thread.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Sat May 30 08:01:16 2015 (r283764) +++ stable/10/sys/kern/kern_thread.c Sat May 30 08:54:42 2015 (r283765) @@ -867,12 +867,9 @@ thread_suspend_check(int return_instead) return (ERESTART); /* - * Ignore suspend requests for stop signals if they - * are deferred. + * Ignore suspend requests if they are deferred. */ - if ((P_SHOULDSTOP(p) == P_STOPPED_SIG || - (p->p_flag & P_TOTAL_STOP) != 0) && - (td->td_flags & TDF_SBDRY) != 0) { + if ((td->td_flags & TDF_SBDRY) != 0) { KASSERT(return_instead, ("TDF_SBDRY set for unsafe thread_suspend_check")); return (0); From owner-svn-src-stable@FreeBSD.ORG Sat May 30 13:48:06 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 443E54C1; Sat, 30 May 2015 13:48:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CB071629; Sat, 30 May 2015 13:48:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 02E10B988; Sat, 30 May 2015 09:48:05 -0400 (EDT) From: John Baldwin To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r283620 - in stable/10/sys: amd64/conf conf dev/ixgbe modules modules/ix modules/ixv Date: Thu, 28 May 2015 18:04:54 -0400 Message-ID: <2770534.B2yRm8IhJm@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201505271744.t4RHiC04024525@svn.freebsd.org> <4977499.IGj0rLHqPU@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 30 May 2015 09:48:05 -0400 (EDT) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 13:48:06 -0000 On Thursday, May 28, 2015 09:03:01 PM Eric Joyner wrote: > I put the stub module in and removed the direct if_baudrate assignment > in r283668. Thanks! -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Sat May 30 21:23:42 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03FDA5D7; Sat, 30 May 2015 21:23:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7E591AFB; Sat, 30 May 2015 21:23:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4ULNfLW035620; Sat, 30 May 2015 21:23:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4ULNfRG035619; Sat, 30 May 2015 21:23:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505302123.t4ULNfRG035619@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 May 2015 21:23: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: r283787 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 21:23:42 -0000 Author: bapt Date: Sat May 30 21:23:41 2015 New Revision: 283787 URL: https://svnweb.freebsd.org/changeset/base/283787 Log: MFC: r257701 (by bdrewery) Remove condition which can never be true as the previous loop is never exited while remote == NULL. Modified: stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Sat May 30 20:39:19 2015 (r283786) +++ stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:23:41 2015 (r283787) @@ -238,9 +238,6 @@ fetch_to_fd(const char *url, char *path) } } - if (remote == NULL) - goto fetchfail; - while (done < st.size) { if ((r = fread(buf, 1, sizeof(buf), remote)) < 1) break; From owner-svn-src-stable@FreeBSD.ORG Sat May 30 21:25:33 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C44E815; Sat, 30 May 2015 21:25:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E29C1B11; Sat, 30 May 2015 21:25:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4ULPXR4037026; Sat, 30 May 2015 21:25:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4ULPX6B037025; Sat, 30 May 2015 21:25:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505302125.t4ULPX6B037025@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 May 2015 21:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283788 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 21:25:33 -0000 Author: bapt Date: Sat May 30 21:25:32 2015 New Revision: 283788 URL: https://svnweb.freebsd.org/changeset/base/283788 Log: MFC: r258020 (by bdrewery) Remove useless checks for NULL pointer before free(3) Reported by: eadler Approved by: eadler Modified: stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:23:41 2015 (r283787) +++ stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:25:32 2015 (r283788) @@ -321,8 +321,7 @@ free_fingerprint_list(struct fingerprint struct fingerprint *fingerprint, *tmp; STAILQ_FOREACH_SAFE(fingerprint, list, next, tmp) { - if (fingerprint->name) - free(fingerprint->name); + free(fingerprint->name); free(fingerprint); } free(list); @@ -724,12 +723,9 @@ cleanup: if (revoked) free_fingerprint_list(revoked); if (sc) { - if (sc->cert) - free(sc->cert); - if (sc->sig) - free(sc->sig); - if (sc->name) - free(sc->name); + free(sc->cert); + free(sc->sig); + free(sc->name); free(sc); } From owner-svn-src-stable@FreeBSD.ORG Sat May 30 21:28:56 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01C0A9CA; Sat, 30 May 2015 21:28:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4F281B32; Sat, 30 May 2015 21:28:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4ULStZe037471; Sat, 30 May 2015 21:28:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4ULSthC037470; Sat, 30 May 2015 21:28:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505302128.t4ULSthC037470@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 May 2015 21:28:55 +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: r283789 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 21:28:56 -0000 Author: bapt Date: Sat May 30 21:28:55 2015 New Revision: 283789 URL: https://svnweb.freebsd.org/changeset/base/283789 Log: MFC: r258226 argc is now used Modified: stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:25:32 2015 (r283788) +++ stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:28:55 2015 (r283789) @@ -881,7 +881,7 @@ cleanup: } int -main(__unused int argc, char *argv[]) +main(int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; const char *pkgarg; From owner-svn-src-stable@FreeBSD.ORG Sat May 30 21:32:03 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DB93B3A; Sat, 30 May 2015 21:32:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DBD21D2B; Sat, 30 May 2015 21:32:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4ULW3vM041584; Sat, 30 May 2015 21:32:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4ULW3Jt041583; Sat, 30 May 2015 21:32:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505302132.t4ULW3Jt041583@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 May 2015 21:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283790 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 21:32:03 -0000 Author: bapt Date: Sat May 30 21:32:02 2015 New Revision: 283790 URL: https://svnweb.freebsd.org/changeset/base/283790 Log: MFC: r259773, r259774, r259775 Do not print a question in non-interractive mode but explain why boostrapping has failed and how to allow it to happen Reported by: jmmv Modified: stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:28:55 2015 (r283789) +++ stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:32:02 2015 (r283790) @@ -819,6 +819,11 @@ static const char confirmation_message[] "The package management tool is not yet installed on your system.\n" "Do you want to fetch and install it now? [y/N]: "; +static const char non_interactive_message[] = +"The package management tool is not yet installed on your system.\n" +"Please set ASSUME_ALWAYS_YES=yes environment variable to be able to bootstrap " +"in non-interactive (stdin not being a tty)\n"; + static int pkg_query_yes_no(void) { @@ -937,10 +942,12 @@ main(int argc, char *argv[]) */ config_bool(ASSUME_ALWAYS_YES, &yes); if (!yes) { - printf("%s", confirmation_message); - if (!isatty(fileno(stdin))) + if (!isatty(fileno(stdin))) { + fprintf(stderr, non_interactive_message); exit(EXIT_FAILURE); + } + printf("%s", confirmation_message); if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } From owner-svn-src-stable@FreeBSD.ORG Sat May 30 21:45:48 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08FF8E45; Sat, 30 May 2015 21:45:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE6CD1F6E; Sat, 30 May 2015 21:45:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4ULjltI047121; Sat, 30 May 2015 21:45:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4ULjlm4047119; Sat, 30 May 2015 21:45:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505302145.t4ULjlm4047119@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 May 2015 21:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283791 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 21:45:48 -0000 Author: bapt Date: Sat May 30 21:45:46 2015 New Revision: 283791 URL: https://svnweb.freebsd.org/changeset/base/283791 Log: MFC: r273754 (by nwhitehorn) Use pkg-1.4-style platform identifiers based on MACHINE_ARCH (e.g. FreeBSD:11:amd64 instead of freebsd:11:x86:64) when bootstrapping pkg. Thanks to portmgr for providing symlinks so both styles work. Reviewed by: bapt MFC after: 3 weeks Modified: stable/10/usr.sbin/pkg/Makefile stable/10/usr.sbin/pkg/config.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/Makefile ============================================================================== --- stable/10/usr.sbin/pkg/Makefile Sat May 30 21:32:02 2015 (r283790) +++ stable/10/usr.sbin/pkg/Makefile Sat May 30 21:45:46 2015 (r283791) @@ -8,7 +8,7 @@ CFLAGS+=-I${.CURDIR}/../../contrib/libuc .PATH: ${.CURDIR}/../../contrib/libucl/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} ${LIBM} -LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto -lm +LDADD= -larchive -lfetch -lucl -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl .include Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Sat May 30 21:32:02 2015 (r283790) +++ stable/10/usr.sbin/pkg/config.c Sat May 30 21:45:46 2015 (r283791) @@ -31,9 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include +#include +#include #include #include @@ -42,14 +42,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include -#include "elf_tables.h" #include "config.h" #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ @@ -135,349 +133,32 @@ static struct config_entry c[] = { }, }; -static const char * -elf_corres_to_string(struct _elf_corres *m, int e) -{ - int i; - - for (i = 0; m[i].string != NULL; i++) - if (m[i].elf_nb == e) - return (m[i].string); - - return ("unknown"); -} - -static const char * -aeabi_parse_arm_attributes(void *data, size_t length) -{ - uint32_t sect_len; - uint8_t *section = data; - -#define MOVE(len) do { \ - assert(length >= (len)); \ - section += (len); \ - length -= (len); \ -} while (0) - - if (length == 0 || *section != 'A') - return (NULL); - - MOVE(1); - - /* Read the section length */ - if (length < sizeof(sect_len)) - return (NULL); - - memcpy(§_len, section, sizeof(sect_len)); - - /* - * The section length should be no longer than the section it is within - */ - if (sect_len > length) - return (NULL); - - MOVE(sizeof(sect_len)); - - /* Skip the vendor name */ - while (length != 0) { - if (*section == '\0') - break; - MOVE(1); - } - if (length == 0) - return (NULL); - MOVE(1); - - while (length != 0) { - uint32_t tag_length; - - switch(*section) { - case 1: /* Tag_File */ - MOVE(1); - if (length < sizeof(tag_length)) - return (NULL); - memcpy(&tag_length, section, sizeof(tag_length)); - break; - case 2: /* Tag_Section */ - case 3: /* Tag_Symbol */ - default: - return (NULL); - } - /* At least space for the tag and size */ - if (tag_length <= 5) - return (NULL); - tag_length--; - /* Check the tag fits */ - if (tag_length > length) - return (NULL); - -#define MOVE_TAG(len) do { \ - assert(tag_length >= (len)); \ - MOVE(len); \ - tag_length -= (len); \ -} while(0) - - MOVE(sizeof(tag_length)); - tag_length -= sizeof(tag_length); - - while (tag_length != 0) { - uint8_t tag; - - assert(tag_length >= length); - - tag = *section; - MOVE_TAG(1); - - /* - * These tag values come from: - * - * Addenda to, and Errata in, the ABI for the - * ARM Architecture. Release 2.08, section 2.3. - */ - if (tag == 6) { /* == Tag_CPU_arch */ - uint8_t val; - - val = *section; - /* - * We don't support values that require - * more than one byte. - */ - if (val & (1 << 7)) - return (NULL); - - /* We have an ARMv4 or ARMv5 */ - if (val <= 5) - return ("arm"); - else /* We have an ARMv6+ */ - return ("armv6"); - } else if (tag == 4 || tag == 5 || tag == 32 || - tag == 65 || tag == 67) { - while (*section != '\0' && length != 0) - MOVE_TAG(1); - if (tag_length == 0) - return (NULL); - /* Skip the last byte */ - MOVE_TAG(1); - } else if ((tag >= 7 && tag <= 31) || tag == 34 || - tag == 36 || tag == 38 || tag == 42 || tag == 44 || - tag == 64 || tag == 66 || tag == 68 || tag == 70) { - /* Skip the uleb128 data */ - while (*section & (1 << 7) && length != 0) - MOVE_TAG(1); - if (tag_length == 0) - return (NULL); - /* Skip the last byte */ - MOVE_TAG(1); - } else - return (NULL); -#undef MOVE_TAG - } - - break; - } - return (NULL); -#undef MOVE -} - static int pkg_get_myabi(char *dest, size_t sz) { - Elf *elf; - Elf_Data *data; - Elf_Note note; - Elf_Scn *scn; - char *src, *osname; - const char *arch, *abi, *fpu, *endian_corres_str; - const char *wordsize_corres_str; - GElf_Ehdr elfhdr; - GElf_Shdr shdr; - int fd, i, ret; - uint32_t version; - - version = 0; - ret = -1; - scn = NULL; - abi = NULL; - - if (elf_version(EV_CURRENT) == EV_NONE) { - warnx("ELF library initialization failed: %s", - elf_errmsg(-1)); - return (-1); - } - - if ((fd = open(_PATH_BSHELL, O_RDONLY)) < 0) { - warn("open()"); - return (-1); - } - - if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - ret = -1; - warnx("elf_begin() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } - - if (gelf_getehdr(elf, &elfhdr) == NULL) { - ret = -1; - warn("getehdr() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } - while ((scn = elf_nextscn(elf, scn)) != NULL) { - if (gelf_getshdr(scn, &shdr) != &shdr) { - ret = -1; - warn("getshdr() failed: %s.", elf_errmsg(-1)); - goto cleanup; - } + struct utsname uts; + char machine_arch[255]; + size_t len; + int error; + + error = uname(&uts); + if (error) + return (errno); + + len = sizeof(machine_arch); + error = sysctlbyname("hw.machine_arch", machine_arch, &len, NULL, 0); + if (error) + return (errno); + machine_arch[len] = '\0'; - if (shdr.sh_type == SHT_NOTE) - break; - } - - if (scn == NULL) { - ret = -1; - warn("failed to get the note section"); - goto cleanup; - } - - data = elf_getdata(scn, NULL); - src = data->d_buf; - for (;;) { - memcpy(¬e, src, sizeof(Elf_Note)); - src += sizeof(Elf_Note); - if (note.n_type == NT_VERSION) - break; - src += note.n_namesz + note.n_descsz; - } - osname = src; - src += roundup2(note.n_namesz, 4); - if (elfhdr.e_ident[EI_DATA] == ELFDATA2MSB) - version = be32dec(src); - else - version = le32dec(src); - - for (i = 0; osname[i] != '\0'; i++) - osname[i] = (char)tolower(osname[i]); - - wordsize_corres_str = elf_corres_to_string(wordsize_corres, - (int)elfhdr.e_ident[EI_CLASS]); - - arch = elf_corres_to_string(mach_corres, (int) elfhdr.e_machine); - - snprintf(dest, sz, "%s:%d", - osname, version / 100000); - - ret = 0; - - switch (elfhdr.e_machine) { - case EM_ARM: - endian_corres_str = elf_corres_to_string(endian_corres, - (int)elfhdr.e_ident[EI_DATA]); - - /* FreeBSD doesn't support the hard-float ABI yet */ - fpu = "softfp"; - if ((elfhdr.e_flags & 0xFF000000) != 0) { - const char *sh_name = NULL; - size_t shstrndx; - - /* This is an EABI file, the conformance level is set */ - abi = "eabi"; - /* Find which TARGET_ARCH we are building for. */ - elf_getshdrstrndx(elf, &shstrndx); - while ((scn = elf_nextscn(elf, scn)) != NULL) { - sh_name = NULL; - if (gelf_getshdr(scn, &shdr) != &shdr) { - scn = NULL; - break; - } - - sh_name = elf_strptr(elf, shstrndx, - shdr.sh_name); - if (sh_name == NULL) - continue; - if (strcmp(".ARM.attributes", sh_name) == 0) - break; - } - if (scn != NULL && sh_name != NULL) { - data = elf_getdata(scn, NULL); - /* - * Prior to FreeBSD 10.0 libelf would return - * NULL from elf_getdata on the .ARM.attributes - * section. As this was the first release to - * get armv6 support assume a NULL value means - * arm. - * - * This assumption can be removed when 9.x - * is unsupported. - */ - if (data != NULL) { - arch = aeabi_parse_arm_attributes( - data->d_buf, data->d_size); - if (arch == NULL) { - ret = 1; - warn("unknown ARM ARCH"); - goto cleanup; - } - } - } else { - ret = 1; - warn("Unable to find the .ARM.attributes " - "section"); - goto cleanup; - } - } else if (elfhdr.e_ident[EI_OSABI] != ELFOSABI_NONE) { - /* - * EABI executables all have this field set to - * ELFOSABI_NONE, therefore it must be an oabi file. - */ - abi = "oabi"; - } else { - ret = 1; - warn("unknown ARM ABI"); - goto cleanup; - } - snprintf(dest + strlen(dest), sz - strlen(dest), - ":%s:%s:%s:%s:%s", arch, wordsize_corres_str, - endian_corres_str, abi, fpu); - break; - case EM_MIPS: - /* - * this is taken from binutils sources: - * include/elf/mips.h - * mapping is figured out from binutils: - * gas/config/tc-mips.c - */ - switch (elfhdr.e_flags & EF_MIPS_ABI) { - case E_MIPS_ABI_O32: - abi = "o32"; - break; - case E_MIPS_ABI_N32: - abi = "n32"; - break; - default: - if (elfhdr.e_ident[EI_DATA] == - ELFCLASS32) - abi = "o32"; - else if (elfhdr.e_ident[EI_DATA] == - ELFCLASS64) - abi = "n64"; - break; - } - endian_corres_str = elf_corres_to_string(endian_corres, - (int)elfhdr.e_ident[EI_DATA]); - - snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s:%s:%s", - arch, wordsize_corres_str, endian_corres_str, abi); - break; - default: - snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s", - arch, wordsize_corres_str); - } - -cleanup: - if (elf != NULL) - elf_end(elf); + /* + * Use __FreeBSD_version rather than kernel version (uts.release) for + * use in jails. This is equivalent to the value of uname -U. + */ + snprintf(dest, sz, "%s:%d:%s", uts.sysname, __FreeBSD_version/100000, + machine_arch); - close(fd); - return (ret); + return (error); } static void From owner-svn-src-stable@FreeBSD.ORG Sat May 30 21:47:26 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09B7BF8B; Sat, 30 May 2015 21:47:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED5C71F7D; Sat, 30 May 2015 21:47:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4ULlPGh047404; Sat, 30 May 2015 21:47:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4ULlPiB047403; Sat, 30 May 2015 21:47:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505302147.t4ULlPiB047403@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 May 2015 21:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283792 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 21:47:26 -0000 Author: bapt Date: Sat May 30 21:47:25 2015 New Revision: 283792 URL: https://svnweb.freebsd.org/changeset/base/283792 Log: MFC: r273778 (by nwhitehorn) Remove spurious libelf dependency. Submitted by: pluknet Modified: stable/10/usr.sbin/pkg/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/Makefile ============================================================================== --- stable/10/usr.sbin/pkg/Makefile Sat May 30 21:45:46 2015 (r283791) +++ stable/10/usr.sbin/pkg/Makefile Sat May 30 21:47:25 2015 (r283792) @@ -6,7 +6,7 @@ MAN= pkg.7 CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include .PATH: ${.CURDIR}/../../contrib/libucl/include -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ +DPADD= ${LIBARCHIVE} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} ${LIBM} LDADD= -larchive -lfetch -lucl -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl From owner-svn-src-stable@FreeBSD.ORG Sat May 30 21:49:18 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E709F13B; Sat, 30 May 2015 21:49:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D68E61F8C; Sat, 30 May 2015 21:49:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4ULnIDV047686; Sat, 30 May 2015 21:49:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4ULnIYZ047685; Sat, 30 May 2015 21:49:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505302149.t4ULnIYZ047685@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 May 2015 21:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283793 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 21:49:19 -0000 Author: bapt Date: Sat May 30 21:49:18 2015 New Revision: 283793 URL: https://svnweb.freebsd.org/changeset/base/283793 Log: MFC: r281039 Allow fetching pkg(8) even if servers/proxies are not passing Content-length Modified: stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:47:25 2015 (r283792) +++ stable/10/usr.sbin/pkg/pkg.c Sat May 30 21:49:18 2015 (r283793) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -177,14 +176,11 @@ fetch_to_fd(const char *url, char *path) /* To store _https._tcp. + hostname + \0 */ int fd; int retry, max_retry; - off_t done, r; - time_t now, last; + ssize_t r; char buf[10240]; char zone[MAXHOSTNAMELEN + 13]; static const char *mirror_type = NULL; - done = 0; - last = 0; max_retry = 3; current = mirrors = NULL; remote = NULL; @@ -238,19 +234,16 @@ fetch_to_fd(const char *url, char *path) } } - while (done < st.size) { - if ((r = fread(buf, 1, sizeof(buf), remote)) < 1) - break; - + while ((r = fread(buf, 1, sizeof(buf), remote)) > 0) { if (write(fd, buf, r) != r) { warn("write()"); goto fetchfail; } + } - done += r; - now = time(NULL); - if (now > last || done == st.size) - last = now; + if (r != 0) { + warn("An error occurred while fetching pkg(8)"); + goto fetchfail; } if (ferror(remote))