svn commit: r283181 - in head/sys: arm/amlogic/aml8726 boot/fdt/dts/arm
Author: ganbold Date: Thu May 21 07:01:08 2015 New Revision: 283181 URL: https://svnweb.freebsd.org/changeset/base/283181 Log: The RTC initialization values are based on the SoC which can be determined at runtime so there's no need to set the values in each DTS. Tested on YYHD18 (aml8726-m3), VSATV102 (aml8726-m6), and ODROIDC1 (aml8726-m8b). Differential Revision:https://reviews.freebsd.org/D2588 Submitted by: John Wehle Modified: head/sys/arm/amlogic/aml8726/aml8726_rtc.c head/sys/boot/fdt/dts/arm/odroidc1.dts head/sys/boot/fdt/dts/arm/vsatv102-m6.dts Modified: head/sys/arm/amlogic/aml8726/aml8726_rtc.c == --- head/sys/arm/amlogic/aml8726/aml8726_rtc.c Thu May 21 06:58:50 2015 (r283180) +++ head/sys/arm/amlogic/aml8726/aml8726_rtc.c Thu May 21 07:01:08 2015 (r283181) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "clock_if.h" /* @@ -372,44 +374,27 @@ static int aml8726_rtc_attach(device_t dev) { struct aml8726_rtc_softc *sc = device_get_softc(dev); - boolean_t init_always_valid; - char *init_always; - pcell_t prop; - phandle_t node; - ssize_t len; sc->dev = dev; - node = ofw_bus_get_node(dev); - - len = OF_getprop_alloc(node, "init-always", - sizeof(char), (void **)&init_always); - sc->init.always = FALSE; - init_always_valid = FALSE; - if (len > 0) { - if (strncmp(init_always, "true", len) == 0) { - sc->init.always = TRUE; - init_always_valid = TRUE; - } else if (strncmp(init_always, "false", len) == 0) - init_always_valid = TRUE; - free(init_always, M_OFWPROP); - } - if (init_always_valid == FALSE) { - device_printf(dev, "missing init-always attribute in FDT\n"); - return (ENXIO); - } - - if (OF_getencprop(node, "xo-init", &prop, sizeof(prop)) <= 0) { - device_printf(dev, "missing xo-init attribute in FDT\n"); - return (ENXIO); - } - sc->init.xo = prop; - - if (OF_getencprop(node, "gpo-init", &prop, sizeof(prop)) <= 0) { - device_printf(dev, "missing gpo-init attribute in FDT\n"); + switch (aml8726_soc_hw_rev) { + case AML_SOC_HW_REV_M3: + sc->init.always = true; + sc->init.xo = 0x3c0a; + sc->init.gpo = 0x10; + break; + case AML_SOC_HW_REV_M6: + case AML_SOC_HW_REV_M8: + case AML_SOC_HW_REV_M8B: + sc->init.always = false; + sc->init.xo = 0x180a; + sc->init.gpo = 0x50; + break; + default: + device_printf(dev, "unsupported SoC\n"); return (ENXIO); + /* NOTREACHED */ } - sc->init.gpo = prop; if (bus_alloc_resources(dev, aml8726_rtc_spec, sc->res)) { device_printf(dev, "can not allocate resources for device\n"); Modified: head/sys/boot/fdt/dts/arm/odroidc1.dts == --- head/sys/boot/fdt/dts/arm/odroidc1.dts Thu May 21 06:58:50 2015 (r283180) +++ head/sys/boot/fdt/dts/arm/odroidc1.dts Thu May 21 07:01:08 2015 (r283181) @@ -194,10 +194,6 @@ compatible = "amlogic,aml8726-rtc"; reg = <0xc8100740 20>; /* aobus 0x1d0 */ interrupts = <0 72 1>; - - init-always = "false"; - xo-init = <0x180a>; - gpo-init = <0x50>; }; clkmsr: clkmsr@c1108758 { Modified: head/sys/boot/fdt/dts/arm/vsatv102-m6.dts == --- head/sys/boot/fdt/dts/arm/vsatv102-m6.dts Thu May 21 06:58:50 2015 (r283180) +++ head/sys/boot/fdt/dts/arm/vsatv102-m6.dts Thu May 21 07:01:08 2015 (r283181) @@ -153,10 +153,6 @@ compatible = "amlogic,aml8726-rtc"; reg = <0xda004340 20>; /* secbus2 0xd0 */ interrupts = <0 72 1>; /* AM_IRQ2(8) */ - - init-always = "false"; - xo-init = <0x180a>; - gpo-init = <0x50>; }; clkmsr: clkmsr@c1108758 { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283182 - stable/9/sys/dev/sound/usb
Author: hselasky Date: Thu May 21 07:07:28 2015 New Revision: 283182 URL: https://svnweb.freebsd.org/changeset/base/283182 Log: MFC r282652: Ensure the USB audio driver doesn't attach twice on the same USB device by grabbing all the USB audio device interfaces. Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c == --- stable/9/sys/dev/sound/usb/uaudio.c Thu May 21 07:01:08 2015 (r283181) +++ stable/9/sys/dev/sound/usb/uaudio.c Thu May 21 07:07:28 2015 (r283182) @@ -1574,6 +1574,19 @@ uaudio_chan_fill_info_sub(struct uaudio_ asf1d.v1 = NULL; ed1 = NULL; sed.v1 = NULL; + + /* +* There can only be one USB audio instance +* per USB device. Grab all USB audio +* interfaces on this USB device so that we +* don't attach USB audio twice: +*/ + if (alt_index == 0 && curidx != sc->sc_mixer_iface_index && + (id->bInterfaceClass == UICLASS_AUDIO || audio_if != 0 || + midi_if != 0)) { + usbd_set_parent_iface(sc->sc_udev, curidx, + sc->sc_mixer_iface_index); + } } if (audio_if == 0) { @@ -1809,9 +1822,6 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; - usbd_set_parent_iface(sc->sc_udev, curidx, - sc->sc_mixer_iface_index); - if (ep_dir == UE_DIR_IN) chan_alt->usb_cfg = uaudio_cfg_record; else ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283183 - head/sys/arm/amlogic/aml8726
Author: ganbold Date: Thu May 21 07:09:01 2015 New Revision: 283183 URL: https://svnweb.freebsd.org/changeset/base/283183 Log: Remove unnecessary break statements. Submitted by:John Wehle Modified: head/sys/arm/amlogic/aml8726/aml8726_ccm.c head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Modified: head/sys/arm/amlogic/aml8726/aml8726_ccm.c == --- head/sys/arm/amlogic/aml8726/aml8726_ccm.c Thu May 21 07:07:28 2015 (r283182) +++ head/sys/arm/amlogic/aml8726/aml8726_ccm.c Thu May 21 07:09:01 2015 (r283183) @@ -185,7 +185,6 @@ aml8726_ccm_attach(device_t dev) device_printf(dev, "unsupported SoC\n"); return (ENXIO); /* NOTREACHED */ - break; } if (bus_alloc_resources(dev, aml8726_ccm_spec, sc->res)) { Modified: head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c == --- head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c Thu May 21 07:07:28 2015(r283182) +++ head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c Thu May 21 07:09:01 2015(r283183) @@ -146,7 +146,6 @@ aml8726_pinctrl_attach(device_t dev) device_printf(dev, "unsupported SoC\n"); return (ENXIO); /* NOTREACHED */ - break; } if (bus_alloc_resources(dev, aml8726_pinctrl_spec, sc->res)) { Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c == --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Thu May 21 07:07:28 2015(r283182) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Thu May 21 07:09:01 2015(r283183) @@ -758,7 +758,6 @@ aml8726_sdxc_attach(device_t dev) device_printf(dev, "unsupported SoC\n"); return (ENXIO); /* NOTREACHED */ - break; } node = ofw_bus_get_node(dev); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283184 - stable/8/sys/dev/sound/usb
Author: hselasky Date: Thu May 21 07:09:19 2015 New Revision: 283184 URL: https://svnweb.freebsd.org/changeset/base/283184 Log: MFC r282652: Ensure the USB audio driver doesn't attach twice on the same USB device by grabbing all the USB audio device interfaces. Modified: stable/8/sys/dev/sound/usb/uaudio.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/usb/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c == --- stable/8/sys/dev/sound/usb/uaudio.c Thu May 21 07:09:01 2015 (r283183) +++ stable/8/sys/dev/sound/usb/uaudio.c Thu May 21 07:09:19 2015 (r283184) @@ -1574,6 +1574,19 @@ uaudio_chan_fill_info_sub(struct uaudio_ asf1d.v1 = NULL; ed1 = NULL; sed.v1 = NULL; + + /* +* There can only be one USB audio instance +* per USB device. Grab all USB audio +* interfaces on this USB device so that we +* don't attach USB audio twice: +*/ + if (alt_index == 0 && curidx != sc->sc_mixer_iface_index && + (id->bInterfaceClass == UICLASS_AUDIO || audio_if != 0 || + midi_if != 0)) { + usbd_set_parent_iface(sc->sc_udev, curidx, + sc->sc_mixer_iface_index); + } } if (audio_if == 0) { @@ -1809,9 +1822,6 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; - usbd_set_parent_iface(sc->sc_udev, curidx, - sc->sc_mixer_iface_index); - if (ep_dir == UE_DIR_IN) chan_alt->usb_cfg = uaudio_cfg_record; else ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283185 - stable/10/sys/dev/sound/usb
Author: hselasky Date: Thu May 21 07:10:49 2015 New Revision: 283185 URL: https://svnweb.freebsd.org/changeset/base/283185 Log: MFC r282652: Ensure the USB audio driver doesn't attach twice on the same USB device by grabbing all the USB audio device interfaces. Modified: stable/10/sys/dev/sound/usb/uaudio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c == --- stable/10/sys/dev/sound/usb/uaudio.cThu May 21 07:09:19 2015 (r283184) +++ stable/10/sys/dev/sound/usb/uaudio.cThu May 21 07:10:49 2015 (r283185) @@ -1574,6 +1574,19 @@ uaudio_chan_fill_info_sub(struct uaudio_ asf1d.v1 = NULL; ed1 = NULL; sed.v1 = NULL; + + /* +* There can only be one USB audio instance +* per USB device. Grab all USB audio +* interfaces on this USB device so that we +* don't attach USB audio twice: +*/ + if (alt_index == 0 && curidx != sc->sc_mixer_iface_index && + (id->bInterfaceClass == UICLASS_AUDIO || audio_if != 0 || + midi_if != 0)) { + usbd_set_parent_iface(sc->sc_udev, curidx, + sc->sc_mixer_iface_index); + } } if (audio_if == 0) { @@ -1809,9 +1822,6 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; - usbd_set_parent_iface(sc->sc_udev, curidx, - sc->sc_mixer_iface_index); - if (ep_dir == UE_DIR_IN) chan_alt->usb_cfg = uaudio_cfg_record; else ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283186 - head/sys/arm/amlogic/aml8726
Author: ganbold Date: Thu May 21 07:23:50 2015 New Revision: 283186 URL: https://svnweb.freebsd.org/changeset/base/283186 Log: Add driver for usbclock generator for earlier amlogic chip. Differential Revision:https://reviews.freebsd.org/D2590 Submitted by: John Wehle Added: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c (contents, props changed) Modified: head/sys/arm/amlogic/aml8726/files.aml8726 Added: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c Thu May 21 07:23:50 2015(r283186) @@ -0,0 +1,428 @@ +/*- + * Copyright 2014-2015 John Wehle + * 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. + */ + +/* + * Amlogic aml8726-m3 USB physical layer driver. + * + * Both USB physical interfaces share the same configuration register. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include "gpio_if.h" + +struct aml8726_usb_phy_gpio { + device_tdev; + uint32_tpin; + uint32_tpol; +}; + +struct aml8726_usb_phy_softc { + device_tdev; + struct resource *res[1]; + uint32_tnpwr_en; + struct aml8726_usb_phy_gpio *pwr_en; +}; + +static struct resource_spec aml8726_usb_phy_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#defineAML_USB_PHY_CFG_REG 0 +#defineAML_USB_PHY_CFG_A_CLK_DETECTED (1U << 31) +#defineAML_USB_PHY_CFG_CLK_DIV_MASK(0x7f << 24) +#defineAML_USB_PHY_CFG_CLK_DIV_SHIFT 24 +#defineAML_USB_PHY_CFG_B_CLK_DETECTED (1 << 22) +#defineAML_USB_PHY_CFG_A_PLL_RST (1 << 19) +#defineAML_USB_PHY_CFG_A_PHYS_RST (1 << 18) +#defineAML_USB_PHY_CFG_A_RST (1 << 17) +#defineAML_USB_PHY_CFG_B_PLL_RST (1 << 13) +#defineAML_USB_PHY_CFG_B_PHYS_RST (1 << 12) +#defineAML_USB_PHY_CFG_B_RST (1 << 11) +#defineAML_USB_PHY_CFG_CLK_EN (1 << 8) +#defineAML_USB_PHY_CFG_CLK_SEL_MASK(7 << 5) +#defineAML_USB_PHY_CFG_CLK_SEL_XTAL(0 << 5) +#defineAML_USB_PHY_CFG_CLK_SEL_XTAL_DIV2 (1 << 5) +#defineAML_USB_PHY_CFG_B_POR (1 << 1) +#defineAML_USB_PHY_CFG_A_POR (1 << 0) + +#defineAML_USB_PHY_CFG_CLK_DETECTED \ +(AML_USB_PHY_CFG_A_CLK_DETECTED | AML_USB_PHY_CFG_B_CLK_DETECTED) + +#defineAML_USB_PHY_MISC_A_REG 12 +#defineAML_USB_PHY_MISC_B_REG 16 +#defineAML_USB_PHY_MISC_ID_OVERIDE_EN (1 << 23) +#defineAML_USB_PHY_MISC_ID_OVERIDE_DEVICE (1 << 22) +#defineAML_USB_PHY_MISC_ID_OVERIDE_HOST(0 << 22) + +#defineCSR_WRITE_4(sc, reg, val) bus_write_4((sc)->res[0], reg, (val)) +#defineCSR_READ_4(sc, reg) bus_read_4((sc)->res[0], reg) +#defineCSR_BARRIER(sc, reg)bus_barrier((sc)->res[0], reg, 4, \ +(BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE)) + +#definePIN_ON_FLAG(pol)((pol) == 0 ? \ +GPIO_PIN_LOW : GPIO_PIN_HIGH) +#definePIN_OFF_FLAG(pol)
svn commit: r283187 - stable/10/sys/dev/vt
Author: hselasky Date: Thu May 21 07:34:08 2015 New Revision: 283187 URL: https://svnweb.freebsd.org/changeset/base/283187 Log: MFC r282645, r282646 and r282730: * Prevent switching to NULL or own window in the "vt_proc_window_switch" function. This fixes an issue where X11 keyboard input can appear stuck. The cause of the problem is a duplicate TTY device window switch IOCTL during boot, which leaves the "vt_switch_timer" running, because the current window is already selected. While at it factor out some NULL checks. * The "SYSCTL_INT()" default value is only used for read only SYSCTLs and is not applicable unless the integer pointer is NULL. Set it to zero to avoid confusion. While at it remove extra semicolon at the end of the "VT_SYSCTL_INT()" macro. * Ensure the result from signed subtraction under modulus does not become negative. PR: 200032 Modified: stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt.h == --- stable/10/sys/dev/vt/vt.h Thu May 21 07:23:50 2015(r283186) +++ stable/10/sys/dev/vt/vt.h Thu May 21 07:34:08 2015(r283187) @@ -83,10 +83,10 @@ #defineISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG) #defineVT_SYSCTL_INT(_name, _default, _descr) \ -static int vt_##_name = _default; \ -SYSCTL_INT(_kern_vt, OID_AUTO, _name, CTLFLAG_RW, &vt_##_name, _default,\ +static int vt_##_name = (_default);\ +SYSCTL_INT(_kern_vt, OID_AUTO, _name, CTLFLAG_RWTUN, &vt_##_name, 0, \ _descr);\ -TUNABLE_INT("kern.vt." #_name, &vt_##_name); +TUNABLE_INT("kern.vt." #_name, &vt_##_name) struct vt_driver; Modified: stable/10/sys/dev/vt/vt_core.c == --- stable/10/sys/dev/vt/vt_core.c Thu May 21 07:23:50 2015 (r283186) +++ stable/10/sys/dev/vt/vt_core.c Thu May 21 07:34:08 2015 (r283187) @@ -448,12 +448,35 @@ vt_proc_window_switch(struct vt_window * struct vt_device *vd; int ret; + /* Prevent switching to NULL */ + if (vw == NULL) { + DPRINTF(30, "%s: Cannot switch: vw is NULL.", __func__); + return (EINVAL); + } vd = vw->vw_device; curvw = vd->vd_curwindow; + /* Check if virtual terminal is locked */ if (curvw->vw_flags & VWF_VTYLOCK) return (EBUSY); + /* Check if switch already in progress */ + if (curvw->vw_flags & VWF_SWWAIT_REL) { + /* Check if switching to same window */ + if (curvw->vw_switch_to == vw) { + DPRINTF(30, "%s: Switch in progress to same vw.", __func__); + return (0); /* success */ + } + DPRINTF(30, "%s: Switch in progress to different vw.", __func__); + return (EBUSY); + } + + /* Avoid switching to already selected window */ + if (vw == curvw) { + DPRINTF(30, "%s: Cannot switch: vw == curvw.", __func__); + return (0); /* success */ + } + /* Ask current process permission to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); @@ -661,8 +684,7 @@ vt_scrollmode_kbdevent(struct vt_window if (console == 0) { if (c >= F_SCR && c <= MIN(L_SCR, F_SCR + VT_MAXWINDOWS - 1)) { vw = vd->vd_windows[c - F_SCR]; - if (vw != NULL) - vt_proc_window_switch(vw); + vt_proc_window_switch(vw); return; } VT_LOCK(vd); @@ -747,8 +769,7 @@ vt_processkey(keyboard_t *kbd, struct vt if (c >= F_SCR && c <= MIN(L_SCR, F_SCR + VT_MAXWINDOWS - 1)) { vw = vd->vd_windows[c - F_SCR]; - if (vw != NULL) - vt_proc_window_switch(vw); + vt_proc_window_switch(vw); return (0); } @@ -757,15 +778,13 @@ vt_processkey(keyboard_t *kbd, struct vt /* Switch to next VT. */ c = (vw->vw_number + 1) % VT_MAXWINDOWS; vw = vd->vd_windows[c]; - if (vw != NULL) - vt_proc_window_switch(vw); + vt_proc_window_switch(vw); return (0); case PREV: /* Switch to previous VT. */ - c = (vw->vw_
svn commit: r283188 - head/sys/arm/amlogic/aml8726
Author: ganbold Date: Thu May 21 07:35:20 2015 New Revision: 283188 URL: https://svnweb.freebsd.org/changeset/base/283188 Log: Add missing break statement. Submitted by: John Wehle Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c == --- head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Thu May 21 07:34:08 2015(r283187) +++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Thu May 21 07:35:20 2015(r283188) @@ -181,8 +181,10 @@ aml8726_usb_phy_attach(device_t dev) sc->pwr_en[i].pin = prop[i * 3 + 1]; sc->pwr_en[i].pol = prop[i * 3 + 2]; - if (sc->pwr_en[i].dev == NULL) + if (sc->pwr_en[i].dev == NULL) { err = 1; + break; + } } free(prop, M_OFWPROP); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283189 - stable/10/sys/cam/scsi
Author: hselasky Date: Thu May 21 07:41:03 2015 New Revision: 283189 URL: https://svnweb.freebsd.org/changeset/base/283189 Log: MFC r279726: Add DA_Q_NO_RC16 quirk for USB mass storage device. PR: 194062 Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c == --- stable/10/sys/cam/scsi/scsi_da.cThu May 21 07:35:20 2015 (r283188) +++ stable/10/sys/cam/scsi/scsi_da.cThu May 21 07:41:03 2015 (r283189) @@ -1177,6 +1177,13 @@ static struct da_quirk_entry da_quirk_ta }, { /* +* Hama Innostor USB-Stick +*/ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Innostor", "Innostor*", "*" }, + /*quirks*/DA_Q_NO_RC16 + }, + { + /* * MX-ES USB Drive by Mach Xtreme */ { T_DIRECT, SIP_MEDIA_REMOVABLE, "MX", "MXUB3*", "*"}, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283190 - stable/9/sys/cam/scsi
Author: hselasky Date: Thu May 21 07:42:46 2015 New Revision: 283190 URL: https://svnweb.freebsd.org/changeset/base/283190 Log: MFC r279726: Add DA_Q_NO_RC16 quirk for USB mass storage device. PR: 194062 Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c == --- stable/9/sys/cam/scsi/scsi_da.c Thu May 21 07:41:03 2015 (r283189) +++ stable/9/sys/cam/scsi/scsi_da.c Thu May 21 07:42:46 2015 (r283190) @@ -1144,6 +1144,13 @@ static struct da_quirk_entry da_quirk_ta { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SG9XCS2D*", "*" }, /*quirks*/DA_Q_4K }, + { + /* +* Hama Innostor USB-Stick +*/ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Innostor", "Innostor*", "*" }, + /*quirks*/DA_Q_NO_RC16 + }, }; static disk_strategy_t dastrategy; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283191 - stable/9/sys/dev/sound/pcm
Author: hselasky Date: Thu May 21 07:46:01 2015 New Revision: 283191 URL: https://svnweb.freebsd.org/changeset/base/283191 Log: MFC r282017: Allow DSP basename cloning to be disabled or enabled at boot and runtime. This is useful when implementing OSS sound stacks in userspace via libcuse for example. Modified: stable/9/sys/dev/sound/pcm/dsp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pcm/dsp.c == --- stable/9/sys/dev/sound/pcm/dsp.cThu May 21 07:42:46 2015 (r283190) +++ stable/9/sys/dev/sound/pcm/dsp.cThu May 21 07:46:01 2015 (r283191) @@ -46,6 +46,12 @@ SYSCTL_INT(_hw_snd, OID_AUTO, compat_lin &dsp_mmap_allow_prot_exec, 0, "linux mmap compatibility (-1=force disable 0=auto 1=force enable)"); +static int dsp_basename_clone = 1; +SYSCTL_INT(_hw_snd, OID_AUTO, basename_clone, CTLFLAG_RWTUN, +&dsp_basename_clone, 0, +"DSP basename cloning (0: Disable; 1: Enabled)"); +TUNABLE_INT("hw.snd.basename_clone", &dsp_basename_clone); + struct dsp_cdevinfo { struct pcm_channel *rdch, *wrch; struct pcm_channel *volch; @@ -2357,9 +2363,10 @@ dsp_clone(void *arg, devname = devcmp; devhw = dsp_cdevs[i].hw; devcmax = dsp_cdevs[i].max - 1; - if (strcmp(name, devcmp) == 0) - unit = snd_unit; - else if (dsp_stdclone(name, devcmp, devsep, + if (strcmp(name, devcmp) == 0) { + if (dsp_basename_clone != 0) + unit = snd_unit; + } else if (dsp_stdclone(name, devcmp, devsep, dsp_cdevs[i].use_sep, &unit, &cunit) != 0) { unit = -1; cunit = -1; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283192 - stable/10/sys/dev/sound/pcm
Author: hselasky Date: Thu May 21 07:48:06 2015 New Revision: 283192 URL: https://svnweb.freebsd.org/changeset/base/283192 Log: MFC r282017: Allow DSP basename cloning to be disabled or enabled at boot and runtime. This is useful when implementing OSS sound stacks in userspace via libcuse for example. Modified: stable/10/sys/dev/sound/pcm/dsp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pcm/dsp.c == --- stable/10/sys/dev/sound/pcm/dsp.c Thu May 21 07:46:01 2015 (r283191) +++ stable/10/sys/dev/sound/pcm/dsp.c Thu May 21 07:48:06 2015 (r283192) @@ -48,6 +48,12 @@ SYSCTL_INT(_hw_snd, OID_AUTO, compat_lin &dsp_mmap_allow_prot_exec, 0, "linux mmap compatibility (-1=force disable 0=auto 1=force enable)"); +static int dsp_basename_clone = 1; +SYSCTL_INT(_hw_snd, OID_AUTO, basename_clone, CTLFLAG_RWTUN, +&dsp_basename_clone, 0, +"DSP basename cloning (0: Disable; 1: Enabled)"); +TUNABLE_INT("hw.snd.basename_clone", &dsp_basename_clone); + struct dsp_cdevinfo { struct pcm_channel *rdch, *wrch; struct pcm_channel *volch; @@ -2359,9 +2365,10 @@ dsp_clone(void *arg, devname = devcmp; devhw = dsp_cdevs[i].hw; devcmax = dsp_cdevs[i].max - 1; - if (strcmp(name, devcmp) == 0) - unit = snd_unit; - else if (dsp_stdclone(name, devcmp, devsep, + if (strcmp(name, devcmp) == 0) { + if (dsp_basename_clone != 0) + unit = snd_unit; + } else if (dsp_stdclone(name, devcmp, devsep, dsp_cdevs[i].use_sep, &unit, &cunit) != 0) { unit = -1; cunit = -1; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283193 - in stable/10/sys/dev/usb: . serial
Author: hselasky Date: Thu May 21 07:49:44 2015 New Revision: 283193 URL: https://svnweb.freebsd.org/changeset/base/283193 Log: MFC r282505: Add new USB ID. PR: 199843 Modified: stable/10/sys/dev/usb/serial/uftdi.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uftdi.c == --- stable/10/sys/dev/usb/serial/uftdi.cThu May 21 07:48:06 2015 (r283192) +++ stable/10/sys/dev/usb/serial/uftdi.cThu May 21 07:49:44 2015 (r283193) @@ -497,6 +497,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, SCS_DEVICE_5, 0), UFTDI_DEV(FTDI, SCS_DEVICE_6, 0), UFTDI_DEV(FTDI, SCS_DEVICE_7, 0), + UFTDI_DEV(FTDI, SCX8_USB_PHOENIX, 0), UFTDI_DEV(FTDI, SDMUSBQSS, 0), UFTDI_DEV(FTDI, SEMC_DSS20, 0), UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_JTAG_CHECK_STRING), Modified: stable/10/sys/dev/usb/usbdevs == --- stable/10/sys/dev/usb/usbdevs Thu May 21 07:48:06 2015 (r283192) +++ stable/10/sys/dev/usb/usbdevs Thu May 21 07:49:44 2015 (r283193) @@ -1851,6 +1851,7 @@ product FREECOM HDD 0xfc05 Classic SL H product FSC E5400 0x1009 PrismGT USB 2.0 WLAN /* Future Technology Devices products */ +product FTDI SCX8_USB_PHOENIX 0x5259 SCx8 USB Phoenix interface product FTDI SERIAL_8U100AX0x8372 8U100AX Serial product FTDI SERIAL_8U232AM0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283194 - in stable/9/sys/dev/usb: . serial
Author: hselasky Date: Thu May 21 07:50:56 2015 New Revision: 283194 URL: https://svnweb.freebsd.org/changeset/base/283194 Log: MFC r282505: Add new USB ID. PR: 199843 Modified: stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/uftdi.c == --- stable/9/sys/dev/usb/serial/uftdi.c Thu May 21 07:49:44 2015 (r283193) +++ stable/9/sys/dev/usb/serial/uftdi.c Thu May 21 07:50:56 2015 (r283194) @@ -497,6 +497,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, SCS_DEVICE_5, 0), UFTDI_DEV(FTDI, SCS_DEVICE_6, 0), UFTDI_DEV(FTDI, SCS_DEVICE_7, 0), + UFTDI_DEV(FTDI, SCX8_USB_PHOENIX, 0), UFTDI_DEV(FTDI, SDMUSBQSS, 0), UFTDI_DEV(FTDI, SEMC_DSS20, 0), UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_JTAG_CHECK_STRING), Modified: stable/9/sys/dev/usb/usbdevs == --- stable/9/sys/dev/usb/usbdevsThu May 21 07:49:44 2015 (r283193) +++ stable/9/sys/dev/usb/usbdevsThu May 21 07:50:56 2015 (r283194) @@ -1851,6 +1851,7 @@ product FREECOM HDD 0xfc05 Classic SL H product FSC E5400 0x1009 PrismGT USB 2.0 WLAN /* Future Technology Devices products */ +product FTDI SCX8_USB_PHOENIX 0x5259 SCx8 USB Phoenix interface product FTDI SERIAL_8U100AX0x8372 8U100AX Serial product FTDI SERIAL_8U232AM0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283195 - head/usr.bin/soelim
Author: bapt Date: Thu May 21 08:20:42 2015 New Revision: 283195 URL: https://svnweb.freebsd.org/changeset/base/283195 Log: sort headers Modified: head/usr.bin/soelim/soelim.c Modified: head/usr.bin/soelim/soelim.c == --- head/usr.bin/soelim/soelim.cThu May 21 07:50:56 2015 (r283194) +++ head/usr.bin/soelim/soelim.cThu May 21 08:20:42 2015 (r283195) @@ -29,15 +29,15 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include #define _WITH_GETLINE #include -#include #include -#include #include #include -#include -#include +#include #define C_OPTION 0x1 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283196 - head/usr.bin/soelim
Author: bapt Date: Thu May 21 08:23:45 2015 New Revision: 283196 URL: https://svnweb.freebsd.org/changeset/base/283196 Log: Use the POSIX PATH_MAX macro from limits.h instead of non standard MAXPATHLEN Submitted by: schwarze at OpenBSD Modified: head/usr.bin/soelim/soelim.c Modified: head/usr.bin/soelim/soelim.c == --- head/usr.bin/soelim/soelim.cThu May 21 08:20:42 2015 (r283195) +++ head/usr.bin/soelim/soelim.cThu May 21 08:23:45 2015 (r283196) @@ -27,10 +27,9 @@ #include __FBSDID("$FreeBSD$"); -#include - #include #include +#include #include #define _WITH_GETLINE #include @@ -56,7 +55,7 @@ static FILE * soelim_fopen(const char *name) { FILE *f; - char path[MAXPATHLEN]; + char path[PATH_MAX]; size_t i; if (strcmp(name, "-") == 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283197 - head/usr.bin/soelim
Author: bapt Date: Thu May 21 08:26:24 2015 New Revision: 283197 URL: https://svnweb.freebsd.org/changeset/base/283197 Log: add an include on sys/types.h because we do explicitly use size_t remove unused stdbool.h Suggested by: schwarze at OpenBSD Modified: head/usr.bin/soelim/soelim.c Modified: head/usr.bin/soelim/soelim.c == --- head/usr.bin/soelim/soelim.cThu May 21 08:23:45 2015 (r283196) +++ head/usr.bin/soelim/soelim.cThu May 21 08:26:24 2015 (r283197) @@ -27,10 +27,11 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include -#include #define _WITH_GETLINE #include #include ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283198 - stable/10/sys/kern
Author: ae Date: Thu May 21 08:28:35 2015 New Revision: 283198 URL: https://svnweb.freebsd.org/changeset/base/283198 Log: MFC r282594: m_dup() is supposed to give a writable copy of an mbuf chain. It uses m_dup_pkthdr(), that uses M_COPYFLAGS mask to copy m_flags field. If original mbuf chain has M_RDONLY flag, its copy also will have it. Reset this flag explicitly. Modified: stable/10/sys/kern/uipc_mbuf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_mbuf.c == --- stable/10/sys/kern/uipc_mbuf.c Thu May 21 08:26:24 2015 (r283197) +++ stable/10/sys/kern/uipc_mbuf.c Thu May 21 08:28:35 2015 (r283198) @@ -934,6 +934,7 @@ m_dup(struct mbuf *m, int how) } if ((n->m_flags & M_EXT) == 0) nsize = MHLEN; + n->m_flags &= ~M_RDONLY; } n->m_len = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283199 - head/usr.bin/soelim
Author: bapt Date: Thu May 21 08:28:48 2015 New Revision: 283199 URL: https://svnweb.freebsd.org/changeset/base/283199 Log: * fix roff terminology in .Nd * remove .Xr to self * add AUTHORS section Submitted by: schwarze at OpenBSD Modified: head/usr.bin/soelim/soelim.1 Modified: head/usr.bin/soelim/soelim.1 == --- head/usr.bin/soelim/soelim.1Thu May 21 08:28:35 2015 (r283198) +++ head/usr.bin/soelim/soelim.1Thu May 21 08:28:48 2015 (r283199) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm soelim -.Nd interpret .so directive in manpages +.Nd interpret .so requests in manpages .Sh SYNOPSIS .Nm .Op Fl Crtv @@ -78,5 +78,9 @@ The files are always searched first in t A file specified with an absolute path will be opened directly without performing a search. .Sh SEE ALSO -.Xr mandoc 1 , -.Xr soelim 1 +.Xr mandoc 1 +.Sh AUTHORS +This version of the +.Nm +utility was written by +.An Baptiste Daroussin Aq Mt b...@freebsd.org . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283200 - stable/9/sys/kern
Author: ae Date: Thu May 21 08:32:52 2015 New Revision: 283200 URL: https://svnweb.freebsd.org/changeset/base/283200 Log: MFC r282594: m_dup() is supposed to give a writable copy of an mbuf chain. It uses m_dup_pkthdr(), that uses M_COPYFLAGS mask to copy m_flags field. If original mbuf chain has M_RDONLY flag, its copy also will have it. Reset this flag explicitly. Modified: stable/9/sys/kern/uipc_mbuf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_mbuf.c == --- stable/9/sys/kern/uipc_mbuf.c Thu May 21 08:28:48 2015 (r283199) +++ stable/9/sys/kern/uipc_mbuf.c Thu May 21 08:32:52 2015 (r283200) @@ -867,6 +867,7 @@ m_dup(struct mbuf *m, int how) } if ((n->m_flags & M_EXT) == 0) nsize = MHLEN; + n->m_flags &= ~M_RDONLY; } n->m_len = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283201 - in head: include lib/libc/gen
Author: bapt Date: Thu May 21 08:38:25 2015 New Revision: 283201 URL: https://svnweb.freebsd.org/changeset/base/283201 Log: Remove clause 3 and 4 from the license Obtained from:NetBSD Modified: head/include/stringlist.h head/lib/libc/gen/stringlist.c Modified: head/include/stringlist.h == --- head/include/stringlist.h Thu May 21 08:32:52 2015(r283200) +++ head/include/stringlist.h Thu May 21 08:38:25 2015(r283201) @@ -12,11 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by Christos Zoulas. - * 4. The name of the author may not be used to endorse or promote products - *derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED Modified: head/lib/libc/gen/stringlist.c == --- head/lib/libc/gen/stringlist.c Thu May 21 08:32:52 2015 (r283200) +++ head/lib/libc/gen/stringlist.c Thu May 21 08:38:25 2015 (r283201) @@ -10,8 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 4. The name of the author may not be used to endorse or promote products - *derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283202 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 08:55:06 2015 New Revision: 283202 URL: https://svnweb.freebsd.org/changeset/base/283202 Log: MFC: r282897 sfxge: add missing const qualifier to sfxge_link_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.cThu May 21 08:38:25 2015 (r283201) +++ stable/10/sys/dev/sfxge/sfxge_port.cThu May 21 08:55:06 2015 (r283202) @@ -624,7 +624,7 @@ fail: return (rc); } -static int sfxge_link_mode[EFX_PHY_MEDIA_NTYPES][EFX_LINK_NMODES] = { +static const int sfxge_link_mode[EFX_PHY_MEDIA_NTYPES][EFX_LINK_NMODES] = { [EFX_PHY_MEDIA_CX4] = { [EFX_LINK_1FDX] = IFM_ETHER | IFM_FDX | IFM_10G_CX4, }, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283203 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 08:59:03 2015 New Revision: 283203 URL: https://svnweb.freebsd.org/changeset/base/283203 Log: MFC: r282899 sfxge: add local variable with Rx descriptor flags Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_rx.c == --- stable/10/sys/dev/sfxge/sfxge_rx.c Thu May 21 08:55:06 2015 (r283202) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Thu May 21 08:59:03 2015 (r283203) @@ -322,16 +322,17 @@ static void sfxge_rx_deliver(struct sfxge_softc *sc, struct sfxge_rx_sw_desc *rx_desc) { struct mbuf *m = rx_desc->mbuf; + int flags = rx_desc->flags; int csum_flags; /* Convert checksum flags */ - csum_flags = (rx_desc->flags & EFX_CKSUM_IPV4) ? + csum_flags = (flags & EFX_CKSUM_IPV4) ? (CSUM_IP_CHECKED | CSUM_IP_VALID) : 0; - if (rx_desc->flags & EFX_CKSUM_TCPUDP) + if (flags & EFX_CKSUM_TCPUDP) csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; /* The hash covers a 4-tuple for TCP only */ - if (rx_desc->flags & EFX_PKT_TCP) { + if (flags & EFX_PKT_TCP) { m->m_pkthdr.flowid = EFX_RX_HASH_VALUE(EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283204 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:00:45 2015 New Revision: 283204 URL: https://svnweb.freebsd.org/changeset/base/283204 Log: MFC: r282900 sfxge: IPv4 Tx checksum offload may be disabled in fact Split IFCAP_HWCSUM to IFCAP_RXCSUM and IFCAP_TXCSUM to highlight Tx and Rx. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c == --- stable/10/sys/dev/sfxge/sfxge.c Thu May 21 08:59:03 2015 (r283203) +++ stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:00:45 2015 (r283204) @@ -58,12 +58,12 @@ __FBSDID("$FreeBSD$"); #include "sfxge_rx.h" #include "sfxge_version.h" -#defineSFXGE_CAP (IFCAP_VLAN_MTU | \ - IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | \ +#defineSFXGE_CAP (IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM | \ + IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO |\ IFCAP_JUMBO_MTU | IFCAP_LRO |\ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) #defineSFXGE_CAP_ENABLE SFXGE_CAP -#defineSFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \ +#defineSFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_RXCSUM | IFCAP_VLAN_HWCSUM | \ IFCAP_JUMBO_MTU | IFCAP_LINKSTATE) MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283205 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:03:18 2015 New Revision: 283205 URL: https://svnweb.freebsd.org/changeset/base/283205 Log: MFC: r282903 sfxge: advertise IPv6 Rx and Tx checksum offload support Tx checksum offload may be enabled/disabled. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c == --- stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:00:45 2015 (r283204) +++ stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:03:18 2015 (r283205) @@ -60,10 +60,12 @@ __FBSDID("$FreeBSD$"); #defineSFXGE_CAP (IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM | \ IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO |\ + IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6 | \ IFCAP_JUMBO_MTU | IFCAP_LRO |\ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) #defineSFXGE_CAP_ENABLE SFXGE_CAP #defineSFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_RXCSUM | IFCAP_VLAN_HWCSUM | \ +IFCAP_RXCSUM_IPV6 |\ IFCAP_JUMBO_MTU | IFCAP_LINKSTATE) MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); @@ -275,6 +277,10 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign ifp->if_hwassist |= (CSUM_IP | CSUM_TCP | CSUM_UDP); else ifp->if_hwassist &= ~(CSUM_IP | CSUM_TCP | CSUM_UDP); + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) + ifp->if_hwassist |= (CSUM_TCP_IPV6 | CSUM_UDP_IPV6); + else + ifp->if_hwassist &= ~(CSUM_TCP_IPV6 | CSUM_UDP_IPV6); if (ifp->if_capenable & IFCAP_TSO) ifp->if_hwassist |= CSUM_TSO; else @@ -325,7 +331,8 @@ sfxge_ifnet_init(struct ifnet *ifp, stru ifp->if_capabilities = SFXGE_CAP; ifp->if_capenable = SFXGE_CAP_ENABLE; - ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO; + ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | + CSUM_TCP_IPV6 | CSUM_UDP_IPV6; ether_ifattach(ifp, encp->enc_mac_addr); Modified: stable/10/sys/dev/sfxge/sfxge_tx.c == --- stable/10/sys/dev/sfxge/sfxge_tx.c Thu May 21 09:00:45 2015 (r283204) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Thu May 21 09:03:18 2015 (r283205) @@ -699,7 +699,8 @@ sfxge_if_transmit(struct ifnet *ifp, str ("interface not up")); /* Pick the desired transmit queue. */ - if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) { + if (m->m_pkthdr.csum_flags & + (CSUM_DELAY_DATA | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO)) { int index = 0; /* check if flowid is set */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283206 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:05:13 2015 New Revision: 283206 URL: https://svnweb.freebsd.org/changeset/base/283206 Log: MFC: r282940 sfxge: LRO may be done only if checksums are OK Also it is cheaper to check Rx descriptor flags than TCP protocol in IP header. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_rx.c == --- stable/10/sys/dev/sfxge/sfxge_rx.c Thu May 21 09:03:18 2015 (r283205) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Thu May 21 09:05:13 2015 (r283206) @@ -681,15 +681,18 @@ sfxge_lro(struct sfxge_rxq *rxq, struct */ if (l3_proto == htons(ETHERTYPE_IP)) { struct ip *iph = nh; - if ((iph->ip_p - IPPROTO_TCP) | - (iph->ip_hl - (sizeof(*iph) >> 2u)) | + + KASSERT(iph->ip_p == IPPROTO_TCP, + ("IPv4 protocol is not TCP, but packet marker is set")); + if ((iph->ip_hl - (sizeof(*iph) >> 2u)) | (iph->ip_off & htons(IP_MF | IP_OFFMASK))) goto deliver_now; th = (struct tcphdr *)(iph + 1); } else if (l3_proto == htons(ETHERTYPE_IPV6)) { struct ip6_hdr *iph = nh; - if (iph->ip6_nxt != IPPROTO_TCP) - goto deliver_now; + + KASSERT(iph->ip6_nxt == IPPROTO_TCP, + ("IPv6 next header is not TCP, but packet marker is set")); l2_id |= SFXGE_LRO_L2_ID_IPV6; th = (struct tcphdr *)(iph + 1); } else { @@ -834,7 +837,9 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq /* Pass packet up the stack or into LRO (pipelined) */ if (prev != NULL) { - if (lro_enabled) + if (lro_enabled && + ((prev->flags & (EFX_PKT_TCP | EFX_CKSUM_TCPUDP)) == +(EFX_PKT_TCP | EFX_CKSUM_TCPUDP))) sfxge_lro(rxq, prev); else sfxge_rx_deliver(sc, prev); @@ -853,7 +858,9 @@ discard: /* Pass last packet up the stack or into LRO */ if (prev != NULL) { - if (lro_enabled) + if (lro_enabled && + ((prev->flags & (EFX_PKT_TCP | EFX_CKSUM_TCPUDP)) == +(EFX_PKT_TCP | EFX_CKSUM_TCPUDP))) sfxge_lro(rxq, prev); else sfxge_rx_deliver(sc, prev); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283207 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:06:41 2015 New Revision: 283207 URL: https://svnweb.freebsd.org/changeset/base/283207 Log: MFC: r282941 sfxge: do not change CSUM_TSO when IFCAP_TSOx is changed It is simply not required since the kernel checks corresponding IFCAP_TSOx capability and CSUM_TSO in hw-assisted offloads. Note that CSUM_TSO is two bits (CSUM_IP_TSO|CSUM_IP6_TSO) and both bits are set in IPv4 and IPv6 mbufs. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c == --- stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:05:13 2015 (r283206) +++ stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:06:41 2015 (r283207) @@ -281,10 +281,14 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign ifp->if_hwassist |= (CSUM_TCP_IPV6 | CSUM_UDP_IPV6); else ifp->if_hwassist &= ~(CSUM_TCP_IPV6 | CSUM_UDP_IPV6); - if (ifp->if_capenable & IFCAP_TSO) - ifp->if_hwassist |= CSUM_TSO; - else - ifp->if_hwassist &= ~CSUM_TSO; + + /* +* The kernel takes both IFCAP_TSOx and CSUM_TSO into +* account before using TSO. So, we do not touch +* checksum flags when IFCAP_TSOx is modified. +* Note that CSUM_TSO is (CSUM_IP_TSO|CSUM_IP6_TSO), +* but both bits are set in IPv4 and IPv6 mbufs. +*/ SFXGE_ADAPTER_UNLOCK(sc); break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283208 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:08:10 2015 New Revision: 283208 URL: https://svnweb.freebsd.org/changeset/base/283208 Log: MFC: r282942 sfxge: split sfxge_tx_qdpl_put() into *_locked() and *_unlocked() It simplifies understanding of the sfxge_tx_packet_add() logic and avoids passing of 'locked' to called function. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c == --- stable/10/sys/dev/sfxge/sfxge_tx.c Thu May 21 09:06:41 2015 (r283207) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Thu May 21 09:08:10 2015 (r283208) @@ -521,18 +521,10 @@ sfxge_tx_qdpl_service(struct sfxge_txq * } /* - * Put a packet on the deferred packet list. - * - * If we are called with the txq lock held, we put the packet on the "get - * list", otherwise we atomically push it on the "put list". The swizzle - * function takes care of ordering. - * - * The length of the put list is bounded by SFXGE_TX_MAX_DEFERRED. We - * overload the csum_data field in the mbuf to keep track of this length - * because there is no cheap alternative to avoid races. + * Put a packet on the deferred packet get-list. */ static int -sfxge_tx_qdpl_put(struct sfxge_txq *txq, struct mbuf *mbuf, int locked) +sfxge_tx_qdpl_put_locked(struct sfxge_txq *txq, struct mbuf *mbuf) { struct sfxge_tx_dpl *stdp; @@ -540,52 +532,66 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, KASSERT(mbuf->m_nextpkt == NULL, ("mbuf->m_nextpkt != NULL")); - if (locked) { - SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); - - sfxge_tx_qdpl_swizzle(txq); + SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); - if (stdp->std_get_count >= stdp->std_get_max) { - txq->get_overflow++; + if (stdp->std_get_count >= stdp->std_get_max) { + txq->get_overflow++; + return (ENOBUFS); + } + if (sfxge_is_mbuf_non_tcp(mbuf)) { + if (stdp->std_get_non_tcp_count >= + stdp->std_get_non_tcp_max) { + txq->get_non_tcp_overflow++; return (ENOBUFS); } - if (sfxge_is_mbuf_non_tcp(mbuf)) { - if (stdp->std_get_non_tcp_count >= - stdp->std_get_non_tcp_max) { - txq->get_non_tcp_overflow++; - return (ENOBUFS); - } - stdp->std_get_non_tcp_count++; - } - - *(stdp->std_getp) = mbuf; - stdp->std_getp = &mbuf->m_nextpkt; - stdp->std_get_count++; - } else { - volatile uintptr_t *putp; - uintptr_t old; - uintptr_t new; - unsigned old_len; - - putp = &stdp->std_put; - new = (uintptr_t)mbuf; - - do { - old = *putp; - if (old != 0) { - struct mbuf *mp = (struct mbuf *)old; - old_len = mp->m_pkthdr.csum_data; - } else - old_len = 0; - if (old_len >= stdp->std_put_max) { - atomic_add_long(&txq->put_overflow, 1); - return (ENOBUFS); - } - mbuf->m_pkthdr.csum_data = old_len + 1; - mbuf->m_nextpkt = (void *)old; - } while (atomic_cmpset_ptr(putp, old, new) == 0); + stdp->std_get_non_tcp_count++; } + *(stdp->std_getp) = mbuf; + stdp->std_getp = &mbuf->m_nextpkt; + stdp->std_get_count++; + + return (0); +} + +/* + * Put a packet on the deferred packet put-list. + * + * We overload the csum_data field in the mbuf to keep track of this length + * because there is no cheap alternative to avoid races. + */ +static int +sfxge_tx_qdpl_put_unlocked(struct sfxge_txq *txq, struct mbuf *mbuf) +{ + struct sfxge_tx_dpl *stdp; + volatile uintptr_t *putp; + uintptr_t old; + uintptr_t new; + unsigned old_len; + + KASSERT(mbuf->m_nextpkt == NULL, ("mbuf->m_nextpkt != NULL")); + + SFXGE_TXQ_LOCK_ASSERT_NOTOWNED(txq); + + stdp = &txq->dpl; + putp = &stdp->std_put; + new = (uintptr_t)mbuf; + + do { + old = *putp; + if (old != 0) { + struct mbuf *mp = (struct mbuf *)old; + old_len = mp->m_pkthdr.csum_data; + } else + old_len = 0; + if (old_len >= stdp->std_put_max) { + ato
svn commit: r283209 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:09:51 2015 New Revision: 283209 URL: https://svnweb.freebsd.org/changeset/base/283209 Log: MFC: r282996 sfxge: support Rx checksum offloads disabling We can't disable it in HW, but we can ignore result. Discard Rx descriptor checksum flags if Rx checksum offload is off. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c == --- stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:08:10 2015 (r283208) +++ stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:09:51 2015 (r283209) @@ -64,8 +64,7 @@ __FBSDID("$FreeBSD$"); IFCAP_JUMBO_MTU | IFCAP_LRO |\ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) #defineSFXGE_CAP_ENABLE SFXGE_CAP -#defineSFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_RXCSUM | IFCAP_VLAN_HWCSUM | \ -IFCAP_RXCSUM_IPV6 |\ +#defineSFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM | \ IFCAP_JUMBO_MTU | IFCAP_LINKSTATE) MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); Modified: stable/10/sys/dev/sfxge/sfxge_rx.c == --- stable/10/sys/dev/sfxge/sfxge_rx.c Thu May 21 09:08:10 2015 (r283208) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Thu May 21 09:09:51 2015 (r283209) @@ -788,7 +788,8 @@ void sfxge_rx_qcomplete(struct sfxge_rxq *rxq, boolean_t eop) { struct sfxge_softc *sc = rxq->sc; - int lro_enabled = sc->ifnet->if_capenable & IFCAP_LRO; + int if_capenable = sc->ifnet->if_capenable; + int lro_enabled = if_capenable & IFCAP_LRO; unsigned int index; struct sfxge_evq *evq; unsigned int completed; @@ -818,21 +819,37 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq prefetch_read_many(mtod(m, caddr_t)); - /* Check for loopback packets */ - if (!(rx_desc->flags & EFX_PKT_IPV4) && - !(rx_desc->flags & EFX_PKT_IPV6)) { - struct ether_header *etherhp; - - /*LINTED*/ - etherhp = mtod(m, struct ether_header *); - - if (etherhp->ether_type == - htons(SFXGE_ETHERTYPE_LOOPBACK)) { - EFSYS_PROBE(loopback); - - rxq->loopback++; - goto discard; + switch (rx_desc->flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) { + case EFX_PKT_IPV4: + if (~if_capenable & IFCAP_RXCSUM) + rx_desc->flags &= + ~(EFX_CKSUM_IPV4 | EFX_CKSUM_TCPUDP); + break; + case EFX_PKT_IPV6: + if (~if_capenable & IFCAP_RXCSUM_IPV6) + rx_desc->flags &= ~EFX_CKSUM_TCPUDP; + break; + case 0: + /* Check for loopback packets */ + { + struct ether_header *etherhp; + + /*LINTED*/ + etherhp = mtod(m, struct ether_header *); + + if (etherhp->ether_type == + htons(SFXGE_ETHERTYPE_LOOPBACK)) { + EFSYS_PROBE(loopback); + + rxq->loopback++; + goto discard; + } } + break; + default: + KASSERT(B_FALSE, + ("Rx descriptor with both IPv4 and IPv6 flags")); + goto discard; } /* Pass packet up the stack or into LRO (pipelined) */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283210 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:11:03 2015 New Revision: 283210 URL: https://svnweb.freebsd.org/changeset/base/283210 Log: MFC: r282997 sfxge: get rid of locked variable in sfxge_tx_packet_add() Now each branch has one and only one possible TxQ lock state. It simplifies understanding of the code. 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 Thu May 21 09:09:51 2015 (r283209) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Thu May 21 09:11:03 2015 (r283210) @@ -602,7 +602,6 @@ sfxge_tx_qdpl_put_unlocked(struct sfxge_ int sfxge_tx_packet_add(struct sfxge_txq *txq, struct mbuf *m) { - int locked; int rc; if (!SFXGE_LINK_UP(txq->sc)) { @@ -616,9 +615,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx * the packet will be appended to the "get list" of the deferred * packet list. Otherwise, it will be pushed on the "put list". */ - locked = SFXGE_TXQ_TRYLOCK(txq); - - if (locked) { + if (SFXGE_TXQ_TRYLOCK(txq)) { /* First swizzle put-list to get-list to keep order */ sfxge_tx_qdpl_swizzle(txq); @@ -627,6 +624,10 @@ sfxge_tx_packet_add(struct sfxge_txq *tx SFXGE_TXQ_UNLOCK(txq); goto fail; } + + /* Try to service the list. */ + sfxge_tx_qdpl_service(txq); + /* Lock has been dropped. */ } else { rc = sfxge_tx_qdpl_put_unlocked(txq, m); if (rc != 0) @@ -639,14 +640,13 @@ sfxge_tx_packet_add(struct sfxge_txq *tx * the deferred packet list. If we are not able to get * the lock, another thread is processing the list. */ - locked = SFXGE_TXQ_TRYLOCK(txq); + if (SFXGE_TXQ_TRYLOCK(txq)) { + sfxge_tx_qdpl_service(txq); + /* Lock has been dropped. */ + } } - if (locked) { - /* Try to service the list. */ - sfxge_tx_qdpl_service(txq); - /* Lock has been dropped. */ - } + SFXGE_TXQ_LOCK_ASSERT_NOTOWNED(txq); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283211 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:12:25 2015 New Revision: 283211 URL: https://svnweb.freebsd.org/changeset/base/283211 Log: MFC: r282998 sfxge: move mbuf free to sfxge_if_transmit() It is a preparation to the next patch which will service packet queue even if packet addtion fails. 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 Thu May 21 09:11:03 2015 (r283210) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Thu May 21 09:12:25 2015 (r283211) @@ -605,9 +605,8 @@ sfxge_tx_packet_add(struct sfxge_txq *tx int rc; if (!SFXGE_LINK_UP(txq->sc)) { - rc = ENETDOWN; atomic_add_long(&txq->netdown_drops, 1); - goto fail; + return (ENETDOWN); } /* @@ -622,7 +621,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx rc = sfxge_tx_qdpl_put_locked(txq, m); if (rc != 0) { SFXGE_TXQ_UNLOCK(txq); - goto fail; + return (rc); } /* Try to service the list. */ @@ -631,7 +630,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx } else { rc = sfxge_tx_qdpl_put_unlocked(txq, m); if (rc != 0) - goto fail; + return (rc); /* * Try to grab the lock again. @@ -649,10 +648,6 @@ sfxge_tx_packet_add(struct sfxge_txq *tx SFXGE_TXQ_LOCK_ASSERT_NOTOWNED(txq); return (0); - -fail: - m_freem(m); - return (rc); } static void @@ -730,6 +725,8 @@ sfxge_if_transmit(struct ifnet *ifp, str } rc = sfxge_tx_packet_add(txq, m); + if (rc != 0) + m_freem(m); return (rc); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283212 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:13:47 2015 New Revision: 283212 URL: https://svnweb.freebsd.org/changeset/base/283212 Log: MFC: r283000 sfxge: add local variable with changed capabilities mask It is required for the next patch which adds dependency of TSO capabilities from Tx checksum offloads. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c == --- stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:12:25 2015 (r283211) +++ stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:13:47 2015 (r283212) @@ -257,26 +257,36 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign sfxge_mac_filter_set(sc); break; case SIOCSIFCAP: + { + int reqcap = ifr->ifr_reqcap; + int capchg_mask; + SFXGE_ADAPTER_LOCK(sc); + /* Capabilities to be changed in accordance with request */ + capchg_mask = ifp->if_capenable ^ reqcap; + /* * The networking core already rejects attempts to * enable capabilities we don't have. We still have * to reject attempts to disable capabilities that we * can't (yet) disable. */ - if (~ifr->ifr_reqcap & SFXGE_CAP_FIXED) { + KASSERT((reqcap & ~ifp->if_capabilities) == 0, + ("Unsupported capabilities %x requested %x vs %x", +reqcap & ~ifp->if_capabilities, +reqcap , ifp->if_capabilities)); + if (capchg_mask & SFXGE_CAP_FIXED) { error = EINVAL; SFXGE_ADAPTER_UNLOCK(sc); break; } - ifp->if_capenable = ifr->ifr_reqcap; - if (ifp->if_capenable & IFCAP_TXCSUM) + if (reqcap & IFCAP_TXCSUM) ifp->if_hwassist |= (CSUM_IP | CSUM_TCP | CSUM_UDP); else ifp->if_hwassist &= ~(CSUM_IP | CSUM_TCP | CSUM_UDP); - if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) + if (reqcap & IFCAP_TXCSUM_IPV6) ifp->if_hwassist |= (CSUM_TCP_IPV6 | CSUM_UDP_IPV6); else ifp->if_hwassist &= ~(CSUM_TCP_IPV6 | CSUM_UDP_IPV6); @@ -289,8 +299,11 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign * but both bits are set in IPv4 and IPv6 mbufs. */ + ifp->if_capenable = reqcap; + SFXGE_ADAPTER_UNLOCK(sc); break; + } case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->media, command); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283213 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:15:19 2015 New Revision: 283213 URL: https://svnweb.freebsd.org/changeset/base/283213 Log: MFC: r283007 sfxge: avoid usage of ifm_data The driver uses ifm_data to save capabilities mask calculated during initialization when supported phy modes are discovered. The patch simply calculates it when either media or options are changed. 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.cThu May 21 09:13:47 2015 (r283212) +++ stable/10/sys/dev/sfxge/sfxge_port.cThu May 21 09:15:19 2015 (r283213) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include "sfxge.h" +static int sfxge_phy_cap_mask(struct sfxge_softc *, int, uint32_t *); + static int sfxge_mac_stat_update(struct sfxge_softc *sc) { @@ -381,6 +383,7 @@ sfxge_port_start(struct sfxge_softc *sc) efx_nic_t *enp; size_t pdu; int rc; + uint32_t phy_cap_mask; port = &sc->port; enp = sc->enp; @@ -421,10 +424,13 @@ sfxge_port_start(struct sfxge_softc *sc) if ((rc = efx_mac_drain(enp, B_FALSE)) != 0) goto fail3; - if ((rc = efx_phy_adv_cap_set(sc->enp, sc->media.ifm_cur->ifm_data)) - != 0) + if ((rc = sfxge_phy_cap_mask(sc, sc->media.ifm_cur->ifm_media, +&phy_cap_mask)) != 0) goto fail4; + if ((rc = efx_phy_adv_cap_set(sc->enp, phy_cap_mask)) != 0) + goto fail5; + port->init_state = SFXGE_PORT_STARTED; /* Single poll in case there were missing initial events */ @@ -433,6 +439,7 @@ sfxge_port_start(struct sfxge_softc *sc) return (0); +fail5: fail4: (void)efx_mac_drain(enp, B_TRUE); fail3: @@ -676,12 +683,95 @@ sfxge_media_status(struct ifnet *ifp, st SFXGE_ADAPTER_UNLOCK(sc); } +static efx_phy_cap_type_t +sfxge_link_mode_to_phy_cap(efx_link_mode_t mode) +{ + switch (mode) { + case EFX_LINK_10HDX: + return (EFX_PHY_CAP_10HDX); + case EFX_LINK_10FDX: + return (EFX_PHY_CAP_10FDX); + case EFX_LINK_100HDX: + return (EFX_PHY_CAP_100HDX); + case EFX_LINK_100FDX: + return (EFX_PHY_CAP_100FDX); + case EFX_LINK_1000HDX: + return (EFX_PHY_CAP_1000HDX); + case EFX_LINK_1000FDX: + return (EFX_PHY_CAP_1000FDX); + case EFX_LINK_1FDX: + return (EFX_PHY_CAP_1FDX); + default: + EFSYS_ASSERT(B_FALSE); + return (EFX_PHY_CAP_INVALID); + } +} + +static int +sfxge_phy_cap_mask(struct sfxge_softc *sc, int ifmedia, uint32_t *phy_cap_mask) +{ + efx_phy_media_type_t medium_type; + boolean_t mode_found = B_FALSE; + uint32_t cap_mask, mode_cap_mask; + efx_link_mode_t mode; + efx_phy_cap_type_t phy_cap; + + efx_phy_media_type_get(sc->enp, &medium_type); + if (medium_type >= nitems(sfxge_link_mode)) { + if_printf(sc->ifnet, "unexpected media type %d\n", medium_type); + return (EINVAL); + } + + 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]) { + mode_found = B_TRUE; + break; + } + } + + if (!mode_found) { + /* +* 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)); + *phy_cap_mask = (cap_mask & ~(1 << EFX_PHY_CAP_ASYM)); + return (0); + } + + phy_cap = sfxge_link_mode_to_phy_cap(mode); + if (phy_cap == EFX_PHY_CAP_INVALID) { + if_printf(sc->ifnet, + "cannot map link mode %d to phy capability\n", + mode); + return (EINVAL); + } + + mode_cap_mask = (1 << phy_cap); + mode_cap_mask |= cap_mask & (1 << EFX_PHY_CAP_AN); +#ifdef SFXGE_HAVE_PAUSE_MEDIAOPTS + if (ifmedia & IFM_ETH_RXPAUSE) + mode_cap_mask |= cap_mask & (1 << EFX_PHY_CAP_PAUSE); + if (!(ifmedia & IFM_ETH_TXPAUSE)) + mode_cap_mask |= cap_mask & (1 << EFX_PHY_CAP_ASYM); +#else + mode_cap_mask |= cap_mask & (1 << EFX_PHY_CAP_PAUSE); +#endif + + *phy_cap_mask = mode_cap_mask; + return (0); +} + static int sfxge_media_change(struct ifnet *ifp) { struct sf
svn commit: r283214 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:21:05 2015 New Revision: 283214 URL: https://svnweb.freebsd.org/changeset/base/283214 Log: MFC: r283048 sfxge: fix overflow queue freeze If TxQ lock is obtained, deferred packet list shold be serviced even if the packet addition fails because of overflow. Without the patch freeze happens if: - queue is not blocked (i.e. completion does not trigger unblock and service) - put-list overflow (1024 entries) - sfxge_tx_packet_add() acquires TxQ lock just as it is released it in sfxge_tx_qdpl_service() on the second CPU but before pending check - sfxge_tx_packet_add() swizzles put-list to get-list, fails because of non-tcp get-list overflow and returns without packet list service - sfxge_tx_qdpl_service() on the second CPU checks that there are no pending packets in the put-list and returns Other possible solution is to guaranee that maximum length of the put-list is less than maximum length of any get-list. 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 Thu May 21 09:15:19 2015 (r283213) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Thu May 21 09:21:05 2015 (r283214) @@ -619,18 +619,12 @@ sfxge_tx_packet_add(struct sfxge_txq *tx sfxge_tx_qdpl_swizzle(txq); rc = sfxge_tx_qdpl_put_locked(txq, m); - if (rc != 0) { - SFXGE_TXQ_UNLOCK(txq); - return (rc); - } /* Try to service the list. */ sfxge_tx_qdpl_service(txq); /* Lock has been dropped. */ } else { rc = sfxge_tx_qdpl_put_unlocked(txq, m); - if (rc != 0) - return (rc); /* * Try to grab the lock again. @@ -639,7 +633,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx * the deferred packet list. If we are not able to get * the lock, another thread is processing the list. */ - if (SFXGE_TXQ_TRYLOCK(txq)) { + if ((rc == 0) && SFXGE_TXQ_TRYLOCK(txq)) { sfxge_tx_qdpl_service(txq); /* Lock has been dropped. */ } @@ -647,7 +641,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx SFXGE_TXQ_LOCK_ASSERT_NOTOWNED(txq); - return (0); + return (rc); } static void ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283215 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:22:15 2015 New Revision: 283215 URL: https://svnweb.freebsd.org/changeset/base/283215 Log: MFC: r283049 sfxge: allow to disable checksum offloads over VLAN It just affects capabilities of the created VLAN interface. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c == --- stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:21:05 2015 (r283214) +++ stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:22:15 2015 (r283215) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); IFCAP_JUMBO_MTU | IFCAP_LRO |\ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) #defineSFXGE_CAP_ENABLE SFXGE_CAP -#defineSFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM | \ +#defineSFXGE_CAP_FIXED (IFCAP_VLAN_MTU | \ IFCAP_JUMBO_MTU | IFCAP_LINKSTATE) MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283216 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:23:28 2015 New Revision: 283216 URL: https://svnweb.freebsd.org/changeset/base/283216 Log: MFC: r283050 sfxge: automatically turn off TSO when Tx checksum offload is disabled Also return error if TSO is requested without Tx checksum offload. Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c == --- stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:22:15 2015 (r283215) +++ stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:23:28 2015 (r283216) @@ -59,8 +59,9 @@ __FBSDID("$FreeBSD$"); #include "sfxge_version.h" #defineSFXGE_CAP (IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM | \ - IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO |\ + IFCAP_RXCSUM | IFCAP_TXCSUM |\ IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6 | \ + IFCAP_TSO4 | IFCAP_TSO6 |\ IFCAP_JUMBO_MTU | IFCAP_LRO |\ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) #defineSFXGE_CAP_ENABLE SFXGE_CAP @@ -282,14 +283,42 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign break; } - if (reqcap & IFCAP_TXCSUM) + /* Check request before any changes */ + if ((capchg_mask & IFCAP_TSO4) && + (reqcap & (IFCAP_TSO4 | IFCAP_TXCSUM)) == IFCAP_TSO4) { + error = EAGAIN; + SFXGE_ADAPTER_UNLOCK(sc); + if_printf(ifp, "enable txcsum before tso4\n"); + break; + } + if ((capchg_mask & IFCAP_TSO6) && + (reqcap & (IFCAP_TSO6 | IFCAP_TXCSUM_IPV6)) == IFCAP_TSO6) { + error = EAGAIN; + SFXGE_ADAPTER_UNLOCK(sc); + if_printf(ifp, "enable txcsum6 before tso6\n"); + break; + } + + if (reqcap & IFCAP_TXCSUM) { ifp->if_hwassist |= (CSUM_IP | CSUM_TCP | CSUM_UDP); - else + } else { ifp->if_hwassist &= ~(CSUM_IP | CSUM_TCP | CSUM_UDP); - if (reqcap & IFCAP_TXCSUM_IPV6) + if (reqcap & IFCAP_TSO4) { + reqcap &= ~IFCAP_TSO4; + if_printf(ifp, + "tso4 disabled due to -txcsum\n"); + } + } + if (reqcap & IFCAP_TXCSUM_IPV6) { ifp->if_hwassist |= (CSUM_TCP_IPV6 | CSUM_UDP_IPV6); - else + } else { ifp->if_hwassist &= ~(CSUM_TCP_IPV6 | CSUM_UDP_IPV6); + if (reqcap & IFCAP_TSO6) { + reqcap &= ~IFCAP_TSO6; + if_printf(ifp, + "tso6 disabled due to -txcsum6\n"); + } + } /* * The kernel takes both IFCAP_TSOx and CSUM_TSO into ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283217 - stable/10/sys/dev/sfxge
Author: arybchik Date: Thu May 21 09:24:35 2015 New Revision: 283217 URL: https://svnweb.freebsd.org/changeset/base/283217 Log: MFC: r283051 sfxge: do not advertise LRO capability if LRO is compiled out Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge.c == --- stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:23:28 2015 (r283216) +++ stable/10/sys/dev/sfxge/sfxge.c Thu May 21 09:24:35 2015 (r283217) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); IFCAP_RXCSUM | IFCAP_TXCSUM |\ IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6 | \ IFCAP_TSO4 | IFCAP_TSO6 |\ - IFCAP_JUMBO_MTU | IFCAP_LRO |\ + IFCAP_JUMBO_MTU |\ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) #defineSFXGE_CAP_ENABLE SFXGE_CAP #defineSFXGE_CAP_FIXED (IFCAP_VLAN_MTU | \ @@ -88,7 +88,6 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, &sfxge_tx_ring_entries, 0, "Maximum number of descriptors in a transmit ring"); - static void sfxge_reset(void *arg, int npending); @@ -376,6 +375,12 @@ sfxge_ifnet_init(struct ifnet *ifp, stru ifp->if_capabilities = SFXGE_CAP; ifp->if_capenable = SFXGE_CAP_ENABLE; + +#ifdef SFXGE_LRO + ifp->if_capabilities |= IFCAP_LRO; + ifp->if_capenable |= IFCAP_LRO; +#endif + ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | CSUM_TCP_IPV6 | CSUM_UDP_IPV6; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r283197 - head/usr.bin/soelim
On Thu, 21 May 2015, Baptiste Daroussin wrote: Log: add an include on sys/types.h because we do explicitly use size_t remove unused stdbool.h sys/types.h may be needed for some other typedef, but not for size_t. size_t is already declared in at least 3 other of the included headers: - and (C90 standard) - (POSIX.1-2001 standard) is a prerequisite for in POSIX.1-1990, and most section 2 man pages still document it as a prerequiste for their syscalls. They place it before the include of but are too fuzzy to document if it is a prerequisite for includes and thus gets size_t and lots of pollution. was cleaned up a bit in 2002, but the ifdefs for things like _SIZE_T_DECLARED in this cleanup are still nonsense, because still includes before these ifdefs and thus gets size_t and lots of pollution, much the same as in FreeBSD-1. Some of the section 2 headers were bogusly changed to say that sys/types.h is a prerequisite for their syscalls _after_ POSIX.1-2001 standardized it not being a prerequisite for for the syscalls declared there. It is needed for portability to pre-POSIX.1-2001 systems that are not polluted like FreeBSD, if any. IIRC, even POSIX.1-1990 permits (or any POSIX header) to declare any typedef ending in _t, so can declare size_t for itself and might even work without its prerequisite. Applications just cannot depend on this. In the previous change, the use of MAXPATHLEN regressed to use of PATH_MAX. MAXPATHLEN was honestly unportable. It defined in all (?) BSD systems. PATH_MAX only defined if {PATH_MAX} is constant. It is better to be honestly unportable than to use PATH_MAX incorrectly. MAXPATHLEN required the include of . That gave and lots of undocumented pollution. Apparently, none of the pollution was needed, not even . Bruce ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283218 - stable/10/sys/dev/xen/netfront
Author: royger Date: Thu May 21 10:28:33 2015 New Revision: 283218 URL: https://svnweb.freebsd.org/changeset/base/283218 Log: MFC: r282908 netfront: wait for backend to connect before sending ARP Sponsored by: Citrix Systems R&D Modified: stable/10/sys/dev/xen/netfront/netfront.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/xen/netfront/netfront.c == --- stable/10/sys/dev/xen/netfront/netfront.c Thu May 21 09:24:35 2015 (r283217) +++ stable/10/sys/dev/xen/netfront/netfront.c Thu May 21 10:28:33 2015 (r283218) @@ -683,7 +683,6 @@ netfront_backend_changed(device_t dev, X switch (newstate) { case XenbusStateInitialising: case XenbusStateInitialised: - case XenbusStateConnected: case XenbusStateUnknown: case XenbusStateClosed: case XenbusStateReconfigured: @@ -695,13 +694,15 @@ netfront_backend_changed(device_t dev, X if (network_connect(sc) != 0) break; xenbus_set_state(dev, XenbusStateConnected); -#ifdef INET - netfront_send_fake_arp(dev, sc); -#endif break; case XenbusStateClosing: xenbus_set_state(dev, XenbusStateClosed); break; + case XenbusStateConnected: +#ifdef INET + netfront_send_fake_arp(dev, sc); +#endif + break; } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283219 - in stable/10/sys: conf dev/atkbdc
Author: royger Date: Thu May 21 10:40:18 2015 New Revision: 283219 URL: https://svnweb.freebsd.org/changeset/base/283219 Log: MFC: r282269, r282277 atkbd: remove usage of x86bios Remove leftover from r282269. Modified: stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/atkbdc/atkbd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 == --- stable/10/sys/conf/files.amd64 Thu May 21 10:28:33 2015 (r283218) +++ stable/10/sys/conf/files.amd64 Thu May 21 10:40:18 2015 (r283219) @@ -531,10 +531,10 @@ compat/ndis/winx64_wrap.S optionalndisa libkern/memmove.c standard libkern/memset.c standard # -# x86 real mode BIOS emulator, required by atkbdc/dpms/vesa +# x86 real mode BIOS emulator, required by dpms/vesa # -compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa -contrib/x86emu/x86emu.coptional x86bios | atkbd | dpms | vesa +compat/x86bios/x86bios.c optional x86bios | dpms | vesa +contrib/x86emu/x86emu.coptional x86bios | dpms | vesa # # bvm console # Modified: stable/10/sys/conf/files.i386 == --- stable/10/sys/conf/files.i386 Thu May 21 10:28:33 2015 (r283218) +++ stable/10/sys/conf/files.i386 Thu May 21 10:40:18 2015 (r283219) @@ -552,9 +552,9 @@ i386/xbox/xboxfb.c optional xboxfb dev/fb/boot_font.c optional xboxfb i386/xbox/pic16l.s optional xbox # -# x86 real mode BIOS support, required by atkbdc/dpms/vesa +# x86 real mode BIOS support, required by dpms/vesa # -compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa +compat/x86bios/x86bios.c optional x86bios | dpms | vesa # # x86 shared code between IA32, AMD64 and PC98 architectures # Modified: stable/10/sys/dev/atkbdc/atkbd.c == --- stable/10/sys/dev/atkbdc/atkbd.cThu May 21 10:28:33 2015 (r283218) +++ stable/10/sys/dev/atkbdc/atkbd.cThu May 21 10:40:18 2015 (r283219) @@ -44,19 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__i386__) || defined(__amd64__) -#include -#include -#include -#include - -#include -#include -#include - -#include -#endif /* __i386__ || __amd64__ */ - #include #include #include @@ -65,6 +52,9 @@ __FBSDID("$FreeBSD$"); static timeout_t atkbd_timeout; static voidatkbd_shutdown_final(void *v); +#define DEFAULT_DELAY 0x1 /* 500ms */ +#define DEFAULT_RATE 0x10 /* 14Hz */ + int atkbd_probe_unit(device_t dev, int irq, int flags) { @@ -239,7 +229,7 @@ static keyboard_switch_t atkbdsw = { KEYBOARD_DRIVER(atkbd, atkbdsw, atkbd_configure); /* local functions */ -static int get_typematic(keyboard_t *kbd); +static int set_typematic(keyboard_t *kbd); static int setup_kbd_port(KBDC kbdc, int port, int intr); static int get_kbd_echo(KBDC kbdc); static int probe_keyboard(KBDC kbdc, int flags); @@ -433,7 +423,7 @@ atkbd_init(int unit, keyboard_t **kbdp, goto bad; } atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state); - get_typematic(kbd); + set_typematic(kbd); delay[0] = kbd->kb_delay1; delay[1] = kbd->kb_delay2; atkbd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); @@ -490,7 +480,7 @@ atkbd_intr(keyboard_t *kbd, void *arg) init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config); KBD_FOUND_DEVICE(kbd); atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state); - get_typematic(kbd); + set_typematic(kbd); delay[0] = kbd->kb_delay1; delay[1] = kbd->kb_delay2; atkbd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); @@ -1089,57 +1079,19 @@ atkbd_shutdown_final(void *v) /* local functions */ static int -get_typematic(keyboard_t *kbd) +set_typematic(keyboard_t *kbd) { -#if defined(__i386__) || defined(__amd64__) - /* -* Only some systems allow us to retrieve the keyboard repeat -* rate previously set via the BIOS... -*/ - x86regs_t regs; - uint8_t *p; + int val, error; + atkbd_state_t *state = kbd->kb_data; - /* -* Traditional entry points of int 0x15 and 0x16 are fixed -* and later BIOSes follow them. (U)EFI CSM specification -* also mandates these fixed entry points. -* -* Validate the entry points here before we proceed further. -* It's known that some recent laptops does not have the -* same entry point and
svn commit: r283220 - in head: lib lib/libmandoc share/mk usr.bin/mandoc
Author: bapt Date: Thu May 21 12:51:56 2015 New Revision: 283220 URL: https://svnweb.freebsd.org/changeset/base/283220 Log: Drop libmandoc and incorporate it into the main mandoc Makefile This simplifies maintainance of mandoc(1). Note that the same direction was taken on OpenBSD Deleted: head/lib/libmandoc/ Modified: head/lib/Makefile head/share/mk/src.libnames.mk head/usr.bin/mandoc/Makefile Modified: head/lib/Makefile == --- head/lib/Makefile Thu May 21 10:40:18 2015(r283219) +++ head/lib/Makefile Thu May 21 12:51:56 2015(r283220) @@ -65,7 +65,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libldns} \ liblzma \ ${_libmagic} \ - libmandoc \ libmemstat \ libmd \ ${_libmilter} \ Modified: head/share/mk/src.libnames.mk == --- head/share/mk/src.libnames.mk Thu May 21 10:40:18 2015 (r283219) +++ head/share/mk/src.libnames.mk Thu May 21 12:51:56 2015 (r283220) @@ -32,7 +32,6 @@ _INTERNALLIBS=\ fifolog \ ipf \ lpr \ - mandoc \ netbsd \ ntp \ ntpevent \ @@ -108,7 +107,6 @@ _LIBRARIES= \ lzma \ m \ magic \ - mandoc \ md \ memstat \ mp \ @@ -314,9 +312,6 @@ LIBREADLINE?= ${LIBREADLINEDIR}/libreadl LIBOHASHDIR= ${ROOTOBJDIR}/lib/libohash LIBOHASH?= ${LIBOHASHDIR}/libohash.a -LIBMANDOCDIR= ${ROOTOBJDIR}/lib/libmandoc -LIBMANDOC?=${LIBMANDOCDIR}/libmandoc.a - LIBSMDIR= ${ROOTOBJDIR}/lib/libsm LIBSM?=${LIBSMDIR}/libsm.a Modified: head/usr.bin/mandoc/Makefile == --- head/usr.bin/mandoc/MakefileThu May 21 10:40:18 2015 (r283219) +++ head/usr.bin/mandoc/MakefileThu May 21 12:51:56 2015 (r283220) @@ -9,6 +9,37 @@ FILESDIR= ${SHAREDIR}/mdocml MAN= mandoc.1 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 # roff.7 MLINKS= mandoc.1 mdocml.1 +LIBMAN_SRCS= man.c \ + man_hash.c \ + man_macro.c \ + man_validate.c + +LIBMDOC_SRCS= att.c \ + lib.c \ + mdoc.c \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_macro.c \ + mdoc_validate.c \ + st.c \ + +LIBROFF_SRCS= eqn.c \ + roff.c \ + tbl.c \ + tbl_data.c \ + tbl_layout.c \ + tbl_opts.c \ + +LIB_SRCS= ${LIBMAN_SRCS} \ + ${LIBMDOC_SRCS} \ + ${LIBROFF_SRCS} \ + chars.c \ + mandoc.c \ + mandoc_aux.c \ + msec.c \ + preconv.c \ + read.c + HTML_SRCS= eqn_html.c \ html.c \ man_html.c \ @@ -30,7 +61,8 @@ DB_SRCS= mandocdb.c \ mansearch_const.c \ manpath.c -SRCS= ${HTML_SRCS} \ +SRCS= ${LIB_SRCS} \ + ${HTML_SRCS} \ ${MAN_SRCS} \ ${TERM_SRCS} \ main.c \ @@ -43,6 +75,6 @@ WARNS?= 2 CFLAGS+= -DHAVE_CONFIG_H \ -I${.CURDIR}/../../lib/libohash/ \ -I${.CURDIR}/../../contrib/sqlite3 -LIBADD=mandoc ohash sqlite3 +LIBADD=ohash sqlite3 .include ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283221 - in head/usr.bin: . demandoc
Author: bapt Date: Thu May 21 13:02:43 2015 New Revision: 283221 URL: https://svnweb.freebsd.org/changeset/base/283221 Log: Remove demandoc(1) from the build Deleted: head/usr.bin/demandoc/ Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Thu May 21 12:51:56 2015(r283220) +++ head/usr.bin/Makefile Thu May 21 13:02:43 2015(r283221) @@ -37,7 +37,6 @@ SUBDIR= ${_addr2line} \ ctlstat \ cut \ ${_cxxfilt} \ - demandoc \ dirname \ dpv \ du \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283222 - head
Author: bapt Date: Thu May 21 13:04:14 2015 New Revision: 283222 URL: https://svnweb.freebsd.org/changeset/base/283222 Log: Removed files not installed anymore with mandoc Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Thu May 21 13:02:43 2015(r283221) +++ head/ObsoleteFiles.inc Thu May 21 13:04:14 2015(r283222) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20150521 +OLD_FILES+=usr/bin/demandoc +OLD_FILES+=usr/share/man/man1/demandoc.1.gz +OLD_FILES+=usr/share/man/man3/mandoc.3.gz +OLD_FILES+=usr/share/man/man3/mandoc_headers.3.gz # 20150520 OLD_FILES+=usr/lib/libheimsqlite.a OLD_FILES+=usr/lib/libheimsqlite.so ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283223 - in stable/10: etc etc/autofs usr.sbin/autofs
Author: trasz Date: Thu May 21 13:08:30 2015 New Revision: 283223 URL: https://svnweb.freebsd.org/changeset/base/283223 Log: MFC r275681: Add "-media" autofs map, to access data on removable media, such as CD drives or flash keys. It can be enabled by uncommenting a single entry in default /etc/auto_master. It can also be easily modified to use fuse-based filesystems instead of in-kernel ones. There is still one deficiency - the mountpoints are permanent, they don't disappear when user removes the media. Fixing it needs some autofs changes. Relnotes: yes Sponsored by: The FreeBSD Foundation Added: stable/10/etc/autofs/special_media - copied unchanged from r275681, head/etc/autofs/special_media Modified: stable/10/etc/auto_master stable/10/etc/autofs/Makefile stable/10/etc/devd.conf stable/10/usr.sbin/autofs/auto_master.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/auto_master == --- stable/10/etc/auto_master Thu May 21 13:04:14 2015(r283222) +++ stable/10/etc/auto_master Thu May 21 13:08:30 2015(r283223) @@ -3,3 +3,6 @@ # Automounter master map, see auto_master(5) for details. # /net -hosts -nobrowse,nosuid +# When using the -media special map, make sure to edit devd.conf(5) +# to move the call to "automount -c" out of the comments section. +#/media-media -nosuid Modified: stable/10/etc/autofs/Makefile == --- stable/10/etc/autofs/Makefile Thu May 21 13:04:14 2015 (r283222) +++ stable/10/etc/autofs/Makefile Thu May 21 13:08:30 2015 (r283223) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= include_ldap special_hosts special_null +FILES= include_ldap special_hosts special_media special_null NO_OBJ= FILESDIR= /etc/autofs Copied: stable/10/etc/autofs/special_media (from r275681, head/etc/autofs/special_media) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/etc/autofs/special_media Thu May 21 13:08:30 2015 (r283223, copy of r275681, head/etc/autofs/special_media) @@ -0,0 +1,93 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Print newline-separated list of devices available for mounting. +# If there is a filesystem label - use it, otherwise use device name. +print_available() { + local _fstype _fstype_and_label _label _p + + for _p in ${providers}; do + _fstype_and_label="$(fstyp -l "/dev/${_p}" 2> /dev/null)" + if [ $? -ne 0 ]; then + # Ignore devices for which we were unable + # to determine filesystem type. + continue + fi + + _fstype="${_fstype_and_label%% *}" + if [ "${_fstype}" != "${_fstype_and_label}" ]; then + _label="${_fstype_and_label#* }" + echo "${_label}" + continue + fi + + echo "${_p}" + done +} + +# Print a single map entry. +print_one() { + local _fstype _fstype_and_label _label _key _p + + _key="$1" + + _fstype="$(fstyp "/dev/${_key}" 2> /dev/null)" + if [ $? -eq 0 ]; then + echo "-fstype=${_fstype},nosuid :/dev/${_key}" + return + fi + + for _p in ${providers}; do + _fstype_and_label="$(fstyp -l "/dev/${_p}" 2> /dev/null)" + if [ $? -ne 0 ]; then + # Ignore devices for which we were unable + # to determine filesystem type. + continue + fi + + _fstype="${_fstype_and_label%% *}" + if [ "${_fstype}" = "${_fstype_and_label}" ]; then + # No label, try another device. + continue + fi + + _label="${_fstype_and_label#* }" + if [ "${_label}" != "${_key}" ]; then + # Labels don't match, try another device. + continue + fi + + echo "-fstype=${_fstype},nosuid :/dev/${_p}" + done + + # No matching device - don't print anything, autofs will handle it. +} + +# Obtain a list of (geom-provider-name, access-count) pairs, turning this: +# +# z0xf80005085d00 [shape=hexagon,label="ada0\nr2w2e3\nerr#0\nsector=512\nstripe=0"]; +# +# Into this: +# +# ada0 r2w2e3 +# +# XXX: It would be easier to use kern.geom.conftxt instead, but it lacks +# access counts. +pairs=$(sysctl kern.geom.confdot | sed -n 's/^.*hexagon,label="\([^\]*\)\\n\([^\]*\).*/\1 \2/p') + +# Obtain a list of GEOM providers that are not already open - not mounted, +# and witho
svn commit: r283224 - stable/10/etc
Author: trasz Date: Thu May 21 13:10:08 2015 New Revision: 283224 URL: https://svnweb.freebsd.org/changeset/base/283224 Log: MFC r276833: Make /net use -intr by default. Linux does that, and it seems a good idea. Sponsored by: The FreeBSD Foundation Modified: stable/10/etc/auto_master Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/auto_master == --- stable/10/etc/auto_master Thu May 21 13:08:30 2015(r283223) +++ stable/10/etc/auto_master Thu May 21 13:10:08 2015(r283224) @@ -2,7 +2,7 @@ # # Automounter master map, see auto_master(5) for details. # -/net -hosts -nobrowse,nosuid +/net -hosts -nobrowse,nosuid,intr # When using the -media special map, make sure to edit devd.conf(5) # to move the call to "automount -c" out of the comments section. #/media-media -nosuid ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283225 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:11:48 2015 New Revision: 283225 URL: https://svnweb.freebsd.org/changeset/base/283225 Log: MFC r276883: Improve documentation for autofs variables and executable maps; also some markup fixes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/auto_master.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/auto_master.5 == --- stable/10/usr.sbin/autofs/auto_master.5 Thu May 21 13:10:08 2015 (r283224) +++ stable/10/usr.sbin/autofs/auto_master.5 Thu May 21 13:11:48 2015 (r283225) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2014 +.Dd January 9, 2015 .Dt AUTO_MASTER 5 .Os .Sh NAME @@ -172,6 +172,42 @@ This is typically used with wildcards, l .Li * 192.168.1.1:/share/& .Ed .Pp +The +.Ar location +field may contain references to variables, like: +.Bd -literal -offset indent +.Li sys192.168.1.1:/sys/${OSNAME} +.Ed +.Pp +Defined variables are: +.Pp +.Bl -tag -width "-OSNAME" -compact +.It Li ARCH +Expands to the output of +.Li "uname -p" . +.It Li CPU +Same as ARCH. +.It Li HOST +Expands to the output of +.Li "uname -n" . +.It Li OSNAME +Expands to the output of +.Li "uname -s" . +.It Li OSREL +Expands to the output of +.Li "uname -r" . +.It Li OSVERS +Expands to the output of +.Li "uname -v" . +.El +.Pp +Additional variables can be defined with the +.Fl D +option of +.Xr automount 8 +and +.Xr automountd 8 . +.Pp To pass a location that begins with .Li / , prefix it with a colon. @@ -217,8 +253,10 @@ Query the remote NFS server and map expo This map is traditionally mounted on .Pa /net . Access to files on a remote NFS server is provided through the -.Pa /net/nfs-server-ip/share-name/ +.Pf /net/ Ar nfs-server-ip Ns / Ns Ar share-name Ns/ directory without any additional configuration. +Directories for individual NFS servers are not present until the first access, +when they are automatically created. .It Li -media Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media. @@ -227,13 +265,27 @@ Prevent .Xr automountd 8 from mounting anything on the mountpoint. .El +.Pp +It is possible to add custom special maps by adding them, as executable +maps named +.Pa special_foo , +to the +.Pa /etc/autofs/ +directory. .Sh EXECUTABLE MAPS If the map file specified in .Nm -has execute bit set, the +has the execute bit set, .Xr automountd 8 will execute it and parse the standard output instead of parsing the file contents. +When called without command line arguments, the executable is +expected to output a list of available map keys separated by +newline characters. +Otherwise, the executable will be called with a key name as +a command line argument. +Output from the executable is expected to be the entry for that key, +not including the key itself. .Sh INDIRECT VERSUS DIRECT MAPS Indirect maps are referred to in .Nm @@ -300,6 +352,9 @@ It can be symlinked to The default location of the .Pa auto_master file. +.It Pa /etc/autofs/ +Directory containing shell scripts to implement special maps and directory +services. .El .Sh SEE ALSO .Xr autofs 5 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283226 - stable/10/etc
Author: trasz Date: Thu May 21 13:13:56 2015 New Revision: 283226 URL: https://svnweb.freebsd.org/changeset/base/283226 Log: MFC r277171: Use newly added GEOM notifications to discard autofs caches. Sponsored by: The FreeBSD Foundation Modified: stable/10/etc/devd.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/devd.conf == --- stable/10/etc/devd.conf Thu May 21 13:11:48 2015(r283225) +++ stable/10/etc/devd.conf Thu May 21 13:13:56 2015(r283226) @@ -318,16 +318,11 @@ notify 0 { action "/usr/local/etc/rc.d/postgresql restart"; }; -# Discard autofs caches, useful for the -media special map. The one -# second delay is for GEOM to finish tasting. -# -# XXX: We should probably have a devctl(4) event that fires after GEOM -# tasting. -# +# Discard autofs caches, useful for the -media special map. notify 100 { - match "system" "DEVFS"; - match "cdev" "(da|mmcsd)[0-9]+"; - action "sleep 1 && /usr/sbin/automount -c"; + match "system" "GEOM"; + match "subsystem" "DEV"; + action "/usr/sbin/automount -c"; }; */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283227 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:18:02 2015 New Revision: 283227 URL: https://svnweb.freebsd.org/changeset/base/283227 Log: MFC r279806: Minor optimization/cleanup in node_path(); no functional changes. Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:13:56 2015 (r283226) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:18:02 2015 (r283227) @@ -561,7 +561,6 @@ static char * node_path_x(const struct node *n, char *x) { char *path; - size_t len; if (n->n_parent == NULL) return (x); @@ -580,14 +579,6 @@ node_path_x(const struct node *n, char * path = separated_concat(n->n_key, x, '/'); free(x); - /* -* Strip trailing slash. -*/ - len = strlen(path); - assert(len > 0); - if (path[len - 1] == '/') - path[len - 1] = '\0'; - return (node_path_x(n->n_parent, path)); } @@ -598,8 +589,19 @@ node_path_x(const struct node *n, char * char * node_path(const struct node *n) { + char *path; + size_t len; + + path = node_path_x(n, checked_strdup("")); + + /* +* Strip trailing slash, unless the whole path is "/". +*/ + len = strlen(path); + if (len > 1 && path[len - 1] == '/') + path[len - 1] = '\0'; - return (node_path_x(n, checked_strdup(""))); + return (path); } static char * ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283228 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:19:44 2015 New Revision: 283228 URL: https://svnweb.freebsd.org/changeset/base/283228 Log: MFC r279807: Improve separated_concat() to properly handle the case of concatenating "/" and "/foo". Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:18:02 2015 (r283227) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:19:44 2015 (r283228) @@ -136,8 +136,14 @@ separated_concat(const char *s1, const c assert(s1 != NULL); assert(s2 != NULL); - if (s1[0] == '\0' || s2[0] == '\0' || - s1[strlen(s1) - 1] == separator || s2[0] == separator) { + /* +* If s2 starts with separator - skip it; otherwise concatenating +* "/" and "/foo" would end up returning "//foo". +*/ + if (s2[0] == separator) + s2++; + + if (s1[0] == '\0' || s2[0] == '\0' || s1[strlen(s1) - 1] == separator) { ret = asprintf(&result, "%s%s", s1, s2); } else { ret = asprintf(&result, "%s%c%s", s1, separator, s2); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283229 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:21:03 2015 New Revision: 283229 URL: https://svnweb.freebsd.org/changeset/base/283229 Log: MFC r279808: Fix memory leak. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:19:44 2015 (r283228) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:21:03 2015 (r283229) @@ -615,9 +615,11 @@ node_options_x(const struct node *n, cha { char *options; + if (n == NULL) + return (x); + options = separated_concat(x, n->n_options, ','); - if (n->n_parent == NULL) - return (options); + free(x); return (node_options_x(n->n_parent, options)); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283230 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:23:49 2015 New Revision: 283230 URL: https://svnweb.freebsd.org/changeset/base/283230 Log: MFC r279812: Remove some particularly bad code; no functional changes. MFC r279815: Erm, revert chunk committed by mistake. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:21:03 2015 (r283229) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:23:49 2015 (r283230) @@ -86,46 +86,7 @@ checked_strdup(const char *s) } /* - * Take two pointers to strings, concatenate the contents with "/" in the - * middle, make the first pointer point to the result, the second pointer - * to NULL, and free the old strings. - * - * Concatenate pathnames, basically. - */ -static void -concat(char **p1, char **p2) -{ - int ret; - char *path; - - assert(p1 != NULL); - assert(p2 != NULL); - - if (*p1 == NULL) - *p1 = checked_strdup(""); - - if (*p2 == NULL) - *p2 = checked_strdup(""); - - ret = asprintf(&path, "%s/%s", *p1, *p2); - if (ret < 0) - log_err(1, "asprintf"); - - /* -* XXX -*/ - //free(*p1); - //free(*p2); - - *p1 = path; - *p2 = NULL; -} - -/* * Concatenate two strings, inserting separator between them, unless not needed. - * - * This function is very convenient to use when you do not care about freeing - * memory - which is okay here, because we are a short running process. */ char * separated_concat(const char *s1, const char *s2, char separator) @@ -151,7 +112,7 @@ separated_concat(const char *s1, const c if (ret < 0) log_err(1, "asprintf"); - //log_debugx("separated_concat: got %s and %s, returning %s", s1, s2, result); + //log_debugx("%s: got %s and %s, returning %s", __func__, s1, s2, result); return (result); } @@ -159,7 +120,7 @@ separated_concat(const char *s1, const c void create_directory(const char *path) { - char *component, *copy, *tofree, *partial; + char *component, *copy, *tofree, *partial, *tmp; int error; assert(path[0] == '/'); @@ -169,12 +130,14 @@ create_directory(const char *path) */ copy = tofree = checked_strdup(path + 1); - partial = NULL; + partial = checked_strdup(""); for (;;) { component = strsep(©, "/"); if (component == NULL) break; - concat(&partial, &component); + tmp = separated_concat(partial, component, '/'); + free(partial); + partial = tmp; //log_debugx("creating \"%s\"", partial); error = mkdir(partial, 0755); if (error != 0 && errno != EEXIST) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283231 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:25:28 2015 New Revision: 283231 URL: https://svnweb.freebsd.org/changeset/base/283231 Log: MFC r279813: Make things more readable; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automount.c stable/10/usr.sbin/autofs/automountd.c stable/10/usr.sbin/autofs/common.c stable/10/usr.sbin/autofs/common.h stable/10/usr.sbin/autofs/popen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automount.c == --- stable/10/usr.sbin/autofs/automount.c Thu May 21 13:23:49 2015 (r283230) +++ stable/10/usr.sbin/autofs/automount.c Thu May 21 13:25:28 2015 (r283231) @@ -349,8 +349,7 @@ main_automount(int argc, char **argv) if (options == NULL) { options = checked_strdup(optarg); } else { - options = - separated_concat(options, optarg, ','); + options = concat(options, ',', optarg); } break; case 'u': @@ -388,8 +387,7 @@ main_automount(int argc, char **argv) if (show_maps) { if (options != NULL) { - root->n_options = separated_concat(options, - root->n_options, ','); + root->n_options = concat(options, ',', root->n_options); } if (show_maps > 1) { node_expand_indirect_maps(root); Modified: stable/10/usr.sbin/autofs/automountd.c == --- stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:23:49 2015 (r283230) +++ stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:25:28 2015 (r283231) @@ -241,8 +241,7 @@ handle_request(const struct autofs_daemo * Prepend options passed via automountd(8) command line. */ if (cmdline_options != NULL) { - options = - separated_concat(cmdline_options, options, ','); + options = concat(cmdline_options, ',', options); } nobrowse = pick_option("nobrowse", &options); @@ -268,8 +267,7 @@ handle_request(const struct autofs_daemo * We still need to create the single subdirectory * user is trying to access. */ - tmp = separated_concat(adr->adr_path, - adr->adr_key, '/'); + tmp = concat(adr->adr_path, '/', adr->adr_key); node = node_find(root, tmp); if (node != NULL) create_subtree(node, false); @@ -301,12 +299,12 @@ handle_request(const struct autofs_daemo * Prepend options passed via automountd(8) command line. */ if (cmdline_options != NULL) - options = separated_concat(cmdline_options, options, ','); + options = concat(cmdline_options, ',', options); /* * Append "automounted". */ - options = separated_concat(options, "automounted", ','); + options = concat(options, ',', "automounted"); /* * Remove "nobrowse", mount(8) doesn't understand it. @@ -334,11 +332,10 @@ handle_request(const struct autofs_daemo if (retrycnt == NULL) { log_debugx("retrycnt not specified in options; " "defaulting to 1"); - options = separated_concat(options, - separated_concat("retrycnt", "1", '='), ','); + options = concat(options, ',', "retrycnt=1"); } else { - options = separated_concat(options, - separated_concat("retrycnt", retrycnt, '='), ','); + options = concat(options, ',', + concat("retrycnt", '=', retrycnt)); } } @@ -465,8 +462,7 @@ main_automountd(int argc, char **argv) if (options == NULL) { options = checked_strdup(optarg); } else { - options = - separated_concat(options, optarg, ','); + options = concat(options, ',', optarg); } break; case 'v': Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/comm
svn commit: r283232 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:26:52 2015 New Revision: 283232 URL: https://svnweb.freebsd.org/changeset/base/283232 Log: MFC r279843: Refactor. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:25:28 2015 (r283231) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:26:52 2015 (r283232) @@ -449,6 +449,18 @@ node_expand_defined(struct node *n) return (cumulated_error); } +static bool +node_is_direct_key(const struct node *n) +{ + + if (n->n_parent != NULL && n->n_parent->n_parent == NULL && + strcmp(n->n_key, "/-") == 0) { + return (true); + } + + return (false); +} + bool node_is_direct_map(const struct node *n) { @@ -460,11 +472,7 @@ node_is_direct_map(const struct node *n) n = n->n_parent; } - assert(n->n_key != NULL); - if (strcmp(n->n_key, "/-") != 0) - return (false); - - return (true); + return (node_is_direct_key(n)); } bool @@ -538,11 +546,8 @@ node_path_x(const struct node *n, char * * Return "/-" for direct maps only if we were asked for path * to the "/-" node itself, not to any of its subnodes. */ - if (n->n_parent->n_parent == NULL && - strcmp(n->n_key, "/-") == 0 && - x[0] != '\0') { + if (node_is_direct_key(n) && x[0] != '\0') return (x); - } assert(n->n_key[0] != '\0'); path = concat(n->n_key, '/', x); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283233 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:29:34 2015 New Revision: 283233 URL: https://svnweb.freebsd.org/changeset/base/283233 Log: MFC r279845: Fix handling of direct maps, broken in r275756. Previously, running automount(8) would unmount direct map trigger nodes every second time. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:26:52 2015 (r283232) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:29:34 2015 (r283233) @@ -661,23 +661,25 @@ node_find_x(struct node *node, const cha char *tmp; size_t tmplen; - //log_debugx("looking up %s in %s", path, node->n_key); + //log_debugx("looking up %s in %s", path, node_path(node)); - tmp = node_path(node); - tmplen = strlen(tmp); - if (strncmp(tmp, path, tmplen) != 0) { - free(tmp); - return (NULL); - } - if (path[tmplen] != '/' && path[tmplen] != '\0') { - /* -* If we have two map entries like 'foo' and 'foobar', make -* sure the search for 'foobar' won't match 'foo' instead. -*/ + if (!node_is_direct_key(node)) { + tmp = node_path(node); + tmplen = strlen(tmp); + if (strncmp(tmp, path, tmplen) != 0) { + free(tmp); + return (NULL); + } + if (path[tmplen] != '/' && path[tmplen] != '\0') { + /* +* If we have two map entries like 'foo' and 'foobar', make +* sure the search for 'foobar' won't match 'foo' instead. +*/ + free(tmp); + return (NULL); + } free(tmp); - return (NULL); } - free(tmp); TAILQ_FOREACH(child, &node->n_children, n_next) { found = node_find_x(child, path); @@ -685,6 +687,9 @@ node_find_x(struct node *node, const cha return (found); } + if (node->n_parent == NULL || node_is_direct_key(node)) + return (NULL); + return (node); } @@ -693,9 +698,12 @@ node_find(struct node *root, const char { struct node *node; + assert(root->n_parent == NULL); + node = node_find_x(root, path); - if (node == root) - return (NULL); + if (node != NULL) + assert(node != root); + return (node); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283234 - stable/10/usr.bin/ar
Author: emaste Date: Thu May 21 13:30:10 2015 New Revision: 283234 URL: https://svnweb.freebsd.org/changeset/base/283234 Log: MFC r276774: ar: Avoid null pointer deref while reading corrupt archives ELF Tool Chain ticket #467 Reported by: Alexander Cherepanov Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/ar/read.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/ar/read.c == --- stable/10/usr.bin/ar/read.c Thu May 21 13:29:34 2015(r283233) +++ stable/10/usr.bin/ar/read.c Thu May 21 13:30:10 2015(r283234) @@ -102,7 +102,8 @@ read_archive(struct bsdar *bsdar, char m continue; } - name = archive_entry_pathname(entry); + if ((name = archive_entry_pathname(entry)) == NULL) + break; /* Skip pseudo members. */ if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283235 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:31:44 2015 New Revision: 283235 URL: https://svnweb.freebsd.org/changeset/base/283235 Log: MFC r279846: Properly pass options for direct maps. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automount.c stable/10/usr.sbin/autofs/automountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automount.c == --- stable/10/usr.sbin/autofs/automount.c Thu May 21 13:30:10 2015 (r283234) +++ stable/10/usr.sbin/autofs/automount.c Thu May 21 13:31:44 2015 (r283235) @@ -141,8 +141,8 @@ mount_autofs(const char *from, const cha } static void -mount_if_not_already(const struct node *n, const char *map, -const struct statfs *mntbuf, int nitems) +mount_if_not_already(const struct node *n, const char *map, const char *options, +const char *prefix, const struct statfs *mntbuf, int nitems) { const struct statfs *sb; char *mountpoint; @@ -175,7 +175,7 @@ mount_if_not_already(const struct node * mountpoint); } - mount_autofs(from, mountpoint, n->n_options, n->n_key); + mount_autofs(from, mountpoint, options, prefix); free(from); free(mountpoint); } @@ -184,7 +184,7 @@ static void mount_unmount(struct node *root) { struct statfs *mntbuf; - struct node *n, *n2, *n3; + struct node *n, *n2; int i, nitems; nitems = getmntinfo(&mntbuf, MNT_WAIT); @@ -216,15 +216,14 @@ mount_unmount(struct node *root) TAILQ_FOREACH(n, &root->n_children, n_next) { if (!node_is_direct_map(n)) { - mount_if_not_already(n, n->n_map, mntbuf, nitems); + mount_if_not_already(n, n->n_map, n->n_options, + n->n_key, mntbuf, nitems); continue; } TAILQ_FOREACH(n2, &n->n_children, n_next) { - TAILQ_FOREACH(n3, &n2->n_children, n_next) { - mount_if_not_already(n3, n->n_map, - mntbuf, nitems); - } + mount_if_not_already(n2, n->n_map, n->n_options, + "/", mntbuf, nitems); } } } Modified: stable/10/usr.sbin/autofs/automountd.c == --- stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:30:10 2015 (r283234) +++ stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:31:44 2015 (r283235) @@ -202,7 +202,7 @@ handle_request(const struct autofs_daemo parent = root; } else { parent = node_new_map(root, checked_strdup(adr->adr_prefix), - checked_strdup(adr->adr_options), checked_strdup(map), + NULL, checked_strdup(map), checked_strdup("[kernel request]"), lineno); } @@ -231,19 +231,19 @@ handle_request(const struct autofs_daemo "failing mount", map, adr->adr_path); } + options = node_options(node); + options = concat(adr->adr_options, ',', options); + + /* +* Prepend options passed via automountd(8) command line. +*/ + if (cmdline_options != NULL) + options = concat(cmdline_options, ',', options); + if (node->n_location == NULL) { log_debugx("found node defined at %s:%d; not a mountpoint", node->n_config_file, node->n_config_line); - options = node_options(node); - - /* -* Prepend options passed via automountd(8) command line. -*/ - if (cmdline_options != NULL) { - options = concat(cmdline_options, ',', options); - } - nobrowse = pick_option("nobrowse", &options); if (nobrowse != NULL && adr->adr_key[0] == '\0') { log_debugx("skipping map %s due to \"nobrowse\" " @@ -293,14 +293,6 @@ handle_request(const struct autofs_daemo "failing mount", adr->adr_path); } - options = node_options(node); - - /* -* Prepend options passed via automountd(8) command line. -*/ - if (cmdline_options != NULL) - options = concat(cmdline_options, ',', options); - /* * Append "automounted". */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283236 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:33:06 2015 New Revision: 283236 URL: https://svnweb.freebsd.org/changeset/base/283236 Log: MFC r279851: Fix typo. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automountd.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automountd.8 == --- stable/10/usr.sbin/autofs/automountd.8 Thu May 21 13:31:44 2015 (r283235) +++ stable/10/usr.sbin/autofs/automountd.8 Thu May 21 13:33:06 2015 (r283236) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2014 +.Dd March 10, 2015 .Dt AUTOMOUNTD 8 .Os .Sh NAME @@ -78,7 +78,7 @@ The default is 30. Debug mode: increase verbosity and do not daemonize. .It Fl o Ar options Specify mount options. -Options specified here ill be overridden by options entered in maps or +Options specified here will be overridden by options entered in maps or .Xr auto_master 5 . .It Fl v Increase verbosity. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283237 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:34:33 2015 New Revision: 283237 URL: https://svnweb.freebsd.org/changeset/base/283237 Log: MFC r279914: Options from auto_master must be appended to options from maps, not prepended. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automountd.c == --- stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:33:06 2015 (r283236) +++ stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:34:33 2015 (r283237) @@ -232,7 +232,11 @@ handle_request(const struct autofs_daemo } options = node_options(node); - options = concat(adr->adr_options, ',', options); + + /* +* Append options from auto_master. +*/ + options = concat(options, ',', adr->adr_options); /* * Prepend options passed via automountd(8) command line. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283238 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:36:00 2015 New Revision: 283238 URL: https://svnweb.freebsd.org/changeset/base/283238 Log: MFC r279915: Make concat() accept NULL arguments. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automount.c stable/10/usr.sbin/autofs/automountd.c stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automount.c == --- stable/10/usr.sbin/autofs/automount.c Thu May 21 13:34:33 2015 (r283237) +++ stable/10/usr.sbin/autofs/automount.c Thu May 21 13:36:00 2015 (r283238) @@ -345,11 +345,7 @@ main_automount(int argc, char **argv) force_unmount = true; break; case 'o': - if (options == NULL) { - options = checked_strdup(optarg); - } else { - options = concat(options, ',', optarg); - } + options = concat(options, ',', optarg); break; case 'u': do_unmount = true; @@ -385,9 +381,7 @@ main_automount(int argc, char **argv) parse_master(root, AUTO_MASTER_PATH); if (show_maps) { - if (options != NULL) { - root->n_options = concat(options, ',', root->n_options); - } + root->n_options = concat(options, ',', root->n_options); if (show_maps > 1) { node_expand_indirect_maps(root); node_expand_ampersand(root, NULL); Modified: stable/10/usr.sbin/autofs/automountd.c == --- stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:34:33 2015 (r283237) +++ stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:36:00 2015 (r283238) @@ -241,8 +241,7 @@ handle_request(const struct autofs_daemo /* * Prepend options passed via automountd(8) command line. */ - if (cmdline_options != NULL) - options = concat(cmdline_options, ',', options); + options = concat(cmdline_options, ',', options); if (node->n_location == NULL) { log_debugx("found node defined at %s:%d; not a mountpoint", @@ -455,11 +454,7 @@ main_automountd(int argc, char **argv) maxproc = atoi(optarg); break; case 'o': - if (options == NULL) { - options = checked_strdup(optarg); - } else { - options = concat(options, ',', optarg); - } + options = concat(options, ',', optarg); break; case 'v': debug++; Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:34:33 2015 (r283237) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:36:00 2015 (r283238) @@ -94,8 +94,10 @@ concat(const char *s1, char separator, c char *result; int ret; - assert(s1 != NULL); - assert(s2 != NULL); + if (s1 == NULL) + s1 = ""; + if (s2 == NULL) + s2 = ""; /* * If s2 starts with separator - skip it; otherwise concatenating ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283239 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:37:48 2015 New Revision: 283239 URL: https://svnweb.freebsd.org/changeset/base/283239 Log: MFC r279916: Make "automount -LL -o whatever" present options in the same order as used by automountd(8). Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automount.c stable/10/usr.sbin/autofs/common.c stable/10/usr.sbin/autofs/common.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automount.c == --- stable/10/usr.sbin/autofs/automount.c Thu May 21 13:36:00 2015 (r283238) +++ stable/10/usr.sbin/autofs/automount.c Thu May 21 13:37:48 2015 (r283239) @@ -381,13 +381,12 @@ main_automount(int argc, char **argv) parse_master(root, AUTO_MASTER_PATH); if (show_maps) { - root->n_options = concat(options, ',', root->n_options); if (show_maps > 1) { node_expand_indirect_maps(root); node_expand_ampersand(root, NULL); } node_expand_defined(root); - node_print(root); + node_print(root, options); return (0); } Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:36:00 2015 (r283238) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:37:48 2015 (r283239) @@ -607,13 +607,16 @@ node_options(const struct node *n) } static void -node_print_indent(const struct node *n, int indent) +node_print_indent(const struct node *n, const char *cmdline_options, +int indent) { const struct node *child, *first_child; - char *path, *options; + char *path, *options, *tmp; path = node_path(n); - options = node_options(n); + tmp = node_options(n); + options = concat(cmdline_options, ',', tmp); + free(tmp); /* * Do not show both parent and child node if they have the same @@ -644,16 +647,21 @@ node_print_indent(const struct node *n, free(options); TAILQ_FOREACH(child, &n->n_children, n_next) - node_print_indent(child, indent + 2); + node_print_indent(child, cmdline_options, indent + 2); } +/* + * Recursively print node with all its children. The cmdline_options + * argument is used for additional options to be prepended to all the + * others - usually those are the options passed by command line. + */ void -node_print(const struct node *n) +node_print(const struct node *n, const char *cmdline_options) { const struct node *child; TAILQ_FOREACH(child, &n->n_children, n_next) - node_print_indent(child, 0); + node_print_indent(child, cmdline_options, 0); } static struct node * Modified: stable/10/usr.sbin/autofs/common.h == --- stable/10/usr.sbin/autofs/common.h Thu May 21 13:36:00 2015 (r283238) +++ stable/10/usr.sbin/autofs/common.h Thu May 21 13:37:48 2015 (r283239) @@ -87,7 +87,7 @@ void node_expand_ampersand(struct node * void node_expand_wildcard(struct node *root, const char *key); intnode_expand_defined(struct node *root); void node_expand_indirect_maps(struct node *n); -void node_print(const struct node *n); +void node_print(const struct node *n, const char *cmdline_options); void parse_master(struct node *root, const char *path); void parse_map(struct node *parent, const char *map, const char *args, bool *wildcards); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283241 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:41:08 2015 New Revision: 283241 URL: https://svnweb.freebsd.org/changeset/base/283241 Log: MFC r279954: Get executable direct maps to work. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/automountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/automountd.c == --- stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:39:38 2015 (r283240) +++ stable/10/usr.sbin/autofs/automountd.c Thu May 21 13:41:08 2015 (r283241) @@ -177,7 +177,7 @@ handle_request(const struct autofs_daemo const char *map; struct node *root, *parent, *node; FILE *f; - char *options, *fstype, *nobrowse, *retrycnt, *tmp; + char *key, *options, *fstype, *nobrowse, *retrycnt, *tmp; int error; bool wildcards; @@ -199,11 +199,25 @@ handle_request(const struct autofs_daemo map = adr->adr_from + 4; /* 4 for strlen("map "); */ root = node_new_root(); if (adr->adr_prefix[0] == '\0' || strcmp(adr->adr_prefix, "/") == 0) { + /* +* Direct map. autofs(4) doesn't have a way to determine +* correct map key, but since it's a direct map, we can just +* use adr_path instead. +*/ parent = root; + key = checked_strdup(adr->adr_path); } else { + /* +* Indirect map. +*/ parent = node_new_map(root, checked_strdup(adr->adr_prefix), NULL, checked_strdup(map), checked_strdup("[kernel request]"), lineno); + + if (adr->adr_key[0] == '\0') + key = NULL; + else + key = checked_strdup(adr->adr_key); } /* @@ -213,8 +227,7 @@ handle_request(const struct autofs_daemo * needs to be done for maps with wildcard entries, but also * for special and executable maps. */ - parse_map(parent, map, adr->adr_key[0] != '\0' ? adr->adr_key : NULL, - &wildcards); + parse_map(parent, map, key, &wildcards); if (!wildcards) wildcards = node_has_wildcards(parent); if (wildcards) @@ -222,8 +235,8 @@ handle_request(const struct autofs_daemo else log_debugx("map does not contain wildcard entries"); - if (adr->adr_key[0] != '\0') - node_expand_wildcard(root, adr->adr_key); + if (key != NULL) + node_expand_wildcard(root, key); node = node_find(root, adr->adr_path); if (node == NULL) { @@ -248,7 +261,7 @@ handle_request(const struct autofs_daemo node->n_config_file, node->n_config_line); nobrowse = pick_option("nobrowse", &options); - if (nobrowse != NULL && adr->adr_key[0] == '\0') { + if (nobrowse != NULL && key == NULL) { log_debugx("skipping map %s due to \"nobrowse\" " "option; exiting", map); done(0, true); @@ -265,12 +278,12 @@ handle_request(const struct autofs_daemo */ create_subtree(node, incomplete_hierarchy); - if (incomplete_hierarchy && adr->adr_key[0] != '\0') { + if (incomplete_hierarchy && key != NULL) { /* * We still need to create the single subdirectory * user is trying to access. */ - tmp = concat(adr->adr_path, '/', adr->adr_key); + tmp = concat(adr->adr_path, '/', key); node = node_find(root, tmp); if (node != NULL) create_subtree(node, false); @@ -288,8 +301,8 @@ handle_request(const struct autofs_daemo log_debugx("found node defined at %s:%d; it is a mountpoint", node->n_config_file, node->n_config_line); - node_expand_ampersand(node, - adr->adr_key[0] != '\0' ? adr->adr_key : NULL); + if (key != NULL) + node_expand_ampersand(node, key); error = node_expand_defined(node); if (error != 0) { log_errx(1, "variable expansion failed for %s; " ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283242 - in stable/10: etc etc/autofs usr.sbin/autofs
Author: trasz Date: Thu May 21 13:42:37 2015 New Revision: 283242 URL: https://svnweb.freebsd.org/changeset/base/283242 Log: MFC r279955: Add -noauto autofs map, for automatic handling of fstab entries marked "noauto". Relnotes: yes Sponsored by: The FreeBSD Foundation Added: stable/10/etc/autofs/special_noauto - copied unchanged from r279955, head/etc/autofs/special_noauto Modified: stable/10/etc/auto_master stable/10/etc/autofs/Makefile stable/10/usr.sbin/autofs/auto_master.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/auto_master == --- stable/10/etc/auto_master Thu May 21 13:41:08 2015(r283241) +++ stable/10/etc/auto_master Thu May 21 13:42:37 2015(r283242) @@ -6,3 +6,4 @@ # When using the -media special map, make sure to edit devd.conf(5) # to move the call to "automount -c" out of the comments section. #/media-media -nosuid +#/--noauto Modified: stable/10/etc/autofs/Makefile == --- stable/10/etc/autofs/Makefile Thu May 21 13:41:08 2015 (r283241) +++ stable/10/etc/autofs/Makefile Thu May 21 13:42:37 2015 (r283242) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= include_ldap special_hosts special_media special_null +FILES= include_ldap special_hosts special_media special_noauto special_null NO_OBJ= FILESDIR= /etc/autofs Copied: stable/10/etc/autofs/special_noauto (from r279955, head/etc/autofs/special_noauto) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/etc/autofs/special_noauto Thu May 21 13:42:37 2015 (r283242, copy of r279955, head/etc/autofs/special_noauto) @@ -0,0 +1,29 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +print_available() { + sed 's/#.*//' /etc/fstab | awk '$4 ~ /noauto/ { print $2 }' +} + +print_one() { + local _mntpoint + + _mntpoint="${1%/}" + + sed 's/#.*//' /etc/fstab | awk ' + $2 == "'"${_mntpoint}"'" && $4 ~ /noauto/ { + if ($1 ~ /:/) { dev=$1 } else { dev=":"$1 } + print "-fstype=" $3 "," $4, dev + }' +} + +if [ $# -eq 0 ]; then + print_available + exit 0 +fi + +print_one "$1" +exit 0 + Modified: stable/10/usr.sbin/autofs/auto_master.5 == --- stable/10/usr.sbin/autofs/auto_master.5 Thu May 21 13:41:08 2015 (r283241) +++ stable/10/usr.sbin/autofs/auto_master.5 Thu May 21 13:42:37 2015 (r283242) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2015 +.Dd March 13, 2015 .Dt AUTO_MASTER 5 .Os .Sh NAME @@ -260,6 +260,11 @@ when they are automatically created. .It Li -media Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media. +.It Li -noauto +Mount filesystems configured in +.Xr fstab 5 +as "noauto". +This needs to be set up as a direct map. .It Li -null Prevent .Xr automountd 8 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283240 - stable/10/usr.sbin/autofs
Author: trasz Date: Thu May 21 13:39:38 2015 New Revision: 283240 URL: https://svnweb.freebsd.org/changeset/base/283240 Log: MFC r279953: Rework the concat() algorithm to be correct in all cases. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c == --- stable/10/usr.sbin/autofs/common.c Thu May 21 13:37:48 2015 (r283239) +++ stable/10/usr.sbin/autofs/common.c Thu May 21 13:39:38 2015 (r283240) @@ -92,6 +92,7 @@ char * concat(const char *s1, char separator, const char *s2) { char *result; + char s1last, s2first; int ret; if (s1 == NULL) @@ -99,14 +100,22 @@ concat(const char *s1, char separator, c if (s2 == NULL) s2 = ""; - /* -* If s2 starts with separator - skip it; otherwise concatenating -* "/" and "/foo" would end up returning "//foo". -*/ - if (s2[0] == separator) - s2++; + if (s1[0] == '\0') + s1last = '\0'; + else + s1last = s1[strlen(s1) - 1]; - if (s1[0] == '\0' || s2[0] == '\0' || s1[strlen(s1) - 1] == separator) { + s2first = s2[0]; + + if (s1last == separator && s2first == separator) { + /* +* If s1 ends with the separator and s2 begins with +* it - skip the latter; otherwise concatenating "/" +* and "/foo" would end up returning "//foo". +*/ + ret = asprintf(&result, "%s%s", s1, s2 + 1); + } else if (s1last == separator || s2first == separator || + s1[0] == '\0' || s2[0] == '\0') { ret = asprintf(&result, "%s%s", s1, s2); } else { ret = asprintf(&result, "%s%c%s", s1, separator, s2); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283246 - head/usr.sbin/bluetooth/bthidd
Author: imp Date: Thu May 21 14:36:15 2015 New Revision: 283246 URL: https://svnweb.freebsd.org/changeset/base/283246 Log: Remove stray DEBUG_FLAGS=-g that snuck in with r137868 Modified: head/usr.sbin/bluetooth/bthidd/Makefile Modified: head/usr.sbin/bluetooth/bthidd/Makefile == --- head/usr.sbin/bluetooth/bthidd/Makefile Thu May 21 14:36:14 2015 (r283245) +++ head/usr.sbin/bluetooth/bthidd/Makefile Thu May 21 14:36:15 2015 (r283246) @@ -8,7 +8,6 @@ SRCS= bthidd.c client.c hid.c kbd.c lex session.c CFLAGS+= -I${.CURDIR} -DEBUG_FLAGS= -g LIBADD+= bluetooth usbhid ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283244 - head/cddl/usr.bin/ctfconvert
Author: imp Date: Thu May 21 14:36:12 2015 New Revision: 283244 URL: https://svnweb.freebsd.org/changeset/base/283244 Log: Remove stray DEBUG_FLAGS=-g that's been here since the initial import. Modified: head/cddl/usr.bin/ctfconvert/Makefile Modified: head/cddl/usr.bin/ctfconvert/Makefile == --- head/cddl/usr.bin/ctfconvert/Makefile Thu May 21 14:36:11 2015 (r283243) +++ head/cddl/usr.bin/ctfconvert/Makefile Thu May 21 14:36:12 2015 (r283244) @@ -3,8 +3,6 @@ .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt -DEBUG_FLAGS= -g - PROG= ctfconvert SRCS= alist.c \ ctf.c \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283245 - head/usr.bin/tar
Author: imp Date: Thu May 21 14:36:14 2015 New Revision: 283245 URL: https://svnweb.freebsd.org/changeset/base/283245 Log: Remove stray DEBUG_FLAGS=-g that snuck in with r184761. Modified: head/usr.bin/tar/Makefile Modified: head/usr.bin/tar/Makefile == --- head/usr.bin/tar/Makefile Thu May 21 14:36:12 2015(r283244) +++ head/usr.bin/tar/Makefile Thu May 21 14:36:14 2015(r283245) @@ -31,7 +31,6 @@ CFLAGS+= -I${LIBARCHIVEDIR}/tar -I${LIBA CFLAGS+= -I${LIBARCHIVEDIR}/libarchive_fe SYMLINKS= bsdtar ${BINDIR}/tar MLINKS=bsdtar.1 tar.1 -DEBUG_FLAGS=-g .PHONY: check test clean-test check test: $(PROG) bsdtar.1.gz ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283243 - head/lib/libufs
Author: imp Date: Thu May 21 14:36:11 2015 New Revision: 283243 URL: https://svnweb.freebsd.org/changeset/base/283243 Log: Remove the stray DEBUG_FLAGS=-g line that snuck in with the soft-updates journaling project merge in r207141. Modified: head/lib/libufs/Makefile Modified: head/lib/libufs/Makefile == --- head/lib/libufs/MakefileThu May 21 13:42:37 2015(r283242) +++ head/lib/libufs/MakefileThu May 21 14:36:11 2015(r283243) @@ -21,7 +21,6 @@ MLINKS+= ufs_disk_close.3 ufs_disk_write WARNS?=2 -DEBUG_FLAGS = -g CFLAGS+= -D_LIBUFS .if defined(LIBUFS_DEBUG) CFLAGS+= -D_LIBUFS_DEBUGGING ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283247 - head/tools/build/mk
Author: bapt Date: Thu May 21 15:05:46 2015 New Revision: 283247 URL: https://svnweb.freebsd.org/changeset/base/283247 Log: Mark libgomp.so.1 as an old lib not an old file Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu May 21 14:36:15 2015(r283246) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu May 21 15:05:46 2015(r283247) @@ -1751,7 +1751,7 @@ OLD_FILES+=usr/include/omp.h OLD_FILES+=usr/lib/libgcov.a OLD_FILES+=usr/lib/libgomp.a OLD_FILES+=usr/lib/libgomp.so -OLD_FILES+=usr/lib/libgomp.so.1 +OLD_LIBS+=usr/lib/libgomp.so.1 OLD_FILES+=usr/lib/libgomp_p.a OLD_FILES+=usr/libexec/cc1 OLD_FILES+=usr/libexec/cc1plus ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283248 - in head/sys: amd64/amd64 arm/arm arm64/arm64 ddb i386/i386 kern mips/mips powerpc/powerpc sparc64/sparc64
Author: pfg Date: Thu May 21 15:16:18 2015 New Revision: 283248 URL: https://svnweb.freebsd.org/changeset/base/283248 Log: ddb: finish converting boolean values. The replacement started at r283088 was necessarily incomplete without replacing boolean_t with bool. This also involved cleaning some type mismatches and ansifying old C function declarations. Pointed out by: bde Discussed with: bde, ian, jhb Modified: head/sys/amd64/amd64/db_disasm.c head/sys/arm/arm/db_disasm.c head/sys/arm64/arm64/db_disasm.c head/sys/ddb/db_access.c head/sys/ddb/db_access.h head/sys/ddb/db_break.c head/sys/ddb/db_capture.c head/sys/ddb/db_command.c head/sys/ddb/db_examine.c head/sys/ddb/db_expr.c head/sys/ddb/db_main.c head/sys/ddb/db_print.c head/sys/ddb/db_ps.c head/sys/ddb/db_run.c head/sys/ddb/db_script.c head/sys/ddb/db_sym.c head/sys/ddb/db_sym.h head/sys/ddb/db_textdump.c head/sys/ddb/db_thread.c head/sys/ddb/db_variables.c head/sys/ddb/db_watch.c head/sys/ddb/db_write_cmd.c head/sys/ddb/ddb.h head/sys/i386/i386/db_disasm.c head/sys/kern/subr_turnstile.c head/sys/kern/subr_witness.c head/sys/mips/mips/db_disasm.c head/sys/mips/mips/pmap.c head/sys/mips/mips/vm_machdep.c head/sys/powerpc/powerpc/db_disasm.c head/sys/sparc64/sparc64/db_disasm.c Modified: head/sys/amd64/amd64/db_disasm.c == --- head/sys/amd64/amd64/db_disasm.cThu May 21 15:05:46 2015 (r283247) +++ head/sys/amd64/amd64/db_disasm.cThu May 21 15:16:18 2015 (r283248) @@ -1223,9 +1223,7 @@ db_disasm_esc(loc, inst, rex, short_addr * next instruction. */ db_addr_t -db_disasm(loc, altfmt) - db_addr_t loc; - boolean_t altfmt; +db_disasm(db_addr_t loc, bool altfmt) { int inst; int size; Modified: head/sys/arm/arm/db_disasm.c == --- head/sys/arm/arm/db_disasm.cThu May 21 15:05:46 2015 (r283247) +++ head/sys/arm/arm/db_disasm.cThu May 21 15:16:18 2015 (r283248) @@ -70,7 +70,7 @@ db_disasm_printaddr(u_int address) } vm_offset_t -db_disasm(vm_offset_t loc, boolean_t altfmt) +db_disasm(vm_offset_t loc, bool altfmt) { return disasm(&db_disasm_interface, loc, altfmt); Modified: head/sys/arm64/arm64/db_disasm.c == --- head/sys/arm64/arm64/db_disasm.cThu May 21 15:05:46 2015 (r283247) +++ head/sys/arm64/arm64/db_disasm.cThu May 21 15:16:18 2015 (r283248) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include vm_offset_t -db_disasm(vm_offset_t loc, boolean_t altfmt) +db_disasm(vm_offset_t loc, bool altfmt) { return 0; } Modified: head/sys/ddb/db_access.c == --- head/sys/ddb/db_access.cThu May 21 15:05:46 2015(r283247) +++ head/sys/ddb/db_access.cThu May 21 15:16:18 2015(r283248) @@ -54,7 +54,7 @@ static unsigned db_extend[] = { /* table #endif db_expr_t -db_get_value(db_addr_t addr, int size, boolean_t is_signed) +db_get_value(db_addr_t addr, int size, bool is_signed) { chardata[sizeof(u_int64_t)]; register db_expr_t value; Modified: head/sys/ddb/db_access.h == --- head/sys/ddb/db_access.hThu May 21 15:05:46 2015(r283247) +++ head/sys/ddb/db_access.hThu May 21 15:16:18 2015(r283248) @@ -36,7 +36,7 @@ /* * Data access functions for debugger. */ -db_expr_t db_get_value(db_addr_t addr, int size, boolean_t is_signed); +db_expr_t db_get_value(db_addr_t addr, int size, bool is_signed); void db_put_value(db_addr_t addr, int size, db_expr_t value); #endif /* !_DDB_DB_ACCESS_H_ */ Modified: head/sys/ddb/db_break.c == --- head/sys/ddb/db_break.c Thu May 21 15:05:46 2015(r283247) +++ head/sys/ddb/db_break.c Thu May 21 15:16:18 2015(r283248) @@ -155,7 +155,7 @@ db_find_breakpoint_here(db_addr_t addr) return db_find_breakpoint(db_map_addr(addr), addr); } -static boolean_t db_breakpoints_inserted = true; +static booldb_breakpoints_inserted = true; #ifndef BKPT_WRITE #defineBKPT_WRITE(addr, storage) \ @@ -267,7 +267,7 @@ db_list_breakpoints(void) /* Delete breakpoint */ /*ARGSUSED*/ void -db_delete_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif) +db_delete_cmd(db_expr_t addr, bool have_addr, db_expr_t count, char *modif) { db_delete_breakpoint(db_map_addr(addr), (db_addr_t)addr); } @@ -275,8 +275,7 @@ db_delete_cmd(db_expr_t addr, boolean_t /* Set bre
svn commit: r283249 - head/sys/sys
Author: jmg Date: Thu May 21 15:38:43 2015 New Revision: 283249 URL: https://svnweb.freebsd.org/changeset/base/283249 Log: remove stray ; that came in r272673... Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h == --- head/sys/sys/systm.hThu May 21 15:16:18 2015(r283248) +++ head/sys/sys/systm.hThu May 21 15:38:43 2015(r283249) @@ -237,7 +237,7 @@ voidhexdump(const void *ptr, int length #define ovbcopy(f, t, l) bcopy((f), (t), (l)) void bcopy(const void *from, void *to, size_t len) __nonnull(1) __nonnull(2); void bzero(void *buf, size_t len) __nonnull(1); -void explicit_bzero(void *, size_t) __nonnull(1);; +void explicit_bzero(void *, size_t) __nonnull(1); void *memcpy(void *to, const void *from, size_t len) __nonnull(1) __nonnull(2); void *memmove(void *dest, const void *src, size_t n) __nonnull(1) __nonnull(2); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283250 - in head/sys: kern sys
Author: jhb Date: Thu May 21 16:43:26 2015 New Revision: 283250 URL: https://svnweb.freebsd.org/changeset/base/283250 Log: Revert r282971. It depends on condvar consumers not destroying condvars until all threads sleeping on a condvar have resumed execution after being awakened. However, there are cases where that guarantee is very hard to provide. Modified: head/sys/kern/kern_condvar.c head/sys/sys/condvar.h Modified: head/sys/kern/kern_condvar.c == --- head/sys/kern/kern_condvar.cThu May 21 15:38:43 2015 (r283249) +++ head/sys/kern/kern_condvar.cThu May 21 16:43:26 2015 (r283250) @@ -122,7 +122,7 @@ _cv_wait(struct cv *cvp, struct lock_obj sleepq_lock(cvp); - atomic_add_int(&cvp->cv_waiters, 1); + cvp->cv_waiters++; if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -137,7 +137,6 @@ _cv_wait(struct cv *cvp, struct lock_obj sleepq_lock(cvp); } sleepq_wait(cvp, 0); - atomic_subtract_int(&cvp->cv_waiters, 1); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) @@ -185,7 +184,7 @@ _cv_wait_unlock(struct cv *cvp, struct l sleepq_lock(cvp); - atomic_add_int(&cvp->cv_waiters, 1); + cvp->cv_waiters++; DROP_GIANT(); sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0); @@ -195,7 +194,6 @@ _cv_wait_unlock(struct cv *cvp, struct l if (class->lc_flags & LC_SLEEPABLE) sleepq_lock(cvp); sleepq_wait(cvp, 0); - atomic_subtract_int(&cvp->cv_waiters, 1); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) @@ -242,7 +240,7 @@ _cv_wait_sig(struct cv *cvp, struct lock sleepq_lock(cvp); - atomic_add_int(&cvp->cv_waiters, 1); + cvp->cv_waiters++; if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -258,7 +256,6 @@ _cv_wait_sig(struct cv *cvp, struct lock sleepq_lock(cvp); } rval = sleepq_wait_sig(cvp, 0); - atomic_subtract_int(&cvp->cv_waiters, 1); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) @@ -310,7 +307,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct sleepq_lock(cvp); - atomic_add_int(&cvp->cv_waiters, 1); + cvp->cv_waiters++; if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -326,7 +323,6 @@ _cv_timedwait_sbt(struct cv *cvp, struct sleepq_lock(cvp); } rval = sleepq_timedwait(cvp, 0); - atomic_subtract_int(&cvp->cv_waiters, 1); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) @@ -380,7 +376,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st sleepq_lock(cvp); - atomic_add_int(&cvp->cv_waiters, 1); + cvp->cv_waiters++; if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -397,7 +393,6 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st sleepq_lock(cvp); } rval = sleepq_timedwait_sig(cvp, 0); - atomic_subtract_int(&cvp->cv_waiters, 1); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) @@ -426,8 +421,10 @@ cv_signal(struct cv *cvp) wakeup_swapper = 0; sleepq_lock(cvp); - if (cvp->cv_waiters > 0) + if (cvp->cv_waiters > 0) { + cvp->cv_waiters--; wakeup_swapper = sleepq_signal(cvp, SLEEPQ_CONDVAR, 0, 0); + } sleepq_release(cvp); if (wakeup_swapper) kick_proc0(); @@ -450,8 +447,10 @@ cv_broadcastpri(struct cv *cvp, int pri) if (pri == -1) pri = 0; sleepq_lock(cvp); - if (cvp->cv_waiters > 0) + if (cvp->cv_waiters > 0) { + cvp->cv_waiters = 0; wakeup_swapper = sleepq_broadcast(cvp, SLEEPQ_CONDVAR, pri, 0); + } sleepq_release(cvp); if (wakeup_swapper) kick_proc0(); Modified: head/sys/sys/condvar.h == --- head/sys/sys/condvar.h Thu May 21 15:38:43 2015(r283249) +++ head/sys/sys/condvar.h Thu May 21 16:43:26 2015(r283250) @@ -45,7 +45,7 @@ TAILQ_HEAD(cv_waitq, thread); */ struct cv { const char *cv_description; - volatile intcv_waiters; + int cv_waiters; }; #ifdef _KERNEL ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283251 - in stable/10: . share/man/man9
Author: bdrewery Date: Thu May 21 16:44:31 2015 New Revision: 283251 URL: https://svnweb.freebsd.org/changeset/base/283251 Log: MFC r282574: Remove references to Giant in namei(9). This was removed in r241896. Modified: stable/10/ObsoleteFiles.inc stable/10/share/man/man9/Makefile stable/10/share/man/man9/namei.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc == --- stable/10/ObsoleteFiles.inc Thu May 21 16:43:26 2015(r283250) +++ stable/10/ObsoleteFiles.inc Thu May 21 16:44:31 2015(r283251) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20150506 +OLD_FILES+=usr/share/man/man9/NDHASGIANT.9.gz # 20141205: convert sbin/mdconfig/tests to ATF format tests OLD_FILES+=usr/tests/sbin/mdconfig/legacy_test OLD_FILES+=usr/tests/sbin/mdconfig/mdconfig.test Modified: stable/10/share/man/man9/Makefile == --- stable/10/share/man/man9/Makefile Thu May 21 16:43:26 2015 (r283250) +++ stable/10/share/man/man9/Makefile Thu May 21 16:44:31 2015 (r283251) @@ -1001,7 +1001,6 @@ MLINKS+=mutex.9 mtx_assert.9 \ mutex.9 mtx_unlock_spin.9 \ mutex.9 mtx_unlock_spin_flags.9 MLINKS+=namei.9 NDFREE.9 \ - namei.9 NDHASGIANT.9 \ namei.9 NDINIT.9 MLINKS+=pbuf.9 getpbuf.9 \ pbuf.9 relpbuf.9 \ Modified: stable/10/share/man/man9/namei.9 == --- stable/10/share/man/man9/namei.9Thu May 21 16:43:26 2015 (r283250) +++ stable/10/share/man/man9/namei.9Thu May 21 16:44:31 2015 (r283251) @@ -33,14 +33,13 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2012 +.Dd May 6, 2015 .Dt NAMEI 9 .Os .Sh NAME .Nm namei , .Nm NDINIT , .Nm NDFREE , -.Nm NDHASGIANT .Nd pathname translation and lookup operations .Sh SYNOPSIS .In sys/param.h @@ -55,8 +54,6 @@ .Fc .Ft void .Fn NDFREE "struct nameidata *ndp" "const uint flags" -.Ft int -.Fn NDHASGIANT "struct nameidata *ndp" .Sh DESCRIPTION The .Nm @@ -73,16 +70,6 @@ or depending on whether the .Dv LOCKLEAF flag was specified or not. -If the -.Va Giant -lock is required, -.Nm -will acquire it if the caller indicates it is -.Dv MPSAFE , -in which case the caller must later release -.Va Giant -based on the results of -.Fn NDHASGIANT . .Pp The .Fn NDINIT @@ -362,6 +349,3 @@ In order to solve this for the cases whe and .Dv LOCKLEAF are used, it is necessary to resort to recursive locking. -.Pp -Non-MPSAFE file systems exist, requiring callers to conditionally unlock -.Va Giant . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r282971 - in head/sys: kern sys
On Wednesday, May 20, 2015 12:00:46 PM Alexander Kabaev wrote: > On Fri, 15 May 2015 13:50:38 + (UTC) > John Baldwin wrote: > > > Author: jhb > > Date: Fri May 15 13:50:37 2015 > > New Revision: 282971 > > URL: https://svnweb.freebsd.org/changeset/base/282971 > > > > Log: > > Previously, cv_waiters was only updated by cv_signal or cv_wait. If > > a thread awakened due to a time out, then cv_waiters was not > > decremented. If INT_MAX threads timed out on a cv without an > > intervening cv_broadcast, then cv_waiters could overflow. To fix > > this, have each sleeping thread decrement cv_waiters when it resumes. > > > > Note that previously cv_waiters was protected by the sleepq chain > > lock. However, that lock is not held when threads resume from sleep. > > In addition, the interlock is also not always reacquired after > > resuming (cv_wait_unlock), nor is it always held by callers of > > cv_signal() or cv_broadcast(). Instead, use atomic ops to update > > cv_waiters. Since the sleepq chain lock is still held on every > > increment, it should still be safe to compare cv_waiters against zero > > while holding the lock in the wakeup routines as the only way the > > race should be lost would result in extra calls to sleepq_signal() or > > sleepq_broadcast(). > > Differential Revision:https://reviews.freebsd.org/D2427 > > Reviewed by: benno > > Reported by: benno (wrap of cv_waiters in the field) > > MFC after:2 weeks > > > > Modified: > > head/sys/kern/kern_condvar.c > > head/sys/sys/condvar.h > > > > This breaks ZFS range locking code, which expects to be able to wakeup > everyone on the condition variable and then free the structure that > contains it. Having woken up threads modify cv_waiters results in a > race that leads to already freed memory to be accessed. > > It is debatable just how correct ZFS code in its expectations, but I > think this commit should probably be reverted until either ZFS is > changed not to expect cv modifiable by waking threads or until > alternative solution is found to the cv_waiters overflow issue fixed by > this commit. Yes, this is fine to revert for now. I'll have to think about which way to fix the bug in question. The simplest route is probably to remove cv_waiters entirely, though hacking up sleepq_timeout to recognize cv's and decrement the count is another option (but hackier). -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r282971 - in head/sys: kern sys
On Wednesday, May 20, 2015 02:26:18 PM Xin Li wrote: > I think we should also assert that no waiter remains when a conditional > variable is destroyed (which also suggests that the memory may be freed > shortly). Otherwise we would either have modify after free or lost wakeups. We already assert for this. That is what the call to sleepq_lookup() is checking for. If there are any sleepers then there will be a sleepq allocated for this cvp. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r282971 - in head/sys: kern sys
On Thu, May 21, 2015 at 11:33:02AM -0400, John Baldwin wrote: > On Wednesday, May 20, 2015 12:00:46 PM Alexander Kabaev wrote: > > On Fri, 15 May 2015 13:50:38 + (UTC) > > John Baldwin wrote: > > > > > Author: jhb > > > Date: Fri May 15 13:50:37 2015 > > > New Revision: 282971 > > > URL: https://svnweb.freebsd.org/changeset/base/282971 > > > > > > Log: > > > Previously, cv_waiters was only updated by cv_signal or cv_wait. If > > > a thread awakened due to a time out, then cv_waiters was not > > > decremented. If INT_MAX threads timed out on a cv without an > > > intervening cv_broadcast, then cv_waiters could overflow. To fix > > > this, have each sleeping thread decrement cv_waiters when it resumes. > > > > > > Note that previously cv_waiters was protected by the sleepq chain > > > lock. However, that lock is not held when threads resume from sleep. > > > In addition, the interlock is also not always reacquired after > > > resuming (cv_wait_unlock), nor is it always held by callers of > > > cv_signal() or cv_broadcast(). Instead, use atomic ops to update > > > cv_waiters. Since the sleepq chain lock is still held on every > > > increment, it should still be safe to compare cv_waiters against zero > > > while holding the lock in the wakeup routines as the only way the > > > race should be lost would result in extra calls to sleepq_signal() or > > > sleepq_broadcast(). > > > Differential Revision: https://reviews.freebsd.org/D2427 > > > Reviewed by:benno > > > Reported by:benno (wrap of cv_waiters in the field) > > > MFC after: 2 weeks > > > > > > Modified: > > > head/sys/kern/kern_condvar.c > > > head/sys/sys/condvar.h > > > > > > > This breaks ZFS range locking code, which expects to be able to wakeup > > everyone on the condition variable and then free the structure that > > contains it. Having woken up threads modify cv_waiters results in a > > race that leads to already freed memory to be accessed. > > > > It is debatable just how correct ZFS code in its expectations, but I > > think this commit should probably be reverted until either ZFS is > > changed not to expect cv modifiable by waking threads or until > > alternative solution is found to the cv_waiters overflow issue fixed by > > this commit. > > Yes, this is fine to revert for now. I'll have to think about which way > to fix the bug in question. The simplest route is probably to remove > cv_waiters entirely, though hacking up sleepq_timeout to recognize cv's > and decrement the count is another option (but hackier). > The code was buggy even prior to this. _cv_wait does: #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ktrcsw(0, 0, cv_wmesg(cvp)); #endif So with ktrace enabled cvp is possibly accessed after it gets freed. I checked "solaris compatiblity layer" from "zfs on linux" project and it looks like they are screwed by this as well. In other words, I would argue modifying native privmitives to accomodate for zfs use may not be the best course of action. Hacking up zfs or cv_ primitives seems better and opens up posibilities for minor optimisations. I'm not up to it though. -- Mateusz Guzik ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283253 - in head/sys: arm/allwinner arm/conf boot/fdt/dts/arm dev/mmc
Author: loos Date: Thu May 21 17:39:42 2015 New Revision: 283253 URL: https://svnweb.freebsd.org/changeset/base/283253 Log: Add the MMC/SD driver for Allwinner SoCs. This is based on the patch sent by Alexander Fedorov with the following fixes/improvements: - Better error handling; - Clock is derived from PLL6 (obtained from netbsd); - No more unnecessary busy loops on interrupt handler; - style(9) fixes and code cleanup. I also want to thanks Martin Galvan who has sent an alternative implementation with some interesting fixes. Tested on CubieBoard2, Banana-Pi (thanks to netgate!) and Cubieboard1 (Pratik Singhal). This is intended to pave the way for the upcoming GSoC work (and make easier the build of images for the supported boards). PR: 196081 Submitted by: Alexander Fedorov Added: head/sys/arm/allwinner/a10_mmc.c (contents, props changed) head/sys/arm/allwinner/a10_mmc.h (contents, props changed) Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/boot/fdt/dts/arm/cubieboard.dts head/sys/boot/fdt/dts/arm/cubieboard2.dts head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi head/sys/dev/mmc/mmc.c Modified: head/sys/arm/allwinner/a10_clk.c == --- head/sys/arm/allwinner/a10_clk.cThu May 21 17:39:42 2015 (r283252) +++ head/sys/arm/allwinner/a10_clk.cThu May 21 17:39:42 2015 (r283253) @@ -174,7 +174,8 @@ a10_clk_usb_deactivate(void) } int -a10_clk_emac_activate(void) { +a10_clk_emac_activate(void) +{ struct a10_ccm_softc *sc = a10_ccm_sc; uint32_t reg_value; @@ -189,3 +190,110 @@ a10_clk_emac_activate(void) { return (0); } +static void +a10_clk_pll6_enable(void) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + + /* +* SATA needs PLL6 to be a 100MHz clock. +* The SATA output frequency is 24MHz * n * k / m / 6. +* To get to 100MHz, k & m must be equal and n must be 25. +* For other uses the output frequency is 24MHz * n * k / 2. +*/ + sc = a10_ccm_sc; + reg_value = ccm_read_4(sc, CCM_PLL6_CFG); + reg_value &= ~CCM_PLL_CFG_BYPASS; + reg_value &= ~(CCM_PLL_CFG_FACTOR_K | CCM_PLL_CFG_FACTOR_M | + CCM_PLL_CFG_FACTOR_N); + reg_value |= (25 << CCM_PLL_CFG_FACTOR_N_SHIFT); + reg_value |= CCM_PLL6_CFG_SATA_CLKEN; + reg_value |= CCM_PLL_CFG_ENABLE; + ccm_write_4(sc, CCM_PLL6_CFG, reg_value); +} + +static unsigned int +a10_clk_pll6_get_rate(void) +{ + struct a10_ccm_softc *sc; + uint32_t k, n, reg_value; + + sc = a10_ccm_sc; + reg_value = ccm_read_4(sc, CCM_PLL6_CFG); + n = ((reg_value & CCM_PLL_CFG_FACTOR_N) >> CCM_PLL_CFG_FACTOR_N_SHIFT); + k = ((reg_value & CCM_PLL_CFG_FACTOR_K) >> CCM_PLL_CFG_FACTOR_K_SHIFT) + + 1; + + return ((CCM_CLK_REF_FREQ * n * k) / 2); +} + +int +a10_clk_mmc_activate(int devid) +{ + struct a10_ccm_softc *sc; + uint32_t reg_value; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + a10_clk_pll6_enable(); + + /* Gating AHB clock for SD/MMC */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING0); + reg_value |= CCM_AHB_GATING_SDMMC0 << devid; + ccm_write_4(sc, CCM_AHB_GATING0, reg_value); + + return (0); +} + +int +a10_clk_mmc_cfg(int devid, int freq) +{ + struct a10_ccm_softc *sc; + uint32_t clksrc, m, n, ophase, phase, reg_value; + unsigned int pll_freq; + + sc = a10_ccm_sc; + if (sc == NULL) + return (ENXIO); + + freq /= 1000; + if (freq <= 400) { + pll_freq = CCM_CLK_REF_FREQ / 1000; + clksrc = CCM_SD_CLK_SRC_SEL_OSC24M; + ophase = 0; + phase = 0; + n = 2; + } else if (freq <= 25000) { + pll_freq = a10_clk_pll6_get_rate() / 1000; + clksrc = CCM_SD_CLK_SRC_SEL_PLL6; + ophase = 0; + phase = 5; + n = 2; + } else if (freq <= 5) { + pll_freq = a10_clk_pll6_get_rate() / 1000; + clksrc = CCM_SD_CLK_SRC_SEL_PLL6; + ophase = 3; + phase = 5; + n = 0; + } else + return (EINVAL); + m = ((pll_freq / (1 << n)) / (freq)) - 1; + reg_value = ccm_read_4(sc, CCM_MMC0_SCLK_CFG + (devid * 4)); + reg_value &= ~CCM_SD_CLK_SRC_SEL; + reg_value |= (clksrc << CCM_SD_CLK_SRC_SEL_SHIFT); + reg_value &= ~CCM_SD_CLK_PHASE_CTR; + reg_value |= (phase << CCM_SD_CLK_PHASE_CTR_SHIFT); + reg_value &= ~CCM_SD_CLK_DIV_RATIO_N; + reg_value |= (n << CCM_SD_CLK_DI
svn commit: r283252 - head/release
Author: gjb Date: Thu May 21 17:39:42 2015 New Revision: 283252 URL: https://svnweb.freebsd.org/changeset/base/283252 Log: Include the TARGET in the EC2 AMI name. Without this, AWS rejects subsequent image uploads of a different architecture because the name conflicts. MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 == --- head/release/Makefile.ec2 Thu May 21 16:44:31 2015(r283251) +++ head/release/Makefile.ec2 Thu May 21 17:39:42 2015(r283252) @@ -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} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283254 - head/sys/sys
Author: dim Date: Thu May 21 17:40:53 2015 New Revision: 283254 URL: https://svnweb.freebsd.org/changeset/base/283254 Log: 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 MFC after:1 week Modified: head/sys/sys/module.h Modified: head/sys/sys/module.h == --- head/sys/sys/module.h Thu May 21 17:39:42 2015(r283253) +++ head/sys/sys/module.h Thu May 21 17:40:53 2015(r283254) @@ -107,7 +107,8 @@ struct mod_metadata { DATA_SET(modmetadata_set, _mod_metadata##uniquifier) #defineMODULE_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\ @@ -147,7 +148,8 @@ struct mod_metadata { DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version) #defineMODULE_VERSION(module, version) \ - static struct mod_version _##module##_version = { \ + static struct mod_version _##module##_version \ + __section(".data") = { \ version \ }; \ MODULE_METADATA(_##module##_version, MDT_VERSION, \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283255 - head/sys/amd64/vmm
Author: neel Date: Thu May 21 18:23:37 2015 New Revision: 283255 URL: https://svnweb.freebsd.org/changeset/base/283255 Log: Emulate the "CMP r/m, reg" instruction (opcode 39H). Reported and tested by: Leon Dang (ld...@nahannisys.com) MFC after:1 week Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c == --- head/sys/amd64/vmm/vmm_instruction_emul.c Thu May 21 17:40:53 2015 (r283254) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Thu May 21 18:23:37 2015 (r283255) @@ -113,6 +113,10 @@ static const struct vie_op one_byte_opco .op_byte = 0x2B, .op_type = VIE_OP_TYPE_SUB, }, + [0x39] = { + .op_byte = 0x39, + .op_type = VIE_OP_TYPE_CMP, + }, [0x3B] = { .op_byte = 0x3B, .op_type = VIE_OP_TYPE_CMP, @@ -1050,34 +1054,46 @@ emulate_cmp(void *vm, int vcpuid, uint64 mem_region_read_t memread, mem_region_write_t memwrite, void *arg) { int error, size; - uint64_t op1, op2, rflags, rflags2; + uint64_t regop, memop, op1, op2, rflags, rflags2; enum vm_reg_name reg; size = vie->opsize; switch (vie->op.op_byte) { + case 0x39: case 0x3B: /* +* 39/r CMP r/m16, r16 +* 39/r CMP r/m32, r32 +* REX.W 39/r CMP r/m64, r64 +* * 3B/r CMP r16, r/m16 * 3B/r CMP r32, r/m32 * REX.W + 3B/r CMP r64, r/m64 * -* Compare first operand (reg) with second operand (r/m) and +* Compare the first operand with the second operand and * set status flags in EFLAGS register. The comparison is * performed by subtracting the second operand from the first * operand and then setting the status flags. */ - /* Get the first operand */ + /* Get the register operand */ reg = gpr_map[vie->reg]; - error = vie_read_register(vm, vcpuid, reg, &op1); + error = vie_read_register(vm, vcpuid, reg, ®op); if (error) return (error); - /* Get the second operand */ - error = memread(vm, vcpuid, gpa, &op2, size, arg); + /* Get the memory operand */ + error = memread(vm, vcpuid, gpa, &memop, size, arg); if (error) return (error); + if (vie->op.op_byte == 0x3B) { + op1 = regop; + op2 = memop; + } else { + op1 = memop; + op2 = regop; + } rflags2 = getcc(size, op1, op2); break; case 0x80: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283256 - head/usr.sbin/bhyvectl
Author: neel Date: Thu May 21 18:29:11 2015 New Revision: 283256 URL: https://svnweb.freebsd.org/changeset/base/283256 Log: Add an option "--get-vmcs-exit-inst-length" to display the instruction length of the instruction that caused the VM-exit. MFC after:1 week Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c == --- head/usr.sbin/bhyvectl/bhyvectl.c Thu May 21 18:23:37 2015 (r283255) +++ head/usr.sbin/bhyvectl/bhyvectl.c Thu May 21 18:29:11 2015 (r283256) @@ -293,6 +293,7 @@ static int get_guest_pat, get_host_pat; static int get_guest_sysenter, get_vmcs_link; static int get_exit_reason, get_vmcs_exit_qualification; static int get_vmcs_exit_interruption_info, get_vmcs_exit_interruption_error; +static int get_vmcs_exit_inst_length; static uint64_t desc_base; static uint32_t desc_limit, desc_access; @@ -1145,7 +1146,15 @@ get_misc_vmcs(struct vmctx *ctx, int vcp vcpu, u64); } } - + + if (!error && (get_vmcs_exit_inst_length || get_all)) { + error = vm_get_vmcs_field(ctx, vcpu, + VMCS_EXIT_INSTRUCTION_LENGTH, &u64); + if (error == 0) + printf("vmcs_exit_inst_length[%d]\t0x%08x\n", vcpu, + (uint32_t)u64); + } + if (!error && (get_vmcs_exit_qualification || get_all)) { error = vm_get_vmcs_field(ctx, vcpu, VMCS_EXIT_QUALIFICATION, &u64); @@ -1405,6 +1414,8 @@ setup_options(bool cpu_intel) REQ_ARG, 0, SET_VMCS_ENTRY_INTERRUPTION_INFO }, { "get-vmcs-exit-qualification", NO_ARG, &get_vmcs_exit_qualification, 1 }, + { "get-vmcs-exit-inst-length", + NO_ARG, &get_vmcs_exit_inst_length, 1 }, { "get-vmcs-interruptibility", NO_ARG, &get_vmcs_interruptibility, 1 }, { "get-vmcs-exit-interruption-error", ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283257 - head/bin/pax
Author: delphij Date: Thu May 21 18:29:36 2015 New Revision: 283257 URL: https://svnweb.freebsd.org/changeset/base/283257 Log: Eliminate unneeded includes. MFC after:2 weeks Modified: head/bin/pax/ar_subs.c head/bin/pax/buf_subs.c head/bin/pax/cache.c head/bin/pax/cpio.c head/bin/pax/file_subs.c head/bin/pax/gen_subs.c head/bin/pax/getoldopt.c head/bin/pax/pat_rep.c head/bin/pax/pax.c head/bin/pax/sel_subs.c head/bin/pax/tar.c head/bin/pax/tty_subs.c Modified: head/bin/pax/ar_subs.c == --- head/bin/pax/ar_subs.c Thu May 21 18:29:11 2015(r283256) +++ head/bin/pax/ar_subs.c Thu May 21 18:29:36 2015(r283257) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "pax.h" #include "extern.h" Modified: head/bin/pax/buf_subs.c == --- head/bin/pax/buf_subs.c Thu May 21 18:29:11 2015(r283256) +++ head/bin/pax/buf_subs.c Thu May 21 18:29:36 2015(r283257) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "pax.h" #include "extern.h" Modified: head/bin/pax/cache.c == --- head/bin/pax/cache.cThu May 21 18:29:11 2015(r283256) +++ head/bin/pax/cache.cThu May 21 18:29:36 2015(r283257) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "pax.h" #include "cache.h" Modified: head/bin/pax/cpio.c == --- head/bin/pax/cpio.c Thu May 21 18:29:11 2015(r283256) +++ head/bin/pax/cpio.c Thu May 21 18:29:36 2015(r283257) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include "pax.h" #include "cpio.h" #include "extern.h" Modified: head/bin/pax/file_subs.c == --- head/bin/pax/file_subs.cThu May 21 18:29:11 2015(r283256) +++ head/bin/pax/file_subs.cThu May 21 18:29:36 2015(r283257) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "pax.h" #include "options.h" #include "extern.h" Modified: head/bin/pax/gen_subs.c == --- head/bin/pax/gen_subs.c Thu May 21 18:29:11 2015(r283256) +++ head/bin/pax/gen_subs.c Thu May 21 18:29:36 2015(r283257) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include "pax.h" #include "extern.h" Modified: head/bin/pax/getoldopt.c == --- head/bin/pax/getoldopt.cThu May 21 18:29:11 2015(r283256) +++ head/bin/pax/getoldopt.cThu May 21 18:29:36 2015(r283257) @@ -19,8 +19,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pax.h" -#include "extern.h" +int getoldopt(int, char **, const char *); int getoldopt(int argc, char **argv, const char *optstring) Modified: head/bin/pax/pat_rep.c == --- head/bin/pax/pat_rep.c Thu May 21 18:29:11 2015(r283256) +++ head/bin/pax/pat_rep.c Thu May 21 18:29:36 2015(r283257) @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #ifdef NET2_REGEX #include #else Modified: head/bin/pax/pax.c == --- head/bin/pax/pax.c Thu May 21 18:29:11 2015(r283256) +++ head/bin/pax/pax.c Thu May 21 18:29:36 2015(r283257) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "pax.h" #include "extern.h" static int gen_init(void); Modified: head/bin/pax/sel_subs.c == --- head/bin/pax/sel_subs.c Thu May 21 18:29:11 2015(r283256) +++ head/bin/pax/sel_subs.c Thu May 21 18:29:36 2015(r283257) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "pax.h" #include "sel_subs.h" Modified: head/bin/pax/tar.c == --- head/bin/pax/tar.c Thu May 21 18:29:11 2015(r283256) +++ head/bin/pax/tar.c Thu May 21 18:29:36 2015(r283257) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include "pax.h" #include "extern.h" #include "tar.h" Modified: head/bin/pax/tty_subs.c
svn commit: r283258 - stable/10/bin/date
Author: delphij Date: Thu May 21 18:59:11 2015 New Revision: 283258 URL: https://svnweb.freebsd.org/changeset/base/283258 Log: MFC r282608: date(1): Make -r behave like GNU's version when the option can not be interpreted as a number, which checks the file's modification time and use that as the date/time value. This improves compatibility with GNU coreutils's version of date(1). Modified: stable/10/bin/date/date.1 stable/10/bin/date/date.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/date/date.1 == --- stable/10/bin/date/date.1 Thu May 21 18:29:36 2015(r283257) +++ stable/10/bin/date/date.1 Thu May 21 18:59:11 2015(r283258) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 26, 2014 +.Dd May 7, 2015 .Dt DATE 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl jRu -.Op Fl r Ar seconds +.Op Fl r Ar seconds | Ar filename .Oo .Fl v .Sm off @@ -150,6 +150,9 @@ is the number of seconds since the Epoch see .Xr time 3 ) , and can be specified in decimal, octal, or hex. +.It Fl r Ar filename +Print the date and time of the last modification of +.Ar filename . .It Fl t Ar minutes_west Set the system's value for minutes west of .Tn GMT . Modified: stable/10/bin/date/date.c == --- stable/10/bin/date/date.c Thu May 21 18:29:36 2015(r283257) +++ stable/10/bin/date/date.c Thu May 21 18:59:11 2015(r283258) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -85,6 +86,7 @@ main(int argc, char *argv[]) struct vary *v; const struct vary *badv; struct tm lt; + struct stat sb; v = NULL; fmt = NULL; @@ -116,8 +118,12 @@ main(int argc, char *argv[]) case 'r': /* user specified seconds */ rflag = 1; tval = strtoq(optarg, &tmp, 0); - if (*tmp != 0) - usage(); + if (*tmp != 0) { + if (stat(optarg, &sb) == 0) + tval = sb.st_mtim.tv_sec; + else + usage(); + } break; case 't': /* minutes west of UTC */ /* error check; don't allow "PST" */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283259 - stable/10/contrib/libarchive/libarchive
Author: delphij Date: Thu May 21 19:05:47 2015 New Revision: 283259 URL: https://svnweb.freebsd.org/changeset/base/283259 Log: MFC r282932: MFV r282927,r282928,r282930 (kientzle): Don't segfault when reading malformed cpio archives. Modified: stable/10/contrib/libarchive/libarchive/archive_read.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/libarchive/archive_read.c == --- stable/10/contrib/libarchive/libarchive/archive_read.c Thu May 21 18:59:11 2015(r283258) +++ stable/10/contrib/libarchive/libarchive/archive_read.c Thu May 21 19:05:47 2015(r283259) @@ -1395,6 +1395,8 @@ __archive_read_filter_consume(struct arc { int64_t skipped; + if (request < 0) + return ARCHIVE_FATAL; if (request == 0) return 0; Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c == --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Thu May 21 18:59:11 2015(r283258) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Thu May 21 19:05:47 2015(r283259) @@ -198,7 +198,7 @@ static int archive_read_format_cpio_read static int archive_read_format_cpio_read_header(struct archive_read *, struct archive_entry *); static int archive_read_format_cpio_skip(struct archive_read *); -static int be4(const unsigned char *); +static int64_t be4(const unsigned char *); static int find_odc_header(struct archive_read *); static int find_newc_header(struct archive_read *); static int header_bin_be(struct archive_read *, struct cpio *, @@ -213,7 +213,7 @@ static int header_afiol(struct archive_r struct archive_entry *, size_t *, size_t *); static int is_octal(const char *, size_t); static int is_hex(const char *, size_t); -static int le4(const unsigned char *); +static int64_t le4(const unsigned char *); static int record_hardlink(struct archive_read *a, struct cpio *cpio, struct archive_entry *entry); @@ -864,8 +864,11 @@ header_bin_le(struct archive_read *a, st /* Read fixed-size portion of header. */ h = __archive_read_ahead(a, bin_header_size, NULL); - if (h == NULL) + if (h == NULL) { + archive_set_error(&a->archive, 0, + "End of file trying to read next cpio header"); return (ARCHIVE_FATAL); + } /* Parse out binary fields. */ header = (const unsigned char *)h; @@ -900,8 +903,11 @@ header_bin_be(struct archive_read *a, st /* Read fixed-size portion of header. */ h = __archive_read_ahead(a, bin_header_size, NULL); - if (h == NULL) + if (h == NULL) { + archive_set_error(&a->archive, 0, + "End of file trying to read next cpio header"); return (ARCHIVE_FATAL); + } /* Parse out binary fields. */ header = (const unsigned char *)h; @@ -944,17 +950,17 @@ archive_read_format_cpio_cleanup(struct return (ARCHIVE_OK); } -static int +static int64_t le4(const unsigned char *p) { - return ((p[0]<<16) + (p[1]<<24) + (p[2]<<0) + (p[3]<<8)); + return ((p[0] << 16) + (((int64_t)p[1]) << 24) + (p[2] << 0) + (p[3] << 8)); } -static int +static int64_t be4(const unsigned char *p) { - return ((p[0]<<24) + (p[1]<<16) + (p[2]<<8) + (p[3])); + return int64_t)p[0]) << 24) + (p[1] << 16) + (p[2] << 8) + (p[3])); } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283260 - stable/10/usr.sbin/crunch/crunchide
Author: emaste Date: Thu May 21 19:16:28 2015 New Revision: 283260 URL: https://svnweb.freebsd.org/changeset/base/283260 Log: MFC r282144: crunchide: add basic string table sanity checks Reported by: Coverity Scan CID: 978805, 980919 Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c == --- stable/10/usr.sbin/crunch/crunchide/exec_elf32.cThu May 21 19:05:47 2015(r283259) +++ stable/10/usr.sbin/crunch/crunchide/exec_elf32.cThu May 21 19:16:28 2015(r283260) @@ -342,11 +342,14 @@ ELFNAMEEND(hide)(int fd, const char *fn) */ /* load section string table for debug use */ - if ((shstrtabp = xmalloc(xewtoh(shstrtabshdr->sh_size), fn, - "section string table")) == NULL) + if ((size = xewtoh(shstrtabshdr->sh_size)) == 0) + goto bad; + if ((shstrtabp = xmalloc(size, fn, "section string table")) == NULL) goto bad; if ((size_t)xreadatoff(fd, shstrtabp, xewtoh(shstrtabshdr->sh_offset), - xewtoh(shstrtabshdr->sh_size), fn) != xewtoh(shstrtabshdr->sh_size)) + size, fn) != size) + goto bad; + if (shstrtabp[size - 1] != '\0') goto bad; /* we need symtab, strtab, and everything behind strtab */ @@ -367,7 +370,8 @@ ELFNAMEEND(hide)(int fd, const char *fn) strtabidx = i; if (layoutp[i].shdr == symtabshdr || i >= strtabidx) { off = xewtoh(layoutp[i].shdr->sh_offset); - size = xewtoh(layoutp[i].shdr->sh_size); + if ((size = xewtoh(layoutp[i].shdr->sh_size)) == 0) + goto bad; layoutp[i].bufp = xmalloc(size, fn, shstrtabp + xewtoh(layoutp[i].shdr->sh_name)); if (layoutp[i].bufp == NULL) @@ -377,10 +381,13 @@ ELFNAMEEND(hide)(int fd, const char *fn) goto bad; /* set symbol table and string table */ - if (layoutp[i].shdr == symtabshdr) + if (layoutp[i].shdr == symtabshdr) { symtabp = layoutp[i].bufp; - else if (layoutp[i].shdr == strtabshdr) + } else if (layoutp[i].shdr == strtabshdr) { strtabp = layoutp[i].bufp; + if (strtabp[size - 1] != '\0') + goto bad; + } } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283261 - head/sys/dev/acpica
Author: jkim Date: Thu May 21 19:31:10 2015 New Revision: 283261 URL: https://svnweb.freebsd.org/changeset/base/283261 Log: Do not probe Intel PIIX4 south bridge quirks on amd64. These quirky south bridges only supported Intel Pentium and Pentium II era processors and there is no reason for hardware virtualizations to emulate these quirks. MFC after:1 week Modified: head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_throttle.c Modified: head/sys/dev/acpica/acpi_cpu.c == --- head/sys/dev/acpica/acpi_cpu.c Thu May 21 19:16:28 2015 (r283260) +++ head/sys/dev/acpica/acpi_cpu.c Thu May 21 19:31:10 2015 (r283261) @@ -185,7 +185,8 @@ static void acpi_cpu_startup_cx(struct a static voidacpi_cpu_cx_list(struct acpi_cpu_softc *sc); static voidacpi_cpu_idle(sbintime_t sbt); static voidacpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); -static int acpi_cpu_quirks(void); +static voidacpi_cpu_quirks(void); +static voidacpi_cpu_quirks_piix4(void); static int acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_usage_counters_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc); @@ -1239,12 +1240,9 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no acpi_UserNotify("PROCESSOR", sc->cpu_handle, notify); } -static int +static void acpi_cpu_quirks(void) { -device_t acpi_dev; -uint32_t val; - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); /* @@ -1278,6 +1276,16 @@ acpi_cpu_quirks(void) } /* Look for various quirks of the PIIX4 part. */ +acpi_cpu_quirks_piix4(); +} + +static void +acpi_cpu_quirks_piix4(void) +{ +#ifdef __i386__ +device_t acpi_dev; +uint32_t val; + acpi_dev = pci_find_device(PCI_VENDOR_INTEL, PCI_DEVICE_82371AB_3); if (acpi_dev != NULL) { switch (pci_get_revid(acpi_dev)) { @@ -1326,8 +1334,7 @@ acpi_cpu_quirks(void) break; } } - -return (0); +#endif } static int Modified: head/sys/dev/acpica/acpi_throttle.c == --- head/sys/dev/acpica/acpi_throttle.c Thu May 21 19:16:28 2015 (r283260) +++ head/sys/dev/acpica/acpi_throttle.c Thu May 21 19:31:10 2015 (r283261) @@ -96,7 +96,7 @@ static void acpi_throttle_identify(drive static int acpi_throttle_probe(device_t dev); static int acpi_throttle_attach(device_t dev); static int acpi_throttle_evaluate(struct acpi_throttle_softc *sc); -static int acpi_throttle_quirks(struct acpi_throttle_softc *sc); +static voidacpi_throttle_quirks(struct acpi_throttle_softc *sc); static int acpi_thr_settings(device_t dev, struct cf_setting *sets, int *count); static int acpi_thr_set(device_t dev, const struct cf_setting *set); @@ -314,9 +314,10 @@ acpi_throttle_evaluate(struct acpi_throt return (0); } -static int +static void acpi_throttle_quirks(struct acpi_throttle_softc *sc) { +#ifdef __i386__ device_t acpi_dev; /* Look for various quirks of the PIIX4 part. */ @@ -339,8 +340,7 @@ acpi_throttle_quirks(struct acpi_throttl break; } } - - return (0); +#endif } static int ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283262 - stable/10/sys/amd64/amd64
Author: emaste Date: Thu May 21 19:40:31 2015 New Revision: 283262 URL: https://svnweb.freebsd.org/changeset/base/283262 Log: MFC r258431: Disable amd64 boot time memory test by default The page presence memory test takes a long time on large memory systems and has little value on contemporary amd64 hardware. Relnotes: Yes Reviewed by: jhb, kib Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D1544 Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c == --- stable/10/sys/amd64/amd64/machdep.c Thu May 21 19:31:10 2015 (r283261) +++ stable/10/sys/amd64/amd64/machdep.c Thu May 21 19:40:31 2015 (r283262) @@ -1590,13 +1590,15 @@ getmemsize(caddr_t kmdp, u_int64_t first Maxmem = atop(physmem_tunable); /* -* By default enable the memory test on real hardware, and disable -* it if we appear to be running in a VM. This avoids touching all -* pages unnecessarily, which doesn't matter on real hardware but is -* bad for shared VM hosts. Use a general name so that -* one could eventually do more with the code than just disable it. +* The boot memory test is disabled by default, as it takes a +* significant amount of time on large-memory systems, and is +* unfriendly to virtual machines as it unnecessarily touches all +* pages. +* +* A general name is used as the code may be extended to support +* additional tests beyond the current "page present" test. */ - memtest = (vm_guest > VM_GUEST_NO) ? 0 : 1; + memtest = 0; TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r283136 - head/sys/netinet
On 05/21/15 at 03:27P, Lawrence Stewart wrote: > On 05/20/15 23:19, Eric van Gyzen wrote: > > On 05/20/2015 02:33, Lawrence Stewart wrote: > >> On 05/20/15 14:24, Hiren Panchasara wrote: > >>> On 05/20/15 at 02:13P, Lawrence Stewart wrote: > Hi Hiren, > > On 05/20/15 11:08, Hiren Panchasara wrote: > > Author: hiren Date: Wed May 20 01:08:01 2015 New Revision: > > 283136 URL: https://svnweb.freebsd.org/changeset/base/283136 > > > > Log: Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to > > expire and purge all entries in hostcache immediately. > > > > In collaboration with: bz, rwatson MFC after: 1 week Relnotes: > > yes Sponsored by: Limelight Networks > > Why introduce a new sysctl and not change the existing behaviour > of net.inet.tcp.hostcache.purge? > >>> > >>> I thought it'd make more sense to keep the existing behavior as is > >>> and provide new knob for the new behavior. > >> > >> Don't think so - why would deferring a purge to the next purge run be > >> useful compared to purging immediately? I'd strongly suggest you adapt > >> this change to the existing purge sysctl. I can't see why anyone would > >> miss the old functionality. > > > > I am generally wary of a question such as "Why would anyone want...", > > because as soon as the code is released, someone answers it. > > > > That being said, I have always wanted Hiren's purgenow behavior, and I've > > always been annoyed by the lazy-purge behavior. I would suggest > > implementing Lawrence's suggestion, but NOT MFC'ing it, since that would be > > a disruptive change. > > > > Thanks for your work, Hiren. > > I see no reason not to MFC it - it's not a POLA violation for a stable > branch. When the user requests a purge, it's surely equally as good (and > I think anyone of right mind would argue better ;) to purge immediately > than some number of seconds "n" in the future, where "n" is between 1 > and the value of net.inet.tcp.hostcache.prune. I *do* want to MFC the change. And if there are no major objections, I'll go ahead with what Lawrence is suggesting: changing current purge behavior in -head and 10. cheers, Hiren pgp6X7mRWX5yO.pgp Description: PGP signature
svn commit: r283263 - head/sys/dev/sdhci
Author: loos Date: Thu May 21 20:09:36 2015 New Revision: 283263 URL: https://svnweb.freebsd.org/changeset/base/283263 Log: Raise the SDHCI timeout to 10 seconds and add a sysctl to allow changing this value at runtime. The SD card specification says that a block write or a block erase can take up to 250ms to complete and thus, under some circumstances, the existent 2 seconds timeout was triggering with normal usage. This change fixes the sporadic controller timeout that happens on RPi and RPi 2. Discussed with: ian (some time ago) Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.c == --- head/sys/dev/sdhci/sdhci.c Thu May 21 19:40:31 2015(r283262) +++ head/sys/dev/sdhci/sdhci.c Thu May 21 20:09:36 2015(r283263) @@ -615,10 +615,16 @@ sdhci_init_slot(device_t dev, struct sdh (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); sdhci_dumpregs(slot); } - + + slot->timeout = 10; + SYSCTL_ADD_INT(device_get_sysctl_ctx(slot->bus), + SYSCTL_CHILDREN(device_get_sysctl_tree(slot->bus)), OID_AUTO, + "timeout", CTLFLAG_RW, &slot->timeout, 0, + "Maximum timeout for SDHCI transfers (in secs)"); TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); callout_init(&slot->card_callout, 1); callout_init_mtx(&slot->timeout_callout, &slot->mtx, 0); + return (0); } @@ -872,7 +878,8 @@ sdhci_start_command(struct sdhci_slot *s /* Start command. */ WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff)); /* Start timeout callout. */ - callout_reset(&slot->timeout_callout, 2*hz, sdhci_timeout, slot); + callout_reset(&slot->timeout_callout, slot->timeout * hz, + sdhci_timeout, slot); } static void Modified: head/sys/dev/sdhci/sdhci.h == --- head/sys/dev/sdhci/sdhci.h Thu May 21 19:40:31 2015(r283262) +++ head/sys/dev/sdhci/sdhci.h Thu May 21 20:09:36 2015(r283263) @@ -271,6 +271,7 @@ struct sdhci_slot { #define SDHCI_HAVE_DMA 1 #define SDHCI_PLATFORM_TRANSFER2 u_char version; + int timeout;/* Transfer timeout */ uint32_tmax_clk;/* Max possible freq */ uint32_ttimeout_clk;/* Timeout freq */ bus_dma_tag_t dmatag; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283264 - head/usr.sbin/bhyve
Author: tychon Date: Thu May 21 20:11:52 2015 New Revision: 283264 URL: https://svnweb.freebsd.org/changeset/base/283264 Log: The 'hostbridge' device exists to allow guests to infer msi/msix capablity by advertising pcie capability. Since the 'hostbridge' device isn't a true pci-to-pci bridge, and doesn't actaully use the bridge configuration space layout, change the header-type from type 1 to type 0 to avoid confusion. Reviewed by: neel Modified: head/usr.sbin/bhyve/pci_hostbridge.c Modified: head/usr.sbin/bhyve/pci_hostbridge.c == --- head/usr.sbin/bhyve/pci_hostbridge.cThu May 21 20:09:36 2015 (r283263) +++ head/usr.sbin/bhyve/pci_hostbridge.cThu May 21 20:11:52 2015 (r283264) @@ -38,7 +38,7 @@ pci_hostbridge_init(struct vmctx *ctx, s /* config space */ pci_set_cfgdata16(pi, PCIR_VENDOR, 0x1275); /* NetApp */ pci_set_cfgdata16(pi, PCIR_DEVICE, 0x1275); /* NetApp */ - pci_set_cfgdata8(pi, PCIR_HDRTYPE, PCIM_HDRTYPE_BRIDGE); + pci_set_cfgdata8(pi, PCIR_HDRTYPE, PCIM_HDRTYPE_NORMAL); pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_BRIDGE); pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_BRIDGE_HOST); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r283136 - head/sys/netinet
On 21 May 2015 at 16:03, Hiren Panchasara wrote: > > I *do* want to MFC the change. And if there are no major objections, I'll go > ahead with what Lawrence is suggesting: changing current purge behavior in > -head > and 10. For the record, that sounds reasonable to me. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283265 - head/release
Author: gjb Date: Thu May 21 20:18:13 2015 New Revision: 283265 URL: https://svnweb.freebsd.org/changeset/base/283265 Log: cd(1) to .CURDIR before calling stat(1) to fix the path to sh(1). Include xz(1)-compressed images when renaming snapshot builds. Use OSRELEASE in place of REVISION-BRANCH for checksum filenames. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.mirrors Modified: head/release/Makefile.mirrors == --- head/release/Makefile.mirrors Thu May 21 20:11:52 2015 (r283264) +++ head/release/Makefile.mirrors Thu May 21 20:18:13 2015 (r283265) @@ -22,7 +22,7 @@ STAGE_TARGETS?= iso-images-stage .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 +BUILDDATE!=cd ${.CURDIR} && 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} @@ -70,10 +70,8 @@ iso-images-stage: . for IMAGE in ${IMAGES} cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \ ${ISO_DIR}/${OSRELEASE}-${IMAGE} -. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz) cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \ ${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz -. endif . if exists(${RELEASEDIR}/CHECKSUM.${CHECKSUM}) cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM} \ ${ISO_DIR}/CHECKSUM.${CHECKSUM} @@ -85,25 +83,30 @@ iso-images-stage: . for IMAGE in ${IMAGES} cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE} \ ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} + cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE}.xz \ + ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} + cd ${TLD}/ISO-IMAGES/${REVISION} && \ + ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz . 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} + CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ - ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${REVISION}-${BRANCH}-${SNAP_SUFFIX} + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} . endfor .else # !snapshot cd ${TLD}/ISO-IMAGES/${REVISION} && ln -s \ ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE} . cd ${ISO_DIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ - CHECKSUM.${CHECKSUM}-${REVISION}-${BRANCH}-${SNAP_SUFFIX} + CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} .endif .if exists(${RELEASEDIR}/ftp) mkdir -p ${FTP_DIR} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283266 - head/release
Author: gjb Date: Thu May 21 20:22:55 2015 New Revision: 283266 URL: https://svnweb.freebsd.org/changeset/base/283266 Log: Include xz(1)-compressed images when not a snapshot build. Do not suffix non-snapshot checksum files with SNAP_SUFFIX. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.mirrors Modified: head/release/Makefile.mirrors == --- head/release/Makefile.mirrors Thu May 21 20:18:13 2015 (r283265) +++ head/release/Makefile.mirrors Thu May 21 20:22:55 2015 (r283266) @@ -104,9 +104,11 @@ iso-images-stage: . endfor .else # !snapshot cd ${TLD}/ISO-IMAGES/${REVISION} && ln -s \ - ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE} . + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE} + cd ${TLD}/ISO-IMAGES/${REVISION} && ln -s \ + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}.xz cd ${ISO_DIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \ - CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} + CHECKSUM.${CHECKSUM}-${OSRELEASE} .endif .if exists(${RELEASEDIR}/ftp) mkdir -p ${FTP_DIR} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283267 - stable/10/sys/sys
Author: pfg Date: Thu May 21 20:39:39 2015 New Revision: 283267 URL: https://svnweb.freebsd.org/changeset/base/283267 Log: MFC r282863: Adjust visibility macros. The GCC visibility attributes were introduced in GCC 4.0. Apparently the "protected" attribute was introduced only until GCC 4.2, but we are not currently using it. Modified: stable/10/sys/sys/cdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/cdefs.h == --- stable/10/sys/sys/cdefs.h Thu May 21 20:22:55 2015(r283266) +++ stable/10/sys/sys/cdefs.h Thu May 21 20:39:39 2015(r283267) @@ -439,7 +439,7 @@ #define __predict_false(exp)(exp) #endif -#if __GNUC_PREREQ__(4, 2) +#if __GNUC_PREREQ__(4, 0) #define__hidden__attribute__((__visibility__("hidden"))) #define__exported __attribute__((__visibility__("default"))) #else ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283268 - head/release
Author: gjb Date: Thu May 21 20:43:02 2015 New Revision: 283268 URL: https://svnweb.freebsd.org/changeset/base/283268 Log: Remove the arm/armv6 bits from Makefile.mirrors, which needs some re-thinking. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.mirrors Modified: head/release/Makefile.mirrors == --- head/release/Makefile.mirrors Thu May 21 20:39:39 2015 (r283267) +++ head/release/Makefile.mirrors Thu May 21 20:43:02 2015 (r283268) @@ -23,14 +23,7 @@ STAGE_TARGETS?= iso-images-stage SNAPSHOT= 1 TLD?= ${FTPDIR}/snapshots BUILDDATE!=cd ${.CURDIR} && 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}) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283269 - head/sys/dev/bxe
Author: davidcs Date: Thu May 21 20:47:19 2015 New Revision: 283269 URL: https://svnweb.freebsd.org/changeset/base/283269 Log: Limit the size of the posted receive buffers in Rx Rings to MJUMPAGESIZE. Previously for jumbo MTUs, the rx ring buffers were MTU + any required pad. Now when this size greater than MJUMPAGESIZE, the packet is spanned across multiple buffers and the mbufs are stiched together. Submitted by:gary.zambr...@qlogic.com Approved by:davi...@freebsd.org Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Thu May 21 20:43:02 2015(r283268) +++ head/sys/dev/bxe/bxe.c Thu May 21 20:47:19 2015(r283269) @@ -3100,7 +3100,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; @@ -3113,17 +3113,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; @@ -3239,6 +3239,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) { @@ -3278,7 +3325,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); @@ -3293,7 +3340,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, @@ -3304,7 +3351,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))) { @@ -3351,7 +3399,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); g
Re: svn commit: r283136 - head/sys/netinet
On 05/21/2015 16:03, Hiren Panchasara wrote: > On 05/21/15 at 03:27P, Lawrence Stewart wrote: >> On 05/20/15 23:19, Eric van Gyzen wrote: >>> On 05/20/2015 02:33, Lawrence Stewart wrote: On 05/20/15 14:24, Hiren Panchasara wrote: > On 05/20/15 at 02:13P, Lawrence Stewart wrote: >> Hi Hiren, >> >> On 05/20/15 11:08, Hiren Panchasara wrote: >>> Author: hiren Date: Wed May 20 01:08:01 2015 New Revision: >>> 283136 URL: https://svnweb.freebsd.org/changeset/base/283136 >>> >>> Log: Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to >>> expire and purge all entries in hostcache immediately. >>> >>> In collaboration with: bz, rwatson MFC after: 1 week Relnotes: >>> yes Sponsored by: Limelight Networks >> >> Why introduce a new sysctl and not change the existing behaviour >> of net.inet.tcp.hostcache.purge? > > I thought it'd make more sense to keep the existing behavior as is > and provide new knob for the new behavior. Don't think so - why would deferring a purge to the next purge run be useful compared to purging immediately? I'd strongly suggest you adapt this change to the existing purge sysctl. I can't see why anyone would miss the old functionality. >>> >>> I am generally wary of a question such as "Why would anyone want...", >>> because as soon as the code is released, someone answers it. >>> >>> That being said, I have always wanted Hiren's purgenow behavior, and I've >>> always been annoyed by the lazy-purge behavior. I would suggest >>> implementing Lawrence's suggestion, but NOT MFC'ing it, since that would be >>> a disruptive change. >>> >>> Thanks for your work, Hiren. >> >> I see no reason not to MFC it - it's not a POLA violation for a stable >> branch. When the user requests a purge, it's surely equally as good (and >> I think anyone of right mind would argue better ;) to purge immediately >> than some number of seconds "n" in the future, where "n" is between 1 >> and the value of net.inet.tcp.hostcache.prune. > > I *do* want to MFC the change. And if there are no major objections, I'll go > ahead with what Lawrence is suggesting: changing current purge behavior in > -head > and 10. I don't strongly object. I like the new behavior, and I expect most people would, as long as it's clearly stated in the Release Notes (as it will be, since you tagged it thus). Thanks for your work, Eric signature.asc Description: OpenPGP digital signature
svn commit: r283270 - stable/10/contrib/netcat
Author: delphij Date: Thu May 21 21:45:37 2015 New Revision: 283270 URL: https://svnweb.freebsd.org/changeset/base/283270 Log: MFC r282613: MFV r282611: netcat from OpenBSD 5.7. Modified: stable/10/contrib/netcat/netcat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netcat/netcat.c == --- stable/10/contrib/netcat/netcat.c Thu May 21 20:47:19 2015 (r283269) +++ stable/10/contrib/netcat/netcat.c Thu May 21 21:45:37 2015 (r283270) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.122 2014/07/20 01:38:40 guenther Exp $ */ +/* $OpenBSD: netcat.c,v 1.127 2015/02/14 22:40:22 jca Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -42,7 +42,6 @@ #include #include -#include #ifdef IPSEC #include #endif @@ -73,6 +72,12 @@ #define PORT_MAX_LEN 6 #define UNIX_DG_TMP_SOCKET_SIZE19 +#define POLL_STDIN 0 +#define POLL_NETOUT 1 +#define POLL_NETIN 2 +#define POLL_STDOUT 3 +#define BUFSIZE 16384 + /* Command Line Options */ intdflag; /* detached, no stdin */ intFflag; /* fdpass sock to stdout */ @@ -117,10 +122,12 @@ int udptest(int); intunix_bind(char *); intunix_connect(char *); intunix_listen(char *); -void set_common_sockopts(int); +void set_common_sockopts(int, int); intmap_tos(char *, int *); void report_connect(const struct sockaddr *, socklen_t); void usage(int); +ssize_t drainbuf(int, unsigned char *, size_t *); +ssize_t fillbuf(int, unsigned char *, size_t *); #ifdef IPSEC void add_ipsec_policy(int, char *); @@ -436,7 +443,7 @@ main(int argc, char *argv[]) &len); if (connfd == -1) { /* For now, all errnos are fatal */ - err(1, "accept"); + err(1, "accept"); } if (vflag) report_connect((struct sockaddr *)&cliaddr, len); @@ -663,7 +670,7 @@ remote_connect(const char *host, const c freeaddrinfo(ares); } - set_common_sockopts(s); + set_common_sockopts(s, res0->ai_family); if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) break; @@ -767,6 +774,8 @@ local_listen(char *host, char *port, str err(1, "disable TCP options"); } + set_common_sockopts(s, res0->ai_family); + if (bind(s, (struct sockaddr *)res0->ai_addr, res0->ai_addrlen) == 0) break; @@ -790,68 +799,224 @@ local_listen(char *host, char *port, str * Loop that polls on the network file descriptor and stdin. */ void -readwrite(int nfd) +readwrite(int net_fd) { - struct pollfd pfd[2]; - unsigned char buf[16 * 1024]; - int n, wfd = fileno(stdin); - int lfd = fileno(stdout); - int plen; - - plen = sizeof(buf); - - /* Setup Network FD */ - pfd[0].fd = nfd; - pfd[0].events = POLLIN; - - /* Set up STDIN FD. */ - pfd[1].fd = wfd; - pfd[1].events = POLLIN; + struct pollfd pfd[4]; + int stdin_fd = STDIN_FILENO; + int stdout_fd = STDOUT_FILENO; + unsigned char netinbuf[BUFSIZE]; + size_t netinbufpos = 0; + unsigned char stdinbuf[BUFSIZE]; + size_t stdinbufpos = 0; + int n, num_fds; + ssize_t ret; + + /* don't read from stdin if requested */ + if (dflag) + stdin_fd = -1; + + /* stdin */ + pfd[POLL_STDIN].fd = stdin_fd; + pfd[POLL_STDIN].events = POLLIN; + + /* network out */ + pfd[POLL_NETOUT].fd = net_fd; + pfd[POLL_NETOUT].events = 0; + + /* network in */ + pfd[POLL_NETIN].fd = net_fd; + pfd[POLL_NETIN].events = POLLIN; + + /* stdout */ + pfd[POLL_STDOUT].fd = stdout_fd; + pfd[POLL_STDOUT].events = 0; + + while (1) { + /* both inputs are gone, buffers are empty, we are done */ + if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 + && stdinbufpos == 0 && netinbufpos == 0) { + close(net_fd); + return; + } + /* both outputs are gone, we can't continue */ + if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) { + close(net_fd); + return; + } + /* listen and net in gone, queues empty, done */ + if (lflag && pfd[POLL_NETIN].fd == -1 + && stdinbufpos == 0 && netinbufpos == 0) { +
svn commit: r283271 - head/release
Author: gjb Date: Thu May 21 22:11:57 2015 New Revision: 283271 URL: https://svnweb.freebsd.org/changeset/base/283271 Log: If TARGET or EMBEDDED_TARGET == arm, set EMBEDDED variable, which helps control some of the arm-specific bits a bit more cleanly (but not really 'clean'). If BOARDNAME is defined (as is in the WANDBOARD configuration RE uses), do some magic to work with the KERNCONF and BOARDNAME to rename the file, making it a bit more intuitive for the consumer to determine which they need. Yes, it is ugly, that is why there is a big warning at the top. It is, however, still much cleaner than the now 474-line shell script, and this Makefile produces the hierarchy needed without much evil. MFC after:1 week X-MFC-Note: needs all previous Makefile.mirror commits Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.mirrors Modified: head/release/Makefile.mirrors == --- head/release/Makefile.mirrors Thu May 21 21:45:37 2015 (r283270) +++ head/release/Makefile.mirrors Thu May 21 22:11:57 2015 (r283271) @@ -18,12 +18,14 @@ RELEASEDIR?=/R FTPDIR?= ${RELEASEDIR}/ftp-stage STAGE_TARGETS?=iso-images-stage +.if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm" +EMBEDDED= 1 +.endif + # snapshot .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" SNAPSHOT= 1 TLD?= ${FTPDIR}/snapshots -BUILDDATE!=cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d -_SNAP_SUFFIX:= -${BUILDDATE} . for _D in /usr/bin /usr/local/bin . for _S in svnversion svnliteversion . if exists(${_D}/${_S}) @@ -31,9 +33,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 @@ -41,6 +50,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:= ${BOARDNAME}.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} @@ -61,10 +84,19 @@ iso-images-stage: .if exists(${RELEASEDIR}) @# Assume we have images to copy. . for IMAGE in ${IMAGES} + @# arm/armv6 IMX6 -> WANDBOARD, for example. +. if defined(OLDNAME) && !empty(OLDNAME) + cd ${RELEASEDIR} && mv ${OSRELEASE}-${IMAGE:S,${BOARDNAME},${OLDNAME},}.xz \ + ${OSRELEASE}-${IMAGE}.xz +. endif +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}) cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \ ${ISO_DIR}/${OSRELEASE}-${IMAGE} +. endif +. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz) cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \ ${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz +. endif . if exists(${RELEASEDIR}/CHECKSUM.${CHECKSUM}) cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM} \ ${ISO_DIR}/CHECKSUM.${CHECKSUM} @@ -75,31 +107,40 @@ iso-images-stage: .if defined(SNAPSHOT) && !empty(SNAPSHOT) . for IMAGE in ${IMAGES} cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE} \ - ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} + ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} || true cd ${ISO_DIR} && mv ${OSRELEASE}-${IMAGE}.xz \ - ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz + ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz || true cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ - ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} || true cd ${TLD}/ISO-IMAGES/${REVISION} && \ ln -s \ - ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz + ../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz || true + cd ${TLD}
svn commit: r283272 - head/release
Author: gjb Date: Thu May 21 22:50:39 2015 New Revision: 283272 URL: https://svnweb.freebsd.org/changeset/base/283272 Log: Fix make(1) syntax error for non-embedded targets. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.mirrors Modified: head/release/Makefile.mirrors == --- head/release/Makefile.mirrors Thu May 21 22:11:57 2015 (r283271) +++ head/release/Makefile.mirrors Thu May 21 22:50:39 2015 (r283272) @@ -18,8 +18,10 @@ RELEASEDIR?= /R FTPDIR?= ${RELEASEDIR}/ftp-stage STAGE_TARGETS?=iso-images-stage -.if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm" +.if defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET) +. if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm" EMBEDDED= 1 +. endif .endif # snapshot ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283273 - head/sys/fs/nfsclient
Author: rmacklem Date: Thu May 21 23:14:18 2015 New Revision: 283273 URL: https://svnweb.freebsd.org/changeset/base/283273 Log: The NFS client wasn't handling getdirentries(2) requests for sizes that are not an exact multiple of DIRBLKSIZ correctly. Fortunately readdir(3) always uses an exact multiple of DIRBLKSIZ, so few applications were affected. This patch fixes this problem by reducing the size of the directory read to an exact multiple of DIRBLKSIZ. Tested by:trasz Reported by: trasz Reviewed by: trasz MFC after:2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c == --- head/sys/fs/nfsclient/nfs_clvnops.c Thu May 21 22:50:39 2015 (r283272) +++ head/sys/fs/nfsclient/nfs_clvnops.c Thu May 21 23:14:18 2015 (r283273) @@ -2210,7 +2210,7 @@ nfs_readdir(struct vop_readdir_args *ap) struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); struct uio *uio = ap->a_uio; - ssize_t tresid; + ssize_t tresid, left; int error = 0; struct vattr vattr; @@ -2239,6 +2239,17 @@ nfs_readdir(struct vop_readdir_args *ap) } /* +* NFS always guarantees that directory entries don't straddle +* DIRBLKSIZ boundaries. As such, we need to limit the size +* to an exact multiple of DIRBLKSIZ, to avoid copying a partial +* directory entry. +*/ + left = uio->uio_resid % DIRBLKSIZ; + if (left == uio->uio_resid) + return (EINVAL); + uio->uio_resid -= left; + + /* * Call ncl_bioread() to do the real work. */ tresid = uio->uio_resid; @@ -2249,6 +2260,9 @@ nfs_readdir(struct vop_readdir_args *ap) if (ap->a_eofflag != NULL) *ap->a_eofflag = 1; } + + /* Add the partial DIRBLKSIZ (left) back in. */ + uio->uio_resid += left; return (error); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"