svn commit: r333622 - head/usr.sbin/bhyve
Author: araujo Date: Tue May 15 05:55:29 2018 New Revision: 333622 URL: https://svnweb.freebsd.org/changeset/base/333622 Log: vq_getchain() can return -1 if some descriptor(s) are invalid and prints a diagnostic message. So we do a sanity checking on the return value of vq_getchain(). Spotted by: gcc49 Reviewed by: avg MFC after:4 weeks Sponsored by: iXsystems Inc. Differential Revision:https://reviews.freebsd.org/D15388 Modified: head/usr.sbin/bhyve/pci_virtio_console.c Modified: head/usr.sbin/bhyve/pci_virtio_console.c == --- head/usr.sbin/bhyve/pci_virtio_console.cTue May 15 04:31:11 2018 (r333621) +++ head/usr.sbin/bhyve/pci_virtio_console.cTue May 15 05:55:29 2018 (r333622) @@ -579,6 +579,7 @@ pci_vtcon_notify_tx(void *vsc, struct vqueue_info *vq) while (vq_has_descs(vq)) { n = vq_getchain(vq, , iov, 1, flags); + assert(n >= 1); if (port != NULL) port->vsp_cb(port, port->vsp_arg, iov, 1); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333621 - head/usr.sbin/cxgbetool
Author: np Date: Tue May 15 04:31:11 2018 New Revision: 333621 URL: https://svnweb.freebsd.org/changeset/base/333621 Log: cxgbetool(8): Provide user interface for hashfilters, hardware NAT, and other filtering related features that were recently added to the driver. Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.8 head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.8 == --- head/usr.sbin/cxgbetool/cxgbetool.8 Tue May 15 04:24:38 2018 (r333620) +++ head/usr.sbin/cxgbetool/cxgbetool.8 Tue May 15 04:31:11 2018 (r333621) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2015, Chelsio Inc +.\" Copyright (c) 2015, 2018 Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 13, 2018 +.Dd May 14, 2018 .Dt CXGBETOOL 8 .Os .Sh NAME @@ -48,10 +48,20 @@ .It .Nm Ar nexus Cm context Bro Cm ingress | egress | fl | cong Brc Ar cntxt_id .It -.Nm Ar nexus Cm filter mode Op Ar match-criteria ... +.Nm Ar nexus Cm hashfilter mode .It -.Nm Ar nexus Cm filter Ar idx Bro Ar filter-specification | Cm delete Brc +.Nm Ar nexus Cm hashfilter Ar filter-specification .It +.Nm Ar nexus Cm hashfilter Ar idx Cm delete +.It +.Nm Ar nexus Cm hashfilter list +.It +.Nm Ar nexus Cm filter mode +.It +.Nm Ar nexus Cm filter Ar idx Ar filter-specification +.It +.Nm Ar nexus Cm filter Ar idx Cm delete +.It .Nm Ar nexus Cm filter list .It .Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len @@ -141,44 +151,51 @@ context id of a freelist manager. The FLM context id is displayed in the egress context dump of a freelist as FLMcontextID. .El -.It Cm filter mode Op Ar match-criteria ... -Display or set the nexus's filter mode. -.Ar match-criteria -is a whitespace separated list of criteria from the table below. -Each criteria has an associated budget which is also listed in the table. -The total budget allowed is 36 and attempts to set a filter mode that -exceeds this will be rejected. -Every filter must conform to the filter mode -- multiple match criteria -per filter are allowed but only from among those in the current setting -of the filter mode. -The filter mode can only be changed when there are no existing filters. -Its default value is -.Cm ipv4 ipv6 sip dip sport dport matchtype proto vlan iport fcoe .Pp +.Bl -item -compact +.It +.Cm hashfilter mode +.It +.Cm filter mode +.El +Display a list of match-criteria available for use in filter rules. +A full list of match-criteria known to the chip is in the table below but not +all can be used together and the firmware sets up the available parameters based +on "filterMode" in the configuration file. +Every filter must conform to the filter mode -- multiple match criteria per +filter are allowed but only from among those in the current setting of the +filter mode. +The filter mode for hash filters is a subset of that for normal TCAM filters and +depends on the "filterMask" setting in the firmware configuration file. +Hash filters do not support masked matches and an exact value for every +parameter in the output of "hashfilter mode" (except ipv4/ipv6) must be provided +when creating a hash filter. +.Pp (Note that .Ar mask defaults to all 1s when not provided explicitly. +Hash filters do not support masked matches. Also note that many of the items being matched are discrete numeric values rather than bit fields and should be masked with caution.) .TS center expand; -cb cb cb cbw(40m) -cb c l l. -Criteria Budget Usage Matches if ... +cb cb cbw(40m) +cb l l. +Criteria Usage Matches if ... _ -ipv4 0 T{ +ipv4 T{ .Cm type ipv4 T} T{ incoming packet is an IPv4 datagram. T} _ -ipv6 0 T{ +ipv6 T{ .Cm type ipv6 T} T{ incoming packet is an IPv6 datagram. T} _ -sip0 T{ +sipT{ .Cm sip Ar addr Ns Op / Ns Ar mask T} T{ bitwise and of the source address in an incoming IP datagram with @@ -189,7 +206,7 @@ equals can be an IPv4 or IPv6 address. T} _ -dip0 T{ +dipT{ .Cm dip Ar addr Ns Op / Ns Ar mask T} T{ bitwise and of the destination address in an incoming IP datagram with @@ -200,7 +217,7 @@ equals can be an IPv4 or IPv6 address. T} _ -sport 0 T{ +sport T{ .Cm sport Ar port Ns Op : Ns Ar mask T} T{ bitwise and of the source port in an incoming TCP or UDP datagram with @@ -209,7 +226,7 @@ equals .Ar port Ns . T} _ -dport 0 T{ +dport T{ .Cm dport Ar port Ns Op : Ns Ar mask T} T{ bitwise and of the destination port in an incoming TCP or UDP datagram with @@ -218,13 +235,13 @@ equals .Ar port Ns . T} _ -fcoe 1 T{ +fcoe T{ .Cm fcoe Brq 0 | 1 T} T{ incoming frame is Fibre Channel over Ethernet(1) or not(0). T} _ -iport 3 T{ +iport T{ .Cm iport Ar val Ns Op : Ns Ar
svn commit: r333620 - in head/sys/dev/cxgbe: . common firmware tom
Author: np Date: Tue May 15 04:24:38 2018 New Revision: 333620 URL: https://svnweb.freebsd.org/changeset/base/333620 Log: cxgbe(4): Filtering related features and fixes. - Driver support for hardware NAT. - Driver support for swapmac action. - Validate a request to create a hashfilter against the filter mask. - Add a hashfilter config file for T5. Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt (contents, props changed) Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4_regs_values.h head/sys/dev/cxgbe/t4_filter.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/common/common.h == --- head/sys/dev/cxgbe/common/common.h Tue May 15 02:26:50 2018 (r333619) +++ head/sys/dev/cxgbe/common/common.h Tue May 15 04:24:38 2018 (r333620) @@ -238,6 +238,7 @@ struct tp_params { uint32_t vlan_pri_map; uint32_t ingress_config; + uint64_t hash_filter_mask; __be16 err_vec_mask; int8_t fcoe_shift; Modified: head/sys/dev/cxgbe/common/t4_hw.c == --- head/sys/dev/cxgbe/common/t4_hw.c Tue May 15 02:26:50 2018 (r333619) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue May 15 04:24:38 2018 (r333620) @@ -8368,6 +8368,7 @@ int t4_init_sge_params(struct adapter *adapter) static void read_filter_mode_and_ingress_config(struct adapter *adap, bool sleep_ok) { + uint32_t v; struct tp_params *tpp = >params.tp; t4_tp_pio_read(adap, >vlan_pri_map, 1, A_TP_VLAN_PRI_MAP, @@ -8391,12 +8392,12 @@ static void read_filter_mode_and_ingress_config(struct tpp->matchtype_shift = t4_filter_field_shift(adap, F_MPSHITTYPE); tpp->frag_shift = t4_filter_field_shift(adap, F_FRAGMENTATION); - /* -* If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID -* represents the presence of an Outer VLAN instead of a VNIC ID. -*/ - if ((tpp->ingress_config & F_VNIC) == 0) - tpp->vnic_shift = -1; + if (chip_id(adap) > CHELSIO_T4) { + v = t4_read_reg(adap, LE_HASH_MASK_GEN_IPV4T5(3)); + adap->params.tp.hash_filter_mask = v; + v = t4_read_reg(adap, LE_HASH_MASK_GEN_IPV4T5(4)); + adap->params.tp.hash_filter_mask |= (u64)v << 32; + } } /** Modified: head/sys/dev/cxgbe/common/t4_regs_values.h == --- head/sys/dev/cxgbe/common/t4_regs_values.h Tue May 15 02:26:50 2018 (r333619) +++ head/sys/dev/cxgbe/common/t4_regs_values.h Tue May 15 04:24:38 2018 (r333620) @@ -292,6 +292,17 @@ #define W_FT_MPSHITTYPE3 #define W_FT_FRAGMENTATION 1 +#define M_FT_FCOE ((1ULL << W_FT_FCOE) - 1) +#define M_FT_PORT ((1ULL << W_FT_PORT) - 1) +#define M_FT_VNIC_ID ((1ULL << W_FT_VNIC_ID) - 1) +#define M_FT_VLAN ((1ULL << W_FT_VLAN) - 1) +#define M_FT_TOS ((1ULL << W_FT_TOS) - 1) +#define M_FT_PROTOCOL ((1ULL << W_FT_PROTOCOL) - 1) +#define M_FT_ETHERTYPE ((1ULL << W_FT_ETHERTYPE) - 1) +#define M_FT_MACMATCH ((1ULL << W_FT_MACMATCH) - 1) +#define M_FT_MPSHITTYPE((1ULL << W_FT_MPSHITTYPE) - 1) +#define M_FT_FRAGMENTATION ((1ULL << W_FT_FRAGMENTATION) - 1) + /* * Some of the Compressed Filter Tuple fields have internal structure. These * bit shifts/masks describe those structures. All shifts are relative to the Added: head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt Tue May 15 04:24:38 2018(r333620) @@ -0,0 +1,300 @@ +# Firmware configuration file. +# +# Global limits (some are hardware limits, others are due to the firmware). +# nvi = 128virtual interfaces +# niqflint = 1023 ingress queues with freelists and/or interrupts +# nethctrl = 64K Ethernet or ctrl egress queues +# neq = 64Kegress queues of all kinds, including freelists +# nexactf = 512MPS TCAM entries, can oversubscribe. +# + +[global] + rss_glb_config_mode = basicvirtual + rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp + + # PL_TIMEOUT register + pl_timeout_value = 1# the timeout value in units of us + + # SGE_THROTTLE_CONTROL + bar2throttlecount = 500 # bar2throttlecount in us + + sge_timer_value = 1, 5, 10, 50, 100, 200#
svn commit: r333618 - head/sys/kern
Author: emaste Date: Tue May 15 00:50:09 2018 New Revision: 333618 URL: https://svnweb.freebsd.org/changeset/base/333618 Log: subr_pidctrl: use standard 2-Clause FreeBSD license and disclaimer Approved by: jeff Modified: head/sys/kern/subr_pidctrl.c Modified: head/sys/kern/subr_pidctrl.c == --- head/sys/kern/subr_pidctrl.cTue May 15 00:00:44 2018 (r333617) +++ head/sys/kern/subr_pidctrl.cTue May 15 00:50:09 2018 (r333618) @@ -8,22 +8,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - *notice unmodified, this list of conditions, and the following - *disclaimer. + *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 ``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 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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333614 - head/sys/dev/mmc
Author: marius Date: Mon May 14 21:57:45 2018 New Revision: 333614 URL: https://svnweb.freebsd.org/changeset/base/333614 Log: Let mmcsd_ioctl() ensure appropriate privileges via priv_check(9). Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c == --- head/sys/dev/mmc/mmcsd.cMon May 14 21:46:06 2018(r333613) +++ head/sys/dev/mmc/mmcsd.cMon May 14 21:57:45 2018(r333614) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -179,7 +180,7 @@ static int mmcsd_bus_bit_width(device_t dev); static daddr_t mmcsd_delete(struct mmcsd_part *part, struct bio *bp); static const char *mmcsd_errmsg(int e); static int mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, -int fflag); +int fflag, struct thread *td); static int mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag); static uintmax_t mmcsd_pretty_size(off_t size, char *unit); @@ -771,22 +772,23 @@ mmcsd_strategy(struct bio *bp) static int mmcsd_ioctl_rpmb(struct cdev *dev, u_long cmd, caddr_t data, -int fflag, struct thread *td __unused) +int fflag, struct thread *td) { - return (mmcsd_ioctl(dev->si_drv1, cmd, data, fflag)); + return (mmcsd_ioctl(dev->si_drv1, cmd, data, fflag, td)); } static int mmcsd_ioctl_disk(struct disk *disk, u_long cmd, void *data, int fflag, -struct thread *td __unused) +struct thread *td) { - return (mmcsd_ioctl(disk->d_drv1, cmd, data, fflag)); + return (mmcsd_ioctl(disk->d_drv1, cmd, data, fflag, td)); } static int -mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, int fflag) +mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, int fflag, +struct thread *td) { struct mmc_ioc_cmd *mic; struct mmc_ioc_multi_cmd *mimc; @@ -795,6 +797,10 @@ mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void if ((fflag & FREAD) == 0) return (EBADF); + + err = priv_check(td, PRIV_DRIVER); + if (err != 0) + return (err); err = 0; switch (cmd) { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333613 - head/sys/dev/sdhci
Author: marius Date: Mon May 14 21:46:06 2018 New Revision: 333613 URL: https://svnweb.freebsd.org/changeset/base/333613 Log: The broken DDR52 support of Intel Bay Trail eMMC controllers rumored in the commit log of r321385 has been confirmed via the public VLI54 erratum. Thus, stop advertising DDR52 for these controllers. Note that this change should hardly make a difference in practice as eMMC chips from the same era as these SoCs most likely support HS200 at least, probably even up to HS400ES. Modified: head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci_acpi.c == --- head/sys/dev/sdhci/sdhci_acpi.c Mon May 14 20:06:49 2018 (r333612) +++ head/sys/dev/sdhci/sdhci_acpi.c Mon May 14 21:46:06 2018 (r333613) @@ -60,7 +60,6 @@ static const struct sdhci_acpi_device { { "80860F14", 1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller", SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "80860F14", 3, "Intel Bay Trail/Braswell SDXC Controller", @@ -261,11 +260,16 @@ sdhci_acpi_attach(device_t dev) return (ENOMEM); } - /* Intel Braswell eMMC 4.5.1 controller quirk */ + /* +* Intel Bay Trail and Braswell eMMC controllers share the same IDs, +* but while with these former DDR52 is affected by the VLI54 erratum, +* these latter require the timeout clock to be hardcoded to 1 MHz. +*/ if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, >slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, >slot, SDHCI_CAPABILITIES2) == 0x0807) - sc->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | + SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; sc->quirks &= ~sdhci_quirk_clear; sc->quirks |= sdhci_quirk_set; sc->slot.quirks = sc->quirks; Modified: head/sys/dev/sdhci/sdhci_pci.c == --- head/sys/dev/sdhci/sdhci_pci.c Mon May 14 20:06:49 2018 (r333612) +++ head/sys/dev/sdhci/sdhci_pci.c Mon May 14 21:46:06 2018 (r333613) @@ -108,18 +108,18 @@ static const struct sdhci_device { { 0x16bc14e4, 0x, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, { 0x0f148086, 0x, "Intel Bay Trail eMMC 4.5 Controller", + /* DDR52 is supported but affected by the VLI54 erratum */ SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN}, { 0x0f158086, 0x, "Intel Bay Trail SDXC Controller", SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x0f508086, 0x, "Intel Bay Trail eMMC 4.5 Controller", + /* DDR52 is supported but affected by the VLI54 erratum */ SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x19db8086, 0x, "Intel Denverton eMMC 5.0 Controller", ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333612 - head/sys/net
Author: shurd Date: Mon May 14 20:06:49 2018 New Revision: 333612 URL: https://svnweb.freebsd.org/changeset/base/333612 Log: Replace rmlock with epoch in lagg Use the new epoch based reclamation API. Now the hot paths will not block at all, and the sx lock is used for the softc data. This fixes LORs reported where the rwlock was obtained when the sxlock was held. Submitted by: mmacy Reported by: Harry SchmalzbauerReviewed by: sbruno Sponsored by: Limelight Networks Differential Revision:https://reviews.freebsd.org/D15355 Modified: head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/if_lagg.c == --- head/sys/net/if_lagg.c Mon May 14 19:21:57 2018(r333611) +++ head/sys/net/if_lagg.c Mon May 14 20:06:49 2018(r333612) @@ -73,6 +73,18 @@ __FBSDID("$FreeBSD$"); #include #include +#defineLAGG_RLOCK()epoch_enter(net_epoch) +#defineLAGG_RUNLOCK() epoch_exit(net_epoch) +#defineLAGG_RLOCK_ASSERT() MPASS(in_epoch()) +#defineLAGG_UNLOCK_ASSERT()MPASS(!in_epoch()) + +#defineLAGG_SX_INIT(_sc) sx_init(&(_sc)->sc_sx, "if_lagg sx") +#defineLAGG_SX_DESTROY(_sc)sx_destroy(&(_sc)->sc_sx) +#defineLAGG_XLOCK(_sc) sx_xlock(&(_sc)->sc_sx) +#defineLAGG_XUNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) +#defineLAGG_SXLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_LOCKED) +#defineLAGG_XLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_XLOCKED) + /* Special flags we should propagate to the lagg ports. */ static struct { int flag; @@ -334,14 +346,11 @@ lagg_proto_detach(struct lagg_softc *sc) lagg_proto pr; LAGG_XLOCK_ASSERT(sc); - LAGG_WLOCK_ASSERT(sc); pr = sc->sc_proto; sc->sc_proto = LAGG_PROTO_NONE; if (lagg_protos[pr].pr_detach != NULL) lagg_protos[pr].pr_detach(sc); - else - LAGG_WUNLOCK(sc); } static int @@ -437,10 +446,10 @@ lagg_register_vlan(void *arg, struct ifnet *ifp, u_int if (ifp->if_softc != arg) /* Not our event */ return; - LAGG_SLOCK(sc); - SLIST_FOREACH(lp, >sc_ports, lp_entries) + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, >sc_ports, lp_entries) EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); } /* @@ -456,10 +465,10 @@ lagg_unregister_vlan(void *arg, struct ifnet *ifp, u_i if (ifp->if_softc != arg) /* Not our event */ return; - LAGG_SLOCK(sc); - SLIST_FOREACH(lp, >sc_ports, lp_entries) + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, >sc_ports, lp_entries) EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); } static int @@ -475,7 +484,6 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd free(sc, M_DEVBUF); return (ENOSPC); } - LAGG_LOCK_INIT(sc); LAGG_SX_INIT(sc); LAGG_XLOCK(sc); @@ -550,9 +558,7 @@ lagg_clone_destroy(struct ifnet *ifp) lagg_port_destroy(lp, 1); /* Unhook the aggregation protocol */ - LAGG_WLOCK(sc); lagg_proto_detach(sc); - LAGG_UNLOCK_ASSERT(sc); LAGG_XUNLOCK(sc); ifmedia_removeall(>sc_media); @@ -564,7 +570,6 @@ lagg_clone_destroy(struct ifnet *ifp) LAGG_LIST_UNLOCK(); LAGG_SX_DESTROY(sc); - LAGG_LOCK_DESTROY(sc); free(sc, M_DEVBUF); } @@ -580,7 +585,7 @@ lagg_capabilities(struct lagg_softc *sc) /* Get common enabled capabilities for the lagg ports */ ena = ~0; - SLIST_FOREACH(lp, >sc_ports, lp_entries) + CK_SLIST_FOREACH(lp, >sc_ports, lp_entries) ena &= lp->lp_ifp->if_capenable; ena = (ena == ~0 ? 0 : ena); @@ -590,7 +595,7 @@ lagg_capabilities(struct lagg_softc *sc) */ do { pena = ena; - SLIST_FOREACH(lp, >sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, >sc_ports, lp_entries) { lagg_setcaps(lp, ena); ena &= lp->lp_ifp->if_capenable; } @@ -600,7 +605,7 @@ lagg_capabilities(struct lagg_softc *sc) cap = ~0; hwa = ~(uint64_t)0; memset(_tsomax, 0, sizeof(hw_tsomax)); - SLIST_FOREACH(lp, >sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, >sc_ports, lp_entries) { cap &= lp->lp_ifp->if_capabilities; hwa &= lp->lp_ifp->if_hwassist; if_hw_tsomax_common(lp->lp_ifp, _tsomax); @@ -689,17 +694,14 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * bcopy(IF_LLADDR(ifp), lp->lp_lladdr, ETHER_ADDR_LEN); lp->lp_ifcapenable = ifp->if_capenable;
Re: svn commit: r332730 - in head/sys: amd64/amd64 i386/i386 powerpc/powerpc
On 05/05/2018 01:55, John Baldwin wrote: > On Wednesday, April 18, 2018 03:44:54 PM Andriy Gapon wrote: >> Author: avg >> Date: Wed Apr 18 15:44:54 2018 >> New Revision: 332730 >> URL: https://svnweb.freebsd.org/changeset/base/332730 >> >> Log: >> don't check for kdb reentry in trap_fatal(), it's impossible >> >> trap() checks for it earlier and calls kdb_reentry(). > > I just noticed today that there are several other kdb_trap() checks in > other architectures that need this fix and the KDB_WHY_TRAP change. Just > grep for debugger_on_panic under sys. For example: > > arm/arm/trap-v4.c: if (debugger_on_panic || kdb_active) > arm/arm/trap-v6.c: if (debugger_on_panic || kdb_active) > arm64/arm64/trap.c: if (debugger_on_panic || kdb_active) > mips/mips/trap.c: if (debugger_on_panic || kdb_active) { This list seems to be exhaustive. Please see https://reviews.freebsd.org/D15431 Thanks! -- Andriy Gapon ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333606 - head/sys/amd64/include
Author: jhb Date: Mon May 14 17:27:53 2018 New Revision: 333606 URL: https://svnweb.freebsd.org/changeset/base/333606 Log: Make the common interrupt entry point labels local labels. Kernel debuggers depend on symbol names to find stack frames with a trapframe rather than a normal stack frame. The labels used for the shared interrupt entry point for the PTI and non-PTI cases did not match the existing patterns confusing debuggers. Add the '.L' prefix to mark these symbols as local so they are not visible in the symbol table. Reviewed by: kib MFC after:1 week Sponsored by: Chelsio Communications Modified: head/sys/amd64/include/asmacros.h Modified: head/sys/amd64/include/asmacros.h == --- head/sys/amd64/include/asmacros.h Mon May 14 15:35:54 2018 (r333605) +++ head/sys/amd64/include/asmacros.h Mon May 14 17:27:53 2018 (r333606) @@ -223,9 +223,9 @@ X\name\()_pti: .type X\vec_name\()_pti,@function X\vec_name\()_pti: testb $SEL_RPL_MASK,PTI_CS-3*8(%rsp) /* err, %rax, %rdx not pushed */ - jz \vec_name\()_u + jz .L\vec_name\()_u PTI_UENTRY has_err=0 - jmp \vec_name\()_u + jmp .L\vec_name\()_u .endm .macro INTR_PUSH_FRAME vec_name @@ -234,9 +234,9 @@ X\vec_name\()_pti: .type X\vec_name,@function X\vec_name: testb $SEL_RPL_MASK,PTI_CS-3*8(%rsp) /* come from kernel? */ - jz \vec_name\()_u /* Yes, dont swapgs again */ + jz .L\vec_name\()_u/* Yes, dont swapgs again */ swapgs -\vec_name\()_u: +.L\vec_name\()_u: subq$TF_RIP,%rsp/* skip dummy tf_err and tf_trapno */ movq%rdi,TF_RDI(%rsp) movq%rsi,TF_RSI(%rsp) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333604 - head/sys/netinet
Author: tuexen Date: Mon May 14 15:16:51 2018 New Revision: 333604 URL: https://svnweb.freebsd.org/changeset/base/333604 Log: sctp_get_mbuf_for_msg() should honor the allinone parameter. When it is not required that the buffer is not a chain, return a chain. This is based on a patch provided by Irene Ruengeler. Modified: head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_bsd_addr.c == --- head/sys/netinet/sctp_bsd_addr.cMon May 14 13:50:17 2018 (r333603) +++ head/sys/netinet/sctp_bsd_addr.cMon May 14 15:16:51 2018 (r333604) @@ -387,10 +387,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int w m_freem(m); return (NULL); } - } - if (SCTP_BUF_NEXT(m)) { - sctp_m_freem(SCTP_BUF_NEXT(m)); - SCTP_BUF_NEXT(m) = NULL; + KASSERT(SCTP_BUF_NEXT(m) == NULL, ("%s: no chain allowed", __FUNCTION__)); } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Mon May 14 13:50:17 2018 (r333603) +++ head/sys/netinet/sctp_output.c Mon May 14 15:16:51 2018 (r333604) @@ -7450,7 +7450,7 @@ dont_do_it: /* Not enough room for a chunk header, get some */ struct mbuf *m; - m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 0, MT_DATA); + m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 1, MT_DATA); if (m == NULL) { /* * we're in trouble here. _PREPEND below will free ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333603 - head/sys/netinet
Author: tuexen Date: Mon May 14 13:50:17 2018 New Revision: 333603 URL: https://svnweb.freebsd.org/changeset/base/333603 Log: Ensure that the MTU's used are multiple of 4. The length of SCTP packets is always a multiple of 4. Therefore, ensure that the MTUs used are also a multiple of 4. Thanks to Irene Ruengeler for providing an earlier version of this patch. MFC after:1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c == --- head/sys/netinet/sctputil.c Mon May 14 07:20:34 2018(r333602) +++ head/sys/netinet/sctputil.c Mon May 14 13:50:17 2018(r333603) @@ -758,8 +758,8 @@ sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb) } /* - * a list of sizes based on typical mtu's, used only if next hop size not - * returned. + * A list of sizes based on typical mtu's, used only if next hop size not + * returned. These values MUST be multiples of 4 and MUST be ordered. */ static uint32_t sctp_mtu_sizes[] = { 68, @@ -768,29 +768,32 @@ static uint32_t sctp_mtu_sizes[] = { 512, 544, 576, - 1006, + 1004, 1492, 1500, 1536, - 2002, + 2000, 2048, 4352, 4464, 8166, - 17914, + 17912, 32000, - 65535 + 65532 }; /* - * Return the largest MTU smaller than val. If there is no - * entry, just return val. + * Return the largest MTU in sctp_mtu_sizes smaller than val. + * If val is smaller than the minimum, just return the largest + * multiple of 4 smaller or equal to val. + * Ensure that the result is a multiple of 4. */ uint32_t sctp_get_prev_mtu(uint32_t val) { uint32_t i; + val &= 0x0003; if (val <= sctp_mtu_sizes[0]) { return (val); } @@ -799,12 +802,16 @@ sctp_get_prev_mtu(uint32_t val) break; } } + KASSERT((sctp_mtu_sizes[i - 1] & 0x0003) == 0, + ("sctp_mtu_sizes[%u] not a multiple of 4", i - 1)); return (sctp_mtu_sizes[i - 1]); } /* - * Return the smallest MTU larger than val. If there is no - * entry, just return val. + * Return the smallest MTU in sctp_mtu_sizes larger than val. + * If val is larger than the maximum, just return the largest multiple of 4 smaller + * or equal to val. + * Ensure that the result is a multiple of 4. */ uint32_t sctp_get_next_mtu(uint32_t val) @@ -812,8 +819,11 @@ sctp_get_next_mtu(uint32_t val) /* select another MTU that is just bigger than this one */ uint32_t i; + val &= 0x0003; for (i = 0; i < (sizeof(sctp_mtu_sizes) / sizeof(uint32_t)); i++) { if (val < sctp_mtu_sizes[i]) { + KASSERT((sctp_mtu_sizes[i] & 0x0003) == 0, + ("sctp_mtu_sizes[%u] not a multiple of 4", i)); return (sctp_mtu_sizes[i]); } } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r333597 - head/sys/sys
On Mon, May 14, 2018 at 12:56:33AM +, Matt Macy wrote: > Author: mmacy > Date: Mon May 14 00:56:33 2018 > New Revision: 333597 > URL: https://svnweb.freebsd.org/changeset/base/333597 > > Log: > pmc: fix buildworld > > hid ck_queue.h from user > > Approved by:sbruno > > Modified: > head/sys/sys/pmc.h > > Modified: head/sys/sys/pmc.h > == > --- head/sys/sys/pmc.hMon May 14 00:21:04 2018(r333596) > +++ head/sys/sys/pmc.hMon May 14 00:56:33 2018(r333597) > @@ -40,8 +40,10 @@ > #include > #include > #include > +#ifdef _KERNEL > #include > #include Kernel must not use userspace headers. > +#endif > > #define PMC_MODULE_NAME "hwpmc" > #define PMC_NAME_MAX64 /* HW counter name size */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r333551 - in head/contrib/ldns: . compat drill ldns m4 packaging
On 2018-05-12 12:00:18 (+), Dag-Erling Smørgrav wrote: Author: des Date: Sat May 12 12:00:18 2018 New Revision: 333551 URL: https://svnweb.freebsd.org/changeset/base/333551 Log: Upgrade LDNS to 1.7.0. I've been holding back on this because 1.7.0 requires OpenSSL 1.1.0 or newer for full DANE support. But we can't wait forever, and nothing in base uses DANE anyway, so here we go. Thank you! This lets me get rid of a couple of annoying local patches. :) Philip -- Philip Paeps Senior Reality Engineer Ministry of Information ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333601 - head/sys/dev/hwpmc
Author: mmacy Date: Mon May 14 06:11:25 2018 New Revision: 333601 URL: https://svnweb.freebsd.org/changeset/base/333601 Log: hwpmc: don't reference domain index with no memory backing it On multi-socket the domain will be correctly set for a given CPU regardless of whether or not NUMA is enabled. Approved by: sbruno Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c == --- head/sys/dev/hwpmc/hwpmc_logging.c Mon May 14 05:21:18 2018 (r333600) +++ head/sys/dev/hwpmc/hwpmc_logging.c Mon May 14 06:11:25 2018 (r333601) @@ -63,8 +63,10 @@ __FBSDID("$FreeBSD$"); #ifdef NUMA #define NDOMAINS vm_ndomains +#define curdomain PCPU_GET(domain) #else #define NDOMAINS 1 +#define curdomain 0 #define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) #define free_domain(addr, type) free(addr, type) #endif @@ -259,7 +261,7 @@ pmclog_get_buffer(struct pmc_owner *po) KASSERT(po->po_curbuf[curcpu] == NULL, ("[pmclog,%d] po=%p current buffer still valid", __LINE__, po)); - domain = PCPU_GET(domain); + domain = curdomain; MPASS(pmc_dom_hdrs[domain]); mtx_lock_spin(_dom_hdrs[domain]->pdbh_mtx); if ((plb = TAILQ_FIRST(_dom_hdrs[domain]->pdbh_head)) != NULL) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"