From owner-svn-src-stable@freebsd.org Sun Jun 3 15:12:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBB69FE0360; Sun, 3 Jun 2018 15:12:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E3E16A650; Sun, 3 Jun 2018 15:12:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F29E204E2; Sun, 3 Jun 2018 15:12:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53FCfLP046396; Sun, 3 Jun 2018 15:12:41 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53FCetu046392; Sun, 3 Jun 2018 15:12:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806031512.w53FCetu046392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 3 Jun 2018 15:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334562 - in stable/11/sys/dev/cxgbe: . common X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 334562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 15:12:42 -0000 Author: np Date: Sun Jun 3 15:12:40 2018 New Revision: 334562 URL: https://svnweb.freebsd.org/changeset/base/334562 Log: MFC r333650, r333652, r333682, r334406, r334409-r334410, and r334489. r333650: cxgbe(4): Claim some more T5 and T6 boards. r333652: cxgbe(4): Add support for two more flash parts. r333682: cxgbe(4): Fall back to a failsafe configuration built into the firmware if an error is reported while pre-processing the configuration file that the driver attempted to use. Also, allow the user to explicitly use the built-in configuration with hw.cxgbe.config_file="built-in" r334406: cxgbe(4): Consider all supported speeds when building the ifmedia list for a port. Fix other related issues while here: - Require port lock for access to link_config. - Allow 100Mbps operation by tracking the speed in Mbps. Yes, really. - New port flag to indicate that the media list is immutable. It will be used in future refinements. This also fixes a bug where the driver reports incorrect media with recent firmwares. r334409: cxgbe(4): Implement ifm_change callback. r334410: cxgbe(4): Use ifm for ifmedia just like the rest of the kernel. No functional change. r334489: cxgbe(4): Include full duplex mediaopt in media that can be reported as active. Always report full duplex in active media. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sun Jun 3 14:32:38 2018 (r334561) +++ stable/11/sys/dev/cxgbe/adapter.h Sun Jun 3 15:12:40 2018 (r334562) @@ -162,6 +162,7 @@ enum { /* port flags */ HAS_TRACEQ = (1 << 3), + FIXED_IFMEDIA = (1 << 4), /* ifmedia list doesn't change. */ /* VI flags */ DOOMED = (1 << 0), Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Sun Jun 3 14:32:38 2018 (r334561) +++ stable/11/sys/dev/cxgbe/common/common.h Sun Jun 3 15:12:40 2018 (r334562) @@ -413,12 +413,12 @@ struct link_config { unsigned char requested_aneg; /* link aneg user has requested */ unsigned char requested_fc; /* flow control user has requested */ unsigned char requested_fec; /* FEC user has requested */ - unsigned int requested_speed; /* speed user has requested */ + unsigned int requested_speed; /* speed user has requested (Mbps) */ unsigned short supported; /* link capabilities */ unsigned short advertising; /* advertised capabilities */ unsigned short lp_advertising; /* peer advertised capabilities */ - unsigned int speed; /* actual link speed */ + unsigned int speed; /* actual link speed (Mbps) */ unsigned char fc; /* actual link flow control */ unsigned char fec; /* actual FEC */ unsigned char link_ok; /* link up? */ Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Sun Jun 3 14:32:38 2018 (r334561) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Sun Jun 3 15:12:40 2018 (r334562) @@ -3725,21 +3725,24 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m lc->requested_aneg == AUTONEG_DISABLE) { aneg = 0; switch (lc->requested_speed) { - case 100: + case 100000: speed = FW_PORT_CAP_SPEED_100G; break; - case 40: + case 40000: speed = FW_PORT_CAP_SPEED_40G; break; - case 25: + case 25000: speed = FW_PORT_CAP_SPEED_25G; break; - case 10: + case 10000: speed = FW_PORT_CAP_SPEED_10G; break; - case 1: + case 1000: speed = FW_PORT_CAP_SPEED_1G; break; + case 100: + speed = FW_PORT_CAP_SPEED_100M; + break; default: return -EINVAL; break; @@ -7713,9 +7716,9 @@ static void handle_port_info(struct port_info *pi, con fec = 0; if (lc->advertising & FW_PORT_CAP_FEC_RS) - fec |= FEC_RS; - if (lc->advertising & FW_PORT_CAP_FEC_BASER_RS) - fec |= FEC_BASER_RS; + fec = FEC_RS; + else if (lc->advertising & FW_PORT_CAP_FEC_BASER_RS) + fec = FEC_BASER_RS; lc->fec = fec; } @@ -7776,14 +7779,16 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be6 } lc = &pi->link_cfg; + PORT_LOCK(pi); old_lc = &pi->old_link_cfg; old_ptype = pi->port_type; old_mtype = pi->mod_type; - handle_port_info(pi, &p->u.info); + PORT_UNLOCK(pi); if (old_ptype != pi->port_type || old_mtype != pi->mod_type) { t4_os_portmod_changed(pi); } + PORT_LOCK(pi); if (old_lc->link_ok != lc->link_ok || old_lc->speed != lc->speed || old_lc->fec != lc->fec || @@ -7791,6 +7796,7 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be6 t4_os_link_changed(pi); *old_lc = *lc; } + PORT_UNLOCK(pi); } else { CH_WARN_RATELIMIT(adap, "Unknown firmware reply %d\n", opcode); return -EINVAL; @@ -7896,6 +7902,44 @@ int t4_get_flash_params(struct adapter *adapter) default: CH_ERR(adapter, "Micron Flash Part has bad size, " + "ID = %#x, Density code = %#x\n", + flashid, density); + return -EINVAL; + } + break; + } + + case 0x9d: { /* ISSI -- Integrated Silicon Solution, Inc. */ + /* + * This Density -> Size decoding table is taken from ISSI + * Data Sheets. + */ + density = (flashid >> 16) & 0xff; + switch (density) { + case 0x16: size = 1 << 25; break; /* 32MB */ + case 0x17: size = 1 << 26; break; /* 64MB */ + + default: + CH_ERR(adapter, "ISSI Flash Part has bad size, " + "ID = %#x, Density code = %#x\n", + flashid, density); + return -EINVAL; + } + break; + } + + case 0xc2: { /* Macronix */ + /* + * This Density -> Size decoding table is taken from Macronix + * Data Sheets. + */ + density = (flashid >> 16) & 0xff; + switch (density) { + case 0x17: size = 1 << 23; break; /* 8MB */ + case 0x18: size = 1 << 24; break; /* 16MB */ + + default: + CH_ERR(adapter, "Macronix Flash Part has bad size, " "ID = %#x, Density code = %#x\n", flashid, density); return -EINVAL; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Jun 3 14:32:38 2018 (r334561) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Jun 3 15:12:40 2018 (r334562) @@ -376,9 +376,10 @@ int t4_intr_types = INTR_MSIX | INTR_MSI | INTR_INTX; TUNABLE_INT("hw.cxgbe.interrupt_types", &t4_intr_types); /* - * Configuration file. + * Configuration file. All the _CF names here are special. */ #define DEFAULT_CF "default" +#define BUILTIN_CF "built-in" #define FLASH_CF "flash" #define UWIRE_CF "uwire" #define FPGA_CF "fpga" @@ -528,6 +529,7 @@ static int set_params__post_init(struct adapter *); static void t4_set_desc(struct adapter *); static void build_medialist(struct port_info *, struct ifmedia *); static void init_l1cfg(struct port_info *); +static int apply_l1cfg(struct port_info *); static int cxgbe_init_synchronized(struct vi_info *); static int cxgbe_uninit_synchronized(struct vi_info *); static void quiesce_txq(struct adapter *, struct sge_txq *); @@ -659,16 +661,10 @@ struct { {0x5412, "Chelsio T560-CR"}, /* 1 x 40G, 2 x 10G */ {0x5414, "Chelsio T580-LP-SO-CR"}, /* 2 x 40G, nomem */ {0x5415, "Chelsio T502-BT"}, /* 2 x 1G */ -#ifdef notyet - {0x5404, "Chelsio T520-BCH"}, - {0x5405, "Chelsio T540-BCH"}, - {0x5406, "Chelsio T540-CH"}, - {0x5408, "Chelsio T520-CX"}, - {0x540b, "Chelsio B520-SR"}, - {0x540c, "Chelsio B504-BT"}, - {0x540f, "Chelsio Amsterdam"}, - {0x5413, "Chelsio T580-CHR"}, -#endif + {0x5418, "Chelsio T540-BT"}, /* 4 x 10GBaseT */ + {0x5419, "Chelsio T540-LP-BT"}, /* 4 x 10GBaseT */ + {0x541a, "Chelsio T540-SO-BT"}, /* 4 x 10GBaseT, nomem */ + {0x541b, "Chelsio T540-SO-CR"}, /* 4 x 10G, nomem */ }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ {0x6400, "Chelsio T6-DBG-25"}, /* 2 x 10/25G, debug */ @@ -688,9 +684,14 @@ struct { {0x6415, "Chelsio T6201-BT"}, /* 2 x 1000BASE-T */ /* Custom */ - {0x6480, "Chelsio T6225 80"}, - {0x6481, "Chelsio T62100 81"}, - {0x6484, "Chelsio T62100 84"}, + {0x6480, "Custom T6225-CR"}, + {0x6481, "Custom T62100-CR"}, + {0x6482, "Custom T6225-CR"}, + {0x6483, "Custom T62100-CR"}, + {0x6484, "Custom T64100-CR"}, + {0x6485, "Custom T6240-SO"}, + {0x6486, "Custom T6225-SO-CR"}, + {0x6487, "Custom T6225-CR"}, }; #ifdef TCP_OFFLOAD @@ -2008,78 +2009,248 @@ cxgbe_get_counter(struct ifnet *ifp, ift_counter c) } } +/* + * The kernel picks a media from the list we had provided so we do not have to + * validate the request. + */ static int cxgbe_media_change(struct ifnet *ifp) { struct vi_info *vi = ifp->if_softc; + struct port_info *pi = vi->pi; + struct ifmedia *ifm = &pi->media; + struct link_config *lc = &pi->link_cfg; + struct adapter *sc = pi->adapter; + int rc; - device_printf(vi->dev, "%s unimplemented.\n", __func__); + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4mec"); + if (rc != 0) + return (rc); + PORT_LOCK(pi); + if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) { + MPASS(lc->supported & FW_PORT_CAP_ANEG); + lc->requested_aneg = AUTONEG_ENABLE; + } else { + lc->requested_aneg = AUTONEG_DISABLE; + lc->requested_speed = + ifmedia_baudrate(ifm->ifm_media) / 1000000; + lc->requested_fc = 0; + if (IFM_OPTIONS(ifm->ifm_media) & IFM_ETH_RXPAUSE) + lc->requested_fc |= PAUSE_RX; + if (IFM_OPTIONS(ifm->ifm_media) & IFM_ETH_TXPAUSE) + lc->requested_fc |= PAUSE_TX; + } + if (pi->up_vis > 0) + rc = apply_l1cfg(pi); + PORT_UNLOCK(pi); + end_synchronized_op(sc, 0); + return (rc); +} - return (EOPNOTSUPP); +/* + * Mbps to FW_PORT_CAP_SPEED_* bit. + */ +static uint16_t +speed_to_fwspeed(int speed) +{ + + switch (speed) { + case 100000: + return (FW_PORT_CAP_SPEED_100G); + case 40000: + return (FW_PORT_CAP_SPEED_40G); + case 25000: + return (FW_PORT_CAP_SPEED_25G); + case 10000: + return (FW_PORT_CAP_SPEED_10G); + case 1000: + return (FW_PORT_CAP_SPEED_1G); + case 100: + return (FW_PORT_CAP_SPEED_100M); + } + + return (0); } +/* + * Base media word (without ETHER, pause, link active, etc.) for the port at the + * given speed. + */ +static int +port_mword(struct port_info *pi, uint16_t speed) +{ + + MPASS(speed & M_FW_PORT_CAP_SPEED); + MPASS(powerof2(speed)); + + switch(pi->port_type) { + case FW_PORT_TYPE_BT_SGMII: + case FW_PORT_TYPE_BT_XFI: + case FW_PORT_TYPE_BT_XAUI: + /* BaseT */ + switch (speed) { + case FW_PORT_CAP_SPEED_100M: + return (IFM_100_T); + case FW_PORT_CAP_SPEED_1G: + return (IFM_1000_T); + case FW_PORT_CAP_SPEED_10G: + return (IFM_10G_T); + } + break; + case FW_PORT_TYPE_KX4: + if (speed == FW_PORT_CAP_SPEED_10G) + return (IFM_10G_KX4); + break; + case FW_PORT_TYPE_CX4: + if (speed == FW_PORT_CAP_SPEED_10G) + return (IFM_10G_CX4); + break; + case FW_PORT_TYPE_KX: + if (speed == FW_PORT_CAP_SPEED_1G) + return (IFM_1000_KX); + break; + case FW_PORT_TYPE_KR: + case FW_PORT_TYPE_BP_AP: + case FW_PORT_TYPE_BP4_AP: + case FW_PORT_TYPE_BP40_BA: + case FW_PORT_TYPE_KR4_100G: + case FW_PORT_TYPE_KR_SFP28: + case FW_PORT_TYPE_KR_XLAUI: + switch (speed) { + case FW_PORT_CAP_SPEED_1G: + return (IFM_1000_KX); + case FW_PORT_CAP_SPEED_10G: + return (IFM_10G_KR); + case FW_PORT_CAP_SPEED_25G: + return (IFM_25G_KR); + case FW_PORT_CAP_SPEED_40G: + return (IFM_40G_KR4); + case FW_PORT_CAP_SPEED_100G: + return (IFM_100G_KR4); + } + break; + case FW_PORT_TYPE_FIBER_XFI: + case FW_PORT_TYPE_FIBER_XAUI: + case FW_PORT_TYPE_SFP: + case FW_PORT_TYPE_QSFP_10G: + case FW_PORT_TYPE_QSA: + case FW_PORT_TYPE_QSFP: + case FW_PORT_TYPE_CR4_QSFP: + case FW_PORT_TYPE_CR_QSFP: + case FW_PORT_TYPE_CR2_QSFP: + case FW_PORT_TYPE_SFP28: + /* Pluggable transceiver */ + switch (pi->mod_type) { + case FW_PORT_MOD_TYPE_LR: + switch (speed) { + case FW_PORT_CAP_SPEED_1G: + return (IFM_1000_LX); + case FW_PORT_CAP_SPEED_10G: + return (IFM_10G_LR); + case FW_PORT_CAP_SPEED_25G: + return (IFM_25G_LR); + case FW_PORT_CAP_SPEED_40G: + return (IFM_40G_LR4); + case FW_PORT_CAP_SPEED_100G: + return (IFM_100G_LR4); + } + break; + case FW_PORT_MOD_TYPE_SR: + switch (speed) { + case FW_PORT_CAP_SPEED_1G: + return (IFM_1000_SX); + case FW_PORT_CAP_SPEED_10G: + return (IFM_10G_SR); + case FW_PORT_CAP_SPEED_25G: + return (IFM_25G_SR); + case FW_PORT_CAP_SPEED_40G: + return (IFM_40G_SR4); + case FW_PORT_CAP_SPEED_100G: + return (IFM_100G_SR4); + } + break; + case FW_PORT_MOD_TYPE_ER: + if (speed == FW_PORT_CAP_SPEED_10G) + return (IFM_10G_ER); + break; + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + switch (speed) { + case FW_PORT_CAP_SPEED_1G: + return (IFM_1000_CX); + case FW_PORT_CAP_SPEED_10G: + return (IFM_10G_TWINAX); + case FW_PORT_CAP_SPEED_25G: + return (IFM_25G_CR); + case FW_PORT_CAP_SPEED_40G: + return (IFM_40G_CR4); + case FW_PORT_CAP_SPEED_100G: + return (IFM_100G_CR4); + } + break; + case FW_PORT_MOD_TYPE_LRM: + if (speed == FW_PORT_CAP_SPEED_10G) + return (IFM_10G_LRM); + break; + case FW_PORT_MOD_TYPE_NA: + MPASS(0); /* Not pluggable? */ + /* fall throough */ + case FW_PORT_MOD_TYPE_ERROR: + case FW_PORT_MOD_TYPE_UNKNOWN: + case FW_PORT_MOD_TYPE_NOTSUPPORTED: + break; + case FW_PORT_MOD_TYPE_NONE: + return (IFM_NONE); + } + break; + case FW_PORT_TYPE_NONE: + return (IFM_NONE); + } + + return (IFM_UNKNOWN); +} + static void cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) { struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; - struct ifmedia_entry *cur; + struct adapter *sc = pi->adapter; struct link_config *lc = &pi->link_cfg; - /* - * If all the interfaces are administratively down the firmware does not - * report transceiver changes. Refresh port info here so that ifconfig - * displays accurate information at all times. - */ - if (begin_synchronized_op(pi->adapter, NULL, SLEEP_OK | INTR_OK, - "t4med") == 0) { - PORT_LOCK(pi); - if (pi->up_vis == 0) { - t4_update_port_info(pi); - build_medialist(pi, &pi->media); - } - PORT_UNLOCK(pi); - end_synchronized_op(pi->adapter, 0); + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4med") != 0) + return; + PORT_LOCK(pi); + + if (pi->up_vis == 0) { + /* + * If all the interfaces are administratively down the firmware + * does not report transceiver changes. Refresh port info here + * so that ifconfig displays accurate ifmedia at all times. + * This is the only reason we have a synchronized op in this + * function. Just PORT_LOCK would have been enough otherwise. + */ + t4_update_port_info(pi); + build_medialist(pi, &pi->media); } + /* ifm_status */ ifmr->ifm_status = IFM_AVALID; if (lc->link_ok == 0) - return; - + goto done; ifmr->ifm_status |= IFM_ACTIVE; - ifmr->ifm_active &= ~(IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE); - if (lc->fc & PAUSE_RX) - ifmr->ifm_active |= IFM_ETH_RXPAUSE; - if (lc->fc & PAUSE_TX) - ifmr->ifm_active |= IFM_ETH_TXPAUSE; - /* active and current will differ iff current media is autoselect. */ - cur = pi->media.ifm_cur; - if (cur != NULL && IFM_SUBTYPE(cur->ifm_media) != IFM_AUTO) - return; - + /* ifm_active */ ifmr->ifm_active = IFM_ETHER | IFM_FDX; + ifmr->ifm_active &= ~(IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE); if (lc->fc & PAUSE_RX) ifmr->ifm_active |= IFM_ETH_RXPAUSE; if (lc->fc & PAUSE_TX) ifmr->ifm_active |= IFM_ETH_TXPAUSE; - switch (lc->speed) { - case 10000: - ifmr->ifm_active |= IFM_10G_T; - break; - case 1000: - ifmr->ifm_active |= IFM_1000_T; - break; - case 100: - ifmr->ifm_active |= IFM_100_TX; - break; - case 10: - ifmr->ifm_active |= IFM_10_T; - break; - default: - device_printf(vi->dev, "link up but speed unknown (%u)\n", - lc->speed); - } + ifmr->ifm_active |= port_mword(pi, speed_to_fwspeed(lc->speed)); +done: + PORT_UNLOCK(pi); + end_synchronized_op(sc, 0); } static int @@ -3247,7 +3418,8 @@ partition_resources(struct adapter *sc, const struct f snprintf(sc->cfg_file, sizeof(sc->cfg_file), UWIRE_CF); if (is_fpga(sc)) snprintf(sc->cfg_file, sizeof(sc->cfg_file), FPGA_CF); - } + } else if (strncmp(t4_cfg_file, BUILTIN_CF, sizeof(t4_cfg_file)) == 0) + goto use_built_in_config; /* go straight to config. */ /* * We need to load another module if the profile is anything except @@ -3358,8 +3530,31 @@ use_config_on_flash: if (rc != 0) { device_printf(sc->dev, "failed to pre-process config file: %d " - "(mtype %d, moff 0x%x).\n", rc, mtype, moff); - goto done; + "(mtype %d, moff 0x%x). Will reset the firmware and retry " + "with the built-in configuration.\n", rc, mtype, moff); + + rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST); + if (rc != 0) { + device_printf(sc->dev, + "firmware reset failed: %d.\n", rc); + if (rc != ETIMEDOUT && rc != EIO) { + t4_fw_bye(sc, sc->mbox); + sc->flags &= ~FW_OK; + } + goto done; + } + snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", "built-in"); +use_built_in_config: + bzero(&caps, sizeof(caps)); + caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ); + caps.cfvalid_to_len16 = htobe32(FW_LEN16(caps)); + rc = t4_wr_mbox(sc, sc->mbox, &caps, sizeof(caps), &caps); + if (rc != 0) { + device_printf(sc->dev, + "built-in configuration failed: %d.\n", rc); + goto done; + } } finicsum = be32toh(caps.finicsum); @@ -3759,214 +3954,114 @@ t4_set_desc(struct adapter *sc) device_set_desc_copy(sc->dev, buf); } +static inline void +ifmedia_add4(struct ifmedia *ifm, int m) +{ + + ifmedia_add(ifm, m, 0, NULL); + ifmedia_add(ifm, m | IFM_ETH_TXPAUSE, 0, NULL); + ifmedia_add(ifm, m | IFM_ETH_RXPAUSE, 0, NULL); + ifmedia_add(ifm, m | IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE, 0, NULL); +} + static void -build_medialist(struct port_info *pi, struct ifmedia *media) +set_current_media(struct port_info *pi, struct ifmedia *ifm) { - int m; + struct link_config *lc; + int mword; PORT_LOCK_ASSERT_OWNED(pi); - ifmedia_removeall(media); + /* Leave current media alone if it's already set to IFM_NONE. */ + if (ifm->ifm_cur != NULL && + IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_NONE) + return; - /* - * XXX: Would it be better to ifmedia_add all 4 combinations of pause - * settings for every speed instead of just txpause|rxpause? ifconfig - * media display looks much better if autoselect is the only case where - * ifm_current is different from ifm_active. If the user picks anything - * except txpause|rxpause the display is ugly. - */ - m = IFM_ETHER | IFM_FDX | IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE; + lc = &pi->link_cfg; + if (lc->requested_aneg == AUTONEG_ENABLE && + lc->supported & FW_PORT_CAP_ANEG) { + ifmedia_set(ifm, IFM_ETHER | IFM_AUTO); + return; + } + mword = IFM_ETHER | IFM_FDX; + if (lc->requested_fc & PAUSE_TX) + mword |= IFM_ETH_TXPAUSE; + if (lc->requested_fc & PAUSE_RX) + mword |= IFM_ETH_RXPAUSE; + mword |= port_mword(pi, speed_to_fwspeed(lc->requested_speed)); + ifmedia_set(ifm, mword); +} - switch(pi->port_type) { - case FW_PORT_TYPE_BT_XFI: - case FW_PORT_TYPE_BT_XAUI: - ifmedia_add(media, m | IFM_10G_T, 0, NULL); - /* fall through */ +static void +build_medialist(struct port_info *pi, struct ifmedia *ifm) +{ + uint16_t ss, speed; + int unknown, mword, bit; + struct link_config *lc; - case FW_PORT_TYPE_BT_SGMII: - ifmedia_add(media, m | IFM_1000_T, 0, NULL); - ifmedia_add(media, m | IFM_100_TX, 0, NULL); - ifmedia_add(media, IFM_ETHER | IFM_AUTO, 0, NULL); - ifmedia_set(media, IFM_ETHER | IFM_AUTO); - break; + PORT_LOCK_ASSERT_OWNED(pi); - case FW_PORT_TYPE_CX4: - ifmedia_add(media, m | IFM_10G_CX4, 0, NULL); - ifmedia_set(media, m | IFM_10G_CX4); - break; + if (pi->flags & FIXED_IFMEDIA) + return; - case FW_PORT_TYPE_QSFP_10G: - case FW_PORT_TYPE_SFP: - case FW_PORT_TYPE_FIBER_XFI: - case FW_PORT_TYPE_FIBER_XAUI: - switch (pi->mod_type) { + /* + * First setup all the requested_ fields so that they comply with what's + * supported by the port + transceiver. Note that this clobbers any + * user preferences set via sysctl_pause_settings or sysctl_autoneg. + */ + init_l1cfg(pi); - case FW_PORT_MOD_TYPE_LR: - ifmedia_add(media, m | IFM_10G_LR, 0, NULL); - ifmedia_set(media, m | IFM_10G_LR); - break; + /* + * Now (re)build the ifmedia list. + */ + ifmedia_removeall(ifm); + lc = &pi->link_cfg; + ss = G_FW_PORT_CAP_SPEED(lc->supported); /* Supported Speeds */ + if (__predict_false(ss == 0)) { /* not supposed to happen. */ + MPASS(ss != 0); +no_media: + MPASS(LIST_EMPTY(&ifm->ifm_list)); + ifmedia_add(ifm, IFM_ETHER | IFM_NONE, 0, NULL); + ifmedia_set(ifm, IFM_ETHER | IFM_NONE); + return; + } - case FW_PORT_MOD_TYPE_SR: - ifmedia_add(media, m | IFM_10G_SR, 0, NULL); - ifmedia_set(media, m | IFM_10G_SR); - break; - - case FW_PORT_MOD_TYPE_LRM: - ifmedia_add(media, m | IFM_10G_LRM, 0, NULL); - ifmedia_set(media, m | IFM_10G_LRM); - break; - - case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: - case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: - ifmedia_add(media, m | IFM_10G_TWINAX, 0, NULL); - ifmedia_set(media, m | IFM_10G_TWINAX); - break; - - case FW_PORT_MOD_TYPE_NONE: - m &= ~IFM_FDX; - ifmedia_add(media, m | IFM_NONE, 0, NULL); - ifmedia_set(media, m | IFM_NONE); - break; - - case FW_PORT_MOD_TYPE_NA: - case FW_PORT_MOD_TYPE_ER: - default: - device_printf(pi->dev, - "unknown port_type (%d), mod_type (%d)\n", - pi->port_type, pi->mod_type); - ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); - ifmedia_set(media, m | IFM_UNKNOWN); - break; + unknown = 0; + for (bit = 0; bit < fls(ss); bit++) { + speed = 1 << bit; + MPASS(speed & M_FW_PORT_CAP_SPEED); + if (ss & speed) { + mword = port_mword(pi, speed); + if (mword == IFM_NONE) { + goto no_media; + } else if (mword == IFM_UNKNOWN) + unknown++; + else + ifmedia_add4(ifm, IFM_ETHER | IFM_FDX | mword); } - break; - - case FW_PORT_TYPE_CR_QSFP: - case FW_PORT_TYPE_SFP28: - case FW_PORT_TYPE_KR_SFP28: - switch (pi->mod_type) { - - case FW_PORT_MOD_TYPE_SR: - ifmedia_add(media, m | IFM_25G_SR, 0, NULL); - ifmedia_set(media, m | IFM_25G_SR); - break; - - case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: - case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: - ifmedia_add(media, m | IFM_25G_CR, 0, NULL); - ifmedia_set(media, m | IFM_25G_CR); - break; - - case FW_PORT_MOD_TYPE_NONE: - m &= ~IFM_FDX; - ifmedia_add(media, m | IFM_NONE, 0, NULL); - ifmedia_set(media, m | IFM_NONE); - break; - - default: - device_printf(pi->dev, - "unknown port_type (%d), mod_type (%d)\n", - pi->port_type, pi->mod_type); - ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); - ifmedia_set(media, m | IFM_UNKNOWN); - break; - } - break; - - case FW_PORT_TYPE_QSFP: - switch (pi->mod_type) { - - case FW_PORT_MOD_TYPE_LR: - ifmedia_add(media, m | IFM_40G_LR4, 0, NULL); - ifmedia_set(media, m | IFM_40G_LR4); - break; - - case FW_PORT_MOD_TYPE_SR: - ifmedia_add(media, m | IFM_40G_SR4, 0, NULL); - ifmedia_set(media, m | IFM_40G_SR4); - break; - - case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: - case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: - ifmedia_add(media, m | IFM_40G_CR4, 0, NULL); - ifmedia_set(media, m | IFM_40G_CR4); - break; - - case FW_PORT_MOD_TYPE_NONE: - m &= ~IFM_FDX; - ifmedia_add(media, m | IFM_NONE, 0, NULL); - ifmedia_set(media, m | IFM_NONE); - break; - - default: - device_printf(pi->dev, - "unknown port_type (%d), mod_type (%d)\n", - pi->port_type, pi->mod_type); - ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); - ifmedia_set(media, m | IFM_UNKNOWN); - break; - } - break; - - case FW_PORT_TYPE_KR4_100G: - case FW_PORT_TYPE_CR4_QSFP: - switch (pi->mod_type) { - - case FW_PORT_MOD_TYPE_LR: - ifmedia_add(media, m | IFM_100G_LR4, 0, NULL); - ifmedia_set(media, m | IFM_100G_LR4); - break; - - case FW_PORT_MOD_TYPE_SR: - ifmedia_add(media, m | IFM_100G_SR4, 0, NULL); - ifmedia_set(media, m | IFM_100G_SR4); - break; - - case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: - case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: - ifmedia_add(media, m | IFM_100G_CR4, 0, NULL); - ifmedia_set(media, m | IFM_100G_CR4); - break; - - case FW_PORT_MOD_TYPE_NONE: - m &= ~IFM_FDX; - ifmedia_add(media, m | IFM_NONE, 0, NULL); - ifmedia_set(media, m | IFM_NONE); - break; - - default: - device_printf(pi->dev, - "unknown port_type (%d), mod_type (%d)\n", - pi->port_type, pi->mod_type); - ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); - ifmedia_set(media, m | IFM_UNKNOWN); - break; - } - break; - - default: - device_printf(pi->dev, - "unknown port_type (%d), mod_type (%d)\n", pi->port_type, - pi->mod_type); - ifmedia_add(media, m | IFM_UNKNOWN, 0, NULL); - ifmedia_set(media, m | IFM_UNKNOWN); - break; } + if (unknown > 0) /* Add one unknown for all unknown media types. */ + ifmedia_add4(ifm, IFM_ETHER | IFM_FDX | IFM_UNKNOWN); + if (lc->supported & FW_PORT_CAP_ANEG) + ifmedia_add(ifm, IFM_ETHER | IFM_AUTO, 0, NULL); + + set_current_media(pi, ifm); } /* - * Update all the requested_* fields in the link config and then send a mailbox - * command to apply the settings. + * Update all the requested_* fields in the link config to something valid (and + * reasonable). */ static void init_l1cfg(struct port_info *pi) { - struct adapter *sc = pi->adapter; struct link_config *lc = &pi->link_cfg; - int rc; - ASSERT_SYNCHRONIZED_OP(sc); + PORT_LOCK_ASSERT_OWNED(pi); - lc->requested_speed = port_top_speed(pi); /* in Gbps */ + /* Gbps -> Mbps */ + lc->requested_speed = port_top_speed(pi) * 1000; + if (t4_autoneg != 0 && lc->supported & FW_PORT_CAP_ANEG) { lc->requested_aneg = AUTONEG_ENABLE; } else { @@ -3976,18 +4071,58 @@ init_l1cfg(struct port_info *pi) lc->requested_fc = t4_pause_settings & (PAUSE_TX | PAUSE_RX); if (t4_fec != -1) { - lc->requested_fec = t4_fec & (FEC_RS | FEC_BASER_RS | - FEC_RESERVED); + if (t4_fec & FEC_RS && lc->supported & FW_PORT_CAP_FEC_RS) { + lc->requested_fec = FEC_RS; + } else if (t4_fec & FEC_BASER_RS && + lc->supported & FW_PORT_CAP_FEC_BASER_RS) { + lc->requested_fec = FEC_BASER_RS; + } else { + lc->requested_fec = 0; + } } else { /* Use the suggested value provided by the firmware in acaps */ - if (lc->advertising & FW_PORT_CAP_FEC_RS) + if (lc->advertising & FW_PORT_CAP_FEC_RS && + lc->supported & FW_PORT_CAP_FEC_RS) { lc->requested_fec = FEC_RS; - else if (lc->advertising & FW_PORT_CAP_FEC_BASER_RS) + } else if (lc->advertising & FW_PORT_CAP_FEC_BASER_RS && + lc->supported & FW_PORT_CAP_FEC_BASER_RS) { lc->requested_fec = FEC_BASER_RS; - else + } else { lc->requested_fec = 0; + } } +} +/* + * Apply the settings in requested_* to the hardware. The parameters are + * expected to be sane. + */ +static int +apply_l1cfg(struct port_info *pi) +{ + struct adapter *sc = pi->adapter; + struct link_config *lc = &pi->link_cfg; + int rc; +#ifdef INVARIANTS + uint16_t fwspeed; + + ASSERT_SYNCHRONIZED_OP(sc); + PORT_LOCK_ASSERT_OWNED(pi); + + if (lc->requested_aneg == AUTONEG_ENABLE) + MPASS(lc->supported & FW_PORT_CAP_ANEG); + if (lc->requested_fc & PAUSE_TX) + MPASS(lc->supported & FW_PORT_CAP_FC_TX); + if (lc->requested_fc & PAUSE_RX) + MPASS(lc->supported & FW_PORT_CAP_FC_RX); + if (lc->requested_fec == FEC_RS) + MPASS(lc->supported & FW_PORT_CAP_FEC_RS); + if (lc->requested_fec == FEC_BASER_RS) + MPASS(lc->supported & FW_PORT_CAP_FEC_BASER_RS); + fwspeed = speed_to_fwspeed(lc->requested_speed); + MPASS(fwspeed != 0); + MPASS(lc->supported & fwspeed); +#endif rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); if (rc != 0) { device_printf(pi->dev, "l1cfg failed: %d\n", rc); @@ -3995,6 +4130,7 @@ init_l1cfg(struct port_info *pi) lc->fc = lc->requested_fc; lc->fec = lc->requested_fec; } + return (rc); } #define FW_MAC_EXACT_CHUNK 7 @@ -4279,7 +4415,7 @@ cxgbe_init_synchronized(struct vi_info *vi) if (pi->up_vis++ == 0) { t4_update_port_info(pi); build_medialist(pi, &pi->media); - init_l1cfg(pi); + apply_l1cfg(pi); } ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -4354,13 +4490,13 @@ cxgbe_uninit_synchronized(struct vi_info *vi) PORT_UNLOCK(pi); return (0); } - PORT_UNLOCK(pi); pi->link_cfg.link_ok = 0; pi->link_cfg.speed = 0; pi->link_cfg.link_down_rc = 255; t4_os_link_changed(pi); pi->old_link_cfg = pi->link_cfg; + PORT_UNLOCK(pi); return (0); } @@ -6083,14 +6219,17 @@ sysctl_pause_settings(SYSCTL_HANDLER_ARGS) "t4PAUSE"); if (rc) return (rc); + PORT_LOCK(pi); if ((lc->requested_fc & (PAUSE_TX | PAUSE_RX)) != n) { lc->requested_fc &= ~(PAUSE_TX | PAUSE_RX); lc->requested_fc |= n; rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); if (rc == 0) { lc->fc = lc->requested_fc; + set_current_media(pi, &pi->media); } } + PORT_UNLOCK(pi); end_synchronized_op(sc, 0); } @@ -6138,11 +6277,14 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) n = s[0] - '0'; if (n & ~M_FW_PORT_CAP_FEC) return (EINVAL); /* some other bit is set too */ + if (!powerof2(n)) + return (EINVAL); /* one bit can be set at most */ rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4fec"); if (rc) return (rc); + PORT_LOCK(pi); if ((lc->requested_fec & M_FW_PORT_CAP_FEC) != n) { lc->requested_fec = n & G_FW_PORT_CAP_FEC(lc->supported); @@ -6151,6 +6293,7 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) lc->fec = lc->requested_fec; } } + PORT_UNLOCK(pi); end_synchronized_op(sc, 0); } @@ -6172,27 +6315,35 @@ sysctl_autoneg(SYSCTL_HANDLER_ARGS) rc = sysctl_handle_int(oidp, &val, 0, req); if (rc != 0 || req->newptr == NULL) return (rc); - if ((lc->supported & FW_PORT_CAP_ANEG) == 0) - return (ENOTSUP); - if (val == 0) val = AUTONEG_DISABLE; else if (val == 1) val = AUTONEG_ENABLE; else return (EINVAL); - if (lc->requested_aneg == val) - return (0); /* no change */ rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4aneg"); if (rc) return (rc); + PORT_LOCK(pi); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Jun 3 17:17:47 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D997FE176E; Sun, 3 Jun 2018 17:17:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE6506FF34; Sun, 3 Jun 2018 17:17:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF7E021848; Sun, 3 Jun 2018 17:17:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w53HHkX0006630; Sun, 3 Jun 2018 17:17:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w53HHjob006624; Sun, 3 Jun 2018 17:17:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806031717.w53HHjob006624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 3 Jun 2018 17:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334572 - in stable/11/stand: . common i386/gptboot i386/gptzfsboot i386/isoboot i386/zfsboot X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11/stand: . common i386/gptboot i386/gptzfsboot i386/isoboot i386/zfsboot X-SVN-Commit-Revision: 334572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 17:17:47 -0000 Author: dim Date: Sun Jun 3 17:17:45 2018 New Revision: 334572 URL: https://svnweb.freebsd.org/changeset/base/334572 Log: MFC r334432: Fix build of stand with base gcc * Make autoboot() a static function in stand/common/boot.c, so it does not shadow local variables in gptboot.c and zfsboot.c. * Remove -Winline from the Makefiles for gptboot, gptzfsboot and zfsboot, as gcc will always fail to inline some functions, and there is nothing we can do about it. * For gcc <= 4.2.1, silence -Wuninitialized for isoboot, as it produces a false positive warning. * Remove deprecated and unnecessary -mcpu=i386 flag from stand/defs.mk, as there is already a -march=i386 flag further in the file. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15628 Modified: stable/11/stand/common/boot.c stable/11/stand/common/bootstrap.h stable/11/stand/defs.mk stable/11/stand/i386/gptboot/Makefile stable/11/stand/i386/gptzfsboot/Makefile stable/11/stand/i386/isoboot/Makefile stable/11/stand/i386/zfsboot/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/boot.c ============================================================================== --- stable/11/stand/common/boot.c Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/common/boot.c Sun Jun 3 17:17:45 2018 (r334572) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" +static int autoboot(int timeout, char *prompt); static char *getbootfile(int try); static int loadakernel(int try, int argc, char* argv[]); @@ -157,7 +158,7 @@ autoboot_maybe() autoboot(-1, NULL); /* try to boot automatically */ } -int +static int autoboot(int timeout, char *prompt) { time_t when, otime, ntime; Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/common/bootstrap.h Sun Jun 3 17:17:45 2018 (r334572) @@ -61,7 +61,6 @@ char *backslash(const char *str); int parse(int *argc, char ***argv, const char *str); /* boot.c */ -int autoboot(int timeout, char *prompt); void autoboot_maybe(void); int getrootmount(char *rootdev); Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/defs.mk Sun Jun 3 17:17:45 2018 (r334572) @@ -89,7 +89,7 @@ CFLAGS+= -m32 -mcpu=powerpc # build 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here # and activate it when DO32 is explicitly defined to be 1. .if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 -CFLAGS+= -m32 -mcpu=i386 +CFLAGS+= -m32 # LD_FLAGS is passed directly to ${LD}, not via ${CC}: LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 Modified: stable/11/stand/i386/gptboot/Makefile ============================================================================== --- stable/11/stand/i386/gptboot/Makefile Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/i386/gptboot/Makefile Sun Jun 3 17:17:45 2018 (r334572) @@ -37,7 +37,7 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline -Wno-pointer-sign + -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 Modified: stable/11/stand/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/stand/i386/gptzfsboot/Makefile Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/i386/gptzfsboot/Makefile Sun Jun 3 17:17:45 2018 (r334572) @@ -37,7 +37,7 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -Wall -Waggregate-return -Wbad-function-cast \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline -Wno-pointer-sign + -Wno-pointer-sign CFLAGS.clang+= -Wno-tentative-definition-incomplete-type Modified: stable/11/stand/i386/isoboot/Makefile ============================================================================== --- stable/11/stand/i386/isoboot/Makefile Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/i386/isoboot/Makefile Sun Jun 3 17:17:45 2018 (r334572) @@ -36,6 +36,9 @@ CFLAGS+=-DBOOTPROG=\"isoboot\" \ -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 +CFLAGS.gcc+= -Wno-uninitialized +.endif CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} Modified: stable/11/stand/i386/zfsboot/Makefile ============================================================================== --- stable/11/stand/i386/zfsboot/Makefile Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/i386/zfsboot/Makefile Sun Jun 3 17:17:45 2018 (r334572) @@ -34,8 +34,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings CFLAGS.gcc+= --param max-inline-insns-single=100 .if ${MACHINE} == "amd64" From owner-svn-src-stable@freebsd.org Mon Jun 4 05:23:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFB1BFF2CEC; Mon, 4 Jun 2018 05:23:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B3E2727CA; Mon, 4 Jun 2018 05:23:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C68EF48; Mon, 4 Jun 2018 05:23:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w545N7tV075246; Mon, 4 Jun 2018 05:23:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w545N7vW075245; Mon, 4 Jun 2018 05:23:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201806040523.w545N7vW075245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 4 Jun 2018 05:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334603 - stable/11/usr.sbin/camdd X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.sbin/camdd X-SVN-Commit-Revision: 334603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:23:08 -0000 Author: delphij Date: Mon Jun 4 05:23:06 2018 New Revision: 334603 URL: https://svnweb.freebsd.org/changeset/base/334603 Log: MFC r332905: Use calloc() instead of malloc+bzero. Reviewed by: ken, emaste Modified: stable/11/usr.sbin/camdd/camdd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/camdd/camdd.c ============================================================================== --- stable/11/usr.sbin/camdd/camdd.c Mon Jun 4 05:04:40 2018 (r334602) +++ stable/11/usr.sbin/camdd/camdd.c Mon Jun 4 05:23:06 2018 (r334603) @@ -591,14 +591,12 @@ camdd_alloc_dev(camdd_dev_type dev_type, struct kevent size_t ke_size; int retval = 0; - dev = malloc(sizeof(*dev)); + dev = calloc(1, sizeof(*dev)); if (dev == NULL) { warn("%s: unable to malloc %zu bytes", __func__, sizeof(*dev)); goto bailout; } - bzero(dev, sizeof(*dev)); - dev->dev_type = dev_type; dev->io_timeout = timeout; dev->retry_count = retry_count; @@ -631,12 +629,11 @@ camdd_alloc_dev(camdd_dev_type dev_type, struct kevent } ke_size = sizeof(struct kevent) * (num_ke + 4); - ke = malloc(ke_size); + ke = calloc(1, ke_size); if (ke == NULL) { warn("%s: unable to malloc %zu bytes", __func__, ke_size); goto bailout; } - bzero(ke, ke_size); if (num_ke > 0) bcopy(new_ke, ke, num_ke * sizeof(struct kevent)); @@ -683,13 +680,12 @@ camdd_alloc_buf(struct camdd_dev *dev, camdd_buf_type break; } - buf = malloc(sizeof(*buf)); + buf = calloc(1, sizeof(*buf)); if (buf == NULL) { warn("unable to allocate %zu bytes", sizeof(*buf)); goto bailout_error; } - bzero(buf, sizeof(*buf)); buf->buf_type = buf_type; buf->dev = dev; switch (buf_type) { From owner-svn-src-stable@freebsd.org Mon Jun 4 05:38:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33599FF479B; Mon, 4 Jun 2018 05:38:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D58C573326; Mon, 4 Jun 2018 05:38:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B51B410E0; Mon, 4 Jun 2018 05:38:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w545cMsB080468; Mon, 4 Jun 2018 05:38:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w545cM3O080467; Mon, 4 Jun 2018 05:38:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201806040538.w545cM3O080467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 4 Jun 2018 05:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334605 - stable/11/sbin/fsck_msdosfs X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/fsck_msdosfs X-SVN-Commit-Revision: 334605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:38:23 -0000 Author: delphij Date: Mon Jun 4 05:38:22 2018 New Revision: 334605 URL: https://svnweb.freebsd.org/changeset/base/334605 Log: MFC r333098: Don't bail out from the check if readboot() returns !FSFATAL. This can happen when the fsinfo signature is invalid, and the user have choose to fix it, in which case the code would return FSBOOTMOD (not FSOK but not FSFATAL either). All other (fatal) cases would return FSFATAL. Obtained from: Android Open Source Project Obtained from: https://android.googlesource.com/platform/external/fsck_msdos/+/d8775a29ea7eac2e5f1504dd21da3725b93b3036 Modified: stable/11/sbin/fsck_msdosfs/check.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_msdosfs/check.c ============================================================================== --- stable/11/sbin/fsck_msdosfs/check.c Mon Jun 4 05:27:00 2018 (r334604) +++ stable/11/sbin/fsck_msdosfs/check.c Mon Jun 4 05:38:22 2018 (r334605) @@ -74,7 +74,7 @@ checkfilesys(const char *fname) return 8; } - if (readboot(dosfs, &boot) != FSOK) { + if (readboot(dosfs, &boot) == FSFATAL) { close(dosfs); printf("\n"); return 8; From owner-svn-src-stable@freebsd.org Mon Jun 4 05:47:16 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57A35FF57C9; Mon, 4 Jun 2018 05:47:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2AF773C39; Mon, 4 Jun 2018 05:47:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2E5B12A0; Mon, 4 Jun 2018 05:47:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w545lFoo085552; Mon, 4 Jun 2018 05:47:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w545lFp2085551; Mon, 4 Jun 2018 05:47:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201806040547.w545lFp2085551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 4 Jun 2018 05:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r334606 - stable/10/sbin/fsck_msdosfs X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/sbin/fsck_msdosfs X-SVN-Commit-Revision: 334606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:47:16 -0000 Author: delphij Date: Mon Jun 4 05:47:15 2018 New Revision: 334606 URL: https://svnweb.freebsd.org/changeset/base/334606 Log: MFC r333098: Don't bail out from the check if readboot() returns !FSFATAL. This can happen when the fsinfo signature is invalid, and the user have choose to fix it, in which case the code would return FSBOOTMOD (not FSOK but not FSFATAL either). All other (fatal) cases would return FSFATAL. Obtained from: Android Open Source Project Obtained from: https://android.googlesource.com/platform/external/fsck_msdos/+/d8775a29ea7eac2e5f1504dd21da3725b93b3036 Modified: stable/10/sbin/fsck_msdosfs/check.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_msdosfs/check.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/check.c Mon Jun 4 05:38:22 2018 (r334605) +++ stable/10/sbin/fsck_msdosfs/check.c Mon Jun 4 05:47:15 2018 (r334606) @@ -72,7 +72,7 @@ checkfilesys(const char *fname) return 8; } - if (readboot(dosfs, &boot) != FSOK) { + if (readboot(dosfs, &boot) == FSFATAL) { close(dosfs); printf("\n"); return 8; From owner-svn-src-stable@freebsd.org Mon Jun 4 05:53:34 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F311AFF6283; Mon, 4 Jun 2018 05:53:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4BBC741A5; Mon, 4 Jun 2018 05:53:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8565A1430; Mon, 4 Jun 2018 05:53:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w545rXJT090196; Mon, 4 Jun 2018 05:53:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w545rX44090194; Mon, 4 Jun 2018 05:53:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201806040553.w545rX44090194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 4 Jun 2018 05:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334607 - in stable/11: contrib/xz contrib/xz/src/common contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/common contrib/xz/src/liblzma/lzma contrib/xz/... X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: contrib/xz contrib/xz/src/common contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/common contrib/xz/src/liblzma/lzma contrib/xz/src/liblzma/rangecoder co... X-SVN-Commit-Revision: 334607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 05:53:34 -0000 Author: delphij Date: Mon Jun 4 05:53:32 2018 New Revision: 334607 URL: https://svnweb.freebsd.org/changeset/base/334607 Log: MFC r333783: MFV r333779: xz 5.2.4. Modified: stable/11/contrib/xz/COPYING stable/11/contrib/xz/ChangeLog stable/11/contrib/xz/README stable/11/contrib/xz/THANKS stable/11/contrib/xz/src/common/tuklib_integer.h stable/11/contrib/xz/src/liblzma/api/lzma.h stable/11/contrib/xz/src/liblzma/api/lzma/base.h stable/11/contrib/xz/src/liblzma/api/lzma/container.h stable/11/contrib/xz/src/liblzma/api/lzma/index.h stable/11/contrib/xz/src/liblzma/api/lzma/version.h stable/11/contrib/xz/src/liblzma/common/alone_decoder.c stable/11/contrib/xz/src/liblzma/common/auto_decoder.c stable/11/contrib/xz/src/liblzma/common/common.c stable/11/contrib/xz/src/liblzma/common/index_decoder.c stable/11/contrib/xz/src/liblzma/common/stream_decoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma_decoder.c stable/11/contrib/xz/src/liblzma/rangecoder/range_common.h stable/11/contrib/xz/src/xz/file_io.c stable/11/contrib/xz/src/xz/list.c stable/11/contrib/xz/src/xz/xz.1 stable/11/contrib/xz/src/xzdec/xzdec.1 stable/11/lib/liblzma/config.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/xz/COPYING ============================================================================== --- stable/11/contrib/xz/COPYING Mon Jun 4 05:47:15 2018 (r334606) +++ stable/11/contrib/xz/COPYING Mon Jun 4 05:53:32 2018 (r334607) @@ -47,7 +47,7 @@ XZ Utils Licensing naturally it is not legally required. Here is an example of a good notice to put into "about box" or into documentation: - This software includes code from XZ Utils . + This software includes code from XZ Utils . The following license texts are included in the following files: - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 Modified: stable/11/contrib/xz/ChangeLog ============================================================================== --- stable/11/contrib/xz/ChangeLog Mon Jun 4 05:47:15 2018 (r334606) +++ stable/11/contrib/xz/ChangeLog Mon Jun 4 05:53:32 2018 (r334607) @@ -1,3 +1,284 @@ +commit b5be61cc06088bb07f488f9baf7d447ff47b37c1 +Author: Lasse Collin +Date: 2018-04-29 19:00:06 +0300 + + Bump version and soname for 5.2.4. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit c47fa6d06745bb2e99866e76b81ac7a9c5a8bfec +Author: Lasse Collin +Date: 2018-04-29 18:48:00 +0300 + + extra/scanlzma: Fix compiler warnings. + + extra/scanlzma/scanlzma.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 7b350fe21aa4fd6495a3b6188a40e3f1ae7c0edf +Author: Lasse Collin +Date: 2018-04-29 18:15:37 +0300 + + Add NEWS for 5.2.4. + + NEWS | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 5801591162a280aa52d156dfde42c531ec7fd8b6 +Author: Lasse Collin +Date: 2018-02-06 19:36:30 +0200 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit c4a616f4536146f8906e1b4412eefeec07b28fae +Author: Ben Boeckel +Date: 2018-01-29 13:58:18 -0500 + + nothrow: use noexcept for C++11 and newer + + In C++11, the `throw()` specifier is deprecated and `noexcept` is + preffered instead. + + src/liblzma/api/lzma.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 0b8947782ff3c5ef830a7f85412e44dcf3cdeb77 +Author: Lasse Collin +Date: 2018-02-06 18:02:48 +0200 + + liblzma: Remove incorrect #ifdef from range_common.h. + + In most cases it was harmless but it could affect some + custom build systems. + + Thanks to Pippijn van Steenhoven. + + src/liblzma/rangecoder/range_common.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 48f3b9f73ffea7f55d5678997aba0e79d2e82168 +Author: Lasse Collin +Date: 2018-01-10 22:10:39 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit a3ce3e902342be37c626a561ce3d9ffcf27d0f94 +Author: Lasse Collin +Date: 2018-01-10 21:54:27 +0200 + + tuklib_integer: New Intel C compiler needs immintrin.h. + + Thanks to Melanie Blower (Intel) for the patch. + + src/common/tuklib_integer.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 4505ca483985f88c6923c05a43b4327feaab83b1 +Author: Lasse Collin +Date: 2017-09-24 20:04:24 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 1ef3cc226e3ce173575c218238b71a4eecabc470 +Author: Lasse Collin +Date: 2017-09-16 20:36:20 +0300 + + Windows: Fix paths in VS project files. + + Some paths use slashes instead of backslashes as directory + separators... now it should work (I tested VS2013 version). + + windows/vs2013/liblzma.vcxproj | 12 ++++++------ + windows/vs2013/liblzma_dll.vcxproj | 24 ++++++++++++------------ + windows/vs2017/liblzma.vcxproj | 12 ++++++------ + windows/vs2017/liblzma_dll.vcxproj | 24 ++++++++++++------------ + 4 files changed, 36 insertions(+), 36 deletions(-) + +commit e775d2a8189d24f60470e6e49d8af881df3a1680 +Author: Lasse Collin +Date: 2017-09-16 12:54:23 +0300 + + Windows: Add project files for VS2017. + + These files match the v5.2 branch (no file info decoder). + + windows/vs2017/config.h | 148 ++++++++++++++ + windows/vs2017/liblzma.vcxproj | 355 ++++++++++++++++++++++++++++++++++ + windows/vs2017/liblzma_dll.vcxproj | 384 +++++++++++++++++++++++++++++++++++++ + windows/vs2017/xz_win.sln | 48 +++++ + 4 files changed, 935 insertions(+) + +commit 10e02e0fbb6e2173f8b41f6e39b7b570f47dd74d +Author: Lasse Collin +Date: 2017-09-16 12:39:43 +0300 + + Windows: Move VS2013 files into windows/vs2013 directory. + + windows/{ => vs2013}/config.h | 0 + windows/{ => vs2013}/liblzma.vcxproj | 278 +++++++++++++++--------------- + windows/{ => vs2013}/liblzma_dll.vcxproj | 280 +++++++++++++++---------------- + windows/{ => vs2013}/xz_win.sln | 0 + 4 files changed, 279 insertions(+), 279 deletions(-) + +commit 06eebd4543196ded36fa9b8b9544195b38b24ef2 +Author: Lasse Collin +Date: 2017-08-14 20:08:33 +0300 + + Fix or hide warnings from GCC 7's -Wimplicit-fallthrough. + + src/liblzma/lzma/lzma_decoder.c | 6 ++++++ + src/xz/list.c | 2 ++ + 2 files changed, 8 insertions(+) + +commit ea4ea1dffafebaa8b2770bf3eca46900e4dd22dc +Author: Alexey Tourbin +Date: 2017-05-16 23:56:35 +0300 + + Docs: Fix a typo in a comment in doc/examples/02_decompress.c. + + doc/examples/02_decompress.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eb2ef4c79bf405ea0d215f3b1df3d0eaf5e1d27b +Author: Lasse Collin +Date: 2017-05-23 18:34:43 +0300 + + xz: Fix "xz --list --robot missing_or_bad_file.xz". + + It ended up printing an uninitialized char-array when trying to + print the check names (column 7) on the "totals" line. + + This also changes the column 12 (minimum xz version) to + 50000002 (xz 5.0.0) instead of 0 when there are no valid + input files. + + Thanks to kidmin for the bug report. + + src/xz/list.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 3ea5dbd9b0d79048e336e40cef3b6d814fb74e13 +Author: Lasse Collin +Date: 2017-04-24 19:48:47 +0300 + + Build: Omit pre-5.0.0 entries from the generated ChangeLog. + + It makes ChangeLog significantly smaller. + + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit bae24675936df99064de1502593c006bd902594b +Author: Lasse Collin +Date: 2017-04-24 19:30:22 +0300 + + Update the Git repository URL to HTTPS in ChangeLog. + + ChangeLog | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 70f479211973b5361f4d7cb08ba5be69b4266e7a +Author: Lasse Collin +Date: 2017-04-19 22:17:35 +0300 + + Update the home page URLs to HTTPS. + + COPYING | 2 +- + README | 2 +- + configure.ac | 2 +- + doc/faq.txt | 4 ++-- + dos/config.h | 2 +- + src/common/common_w32res.rc | 2 +- + src/xz/xz.1 | 6 +++--- + src/xzdec/xzdec.1 | 4 ++-- + windows/README-Windows.txt | 2 +- + windows/config.h | 2 +- + 10 files changed, 14 insertions(+), 14 deletions(-) + +commit 2a4b2fa75d06a097261a02ecd3cf2b6d449bf754 +Author: Lasse Collin +Date: 2017-03-30 22:01:54 +0300 + + xz: Use POSIX_FADV_RANDOM for in "xz --list" mode. + + xz --list is random access so POSIX_FADV_SEQUENTIAL was clearly + wrong. + + src/xz/file_io.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit eb25743ade39170cffd9566a1aae272098cce216 +Author: Lasse Collin +Date: 2017-03-30 19:47:45 +0300 + + liblzma: Fix lzma_memlimit_set(strm, 0). + + The 0 got treated specially in a buggy way and as a result + the function did nothing. The API doc said that 0 was supposed + to return LZMA_PROG_ERROR but it didn't. + + Now 0 is treated as if 1 had been specified. This is done because + 0 is already used to indicate an error from lzma_memlimit_get() + and lzma_memusage(). + + In addition, lzma_memlimit_set() no longer checks that the new + limit is at least LZMA_MEMUSAGE_BASE. It's counter-productive + for the Index decoder and was actually needed only by the + auto decoder. Auto decoder has now been modified to check for + LZMA_MEMUSAGE_BASE. + + src/liblzma/api/lzma/base.h | 7 ++++++- + src/liblzma/common/auto_decoder.c | 3 +++ + src/liblzma/common/common.c | 6 ++++-- + 3 files changed, 13 insertions(+), 3 deletions(-) + +commit ef36c6362f3f3853f21b8a6359bcd06576ebf207 +Author: Lasse Collin +Date: 2017-03-30 19:16:55 +0300 + + liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder. + + src/liblzma/api/lzma/container.h | 21 +++++++++++++++++---- + src/liblzma/common/alone_decoder.c | 5 +---- + src/liblzma/common/auto_decoder.c | 5 +---- + src/liblzma/common/stream_decoder.c | 5 +---- + 4 files changed, 20 insertions(+), 16 deletions(-) + +commit 57616032650f03840480b696d7878acdd2065521 +Author: Lasse Collin +Date: 2017-03-30 18:58:18 +0300 + + liblzma: Fix handling of memlimit == 0 in lzma_index_decoder(). + + It returned LZMA_PROG_ERROR, which was done to avoid zero as + the limit (because it's a special value elsewhere), but using + LZMA_PROG_ERROR is simply inconvenient and can cause bugs. + + The fix/workaround is to treat 0 as if it were 1 byte. It's + effectively the same thing. The only weird consequence is + that then lzma_memlimit_get() will return 1 even when 0 was + specified as the limit. + + This fixes a very rare corner case in xz --list where a specific + memory usage limit and a multi-stream file could print the + error message "Internal error (bug)" instead of saying that + the memory usage limit is too low. + + src/liblzma/api/lzma/index.h | 18 +++++++++++------- + src/liblzma/common/index_decoder.c | 4 ++-- + 2 files changed, 13 insertions(+), 9 deletions(-) + commit 3d566cd519017eee1a400e7961ff14058dfaf33c Author: Lasse Collin Date: 2016-12-30 13:26:36 +0200 @@ -5332,10037 +5613,3 @@ Date: 2010-10-23 14:02:53 +0300 src/liblzma/Makefile.am | 2 +- src/liblzma/api/lzma/version.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) - -commit 8c947e9291691629714dafb4536c718b6cc24fbd -Author: Lasse Collin -Date: 2010-10-23 12:30:54 +0300 - - liblzma: Make lzma_code() check the reserved members in lzma_stream. - - If any of the reserved members in lzma_stream are non-zero - or non-NULL, LZMA_OPTIONS_ERROR is returned. It is possible - that a new feature in the future is indicated by just setting - a reserved member to some other value, so the old liblzma - version need to catch it as an unsupported feature. - - src/liblzma/common/common.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -commit e61d85e082743ebd2dd0ff28fc0a82482ede0538 -Author: Lasse Collin -Date: 2010-10-23 12:26:33 +0300 - - Windows: Use MinGW's stdio functions. - - The non-standard ones from msvcrt.dll appear to work - most of the time with XZ Utils, but there are some - corner cases where things may go very wrong. So it's - good to use the better replacements provided by - MinGW(-w64) runtime. - - src/common/sysdefs.h | 5 +++++ - 1 file changed, 5 insertions(+) - -commit 23e23f1dc029146714c9a98313ab3ea93d71a2fc -Author: Lasse Collin -Date: 2010-10-23 12:21:32 +0300 - - liblzma: Use 512 as INDEX_GROUP_SIZE. - - This lets compiler use shifting instead of 64-bit division. - - src/liblzma/common/index.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 613939fc82603b75b59eee840871a05bc8dd08e0 -Author: Lasse Collin -Date: 2010-10-23 12:20:11 +0300 - - liblzma: A few ABI tweaks to reserve space in structures. - - src/liblzma/api/lzma/base.h | 7 ++++++- - src/liblzma/api/lzma/lzma.h | 4 ++-- - src/liblzma/api/lzma/stream_flags.h | 4 ---- - 3 files changed, 8 insertions(+), 7 deletions(-) - -commit 68b83f252df3d27480a9f6f03445d16f6506fef1 -Author: Lasse Collin -Date: 2010-10-21 23:16:11 +0300 - - xz: Make sure that message_strm() can never return NULL. - - src/xz/message.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -commit d09c5753e33ff96ee57edb6d1e98e34041203695 -Author: Lasse Collin -Date: 2010-10-21 23:06:31 +0300 - - liblzma: Update the comments in the API headers. - - Adding support for LZMA_FINISH for Index encoding and - decoding needed tiny additions to the relevant .c files too. - - src/liblzma/api/lzma.h | 4 +-- - src/liblzma/api/lzma/base.h | 38 +++++++++++++-------------- - src/liblzma/api/lzma/bcj.h | 4 +-- - src/liblzma/api/lzma/block.h | 4 +-- - src/liblzma/api/lzma/container.h | 26 ++++++++++++------- - src/liblzma/api/lzma/filter.h | 51 ++++++++++++++++++------------------- - src/liblzma/api/lzma/hardware.h | 3 +-- - src/liblzma/api/lzma/index.h | 28 ++++++++++++-------- - src/liblzma/api/lzma/index_hash.h | 2 +- - src/liblzma/api/lzma/lzma.h | 46 ++++++++++++++++++++++----------- - src/liblzma/api/lzma/stream_flags.h | 4 +-- - src/liblzma/api/lzma/vli.h | 31 +++++++++++----------- - src/liblzma/common/index_decoder.c | 1 + - src/liblzma/common/index_encoder.c | 1 + - 14 files changed, 136 insertions(+), 107 deletions(-) - -commit 33c1c0e102eb529588503b8beea0903a45488fad -Author: Lasse Collin -Date: 2010-10-19 12:08:30 +0300 - - Update INSTALL.generic. - - INSTALL.generic | 99 ++++++++++++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 81 insertions(+), 18 deletions(-) - -commit 0076e03641f201c4b77dddd5a6db5880be19a78c -Author: Lasse Collin -Date: 2010-10-19 11:44:37 +0300 - - Clean up a few FIXMEs and TODOs. - - lzma_chunk_size() was commented out because it is - currently useless. - - src/liblzma/common/filter_encoder.c | 2 ++ - src/liblzma/common/filter_encoder.h | 4 ++-- - src/liblzma/lzma/lzma2_decoder.c | 1 - - src/liblzma/lzma/lzma_decoder.c | 4 ++-- - src/liblzma/lzma/lzma_encoder.c | 2 +- - src/xz/message.h | 2 +- - 6 files changed, 8 insertions(+), 7 deletions(-) - -commit ce34ec4f54ff8b753da236f371ad8dd23c8135c9 -Author: Lasse Collin -Date: 2010-10-19 10:21:08 +0300 - - Update docs. - - INSTALL | 192 +++++++++++++++++++++++++++++++++++++++++-------------------- - PACKAGERS | 104 +++++++++------------------------ - TODO | 17 ++++-- - dos/README | 2 +- - 4 files changed, 172 insertions(+), 143 deletions(-) - -commit f0fa880d247e73264d2c04fe31fb3412318a0026 -Author: Lasse Collin -Date: 2010-10-12 15:13:30 +0300 - - xz: Avoid raise() also on OpenVMS. - - This is similar to DOS/DJGPP that killing the program - with a signal will print a backtrace or a similar message. - - src/xz/signals.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit ac462b1c47c451f5c62e428306314c4bdad8ae7f -Author: Lasse Collin -Date: 2010-10-11 21:26:19 +0300 - - xz: Avoid SA_RESTART for portability reasons. - - SA_RESTART is not as portable as I had hoped. It's missing - at least from OpenVMS, QNX, and DJGPP). Luckily we can do - fine without SA_RESTART. - - src/xz/message.c | 38 +++++++++++++++----------------------- - src/xz/message.h | 4 ++++ - src/xz/signals.c | 6 ++++++ - 3 files changed, 25 insertions(+), 23 deletions(-) - -commit d52b411716a614c202e89ba732492efb9916cd3f -Author: Lasse Collin -Date: 2010-10-10 17:58:58 +0300 - - xz: Use "%"PRIu32 instead of "%d" in a format string. - - src/xz/message.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit ae74d1bdeb075c3beefe76e1136c5741804e7e91 -Author: Lasse Collin -Date: 2010-10-10 17:43:26 +0300 - - test_files.sh: Fix the first line. - - For some reason this prevented running the test only - on OS/2 and even on that it broke only recently. - - Thanks to Elbert Pol. - - tests/test_files.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit d492b80ddd6f9a13419de6d102df7374d8f448e8 -Author: Lasse Collin -Date: 2010-10-10 16:49:01 +0300 - - lzmainfo: Use "%"PRIu32 instead of "%u" for uint32_t. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 825e859a9054bd91202e5723c41a17e72f63040a -Author: Lasse Collin -Date: 2010-10-10 16:47:01 +0300 - - lzmainfo: Use fileno(stdin) instead of STDIN_FILENO. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit acbc4cdecbeec2a4dfaac04f185ece49b2ff17c8 -Author: Lasse Collin -Date: 2010-10-09 23:20:51 +0300 - - lzmainfo: Use setmode() on DOS-like systems. - - src/lzmainfo/lzmainfo.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -commit ef364d3abc5647111c5424ea0d83a567e184a23b -Author: Lasse Collin -Date: 2010-10-09 21:51:03 +0300 - - OS/2 and DOS: Be less verbose on signals. - - Calling raise() to kill xz when user has pressed C-c - is a bit verbose on OS/2 and DOS/DJGPP. Instead of - calling raise(), set only the exit status to 1. - - src/xz/signals.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -commit 5629c4be07b6c67e79842b2569da1cedc9c0d69a -Author: Lasse Collin -Date: 2010-10-09 19:28:49 +0300 - - DOS: Update the Makefile, config.h and README. - - This is now simpler and builds only xz.exe. - - dos/Makefile | 211 +++++++++++++++-------------------------------------------- - dos/README | 73 +++++++-------------- - dos/config.h | 45 ++++--------- - 3 files changed, 86 insertions(+), 243 deletions(-) - -commit f25a77e6b9bc48a243ddfbbd755b7960eec7e0ac -Author: Lasse Collin -Date: 2010-10-09 18:57:55 +0300 - - Windows: Put some license info into README-Windows.txt. - - windows/README-Windows.txt | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -commit e75100f549f85d231df25c07aa94d63e78e2d668 -Author: Lasse Collin -Date: 2010-10-09 18:57:04 +0300 - - Windows: Fix a diagnostics bug in build.bash. - - windows/build.bash | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit efeb998a2b1025df1c1d202cc7d21d866cd1c336 -Author: Lasse Collin -Date: 2010-10-09 13:02:15 +0300 - - lzmainfo: Add Windows resource file. - - src/lzmainfo/Makefile.am | 9 +++++++++ - src/lzmainfo/lzmainfo_w32res.rc | 12 ++++++++++++ - 2 files changed, 21 insertions(+) - -commit 389d418445f1623593dfdbba55d52fbb6d1205f5 -Author: Lasse Collin -Date: 2010-10-09 12:57:25 +0300 - - Add missing public domain notice to lzmadec_w32res.rc. - - src/xzdec/lzmadec_w32res.rc | 7 +++++++ - 1 file changed, 7 insertions(+) - -commit 6389c773a4912dd9f111256d74ba1605230a7957 -Author: Lasse Collin -Date: 2010-10-09 12:52:12 +0300 - - Windows: Update common_w32res.rc. - - src/common/common_w32res.rc | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -commit 71275457ca24c9b01721f5cfc3638cf094daf454 -Author: Lasse Collin -Date: 2010-10-09 12:27:08 +0300 - - Windows: Make build.bash prefer MinGW-w32 over MinGW. - - This is simply for licensing reasons. The 64-bit version - will be built with MinGW-w64 anyway (at least for now), - so using it also for 32-bit build allows using the same - copyright notice about the MinGW-w64/w32 runtime. - - Note that using MinGW would require a copyright notice too, - because its runtime is not in the public domain either even - though MinGW's home page claims that it is public domain. - See . - - windows/build.bash | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -commit 3ac35719d8433af937af6491383d4a50e343099b -Author: Lasse Collin -Date: 2010-10-09 11:33:21 +0300 - - Windows: Copy COPYING-Windows.txt (if it exists) to the package. - - Also, put README-Windows.txt to the doc directory like - the other documentation files. - - windows/build.bash | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -commit 7b5db576fd7a4a67813b8437a9ccd4dbc94bbaae -Author: Lasse Collin -Date: 2010-10-08 21:42:37 +0300 - - Windows: Fix build.bash again. - - 630a8beda34af0ac153c8051b1bf01230558e422 wasn't good. - - windows/build.bash | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -commit d3cd7abe85ec7c2f46cf198b15c00d5d119df3dd -Author: Lasse Collin -Date: 2010-10-08 16:53:20 +0300 - - Use LZMA_VERSION_STRING instead of PACKAGE_VERSION. - - Those are the same thing, and the former makes it a bit - easier to build the code with other build systems, because - one doesn't need to update the version number into custom - config.h. - - This change affects only lzmainfo. Other tools were already - using LZMA_VERSION_STRING. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 084c60d318f2dbaef4078d9b100b4a373d0c3a7f -Author: Lasse Collin -Date: 2010-10-08 15:59:25 +0300 - - configure.ac: Remove two unused defines. - - configure.ac | 4 ---- - 1 file changed, 4 deletions(-) - -commit 11f51b6714357cb67ec7e56ed9575c199b5581fe -Author: Lasse Collin -Date: 2010-10-08 15:32:29 +0300 - - Make tests accommodate missing xz or xzdec. - - tests/test_compress.sh | 47 ++++++++++++++++++++++++++++++----------------- - tests/test_files.sh | 28 ++++++++++++++++++++++++++-- - 2 files changed, 56 insertions(+), 19 deletions(-) - -commit b1c7368f95e93ccdefdd0748e04398c26766f47f -Author: Lasse Collin -Date: 2010-10-08 15:25:45 +0300 - - Build: Add options to disable individual command line tools. - - configure.ac | 38 ++++++++++++++++++++++++++++++ - src/Makefile.am | 15 +++++++++++- - src/scripts/Makefile.am | 62 +++++++++++++++++++++---------------------------- - src/xz/Makefile.am | 6 ++++- - src/xzdec/Makefile.am | 12 ++++++++-- - 5 files changed, 93 insertions(+), 40 deletions(-) - -commit 630a8beda34af0ac153c8051b1bf01230558e422 -Author: Lasse Collin -Date: 2010-10-07 00:44:53 +0300 - - Windows: Make build.bash work without --enable-dynamic=no. - - windows/build.bash | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -commit f9907503f882a745dce9d84c2968f6c175ba966a -Author: Lasse Collin -Date: 2010-10-05 14:13:16 +0300 - - Build: Remove the static/dynamic tricks. - - Most distros want xz linked against shared liblzma, so - it doesn't help much to require --enable-dynamic for that. - Those who want to avoid PIC on x86-32 to get better - performance, can still do it e.g. by using --disable-shared - to compile xz and then another pass to compile shared liblzma. - - Part of these static/dynamic tricks were needed for Windows - in the past. Nowadays we rely on GCC and binutils to do the - right thing with auto-import. If the Autotooled build system - needs to support some other toolchain on Windows in the future, - this may need some rethinking. - - configure.ac | 74 ------------------------------------------------ - debug/Makefile.am | 5 +--- - src/lzmainfo/Makefile.am | 4 +-- - src/xz/Makefile.am | 4 +-- - src/xzdec/Makefile.am | 4 +-- - tests/Makefile.am | 5 +--- - 6 files changed, 5 insertions(+), 91 deletions(-) - -commit fda4724d8114fccfa31c1839c15479f350c2fb4c -Author: Lasse Collin -Date: 2010-10-05 12:18:58 +0300 - - configure.ac: Silence a warning from Autoconf 2.68. - - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 80b5675fa62c87426fe86f8fcd20feeabc4361b9 -Author: Lasse Collin -Date: 2010-10-04 19:43:01 +0300 - - A few more languages files to the xz man page. - - Thanks to Jonathan Nieder. - - src/xz/xz.1 | 45 ++++++++++++++++++++++++--------------------- - 1 file changed, 24 insertions(+), 21 deletions(-) - -commit f9722dbeca4dc4c43cfd15d122dafaac50b0a0bb -Author: Lasse Collin -Date: 2010-10-02 12:07:33 +0300 - - Update the FAQ. - - doc/faq.txt | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 100 insertions(+), 4 deletions(-) - -commit 61ae593661e8dc402394e84d567ca2044a51572b -Author: Lasse Collin -Date: 2010-10-02 11:38:20 +0300 - - liblzma: Small fixes to comments in the API headers. - - src/liblzma/api/lzma/lzma.h | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -commit 9166682dc601fd42c1b9510572e3f917d18de504 -Author: Lasse Collin -Date: 2010-09-28 11:40:12 +0300 - - Create the PDF versions of the man pages better. - - Makefile.am | 14 +++++++------ - build-aux/manconv.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 66 insertions(+), 6 deletions(-) - -commit 17d3c61edd35de8fa884944fc70d1db86daa5dd8 -Author: Lasse Collin -Date: 2010-09-28 10:59:53 +0300 - - Move version.sh to build-aux. - - Makefile.am | 4 ++-- - version.sh => build-aux/version.sh | 0 - configure.ac | 2 +- - windows/build.bash | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -commit 84af9d8770451339a692e9b70f96cf56156a6069 -Author: Lasse Collin -Date: 2010-09-28 10:53:02 +0300 - - Update .gitignore. - - .gitignore | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -commit 31575a449ac64c523da3bab8d0c0b522cdc7c780 -Author: Lasse Collin -Date: 2010-09-28 01:17:14 +0300 - - Fix accomodate -> accommodate on the xz man page. - - src/xz/xz.1 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit cec0ddc8ec4ce81685a51998b978e22167e461f9 -Author: Lasse Collin -Date: 2010-09-27 23:29:34 +0300 - - Major man page updates. - - Lots of content was updated on the xz man page. - - Technical improvements: - - Start a new sentence on a new line. - - Use fairly short lines. - - Use constant-width font for examples (where supported). - - Some minor cleanups. - - Thanks to Jonathan Nieder for some language fixes. - - src/lzmainfo/lzmainfo.1 | 25 +- - src/scripts/xzdiff.1 | 15 +- - src/scripts/xzgrep.1 | 11 +- - src/scripts/xzless.1 | 13 +- - src/scripts/xzmore.1 | 9 +- - src/xz/xz.1 | 1964 ++++++++++++++++++++++++++++++++--------------- - src/xzdec/xzdec.1 | 39 +- - 7 files changed, 1435 insertions(+), 641 deletions(-) - -commit 075257ab0416a0603be930082e31a5703e4ba345 -Author: Lasse Collin -Date: 2010-09-26 18:10:31 +0300 - - Fix the preset -3e. - - depth=0 was missing. - - src/liblzma/lzma/lzma_encoder_presets.c | 1 + - 1 file changed, 1 insertion(+) - -commit 2577da9ebdba13fbe99ae5ee8bde35f7ed60f6d1 -Author: Lasse Collin -Date: 2010-09-23 14:03:10 +0300 - - Add translations.bash and translation notes to README. - - translations.bash prints some messages from xz, which - hopefully makes it a bit easier to test translations. - - README | 96 +++++++++++++++++++++++++++++++++++++++++++++-- - debug/translation.bash | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 192 insertions(+), 4 deletions(-) - -commit a3c5997c57e5b1a20aae6d1071b584b4f17d0b23 -Author: Lasse Collin -Date: 2010-09-17 22:14:30 +0300 - - xz: Update the Czech translation. - - Thanks to Marek Černocký. - - po/cs.po | 202 +++++++++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 131 insertions(+), 71 deletions(-) - -commit a1766af582dc23fddd9da1eeb4b9d61e3eb4c2e6 -Author: Lasse Collin -Date: 2010-09-16 23:40:41 +0300 - - xz: Add Italian translation. - - Thanks to Milo Casagrande and Lorenzo De Liso. - - THANKS | 2 + - po/LINGUAS | 1 + - po/it.po | 902 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 905 insertions(+) - -commit 21088018554e2b0e02914205377ceb6e34a090bd -Author: Lasse Collin -Date: 2010-09-15 00:34:13 +0300 - - xz: Edit a translators comment. - - src/xz/list.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit be16e28ece1b492b8f93382b7fa1cc4da23c6ff6 -Author: Lasse Collin -Date: 2010-09-14 22:47:14 +0300 - - xz: Add German translation. - - Thanks to Andre Noll. - - THANKS | 1 + - po/LINGUAS | 1 + - po/de.po | 903 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 905 insertions(+) - -commit e23ea74f3240e6b69683f9e69d1716e0f9e9092b -Author: Lasse Collin -Date: 2010-09-10 14:30:25 +0300 - - Updated README. - - README | 2 -- - 1 file changed, 2 deletions(-) - -commit 8dad2fd69336985adb9f774fa96dc9c0efcb5a71 -Author: Lasse Collin -Date: 2010-09-10 14:30:07 +0300 - - Updated INSTALL. - - INSTALL | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -commit 0b5f07fe3728c27cce416ddc40f7e4803ae96ac2 -Author: Lasse Collin -Date: 2010-09-10 14:26:20 +0300 - - Updated the git repository address in ChangeLog. - - ChangeLog | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit a8760203f93a69bc39fd14520a6e9e7b7d70be06 -Author: Lasse Collin -Date: 2010-09-10 14:09:33 +0300 - - xz: Add a comment to translators about "literal context bits". - - src/xz/message.c | 4 ++++ - 1 file changed, 4 insertions(+) - -commit bb0b1004f83cdc4d309e1471c2ecaf9f95ce60c5 -Author: Lasse Collin -Date: 2010-09-10 10:30:33 +0300 - - xz: Multiple fixes. - - The code assumed that printing numbers with thousand separators - and decimal points would always produce only US-ASCII characters. - This was used for buffer sizes (with snprintf(), no overflows) - and aligning columns of the progress indicator and --list. That - assumption was wrong (e.g. LC_ALL=fi_FI.UTF-8 with glibc), so - multibyte character support was added in this commit. The old - way is used if the operating system doesn't have enough multibyte - support (e.g. lacks wcwidth()). - - The sizes of buffers were increased to accomodate multibyte - characters. I don't know how big they should be exactly, but - they aren't used for anything critical, so it's not too bad. - If they still aren't big enough, I hopefully get a bug report. - snprintf() takes care of avoiding buffer overflows. - - Some static buffers were replaced with buffers allocated on - stack. double_to_str() was removed. uint64_to_str() and - uint64_to_nicestr() now share the static buffer and test - for thousand separator support. - - Integrity check names "None" and "Unknown-N" (2 <= N <= 15) - were marked to be translated. I had forgot these, plus they - wouldn't have worked correctly anyway before this commit, - because printing tables with multibyte strings didn't work. - - Thanks to Marek Černocký for reporting the bug about - misaligned table columns in --list output. - - configure.ac | 1 + - m4/tuklib_mbstr.m4 | 30 ++++++ - src/common/tuklib_mbstr.h | 66 +++++++++++++ - src/common/tuklib_mbstr_fw.c | 31 ++++++ - src/common/tuklib_mbstr_width.c | 64 +++++++++++++ - src/xz/Makefile.am | 4 +- - src/xz/list.c | 205 +++++++++++++++++++++++++++------------- - src/xz/message.c | 56 +++++++---- - src/xz/message.h | 10 +- - src/xz/private.h | 1 + - src/xz/util.c | 136 +++++++++----------------- - src/xz/util.h | 7 -- - 12 files changed, 424 insertions(+), 187 deletions(-) - -commit 639f8e2af33cf8a184d59ba56b6df7c098679d61 -Author: Lasse Collin -Date: 2010-09-08 08:49:22 +0300 - - Update the Czech translation. - - Thanks to Marek Černocký. - - po/cs.po | 655 +++++++++++++++++++++++++++++++++++++++++++-------------------- - 1 file changed, 454 insertions(+), 201 deletions(-) - -commit 41bc9956ebfd7c86777d33676acf34c45e7ca7c7 -Author: Lasse Collin -Date: 2010-09-07 12:31:40 +0300 - - xz: Add a note to translators. - - src/xz/hardware.c | 2 ++ - 1 file changed, 2 insertions(+) - -commit 77a7746616e555fc08028e883a56d06bf0088b81 -Author: Lasse Collin -Date: 2010-09-07 10:42:13 +0300 - - Fix use of N_() and ngettext(). - - I had somehow thought that N_() is usually used - as shorthand for ngettext(). - - This also fixes a missing \n from a call to ngettext(). - - src/common/tuklib_gettext.h | 4 ++-- - src/xz/list.c | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -commit e6ad39335842343e622ab51207d1d3cb9caad801 -Author: Lasse Collin -Date: 2010-09-06 19:43:12 +0300 - - Add missing files to POTFILES.in. - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Jun 4 14:13:05 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1E76FE5AAF; Mon, 4 Jun 2018 14:13:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9361868C6D; Mon, 4 Jun 2018 14:13:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7478868EA; Mon, 4 Jun 2018 14:13:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54ED48d041301; Mon, 4 Jun 2018 14:13:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54ED4KI041300; Mon, 4 Jun 2018 14:13:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806041413.w54ED4KI041300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 4 Jun 2018 14:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334611 - stable/11/sys/geom/mirror X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/geom/mirror X-SVN-Commit-Revision: 334611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 14:13:05 -0000 Author: markj Date: Mon Jun 4 14:13:04 2018 New Revision: 334611 URL: https://svnweb.freebsd.org/changeset/base/334611 Log: MFC r333278, r333279: Avoid dropping the topology lock in gmirror's dumpconf implementation. Modified: stable/11/sys/geom/mirror/g_mirror.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/11/sys/geom/mirror/g_mirror.c Mon Jun 4 11:35:04 2018 (r334610) +++ stable/11/sys/geom/mirror/g_mirror.c Mon Jun 4 14:13:04 2018 (r334611) @@ -275,8 +275,6 @@ g_mirror_ndisks(struct g_mirror_softc *sc, int state) struct g_mirror_disk *disk; u_int n = 0; - sx_assert(&sc->sc_lock, SX_LOCKED); - LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (state == -1 || disk->d_state == state) n++; @@ -493,7 +491,9 @@ g_mirror_destroy_disk(struct g_mirror_disk *disk) sc = disk->d_softc; sx_assert(&sc->sc_lock, SX_XLOCKED); + g_topology_lock(); LIST_REMOVE(disk, d_next); + g_topology_unlock(); g_mirror_event_cancel(disk); if (sc->sc_hint == disk) sc->sc_hint = NULL; @@ -520,6 +520,8 @@ static void g_mirror_free_device(struct g_mirror_softc *sc) { + g_topology_assert(); + mtx_destroy(&sc->sc_queue_mtx); mtx_destroy(&sc->sc_events_mtx); mtx_destroy(&sc->sc_done_mtx); @@ -2624,6 +2626,7 @@ again: DISK_STATE_CHANGED(); disk->d_state = state; + g_topology_lock(); if (LIST_EMPTY(&sc->sc_disks)) LIST_INSERT_HEAD(&sc->sc_disks, disk, d_next); else { @@ -2641,6 +2644,7 @@ again: if (dp != NULL) LIST_INSERT_AFTER(dp, disk, d_next); } + g_topology_unlock(); G_MIRROR_DEBUG(1, "Device %s: provider %s detected.", sc->sc_name, g_mirror_get_diskname(disk)); if (sc->sc_state == G_MIRROR_DEVICE_STATE_STARTING) @@ -3326,24 +3330,20 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent, disk = cp->private; if (disk == NULL) return; - g_topology_unlock(); - sx_xlock(&sc->sc_lock); sbuf_printf(sb, "%s%u\n", indent, (u_int)disk->d_id); if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) { sbuf_printf(sb, "%s", indent); if (disk->d_sync.ds_offset == 0) sbuf_printf(sb, "0%%"); - else { + else sbuf_printf(sb, "%u%%", (u_int)((disk->d_sync.ds_offset * 100) / - sc->sc_provider->mediasize)); - } + sc->sc_mediasize)); sbuf_printf(sb, "\n"); - if (disk->d_sync.ds_offset > 0) { + if (disk->d_sync.ds_offset > 0) sbuf_printf(sb, "%s%jd" "\n", indent, (intmax_t)disk->d_sync.ds_offset); - } } sbuf_printf(sb, "%s%u\n", indent, disk->d_sync.ds_syncid); @@ -3378,11 +3378,7 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent, disk->d_priority); sbuf_printf(sb, "%s%s\n", indent, g_mirror_disk_state2str(disk->d_state)); - sx_xunlock(&sc->sc_lock); - g_topology_lock(); } else { - g_topology_unlock(); - sx_xlock(&sc->sc_lock); sbuf_printf(sb, "%s", indent); switch (sc->sc_type) { case G_MIRROR_TYPE_AUTOMATIC: @@ -3434,8 +3430,6 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent, else sbuf_printf(sb, "%s", "DEGRADED"); sbuf_printf(sb, "\n"); - sx_xunlock(&sc->sc_lock); - g_topology_lock(); } } From owner-svn-src-stable@freebsd.org Mon Jun 4 14:15:04 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 321FDFE5DA2; Mon, 4 Jun 2018 14:15:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D77BF68E37; Mon, 4 Jun 2018 14:15:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5FAA68EB; Mon, 4 Jun 2018 14:15:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54EF3tj041432; Mon, 4 Jun 2018 14:15:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54EF3lu041431; Mon, 4 Jun 2018 14:15:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806041415.w54EF3lu041431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 4 Jun 2018 14:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334612 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 334612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 14:15:04 -0000 Author: markj Date: Mon Jun 4 14:15:03 2018 New Revision: 334612 URL: https://svnweb.freebsd.org/changeset/base/334612 Log: MFC r334100: Document the return value of sbuf_bcat(9). Modified: stable/11/share/man/man9/sbuf.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/sbuf.9 ============================================================================== --- stable/11/share/man/man9/sbuf.9 Mon Jun 4 14:13:04 2018 (r334611) +++ stable/11/share/man/man9/sbuf.9 Mon Jun 4 14:15:03 2018 (r334612) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 5, 2017 +.Dd May 23, 2018 .Dt SBUF 9 .Os .Sh NAME @@ -616,6 +616,7 @@ function returns \-1 if was invalid, and zero otherwise. .Pp The +.Fn sbuf_bcat , .Fn sbuf_cat , .Fn sbuf_cpy , .Fn sbuf_printf , From owner-svn-src-stable@freebsd.org Mon Jun 4 14:16:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 555B3FE5EE8; Mon, 4 Jun 2018 14:16:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0678669022; Mon, 4 Jun 2018 14:16:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCC7A68EC; Mon, 4 Jun 2018 14:16:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54EG1tV041519; Mon, 4 Jun 2018 14:16:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54EG1cO041518; Mon, 4 Jun 2018 14:16:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806041416.w54EG1cO041518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 4 Jun 2018 14:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334613 - stable/11/sys/cddl/dev/dtrace/aarch64 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/cddl/dev/dtrace/aarch64 X-SVN-Commit-Revision: 334613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 14:16:02 -0000 Author: markj Date: Mon Jun 4 14:16:01 2018 New Revision: 334613 URL: https://svnweb.freebsd.org/changeset/base/334613 Log: MFC r333570: DTrace aarch64: Avoid calling unwind_frame() in the probe context. Modified: stable/11/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c ============================================================================== --- stable/11/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Mon Jun 4 14:15:03 2018 (r334612) +++ stable/11/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c Mon Jun 4 14:16:01 2018 (r334613) @@ -70,7 +70,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in { struct unwind_state state; int scp_offset; - register_t sp; + register_t sp, fp; int depth; depth = 0; @@ -88,11 +88,15 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in state.pc = (uint64_t)dtrace_getpcstack; while (depth < pcstack_limit) { - if (unwind_frame(&state)) - break; - if (!INKERNEL(state.pc) || !INKERNEL(state.fp)) break; + + fp = state.fp; + state.sp = fp + 0x10; + /* FP to previous frame (X29) */ + state.fp = *(register_t *)(fp); + /* LR (X30) */ + state.pc = *(register_t *)(fp + 8) - 4; /* * NB: Unlike some other architectures, we don't need to From owner-svn-src-stable@freebsd.org Mon Jun 4 14:23:05 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 045CAFE6BE2; Mon, 4 Jun 2018 14:23:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAC64697B2; Mon, 4 Jun 2018 14:23:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BD476A7A; Mon, 4 Jun 2018 14:23:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54EN4OP046184; Mon, 4 Jun 2018 14:23:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54EN4l2046183; Mon, 4 Jun 2018 14:23:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806041423.w54EN4l2046183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 4 Jun 2018 14:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334614 - stable/11/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/cddl/usr.sbin/dtrace/tests/tools X-SVN-Commit-Revision: 334614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 14:23:05 -0000 Author: markj Date: Mon Jun 4 14:23:04 2018 New Revision: 334614 URL: https://svnweb.freebsd.org/changeset/base/334614 Log: MFC r319792: Override the locale so that file lists get a consistent sort order. Modified: stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh ============================================================================== --- stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Mon Jun 4 14:16:01 2018 (r334613) +++ stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Mon Jun 4 14:23:04 2018 (r334614) @@ -89,6 +89,8 @@ if [ $# -ne 0 ]; then usage fi +export LC_ALL=C + readonly ORIGINDIR=$(realpath $(dirname $0)) readonly TOPDIR=$(realpath ${ORIGINDIR}/../../../../..) readonly CONTRIB_TESTDIR=${TOPDIR}/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common From owner-svn-src-stable@freebsd.org Mon Jun 4 20:21:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9926FEDFB5; Mon, 4 Jun 2018 20:21:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4388426F; Mon, 4 Jun 2018 20:21:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D237124A8; Mon, 4 Jun 2018 20:21:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54KLqSU041869; Mon, 4 Jun 2018 20:21:52 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54KLqh9041868; Mon, 4 Jun 2018 20:21:52 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806042021.w54KLqh9041868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 4 Jun 2018 20:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334629 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 334629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 20:21:53 -0000 Author: rmacklem Date: Mon Jun 4 20:21:51 2018 New Revision: 334629 URL: https://svnweb.freebsd.org/changeset/base/334629 Log: MFC: r333592 Fix the eir_server_scope reply argument for NFSv4.1 ExchangeID. In the reply to an ExchangeID operation, the NFSv4.1 server returns a "scope" value (eir_server_scope). If this value is the same, it indicates that two servers share state, which is never the case for FreeBSD servers. As such, the value needs to be unique and it was without this patch. However, I just found out that it is not supposed to change when the server reboots and without this patch, it did change. This patch fixes eir_server_scope so that it does not change when the server is rebooted. The only affect not having this patch has is that Linux clients don't reclaim opens and locks after a server reboot, which meant they lost any byte range locks held before the server rebooted. It only affects NFSv4.1 mounts and the FreeBSD NFSv4.1 client was not affected by this bug. Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 4 19:47:24 2018 (r334628) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 4 20:21:51 2018 (r334629) @@ -3831,9 +3831,9 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused txdr_hyper(owner_minor, tl); /* Minor */ (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid, strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Major */ - NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED); - *tl++ = txdr_unsigned(NFSX_UNSIGNED); - *tl++ = time_uptime; /* Make scope a unique value. */ + (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid, + strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Scope */ + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(1); (void)nfsm_strtom(nd, "freebsd.org", strlen("freebsd.org")); (void)nfsm_strtom(nd, version, strlen(version)); From owner-svn-src-stable@freebsd.org Mon Jun 4 20:40:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D205FF0068; Mon, 4 Jun 2018 20:40:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDDDB85103; Mon, 4 Jun 2018 20:40:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE653126A5; Mon, 4 Jun 2018 20:40:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54KeM0G051962; Mon, 4 Jun 2018 20:40:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54KeMtt051961; Mon, 4 Jun 2018 20:40:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806042040.w54KeMtt051961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 4 Jun 2018 20:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r334633 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsserver X-SVN-Commit-Revision: 334633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 20:40:23 -0000 Author: rmacklem Date: Mon Jun 4 20:40:22 2018 New Revision: 334633 URL: https://svnweb.freebsd.org/changeset/base/334633 Log: MFC: r333592 Fix the eir_server_scope reply argument for NFSv4.1 ExchangeID. In the reply to an ExchangeID operation, the NFSv4.1 server returns a "scope" value (eir_server_scope). If this value is the same, it indicates that two servers share state, which is never the case for FreeBSD servers. As such, the value needs to be unique and it was without this patch. However, I just found out that it is not supposed to change when the server reboots and without this patch, it did change. This patch fixes eir_server_scope so that it does not change when the server is rebooted. The only affect not having this patch has is that Linux clients don't reclaim opens and locks after a server reboot, which meant they lost any byte range locks held before the server rebooted. It only affects NFSv4.1 mounts and the FreeBSD NFSv4.1 client was not affected by this bug. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 4 20:39:58 2018 (r334632) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 4 20:40:22 2018 (r334633) @@ -3800,9 +3800,9 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused txdr_hyper(owner_minor, tl); /* Minor */ (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid, strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Major */ - NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED); - *tl++ = txdr_unsigned(NFSX_UNSIGNED); - *tl++ = time_uptime; /* Make scope a unique value. */ + (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid, + strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Scope */ + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(1); (void)nfsm_strtom(nd, "freebsd.org", strlen("freebsd.org")); (void)nfsm_strtom(nd, version, strlen(version)); From owner-svn-src-stable@freebsd.org Mon Jun 4 20:47:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 961E7FF10C3; Mon, 4 Jun 2018 20:47:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D2185984; Mon, 4 Jun 2018 20:47:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F45C12857; Mon, 4 Jun 2018 20:47:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54KlbAC059068; Mon, 4 Jun 2018 20:47:37 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54KlbYb059067; Mon, 4 Jun 2018 20:47:37 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806042047.w54KlbYb059067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 4 Jun 2018 20:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334634 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsclient X-SVN-Commit-Revision: 334634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 20:47:38 -0000 Author: rmacklem Date: Mon Jun 4 20:47:37 2018 New Revision: 334634 URL: https://svnweb.freebsd.org/changeset/base/334634 Log: MFC: r334252 Fix the sleep event for layout recall. The sleep for I/O completion during an NFSv4.1 pNFS layout recall used the wrong event value and could result in the "[nfscl]" thread hung for the mount. This patch fixes the event to be the correct. This bug will only affect NFSv4.1 pnfs mounts and only when the server does a layout recall callback, so it won't affect many. Without the patch, a mount without the "pnfs" option will avoid the problem. Found during testing of the pNFS server. Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clstate.c Mon Jun 4 20:40:22 2018 (r334633) +++ stable/11/sys/fs/nfsclient/nfs_clstate.c Mon Jun 4 20:47:37 2018 (r334634) @@ -2719,7 +2719,7 @@ tryagain2: NFSV4LOCK_LOCK) != 0) { lyp->nfsly_lock.nfslock_lock |= NFSV4LOCK_WANTED; - (void)nfsmsleep(&lyp->nfsly_lock, + nfsmsleep(&lyp->nfsly_lock.nfslock_lock, NFSCLSTATEMUTEXPTR, PZERO, "nfslyp", NULL); goto tryagain2; From owner-svn-src-stable@freebsd.org Mon Jun 4 20:55:26 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2D0FF217A; Mon, 4 Jun 2018 20:55:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C21BA8601F; Mon, 4 Jun 2018 20:55:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A00E8129E5; Mon, 4 Jun 2018 20:55:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w54KtP00066861; Mon, 4 Jun 2018 20:55:25 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w54KtPRu066860; Mon, 4 Jun 2018 20:55:25 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806042055.w54KtPRu066860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 4 Jun 2018 20:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r334635 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsclient X-SVN-Commit-Revision: 334635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 20:55:26 -0000 Author: rmacklem Date: Mon Jun 4 20:55:25 2018 New Revision: 334635 URL: https://svnweb.freebsd.org/changeset/base/334635 Log: MFC: r334252 Fix the sleep event for layout recall. The sleep for I/O completion during an NFSv4.1 pNFS layout recall used the wrong event value and could result in the "[nfscl]" thread hung for the mount. This patch fixes the event to be the correct. This bug will only affect NFSv4.1 pnfs mounts and only when the server does a layout recall callback, so it won't affect many. Without the patch, a mount without the "pnfs" option will avoid the problem. Found during testing of the pNFS server. Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clstate.c Mon Jun 4 20:47:37 2018 (r334634) +++ stable/10/sys/fs/nfsclient/nfs_clstate.c Mon Jun 4 20:55:25 2018 (r334635) @@ -2719,7 +2719,7 @@ tryagain2: NFSV4LOCK_LOCK) != 0) { lyp->nfsly_lock.nfslock_lock |= NFSV4LOCK_WANTED; - (void)nfsmsleep(&lyp->nfsly_lock, + nfsmsleep(&lyp->nfsly_lock.nfslock_lock, NFSCLSTATEMUTEXPTR, PZERO, "nfslyp", NULL); goto tryagain2; From owner-svn-src-stable@freebsd.org Tue Jun 5 13:46:21 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13EAFFDD3DC; Tue, 5 Jun 2018 13:46:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9A30793FC; Tue, 5 Jun 2018 13:46:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97C4B1D3B0; Tue, 5 Jun 2018 13:46:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55DkKPZ082209; Tue, 5 Jun 2018 13:46:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55DkIZX082198; Tue, 5 Jun 2018 13:46:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806051346.w55DkIZX082198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 Jun 2018 13:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334654 - in stable/11: include lib/libc/softfloat/bits64 lib/msun lib/msun/man lib/msun/src X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: include lib/libc/softfloat/bits64 lib/msun lib/msun/man lib/msun/src X-SVN-Commit-Revision: 334654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 13:46:21 -0000 Author: kib Date: Tue Jun 5 13:46:18 2018 New Revision: 334654 URL: https://svnweb.freebsd.org/changeset/base/334654 Log: MFC r333577: Add implementations for clog(3), clogf(3), and clogl(3). PR: 216863 Added: stable/11/lib/msun/man/clog.3 - copied unchanged from r333577, head/lib/msun/man/clog.3 stable/11/lib/msun/src/s_clog.c - copied unchanged from r333577, head/lib/msun/src/s_clog.c stable/11/lib/msun/src/s_clogf.c - copied unchanged from r333577, head/lib/msun/src/s_clogf.c stable/11/lib/msun/src/s_clogl.c - copied unchanged from r333577, head/lib/msun/src/s_clogl.c Modified: stable/11/include/complex.h stable/11/lib/libc/softfloat/bits64/softfloat-macros stable/11/lib/msun/Makefile stable/11/lib/msun/Symbol.map stable/11/lib/msun/man/complex.3 stable/11/lib/msun/src/math_private.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/complex.h ============================================================================== --- stable/11/include/complex.h Tue Jun 5 13:06:06 2018 (r334653) +++ stable/11/include/complex.h Tue Jun 5 13:46:18 2018 (r334654) @@ -87,6 +87,10 @@ float complex cexpf(float complex); double cimag(double complex) __pure2; float cimagf(float complex) __pure2; long double cimagl(long double complex) __pure2; +double complex clog(double complex); +float complex clogf(float complex); +long double complex + clogl(long double complex); double complex conj(double complex) __pure2; float complex conjf(float complex) __pure2; long double complex Modified: stable/11/lib/libc/softfloat/bits64/softfloat-macros ============================================================================== --- stable/11/lib/libc/softfloat/bits64/softfloat-macros Tue Jun 5 13:06:06 2018 (r334653) +++ stable/11/lib/libc/softfloat/bits64/softfloat-macros Tue Jun 5 13:46:18 2018 (r334654) @@ -157,7 +157,7 @@ INLINE void z0 = a0>>count; } else { - z1 = ( count < 64 ) ? ( a0>>( count & 63 ) ) : 0; + z1 = ( count < 128 ) ? ( a0>>( count & 63 ) ) : 0; z0 = 0; } *z1Ptr = z1; Modified: stable/11/lib/msun/Makefile ============================================================================== --- stable/11/lib/msun/Makefile Tue Jun 5 13:06:06 2018 (r334653) +++ stable/11/lib/msun/Makefile Tue Jun 5 13:46:18 2018 (r334654) @@ -57,7 +57,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \ k_cos.c k_cosf.c k_exp.c k_expf.c k_rem_pio2.c k_sin.c k_sinf.c \ k_tan.c k_tanf.c \ s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_carg.c s_cargf.c s_cargl.c \ - s_cbrt.c s_cbrtf.c s_ceil.c s_ceilf.c \ + s_cbrt.c s_cbrtf.c s_ceil.c s_ceilf.c s_clog.c s_clogf.c \ s_copysign.c s_copysignf.c s_cos.c s_cosf.c \ s_csqrt.c s_csqrtf.c s_erf.c s_erff.c \ s_exp2.c s_exp2f.c s_expm1.c s_expm1f.c s_fabsf.c s_fdim.c \ @@ -101,7 +101,8 @@ COMMON_SRCS+= catrigl.c \ e_lgammal.c e_lgammal_r.c \ e_remainderl.c e_sinhl.c e_sqrtl.c \ invtrig.c k_cosl.c k_sinl.c k_tanl.c \ - s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \ + s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c \ + s_clogl.c s_cosl.c s_cprojl.c \ s_csqrtl.c s_erfl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ s_fmaxl.c s_fminl.c s_frexpl.c s_logbl.c s_logl.c s_nanl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ @@ -133,7 +134,8 @@ INCS+= fenv.h math.h MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \ ceil.3 cacos.3 ccos.3 ccosh.3 cexp.3 \ - cimag.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 exp.3 fabs.3 fdim.3 \ + cimag.3 clog.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 \ + exp.3 fabs.3 fdim.3 \ feclearexcept.3 feenableexcept.3 fegetenv.3 \ fegetround.3 fenv.3 floor.3 \ fma.3 fmax.3 fmod.3 hypot.3 ieee.3 ieee_test.3 ilogb.3 j0.3 \ @@ -166,6 +168,7 @@ MLINKS+=cimag.3 cimagf.3 cimag.3 cimagl.3 \ cimag.3 conj.3 cimag.3 conjf.3 cimag.3 conjl.3 \ cimag.3 cproj.3 cimag.3 cprojf.3 cimag.3 cprojl.3 \ cimag.3 creal.3 cimag.3 crealf.3 cimag.3 creall.3 +MLINKS+=clog.3 clogf.3 clog.3 clogl.3 MLINKS+=copysign.3 copysignf.3 copysign.3 copysignl.3 MLINKS+=cos.3 cosf.3 cos.3 cosl.3 MLINKS+=cosh.3 coshf.3 cosh.3 coshl.3 Modified: stable/11/lib/msun/Symbol.map ============================================================================== --- stable/11/lib/msun/Symbol.map Tue Jun 5 13:06:06 2018 (r334653) +++ stable/11/lib/msun/Symbol.map Tue Jun 5 13:46:18 2018 (r334654) @@ -294,6 +294,9 @@ FBSD_1.5 { casinl; catanl; catanhl; + clog; + clogf; + clogl; sincos; sincosf; sincosl; Copied: stable/11/lib/msun/man/clog.3 (from r333577, head/lib/msun/man/clog.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/msun/man/clog.3 Tue Jun 5 13:46:18 2018 (r334654, copy of r333577, head/lib/msun/man/clog.3) @@ -0,0 +1,103 @@ +.\" Copyright (c) 2017 Steven G. Kargl +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 13, 2017 +.Dt CLOG 3 +.Os +.Sh NAME +.Nm clog , +.Nm clogf , +and +.Nm clogl +.Nd complex natural logrithm functions +.Sh LIBRARY +.Lb libm +.Sh SYNOPSIS +.In complex.h +.Ft double complex +.Fn clog "double complex z" +.Ft float complex +.Fn clogf "float complex z" +.Ft long double complex +.Fn clogl "long double complex z" +.Sh DESCRIPTION +The +.Fn clog , +.Fn clogf , +and +.Fn clogl +functions compute the complex natural logrithm of +.Fa z . +with a branch cut along the negative real axis . +.Sh RETURN VALUES +The +.Fn clog +function returns the complex natural logarithm value, in the +range of a strip mathematically unbounded along the real axis and in +the interval [-I* \*(Pi , +I* \*(Pi ] along the imaginary axis. +The function satisfies the relationship: +.Fo clog +.Fn conj "z" Fc += +.Fo conj +.Fn clog "z" Fc . +.Pp + +.\" Table is formatted for an 80-column xterm. +.Bl -column ".Sy +\*(If + I*\*(Na" ".Sy Return value" ".Sy Divide-by-zero exception" +.It Sy Argument Ta Sy Return value Ta Sy Comment +.It -0 + I*0 Ta -\*(If + I*\*(Pi Ta Divide-by-zero exception +.It Ta Ta raised +.It +0 + I*0 Ta -\*(If + I*0 Ta Divide by zero exception +.It Ta Ta raised +.It x + I*\*(If Ta +\*(If + I*\*(Pi/2 Ta For finite x +.It x + I*\*(Na Ta \*(Na + I*\*(Na Ta Optionally raises invalid +.It Ta Ta floating-point exception +.It Ta Ta for finite x +.It -\*(If + I*y Ta +\*(If + I*\*(Pi Ta For finite positive-signed y +.It +\*(If + I*y Ta +\*(If + I*0 Ta For finite positive-signed y +.It -\*(If + I*\*(If Ta +\*(If + I*3\*(Pi/4 +.It +\*(If + I*\*(If Ta +\*(If + I*\*(Pi/4 +.It \*(Pm\*(If + I*\*(Na Ta +\*(If + I*\*(Na +.It \*(Na + I*y Ta \*(Na + I*\*(Na Ta Optionally raises invalid +.It Ta Ta floating-point exception +.It Ta Ta for finite y +.It \*(Na + I*\*(If Ta +\*(If + I*\*(Na +.It \*(Na + I*\*(Na Ta \*(Na + I*\*(Na +.El + +.Sh SEE ALSO +.Xr complex 3 , +.Xr log 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn clog , +.Fn cexpf , +and +.Fn clogl +functions conform to +.St -isoC-99 . Modified: stable/11/lib/msun/man/complex.3 ============================================================================== --- stable/11/lib/msun/man/complex.3 Tue Jun 5 13:06:06 2018 (r334653) +++ stable/11/lib/msun/man/complex.3 Tue Jun 5 13:46:18 2018 (r334654) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2011 +.Dd May 13, 2018 .Dt COMPLEX 3 .Os .Sh NAME @@ -77,6 +77,10 @@ csqrt complex square root .Cl cexp exponential base e .El +.Ss Natural logrithm Function +.Cl +clog natural logrithm +.El .\" Section 7.3.9 of ISO C99 standard .Ss Manipulation Functions .Cl @@ -117,8 +121,6 @@ The functions described here conform to .St -isoC-99 . .Sh BUGS -The logarithmic functions -.Fn clog -and the power functions +The power functions .Fn cpow are not implemented. Modified: stable/11/lib/msun/src/math_private.h ============================================================================== --- stable/11/lib/msun/src/math_private.h Tue Jun 5 13:06:06 2018 (r334653) +++ stable/11/lib/msun/src/math_private.h Tue Jun 5 13:46:18 2018 (r334654) @@ -294,8 +294,9 @@ do { \ /* Support switching the mode to FP_PE if necessary. */ #if defined(__i386__) && !defined(NO_FPSETPREC) -#define ENTERI() \ - long double __retval; \ +#define ENTERI() ENTERIT(long double) +#define ENTERIT(returntype) \ + returntype __retval; \ fp_prec_t __oprec; \ \ if ((__oprec = fpgetprec()) != FP_PE) \ @@ -318,6 +319,7 @@ do { \ } while (0) #else #define ENTERI() +#define ENTERIT(x) #define RETURNI(x) RETURNF(x) #define ENTERV() #define RETURNV() return Copied: stable/11/lib/msun/src/s_clog.c (from r333577, head/lib/msun/src/s_clog.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/msun/src/s_clog.c Tue Jun 5 13:46:18 2018 (r334654, copy of r333577, head/lib/msun/src/s_clog.c) @@ -0,0 +1,155 @@ +/*- + * Copyright (c) 2013 Bruce D. Evans + * 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 unmodified, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +#define MANT_DIG DBL_MANT_DIG +#define MAX_EXP DBL_MAX_EXP +#define MIN_EXP DBL_MIN_EXP + +static const double +ln2_hi = 6.9314718055829871e-1, /* 0x162e42fefa0000.0p-53 */ +ln2_lo = 1.6465949582897082e-12; /* 0x1cf79abc9e3b3a.0p-92 */ + +double complex +clog(double complex z) +{ + double_t ax, ax2h, ax2l, axh, axl, ay, ay2h, ay2l, ayh, ayl, sh, sl, t; + double x, y, v; + uint32_t hax, hay; + int kx, ky; + + x = creal(z); + y = cimag(z); + v = atan2(y, x); + + ax = fabs(x); + ay = fabs(y); + if (ax < ay) { + t = ax; + ax = ay; + ay = t; + } + + GET_HIGH_WORD(hax, ax); + kx = (hax >> 20) - 1023; + GET_HIGH_WORD(hay, ay); + ky = (hay >> 20) - 1023; + + /* Handle NaNs and Infs using the general formula. */ + if (kx == MAX_EXP || ky == MAX_EXP) + return (CMPLX(log(hypot(x, y)), v)); + + /* Avoid spurious underflow, and reduce inaccuracies when ax is 1. */ + if (ax == 1) { + if (ky < (MIN_EXP - 1) / 2) + return (CMPLX((ay / 2) * ay, v)); + return (CMPLX(log1p(ay * ay) / 2, v)); + } + + /* Avoid underflow when ax is not small. Also handle zero args. */ + if (kx - ky > MANT_DIG || ay == 0) + return (CMPLX(log(ax), v)); + + /* Avoid overflow. */ + if (kx >= MAX_EXP - 1) + return (CMPLX(log(hypot(x * 0x1p-1022, y * 0x1p-1022)) + + (MAX_EXP - 2) * ln2_lo + (MAX_EXP - 2) * ln2_hi, v)); + if (kx >= (MAX_EXP - 1) / 2) + return (CMPLX(log(hypot(x, y)), v)); + + /* Reduce inaccuracies and avoid underflow when ax is denormal. */ + if (kx <= MIN_EXP - 2) + return (CMPLX(log(hypot(x * 0x1p1023, y * 0x1p1023)) + + (MIN_EXP - 2) * ln2_lo + (MIN_EXP - 2) * ln2_hi, v)); + + /* Avoid remaining underflows (when ax is small but not denormal). */ + if (ky < (MIN_EXP - 1) / 2 + MANT_DIG) + return (CMPLX(log(hypot(x, y)), v)); + + /* Calculate ax*ax and ay*ay exactly using Dekker's algorithm. */ + t = (double)(ax * (0x1p27 + 1)); + axh = (double)(ax - t) + t; + axl = ax - axh; + ax2h = ax * ax; + ax2l = axh * axh - ax2h + 2 * axh * axl + axl * axl; + t = (double)(ay * (0x1p27 + 1)); + ayh = (double)(ay - t) + t; + ayl = ay - ayh; + ay2h = ay * ay; + ay2l = ayh * ayh - ay2h + 2 * ayh * ayl + ayl * ayl; + + /* + * When log(|z|) is far from 1, accuracy in calculating the sum + * of the squares is not very important since log() reduces + * inaccuracies. We depended on this to use the general + * formula when log(|z|) is very far from 1. When log(|z|) is + * moderately far from 1, we go through the extra-precision + * calculations to reduce branches and gain a little accuracy. + * + * When |z| is near 1, we subtract 1 and use log1p() and don't + * leave it to log() to subtract 1, since we gain at least 1 bit + * of accuracy in this way. + * + * When |z| is very near 1, subtracting 1 can cancel almost + * 3*MANT_DIG bits. We arrange that subtracting 1 is exact in + * doubled precision, and then do the rest of the calculation + * in sloppy doubled precision. Although large cancellations + * often lose lots of accuracy, here the final result is exact + * in doubled precision if the large calculation occurs (because + * then it is exact in tripled precision and the cancellation + * removes enough bits to fit in doubled precision). Thus the + * result is accurate in sloppy doubled precision, and the only + * significant loss of accuracy is when it is summed and passed + * to log1p(). + */ + sh = ax2h; + sl = ay2h; + _2sumF(sh, sl); + if (sh < 0.5 || sh >= 3) + return (CMPLX(log(ay2l + ax2l + sl + sh) / 2, v)); + sh -= 1; + _2sum(sh, sl); + _2sum(ax2l, ay2l); + /* Briggs-Kahan algorithm (except we discard the final low term): */ + _2sum(sh, ax2l); + _2sum(sl, ay2l); + t = ax2l + sl; + _2sumF(sh, t); + return (CMPLX(log1p(ay2l + t + sh) / 2, v)); +} + +#if (LDBL_MANT_DIG == 53) +__weak_reference(clog, clogl); +#endif Copied: stable/11/lib/msun/src/s_clogf.c (from r333577, head/lib/msun/src/s_clogf.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/msun/src/s_clogf.c Tue Jun 5 13:46:18 2018 (r334654, copy of r333577, head/lib/msun/src/s_clogf.c) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2013 Bruce D. Evans + * 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 unmodified, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +#define MANT_DIG FLT_MANT_DIG +#define MAX_EXP FLT_MAX_EXP +#define MIN_EXP FLT_MIN_EXP + +static const float +ln2f_hi = 6.9314575195e-1, /* 0xb17200.0p-24 */ +ln2f_lo = 1.4286067653e-6; /* 0xbfbe8e.0p-43 */ + +float complex +clogf(float complex z) +{ + float_t ax, ax2h, ax2l, axh, axl, ay, ay2h, ay2l, ayh, ayl, sh, sl, t; + float x, y, v; + uint32_t hax, hay; + int kx, ky; + + x = crealf(z); + y = cimagf(z); + v = atan2f(y, x); + + ax = fabsf(x); + ay = fabsf(y); + if (ax < ay) { + t = ax; + ax = ay; + ay = t; + } + + GET_FLOAT_WORD(hax, ax); + kx = (hax >> 23) - 127; + GET_FLOAT_WORD(hay, ay); + ky = (hay >> 23) - 127; + + /* Handle NaNs and Infs using the general formula. */ + if (kx == MAX_EXP || ky == MAX_EXP) + return (CMPLXF(logf(hypotf(x, y)), v)); + + /* Avoid spurious underflow, and reduce inaccuracies when ax is 1. */ + if (hax == 0x3f800000) { + if (ky < (MIN_EXP - 1) / 2) + return (CMPLXF((ay / 2) * ay, v)); + return (CMPLXF(log1pf(ay * ay) / 2, v)); + } + + /* Avoid underflow when ax is not small. Also handle zero args. */ + if (kx - ky > MANT_DIG || hay == 0) + return (CMPLXF(logf(ax), v)); + + /* Avoid overflow. */ + if (kx >= MAX_EXP - 1) + return (CMPLXF(logf(hypotf(x * 0x1p-126F, y * 0x1p-126F)) + + (MAX_EXP - 2) * ln2f_lo + (MAX_EXP - 2) * ln2f_hi, v)); + if (kx >= (MAX_EXP - 1) / 2) + return (CMPLXF(logf(hypotf(x, y)), v)); + + /* Reduce inaccuracies and avoid underflow when ax is denormal. */ + if (kx <= MIN_EXP - 2) + return (CMPLXF(logf(hypotf(x * 0x1p127F, y * 0x1p127F)) + + (MIN_EXP - 2) * ln2f_lo + (MIN_EXP - 2) * ln2f_hi, v)); + + /* Avoid remaining underflows (when ax is small but not denormal). */ + if (ky < (MIN_EXP - 1) / 2 + MANT_DIG) + return (CMPLXF(logf(hypotf(x, y)), v)); + + /* Calculate ax*ax and ay*ay exactly using Dekker's algorithm. */ + t = (float)(ax * (0x1p12F + 1)); + axh = (float)(ax - t) + t; + axl = ax - axh; + ax2h = ax * ax; + ax2l = axh * axh - ax2h + 2 * axh * axl + axl * axl; + t = (float)(ay * (0x1p12F + 1)); + ayh = (float)(ay - t) + t; + ayl = ay - ayh; + ay2h = ay * ay; + ay2l = ayh * ayh - ay2h + 2 * ayh * ayl + ayl * ayl; + + /* + * When log(|z|) is far from 1, accuracy in calculating the sum + * of the squares is not very important since log() reduces + * inaccuracies. We depended on this to use the general + * formula when log(|z|) is very far from 1. When log(|z|) is + * moderately far from 1, we go through the extra-precision + * calculations to reduce branches and gain a little accuracy. + * + * When |z| is near 1, we subtract 1 and use log1p() and don't + * leave it to log() to subtract 1, since we gain at least 1 bit + * of accuracy in this way. + * + * When |z| is very near 1, subtracting 1 can cancel almost + * 3*MANT_DIG bits. We arrange that subtracting 1 is exact in + * doubled precision, and then do the rest of the calculation + * in sloppy doubled precision. Although large cancellations + * often lose lots of accuracy, here the final result is exact + * in doubled precision if the large calculation occurs (because + * then it is exact in tripled precision and the cancellation + * removes enough bits to fit in doubled precision). Thus the + * result is accurate in sloppy doubled precision, and the only + * significant loss of accuracy is when it is summed and passed + * to log1p(). + */ + sh = ax2h; + sl = ay2h; + _2sumF(sh, sl); + if (sh < 0.5F || sh >= 3) + return (CMPLXF(logf(ay2l + ax2l + sl + sh) / 2, v)); + sh -= 1; + _2sum(sh, sl); + _2sum(ax2l, ay2l); + /* Briggs-Kahan algorithm (except we discard the final low term): */ + _2sum(sh, ax2l); + _2sum(sl, ay2l); + t = ax2l + sl; + _2sumF(sh, t); + return (CMPLXF(log1pf(ay2l + t + sh) / 2, v)); +} Copied: stable/11/lib/msun/src/s_clogl.c (from r333577, head/lib/msun/src/s_clogl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/msun/src/s_clogl.c Tue Jun 5 13:46:18 2018 (r334654, copy of r333577, head/lib/msun/src/s_clogl.c) @@ -0,0 +1,168 @@ +/*- + * Copyright (c) 2013 Bruce D. Evans + * 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 unmodified, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#ifdef __i386__ +#include +#endif + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +#define MANT_DIG LDBL_MANT_DIG +#define MAX_EXP LDBL_MAX_EXP +#define MIN_EXP LDBL_MIN_EXP + +static const double +ln2_hi = 6.9314718055829871e-1; /* 0x162e42fefa0000.0p-53 */ + +#if LDBL_MANT_DIG == 64 +#define MULT_REDUX 0x1p32 /* exponent MANT_DIG / 2 rounded up */ +static const double +ln2l_lo = 1.6465949582897082e-12; /* 0x1cf79abc9e3b3a.0p-92 */ +#elif LDBL_MANT_DIG == 113 +#define MULT_REDUX 0x1p57 +static const long double +ln2l_lo = 1.64659495828970812809844307550013433e-12L; /* 0x1cf79abc9e3b39803f2f6af40f343.0p-152L */ +#else +#error "Unsupported long double format" +#endif + +long double complex +clogl(long double complex z) +{ + long double ax, ax2h, ax2l, axh, axl, ay, ay2h, ay2l, ayh, ayl; + long double sh, sl, t; + long double x, y, v; + uint16_t hax, hay; + int kx, ky; + + ENTERIT(long double complex); + + x = creall(z); + y = cimagl(z); + v = atan2l(y, x); + + ax = fabsl(x); + ay = fabsl(y); + if (ax < ay) { + t = ax; + ax = ay; + ay = t; + } + + GET_LDBL_EXPSIGN(hax, ax); + kx = hax - 16383; + GET_LDBL_EXPSIGN(hay, ay); + ky = hay - 16383; + + /* Handle NaNs and Infs using the general formula. */ + if (kx == MAX_EXP || ky == MAX_EXP) + RETURNI(CMPLXL(logl(hypotl(x, y)), v)); + + /* Avoid spurious underflow, and reduce inaccuracies when ax is 1. */ + if (ax == 1) { + if (ky < (MIN_EXP - 1) / 2) + RETURNI(CMPLXL((ay / 2) * ay, v)); + RETURNI(CMPLXL(log1pl(ay * ay) / 2, v)); + } + + /* Avoid underflow when ax is not small. Also handle zero args. */ + if (kx - ky > MANT_DIG || ay == 0) + RETURNI(CMPLXL(logl(ax), v)); + + /* Avoid overflow. */ + if (kx >= MAX_EXP - 1) + RETURNI(CMPLXL(logl(hypotl(x * 0x1p-16382L, y * 0x1p-16382L)) + + (MAX_EXP - 2) * ln2l_lo + (MAX_EXP - 2) * ln2_hi, v)); + if (kx >= (MAX_EXP - 1) / 2) + RETURNI(CMPLXL(logl(hypotl(x, y)), v)); + + /* Reduce inaccuracies and avoid underflow when ax is denormal. */ + if (kx <= MIN_EXP - 2) + RETURNI(CMPLXL(logl(hypotl(x * 0x1p16383L, y * 0x1p16383L)) + + (MIN_EXP - 2) * ln2l_lo + (MIN_EXP - 2) * ln2_hi, v)); + + /* Avoid remaining underflows (when ax is small but not denormal). */ + if (ky < (MIN_EXP - 1) / 2 + MANT_DIG) + RETURNI(CMPLXL(logl(hypotl(x, y)), v)); + + /* Calculate ax*ax and ay*ay exactly using Dekker's algorithm. */ + t = (long double)(ax * (MULT_REDUX + 1)); + axh = (long double)(ax - t) + t; + axl = ax - axh; + ax2h = ax * ax; + ax2l = axh * axh - ax2h + 2 * axh * axl + axl * axl; + t = (long double)(ay * (MULT_REDUX + 1)); + ayh = (long double)(ay - t) + t; + ayl = ay - ayh; + ay2h = ay * ay; + ay2l = ayh * ayh - ay2h + 2 * ayh * ayl + ayl * ayl; + + /* + * When log(|z|) is far from 1, accuracy in calculating the sum + * of the squares is not very important since log() reduces + * inaccuracies. We depended on this to use the general + * formula when log(|z|) is very far from 1. When log(|z|) is + * moderately far from 1, we go through the extra-precision + * calculations to reduce branches and gain a little accuracy. + * + * When |z| is near 1, we subtract 1 and use log1p() and don't + * leave it to log() to subtract 1, since we gain at least 1 bit + * of accuracy in this way. + * + * When |z| is very near 1, subtracting 1 can cancel almost + * 3*MANT_DIG bits. We arrange that subtracting 1 is exact in + * doubled precision, and then do the rest of the calculation + * in sloppy doubled precision. Although large cancellations + * often lose lots of accuracy, here the final result is exact + * in doubled precision if the large calculation occurs (because + * then it is exact in tripled precision and the cancellation + * removes enough bits to fit in doubled precision). Thus the + * result is accurate in sloppy doubled precision, and the only + * significant loss of accuracy is when it is summed and passed + * to log1p(). + */ + sh = ax2h; + sl = ay2h; + _2sumF(sh, sl); + if (sh < 0.5 || sh >= 3) + RETURNI(CMPLXL(logl(ay2l + ax2l + sl + sh) / 2, v)); + sh -= 1; + _2sum(sh, sl); + _2sum(ax2l, ay2l); + /* Briggs-Kahan algorithm (except we discard the final low term): */ + _2sum(sh, ax2l); + _2sum(sl, ay2l); + t = ax2l + sl; + _2sumF(sh, t); + RETURNI(CMPLXL(log1pl(ay2l + t + sh) / 2, v)); +} From owner-svn-src-stable@freebsd.org Tue Jun 5 13:53:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAEF4FDE5E9; Tue, 5 Jun 2018 13:53:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C5AB79C7B; Tue, 5 Jun 2018 13:53:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 446121D541; Tue, 5 Jun 2018 13:53:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55DrchR087345; Tue, 5 Jun 2018 13:53:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55Drb7X087344; Tue, 5 Jun 2018 13:53:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806051353.w55Drb7X087344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 Jun 2018 13:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334655 - stable/11/lib/libc/stdio X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/stdio X-SVN-Commit-Revision: 334655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 13:53:39 -0000 Author: kib Date: Tue Jun 5 13:53:37 2018 New Revision: 334655 URL: https://svnweb.freebsd.org/changeset/base/334655 Log: MFC r334031: Implement printf(3) family %m format string extension. Modified: stable/11/lib/libc/stdio/printf.3 stable/11/lib/libc/stdio/vfprintf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdio/printf.3 ============================================================================== --- stable/11/lib/libc/stdio/printf.3 Tue Jun 5 13:46:18 2018 (r334654) +++ stable/11/lib/libc/stdio/printf.3 Tue Jun 5 13:53:37 2018 (r334655) @@ -32,7 +32,7 @@ .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 2, 2009 +.Dd May 22, 2018 .Dt PRINTF 3 .Os .Sh NAME @@ -642,6 +642,12 @@ integer indicated by the .Vt "int *" (or variant) pointer argument. No argument is converted. +.It Cm m +Print the string representation of the error code stored in the +.Dv errno +variable at the beginning of the call, as returned by +.Xr strerror 3 . +No argument is taken. .It Cm % A .Ql % @@ -749,6 +755,12 @@ and .Cm \&%U are not standard and are provided only for backward compatibility. +The conversion format +.Cm \&%m +is also not standard and provides the popular extension from the +.Tn GNU C +library. +.Pp The effect of padding the .Cm %p format with zeros (either by the @@ -786,9 +798,11 @@ or the return value would be too large to be represent .El .Sh SEE ALSO .Xr printf 1 , +.Xr errno 2 , .Xr fmtcheck 3 , .Xr scanf 3 , .Xr setlocale 3 , +.Xr strerror 3 , .Xr wprintf 3 .Sh STANDARDS Subject to the caveats noted in the @@ -841,6 +855,12 @@ and .Fn vdprintf functions were added in .Fx 8.0 . +The +.Cm \&%m +format extension first appeared in the +.Tn GNU C +library, and was implemented in +.Fx 12.0 . .Sh BUGS The .Nm Modified: stable/11/lib/libc/stdio/vfprintf.c ============================================================================== --- stable/11/lib/libc/stdio/vfprintf.c Tue Jun 5 13:46:18 2018 (r334654) +++ stable/11/lib/libc/stdio/vfprintf.c Tue Jun 5 13:53:37 2018 (r334655) @@ -315,6 +315,7 @@ __vfprintf(FILE *fp, locale_t locale, const char *fmt0 int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ + int saved_errno; char sign; /* sign prefix (' ', '+', '-', or \0) */ struct grouping_state gs; /* thousands' grouping info */ @@ -464,6 +465,7 @@ __vfprintf(FILE *fp, locale_t locale, const char *fmt0 savserr = fp->_flags & __SERR; fp->_flags &= ~__SERR; + saved_errno = errno; convbuf = NULL; fmt = (char *)fmt0; argtable = NULL; @@ -774,6 +776,11 @@ fp_common: } break; #endif /* !NO_FLOATING_POINT */ + case 'm': + cp = strerror(saved_errno); + size = (prec >= 0) ? strnlen(cp, prec) : strlen(cp); + sign = '\0'; + break; case 'n': /* * Assignment-like behavior is specified if the From owner-svn-src-stable@freebsd.org Wed Jun 6 00:59:44 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEE8AFD5815; Wed, 6 Jun 2018 00:59:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7257CB26; Wed, 6 Jun 2018 00:59:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A67623E79; Wed, 6 Jun 2018 00:59:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w560xiW3028185; Wed, 6 Jun 2018 00:59:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w560xi3J028184; Wed, 6 Jun 2018 00:59:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806060059.w560xi3J028184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 6 Jun 2018 00:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334697 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 334697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 00:59:44 -0000 Author: markj Date: Wed Jun 6 00:59:43 2018 New Revision: 334697 URL: https://svnweb.freebsd.org/changeset/base/334697 Log: MFC r334389: Typo. PR: 228533 Modified: stable/11/sys/vm/vm_fault.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_fault.c ============================================================================== --- stable/11/sys/vm/vm_fault.c Tue Jun 5 22:27:36 2018 (r334696) +++ stable/11/sys/vm/vm_fault.c Wed Jun 6 00:59:43 2018 (r334697) @@ -1647,7 +1647,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map * range, copying each page from the source object to the * destination object. Since the source is wired, those pages * must exist. In contrast, the destination is pageable. - * Since the destination object does share any backing storage + * Since the destination object doesn't share any backing storage * with the source object, all of its pages must be dirtied, * regardless of whether they can be written. */ From owner-svn-src-stable@freebsd.org Wed Jun 6 01:21:34 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95C31FDB471; Wed, 6 Jun 2018 01:21:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BAC37D7F3; Wed, 6 Jun 2018 01:21:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CB02242DA; Wed, 6 Jun 2018 01:21:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w561LX7V040005; Wed, 6 Jun 2018 01:21:33 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w561LXBX040004; Wed, 6 Jun 2018 01:21:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806060121.w561LXBX040004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 6 Jun 2018 01:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334698 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 334698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 01:21:34 -0000 Author: rmacklem Date: Wed Jun 6 01:21:33 2018 New Revision: 334698 URL: https://svnweb.freebsd.org/changeset/base/334698 Log: MFC: r334396 Strengthen locking for the NFSv4.1 server DestroySession operation. If a client did a DestroySession on a session while it was still in use, the server might try to use the session structure after it is free'd. I think the client has violated RFC5661 if it does this, but this patch makes DestroySession block all other nfsd threads so no thread could be using the session when it is free'd. After the DestroySession, nfsd threads will not be able to find the session. The patch also adds a check for nd_sessionid being set, although if that was not the case it would have been all 0s and unlikely to have a false match. This might fix the crashes described in PR#228497 for the FreeNAS server. PR: 228497 Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jun 6 00:59:43 2018 (r334697) +++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jun 6 01:21:33 2018 (r334698) @@ -5946,17 +5946,32 @@ nfsrv_findsession(uint8_t *sessionid) int nfsrv_destroysession(struct nfsrv_descript *nd, uint8_t *sessionid) { - int error, samesess; + int error, igotlock, samesess; samesess = 0; - if (!NFSBCMP(sessionid, nd->nd_sessionid, NFSX_V4SESSIONID)) { + if (!NFSBCMP(sessionid, nd->nd_sessionid, NFSX_V4SESSIONID) && + (nd->nd_flag & ND_HASSEQUENCE) != 0) { samesess = 1; if ((nd->nd_flag & ND_LASTOP) == 0) return (NFSERR_BADSESSION); } + + /* Lock out other nfsd threads */ + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (igotlock == 0); + NFSUNLOCKV4ROOTMUTEX(); + error = nfsrv_freesession(NULL, sessionid); if (error == 0 && samesess != 0) nd->nd_flag &= ~ND_HASSEQUENCE; + + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); return (error); } From owner-svn-src-stable@freebsd.org Wed Jun 6 01:30:49 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9201CFDBA0B; Wed, 6 Jun 2018 01:30:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EA0B7DABE; Wed, 6 Jun 2018 01:30:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FEEB24346; Wed, 6 Jun 2018 01:30:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w561UnOB044171; Wed, 6 Jun 2018 01:30:49 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w561UnSd044170; Wed, 6 Jun 2018 01:30:49 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806060130.w561UnSd044170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 6 Jun 2018 01:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r334699 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsserver X-SVN-Commit-Revision: 334699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 01:30:49 -0000 Author: rmacklem Date: Wed Jun 6 01:30:48 2018 New Revision: 334699 URL: https://svnweb.freebsd.org/changeset/base/334699 Log: MFC: r334396 Strengthen locking for the NFSv4.1 server DestroySession operation. If a client did a DestroySession on a session while it was still in use, the server might try to use the session structure after it is free'd. I think the client has violated RFC5661 if it does this, but this patch makes DestroySession block all other nfsd threads so no thread could be using the session when it is free'd. After the DestroySession, nfsd threads will not be able to find the session. The patch also adds a check for nd_sessionid being set, although if that was not the case it would have been all 0s and unlikely to have a false match. This might fix the crashes described in PR#228497 for the FreeNAS server. PR: 228497 Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jun 6 01:21:33 2018 (r334698) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jun 6 01:30:48 2018 (r334699) @@ -5938,17 +5938,32 @@ nfsrv_findsession(uint8_t *sessionid) int nfsrv_destroysession(struct nfsrv_descript *nd, uint8_t *sessionid) { - int error, samesess; + int error, igotlock, samesess; samesess = 0; - if (!NFSBCMP(sessionid, nd->nd_sessionid, NFSX_V4SESSIONID)) { + if (!NFSBCMP(sessionid, nd->nd_sessionid, NFSX_V4SESSIONID) && + (nd->nd_flag & ND_HASSEQUENCE) != 0) { samesess = 1; if ((nd->nd_flag & ND_LASTOP) == 0) return (NFSERR_BADSESSION); } + + /* Lock out other nfsd threads */ + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (igotlock == 0); + NFSUNLOCKV4ROOTMUTEX(); + error = nfsrv_freesession(NULL, sessionid); if (error == 0 && samesess != 0) nd->nd_flag &= ~ND_HASSEQUENCE; + + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); return (error); } From owner-svn-src-stable@freebsd.org Wed Jun 6 19:48:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44DDAFE04B8; Wed, 6 Jun 2018 19:48:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAF49843E0; Wed, 6 Jun 2018 19:48:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C78C57704; Wed, 6 Jun 2018 19:48:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56Jmd1Z001208; Wed, 6 Jun 2018 19:48:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56JmdCF001207; Wed, 6 Jun 2018 19:48:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806061948.w56JmdCF001207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 6 Jun 2018 19:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334727 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 334727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 19:48:40 -0000 Author: tuexen Date: Wed Jun 6 19:48:39 2018 New Revision: 334727 URL: https://svnweb.freebsd.org/changeset/base/334727 Log: MFC r333178: Simplify the call to tcp_drop(), since the handling of soft error is also done in tcp_drop(). No functional change. Sponsored by: Netflix, Inc. Modified: stable/11/sys/netinet/tcp_timer.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_timer.c ============================================================================== --- stable/11/sys/netinet/tcp_timer.c Wed Jun 6 19:36:37 2018 (r334726) +++ stable/11/sys/netinet/tcp_timer.c Wed Jun 6 19:48:39 2018 (r334727) @@ -619,8 +619,7 @@ tcp_timer_rexmt(void * xtp) tp->t_rxtshift = TCP_MAXRXTSHIFT; TCPSTAT_INC(tcps_timeoutdrop); - tp = tcp_drop(tp, tp->t_softerror ? - tp->t_softerror : ETIMEDOUT); + tp = tcp_drop(tp, ETIMEDOUT); headlocked = 1; goto out; } From owner-svn-src-stable@freebsd.org Wed Jun 6 19:51:55 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6F7AFE0981; Wed, 6 Jun 2018 19:51:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BAD2848A0; Wed, 6 Jun 2018 19:51:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E1ED7864; Wed, 6 Jun 2018 19:51:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56JptB9004494; Wed, 6 Jun 2018 19:51:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56Jptf2004493; Wed, 6 Jun 2018 19:51:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806061951.w56Jptf2004493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 6 Jun 2018 19:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334728 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 334728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 19:51:55 -0000 Author: tuexen Date: Wed Jun 6 19:51:55 2018 New Revision: 334728 URL: https://svnweb.freebsd.org/changeset/base/334728 Log: MFC r333304: Ensure we are not dereferencing a NULL pointer. CID: 1385266 Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Wed Jun 6 19:48:39 2018 (r334727) +++ stable/11/sys/netinet/sctp_indata.c Wed Jun 6 19:51:55 2018 (r334728) @@ -3619,7 +3619,9 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru SCTP_SO_NOT_LOCKED); } /* Make sure to flag we had a FR */ - tp1->whoTo->net_ack++; + if (tp1->whoTo != NULL) { + tp1->whoTo->net_ack++; + } continue; } } From owner-svn-src-stable@freebsd.org Wed Jun 6 19:56:20 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C645FE0BD8; Wed, 6 Jun 2018 19:56:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AAF584AE4; Wed, 6 Jun 2018 19:56:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3DFB7893; Wed, 6 Jun 2018 19:56:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56JuJ9d006206; Wed, 6 Jun 2018 19:56:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56JuJ2p006205; Wed, 6 Jun 2018 19:56:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806061956.w56JuJ2p006205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 6 Jun 2018 19:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334729 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 334729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 19:56:20 -0000 Author: tuexen Date: Wed Jun 6 19:56:19 2018 New Revision: 334729 URL: https://svnweb.freebsd.org/changeset/base/334729 Log: MFC r333603: 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 r334286: Use correct mask. Introduced in https://svnweb.freebsd.org/changeset/base/333603. Thanks to Irene Ruengler for testing and reporting the issue. Modified: stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Wed Jun 6 19:51:55 2018 (r334728) +++ stable/11/sys/netinet/sctputil.c Wed Jun 6 19:56:19 2018 (r334729) @@ -756,8 +756,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, @@ -766,29 +766,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 &= 0xfffffffc; if (val <= sctp_mtu_sizes[0]) { return (val); } @@ -797,12 +800,16 @@ sctp_get_prev_mtu(uint32_t val) break; } } + KASSERT((sctp_mtu_sizes[i - 1] & 0x00000003) == 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) @@ -810,8 +817,11 @@ sctp_get_next_mtu(uint32_t val) /* select another MTU that is just bigger than this one */ uint32_t i; + val &= 0xfffffffc; for (i = 0; i < (sizeof(sctp_mtu_sizes) / sizeof(uint32_t)); i++) { if (val < sctp_mtu_sizes[i]) { + KASSERT((sctp_mtu_sizes[i] & 0x00000003) == 0, + ("sctp_mtu_sizes[%u] not a multiple of 4", i)); return (sctp_mtu_sizes[i]); } } From owner-svn-src-stable@freebsd.org Wed Jun 6 20:00:22 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA99CFE0E16; Wed, 6 Jun 2018 20:00:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87C3784D08; Wed, 6 Jun 2018 20:00:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64C917898; Wed, 6 Jun 2018 20:00:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56K0MYE006464; Wed, 6 Jun 2018 20:00:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56K0MaR006463; Wed, 6 Jun 2018 20:00:22 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806062000.w56K0MaR006463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 6 Jun 2018 20:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334730 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 334730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 20:00:23 -0000 Author: tuexen Date: Wed Jun 6 20:00:21 2018 New Revision: 334730 URL: https://svnweb.freebsd.org/changeset/base/334730 Log: MFC r334494: Ensure net.inet.tcp.syncache.rexmtlimit is limited by TCP_MAXRXTSHIFT. If the sysctl variable is set to a value larger than TCP_MAXRXTSHIFT+1, the array tcp_syn_backoff[] is accessed out of bounds. Discussed with: jtl@ Sponsored by: Netflix, Inc. Modified: stable/11/sys/netinet/tcp_syncache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_syncache.c ============================================================================== --- stable/11/sys/netinet/tcp_syncache.c Wed Jun 6 19:56:19 2018 (r334729) +++ stable/11/sys/netinet/tcp_syncache.c Wed Jun 6 20:00:21 2018 (r334730) @@ -175,8 +175,27 @@ SYSCTL_UINT(_net_inet_tcp_syncache, OID_AUTO, hashsize &VNET_NAME(tcp_syncache.hashsize), 0, "Size of TCP syncache hashtable"); -SYSCTL_UINT(_net_inet_tcp_syncache, OID_AUTO, rexmtlimit, CTLFLAG_VNET | CTLFLAG_RW, +static int +sysctl_net_inet_tcp_syncache_rexmtlimit_check(SYSCTL_HANDLER_ARGS) +{ + int error; + u_int new; + + new = V_tcp_syncache.rexmt_limit; + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && (req->newptr != NULL)) { + if (new > TCP_MAXRXTSHIFT) + error = EINVAL; + else + V_tcp_syncache.rexmt_limit = new; + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp_syncache, OID_AUTO, rexmtlimit, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(tcp_syncache.rexmt_limit), 0, + sysctl_net_inet_tcp_syncache_rexmtlimit_check, "UI", "Limit on SYN/ACK retransmissions"); VNET_DEFINE(int, tcp_sc_rst_sock_fail) = 1; From owner-svn-src-stable@freebsd.org Wed Jun 6 20:02:06 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABA62FE1030; Wed, 6 Jun 2018 20:02:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59E7885084; Wed, 6 Jun 2018 20:02:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A9887A13; Wed, 6 Jun 2018 20:02:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56K26eI011511; Wed, 6 Jun 2018 20:02:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56K261O011510; Wed, 6 Jun 2018 20:02:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806062002.w56K261O011510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 6 Jun 2018 20:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334731 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 334731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 20:02:06 -0000 Author: tuexen Date: Wed Jun 6 20:02:05 2018 New Revision: 334731 URL: https://svnweb.freebsd.org/changeset/base/334731 Log: MFC r334497: Limit the retransmission timer for SYN-ACKs by TCPTV_REXMTMAX. Use the same logic to handle the SYN-ACK retransmission when sent from the syn cache code as when sent from the main code. Sponsored by: Netflix, Inc. Modified: stable/11/sys/netinet/tcp_syncache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_syncache.c ============================================================================== --- stable/11/sys/netinet/tcp_syncache.c Wed Jun 6 20:00:21 2018 (r334730) +++ stable/11/sys/netinet/tcp_syncache.c Wed Jun 6 20:02:05 2018 (r334731) @@ -407,8 +407,14 @@ syncache_drop(struct syncache *sc, struct syncache_hea static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout) { - sc->sc_rxttime = ticks + - TCPTV_RTOBASE * (tcp_syn_backoff[sc->sc_rxmits]); + int rexmt; + + if (sc->sc_rxmits == 0) + rexmt = TCPTV_RTOBASE; + else + TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_syn_backoff[sc->sc_rxmits], + tcp_rexmit_min, TCPTV_REXMTMAX); + sc->sc_rxttime = ticks + rexmt; sc->sc_rxmits++; if (TSTMP_LT(sc->sc_rxttime, sch->sch_nextc)) { sch->sch_nextc = sc->sc_rxttime; From owner-svn-src-stable@freebsd.org Wed Jun 6 20:03:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54974FE11E8; Wed, 6 Jun 2018 20:03:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29C338526D; Wed, 6 Jun 2018 20:03:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C7A47A33; Wed, 6 Jun 2018 20:03:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56K3ZTi011617; Wed, 6 Jun 2018 20:03:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56K3ZGc011616; Wed, 6 Jun 2018 20:03:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806062003.w56K3ZGc011616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 6 Jun 2018 20:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334732 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 334732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 20:03:36 -0000 Author: tuexen Date: Wed Jun 6 20:03:35 2018 New Revision: 334732 URL: https://svnweb.freebsd.org/changeset/base/334732 Log: MFC r334532: Don't overflow a buffer if we receive an INIT or INIT-ACK chunk without a RANDOM parameter but with a CHUNKS or HMAC-ALGO parameter. Please note that sending this combination violates the specification. Thanks to Ronald E. Crane for reporting the issue for the userland stack. Modified: stable/11/sys/netinet/sctp_auth.c stable/11/sys/netinet/sctp_pcb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_auth.c ============================================================================== --- stable/11/sys/netinet/sctp_auth.c Wed Jun 6 20:02:05 2018 (r334731) +++ stable/11/sys/netinet/sctp_auth.c Wed Jun 6 20:03:35 2018 (r334732) @@ -1502,6 +1502,8 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, str if (p_random != NULL) { keylen = sizeof(*p_random) + random_len; memcpy(new_key->key, p_random, keylen); + } else { + keylen = 0; } /* append in the AUTH chunks */ if (chunks != NULL) { Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Wed Jun 6 20:02:05 2018 (r334731) +++ stable/11/sys/netinet/sctp_pcb.c Wed Jun 6 20:03:35 2018 (r334732) @@ -6702,6 +6702,8 @@ next_param: if (p_random != NULL) { keylen = sizeof(*p_random) + random_len; memcpy(new_key->key, p_random, keylen); + } else { + keylen = 0; } /* append in the AUTH chunks */ if (chunks != NULL) { From owner-svn-src-stable@freebsd.org Wed Jun 6 22:02:21 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8E64FE4962; Wed, 6 Jun 2018 22:02:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57FA6690AA; Wed, 6 Jun 2018 22:02:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3920610CFD; Wed, 6 Jun 2018 22:02:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56M2L5G069540; Wed, 6 Jun 2018 22:02:21 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56M2LnQ069539; Wed, 6 Jun 2018 22:02:21 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806062202.w56M2LnQ069539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 6 Jun 2018 22:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334739 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 334739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 22:02:21 -0000 Author: rmacklem Date: Wed Jun 6 22:02:20 2018 New Revision: 334739 URL: https://svnweb.freebsd.org/changeset/base/334739 Log: MFC: r333580 Fix a slow leak of session structures in the NFSv4.1 server. For a fairly rare case of a client doing an ExchangeID after a hard reboot, the old confirmed clientid still exists, but some clients use a new co_verifier. For this case, the server was not freeing up the sessions on the old confirmed clientid. This patch fixes this case. It also adds two LIST_INIT() macros, which are actually no-ops, since the structure is malloc()d with M_ZERO so the pointer is already set to NULL. It should have minimal impact, since the only way I could exercise this code path was by doing a hard power cycle (pulling the plus) on a machine running Linux with a NFSv4.1 mount on the server. Originally spotted during testing of the ESXi 6.5 client. PR: 228497 Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jun 6 21:32:49 2018 (r334738) +++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jun 6 22:02:20 2018 (r334739) @@ -178,9 +178,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc nfsquad_t *clientidp, nfsquad_t *confirmp, NFSPROC_T *p) { struct nfsclient *clp = NULL, *new_clp = *new_clpp; - int i, error = 0; + int i, error = 0, ret; struct nfsstate *stp, *tstp; struct sockaddr_in *sad, *rad; + struct nfsdsession *sep, *nsep; int zapit = 0, gotit, hasstate = 0, igotlock; static u_int64_t confirm_index = 0; @@ -350,6 +351,15 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc * can be thrown away once the SETCLIENTID_CONFIRM occurs. */ LIST_REMOVE(clp, lc_hash); + + /* Get rid of all sessions on this clientid. */ + LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { + ret = nfsrv_freesession(sep, NULL); + if (ret != 0) + printf("nfsrv_setclient: verifier changed free" + " session failed=%d\n", ret); + } + new_clp->lc_flags |= LCL_NEEDSCONFIRM; if ((nd->nd_flag & ND_NFSV41) != 0) new_clp->lc_confirm.lval[0] = confirmp->lval[0] = @@ -385,6 +395,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } + LIST_INIT(&new_clp->lc_session); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); nfsstatsv1.srvclients++; @@ -449,6 +460,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } + LIST_INIT(&new_clp->lc_session); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); nfsstatsv1.srvclients++; From owner-svn-src-stable@freebsd.org Wed Jun 6 22:18:25 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E2C5FE4FCD; Wed, 6 Jun 2018 22:18:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDF58698E3; Wed, 6 Jun 2018 22:18:24 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86EEB10EB3; Wed, 6 Jun 2018 22:18:24 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56MIOFR077173; Wed, 6 Jun 2018 22:18:24 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56MIOVQ077172; Wed, 6 Jun 2018 22:18:24 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806062218.w56MIOVQ077172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 6 Jun 2018 22:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r334741 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsserver X-SVN-Commit-Revision: 334741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 22:18:25 -0000 Author: rmacklem Date: Wed Jun 6 22:18:24 2018 New Revision: 334741 URL: https://svnweb.freebsd.org/changeset/base/334741 Log: MFC: r333580 Fix a slow leak of session structures in the NFSv4.1 server. For a fairly rare case of a client doing an ExchangeID after a hard reboot, the old confirmed clientid still exists, but some clients use a new co_verifier. For this case, the server was not freeing up the sessions on the old confirmed clientid. This patch fixes this case. It also adds two LIST_INIT() macros, which are actually no-ops, since the structure is malloc()d with M_ZERO so the pointer is already set to NULL. It should have minimal impact, since the only way I could exercise this code path was by doing a hard power cycle (pulling the plus) on a machine running Linux with a NFSv4.1 mount on the server. Originally spotted during testing of the ESXi 6.5 client. PR: 228497 Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jun 6 22:02:44 2018 (r334740) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Wed Jun 6 22:18:24 2018 (r334741) @@ -183,9 +183,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc nfsquad_t *clientidp, nfsquad_t *confirmp, NFSPROC_T *p) { struct nfsclient *clp = NULL, *new_clp = *new_clpp; - int i, error = 0; + int i, error = 0, ret; struct nfsstate *stp, *tstp; struct sockaddr_in *sad, *rad; + struct nfsdsession *sep, *nsep; int zapit = 0, gotit, hasstate = 0, igotlock; static u_int64_t confirm_index = 0; @@ -355,6 +356,15 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc * can be thrown away once the SETCLIENTID_CONFIRM occurs. */ LIST_REMOVE(clp, lc_hash); + + /* Get rid of all sessions on this clientid. */ + LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { + ret = nfsrv_freesession(sep, NULL); + if (ret != 0) + printf("nfsrv_setclient: verifier changed free" + " session failed=%d\n", ret); + } + new_clp->lc_flags |= LCL_NEEDSCONFIRM; if ((nd->nd_flag & ND_NFSV41) != 0) new_clp->lc_confirm.lval[0] = confirmp->lval[0] = @@ -390,6 +400,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } + LIST_INIT(&new_clp->lc_session); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); newnfsstats.srvclients++; @@ -454,6 +465,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } + LIST_INIT(&new_clp->lc_session); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); newnfsstats.srvclients++; From owner-svn-src-stable@freebsd.org Wed Jun 6 22:29:23 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3728EFE539E; Wed, 6 Jun 2018 22:29:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB31A69DA0; Wed, 6 Jun 2018 22:29:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DD6711041; Wed, 6 Jun 2018 22:29:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w56MTMtj082486; Wed, 6 Jun 2018 22:29:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w56MTMkg082484; Wed, 6 Jun 2018 22:29:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201806062229.w56MTMkg082484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 6 Jun 2018 22:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334742 - stable/11/sys/fs/msdosfs X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/fs/msdosfs X-SVN-Commit-Revision: 334742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2018 22:29:23 -0000 Author: pfg Date: Wed Jun 6 22:29:21 2018 New Revision: 334742 URL: https://svnweb.freebsd.org/changeset/base/334742 Log: MFC r333311: msdosfs: use vfs_timestamp() to generate timestamps instead of getnanotime(). Most filesystems, with the notable exceptions of msdosfs and autofs use only vfs_timestamp() to read the current time. This has the benefit of configurable granularity (using the vfs.timestamp_precision sysctl). For convenience, use it on msdosfs too. Submitted by: Damjan Jovanovic Modified: stable/11/sys/fs/msdosfs/msdosfs_denode.c stable/11/sys/fs/msdosfs/msdosfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- stable/11/sys/fs/msdosfs/msdosfs_denode.c Wed Jun 6 22:18:24 2018 (r334741) +++ stable/11/sys/fs/msdosfs/msdosfs_denode.c Wed Jun 6 22:29:21 2018 (r334742) @@ -295,7 +295,7 @@ deupdat(struct denode *dep, int waitfor) DE_MODIFIED); return (0); } - getnanotime(&ts); + vfs_timestamp(&ts); DETIMES(dep, &ts, &ts, &ts); if ((dep->de_flag & DE_MODIFIED) == 0 && waitfor == 0) return (0); Modified: stable/11/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/11/sys/fs/msdosfs/msdosfs_vnops.c Wed Jun 6 22:18:24 2018 (r334741) +++ stable/11/sys/fs/msdosfs/msdosfs_vnops.c Wed Jun 6 22:29:21 2018 (r334742) @@ -176,7 +176,7 @@ msdosfs_create(struct vop_create_args *ap) ndirent.de_FileSize = 0; ndirent.de_pmp = pdep->de_pmp; ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE; - getnanotime(&ts); + vfs_timestamp(&ts); DETIMES(&ndirent, &ts, &ts, &ts); error = createde(&ndirent, pdep, &dep, cnp); if (error) @@ -214,7 +214,7 @@ msdosfs_close(struct vop_close_args *ap) VI_LOCK(vp); if (vp->v_usecount > 1) { - getnanotime(&ts); + vfs_timestamp(&ts); DETIMES(dep, &ts, &ts, &ts); } VI_UNLOCK(vp); @@ -264,7 +264,7 @@ msdosfs_getattr(struct vop_getattr_args *ap) u_long dirsperblk = pmp->pm_BytesPerSec / sizeof(struct direntry); uint64_t fileid; - getnanotime(&ts); + vfs_timestamp(&ts); DETIMES(dep, &ts, &ts, &ts); vap->va_fsid = dev2udev(pmp->pm_dev); /* @@ -1327,7 +1327,7 @@ msdosfs_mkdir(struct vop_mkdir_args *ap) bzero(&ndirent, sizeof(ndirent)); ndirent.de_pmp = pmp; ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE; - getnanotime(&ts); + vfs_timestamp(&ts); DETIMES(&ndirent, &ts, &ts, &ts); /* From owner-svn-src-stable@freebsd.org Thu Jun 7 07:32:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69280FD1FB7; Thu, 7 Jun 2018 07:32:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18C5E82422; Thu, 7 Jun 2018 07:32:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDF681D2CB; Thu, 7 Jun 2018 07:32:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577Wp0Z056412; Thu, 7 Jun 2018 07:32:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577WpdV056410; Thu, 7 Jun 2018 07:32:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070732.w577WpdV056410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334757 - stable/11/sys/dev/usb/net X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/net X-SVN-Commit-Revision: 334757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:32:52 -0000 Author: hselasky Date: Thu Jun 7 07:32:51 2018 New Revision: 334757 URL: https://svnweb.freebsd.org/changeset/base/334757 Log: MFC r334158: Add function to wait for USB ethernet attach to complete. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/net/usb_ethernet.c stable/11/sys/dev/usb/net/usb_ethernet.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- stable/11/sys/dev/usb/net/usb_ethernet.c Thu Jun 7 04:57:40 2018 (r334756) +++ stable/11/sys/dev/usb/net/usb_ethernet.c Thu Jun 7 07:32:51 2018 (r334757) @@ -188,6 +188,17 @@ error: return (error); } +void +uether_ifattach_wait(struct usb_ether *ue) +{ + + UE_LOCK(ue); + usb_proc_mwait(&ue->ue_tq, + &ue->ue_sync_task[0].hdr, + &ue->ue_sync_task[1].hdr); + UE_UNLOCK(ue); +} + static void ue_attach_post_task(struct usb_proc_msg *_task) { Modified: stable/11/sys/dev/usb/net/usb_ethernet.h ============================================================================== --- stable/11/sys/dev/usb/net/usb_ethernet.h Thu Jun 7 04:57:40 2018 (r334756) +++ stable/11/sys/dev/usb/net/usb_ethernet.h Thu Jun 7 07:32:51 2018 (r334757) @@ -111,6 +111,7 @@ struct ifnet *uether_getifp(struct usb_ether *); struct mii_data *uether_getmii(struct usb_ether *); void *uether_getsc(struct usb_ether *); int uether_ifattach(struct usb_ether *); +void uether_ifattach_wait(struct usb_ether *); void uether_ifdetach(struct usb_ether *); int uether_ifmedia_upd(struct ifnet *); void uether_init(void *); From owner-svn-src-stable@freebsd.org Thu Jun 7 07:33:47 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26A7EFD30D8; Thu, 7 Jun 2018 07:33:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBD218276C; Thu, 7 Jun 2018 07:33:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD2D51D2CD; Thu, 7 Jun 2018 07:33:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577Xkri056519; Thu, 7 Jun 2018 07:33:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577XkXR056518; Thu, 7 Jun 2018 07:33:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070733.w577XkXR056518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r334758 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/usb/net X-SVN-Commit-Revision: 334758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:33:47 -0000 Author: hselasky Date: Thu Jun 7 07:33:46 2018 New Revision: 334758 URL: https://svnweb.freebsd.org/changeset/base/334758 Log: MFC r334158: Add function to wait for USB ethernet attach to complete. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/net/usb_ethernet.c stable/10/sys/dev/usb/net/usb_ethernet.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- stable/10/sys/dev/usb/net/usb_ethernet.c Thu Jun 7 07:32:51 2018 (r334757) +++ stable/10/sys/dev/usb/net/usb_ethernet.c Thu Jun 7 07:33:46 2018 (r334758) @@ -187,6 +187,17 @@ error: return (error); } +void +uether_ifattach_wait(struct usb_ether *ue) +{ + + UE_LOCK(ue); + usb_proc_mwait(&ue->ue_tq, + &ue->ue_sync_task[0].hdr, + &ue->ue_sync_task[1].hdr); + UE_UNLOCK(ue); +} + static void ue_attach_post_task(struct usb_proc_msg *_task) { Modified: stable/10/sys/dev/usb/net/usb_ethernet.h ============================================================================== --- stable/10/sys/dev/usb/net/usb_ethernet.h Thu Jun 7 07:32:51 2018 (r334757) +++ stable/10/sys/dev/usb/net/usb_ethernet.h Thu Jun 7 07:33:46 2018 (r334758) @@ -111,6 +111,7 @@ struct ifnet *uether_getifp(struct usb_ether *); struct mii_data *uether_getmii(struct usb_ether *); void *uether_getsc(struct usb_ether *); int uether_ifattach(struct usb_ether *); +void uether_ifattach_wait(struct usb_ether *); void uether_ifdetach(struct usb_ether *); int uether_ifmedia_upd(struct ifnet *); void uether_init(void *); From owner-svn-src-stable@freebsd.org Thu Jun 7 07:36:45 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6026AFD323F; Thu, 7 Jun 2018 07:36:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2DD4828BA; Thu, 7 Jun 2018 07:36:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE2CB1D2CF; Thu, 7 Jun 2018 07:36:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577aiM9056654; Thu, 7 Jun 2018 07:36:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577aivs056653; Thu, 7 Jun 2018 07:36:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070736.w577aivs056653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334759 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 334759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:36:45 -0000 Author: hselasky Date: Thu Jun 7 07:36:44 2018 New Revision: 334759 URL: https://svnweb.freebsd.org/changeset/base/334759 Log: MFC r334280: Allow TASK_PARKED bit being set when going to sleep in the LinuxKPI. Found by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Thu Jun 7 07:33:46 2018 (r334758) +++ stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Thu Jun 7 07:36:44 2018 (r334759) @@ -47,7 +47,7 @@ linux_add_to_sleepqueue(void *wchan, struct task_struc { int flags, ret; - MPASS((state & ~TASK_NORMAL) == 0); + MPASS((state & ~(TASK_PARKED | TASK_NORMAL)) == 0); flags = SLEEPQ_SLEEP | ((state & TASK_INTERRUPTIBLE) != 0 ? SLEEPQ_INTERRUPTIBLE : 0); From owner-svn-src-stable@freebsd.org Thu Jun 7 07:37:39 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 486CEFD32D5; Thu, 7 Jun 2018 07:37:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE85A829A4; Thu, 7 Jun 2018 07:37:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC6251D2D2; Thu, 7 Jun 2018 07:37:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577bcaf056737; Thu, 7 Jun 2018 07:37:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577bcI6056736; Thu, 7 Jun 2018 07:37:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070737.w577bcI6056736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334760 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:37:39 -0000 Author: hselasky Date: Thu Jun 7 07:37:38 2018 New Revision: 334760 URL: https://svnweb.freebsd.org/changeset/base/334760 Log: MFC r334281: Implement wait_event_killable() in the LinuxKPI. Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Thu Jun 7 07:36:44 2018 (r334759) +++ stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Thu Jun 7 07:37:38 2018 (r334760) @@ -170,6 +170,11 @@ int linux_wait_event_common(wait_queue_head_t *, wait_ NULL); \ }) +#define wait_event_killable(wqh, cond) ({ \ + __wait_event_common(wqh, cond, MAX_SCHEDULE_TIMEOUT, \ + TASK_INTERRUPTIBLE, NULL); \ +}) + #define wait_event_interruptible(wqh, cond) ({ \ __wait_event_common(wqh, cond, MAX_SCHEDULE_TIMEOUT, \ TASK_INTERRUPTIBLE, NULL); \ From owner-svn-src-stable@freebsd.org Thu Jun 7 07:38:38 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06C82FD3386; Thu, 7 Jun 2018 07:38:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DA9482A9E; Thu, 7 Jun 2018 07:38:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 795901D2D4; Thu, 7 Jun 2018 07:38:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577cbiD056824; Thu, 7 Jun 2018 07:38:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577cb74056823; Thu, 7 Jun 2018 07:38:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070738.w577cb74056823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334761 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:38:38 -0000 Author: hselasky Date: Thu Jun 7 07:38:37 2018 New Revision: 334761 URL: https://svnweb.freebsd.org/changeset/base/334761 Log: MFC r334283: The schedule_timeout_killable() function should listen for signals in the LinuxKPI. Found by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Thu Jun 7 07:37:38 2018 (r334760) +++ stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Thu Jun 7 07:38:37 2018 (r334761) @@ -153,7 +153,7 @@ linux_schedule_get_interrupt_value(struct task_struct #define schedule_timeout(timeout) \ linux_schedule_timeout(timeout) #define schedule_timeout_killable(timeout) \ - schedule_timeout_uninterruptible(timeout) + schedule_timeout_interruptible(timeout) #define schedule_timeout_interruptible(timeout) ({ \ set_current_state(TASK_INTERRUPTIBLE); \ schedule_timeout(timeout); \ From owner-svn-src-stable@freebsd.org Thu Jun 7 07:42:49 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50087FD3797; Thu, 7 Jun 2018 07:42:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23CFB83011; Thu, 7 Jun 2018 07:42:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04DF31D45E; Thu, 7 Jun 2018 07:42:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577gm6t061782; Thu, 7 Jun 2018 07:42:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577gmaD061779; Thu, 7 Jun 2018 07:42:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070742.w577gmaD061779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334762 - in stable/11/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys i386/include X-SVN-Commit-Revision: 334762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:42:49 -0000 Author: hselasky Date: Thu Jun 7 07:42:48 2018 New Revision: 334762 URL: https://svnweb.freebsd.org/changeset/base/334762 Log: MFC r334320 and r334328: Implement atomic_add_64() and atomic_subtract_64() for the i386 target. While at it add missing _acq_ and _rel_ variants for 64-bit atomic operations under i386. Reviewed by: kib @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c stable/11/sys/cddl/compat/opensolaris/sys/atomic.h stable/11/sys/i386/include/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c ============================================================================== --- stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c Thu Jun 7 07:38:37 2018 (r334761) +++ stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c Thu Jun 7 07:42:48 2018 (r334762) @@ -52,7 +52,8 @@ atomic_init(void) } #endif -#if !defined(__LP64__) && !defined(__mips_n32) && !defined(ARM_HAVE_ATOMIC64) +#if !defined(__LP64__) && !defined(__mips_n32) && \ + !defined(ARM_HAVE_ATOMIC64) && !defined(I386_HAVE_ATOMIC64) void atomic_add_64(volatile uint64_t *target, int64_t delta) { Modified: stable/11/sys/cddl/compat/opensolaris/sys/atomic.h ============================================================================== --- stable/11/sys/cddl/compat/opensolaris/sys/atomic.h Thu Jun 7 07:38:37 2018 (r334761) +++ stable/11/sys/cddl/compat/opensolaris/sys/atomic.h Thu Jun 7 07:42:48 2018 (r334762) @@ -36,7 +36,12 @@ atomic_cmpset_ptr((volatile uintptr_t *)(_a), (uintptr_t)(_b), (uintptr_t) (_c)) #define cas32 atomic_cmpset_32 -#if !defined(__LP64__) && !defined(__mips_n32) && !defined(ARM_HAVE_ATOMIC64) +#if defined(__i386__) && (defined(_KERNEL) || defined(KLD_MODULE)) +#define I386_HAVE_ATOMIC64 +#endif + +#if !defined(__LP64__) && !defined(__mips_n32) && \ + !defined(ARM_HAVE_ATOMIC64) && !defined(I386_HAVE_ATOMIC64) extern void atomic_add_64(volatile uint64_t *target, int64_t delta); extern void atomic_dec_64(volatile uint64_t *target); #endif @@ -85,7 +90,8 @@ atomic_dec_32_nv(volatile uint32_t *target) return (atomic_fetchadd_32(target, -1) - 1); } -#if defined(__LP64__) || defined(__mips_n32) || defined(ARM_HAVE_ATOMIC64) +#if defined(__LP64__) || defined(__mips_n32) || \ + defined(ARM_HAVE_ATOMIC64) || defined(I386_HAVE_ATOMIC64) static __inline void atomic_dec_64(volatile uint64_t *target) { Modified: stable/11/sys/i386/include/atomic.h ============================================================================== --- stable/11/sys/i386/include/atomic.h Thu Jun 7 07:38:37 2018 (r334761) +++ stable/11/sys/i386/include/atomic.h Thu Jun 7 07:42:48 2018 (r334762) @@ -132,6 +132,8 @@ uint64_t atomic_load_acq_64(volatile uint64_t *); void atomic_store_rel_64(volatile uint64_t *, uint64_t); uint64_t atomic_swap_64(volatile uint64_t *, uint64_t); uint64_t atomic_fetchadd_64(volatile uint64_t *, uint64_t); +void atomic_add_64(volatile uint64_t *, uint64_t); +void atomic_subtract_64(volatile uint64_t *, uint64_t); #else /* !KLD_MODULE && __GNUCLIKE_ASM */ @@ -579,6 +581,30 @@ atomic_fetchadd_64(volatile uint64_t *p, uint64_t v) } } +static __inline void +atomic_add_64(volatile uint64_t *p, uint64_t v) +{ + uint64_t t; + + for (;;) { + t = *p; + if (atomic_cmpset_64(p, t, t + v)) + break; + } +} + +static __inline void +atomic_subtract_64(volatile uint64_t *p, uint64_t v) +{ + uint64_t t; + + for (;;) { + t = *p; + if (atomic_cmpset_64(p, t, t - v)) + break; + } +} + #endif /* _KERNEL */ #endif /* KLD_MODULE || !__GNUCLIKE_ASM */ @@ -802,6 +828,16 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_fetchadd_32 atomic_fetchadd_int #define atomic_testandset_32 atomic_testandset_int #define atomic_testandclear_32 atomic_testandclear_int + +/* Operations on 64-bit quad words. */ +#define atomic_cmpset_acq_64 atomic_cmpset_64 +#define atomic_cmpset_rel_64 atomic_cmpset_64 +#define atomic_fetchadd_acq_64 atomic_fetchadd_64 +#define atomic_fetchadd_rel_64 atomic_fetchadd_64 +#define atomic_add_acq_64 atomic_add_64 +#define atomic_add_rel_64 atomic_add_64 +#define atomic_subtract_acq_64 atomic_subtract_64 +#define atomic_subtract_rel_64 atomic_subtract_64 /* Operations on pointers. */ #define atomic_set_ptr(p, v) \ From owner-svn-src-stable@freebsd.org Thu Jun 7 07:43:58 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD93BFD38BB; Thu, 7 Jun 2018 07:43:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3CBA8316F; Thu, 7 Jun 2018 07:43:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94E021D461; Thu, 7 Jun 2018 07:43:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577hw3Z061851; Thu, 7 Jun 2018 07:43:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577hwk8061850; Thu, 7 Jun 2018 07:43:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070743.w577hwk8061850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334763 - stable/11/sys/dev/atkbdc X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/atkbdc X-SVN-Commit-Revision: 334763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:43:59 -0000 Author: hselasky Date: Thu Jun 7 07:43:58 2018 New Revision: 334763 URL: https://svnweb.freebsd.org/changeset/base/334763 Log: MFC r334422: Correct argument for evdev_push_rel(). This is a regression issue after r319162. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/atkbdc/psm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/atkbdc/psm.c ============================================================================== --- stable/11/sys/dev/atkbdc/psm.c Thu Jun 7 07:42:48 2018 (r334762) +++ stable/11/sys/dev/atkbdc/psm.c Thu Jun 7 07:43:58 2018 (r334763) @@ -4960,8 +4960,8 @@ psmsoftintr(void *arg) if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE && sc->hw.model != MOUSE_MODEL_ELANTECH && sc->hw.model != MOUSE_MODEL_SYNAPTICS) { - evdev_push_rel(sc->evdev_r, EV_REL, x); - evdev_push_rel(sc->evdev_r, EV_REL, -y); + evdev_push_rel(sc->evdev_r, REL_X, x); + evdev_push_rel(sc->evdev_r, REL_Y, -y); switch (sc->hw.model) { case MOUSE_MODEL_EXPLORER: From owner-svn-src-stable@freebsd.org Thu Jun 7 07:47:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD0FDFD3A0E; Thu, 7 Jun 2018 07:47:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3815B832D8; Thu, 7 Jun 2018 07:44:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A79D1D463; Thu, 7 Jun 2018 07:44:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577isft061953; Thu, 7 Jun 2018 07:44:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577isDg061951; Thu, 7 Jun 2018 07:44:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070744.w577isDg061951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334764 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 334764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:47:02 -0000 Author: hselasky Date: Thu Jun 7 07:44:54 2018 New Revision: 334764 URL: https://svnweb.freebsd.org/changeset/base/334764 Log: MFC r334423: Implement idr_is_empty() in the LinuxKPI and make idr_remove() API compatible with upstream Linux by returning the pointer to the removed element. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/idr.h stable/11/sys/compat/linuxkpi/common/src/linux_idr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/idr.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/idr.h Thu Jun 7 07:43:58 2018 (r334763) +++ stable/11/sys/compat/linuxkpi/common/include/linux/idr.h Thu Jun 7 07:44:54 2018 (r334764) @@ -79,11 +79,12 @@ void idr_preload(gfp_t gfp_mask); void idr_preload_end(void); void *idr_find(struct idr *idp, int id); void *idr_get_next(struct idr *idp, int *nextid); +bool idr_is_empty(struct idr *idp); int idr_pre_get(struct idr *idp, gfp_t gfp_mask); int idr_get_new(struct idr *idp, void *ptr, int *id); int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); void *idr_replace(struct idr *idp, void *ptr, int id); -void idr_remove(struct idr *idp, int id); +void *idr_remove(struct idr *idp, int id); void idr_remove_all(struct idr *idp); void idr_destroy(struct idr *idp); void idr_init(struct idr *idp); Modified: stable/11/sys/compat/linuxkpi/common/src/linux_idr.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_idr.c Thu Jun 7 07:43:58 2018 (r334763) +++ stable/11/sys/compat/linuxkpi/common/src/linux_idr.c Thu Jun 7 07:44:54 2018 (r334764) @@ -218,10 +218,11 @@ idr_remove_all(struct idr *idr) mtx_unlock(&idr->lock); } -static void +static void * idr_remove_locked(struct idr *idr, int id) { struct idr_layer *il; + void *res; int layer; int idx; @@ -229,7 +230,7 @@ idr_remove_locked(struct idr *idr, int id) il = idr->top; layer = idr->layers - 1; if (il == NULL || id > idr_max(idr)) - return; + return (NULL); /* * Walk down the tree to this item setting bitmaps along the way * as we know at least one item will be free along this path. @@ -249,16 +250,23 @@ idr_remove_locked(struct idr *idr, int id) if (il == NULL || (il->bitmap & (1 << idx)) != 0) panic("idr_remove: Item %d not allocated (%p, %p)\n", id, idr, il); + res = il->ary[idx]; il->ary[idx] = NULL; il->bitmap |= 1 << idx; + + return (res); } -void +void * idr_remove(struct idr *idr, int id) { + void *res; + mtx_lock(&idr->lock); - idr_remove_locked(idr, id); + res = idr_remove_locked(idr, id); mtx_unlock(&idr->lock); + + return (res); } @@ -713,6 +721,20 @@ int idr_for_each(struct idr *idp, int (*f)(int id, void *p, void *data), void *data) { return (idr_for_each_layer(idp->top, 0, idp->layers - 1, f, data)); +} + +static int +idr_has_entry(int id, void *p, void *data) +{ + + return (1); +} + +bool +idr_is_empty(struct idr *idp) +{ + + return (idr_for_each(idp, idr_has_entry, NULL) == 0); } int From owner-svn-src-stable@freebsd.org Thu Jun 7 07:47:00 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61F79FD39C8; Thu, 7 Jun 2018 07:47:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40CA983454; Thu, 7 Jun 2018 07:45:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 217A51D465; Thu, 7 Jun 2018 07:45:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577jnjn062041; Thu, 7 Jun 2018 07:45:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577jnbm062040; Thu, 7 Jun 2018 07:45:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070745.w577jnbm062040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334765 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:47:00 -0000 Author: hselasky Date: Thu Jun 7 07:45:49 2018 New Revision: 334765 URL: https://svnweb.freebsd.org/changeset/base/334765 Log: MFC r334425: Implement bitmap_complement() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Thu Jun 7 07:44:54 2018 (r334764) +++ stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Thu Jun 7 07:45:49 2018 (r334765) @@ -244,6 +244,17 @@ bitmap_equal(const unsigned long *pa, } static inline void +bitmap_complement(unsigned long *dst, const unsigned long *src, + const unsigned int size) +{ + const unsigned int end = BITS_TO_LONGS(size); + unsigned int i; + + for (i = 0; i != end; i++) + dst[i] = ~src[i]; +} + +static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, const unsigned long *src2, const unsigned int size) { From owner-svn-src-stable@freebsd.org Thu Jun 7 07:47:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F310BFD3A16; Thu, 7 Jun 2018 07:47:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BF3B835C2; Thu, 7 Jun 2018 07:46:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D3B41D468; Thu, 7 Jun 2018 07:46:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577kevn062124; Thu, 7 Jun 2018 07:46:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577keJS062123; Thu, 7 Jun 2018 07:46:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070746.w577keJS062123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334766 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:47:02 -0000 Author: hselasky Date: Thu Jun 7 07:46:39 2018 New Revision: 334766 URL: https://svnweb.freebsd.org/changeset/base/334766 Log: MFC r334426: Define __initconst in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Thu Jun 7 07:45:49 2018 (r334765) +++ stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Thu Jun 7 07:46:39 2018 (r334766) @@ -52,6 +52,7 @@ #define __devinitdata #define __deprecated #define __init +#define __initconst #define __devinit #define __devexit #define __exit From owner-svn-src-stable@freebsd.org Thu Jun 7 07:47:33 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30376FD3BDD; Thu, 7 Jun 2018 07:47:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6CAF836E9; Thu, 7 Jun 2018 07:47:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B97FF1D46B; Thu, 7 Jun 2018 07:47:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577lWTT062207; Thu, 7 Jun 2018 07:47:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577lWXX062206; Thu, 7 Jun 2018 07:47:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070747.w577lWXX062206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334767 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:47:33 -0000 Author: hselasky Date: Thu Jun 7 07:47:32 2018 New Revision: 334767 URL: https://svnweb.freebsd.org/changeset/base/334767 Log: MFC r334427: Correct macroname in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/completion.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/completion.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/completion.h Thu Jun 7 07:46:39 2018 (r334766) +++ stable/11/sys/compat/linuxkpi/common/include/linux/completion.h Thu Jun 7 07:47:32 2018 (r334767) @@ -49,7 +49,7 @@ struct completion { linux_complete_common((c), 1) #define wait_for_completion(c) \ linux_wait_for_common((c), 0) -#define wait_for_completion_interuptible(c) \ +#define wait_for_completion_interruptible(c) \ linux_wait_for_common((c), 1) #define wait_for_completion_timeout(c, timeout) \ linux_wait_for_timeout_common((c), (timeout), 0) From owner-svn-src-stable@freebsd.org Thu Jun 7 07:48:27 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 159DDFD3D28; Thu, 7 Jun 2018 07:48:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD72A8381E; Thu, 7 Jun 2018 07:48:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE5E71D470; Thu, 7 Jun 2018 07:48:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577mQmi062285; Thu, 7 Jun 2018 07:48:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577mQBw062284; Thu, 7 Jun 2018 07:48:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070748.w577mQBw062284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334768 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:48:27 -0000 Author: hselasky Date: Thu Jun 7 07:48:26 2018 New Revision: 334768 URL: https://svnweb.freebsd.org/changeset/base/334768 Log: MFC r334428: Implement support for the kvmalloc_array() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Thu Jun 7 07:47:32 2018 (r334767) +++ stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Thu Jun 7 07:48:26 2018 (r334768) @@ -132,6 +132,12 @@ kmalloc_array(size_t n, size_t size, gfp_t flags) } static inline void * +kvmalloc_array(size_t n, size_t size, gfp_t flags) +{ + return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); +} + +static inline void * krealloc(void *ptr, size_t size, gfp_t flags) { return (realloc(ptr, size, M_KMALLOC, linux_check_m_flags(flags))); From owner-svn-src-stable@freebsd.org Thu Jun 7 07:49:19 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB001FD3E9D; Thu, 7 Jun 2018 07:49:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E6C583A13; Thu, 7 Jun 2018 07:49:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ED801D473; Thu, 7 Jun 2018 07:49:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w577nI2D062410; Thu, 7 Jun 2018 07:49:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w577nIjY062409; Thu, 7 Jun 2018 07:49:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806070749.w577nIjY062409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jun 2018 07:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334770 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 334770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 07:49:19 -0000 Author: hselasky Date: Thu Jun 7 07:49:18 2018 New Revision: 334770 URL: https://svnweb.freebsd.org/changeset/base/334770 Log: MFC r334429: Implement support for the PCI_BUS_NUM() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Thu Jun 7 07:48:50 2018 (r334769) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Thu Jun 7 07:49:18 2018 (r334770) @@ -98,6 +98,7 @@ struct pci_device_id { #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) #define PCI_FUNC(devfn) ((devfn) & 0x07) +#define PCI_BUS_NUM(devfn) (((devfn) >> 8) & 0xff) #define PCI_VDEVICE(_vendor, _device) \ .vendor = PCI_VENDOR_ID_##_vendor, .device = (_device), \ From owner-svn-src-stable@freebsd.org Thu Jun 7 09:03:44 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FB0BFDC4CA; Thu, 7 Jun 2018 09:03:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 336B0867ED; Thu, 7 Jun 2018 09:03:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 158921E12D; Thu, 7 Jun 2018 09:03:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5793hQE001302; Thu, 7 Jun 2018 09:03:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5793gBF001296; Thu, 7 Jun 2018 09:03:42 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806070903.w5793gBF001296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 7 Jun 2018 09:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334771 - in stable/11: lib/msun/amd64 lib/msun/i387 lib/msun/tests lib/msun/x86 sys/amd64/include sys/i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: lib/msun/amd64 lib/msun/i387 lib/msun/tests lib/msun/x86 sys/amd64/include sys/i386/include X-SVN-Commit-Revision: 334771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 09:03:44 -0000 Author: dim Date: Thu Jun 7 09:03:42 2018 New Revision: 334771 URL: https://svnweb.freebsd.org/changeset/base/334771 Log: MFC r334445: Resolve conflicts between macros in fenv.h and ieeefp.h This is a follow-up to r321483, which disabled -Wmacro-redefined for some lib/msun tests. If an application included both fenv.h and ieeefp.h, several macros such as __fldcw(), __fldenv() were defined in both headers, with slightly different arguments, leading to conflicts. Fix this by putting all the common macros in the machine-specific versions of ieeefp.h. Where needed, update the arguments in places where the macros are invoked. This also slightly reduces the differences between the amd64 and i386 versions of ieeefp.h. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D15633 Modified: stable/11/lib/msun/amd64/fenv.c stable/11/lib/msun/i387/fenv.c stable/11/lib/msun/tests/Makefile stable/11/lib/msun/x86/fenv.h stable/11/sys/amd64/include/ieeefp.h stable/11/sys/i386/include/ieeefp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/msun/amd64/fenv.c ============================================================================== --- stable/11/lib/msun/amd64/fenv.c Thu Jun 7 07:49:18 2018 (r334770) +++ stable/11/lib/msun/amd64/fenv.c Thu Jun 7 09:03:42 2018 (r334771) @@ -58,12 +58,12 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) __fnstenv(&env.__x87); env.__x87.__status &= ~excepts; env.__x87.__status |= *flagp & excepts; - __fldenv(env.__x87); + __fldenv(&env.__x87); __stmxcsr(&env.__mxcsr); env.__mxcsr &= ~excepts; env.__mxcsr |= *flagp & excepts; - __ldmxcsr(env.__mxcsr); + __ldmxcsr(&env.__mxcsr); return (0); } @@ -92,7 +92,7 @@ fegetenv(fenv_t *envp) * fnstenv masks all exceptions, so we need to restore the * control word to avoid this side effect. */ - __fldcw(envp->__x87.__control); + __fldcw(&envp->__x87.__control); return (0); } @@ -107,7 +107,7 @@ feholdexcept(fenv_t *envp) envp->__mxcsr = mxcsr; mxcsr &= ~FE_ALL_EXCEPT; mxcsr |= FE_ALL_EXCEPT << _SSE_EMASK_SHIFT; - __ldmxcsr(mxcsr); + __ldmxcsr(&mxcsr); return (0); } @@ -137,9 +137,9 @@ __feenableexcept(int mask) __stmxcsr(&mxcsr); omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control &= ~mask; - __fldcw(control); + __fldcw(&control); mxcsr &= ~(mask << _SSE_EMASK_SHIFT); - __ldmxcsr(mxcsr); + __ldmxcsr(&mxcsr); return (omask); } @@ -154,9 +154,9 @@ __fedisableexcept(int mask) __stmxcsr(&mxcsr); omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control |= mask; - __fldcw(control); + __fldcw(&control); mxcsr |= mask << _SSE_EMASK_SHIFT; - __ldmxcsr(mxcsr); + __ldmxcsr(&mxcsr); return (omask); } Modified: stable/11/lib/msun/i387/fenv.c ============================================================================== --- stable/11/lib/msun/i387/fenv.c Thu Jun 7 07:49:18 2018 (r334770) +++ stable/11/lib/msun/i387/fenv.c Thu Jun 7 09:03:42 2018 (r334771) @@ -101,13 +101,13 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) __fnstenv(&env); env.__status &= ~excepts; env.__status |= *flagp & excepts; - __fldenv(env); + __fldenv(&env); if (__HAS_SSE()) { __stmxcsr(&mxcsr); mxcsr &= ~excepts; mxcsr |= *flagp & excepts; - __ldmxcsr(mxcsr); + __ldmxcsr(&mxcsr); } return (0); @@ -137,7 +137,7 @@ fegetenv(fenv_t *envp) * fnstenv masks all exceptions, so we need to restore * the old control word to avoid this side effect. */ - __fldcw(envp->__control); + __fldcw(&envp->__control); if (__HAS_SSE()) { __stmxcsr(&mxcsr); __set_mxcsr(*envp, mxcsr); @@ -157,7 +157,7 @@ feholdexcept(fenv_t *envp) __set_mxcsr(*envp, mxcsr); mxcsr &= ~FE_ALL_EXCEPT; mxcsr |= FE_ALL_EXCEPT << _SSE_EMASK_SHIFT; - __ldmxcsr(mxcsr); + __ldmxcsr(&mxcsr); } return (0); } @@ -194,10 +194,10 @@ __feenableexcept(int mask) mxcsr = 0; omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control &= ~mask; - __fldcw(control); + __fldcw(&control); if (__HAS_SSE()) { mxcsr &= ~(mask << _SSE_EMASK_SHIFT); - __ldmxcsr(mxcsr); + __ldmxcsr(&mxcsr); } return (omask); } @@ -216,10 +216,10 @@ __fedisableexcept(int mask) mxcsr = 0; omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control |= mask; - __fldcw(control); + __fldcw(&control); if (__HAS_SSE()) { mxcsr |= mask << _SSE_EMASK_SHIFT; - __ldmxcsr(mxcsr); + __ldmxcsr(&mxcsr); } return (omask); } Modified: stable/11/lib/msun/tests/Makefile ============================================================================== --- stable/11/lib/msun/tests/Makefile Thu Jun 7 07:49:18 2018 (r334770) +++ stable/11/lib/msun/tests/Makefile Thu Jun 7 09:03:42 2018 (r334771) @@ -84,10 +84,6 @@ SRCS.ilogb2_test= ilogb_test.c LIBADD+= m -.if ${MACHINE_CPUARCH} == "i386" -# XXX: __fldcw macro mismatch between fenv.h and ieeefp.h . -CWARNFLAGS.clang+= -Wno-error=macro-redefined -.endif WARNS?= 1 # Copied from lib/msun/Makefile Modified: stable/11/lib/msun/x86/fenv.h ============================================================================== --- stable/11/lib/msun/x86/fenv.h Thu Jun 7 07:49:18 2018 (r334770) +++ stable/11/lib/msun/x86/fenv.h Thu Jun 7 09:03:42 2018 (r334771) @@ -31,6 +31,7 @@ #include #include +#include #ifndef __fenv_static #define __fenv_static static @@ -95,18 +96,10 @@ __BEGIN_DECLS extern const fenv_t __fe_dfl_env; #define FE_DFL_ENV (&__fe_dfl_env) -#define __fldcw(__cw) __asm __volatile("fldcw %0" : : "m" (__cw)) -#define __fldenv(__env) __asm __volatile("fldenv %0" : : "m" (__env)) #define __fldenvx(__env) __asm __volatile("fldenv %0" : : "m" (__env) \ : "st", "st(1)", "st(2)", "st(3)", "st(4)", \ "st(5)", "st(6)", "st(7)") -#define __fnclex() __asm __volatile("fnclex") -#define __fnstenv(__env) __asm __volatile("fnstenv %0" : "=m" (*(__env))) -#define __fnstcw(__cw) __asm __volatile("fnstcw %0" : "=m" (*(__cw))) -#define __fnstsw(__sw) __asm __volatile("fnstsw %0" : "=am" (*(__sw))) #define __fwait() __asm __volatile("fwait") -#define __ldmxcsr(__csr) __asm __volatile("ldmxcsr %0" : : "m" (__csr)) -#define __stmxcsr(__csr) __asm __volatile("stmxcsr %0" : "=m" (*(__csr))) int fegetenv(fenv_t *__envp); int feholdexcept(fenv_t *__envp); @@ -181,12 +174,12 @@ feclearexcept(int __excepts) } else { __fnstenv(&__env); __env.__status &= ~__excepts; - __fldenv(__env); + __fldenv(&__env); } if (__HAS_SSE()) { __stmxcsr(&__mxcsr); __mxcsr &= ~__excepts; - __ldmxcsr(__mxcsr); + __ldmxcsr(&__mxcsr); } return (0); } @@ -232,13 +225,13 @@ fesetround(int __round) __fnstcw(&__control); __control &= ~_ROUND_MASK; __control |= __round; - __fldcw(__control); + __fldcw(&__control); if (__HAS_SSE()) { __stmxcsr(&__mxcsr); __mxcsr &= ~(_ROUND_MASK << _SSE_ROUND_SHIFT); __mxcsr |= __round << _SSE_ROUND_SHIFT; - __ldmxcsr(__mxcsr); + __ldmxcsr(&__mxcsr); } return (0); @@ -262,7 +255,7 @@ fesetenv(const fenv_t *__envp) */ __fldenvx(__env); if (__HAS_SSE()) - __ldmxcsr(__mxcsr); + __ldmxcsr(&__mxcsr); return (0); } @@ -278,11 +271,11 @@ feclearexcept(int __excepts) } else { __fnstenv(&__env.__x87); __env.__x87.__status &= ~__excepts; - __fldenv(__env.__x87); + __fldenv(&__env.__x87); } __stmxcsr(&__env.__mxcsr); __env.__mxcsr &= ~__excepts; - __ldmxcsr(__env.__mxcsr); + __ldmxcsr(&__env.__mxcsr); return (0); } @@ -321,12 +314,12 @@ fesetround(int __round) __fnstcw(&__control); __control &= ~_ROUND_MASK; __control |= __round; - __fldcw(__control); + __fldcw(&__control); __stmxcsr(&__mxcsr); __mxcsr &= ~(_ROUND_MASK << _SSE_ROUND_SHIFT); __mxcsr |= __round << _SSE_ROUND_SHIFT; - __ldmxcsr(__mxcsr); + __ldmxcsr(&__mxcsr); return (0); } @@ -344,7 +337,7 @@ fesetenv(const fenv_t *__envp) * inlined, so we need to be more careful. */ __fldenvx(__envp->__x87); - __ldmxcsr(__envp->__mxcsr); + __ldmxcsr(&__envp->__mxcsr); return (0); } Modified: stable/11/sys/amd64/include/ieeefp.h ============================================================================== --- stable/11/sys/amd64/include/ieeefp.h Thu Jun 7 07:49:18 2018 (r334770) +++ stable/11/sys/amd64/include/ieeefp.h Thu Jun 7 09:03:42 2018 (r334771) @@ -128,6 +128,7 @@ typedef enum { #define __fldcw(addr) __asm __volatile("fldcw %0" : : "m" (*(addr))) #define __fldenv(addr) __asm __volatile("fldenv %0" : : "m" (*(addr))) +#define __fnclex() __asm __volatile("fnclex") #define __fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr))) #define __fnstenv(addr) __asm __volatile("fnstenv %0" : "=m" (*(addr))) #define __fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr))) Modified: stable/11/sys/i386/include/ieeefp.h ============================================================================== --- stable/11/sys/i386/include/ieeefp.h Thu Jun 7 07:49:18 2018 (r334770) +++ stable/11/sys/i386/include/ieeefp.h Thu Jun 7 09:03:42 2018 (r334771) @@ -114,6 +114,8 @@ typedef enum { #define __fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr))) #define __fnstenv(addr) __asm __volatile("fnstenv %0" : "=m" (*(addr))) #define __fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr))) +#define __ldmxcsr(addr) __asm __volatile("ldmxcsr %0" : : "m" (*(addr))) +#define __stmxcsr(addr) __asm __volatile("stmxcsr %0" : "=m" (*(addr))) /* * Load the control word. Be careful not to trap if there is a currently From owner-svn-src-stable@freebsd.org Thu Jun 7 13:06:57 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D117FE6EDD; Thu, 7 Jun 2018 13:06:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 217B68F861; Thu, 7 Jun 2018 13:06:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02038207ED; Thu, 7 Jun 2018 13:06:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57D6uoc020916; Thu, 7 Jun 2018 13:06:56 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57D6uKj020915; Thu, 7 Jun 2018 13:06:56 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806071306.w57D6uKj020915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jun 2018 13:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334780 - stable/11/cddl/usr.sbin/dwatch X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/cddl/usr.sbin/dwatch X-SVN-Commit-Revision: 334780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:06:57 -0000 Author: dteske Date: Thu Jun 7 13:06:56 2018 New Revision: 334780 URL: https://svnweb.freebsd.org/changeset/base/334780 Log: MFC r334594: dwatch(1): Update manual to reference actual release Sponsored by: Smule, Inc. Modified: stable/11/cddl/usr.sbin/dwatch/dwatch.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/usr.sbin/dwatch/dwatch.1 ============================================================================== --- stable/11/cddl/usr.sbin/dwatch/dwatch.1 Thu Jun 7 13:03:07 2018 (r334779) +++ stable/11/cddl/usr.sbin/dwatch/dwatch.1 Thu Jun 7 13:06:56 2018 (r334780) @@ -761,6 +761,6 @@ dwatch -F 'pid$target:::entry' -c true .Sh HISTORY .Nm first appeared in -.Fx 12.0-CURRENT . +.Fx 11.2 . .Sh AUTHORS .An Devin Teske Aq Mt dteske@FreeBSD.org From owner-svn-src-stable@freebsd.org Thu Jun 7 15:03:49 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 098D4FDD92C; Thu, 7 Jun 2018 15:03:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEAAB6E3B6; Thu, 7 Jun 2018 15:03:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7598F21BD1; Thu, 7 Jun 2018 15:03:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57F3mLp081932; Thu, 7 Jun 2018 15:03:48 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57F3mpY081930; Thu, 7 Jun 2018 15:03:48 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201806071503.w57F3mpY081930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 7 Jun 2018 15:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334787 - stable/11/sbin/dhclient X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sbin/dhclient X-SVN-Commit-Revision: 334787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 15:03:49 -0000 Author: marius Date: Thu Jun 7 15:03:47 2018 New Revision: 334787 URL: https://svnweb.freebsd.org/changeset/base/334787 Log: MFC: r334443 (by cem@) dhclient(8): allow to supersede interface-mtu option In some cases broken DHCP servers might send invalid MTU value, so allow to use 'supersede' in dhclient.conf to override this. When superseded value is 0, MTU value is not updated at all. PR: 206721 Submitted by: novel@ Reported by: Relnotes: yes (potentially surprising behavior change w/ broken dhcpd mtu) Differential Revision: https://reviews.freebsd.org/D15484 Modified: stable/11/sbin/dhclient/dhclient.c stable/11/sbin/dhclient/dhclient.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/dhclient/dhclient.c ============================================================================== --- stable/11/sbin/dhclient/dhclient.c Thu Jun 7 14:46:52 2018 (r334786) +++ stable/11/sbin/dhclient/dhclient.c Thu Jun 7 15:03:47 2018 (r334787) @@ -828,11 +828,23 @@ bind_lease(struct interface_info *ip) opt = &ip->client->new->options[DHO_INTERFACE_MTU]; if (opt->len == sizeof(u_int16_t)) { - u_int16_t mtu = be16dec(opt->data); - if (mtu < MIN_MTU) - warning("mtu size %u < %d: ignored", (unsigned)mtu, MIN_MTU); + u_int16_t mtu = 0; + bool supersede = (ip->client->config->default_actions[DHO_INTERFACE_MTU] == + ACTION_SUPERSEDE); + + if (supersede) + mtu = getUShort(ip->client->config->defaults[DHO_INTERFACE_MTU].data); else + mtu = be16dec(opt->data); + + if (mtu < MIN_MTU) { + /* Treat 0 like a user intentionally doesn't want to change MTU and, + * therefore, warning is not needed */ + if (!supersede || mtu != 0) + warning("mtu size %u < %d: ignored", (unsigned)mtu, MIN_MTU); + } else { interface_set_mtu_unpriv(privfd, mtu); + } } /* Write out the new lease. */ Modified: stable/11/sbin/dhclient/dhclient.conf.5 ============================================================================== --- stable/11/sbin/dhclient/dhclient.conf.5 Thu Jun 7 14:46:52 2018 (r334786) +++ stable/11/sbin/dhclient/dhclient.conf.5 Thu Jun 7 15:03:47 2018 (r334787) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 1, 1997 +.Dd May 31, 2018 .Dt DHCLIENT.CONF 5 .Os .Sh NAME @@ -227,6 +227,14 @@ rather than any value supplied by the server, these va in the .Ic supersede statement. +.Pp +Some options values have special meaning: +.Bl -tag -width indent +.It Ar interface-mtu +Any server-supplied interface MTU is ignored by the client if a +.Ic supersede +zero value is configured. +.El .It Xo .Ic prepend No { Op Ar option declaration .Oo , Ar ... option declaration Oc } From owner-svn-src-stable@freebsd.org Thu Jun 7 17:43:33 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFF71FE5DE9; Thu, 7 Jun 2018 17:43:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92DC17620F; Thu, 7 Jun 2018 17:43:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 758CB2368D; Thu, 7 Jun 2018 17:43:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w57HhWhM064442; Thu, 7 Jun 2018 17:43:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w57HhVv1064440; Thu, 7 Jun 2018 17:43:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806071743.w57HhVv1064440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 7 Jun 2018 17:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334801 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 334801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 17:43:33 -0000 Author: tuexen Date: Thu Jun 7 17:43:31 2018 New Revision: 334801 URL: https://svnweb.freebsd.org/changeset/base/334801 Log: MFC r334725: Improve compliance with RFC 4895 and RFC 6458. Silently dicard SCTP chunks which have been requested to be authenticated but are received unauthenticated no matter if support for SCTP authentication has been negotiated. This improves compliance with RFC 4895. When the application uses the SCTP_AUTH_CHUNK socket option to request a chunk to be received in an authenticated way, enable the SCTP authentication extension for the end-point. This improves compliance with RFC 6458. Discussed with: Peter Lei Approved by: re (gjb, early MFC) Modified: stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Thu Jun 7 17:08:36 2018 (r334800) +++ stable/11/sys/netinet/sctp_input.c Thu Jun 7 17:43:31 2018 (r334801) @@ -4810,7 +4810,6 @@ process_control_chunks: /* check to see if this chunk required auth, but isn't */ if ((stcb != NULL) && - (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(ch->chunk_type, stcb->asoc.local_auth_chunks) && !stcb->asoc.authenticated) { /* "silently" ignore */ @@ -5687,7 +5686,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph * chunks */ if ((stcb != NULL) && - (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) { /* "silently" ignore */ SCTP_STAT_INCR(sctps_recvauthmissing); @@ -5729,7 +5727,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph */ if ((length > offset) && (stcb != NULL) && - (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks) && !stcb->asoc.authenticated) { /* "silently" ignore */ Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Thu Jun 7 17:08:36 2018 (r334800) +++ stable/11/sys/netinet/sctp_usrreq.c Thu Jun 7 17:43:31 2018 (r334801) @@ -4248,6 +4248,8 @@ sctp_setopt(struct socket *so, int optname, void *optv if (sctp_auth_add_chunk(sauth->sauth_chunk, inp->sctp_ep.local_auth_chunks)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; + } else { + inp->auth_supported = 1; } SCTP_INP_WUNLOCK(inp); break; From owner-svn-src-stable@freebsd.org Fri Jun 8 09:52:50 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 263D610167EE; Fri, 8 Jun 2018 09:52:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE63C7C009; Fri, 8 Jun 2018 09:52:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89C765879; Fri, 8 Jun 2018 09:52:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w589qnjD059794; Fri, 8 Jun 2018 09:52:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w589qnvj059793; Fri, 8 Jun 2018 09:52:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806080952.w589qnvj059793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 8 Jun 2018 09:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334835 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 334835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 09:52:50 -0000 Author: ae Date: Fri Jun 8 09:52:49 2018 New Revision: 334835 URL: https://svnweb.freebsd.org/changeset/base/334835 Log: MFC r333400: Add IFCAP_LINKSTATE support to if_loop(4). Modified: stable/11/sys/net/if_loop.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_loop.c ============================================================================== --- stable/11/sys/net/if_loop.c Fri Jun 8 07:29:24 2018 (r334834) +++ stable/11/sys/net/if_loop.c Fri Jun 8 09:52:49 2018 (r334835) @@ -133,7 +133,7 @@ lo_clone_create(struct if_clone *ifc, int unit, caddr_ ifp->if_output = looutput; ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_capabilities = ifp->if_capenable = - IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6; + IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_LINKSTATE; ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); @@ -406,6 +406,8 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCSIFFLAGS: + if_link_state_change(ifp, (ifp->if_flags & IFF_UP) ? + LINK_STATE_UP: LINK_STATE_DOWN); break; case SIOCSIFCAP: From owner-svn-src-stable@freebsd.org Fri Jun 8 10:09:33 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 401531016F79; Fri, 8 Jun 2018 10:09:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5CC77C81C; Fri, 8 Jun 2018 10:09:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 994935A25; Fri, 8 Jun 2018 10:09:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58A9WJg064866; Fri, 8 Jun 2018 10:09:32 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58A9U82064857; Fri, 8 Jun 2018 10:09:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806081009.w58A9U82064857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 8 Jun 2018 10:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334836 - in stable/11: sbin/ipfw sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11: sbin/ipfw sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 334836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 10:09:33 -0000 Author: ae Date: Fri Jun 8 10:09:30 2018 New Revision: 334836 URL: https://svnweb.freebsd.org/changeset/base/334836 Log: MFC r333403: Bring in some last changes in NAT64 implementation: o Modify ipfw(8) to be able set any prefix6 not just Well-Known, and also show configured prefix6; o relocate some definitions and macros into proper place; o convert nat64_debug and nat64_allow_private variables to be VNET-compatible; o add struct nat64_config that keeps generic configuration needed to NAT64 code; o add nat64_check_prefix6() function to check validness of specified by user IPv6 prefix according to RFC6052; o use nat64_check_private_ip4() and nat64_embed_ip4() functions instead of nat64_get_ip4() and nat64_set_ip4() macros. This allows to use any configured IPv6 prefixes that are allowed by RFC6052; o introduce NAT64_WKPFX flag, that is set when IPv6 prefix is Well-Known IPv6 prefix. It is used to reduce overhead to check this; o modify nat64lsn_cfg and nat64stl_cfg structures to use nat64_config structure. And respectivelly modify the rest of code; o remove now unused ro argument from nat64_output() function; o remove __FreeBSD_version ifdef, NAT64 was not merged to older versions; o add commented -DIPFIREWALL_NAT64_DIRECT_OUTPUT flag to module's Makefile as example. MFC r333406: Update NAT64 documentation, now we support any IPv6 prefixes. Modified: stable/11/sbin/ipfw/ipfw.8 stable/11/sbin/ipfw/ipfw2.h stable/11/sbin/ipfw/nat64lsn.c stable/11/sbin/ipfw/nat64stl.c stable/11/sys/modules/ipfw_nat64/Makefile stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.h stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c stable/11/sys/netpfil/ipfw/nat64/nat64_translate.h stable/11/sys/netpfil/ipfw/nat64/nat64lsn.c stable/11/sys/netpfil/ipfw/nat64/nat64lsn.h stable/11/sys/netpfil/ipfw/nat64/nat64lsn_control.c stable/11/sys/netpfil/ipfw/nat64/nat64stl.c stable/11/sys/netpfil/ipfw/nat64/nat64stl.h stable/11/sys/netpfil/ipfw/nat64/nat64stl_control.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Fri Jun 8 09:52:49 2018 (r334835) +++ stable/11/sbin/ipfw/ipfw.8 Fri Jun 8 10:09:30 2018 (r334836) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2018 +.Dd May 9, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -3043,13 +3043,6 @@ After translation NAT64 translator sends packets throu queue. Thus translator host should be configured as IPv4 and IPv6 router. .Pp -Currently both stateful and stateless NAT64 translators use Well-Known IPv6 -Prefix -.Ar 64:ff9b::/96 -to represent IPv4 addresses in the IPv6 address. -Thus DNS64 service and routing should be configured to use Well-Known IPv6 -Prefix. -.Pp The stateful NAT64 configuration command is the following: .Bd -ragged -offset indent .Bk -words @@ -3062,7 +3055,7 @@ The stateful NAT64 configuration command is the follow .Pp The following parameters can be configured: .Bl -tag -width indent -.It Cm prefix4 Ar ipv4_prefix/mask +.It Cm prefix4 Ar ipv4_prefix/plen The IPv4 prefix with mask defines the pool of IPv4 addresses used as source address after translation. Stateful NAT64 module translates IPv6 source address of client to one @@ -3070,6 +3063,12 @@ IPv4 address from this pool. Note that incoming IPv4 packets that don't have corresponding state entry in the states table will be dropped by translator. Make sure that translation rules handle packets, destined to configured prefix. +.It Cm prefix6 Ar ipv6_prefix/length +The IPv6 prefix defines IPv4-embedded IPv6 addresses used by translator +to represent IPv4 addresses. This IPv6 prefix should be configured in DNS64. +The translator implementation follows RFC6052, that restricts the length of +prefixes to one of following: 32, 40, 48, 56, 64, or 96. +The Well-Known IPv6 Prefix 64:ff9b:: must be 96 bits long. .It Cm max_ports Ar number Maximum number of ports reserved for upper level protocols to one IPv6 client. All reserved ports are divided into chunks between supported protocols. @@ -3169,6 +3168,9 @@ The stateless NAT64 configuration command is the follo .Pp The following parameters can be configured: .Bl -tag -width indent +.It Cm prefix6 Ar ipv6_prefix/length +The IPv6 prefix defines IPv4-embedded IPv6 addresses used by translator +to represent IPv4 addresses. This IPv6 prefix should be configured in DNS64. .It Cm table4 Ar table46 The lookup table .Ar table46 Modified: stable/11/sbin/ipfw/ipfw2.h ============================================================================== --- stable/11/sbin/ipfw/ipfw2.h Fri Jun 8 09:52:49 2018 (r334835) +++ stable/11/sbin/ipfw/ipfw2.h Fri Jun 8 10:09:30 2018 (r334836) @@ -384,6 +384,7 @@ void ipfw_nat64lsn_handler(int ac, char *av[]); void ipfw_nat64stl_handler(int ac, char *av[]); void ipfw_nptv6_handler(int ac, char *av[]); int ipfw_check_object_name(const char *name); +int ipfw_check_nat64prefix(const struct in6_addr *prefix, int length); #ifdef PF /* altq.c */ Modified: stable/11/sbin/ipfw/nat64lsn.c ============================================================================== --- stable/11/sbin/ipfw/nat64lsn.c Fri Jun 8 09:52:49 2018 (r334835) +++ stable/11/sbin/ipfw/nat64lsn.c Fri Jun 8 10:09:30 2018 (r334836) @@ -428,13 +428,17 @@ nat64lsn_create(const char *name, uint8_t set, int ac, flags |= NAT64LSN_HAS_PREFIX4; ac--; av++; break; -#if 0 case TOK_PREFIX6: NEED1("IPv6 prefix required"); nat64lsn_parse_prefix(*av, AF_INET6, &cfg->prefix6, &cfg->plen6); + if (ipfw_check_nat64prefix(&cfg->prefix6, + cfg->plen6) != 0) + errx(EX_USAGE, "Bad prefix6 %s", *av); + ac--; av++; break; +#if 0 case TOK_AGG_LEN: NEED1("Aggregation prefix len required"); cfg->agg_prefix_len = nat64lsn_parse_int(*av, opt); @@ -767,10 +771,10 @@ nat64lsn_show_cb(ipfw_nat64lsn_cfg *cfg, const char *n if (co.use_set != 0 || cfg->set != 0) printf("set %u ", cfg->set); inet_ntop(AF_INET, &cfg->prefix4, abuf, sizeof(abuf)); - printf("nat64lsn %s prefix4 %s/%u ", cfg->name, abuf, cfg->plen4); -#if 0 + printf("nat64lsn %s prefix4 %s/%u", cfg->name, abuf, cfg->plen4); inet_ntop(AF_INET6, &cfg->prefix6, abuf, sizeof(abuf)); - printf("prefix6 %s/%u", abuf, cfg->plen6); + printf(" prefix6 %s/%u", abuf, cfg->plen6); +#if 0 printf("agg_len %u agg_count %u ", cfg->agg_prefix_len, cfg->agg_prefix_max); if (cfg->min_port != NAT64LSN_PORT_MIN || Modified: stable/11/sbin/ipfw/nat64stl.c ============================================================================== --- stable/11/sbin/ipfw/nat64stl.c Fri Jun 8 09:52:49 2018 (r334835) +++ stable/11/sbin/ipfw/nat64stl.c Fri Jun 8 10:09:30 2018 (r334836) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -static int nat64stl_check_prefix(struct in6_addr *prefix, int length); typedef int (nat64stl_cb_t)(ipfw_nat64stl_cfg *i, const char *name, uint8_t set); static int nat64stl_foreach(nat64stl_cb_t *f, const char *name, uint8_t set, @@ -80,13 +79,10 @@ static struct _s_x nat64cmds[] = { ((a)->__u6_addr.__u6_addr32[0] == IPV6_ADDR_INT32_WKPFX && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == 0) -static int -nat64stl_check_prefix(struct in6_addr *prefix, int length) +int +ipfw_check_nat64prefix(const struct in6_addr *prefix, int length) { - if (IN6_IS_ADDR_WKPFX(prefix) && length == 96) - return (0); -#if 0 switch (length) { case 32: case 40: @@ -95,21 +91,20 @@ nat64stl_check_prefix(struct in6_addr *prefix, int len case 64: /* Well-known prefix has 96 prefix length */ if (IN6_IS_ADDR_WKPFX(prefix)) - return (1); + return (EINVAL); /* FALLTHROUGH */ case 96: /* Bits 64 to 71 must be set to zero */ if (prefix->__u6_addr.__u6_addr8[8] != 0) - return (1); + return (EINVAL); /* XXX: looks incorrect */ if (IN6_IS_ADDR_MULTICAST(prefix) || IN6_IS_ADDR_UNSPECIFIED(prefix) || IN6_IS_ADDR_LOOPBACK(prefix)) - return (1); + return (EINVAL); return (0); } -#endif - return (1); + return (EINVAL); } static struct _s_x nat64statscmds[] = { @@ -255,7 +250,7 @@ nat64stl_create(const char *name, uint8_t set, int ac, errx(EX_USAGE, "Bad prefix: %s", *av); cfg->plen6 = strtol(p, NULL, 10); - if (nat64stl_check_prefix(&cfg->prefix6, + if (ipfw_check_nat64prefix(&cfg->prefix6, cfg->plen6) != 0) errx(EX_USAGE, "Bad prefix length: %s", p); @@ -439,6 +434,7 @@ nat64stl_reset_stats(const char *name, uint8_t set) static int nat64stl_show_cb(ipfw_nat64stl_cfg *cfg, const char *name, uint8_t set) { + char abuf[INET6_ADDRSTRLEN]; if (name != NULL && strcmp(cfg->name, name) != 0) return (ESRCH); @@ -448,8 +444,11 @@ nat64stl_show_cb(ipfw_nat64stl_cfg *cfg, const char *n if (co.use_set != 0 || cfg->set != 0) printf("set %u ", cfg->set); + printf("nat64stl %s table4 %s table6 %s", cfg->name, cfg->ntlv4.name, cfg->ntlv6.name); + inet_ntop(AF_INET6, &cfg->prefix6, abuf, sizeof(abuf)); + printf(" prefix6 %s/%u", abuf, cfg->plen6); if (cfg->flags & NAT64_LOG) printf(" log"); printf("\n"); Modified: stable/11/sys/modules/ipfw_nat64/Makefile ============================================================================== --- stable/11/sys/modules/ipfw_nat64/Makefile Fri Jun 8 09:52:49 2018 (r334835) +++ stable/11/sys/modules/ipfw_nat64/Makefile Fri Jun 8 10:09:30 2018 (r334836) @@ -8,4 +8,6 @@ SRCS+= nat64lsn.c nat64lsn_control.c SRCS+= nat64stl.c nat64stl_control.c SRCS+= opt_ipfw.h +#CFLAGS+= -DIPFIREWALL_NAT64_DIRECT_OUTPUT + .include Modified: stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Fri Jun 8 09:52:49 2018 (r334835) +++ stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Fri Jun 8 10:09:30 2018 (r334836) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2015-2016 Yandex LLC - * Copyright (c) 2015-2016 Andrey V. Elsukov + * Copyright (c) 2015-2018 Yandex LLC + * Copyright (c) 2015-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,18 +46,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include "ip_fw_nat64.h" -int nat64_debug = 0; -SYSCTL_DECL(_net_inet_ip_fw); -SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_debug, CTLFLAG_RW, - &nat64_debug, 0, "Debug level for NAT64 module"); +VNET_DEFINE(int, nat64_debug) = 0; +VNET_DEFINE(int, nat64_allow_private) = 0; -int nat64_allow_private = 0; -SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_allow_private, CTLFLAG_RW, - &nat64_allow_private, 0, +SYSCTL_DECL(_net_inet_ip_fw); +SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_debug, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(nat64_debug), 0, "Debug level for NAT64 module"); +SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_allow_private, + CTLFLAG_VNET |CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, "Allow use of non-global IPv4 addresses with NAT64"); static int Modified: stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.h ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.h Fri Jun 8 09:52:49 2018 (r334835) +++ stable/11/sys/netpfil/ipfw/nat64/ip_fw_nat64.h Fri Jun 8 10:09:30 2018 (r334836) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2015-2016 Yandex LLC - * Copyright (c) 2015-2016 Andrey V. Elsukov + * Copyright (c) 2015-2018 Yandex LLC + * Copyright (c) 2015-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ #define _IP_FW_NAT64_H_ #define DPRINTF(mask, fmt, ...) \ - if (nat64_debug & (mask)) \ + if (V_nat64_debug & (mask)) \ printf("NAT64: %s: " fmt "\n", __func__, ## __VA_ARGS__) #define DP_GENERIC 0x0001 #define DP_OBJ 0x0002 @@ -39,79 +39,21 @@ #define DP_STATE 0x0008 #define DP_DROPS 0x0010 #define DP_ALL 0xFFFF -extern int nat64_debug; +VNET_DECLARE(int, nat64_debug); +VNET_DECLARE(int, nat64_allow_private); +#define V_nat64_debug VNET(nat64_debug) +#define V_nat64_allow_private VNET(nat64_allow_private) + #if 0 #define NAT64NOINLINE __noinline #else #define NAT64NOINLINE #endif -int nat64stl_init(struct ip_fw_chain *ch, int first); -void nat64stl_uninit(struct ip_fw_chain *ch, int last); -int nat64lsn_init(struct ip_fw_chain *ch, int first); -void nat64lsn_uninit(struct ip_fw_chain *ch, int last); +int nat64stl_init(struct ip_fw_chain *ch, int first); +void nat64stl_uninit(struct ip_fw_chain *ch, int last); +int nat64lsn_init(struct ip_fw_chain *ch, int first); +void nat64lsn_uninit(struct ip_fw_chain *ch, int last); -struct ip_fw_nat64_stats { - counter_u64_t opcnt64; /* 6to4 of packets translated */ - counter_u64_t opcnt46; /* 4to6 of packets translated */ - counter_u64_t ofrags; /* number of fragments generated */ - counter_u64_t ifrags; /* number of fragments received */ - counter_u64_t oerrors; /* number of output errors */ - counter_u64_t noroute4; - counter_u64_t noroute6; - counter_u64_t nomatch4; /* No addr/port match */ - counter_u64_t noproto; /* Protocol not supported */ - counter_u64_t nomem; /* mbufs allocation failed */ - counter_u64_t dropped; /* number of packets silently - * dropped due to some errors/ - * unsupported/etc. - */ - - counter_u64_t jrequests; /* number of jobs requests queued */ - counter_u64_t jcalls; /* number of jobs handler calls */ - counter_u64_t jhostsreq; /* number of hosts requests */ - counter_u64_t jportreq; - counter_u64_t jhostfails; - counter_u64_t jportfails; - counter_u64_t jmaxlen; - counter_u64_t jnomem; - counter_u64_t jreinjected; - - counter_u64_t screated; - counter_u64_t sdeleted; - counter_u64_t spgcreated; - counter_u64_t spgdeleted; -}; - -#define IPFW_NAT64_VERSION 1 -#define NAT64STATS (sizeof(struct ip_fw_nat64_stats) / sizeof(uint64_t)) -typedef struct _nat64_stats_block { - counter_u64_t stats[NAT64STATS]; -} nat64_stats_block; -#define NAT64STAT_ADD(s, f, v) \ - counter_u64_add((s)->stats[ \ - offsetof(struct ip_fw_nat64_stats, f) / sizeof(uint64_t)], (v)) -#define NAT64STAT_INC(s, f) NAT64STAT_ADD(s, f, 1) -#define NAT64STAT_FETCH(s, f) \ - counter_u64_fetch((s)->stats[ \ - offsetof(struct ip_fw_nat64_stats, f) / sizeof(uint64_t)]) - -#define L3HDR(_ip, _t) ((_t)((u_int32_t *)(_ip) + (_ip)->ip_hl)) -#define TCP(p) ((struct tcphdr *)(p)) -#define UDP(p) ((struct udphdr *)(p)) -#define ICMP(p) ((struct icmphdr *)(p)) -#define ICMP6(p) ((struct icmp6_hdr *)(p)) - -#define NAT64SKIP 0 -#define NAT64RETURN 1 -#define NAT64MFREE -1 - -/* Well-known prefix 64:ff9b::/96 */ -#define IPV6_ADDR_INT32_WKPFX htonl(0x64ff9b) -#define IN6_IS_ADDR_WKPFX(a) \ - ((a)->s6_addr32[0] == IPV6_ADDR_INT32_WKPFX && \ - (a)->s6_addr32[1] == 0 && (a)->s6_addr32[2] == 0) - -#endif - +#endif /* _IP_FW_NAT64_H_ */ Modified: stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c Fri Jun 8 09:52:49 2018 (r334835) +++ stable/11/sys/netpfil/ipfw/nat64/nat64_translate.c Fri Jun 8 10:09:30 2018 (r334836) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2015-2016 Yandex LLC - * Copyright (c) 2015-2016 Andrey V. Elsukov + * Copyright (c) 2015-2018 Yandex LLC + * Copyright (c) 2015-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,10 +66,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include "ip_fw_nat64.h" +#include "nat64_translate.h" + static void nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa_family_t family) { @@ -86,22 +87,21 @@ static NAT64NOINLINE int nat64_find_route6(struct nhop struct sockaddr_in6 *, struct mbuf *); static NAT64NOINLINE int -nat64_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro, nat64_stats_block *stats, - void *logdata) +nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, + struct nat64_counters *stats, void *logdata) { int error; if (logdata != NULL) nat64_log(logdata, m, dst->sa_family); - error = (*ifp->if_output)(ifp, m, dst, ro); + error = (*ifp->if_output)(ifp, m, dst, NULL); if (error != 0) NAT64STAT_INC(stats, oerrors); return (error); } static NAT64NOINLINE int -nat64_output_one(struct mbuf *m, nat64_stats_block *stats, void *logdata) +nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) { struct nhop6_basic nh6; struct nhop4_basic nh4; @@ -155,9 +155,8 @@ nat64_output_one(struct mbuf *m, nat64_stats_block *st } #else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ static NAT64NOINLINE int -nat64_output(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro, nat64_stats_block *stats, - void *logdata) +nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, + struct nat64_counters *stats, void *logdata) { struct ip *ip4; int ret, af; @@ -187,50 +186,103 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, } static NAT64NOINLINE int -nat64_output_one(struct mbuf *m, nat64_stats_block *stats, void *logdata) +nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) { - return (nat64_output(NULL, m, NULL, NULL, stats, logdata)); + return (nat64_output(NULL, m, NULL, stats, logdata)); } #endif /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ +/* + * Check the given IPv6 prefix and length according to RFC6052: + * The prefixes can only have one of the following lengths: + * 32, 40, 48, 56, 64, or 96 (The Well-Known Prefix is 96 bits long). + * Returns zero on success, otherwise EINVAL. + */ +int +nat64_check_prefix6(const struct in6_addr *prefix, int length) +{ -#if 0 -void print_ipv6_header(struct ip6_hdr *ip6, char *buf, size_t bufsize); + switch (length) { + case 32: + case 40: + case 48: + case 56: + case 64: + /* Well-known prefix has 96 prefix length */ + if (IN6_IS_ADDR_WKPFX(prefix)) + return (EINVAL); + /* FALLTHROUGH */ + case 96: + /* Bits 64 to 71 must be set to zero */ + if (prefix->__u6_addr.__u6_addr8[8] != 0) + return (EINVAL); + /* Some extra checks */ + if (IN6_IS_ADDR_MULTICAST(prefix) || + IN6_IS_ADDR_UNSPECIFIED(prefix) || + IN6_IS_ADDR_LOOPBACK(prefix)) + return (EINVAL); + return (0); + } + return (EINVAL); +} -void -print_ipv6_header(struct ip6_hdr *ip6, char *buf, size_t bufsize) +int +nat64_check_private_ip4(const struct nat64_config *cfg, in_addr_t ia) { - char sbuf[INET6_ADDRSTRLEN], dbuf[INET6_ADDRSTRLEN]; - inet_ntop(AF_INET6, &ip6->ip6_src, sbuf, sizeof(sbuf)); - inet_ntop(AF_INET6, &ip6->ip6_dst, dbuf, sizeof(dbuf)); - snprintf(buf, bufsize, "%s -> %s %d", sbuf, dbuf, ip6->ip6_nxt); + if (V_nat64_allow_private) + return (0); + + /* WKPFX must not be used to represent non-global IPv4 addresses */ + if (cfg->flags & NAT64_WKPFX) { + /* IN_PRIVATE */ + if ((ia & htonl(0xff000000)) == htonl(0x0a000000) || + (ia & htonl(0xfff00000)) == htonl(0xac100000) || + (ia & htonl(0xffff0000)) == htonl(0xc0a80000)) + return (1); + /* + * RFC 5735: + * 192.0.0.0/24 - reserved for IETF protocol assignments + * 192.88.99.0/24 - for use as 6to4 relay anycast addresses + * 198.18.0.0/15 - for use in benchmark tests + * 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 - for use + * in documentation and example code + */ + if ((ia & htonl(0xffffff00)) == htonl(0xc0000000) || + (ia & htonl(0xffffff00)) == htonl(0xc0586300) || + (ia & htonl(0xfffffe00)) == htonl(0xc6120000) || + (ia & htonl(0xffffff00)) == htonl(0xc0000200) || + (ia & htonl(0xfffffe00)) == htonl(0xc6336400) || + (ia & htonl(0xffffff00)) == htonl(0xcb007100)) + return (1); + } + return (0); } - -static NAT64NOINLINE int -nat64_embed_ip4(struct nat64_cfg *cfg, in_addr_t ia, struct in6_addr *ip6) +void +nat64_embed_ip4(const struct nat64_config *cfg, in_addr_t ia, + struct in6_addr *ip6) { - /* assume the prefix is properly filled with zeros */ - bcopy(&cfg->prefix, ip6, sizeof(*ip6)); - switch (cfg->plen) { + /* assume the prefix6 is properly filled with zeros */ + bcopy(&cfg->prefix6, ip6, sizeof(*ip6)); + switch (cfg->plen6) { case 32: case 96: - ip6->s6_addr32[cfg->plen / 32] = ia; + ip6->s6_addr32[cfg->plen6 / 32] = ia; break; case 40: case 48: case 56: #if BYTE_ORDER == BIG_ENDIAN - ip6->s6_addr32[1] = cfg->prefix.s6_addr32[1] | - (ia >> (cfg->plen % 32)); - ip6->s6_addr32[2] = ia << (24 - cfg->plen % 32); + ip6->s6_addr32[1] = cfg->prefix6.s6_addr32[1] | + (ia >> (cfg->plen6 % 32)); + ip6->s6_addr32[2] = ia << (24 - cfg->plen6 % 32); #elif BYTE_ORDER == LITTLE_ENDIAN - ip6->s6_addr32[1] = cfg->prefix.s6_addr32[1] | - (ia << (cfg->plen % 32)); - ip6->s6_addr32[2] = ia >> (24 - cfg->plen % 32); + ip6->s6_addr32[1] = cfg->prefix6.s6_addr32[1] | + (ia << (cfg->plen6 % 32)); + ip6->s6_addr32[2] = ia >> (24 - cfg->plen6 % 32); #endif break; case 64: @@ -243,14 +295,13 @@ nat64_embed_ip4(struct nat64_cfg *cfg, in_addr_t ia, s #endif break; default: - return (0); + panic("Wrong plen6"); }; ip6->s6_addr8[8] = 0; - return (1); } -static NAT64NOINLINE in_addr_t -nat64_extract_ip4(struct in6_addr *ip6, int plen) +in_addr_t +nat64_extract_ip4(const struct nat64_config *cfg, const struct in6_addr *ip6) { in_addr_t ia; @@ -261,7 +312,7 @@ nat64_extract_ip4(struct in6_addr *ip6, int plen) * The suffix bits are reserved for future extensions and SHOULD * be set to zero. */ - switch (plen) { + switch (cfg->plen6) { case 32: if (ip6->s6_addr32[3] != 0 || ip6->s6_addr32[2] != 0) goto badip6; @@ -285,20 +336,20 @@ nat64_extract_ip4(struct in6_addr *ip6, int plen) (ip6->s6_addr32[3] & htonl(0x00ffffff)) != 0) goto badip6; }; - switch (plen) { + switch (cfg->plen6) { case 32: case 96: - ia = ip6->s6_addr32[plen / 32]; + ia = ip6->s6_addr32[cfg->plen6 / 32]; break; case 40: case 48: case 56: #if BYTE_ORDER == BIG_ENDIAN - ia = (ip6->s6_addr32[1] << (plen % 32)) | - (ip6->s6_addr32[2] >> (24 - plen % 32)); + ia = (ip6->s6_addr32[1] << (cfg->plen6 % 32)) | + (ip6->s6_addr32[2] >> (24 - cfg->plen6 % 32)); #elif BYTE_ORDER == LITTLE_ENDIAN - ia = (ip6->s6_addr32[1] >> (plen % 32)) | - (ip6->s6_addr32[2] << (24 - plen % 32)); + ia = (ip6->s6_addr32[1] >> (cfg->plen6 % 32)) | + (ip6->s6_addr32[2] << (24 - cfg->plen6 % 32)); #endif break; case 64: @@ -312,18 +363,18 @@ nat64_extract_ip4(struct in6_addr *ip6, int plen) return (0); }; if (nat64_check_ip4(ia) != 0 || - nat64_check_private_ip4(ia) != 0) + nat64_check_private_ip4(cfg, ia) != 0) goto badip4; return (ia); badip4: - DPRINTF(DP_GENERIC, "invalid destination address: %08x", ia); + DPRINTF(DP_GENERIC | DP_DROPS, + "invalid destination address: %08x", ia); return (0); badip6: - DPRINTF(DP_GENERIC, "invalid IPv4-embedded IPv6 address"); + DPRINTF(DP_GENERIC | DP_DROPS, "invalid IPv4-embedded IPv6 address"); return (0); } -#endif /* * According to RFC 1624 the equation for incremental checksum update is: @@ -363,9 +414,6 @@ nat64_cksum_convert(struct ip6_hdr *ip6, struct ip *ip return (sum); } -#if __FreeBSD_version < 1100000 -#define ip_fillid(ip) (ip)->ip_id = ip_newid() -#endif static NAT64NOINLINE void nat64_init_ip4hdr(const struct ip6_hdr *ip6, const struct ip6_frag *frag, uint16_t plen, uint8_t proto, struct ip *ip) @@ -397,8 +445,9 @@ nat64_init_ip4hdr(const struct ip6_hdr *ip6, const str #define FRAGSZ(mtu) ((mtu) - sizeof(struct ip6_hdr) - sizeof(struct ip6_frag)) static NAT64NOINLINE int -nat64_fragment6(nat64_stats_block *stats, struct ip6_hdr *ip6, struct mbufq *mq, - struct mbuf *m, uint32_t mtu, uint16_t ip_id, uint16_t ip_off) +nat64_fragment6(struct nat64_counters *stats, struct ip6_hdr *ip6, + struct mbufq *mq, struct mbuf *m, uint32_t mtu, uint16_t ip_id, + uint16_t ip_off) { struct ip6_frag ip6f; struct mbuf *n; @@ -510,7 +559,7 @@ nat64_find_route6(struct nhop6_basic *pnh, struct sock #define NAT64_ICMP6_PLEN 64 static NAT64NOINLINE void nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint8_t code, uint32_t mtu, - nat64_stats_block *stats, void *logdata) + struct nat64_counters *stats, void *logdata) { struct icmp6_hdr *icmp6; struct ip6_hdr *ip6, *oip6; @@ -625,7 +674,7 @@ nat64_find_route4(struct nhop4_basic *pnh, struct sock #define NAT64_ICMP_PLEN 64 static NAT64NOINLINE void nat64_icmp_reflect(struct mbuf *m, uint8_t type, - uint8_t code, uint16_t mtu, nat64_stats_block *stats, void *logdata) + uint8_t code, uint16_t mtu, struct nat64_counters *stats, void *logdata) { struct icmp *icmp; struct ip *ip, *oip; @@ -734,7 +783,7 @@ nat64_icmp_handle_echo(struct ip6_hdr *ip6, struct icm static NAT64NOINLINE struct mbuf * nat64_icmp_translate(struct mbuf *m, struct ip6_hdr *ip6, uint16_t icmpid, - int offset, nat64_stats_block *stats) + int offset, struct nat64_config *cfg) { struct ip ip; struct icmp *icmp; @@ -749,7 +798,7 @@ nat64_icmp_translate(struct mbuf *m, struct ip6_hdr *i if (m->m_len < offset + ICMP_MINLEN) m = m_pullup(m, offset + ICMP_MINLEN); if (m == NULL) { - NAT64STAT_INC(stats, nomem); + NAT64STAT_INC(&cfg->stats, nomem); return (m); } mtu = 0; @@ -889,8 +938,8 @@ nat64_icmp_translate(struct mbuf *m, struct ip6_hdr *i hlen += ip.ip_hl << 2; /* Skip inner IP header */ if (nat64_check_ip4(ip.ip_src.s_addr) != 0 || nat64_check_ip4(ip.ip_dst.s_addr) != 0 || - nat64_check_private_ip4(ip.ip_src.s_addr) != 0 || - nat64_check_private_ip4(ip.ip_dst.s_addr) != 0) { + nat64_check_private_ip4(cfg, ip.ip_src.s_addr) != 0 || + nat64_check_private_ip4(cfg, ip.ip_dst.s_addr) != 0) { DPRINTF(DP_DROPS, "IP addresses checks failed %04x -> %04x", ntohl(ip.ip_src.s_addr), ntohl(ip.ip_dst.s_addr)); goto freeit; @@ -925,7 +974,7 @@ nat64_icmp_translate(struct mbuf *m, struct ip6_hdr *i plen = sizeof(struct icmp6_hdr) + sizeof(struct ip6_hdr) + len; n = m_get2(offset + plen + max_hdr, M_NOWAIT, MT_HEADER, M_PKTHDR); if (n == NULL) { - NAT64STAT_INC(stats, nomem); + NAT64STAT_INC(&cfg->stats, nomem); m_freem(m); return (NULL); } @@ -939,7 +988,7 @@ nat64_icmp_translate(struct mbuf *m, struct ip6_hdr *i eip6->ip6_src = ip6->ip6_dst; /* Use the fact that we have single /96 prefix for IPv4 map */ eip6->ip6_dst = ip6->ip6_src; - nat64_set_ip4(&eip6->ip6_dst, ip.ip_dst.s_addr); + nat64_embed_ip4(cfg, ip.ip_dst.s_addr, &eip6->ip6_dst); eip6->ip6_flow = htonl(ip.ip_tos << 20); eip6->ip6_vfc |= IPV6_VERSION; @@ -1009,7 +1058,7 @@ nat64_icmp_translate(struct mbuf *m, struct ip6_hdr *i return (n); freeit: m_freem(m); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NULL); } @@ -1057,7 +1106,7 @@ nat64_getlasthdr(struct mbuf *m, int *offset) int nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *saddr, - struct in6_addr *daddr, uint16_t lport, nat64_stats_block *stats, + struct in6_addr *daddr, uint16_t lport, struct nat64_config *cfg, void *logdata) { struct nhop6_basic nh; @@ -1074,7 +1123,7 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s if (ip->ip_ttl <= IPTTLDEC) { nat64_icmp_reflect(m, ICMP_TIMXCEED, - ICMP_TIMXCEED_INTRANS, 0, stats, logdata); + ICMP_TIMXCEED_INTRANS, 0, &cfg->stats, logdata); return (NAT64RETURN); } @@ -1092,27 +1141,27 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s /* Fragment length must be multiple of 8 octets */ if ((ip->ip_off & htons(IP_MF)) != 0 && (plen & 0x7) != 0) { nat64_icmp_reflect(m, ICMP_PARAMPROB, - ICMP_PARAMPROB_LENGTH, 0, stats, logdata); + ICMP_PARAMPROB_LENGTH, 0, &cfg->stats, logdata); return (NAT64RETURN); } /* Fragmented ICMP is unsupported */ if (proto == IPPROTO_ICMP && ip_off != 0) { DPRINTF(DP_DROPS, "dropped due to fragmented ICMP"); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } dst.sin6_addr = ip6.ip6_dst; if (nat64_find_route6(&nh, &dst, m) != 0) { - NAT64STAT_INC(stats, noroute6); + NAT64STAT_INC(&cfg->stats, noroute6); nat64_icmp_reflect(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, - stats, logdata); + &cfg->stats, logdata); return (NAT64RETURN); } if (nh.nh_mtu < plen + sizeof(ip6) && (ip->ip_off & htons(IP_DF)) != 0) { nat64_icmp_reflect(m, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, - FRAGSZ(nh.nh_mtu) + sizeof(struct ip), stats, logdata); + FRAGSZ(nh.nh_mtu) + sizeof(struct ip), &cfg->stats, logdata); return (NAT64RETURN); } @@ -1147,19 +1196,19 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s *csum = cksum_add(*csum, ~nat64_cksum_convert(&ip6, ip)); break; case IPPROTO_ICMP: - m = nat64_icmp_translate(m, &ip6, lport, hlen, stats); + m = nat64_icmp_translate(m, &ip6, lport, hlen, cfg); if (m == NULL) /* stats already accounted */ return (NAT64RETURN); } m_adj(m, hlen); mbufq_init(&mq, 255); - nat64_fragment6(stats, &ip6, &mq, m, nh.nh_mtu, ip_id, ip_off); + nat64_fragment6(&cfg->stats, &ip6, &mq, m, nh.nh_mtu, ip_id, ip_off); while ((m = mbufq_dequeue(&mq)) != NULL) { if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, - NULL, stats, logdata) != 0) + &cfg->stats, logdata) != 0) break; - NAT64STAT_INC(stats, opcnt46); + NAT64STAT_INC(&cfg->stats, opcnt46); } mbufq_drain(&mq); return (NAT64RETURN); @@ -1167,7 +1216,7 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s int nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t aaddr, uint16_t aport, - nat64_stats_block *stats, void *logdata) + struct nat64_config *cfg, void *logdata) { struct ip ip; struct icmp6_hdr *icmp6; @@ -1187,7 +1236,7 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t if (proto != IPPROTO_ICMPV6) { DPRINTF(DP_DROPS, "dropped due to mbuf isn't contigious"); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } } @@ -1217,7 +1266,7 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t DPRINTF(DP_DROPS, "Unsupported ICMPv6 type %d," " code %d", icmp6->icmp6_type, icmp6->icmp6_code); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } break; @@ -1229,7 +1278,7 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t DPRINTF(DP_DROPS, "Wrong MTU %d in ICMPv6 type %d," " code %d", mtu, icmp6->icmp6_type, icmp6->icmp6_code); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } /* @@ -1274,7 +1323,7 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t DPRINTF(DP_DROPS, "Unsupported ICMPv6 type %d," " code %d, pptr %d", icmp6->icmp6_type, icmp6->icmp6_code, mtu); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } case ICMP6_PARAMPROB_NEXTHEADER: @@ -1285,20 +1334,20 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t DPRINTF(DP_DROPS, "Unsupported ICMPv6 type %d," " code %d, pptr %d", icmp6->icmp6_type, icmp6->icmp6_code, ntohl(icmp6->icmp6_pptr)); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } break; default: DPRINTF(DP_DROPS, "Unsupported ICMPv6 type %d, code %d", icmp6->icmp6_type, icmp6->icmp6_code); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } hlen += sizeof(struct icmp6_hdr); if (m->m_pkthdr.len < hlen + sizeof(struct ip6_hdr) + ICMP_MINLEN) { - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); DPRINTF(DP_DROPS, "Message is too short %d", m->m_pkthdr.len); return (NAT64MFREE); @@ -1325,7 +1374,7 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t if (m->m_len < hlen + sizeof(struct ip6_hdr) + ICMP_MINLEN) m = m_pullup(m, hlen + sizeof(struct ip6_hdr) + ICMP_MINLEN); if (m == NULL) { - NAT64STAT_INC(stats, nomem); + NAT64STAT_INC(&cfg->stats, nomem); return (NAT64RETURN); } ip6 = mtod(m, struct ip6_hdr *); @@ -1364,7 +1413,7 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t /* Now we need to make a fake IPv4 packet to generate ICMP message */ ip.ip_dst.s_addr = aaddr; - ip.ip_src.s_addr = nat64_get_ip4(&ip6i->ip6_src); + ip.ip_src.s_addr = nat64_extract_ip4(cfg, &ip6i->ip6_src); /* XXX: Make fake ulp header */ #ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT ip6i->ip6_hlim += IPV6_HLIMDEC; /* init_ip4hdr will decrement it */ @@ -1372,7 +1421,8 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t nat64_init_ip4hdr(ip6i, ip6f, plen, proto, &ip); m_adj(m, hlen - sizeof(struct ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); - nat64_icmp_reflect(m, type, code, (uint16_t)mtu, stats, logdata); + nat64_icmp_reflect(m, type, code, (uint16_t)mtu, &cfg->stats, + logdata); return (NAT64RETURN); fail: /* @@ -1380,13 +1430,13 @@ fail: * changed with m_pullup(). */ m_freem(m); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64RETURN); } int nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, uint16_t aport, - nat64_stats_block *stats, void *logdata) + struct nat64_config *cfg, void *logdata) { struct ip ip; struct nhop4_basic nh; @@ -1411,21 +1461,21 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui /* Starting from this point we must not return zero */ ip.ip_src.s_addr = aaddr; if (nat64_check_ip4(ip.ip_src.s_addr) != 0) { - DPRINTF(DP_GENERIC, "invalid source address: %08x", + DPRINTF(DP_GENERIC | DP_DROPS, "invalid source address: %08x", ip.ip_src.s_addr); - /* XXX: stats? */ + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } - ip.ip_dst.s_addr = nat64_get_ip4(&ip6->ip6_dst); + ip.ip_dst.s_addr = nat64_extract_ip4(cfg, &ip6->ip6_dst); if (ip.ip_dst.s_addr == 0) { - /* XXX: stats? */ + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } if (ip6->ip6_hlim <= IPV6_HLIMDEC) { nat64_icmp6_reflect(m, ICMP6_TIME_EXCEEDED, - ICMP6_TIME_EXCEED_TRANSIT, 0, stats, logdata); + ICMP6_TIME_EXCEED_TRANSIT, 0, &cfg->stats, logdata); return (NAT64RETURN); } @@ -1434,7 +1484,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui proto = nat64_getlasthdr(m, &hlen); if (proto < 0) { DPRINTF(DP_DROPS, "dropped due to mbuf isn't contigious"); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } frag = NULL; @@ -1443,7 +1493,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui if (m->m_len < hlen + sizeof(*frag)) { DPRINTF(DP_DROPS, "dropped due to mbuf isn't contigious"); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } frag = mtodo(m, hlen); @@ -1452,7 +1502,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui /* Fragmented ICMPv6 is unsupported */ if (proto == IPPROTO_ICMPV6) { DPRINTF(DP_DROPS, "dropped due to fragmented ICMPv6"); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } /* Fragment length must be multiple of 8 octets */ @@ -1460,7 +1510,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui ((plen + sizeof(struct ip6_hdr) - hlen) & 0x7) != 0) { nat64_icmp6_reflect(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, - offsetof(struct ip6_hdr, ip6_plen), stats, + offsetof(struct ip6_hdr, ip6_plen), &cfg->stats, logdata); return (NAT64RETURN); } @@ -1469,7 +1519,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui if (plen < 0 || m->m_pkthdr.len < plen + hlen) { DPRINTF(DP_DROPS, "plen %d, pkthdr.len %d, hlen %d", plen, m->m_pkthdr.len, hlen); - NAT64STAT_INC(stats, dropped); + NAT64STAT_INC(&cfg->stats, dropped); return (NAT64MFREE); } @@ -1479,18 +1529,18 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui if (icmp6->icmp6_type != ICMP6_ECHO_REQUEST && icmp6->icmp6_type != ICMP6_ECHO_REPLY) return (nat64_handle_icmp6(m, hlen, aaddr, aport, - stats, logdata)); + cfg, logdata)); } dst.sin_addr.s_addr = ip.ip_dst.s_addr; if (nat64_find_route4(&nh, &dst, m) != 0) { - NAT64STAT_INC(stats, noroute4); + NAT64STAT_INC(&cfg->stats, noroute4); nat64_icmp6_reflect(m, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_NOROUTE, 0, stats, logdata); + ICMP6_DST_UNREACH_NOROUTE, 0, &cfg->stats, logdata); return (NAT64RETURN); } if (nh.nh_mtu < plen + sizeof(ip)) { nat64_icmp6_reflect(m, ICMP6_PACKET_TOO_BIG, 0, nh.nh_mtu, - stats, logdata); + &cfg->stats, logdata); return (NAT64RETURN); } nat64_init_ip4hdr(ip6, frag, plen, proto, &ip); @@ -1537,9 +1587,9 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui m_adj(m, hlen - sizeof(ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); - if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, NULL, - stats, logdata) == 0) - NAT64STAT_INC(stats, opcnt64); + if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, + &cfg->stats, logdata) == 0) + NAT64STAT_INC(&cfg->stats, opcnt64); return (NAT64RETURN); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sat Jun 9 03:01:39 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92857FF5556; Sat, 9 Jun 2018 03:01:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48320802A3; Sat, 9 Jun 2018 03:01:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A4D118060; Sat, 9 Jun 2018 03:01:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5931dUK081594; Sat, 9 Jun 2018 03:01:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5931doS081593; Sat, 9 Jun 2018 03:01:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806090301.w5931doS081593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 9 Jun 2018 03:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334870 - stable/11/sbin/md5 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sbin/md5 X-SVN-Commit-Revision: 334870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 03:01:39 -0000 Author: eadler Date: Sat Jun 9 03:01:38 2018 New Revision: 334870 URL: https://svnweb.freebsd.org/changeset/base/334870 Log: MFC r334091: md5: perform compare case-insenstive md5 generates a md5 hash lowercase, but it might be provided in uppercase. Allow this. PR: 205598 Reported by: ohauer MFC After: 2 weeks Modified: stable/11/sbin/md5/md5.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/md5/md5.c ============================================================================== --- stable/11/sbin/md5/md5.c Sat Jun 9 02:47:02 2018 (r334869) +++ stable/11/sbin/md5/md5.c Sat Jun 9 03:01:38 2018 (r334870) @@ -220,7 +220,7 @@ main(int argc, char *argv[]) else printf("%s (%s) = %s", Algorithm[digest].name, *argv, p); - if (checkAgainst && strcmp(checkAgainst,p)) + if (checkAgainst && strcasecmp(checkAgainst, p) != 0) { checksFailed++; if (!qflag) @@ -255,7 +255,7 @@ MDString(const Algorithm_t *alg, const char *string) printf("%s \"%s\"", buf, string); else printf("%s (\"%s\") = %s", alg->name, string, buf); - if (checkAgainst && strcmp(buf,checkAgainst)) + if (checkAgainst && strcasecmp(buf,checkAgainst) != 0) { checksFailed++; if (!qflag) From owner-svn-src-stable@freebsd.org Sat Jun 9 04:05:19 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ABABFF9148; Sat, 9 Jun 2018 04:05:19 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1D4C82970; Sat, 9 Jun 2018 04:05:18 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD38C18BF5; Sat, 9 Jun 2018 04:05:18 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5945Io0012806; Sat, 9 Jun 2018 04:05:18 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5945IHs012805; Sat, 9 Jun 2018 04:05:18 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201806090405.w5945IHs012805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Sat, 9 Jun 2018 04:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334872 - stable/11/sys/dev/ocs_fc X-SVN-Group: stable-11 X-SVN-Commit-Author: ram X-SVN-Commit-Paths: stable/11/sys/dev/ocs_fc X-SVN-Commit-Revision: 334872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 04:05:19 -0000 Author: ram Date: Sat Jun 9 04:05:18 2018 New Revision: 334872 URL: https://svnweb.freebsd.org/changeset/base/334872 Log: Issue: Utility hangs when OCS_IOCTL_CMD_MGMT_GET_ALL called in parallel on port 0 and port 1. Fix: Using static structure for results is corrupting the second ioctl request. Removed static for results structure. Approved by: ken Modified: stable/11/sys/dev/ocs_fc/ocs_mgmt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ocs_fc/ocs_mgmt.c ============================================================================== --- stable/11/sys/dev/ocs_fc/ocs_mgmt.c Sat Jun 9 03:08:04 2018 (r334871) +++ stable/11/sys/dev/ocs_fc/ocs_mgmt.c Sat Jun 9 04:05:18 2018 (r334872) @@ -2373,7 +2373,7 @@ static void get_nv_wwpn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) { char result_string[24]; - static ocs_mgmt_get_nvparms_result_t result; + ocs_mgmt_get_nvparms_result_t result; ocs_sem_init(&(result.semaphore), 0, "get_nv_wwpn"); @@ -2411,7 +2411,7 @@ static void get_nv_wwnn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) { char result_string[24]; - static ocs_mgmt_get_nvparms_result_t result; + ocs_mgmt_get_nvparms_result_t result; ocs_sem_init(&(result.semaphore), 0, "get_nv_wwnn");