From owner-dev-commits-src-all@freebsd.org Mon Aug 16 00:49:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7B576699A5; Mon, 16 Aug 2021 00:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GnwY74d21z4wBr; Mon, 16 Aug 2021 00:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 832B620126; Mon, 16 Aug 2021 00:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G0nlX9099598; Mon, 16 Aug 2021 00:49:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G0nluW099597; Mon, 16 Aug 2021 00:49:47 GMT (envelope-from git) Date: Mon, 16 Aug 2021 00:49:47 GMT Message-Id: <202108160049.17G0nluW099597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 094860333aaf - stable/13 - iichid(4): disable interrupt on suspend MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 094860333aaf63c922319f112601091af0c65ac9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 00:49:48 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=094860333aaf63c922319f112601091af0c65ac9 commit 094860333aaf63c922319f112601091af0c65ac9 Author: J.R. Oldroyd AuthorDate: 2021-05-31 19:33:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 00:45:44 +0000 iichid(4): disable interrupt on suspend Commit message of the identical change in Linux driver says: "When an I2C HID device is powered off during system sleep, as a result of removing its power resources (by the ACPI core) the interrupt line might go low as well. This results inadvertent interrupts." This change fixes suspend/resume on Asus S510UQ laptops. While here add a couple of typo fixes as well as a slight change to the iichid_attach() code to have the power_on flag set properly. Submitted by: J.R. Oldroyd Reviewed by: wulf (cherry picked from commit 5236888db77194c194706b122675af7355fe7ceb) --- sys/dev/iicbus/iichid.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 7c51a697c4c7..68d7cfd9090f 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -573,7 +573,7 @@ iichid_intr(void *context) * not allowed and often returns a garbage. If a HOST needs to * communicate with the DEVICE it MUST issue a SET POWER command * (to ON) before any other command. As some hardware requires reads to - * acknoledge interrupts we fetch only length header and discard it. + * acknowledge interrupts we fetch only length header and discard it. */ maxlen = sc->power_on ? sc->intr_bufsize : 0; error = iichid_cmd_read(sc, sc->intr_buf, maxlen, &actual); @@ -1069,14 +1069,16 @@ iichid_attach(device_t dev) error = iichid_reset(sc); if (error) { device_printf(dev, "failed to reset hardware: %d\n", error); - return (ENXIO); + error = ENXIO; + goto done; } - sc->power_on = false; + sc->power_on = true; + #ifdef IICHID_SAMPLING TASK_INIT(&sc->event_task, 0, iichid_event_task, sc); /* taskqueue_create can't fail with M_WAITOK mflag passed. */ - sc->taskqueue = taskqueue_create("hmt_tq", M_WAITOK | M_ZERO, + sc->taskqueue = taskqueue_create("iichid_tq", M_WAITOK | M_ZERO, taskqueue_thread_enqueue, &sc->taskqueue); TIMEOUT_TASK_INIT(sc->taskqueue, &sc->periodic_task, 0, iichid_event_task, sc); @@ -1144,8 +1146,10 @@ iichid_attach(device_t dev) device_printf(dev, "failed to attach child: error %d\n", error); iichid_detach(dev); } + done: (void)iichid_set_power(sc, I2C_HID_POWER_OFF); + sc->power_on = false; return (error); } @@ -1178,21 +1182,27 @@ iichid_suspend(device_t dev) int error; sc = device_get_softc(dev); - DPRINTF(sc, "Suspend called, setting device to power_state 1\n"); (void)bus_generic_suspend(dev); +#ifdef IICHID_SAMPLING + if (sc->sampling_rate_slow < 0) +#endif + (void)bus_generic_suspend_intr(device_get_parent(dev), dev, + sc->irq_res); + /* * 8.2 - The HOST is going into a deep power optimized state and wishes * to put all the devices into a low power state also. The HOST * is recommended to issue a HIPO command to the DEVICE to force * the DEVICE in to a lower power state. */ + DPRINTF(sc, "Suspend called, setting device to power_state 1\n"); error = iichid_set_power_state(sc, IICHID_PS_NULL, IICHID_PS_OFF); if (error != 0) DPRINTF(sc, "Could not set power_state, error: %d\n", error); else DPRINTF(sc, "Successfully set power_state\n"); - return (0); + return (0); } static int @@ -1209,6 +1219,11 @@ iichid_resume(device_t dev) else DPRINTF(sc, "Successfully set power_state\n"); (void)bus_generic_resume(dev); +#ifdef IICHID_SAMPLING + if (sc->sampling_rate_slow < 0) +#endif + (void)bus_generic_resume_intr(device_get_parent(dev), dev, + sc->irq_res); return (0); } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 00:49:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE39C669369; Mon, 16 Aug 2021 00:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GnwY85Hysz4vyq; Mon, 16 Aug 2021 00:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CC8020191; Mon, 16 Aug 2021 00:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G0nmsp099622; Mon, 16 Aug 2021 00:49:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G0nmIW099621; Mon, 16 Aug 2021 00:49:48 GMT (envelope-from git) Date: Mon, 16 Aug 2021 00:49:48 GMT Message-Id: <202108160049.17G0nmIW099621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: c3bccba63d0d - stable/13 - iichid(4): Perform bus_teardown_intr/bus_setup_intr to disable interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c3bccba63d0d2beb105bfc7b7c6db5ecc977ccfa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 00:49:48 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c3bccba63d0d2beb105bfc7b7c6db5ecc977ccfa commit c3bccba63d0d2beb105bfc7b7c6db5ecc977ccfa Author: Vladimir Kondratyev AuthorDate: 2021-07-09 19:32:59 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 00:46:18 +0000 iichid(4): Perform bus_teardown_intr/bus_setup_intr to disable interrupts during suspend/resume cycle. Previously used bus_generic_suspend_intr and bus_generic_resume_intr may cause interrupt storm because of missed interrupt acknowledges caused by blocking of intr handler. Reported by: J.R. Oldroyd (cherry picked from commit 82626fef6253a9172163df137097f54e93e3c209) --- sys/dev/iicbus/iichid.c | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 68d7cfd9090f..d95ffb8add88 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -177,6 +177,7 @@ struct iichid_softc { struct task event_task; #endif + struct task suspend_task; bool open; /* iicbus lock */ bool suspend; /* iicbus lock */ bool power_on; /* iicbus lock */ @@ -188,6 +189,8 @@ static device_detach_t iichid_detach; static device_resume_t iichid_resume; static device_suspend_t iichid_suspend; +static void iichid_suspend_task(void *, int); + #ifdef IICHID_SAMPLING static int iichid_setup_callout(struct iichid_softc *); static int iichid_reset_callout(struct iichid_softc *); @@ -1075,6 +1078,7 @@ iichid_attach(device_t dev) sc->power_on = true; + TASK_INIT(&sc->suspend_task, 0, iichid_suspend_task, sc); #ifdef IICHID_SAMPLING TASK_INIT(&sc->event_task, 0, iichid_event_task, sc); /* taskqueue_create can't fail with M_WAITOK mflag passed. */ @@ -1146,7 +1150,6 @@ iichid_attach(device_t dev) device_printf(dev, "failed to attach child: error %d\n", error); iichid_detach(dev); } - done: (void)iichid_set_power(sc, I2C_HID_POWER_OFF); sc->power_on = false; @@ -1175,6 +1178,14 @@ iichid_detach(device_t dev) return (0); } +static void +iichid_suspend_task(void *context, int pending) +{ + struct iichid_softc *sc = context; + + iichid_teardown_interrupt(sc); +} + static int iichid_suspend(device_t dev) { @@ -1183,12 +1194,6 @@ iichid_suspend(device_t dev) sc = device_get_softc(dev); (void)bus_generic_suspend(dev); -#ifdef IICHID_SAMPLING - if (sc->sampling_rate_slow < 0) -#endif - (void)bus_generic_suspend_intr(device_get_parent(dev), dev, - sc->irq_res); - /* * 8.2 - The HOST is going into a deep power optimized state and wishes * to put all the devices into a low power state also. The HOST @@ -1202,6 +1207,24 @@ iichid_suspend(device_t dev) else DPRINTF(sc, "Successfully set power_state\n"); +#ifdef IICHID_SAMPLING + if (sc->sampling_rate_slow < 0) +#endif + { + /* + * bus_teardown_intr can not be executed right here as it wants + * to run on certain CPU to interacts with LAPIC while suspend + * thread is bound to CPU0. So run it from taskqueue context. + */ +#ifdef IICHID_SAMPLING +#define suspend_thread sc->taskqueue +#else +#define suspend_thread taskqueue_thread +#endif + taskqueue_enqueue(suspend_thread, &sc->suspend_task); + taskqueue_drain(suspend_thread, &sc->suspend_task); + } + return (0); } @@ -1212,6 +1235,11 @@ iichid_resume(device_t dev) int error; sc = device_get_softc(dev); +#ifdef IICHID_SAMPLING + if (sc->sampling_rate_slow < 0) +#endif + iichid_setup_interrupt(sc); + DPRINTF(sc, "Resume called, setting device to power_state 0\n"); error = iichid_set_power_state(sc, IICHID_PS_NULL, IICHID_PS_ON); if (error != 0) @@ -1219,11 +1247,6 @@ iichid_resume(device_t dev) else DPRINTF(sc, "Successfully set power_state\n"); (void)bus_generic_resume(dev); -#ifdef IICHID_SAMPLING - if (sc->sampling_rate_slow < 0) -#endif - (void)bus_generic_resume_intr(device_get_parent(dev), dev, - sc->irq_res); return (0); } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 00:49:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF587669B11; Mon, 16 Aug 2021 00:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GnwY96MbPz4vt6; Mon, 16 Aug 2021 00:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C16791FE29; Mon, 16 Aug 2021 00:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G0nndK099646; Mon, 16 Aug 2021 00:49:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G0nnfb099645; Mon, 16 Aug 2021 00:49:49 GMT (envelope-from git) Date: Mon, 16 Aug 2021 00:49:49 GMT Message-Id: <202108160049.17G0nnfb099645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: f2f52fbfdb28 - stable/13 - psm(4): Probe Synaptics touchpad with active multiplexing mode enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f2f52fbfdb282d740c02a92a47737c2c3f975791 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 00:49:50 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f2f52fbfdb282d740c02a92a47737c2c3f975791 commit f2f52fbfdb282d740c02a92a47737c2c3f975791 Author: Vladimir Kondratyev AuthorDate: 2021-07-14 10:30:26 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 00:47:18 +0000 psm(4): Probe Synaptics touchpad with active multiplexing mode enabled if it is only multiplexed device. Also enable syncbit checks for them. This fixes touchpad recognition on Panasonic Toughbook CF-MX4 laptop. Reported by: Tomasz "CeDeROM" CEDRO PR: 253279 Differential revision: https://reviews.freebsd.org/D28502 (cherry picked from commit f5998d20ed80fdc1cb3ba0c245cae5f179e22fe2) --- sys/dev/atkbdc/psm.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 43d19b5174d3..f6276ae847aa 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -466,6 +466,7 @@ struct psm_softc { /* Driver status information */ int muxtpbuttons; /* Touchpad button state */ int muxmsbuttons; /* Mouse (trackpoint) button state */ struct timeval muxmidtimeout; /* middle button supression timeout */ + int muxsinglesyna; /* Probe result of single Synaptics */ #ifdef EVDEV_SUPPORT struct evdev_dev *evdev_a; /* Absolute reporting device */ struct evdev_dev *evdev_r; /* Relative reporting device */ @@ -666,6 +667,7 @@ static probefunc_t enable_4dplus; static probefunc_t enable_mmanplus; static probefunc_t enable_synaptics; static probefunc_t enable_synaptics_mux; +static probefunc_t enable_single_synaptics_mux; static probefunc_t enable_trackpoint; static probefunc_t enable_versapad; static probefunc_t enable_elantech; @@ -686,8 +688,10 @@ static struct { * WARNING: the order of probe is very important. Don't mess it * unless you know what you are doing. */ - { MOUSE_MODEL_SYNAPTICS, /* Synaptics Touchpad on Active Mux */ + { MOUSE_MODEL_SYNAPTICS, /* Synaptics + mouse on Active Mux */ 0x00, MOUSE_PS2_PACKETSIZE, enable_synaptics_mux }, + { MOUSE_MODEL_SYNAPTICS, /* Single Synaptics on Active Mux */ + 0xc0, MOUSE_SYNAPTICS_PACKETSIZE, enable_single_synaptics_mux }, { MOUSE_MODEL_NET, /* Genius NetMouse */ 0x08, MOUSE_PS2INTELLI_PACKETSIZE, enable_gmouse }, { MOUSE_MODEL_NETSCROLL, /* Genius NetScroll */ @@ -6292,6 +6296,8 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) int active_ports_count = 0; int active_ports_mask = 0; + sc->muxsinglesyna = FALSE; + if (mux_disabled == 1 || (mux_disabled == -1 && (kbdc->quirks & KBDC_QUIRK_DISABLE_MUX_PROBE) != 0)) return (FALSE); @@ -6315,18 +6321,16 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) active_ports_count); /* psm has a special support for GenMouse + SynTouchpad combination */ - if (active_ports_count >= 2) { - for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { - if ((active_ports_mask & 1 << port) == 0) - continue; - VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port)); - set_active_aux_mux_port(kbdc, port); - probe = enable_synaptics(sc, arg); - if (probe) { - if (arg == PROBE) - sc->muxport = port; - break; - } + for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { + if ((active_ports_mask & 1 << port) == 0) + continue; + VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port)); + set_active_aux_mux_port(kbdc, port); + probe = enable_synaptics(sc, arg); + if (probe) { + if (arg == PROBE) + sc->muxport = port; + break; } } @@ -6348,7 +6352,17 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) } empty_both_buffers(kbdc, 10); /* remove stray data if any */ - return (probe); + /* Don't disable syncbit checks if Synaptics is only device on MUX */ + if (active_ports_count == 1) + sc->muxsinglesyna = probe; + return (active_ports_count != 1 ? probe : FALSE); +} + +static int +enable_single_synaptics_mux(struct psm_softc *sc, enum probearg arg) +{ + /* Synaptics device is already initialized in enable_synaptics_mux */ + return (sc->muxsinglesyna); } static int From owner-dev-commits-src-all@freebsd.org Mon Aug 16 00:57:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 409576698FF; Mon, 16 Aug 2021 00:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gnwjw0svwz4wSB; Mon, 16 Aug 2021 00:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1E7E20047; Mon, 16 Aug 2021 00:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G0vNno012562; Mon, 16 Aug 2021 00:57:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G0vN9D012561; Mon, 16 Aug 2021 00:57:23 GMT (envelope-from git) Date: Mon, 16 Aug 2021 00:57:23 GMT Message-Id: <202108160057.17G0vN9D012561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0d0726a769a1 - stable/13 - e1000: Fix lem/em UDP rx csum offload MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0d0726a769a176be699b2ceeb5a417ffe88b0e64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 00:57:24 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0d0726a769a176be699b2ceeb5a417ffe88b0e64 commit 0d0726a769a176be699b2ceeb5a417ffe88b0e64 Author: Kevin Bowling AuthorDate: 2021-08-09 21:29:31 +0000 Commit: Kevin Bowling CommitDate: 2021-08-16 00:56:45 +0000 e1000: Fix lem/em UDP rx csum offload Rebase on igb code and unify lem/em implementations. PR: 257642 Reported by: Nick Reilly Reviewed by: karels, emaste Tested by: Nick Reilly Approved by: grehan MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31449 (cherry picked from commit 015075f383489fcbedbe8aae7c1c64a3d55ca75e) --- sys/dev/e1000/em_txrx.c | 67 ++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 46 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 458de96a7b9d..11f6662c5b79 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -62,8 +62,7 @@ static int lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget); static int lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri); -static void lem_receive_checksum(int status, int errors, if_rxd_info_t ri); -static void em_receive_checksum(uint32_t status, if_rxd_info_t ri); +static void em_receive_checksum(uint16_t, uint8_t, if_rxd_info_t); static int em_determine_rsstype(u32 pkt_info); extern int em_intr(void *arg); @@ -646,8 +645,8 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) } while (!eop); /* XXX add a faster way to look this up */ - if (adapter->hw.mac.type >= e1000_82543 && !(status & E1000_RXD_STAT_IXSM)) - lem_receive_checksum(status, errors, ri); + if (adapter->hw.mac.type >= e1000_82543) + em_receive_checksum(status, errors, ri); if (status & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->special); @@ -707,9 +706,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - /* XXX add a faster way to look this up */ - if (adapter->hw.mac.type >= e1000_82543) - em_receive_checksum(staterr, ri); + em_receive_checksum(staterr, staterr >> 24, ri); if (staterr & E1000_RXD_STAT_VP) { vtag = le16toh(rxd->wb.upper.vlan); @@ -734,19 +731,24 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) * *********************************************************************/ static void -lem_receive_checksum(int status, int errors, if_rxd_info_t ri) +em_receive_checksum(uint16_t status, uint8_t errors, if_rxd_info_t ri) { - /* Did it pass? */ - if (status & E1000_RXD_STAT_IPCS && !(errors & E1000_RXD_ERR_IPE)) - ri->iri_csum_flags = (CSUM_IP_CHECKED|CSUM_IP_VALID); - - if (status & E1000_RXD_STAT_TCPCS) { - /* Did it pass? */ - if (!(errors & E1000_RXD_ERR_TCPE)) { - ri->iri_csum_flags |= - (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - ri->iri_csum_data = htons(0xffff); - } + if (__predict_false(status & E1000_RXD_STAT_IXSM)) + return; + + /* If there is a layer 3 or 4 error we are done */ + if (__predict_false(errors & (E1000_RXD_ERR_IPE | E1000_RXD_ERR_TCPE))) + return; + + /* IP Checksum Good */ + if (status & E1000_RXD_STAT_IPCS) + ri->iri_csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + + /* Valid L4E checksum */ + if (__predict_true(status & + (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS))) { + ri->iri_csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + ri->iri_csum_data = htons(0xffff); } } @@ -775,30 +777,3 @@ em_determine_rsstype(u32 pkt_info) return M_HASHTYPE_OPAQUE; } } - -static void -em_receive_checksum(uint32_t status, if_rxd_info_t ri) -{ - ri->iri_csum_flags = 0; - - /* Ignore Checksum bit is set */ - if (status & E1000_RXD_STAT_IXSM) - return; - - /* If the IP checksum exists and there is no IP Checksum error */ - if ((status & (E1000_RXD_STAT_IPCS | E1000_RXDEXT_STATERR_IPE)) == - E1000_RXD_STAT_IPCS) { - ri->iri_csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); - } - - /* TCP or UDP checksum */ - if ((status & (E1000_RXD_STAT_TCPCS | E1000_RXDEXT_STATERR_TCPE)) == - E1000_RXD_STAT_TCPCS) { - ri->iri_csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - ri->iri_csum_data = htons(0xffff); - } - if (status & E1000_RXD_STAT_UDPCS) { - ri->iri_csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - ri->iri_csum_data = htons(0xffff); - } -} From owner-dev-commits-src-all@freebsd.org Mon Aug 16 00:58:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FFD5669C62; Mon, 16 Aug 2021 00:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GnwlX1PZhz4wxw; Mon, 16 Aug 2021 00:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 186131FEE6; Mon, 16 Aug 2021 00:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G0wmuZ012771; Mon, 16 Aug 2021 00:58:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G0wlsN012770; Mon, 16 Aug 2021 00:58:47 GMT (envelope-from git) Date: Mon, 16 Aug 2021 00:58:47 GMT Message-Id: <202108160058.17G0wlsN012770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: ec56aaca91b2 - stable/12 - e1000: Fix lem/em UDP rx csum offload MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ec56aaca91b243be590fdb3b8f0e6ee3b0b2e9f0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 00:58:48 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ec56aaca91b243be590fdb3b8f0e6ee3b0b2e9f0 commit ec56aaca91b243be590fdb3b8f0e6ee3b0b2e9f0 Author: Kevin Bowling AuthorDate: 2021-08-09 21:29:31 +0000 Commit: Kevin Bowling CommitDate: 2021-08-16 00:58:11 +0000 e1000: Fix lem/em UDP rx csum offload Rebase on igb code and unify lem/em implementations. PR: 257642 Reported by: Nick Reilly Reviewed by: karels, emaste Tested by: Nick Reilly Approved by: grehan MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31449 (cherry picked from commit 015075f383489fcbedbe8aae7c1c64a3d55ca75e) --- sys/dev/e1000/em_txrx.c | 67 ++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 46 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 458de96a7b9d..11f6662c5b79 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -62,8 +62,7 @@ static int lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget); static int lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri); -static void lem_receive_checksum(int status, int errors, if_rxd_info_t ri); -static void em_receive_checksum(uint32_t status, if_rxd_info_t ri); +static void em_receive_checksum(uint16_t, uint8_t, if_rxd_info_t); static int em_determine_rsstype(u32 pkt_info); extern int em_intr(void *arg); @@ -646,8 +645,8 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) } while (!eop); /* XXX add a faster way to look this up */ - if (adapter->hw.mac.type >= e1000_82543 && !(status & E1000_RXD_STAT_IXSM)) - lem_receive_checksum(status, errors, ri); + if (adapter->hw.mac.type >= e1000_82543) + em_receive_checksum(status, errors, ri); if (status & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->special); @@ -707,9 +706,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - /* XXX add a faster way to look this up */ - if (adapter->hw.mac.type >= e1000_82543) - em_receive_checksum(staterr, ri); + em_receive_checksum(staterr, staterr >> 24, ri); if (staterr & E1000_RXD_STAT_VP) { vtag = le16toh(rxd->wb.upper.vlan); @@ -734,19 +731,24 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) * *********************************************************************/ static void -lem_receive_checksum(int status, int errors, if_rxd_info_t ri) +em_receive_checksum(uint16_t status, uint8_t errors, if_rxd_info_t ri) { - /* Did it pass? */ - if (status & E1000_RXD_STAT_IPCS && !(errors & E1000_RXD_ERR_IPE)) - ri->iri_csum_flags = (CSUM_IP_CHECKED|CSUM_IP_VALID); - - if (status & E1000_RXD_STAT_TCPCS) { - /* Did it pass? */ - if (!(errors & E1000_RXD_ERR_TCPE)) { - ri->iri_csum_flags |= - (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - ri->iri_csum_data = htons(0xffff); - } + if (__predict_false(status & E1000_RXD_STAT_IXSM)) + return; + + /* If there is a layer 3 or 4 error we are done */ + if (__predict_false(errors & (E1000_RXD_ERR_IPE | E1000_RXD_ERR_TCPE))) + return; + + /* IP Checksum Good */ + if (status & E1000_RXD_STAT_IPCS) + ri->iri_csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + + /* Valid L4E checksum */ + if (__predict_true(status & + (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS))) { + ri->iri_csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + ri->iri_csum_data = htons(0xffff); } } @@ -775,30 +777,3 @@ em_determine_rsstype(u32 pkt_info) return M_HASHTYPE_OPAQUE; } } - -static void -em_receive_checksum(uint32_t status, if_rxd_info_t ri) -{ - ri->iri_csum_flags = 0; - - /* Ignore Checksum bit is set */ - if (status & E1000_RXD_STAT_IXSM) - return; - - /* If the IP checksum exists and there is no IP Checksum error */ - if ((status & (E1000_RXD_STAT_IPCS | E1000_RXDEXT_STATERR_IPE)) == - E1000_RXD_STAT_IPCS) { - ri->iri_csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); - } - - /* TCP or UDP checksum */ - if ((status & (E1000_RXD_STAT_TCPCS | E1000_RXDEXT_STATERR_TCPE)) == - E1000_RXD_STAT_TCPCS) { - ri->iri_csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - ri->iri_csum_data = htons(0xffff); - } - if (status & E1000_RXD_STAT_UDPCS) { - ri->iri_csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - ri->iri_csum_data = htons(0xffff); - } -} From owner-dev-commits-src-all@freebsd.org Mon Aug 16 01:00:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 151EC669BDB; Mon, 16 Aug 2021 01:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GnwnB01H9z4xRY; Mon, 16 Aug 2021 01:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD82920049; Mon, 16 Aug 2021 01:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G10Dgw018450; Mon, 16 Aug 2021 01:00:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G10DXu018442; Mon, 16 Aug 2021 01:00:13 GMT (envelope-from git) Date: Mon, 16 Aug 2021 01:00:13 GMT Message-Id: <202108160100.17G10DXu018442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: e57850820d47 - stable/12 - psm(4): Probe Synaptics touchpad with active multiplexing mode enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e57850820d4732b248458007cad2e70c43156a90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 01:00:14 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e57850820d4732b248458007cad2e70c43156a90 commit e57850820d4732b248458007cad2e70c43156a90 Author: Vladimir Kondratyev AuthorDate: 2021-07-14 10:30:26 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 00:58:41 +0000 psm(4): Probe Synaptics touchpad with active multiplexing mode enabled if it is only multiplexed device. Also enable syncbit checks for them. This fixes touchpad recognition on Panasonic Toughbook CF-MX4 laptop. Reported by: Tomasz "CeDeROM" CEDRO PR: 253279 Differential revision: https://reviews.freebsd.org/D28502 (cherry picked from commit f5998d20ed80fdc1cb3ba0c245cae5f179e22fe2) --- sys/dev/atkbdc/psm.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index f9b8b098ea87..cae4ac41fb32 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -465,6 +465,7 @@ struct psm_softc { /* Driver status information */ int muxtpbuttons; /* Touchpad button state */ int muxmsbuttons; /* Mouse (trackpoint) button state */ struct timeval muxmidtimeout; /* middle button supression timeout */ + int muxsinglesyna; /* Probe result of single Synaptics */ #ifdef EVDEV_SUPPORT struct evdev_dev *evdev_a; /* Absolute reporting device */ struct evdev_dev *evdev_r; /* Relative reporting device */ @@ -665,6 +666,7 @@ static probefunc_t enable_4dplus; static probefunc_t enable_mmanplus; static probefunc_t enable_synaptics; static probefunc_t enable_synaptics_mux; +static probefunc_t enable_single_synaptics_mux; static probefunc_t enable_trackpoint; static probefunc_t enable_versapad; static probefunc_t enable_elantech; @@ -685,8 +687,10 @@ static struct { * WARNING: the order of probe is very important. Don't mess it * unless you know what you are doing. */ - { MOUSE_MODEL_SYNAPTICS, /* Synaptics Touchpad on Active Mux */ + { MOUSE_MODEL_SYNAPTICS, /* Synaptics + mouse on Active Mux */ 0x00, MOUSE_PS2_PACKETSIZE, enable_synaptics_mux }, + { MOUSE_MODEL_SYNAPTICS, /* Single Synaptics on Active Mux */ + 0xc0, MOUSE_SYNAPTICS_PACKETSIZE, enable_single_synaptics_mux }, { MOUSE_MODEL_NET, /* Genius NetMouse */ 0x08, MOUSE_PS2INTELLI_PACKETSIZE, enable_gmouse }, { MOUSE_MODEL_NETSCROLL, /* Genius NetScroll */ @@ -6256,6 +6260,8 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) int active_ports_count = 0; int active_ports_mask = 0; + sc->muxsinglesyna = FALSE; + if (mux_disabled == 1 || (mux_disabled == -1 && (kbdcp(kbdc)->quirks & KBDC_QUIRK_DISABLE_MUX_PROBE) != 0)) return (FALSE); @@ -6279,18 +6285,16 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) active_ports_count); /* psm has a special support for GenMouse + SynTouchpad combination */ - if (active_ports_count >= 2) { - for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { - if ((active_ports_mask & 1 << port) == 0) - continue; - VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port)); - set_active_aux_mux_port(kbdc, port); - probe = enable_synaptics(sc, arg); - if (probe) { - if (arg == PROBE) - sc->muxport = port; - break; - } + for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { + if ((active_ports_mask & 1 << port) == 0) + continue; + VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port)); + set_active_aux_mux_port(kbdc, port); + probe = enable_synaptics(sc, arg); + if (probe) { + if (arg == PROBE) + sc->muxport = port; + break; } } @@ -6312,7 +6316,17 @@ enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) } empty_both_buffers(kbdc, 10); /* remove stray data if any */ - return (probe); + /* Don't disable syncbit checks if Synaptics is only device on MUX */ + if (active_ports_count == 1) + sc->muxsinglesyna = probe; + return (active_ports_count != 1 ? probe : FALSE); +} + +static int +enable_single_synaptics_mux(struct psm_softc *sc, enum probearg arg) +{ + /* Synaptics device is already initialized in enable_synaptics_mux */ + return (sc->muxsinglesyna); } static int From owner-dev-commits-src-all@freebsd.org Mon Aug 16 04:28:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1F8066BD70; Mon, 16 Aug 2021 04:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp1Pk5mpmz589B; Mon, 16 Aug 2021 04:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE23522BD1; Mon, 16 Aug 2021 04:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G4Sgag092617; Mon, 16 Aug 2021 04:28:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G4SgWS092616; Mon, 16 Aug 2021 04:28:42 GMT (envelope-from git) Date: Mon, 16 Aug 2021 04:28:42 GMT Message-Id: <202108160428.17G4SgWS092616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 59d1661cd8b0 - main - tpm_tis: Improve interrupt allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59d1661cd8b02d13bc697e9dc0ff97844e719d9b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 04:28:43 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=59d1661cd8b02d13bc697e9dc0ff97844e719d9b commit 59d1661cd8b02d13bc697e9dc0ff97844e719d9b Author: Kornel Duleba AuthorDate: 2021-08-16 04:26:50 +0000 Commit: Wojciech Macek CommitDate: 2021-08-16 04:28:33 +0000 tpm_tis: Improve interrupt allocation Validate the irq received from ACPI. Test if it works by sending a simple command and checking if the interrupt handler was executed. Internal buffer allocation was moved away from common code to tis and crb parts - in order to test the interrupt we need to have it allocated early. Obtained from: Semihalf Differential revision: https://reviews.freebsd.org/D31395 --- sys/dev/tpm/tpm20.c | 3 -- sys/dev/tpm/tpm20.h | 2 + sys/dev/tpm/tpm_crb.c | 11 +++-- sys/dev/tpm/tpm_tis.c | 119 ++++++++++++++++++++++++++++---------------------- 4 files changed, 77 insertions(+), 58 deletions(-) diff --git a/sys/dev/tpm/tpm20.c b/sys/dev/tpm/tpm20.c index eeddad85009d..68a30cfb51dd 100644 --- a/sys/dev/tpm/tpm20.c +++ b/sys/dev/tpm/tpm20.c @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); */ #define TPM_HARVEST_INTERVAL 10000000 -MALLOC_DECLARE(M_TPM20); MALLOC_DEFINE(M_TPM20, "tpm_buffer", "buffer for tpm 2.0 driver"); static void tpm20_discard_buffer(void *arg); @@ -191,8 +190,6 @@ tpm20_init(struct tpm_sc *sc) struct make_dev_args args; int result; - sc->buf = malloc(TPM_BUFSIZE, M_TPM20, M_WAITOK); - sx_init(&sc->dev_lock, "TPM driver lock"); cv_init(&sc->buf_cv, "TPM buffer cv"); callout_init(&sc->discard_buffer_callout, 1); #ifdef TPM_HARVEST diff --git a/sys/dev/tpm/tpm20.h b/sys/dev/tpm/tpm20.h index bafbd93dc136..6911ca0cb6fe 100644 --- a/sys/dev/tpm/tpm20.h +++ b/sys/dev/tpm/tpm20.h @@ -100,6 +100,8 @@ __FBSDID("$FreeBSD$"); #define TPM2_START_METHOD_CRB 7 #define TPM2_START_METHOD_CRB_ACPI 8 +MALLOC_DECLARE(M_TPM20); + struct tpm_sc { device_t dev; diff --git a/sys/dev/tpm/tpm_crb.c b/sys/dev/tpm/tpm_crb.c index 5345be261d16..d45b714bffc4 100644 --- a/sys/dev/tpm/tpm_crb.c +++ b/sys/dev/tpm/tpm_crb.c @@ -155,18 +155,21 @@ tpmcrb_attach(device_t dev) crb_sc = device_get_softc(dev); sc = &crb_sc->base; handle = acpi_get_handle(dev); - sc->dev = dev; + sx_init(&sc->dev_lock, "TPM driver lock"); + sc->buf = malloc(TPM_BUFSIZE, M_TPM20, M_WAITOK); + sc->mem_rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, RF_ACTIVE); - if (sc->mem_res == NULL) + if (sc->mem_res == NULL) { + tpmcrb_detach(dev); return (ENXIO); + } if(!tpmcrb_request_locality(sc, 0)) { - bus_release_resource(dev, SYS_RES_MEMORY, - sc->mem_rid, sc->mem_res); + tpmcrb_detach(dev); return (ENXIO); } diff --git a/sys/dev/tpm/tpm_tis.c b/sys/dev/tpm/tpm_tis.c index 132d238d42bd..02779f2bf2f2 100644 --- a/sys/dev/tpm/tpm_tis.c +++ b/sys/dev/tpm/tpm_tis.c @@ -82,8 +82,7 @@ static int tpmtis_detach(device_t dev); static void tpmtis_intr_handler(void *arg); -static ACPI_STATUS tpmtis_get_SIRQ_channel(ACPI_RESOURCE *res, void *arg); -static bool tpmtis_setup_intr(struct tpm_sc *sc); +static void tpmtis_setup_intr(struct tpm_sc *sc); static bool tpmtis_read_bytes(struct tpm_sc *sc, size_t count, uint8_t *buf); static bool tpmtis_write_bytes(struct tpm_sc *sc, size_t count, uint8_t *buf); @@ -126,30 +125,35 @@ tpmtis_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + sc->transmit = tpmtis_transmit; + sc->intr_type = -1; + + sx_init(&sc->dev_lock, "TPM driver lock"); + sc->buf = malloc(TPM_BUFSIZE, M_TPM20, M_WAITOK); sc->mem_rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, RF_ACTIVE); - if (sc->mem_res == NULL) + if (sc->mem_res == NULL) { + tpmtis_detach(dev); return (ENXIO); + } sc->irq_rid = 0; sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, RF_ACTIVE | RF_SHAREABLE); - if (sc->irq_res != NULL) { - if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - NULL, tpmtis_intr_handler, sc, &sc->intr_cookie)) - sc->interrupts = false; - else - sc->interrupts = tpmtis_setup_intr(sc); - } else { - sc->interrupts = false; + if (sc->irq_res == NULL) + goto skip_irq; + + result = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, tpmtis_intr_handler, sc, &sc->intr_cookie); + if (result != 0) { + bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq_res); + goto skip_irq; } + tpmtis_setup_intr(sc); - sc->intr_type = -1; - - sc->transmit = tpmtis_transmit; - +skip_irq: result = tpm20_init(sc); if (result != 0) tpmtis_detach(dev); @@ -179,55 +183,63 @@ tpmtis_detach(device_t dev) return (0); } -static ACPI_STATUS -tpmtis_get_SIRQ_channel(ACPI_RESOURCE *res, void *arg) +/* + * Test if the advertisted interrupt actually works. + * This sends a simple command. (GetRandom) + * Interrupts are then enabled in the handler. + */ +static void +tpmtis_test_intr(struct tpm_sc *sc) { - struct tpm_sc *sc; - uint8_t channel; - - sc = (struct tpm_sc *)arg; - - switch (res->Type) { - case ACPI_RESOURCE_TYPE_IRQ: - channel = res->Data.Irq.Interrupts[0]; - break; - case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: - channel = res->Data.ExtendedIrq.Interrupts[0]; - break; - default: - return (AE_OK); - } - - WR1(sc, TPM_INT_VECTOR, channel); - return (AE_OK); + uint8_t cmd[] = { + 0x80, 0x01, /* TPM_ST_NO_SESSIONS tag*/ + 0x00, 0x00, 0x00, 0x0c, /* cmd length */ + 0x00, 0x00, 0x01, 0x7b, /* cmd TPM_CC_GetRandom */ + 0x00, 0x01 /* number of bytes requested */ + }; + + sx_xlock(&sc->dev_lock); + memcpy(sc->buf, cmd, sizeof(cmd)); + tpmtis_transmit(sc, sizeof(cmd)); + sc->pending_data_length = 0; + sx_xunlock(&sc->dev_lock); } -static bool +static void tpmtis_setup_intr(struct tpm_sc *sc) { - ACPI_STATUS status; - ACPI_HANDLE handle; - uint32_t irq_mask; + uint32_t reg; + uint8_t irq; + + irq = bus_get_resource_start(sc->dev, SYS_RES_IRQ, sc->irq_rid); - handle = acpi_get_handle(sc->dev); + /* + * SIRQ has to be between 1 - 15. + * I found a system with ACPI table that reported a value of 0x2d. + * An attempt to use such value resulted in an interrupt storm. + */ + if (irq == 0 || irq > 0xF) + return; if(!tpmtis_request_locality(sc, 0)) - return (false); + sc->interrupts = false; + + WR1(sc, TPM_INT_VECTOR, irq); + + /* Clear all pending interrupts. */ + reg = RD4(sc, TPM_INT_STS); + WR4(sc, TPM_INT_STS, reg); - irq_mask = RD4(sc, TPM_INT_ENABLE); - irq_mask |= TPM_INT_ENABLE_GLOBAL_ENABLE | + reg = RD4(sc, TPM_INT_ENABLE); + reg |= TPM_INT_ENABLE_GLOBAL_ENABLE | TPM_INT_ENABLE_DATA_AVAIL | TPM_INT_ENABLE_LOC_CHANGE | TPM_INT_ENABLE_CMD_RDY | TPM_INT_ENABLE_STS_VALID; - WR4(sc, TPM_INT_ENABLE, irq_mask); - - status = AcpiWalkResources(handle, "_CRS", - tpmtis_get_SIRQ_channel, (void *)sc); + WR4(sc, TPM_INT_ENABLE, reg); tpmtis_relinquish_locality(sc); - - return (ACPI_SUCCESS(status)); + tpmtis_test_intr(sc); } static void @@ -240,8 +252,13 @@ tpmtis_intr_handler(void *arg) status = RD4(sc, TPM_INT_STS); WR4(sc, TPM_INT_STS, status); - if (sc->intr_type != -1 && sc->intr_type & status) - wakeup(sc); + + /* Check for stray interrupts. */ + if (sc->intr_type == -1 || (sc->intr_type & status) == 0) + return; + + sc->interrupts = true; + wakeup(sc); } static bool From owner-dev-commits-src-all@freebsd.org Mon Aug 16 05:20:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA03966CEA1; Mon, 16 Aug 2021 05:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp2YD4bJfz3CWy; Mon, 16 Aug 2021 05:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8540C238D0; Mon, 16 Aug 2021 05:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G5KGBf065512; Mon, 16 Aug 2021 05:20:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G5KGfm065508; Mon, 16 Aug 2021 05:20:16 GMT (envelope-from git) Date: Mon, 16 Aug 2021 05:20:16 GMT Message-Id: <202108160520.17G5KGfm065508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: bb151177614a - stable/13 - iscontrol(8): Fix a typo in a struct MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bb151177614a7187a489baff49f6a05e5400a95f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 05:20:16 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bb151177614a7187a489baff49f6a05e5400a95f commit bb151177614a7187a489baff49f6a05e5400a95f Author: Gordon Bergling AuthorDate: 2021-08-11 07:55:08 +0000 Commit: Gordon Bergling CommitDate: 2021-08-16 05:20:00 +0000 iscontrol(8): Fix a typo in a struct - s/suport/support/ (cherry picked from commit 1e1fbf3b47d7296896593b1e477141263b0c555f) --- sbin/iscontrol/login.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/iscontrol/login.c b/sbin/iscontrol/login.c index 7cb990029047..c4fbc46548e9 100644 --- a/sbin/iscontrol/login.c +++ b/sbin/iscontrol/login.c @@ -59,7 +59,7 @@ static char *status_class1[] = { "Too many connections", "Missing parameter", "Can't include in session", - "Session type not suported", + "Session type not supported", "Session does not exist", "Invalid during login", }; From owner-dev-commits-src-all@freebsd.org Mon Aug 16 05:20:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A41366CC2B; Mon, 16 Aug 2021 05:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp2Ym6ZYJz3Cc5; Mon, 16 Aug 2021 05:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAB13238D4; Mon, 16 Aug 2021 05:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G5Ki4K068182; Mon, 16 Aug 2021 05:20:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G5KiTp068181; Mon, 16 Aug 2021 05:20:44 GMT (envelope-from git) Date: Mon, 16 Aug 2021 05:20:44 GMT Message-Id: <202108160520.17G5KiTp068181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 71a74e216830 - stable/13 - ipfw(8): Fix a typo in an error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71a74e21683025b1e69a0a2c6936a2b189bf8b76 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 05:20:45 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=71a74e21683025b1e69a0a2c6936a2b189bf8b76 commit 71a74e21683025b1e69a0a2c6936a2b189bf8b76 Author: Gordon Bergling AuthorDate: 2021-08-11 07:53:01 +0000 Commit: Gordon Bergling CommitDate: 2021-08-16 05:20:31 +0000 ipfw(8): Fix a typo in an error message - s/suport/support/ (cherry picked from commit 809ad8170aa97e570ef5e1e414b4c25e4b58044c) --- sbin/ipfw/ipfw2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index fb1d9a4a180b..deb46fc64e00 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -4127,7 +4127,7 @@ chkarg: action->arg1 = strtoul(*av, NULL, 10); if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) - errx(EX_DATAERR, "fibs not suported.\n"); + errx(EX_DATAERR, "fibs not supported.\n"); if (action->arg1 >= numfibs) /* Temporary */ errx(EX_DATAERR, "fib too large.\n"); /* Add high-order bit to fib to make room for tablearg*/ From owner-dev-commits-src-all@freebsd.org Mon Aug 16 05:21:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8D6566C7D9; Mon, 16 Aug 2021 05:21:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp2ZK5YHPz3ClR; Mon, 16 Aug 2021 05:21:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6CE82354E; Mon, 16 Aug 2021 05:21:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G5LDD1068339; Mon, 16 Aug 2021 05:21:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G5LDtB068338; Mon, 16 Aug 2021 05:21:13 GMT (envelope-from git) Date: Mon, 16 Aug 2021 05:21:13 GMT Message-Id: <202108160521.17G5LDtB068338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ae69c3104e35 - stable/12 - iscontrol(8): Fix a typo in a struct MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ae69c3104e35d890014ce0d826beeff9e5527929 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 05:21:13 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ae69c3104e35d890014ce0d826beeff9e5527929 commit ae69c3104e35d890014ce0d826beeff9e5527929 Author: Gordon Bergling AuthorDate: 2021-08-11 07:55:08 +0000 Commit: Gordon Bergling CommitDate: 2021-08-16 05:20:57 +0000 iscontrol(8): Fix a typo in a struct - s/suport/support/ (cherry picked from commit 1e1fbf3b47d7296896593b1e477141263b0c555f) --- sbin/iscontrol/login.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/iscontrol/login.c b/sbin/iscontrol/login.c index 7cb990029047..c4fbc46548e9 100644 --- a/sbin/iscontrol/login.c +++ b/sbin/iscontrol/login.c @@ -59,7 +59,7 @@ static char *status_class1[] = { "Too many connections", "Missing parameter", "Can't include in session", - "Session type not suported", + "Session type not supported", "Session does not exist", "Invalid during login", }; From owner-dev-commits-src-all@freebsd.org Mon Aug 16 05:21:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5499366D14C; Mon, 16 Aug 2021 05:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp2Zp1zD7z3Cw5; Mon, 16 Aug 2021 05:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21B34238F0; Mon, 16 Aug 2021 05:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G5Lc7i069329; Mon, 16 Aug 2021 05:21:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G5LcDK069327; Mon, 16 Aug 2021 05:21:38 GMT (envelope-from git) Date: Mon, 16 Aug 2021 05:21:38 GMT Message-Id: <202108160521.17G5LcDK069327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 9cb0382ada88 - stable/12 - ipfw(8): Fix a typo in an error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9cb0382ada8835bb3bb94ea4fb54e4a649662c01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 05:21:38 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9cb0382ada8835bb3bb94ea4fb54e4a649662c01 commit 9cb0382ada8835bb3bb94ea4fb54e4a649662c01 Author: Gordon Bergling AuthorDate: 2021-08-11 07:53:01 +0000 Commit: Gordon Bergling CommitDate: 2021-08-16 05:21:21 +0000 ipfw(8): Fix a typo in an error message - s/suport/support/ (cherry picked from commit 809ad8170aa97e570ef5e1e414b4c25e4b58044c) --- sbin/ipfw/ipfw2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 8f06563d61a8..feb55b403f0a 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -4127,7 +4127,7 @@ chkarg: action->arg1 = strtoul(*av, NULL, 10); if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) - errx(EX_DATAERR, "fibs not suported.\n"); + errx(EX_DATAERR, "fibs not supported.\n"); if (action->arg1 >= numfibs) /* Temporary */ errx(EX_DATAERR, "fib too large.\n"); /* Add high-order bit to fib to make room for tablearg*/ From owner-dev-commits-src-all@freebsd.org Mon Aug 16 06:08:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC81366D165; Mon, 16 Aug 2021 06:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp3cf4xQ1z3GTW; Mon, 16 Aug 2021 06:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82E6524050; Mon, 16 Aug 2021 06:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G68IfS029084; Mon, 16 Aug 2021 06:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G68IJk029083; Mon, 16 Aug 2021 06:08:18 GMT (envelope-from git) Date: Mon, 16 Aug 2021 06:08:18 GMT Message-Id: <202108160608.17G68IJk029083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 239aebee61b8 - main - domain: give domains a chance to probe for availability MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 239aebee61b85d9a050d09a37fce2c2df8f36fc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 06:08:18 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=239aebee61b85d9a050d09a37fce2c2df8f36fc1 commit 239aebee61b85d9a050d09a37fce2c2df8f36fc1 Author: Kyle Evans AuthorDate: 2020-06-26 02:17:47 +0000 Commit: Kyle Evans CommitDate: 2021-08-16 05:59:56 +0000 domain: give domains a chance to probe for availability This gives any given domain a chance to indicate that it's not actually supported on the current system. If dom_probe isn't supplied, we assume the domain is universally applicable as most of them are. Keeping fully-initialized and registered domains around that physically can't work on a large majority of FreeBSD deployments is sub-optimal and leads to errors that aren't consistent with the reality of why the socket can't be created (e.g. ESOCKTNOSUPPORT) because such scenario has to be caught upon pru_attach, at which point kicking back the more-appropriate EAFNOSUPPORT would seem weird. The initial consumer of this will be hvsock, which is only available on HyperV guests. Reviewed by: cem (earlier version), bcr (manpages) Differential Revision: https://reviews.freebsd.org/D25062 --- share/man/man9/Makefile | 1 + share/man/man9/domain.9 | 32 +++++++++++++++++++++++++++++--- sys/kern/uipc_domain.c | 9 +++++++++ sys/sys/domain.h | 5 +++++ 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 47c642319049..d7d26419b042 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1011,6 +1011,7 @@ MLINKS+=dnv.9 dnvlist.9 \ dnv.9 dnvlist_take_string.9 MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 domain_add.9 \ + domain.9 domain_init.9 \ domain.9 pfctlinput.9 \ domain.9 pffinddomain.9 \ domain.9 pffindproto.9 \ diff --git a/share/man/man9/domain.9 b/share/man/man9/domain.9 index e8f97253a1d4..03e83edfc14b 100644 --- a/share/man/man9/domain.9 +++ b/share/man/man9/domain.9 @@ -31,6 +31,7 @@ .Os .Sh NAME .Nm domain_add , +.Nm domain_init , .Nm pfctlinput , .Nm pffinddomain , .Nm pffindproto , @@ -45,6 +46,8 @@ .Ft void .Fn domain_add "void *data" .Ft void +.Fn domain_init "void *data" +.Ft void .Fn pfctlinput "int cmd" "struct sockaddr *sa" .Ft struct domain * .Fn pffinddomain "int family" @@ -65,8 +68,10 @@ and struct domain { int dom_family; /* AF_xxx */ char *dom_name; + int dom_flags; void (*dom_init) /* initialize domain data structures */ (void); + int (*dom_probe)(void); /* check for support (optional) */ void (*dom_destroy) /* cleanup structures / state */ (void); int (*dom_externalize) /* externalize access rights */ @@ -143,15 +148,36 @@ is not called directly, instead .Fn DOMAIN_SET is used. .Pp -If the new domain has defined an initialization routine, it is called by -.Fn domain_add ; +If the new domain has defined a probe routine, it is called first in +.Fn domain_add +to determine if the domain should be supported on the current system. +If the probe routine returns a non-0 value, then the domain will not be +marked as supported. +Unsupported domains do not proceed with the initialization process and are not +discoverable by +.Fn pffinddomain , +.Fn pffindtype , +or +.Fn pffindproto . +.Pp +.Fn domain_init +is called after +.Fn domain_add +during boot and for each +.Xr vnet 9 . +If the new domain has defined an initialization routine, it is called during +.Fn domain_init ; as well, each of the protocols within the domain that have defined an initialization routine will have theirs called. +Note that domain initialization cannot fail at this time. .Pp -Once a domain is added it cannot be unloaded. +Once a domain is added it cannot be completely unloaded. This is because there is no reference counting system in place to determine if there are any active references from sockets within that domain. +If the domain defines a +.Fn dom_destroy +routine, then it will be invoked during vnet teardown. .Pp .Fn pffinddomain finds a domain by family. diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 60e30eb1ae00..50d6c0a9d9f8 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -172,7 +172,11 @@ domain_init(void *arg) { struct domain *dp = arg; struct protosw *pr; + int flags; + flags = atomic_load_acq_int(&dp->dom_flags); + if ((flags & DOMF_SUPPORTED) == 0) + return; if (dp->dom_init) (*dp->dom_init)(); for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) @@ -200,6 +204,8 @@ vnet_domain_uninit(void *arg) { struct domain *dp = arg; + if ((atomic_load_acq_int(&dp->dom_flags) & DOMF_SUPPORTED) == 0) + return; if (dp->dom_destroy) (*dp->dom_destroy)(); } @@ -216,6 +222,9 @@ domain_add(void *data) struct domain *dp; dp = (struct domain *)data; + if (dp->dom_probe != NULL && (*dp->dom_probe)() != 0) + return; + atomic_set_rel_int(&dp->dom_flags, DOMF_SUPPORTED); mtx_lock(&dom_mtx); dp->dom_next = domains; domains = dp; diff --git a/sys/sys/domain.h b/sys/sys/domain.h index 3d17879f1ccd..a59f4e230a1d 100644 --- a/sys/sys/domain.h +++ b/sys/sys/domain.h @@ -50,8 +50,10 @@ struct rib_head; struct domain { int dom_family; /* AF_xxx */ char *dom_name; + int dom_flags; void (*dom_init) /* initialize domain data structures */ (void); + int (*dom_probe)(void); /* check for support (optional) */ void (*dom_destroy) /* cleanup structures / state */ (void); int (*dom_externalize) /* externalize access rights */ @@ -70,6 +72,9 @@ struct domain { /* af-dependent data on ifnet */ }; +/* dom_flags */ +#define DOMF_SUPPORTED 0x0001 /* System supports this domain. */ + #ifdef _KERNEL extern int domain_init_status; extern struct domain *domains; From owner-dev-commits-src-all@freebsd.org Mon Aug 16 06:08:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D454E66D9EE; Mon, 16 Aug 2021 06:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp3cg53GJz3GM3; Mon, 16 Aug 2021 06:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EDD624417; Mon, 16 Aug 2021 06:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G68JBH029108; Mon, 16 Aug 2021 06:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G68J2o029107; Mon, 16 Aug 2021 06:08:19 GMT (envelope-from git) Date: Mon, 16 Aug 2021 06:08:19 GMT Message-Id: <202108160608.17G68J2o029107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 625932c9aa2c - main - hvsock: fail the probe on non-HyperV machines MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 625932c9aa2c9fc0d2fb7b10b838f40ca7d808fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 06:08:19 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=625932c9aa2c9fc0d2fb7b10b838f40ca7d808fc commit 625932c9aa2c9fc0d2fb7b10b838f40ca7d808fc Author: Kyle Evans AuthorDate: 2021-08-04 20:57:55 +0000 Commit: Kyle Evans CommitDate: 2021-08-16 05:59:56 +0000 hvsock: fail the probe on non-HyperV machines Differential Revision: https://reviews.freebsd.org/D25459 --- sys/dev/hyperv/hvsock/hv_sock.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/sys/dev/hyperv/hvsock/hv_sock.c b/sys/dev/hyperv/hvsock/hv_sock.c index 00e296fcd335..a920d1850c7d 100644 --- a/sys/dev/hyperv/hvsock/hv_sock.c +++ b/sys/dev/hyperv/hvsock/hv_sock.c @@ -74,6 +74,8 @@ SYSCTL_INT(_net_hvsock, OID_AUTO, hvs_dbg_level, CTLFLAG_RWTUN, &hvs_dbg_level, MALLOC_DEFINE(M_HVSOCK, "hyperv_socket", "hyperv socket control structures"); +static int hvs_dom_probe(void); + /* The MTU is 16KB per host side's design */ #define HVSOCK_MTU_SIZE (1024 * 16) #define HVSOCK_SEND_BUF_SZ (PAGE_SIZE - sizeof(struct vmpipe_proto_header)) @@ -124,6 +126,7 @@ static struct protosw hv_socket_protosw[] = { static struct domain hv_socket_domain = { .dom_family = AF_HYPERV, .dom_name = "hyperv", + .dom_probe = hvs_dom_probe, .dom_protosw = hv_socket_protosw, .dom_protoswNPROTOSW = &hv_socket_protosw[nitems(hv_socket_protosw)] }; @@ -323,6 +326,16 @@ hvs_trans_unlock(void) sx_xunlock(&hvs_trans_socks_sx); } +static int +hvs_dom_probe(void) +{ + + /* Don't even give us a chance to attach on non-HyperV. */ + if (vm_guest != VM_GUEST_HV) + return (ENXIO); + return (0); +} + void hvs_trans_init(void) { @@ -330,9 +343,6 @@ hvs_trans_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; - if (vm_guest != VM_GUEST_HV) - return; - HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_init called\n", __func__); @@ -355,9 +365,6 @@ hvs_trans_attach(struct socket *so, int proto, struct thread *td) { struct hvs_pcb *pcb = so2hvspcb(so); - if (vm_guest != VM_GUEST_HV) - return (ESOCKTNOSUPPORT); - HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_attach called\n", __func__); @@ -384,9 +391,6 @@ hvs_trans_detach(struct socket *so) { struct hvs_pcb *pcb; - if (vm_guest != VM_GUEST_HV) - return; - HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_detach called\n", __func__); @@ -604,9 +608,6 @@ hvs_trans_disconnect(struct socket *so) { struct hvs_pcb *pcb; - if (vm_guest != VM_GUEST_HV) - return (ESOCKTNOSUPPORT); - HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_disconnect called\n", __func__); @@ -934,9 +935,6 @@ hvs_trans_close(struct socket *so) { struct hvs_pcb *pcb; - if (vm_guest != VM_GUEST_HV) - return; - HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_close called\n", __func__); @@ -978,9 +976,6 @@ hvs_trans_abort(struct socket *so) { struct hvs_pcb *pcb = so2hvspcb(so); - if (vm_guest != VM_GUEST_HV) - return; - HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_abort called\n", __func__); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 06:08:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E177366D9EF; Mon, 16 Aug 2021 06:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp3ch5tXTz3GfN; Mon, 16 Aug 2021 06:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B188324259; Mon, 16 Aug 2021 06:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G68K29029132; Mon, 16 Aug 2021 06:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G68KXm029131; Mon, 16 Aug 2021 06:08:20 GMT (envelope-from git) Date: Mon, 16 Aug 2021 06:08:20 GMT Message-Id: <202108160608.17G68KXm029131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 29e400e994ea - main - domain: make it safer to add domains post-domainfinalize MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29e400e994ea19cb90736ceeb67dff716671ff25 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 06:08:21 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=29e400e994ea19cb90736ceeb67dff716671ff25 commit 29e400e994ea19cb90736ceeb67dff716671ff25 Author: Kyle Evans AuthorDate: 2020-06-26 02:38:27 +0000 Commit: Kyle Evans CommitDate: 2021-08-16 05:59:56 +0000 domain: make it safer to add domains post-domainfinalize I can see two concerns for adding domains after domainfinalize: 1.) The slow/fast callouts have already been setup. 2.) Userland could create a socket while we're in the middle of initialization. We can address #1 fairly easily by tracking whether the domain's been initialized for at least the default vnet. There are still some concerns about the callbacks being invoked while a vnet is in the process of being created/destroyed, but this is a pre-existing issue that the callbacks must coordinate anyways. We should also address #2, but technically this has been an issue anyways because we don't assert on post-domainfinalize additions; we don't seem to hit it in practice. Future work can fix that up to make sure we don't find partially constructed domains, but care must be taken to make sure that at least, e.g., the usages of pffindproto in ip_input.c can still find them. Differential Revision: https://reviews.freebsd.org/D25459 --- sys/kern/uipc_domain.c | 27 ++++++++++++++++----------- sys/sys/domain.h | 1 + 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 50d6c0a9d9f8..b6aefec9556a 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include /* @@ -177,6 +179,8 @@ domain_init(void *arg) flags = atomic_load_acq_int(&dp->dom_flags); if ((flags & DOMF_SUPPORTED) == 0) return; + KASSERT((flags & DOMF_INITED) == 0 || !IS_DEFAULT_VNET(curvnet), + ("Premature initialization of domain in non-default vnet")); if (dp->dom_init) (*dp->dom_init)(); for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) @@ -188,6 +192,8 @@ domain_init(void *arg) max_datalen = MHLEN - max_hdr; if (max_datalen < 1) panic("%s: max_datalen < 1", __func__); + if (IS_DEFAULT_VNET(curvnet)) + atomic_set_rel_int(&dp->dom_flags, DOMF_INITED); } #ifdef VIMAGE @@ -236,15 +242,6 @@ domain_add(void *data) if (domain_init_status < 1) printf("WARNING: attempt to domain_add(%s) before " "domaininit()\n", dp->dom_name); -#endif -#ifdef notyet - KASSERT(domain_init_status < 2, - ("attempt to domain_add(%s) after domainfinalize()", - dp->dom_name)); -#else - if (domain_init_status >= 2) - printf("WARNING: attempt to domain_add(%s) after " - "domainfinalize()\n", dp->dom_name); #endif mtx_unlock(&dom_mtx); } @@ -491,10 +488,14 @@ pfslowtimo(void *arg) struct protosw *pr; NET_EPOCH_ENTER(et); - for (dp = domains; dp; dp = dp->dom_next) + for (dp = domains; dp; dp = dp->dom_next) { + if ((atomic_load_int(&dp->dom_flags) & DOMF_INITED) == 0) + continue; + atomic_thread_fence_acq(); for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_slowtimo) (*pr->pr_slowtimo)(); + } NET_EPOCH_EXIT(et); callout_reset(&pfslow_callout, hz/2, pfslowtimo, NULL); } @@ -507,10 +508,14 @@ pffasttimo(void *arg) struct protosw *pr; NET_EPOCH_ENTER(et); - for (dp = domains; dp; dp = dp->dom_next) + for (dp = domains; dp; dp = dp->dom_next) { + if ((atomic_load_int(&dp->dom_flags) & DOMF_INITED) == 0) + continue; + atomic_thread_fence_acq(); for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_fasttimo) (*pr->pr_fasttimo)(); + } NET_EPOCH_EXIT(et); callout_reset(&pffast_callout, hz/5, pffasttimo, NULL); } diff --git a/sys/sys/domain.h b/sys/sys/domain.h index a59f4e230a1d..dc09c9786443 100644 --- a/sys/sys/domain.h +++ b/sys/sys/domain.h @@ -74,6 +74,7 @@ struct domain { /* dom_flags */ #define DOMF_SUPPORTED 0x0001 /* System supports this domain. */ +#define DOMF_INITED 0x0002 /* Initialized in the default vnet. */ #ifdef _KERNEL extern int domain_init_status; From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:03:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FA3F66FE46; Mon, 16 Aug 2021 09:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WF3xBjz3QwP; Mon, 16 Aug 2021 09:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FF4226C0A; Mon, 16 Aug 2021 09:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G93r8k069043; Mon, 16 Aug 2021 09:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G93rWu069042; Mon, 16 Aug 2021 09:03:53 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:03:53 GMT Message-Id: <202108160903.17G93rWu069042@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 312b46348c52 - stable/13 - bhyve.8: Make synopsis more readable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 312b46348c5225343c3c42cbcb05051ff3004e3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:03:53 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=312b46348c5225343c3c42cbcb05051ff3004e3e commit 312b46348c5225343c3c42cbcb05051ff3004e3e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 17:54:45 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:13:23 +0000 bhyve.8: Make synopsis more readable There is no need to squeeze all the possible options into one synopsis entry. Let "-l help" and "-s help" be listed separately. While here, keep -s and its arguments on the same line. MFC after: 2 weeks (cherry picked from commit bfe40b692d087cdd5fdeea69e18496ab2a7f67ac) --- usr.sbin/bhyve/bhyve.8 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 04e22302d9d7..367a3306786e 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2021 +.Dd April 18, 2021 .Dt BHYVE 8 .Os .Sh NAME @@ -49,7 +49,7 @@ .Op Fl k Ar file .Oo Fl l .Sm off -.Cm help | Ar lpcdev Op Cm \&, Ar conf +.Ar lpcdev Op Cm \&, Ar conf .Sm on .Oc .Oo Fl m @@ -63,13 +63,17 @@ .Op Fl o Ar var Ns Cm = Ns Ar value .Op Fl p Ar vcpu Ns Cm \&: Ns Ar hostcpu .Op Fl r Ar file -.Oo Fl s .Sm off -.Cm help | Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf +.Oo Fl s\~ +.Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf .Sm on .Oc .Op Fl U Ar uuid .Ar vmname +.Nm +.Fl l Cm help +.Nm +.Fl s Cm help .Sh DESCRIPTION .Nm is a hypervisor that runs guest operating systems inside a From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:03:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B49A766F874; Mon, 16 Aug 2021 09:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WG4phPz3Qnb; Mon, 16 Aug 2021 09:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CB77262ED; Mon, 16 Aug 2021 09:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G93scn069069; Mon, 16 Aug 2021 09:03:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G93saW069068; Mon, 16 Aug 2021 09:03:54 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:03:54 GMT Message-Id: <202108160903.17G93saW069068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 661550f32bbb - stable/13 - bhyve: Fix synopsis in the usage message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 661550f32bbb0d02f907245c1c35ef71c8e2c705 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:03:54 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=661550f32bbb0d02f907245c1c35ef71c8e2c705 commit 661550f32bbb0d02f907245c1c35ef71c8e2c705 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 18:04:12 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:13:49 +0000 bhyve: Fix synopsis in the usage message In particular: - Sort short options to align with style(9) - Add two missing flags: -G and -r - Drop unnecessary angle brackets for consistency - Rename the "vm" argument to vmname for consistency with the manual page MFC after: 2 weeks (cherry picked from commit 03c3e5e40d6497afa33df1d0b43857157c086729) --- usr.sbin/bhyve/bhyverun.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index a3e6ef3c4724..8c87a0e7328e 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -222,10 +222,10 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehuwxACDHPSWY]\n" + "Usage: %s [-AaCDeHhPSuWwxY]\n" " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" - " %*s [-k ] [-l ] [-m mem] [-o =]\n" - " %*s [-p vcpu:hostcpu] [-s ] [-U uuid] []\n" + " %*s [-G port] [-k file] [-l lpc] [-m mem] [-o var=value]\n" + " %*s [-p vcpu:hostcpu] [-r file] [-s pci] [-U uuid] vmname\n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" " -c: number of cpus and/or topology specification\n" From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:03:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F9D2670104; Mon, 16 Aug 2021 09:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WJ029gz3QrD; Mon, 16 Aug 2021 09:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B266F262EE; Mon, 16 Aug 2021 09:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G93tYx069093; Mon, 16 Aug 2021 09:03:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G93ts4069092; Mon, 16 Aug 2021 09:03:55 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:03:55 GMT Message-Id: <202108160903.17G93ts4069092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 12ad3e2b41cc - stable/13 - bhyve: Improve the option description in the usage message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 12ad3e2b41cc82fa4896f6719c688d4182e61509 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:03:56 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=12ad3e2b41cc82fa4896f6719c688d4182e61509 commit 12ad3e2b41cc82fa4896f6719c688d4182e61509 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 18:13:54 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:14:58 +0000 bhyve: Improve the option description in the usage message - Sort options as suggested by style(9) - Capitalize some words like CPU and HLT - Add a missing description for the -G flag MFC after: 2 weeks (cherry picked from commit b6a572d03f654236b929b91d376ad1a6dfaa2e9a) --- usr.sbin/bhyve/bhyverun.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 8c87a0e7328e..d14219bbef65 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -226,30 +226,31 @@ usage(int code) " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" " %*s [-G port] [-k file] [-l lpc] [-m mem] [-o var=value]\n" " %*s [-p vcpu:hostcpu] [-r file] [-s pci] [-U uuid] vmname\n" - " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" - " -c: number of cpus and/or topology specification\n" + " -a: local apic is in xAPIC mode (deprecated)\n" " -C: include guest memory in core file\n" + " -c: number of CPUs and/or topology specification\n" " -D: destroy on power-off\n" " -e: exit on unhandled I/O access\n" + " -G: start a debug server\n" + " -H: vmexit from the guest on HLT\n" " -h: help\n" - " -H: vmexit from the guest on hlt\n" " -k: key=value flat config file\n" " -l: LPC device configuration\n" " -m: memory size in MB\n" " -o: set config 'var' to 'value'\n" - " -p: pin 'vcpu' to 'hostcpu'\n" " -P: vmexit from the guest on pause\n" + " -p: pin 'vcpu' to 'hostcpu'\n" #ifdef BHYVE_SNAPSHOT " -r: path to checkpoint file\n" #endif - " -s: PCI slot config\n" " -S: guest memory cannot be swapped\n" + " -s: PCI slot config\n" + " -U: UUID\n" " -u: RTC keeps UTC time\n" - " -U: uuid\n" - " -w: ignore unimplemented MSRs\n" " -W: force virtio to use single-vector MSI\n" - " -x: local apic is in x2APIC mode\n" + " -w: ignore unimplemented MSRs\n" + " -x: local APIC is in x2APIC mode\n" " -Y: disable MPtable generation\n", progname, (int)strlen(progname), "", (int)strlen(progname), "", (int)strlen(progname), ""); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:03:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78DB966FC6B; Mon, 16 Aug 2021 09:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WK0hpXz3QrM; Mon, 16 Aug 2021 09:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4A50266FE; Mon, 16 Aug 2021 09:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G93ulu069123; Mon, 16 Aug 2021 09:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G93u9o069122; Mon, 16 Aug 2021 09:03:56 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:03:56 GMT Message-Id: <202108160903.17G93u9o069122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: da4c8aec04eb - stable/13 - bhyve.8: Sort the options in the OPTIONS section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da4c8aec04ebfcc6a80e5b05a3776fb1e8050571 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:03:57 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=da4c8aec04ebfcc6a80e5b05a3776fb1e8050571 commit da4c8aec04ebfcc6a80e5b05a3776fb1e8050571 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 18:26:04 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:15:25 +0000 bhyve.8: Sort the options in the OPTIONS section No content change intended. Just moving the option descriptions around to follow the order suggested by style(9). MFC after: 2 weeks (cherry picked from commit ccb1c87a6aa563a927a98a6f9175d95929535b21) --- usr.sbin/bhyve/bhyve.8 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 367a3306786e..d38a9487abef 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -95,15 +95,17 @@ runs until the guest operating system reboots or an unhandled hypervisor exit is detected. .Sh OPTIONS .Bl -tag -width 10n -.It Fl a -The guest's local APIC is configured in xAPIC mode. -The xAPIC mode is the default setting so this option is redundant. -It will be deprecated in a future version. .It Fl A Generate ACPI tables. Required for .Fx Ns /amd64 guests. +.It Fl a +The guest's local APIC is configured in xAPIC mode. +The xAPIC mode is the default setting so this option is redundant. +It will be deprecated in a future version. +.It Fl C +Include guest memory in core file. .It Fl c Op Ar setting ... Number of guest virtual CPUs and/or the CPU topology. @@ -128,8 +130,6 @@ and If a .Ar setting is specified more than once the last one has precedence. -.It Fl C -Include guest memory in core file. .It Fl D Destroy the VM on guest initiated power-off. .It Fl e @@ -150,11 +150,11 @@ begins with .Sq w , .Nm will pause execution at the first instruction waiting for a debugger to attach. -.It Fl h -Print help message and exit. .It Fl H Yield the virtual CPU thread when a HLT instruction is detected. If this option is not specified, virtual CPUs will use 100% of a host CPU. +.It Fl h +Print help message and exit. .It Fl k Ar file Set configuration variables from a simple, key-value config file. Each line of the config file is expected to consist of a config variable @@ -196,13 +196,13 @@ Set the configuration variable .Ar var to .Ar value . +.It Fl P +Force the guest virtual CPU to exit when a PAUSE instruction is detected. .It Fl p Ar vcpu:hostcpu Pin guest's virtual CPU .Em vcpu to .Em hostcpu . -.It Fl P -Force the guest virtual CPU to exit when a PAUSE instruction is detected. .It Fl r Ar file Resume a guest from a snapshot. The guest memory contents are restored from @@ -218,6 +218,8 @@ and .Op Fl l options. The count of vCPUs and memory configuration are read from the snapshot. +.It Fl S +Wire guest memory. .It Fl s Op Ar help|slot,emulation Ns Op , Ns Ar conf Configure a virtual PCI slot and function. .Pp @@ -591,22 +593,20 @@ Recording device, typically .Ar /dev/dsp0 . .El .El -.It Fl S -Wire guest memory. -.It Fl u -RTC keeps UTC time. .It Fl U Ar uuid Set the universally unique identifier .Pq UUID in the guest's System Management BIOS System Information structure. By default a UUID is generated from the host's hostname and .Ar vmname . -.It Fl w -Ignore accesses to unimplemented Model Specific Registers (MSRs). -This is intended for debug purposes. +.It Fl u +RTC keeps UTC time. .It Fl W Force virtio PCI device emulations to use MSI interrupts instead of MSI-X interrupts. +.It Fl w +Ignore accesses to unimplemented Model Specific Registers (MSRs). +This is intended for debug purposes. .It Fl x The guest's local APIC is configured in x2APIC mode. .It Fl Y From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:03:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 384E966F87E; Mon, 16 Aug 2021 09:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WL1045z3RD4; Mon, 16 Aug 2021 09:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 015B0269B4; Mon, 16 Aug 2021 09:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G93v6V069148; Mon, 16 Aug 2021 09:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G93va2069147; Mon, 16 Aug 2021 09:03:57 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:03:57 GMT Message-Id: <202108160903.17G93va2069147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 1103bc026f72 - stable/13 - bhyve.8: Improve the description and synopsis of -l MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1103bc026f729f0c0f1a30259a2b3d343a064035 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:03:58 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1103bc026f729f0c0f1a30259a2b3d343a064035 commit 1103bc026f729f0c0f1a30259a2b3d343a064035 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 19:41:15 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:15:44 +0000 bhyve.8: Improve the description and synopsis of -l - Describe "-l help" separately for readability. - List all the supported comX devices explicitly - Use Cm instead of Ar for command modifiers (i.e., literal values a user can specify as an argument to the command). - Explain where to get more information about the possible values of the conf argument. MFC after: 2 weeks (cherry picked from commit 4c08b978b276f8cfc25f72715e97898f629f7f89) --- usr.sbin/bhyve/bhyve.8 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index d38a9487abef..3105dbca016a 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -166,19 +166,24 @@ value. Blank lines and lines starting with .Sq # are ignored. -.It Fl l Op Ar help|lpcdev Ns Op , Ns Ar conf +.It Fl l Cm help +Print a list of supported LPC devices. +.It Fl l Ar lpcdev Ns Op Cm \&, Ns Ar conf Allow devices behind the LPC PCI-ISA bridge to be configured. The only supported devices are the TTY-class devices -.Ar com1 -through -.Ar com4 , +.Cm com1 , com2 , com3 , +and +.Cm com4 , the boot ROM device -.Ar bootrom , +.Cm bootrom , and the debug/test device -.Ar pc-testdev . +.Cm pc-testdev . .Pp -.Ar help -print a list of supported LPC devices. +The possible values for the +.Ar conf +argument are listed in the +.Fl s +flag description. .It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t Guest physical memory size in bytes. This must be the same size that was given to From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:03:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE63766FC6C; Mon, 16 Aug 2021 09:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WM1p0Rz3Qnw; Mon, 16 Aug 2021 09:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15E3226B9D; Mon, 16 Aug 2021 09:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G93wCh069172; Mon, 16 Aug 2021 09:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G93wod069171; Mon, 16 Aug 2021 09:03:58 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:03:58 GMT Message-Id: <202108160903.17G93wod069171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a6dca2ecb4f2 - stable/13 - bhyve.8: Improve the description of the -m flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a6dca2ecb4f2410d63f1859dcc3237bb07a2c5bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:00 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a6dca2ecb4f2410d63f1859dcc3237bb07a2c5bb commit a6dca2ecb4f2410d63f1859dcc3237bb07a2c5bb Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 19:56:13 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:29:50 +0000 bhyve.8: Improve the description of the -m flag - Stylize the synopsis with proper mdoc macros - Do some wordsmithing on the description for consistency. MFC after: 2 weeks (cherry picked from commit 7e0cb3df687695212ae20cc90d5f2f48bd42eba7) --- usr.sbin/bhyve/bhyve.8 | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 3105dbca016a..051ca05d85e5 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -184,18 +184,26 @@ The possible values for the argument are listed in the .Fl s flag description. -.It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t -Guest physical memory size in bytes. +.It Xo +.Fl m Ar memsize Ns Oo +.Sm off +.Cm K | k | M | m | G | g | T | t +.Sm on +.Oc +.Xc +Set the guest physical memory size This must be the same size that was given to .Xr bhyveload 8 . .Pp -The size argument may be suffixed with one of K, M, G or T (either upper -or lower case) to indicate a multiple of kilobytes, megabytes, gigabytes, -or terabytes. +The size argument may be suffixed with one of +.Cm K , M , G +or +.Cm T +(either upper or lower case) +to indicate a multiple of kilobytes, megabytes, gigabytes, or terabytes. If no suffix is given, the value is assumed to be in megabytes. .Pp -.Ar memsize -defaults to 256M. +The default is 256M. .It Fl o Ar var Ns Cm = Ns Ar value Set the configuration variable .Ar var From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E02566FC6D; Mon, 16 Aug 2021 09:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WN2xNcz3QtB; Mon, 16 Aug 2021 09:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3342F269B5; Mon, 16 Aug 2021 09:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G940cl069196; Mon, 16 Aug 2021 09:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G9409X069195; Mon, 16 Aug 2021 09:04:00 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:00 GMT Message-Id: <202108160904.17G9409X069195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: ff8c945e9ac2 - stable/13 - bhyve.8: Fix the synopsis of -p MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ff8c945e9ac28301ba6d646f432911a0e6a45403 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:00 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ff8c945e9ac28301ba6d646f432911a0e6a45403 commit ff8c945e9ac28301ba6d646f432911a0e6a45403 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:01:30 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:55:36 +0000 bhyve.8: Fix the synopsis of -p Use appropriate mdoc macros. MFC after: 2 weeks (cherry picked from commit 90df54374f1ce1b94c10c34c2a5b06be0353ebae) --- usr.sbin/bhyve/bhyve.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 051ca05d85e5..eaef0548e209 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -211,7 +211,7 @@ to .Ar value . .It Fl P Force the guest virtual CPU to exit when a PAUSE instruction is detected. -.It Fl p Ar vcpu:hostcpu +.It Fl p Ar vcpu Ns Cm \& : Ns Ar hostcpu Pin guest's virtual CPU .Em vcpu to From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD34067011F; Mon, 16 Aug 2021 09:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WP3X9Lz3R7h; Mon, 16 Aug 2021 09:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AA4E26B9E; Mon, 16 Aug 2021 09:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G941OQ069220; Mon, 16 Aug 2021 09:04:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G941nZ069219; Mon, 16 Aug 2021 09:04:01 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:01 GMT Message-Id: <202108160904.17G941nZ069219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: e08e2c7c1882 - stable/13 - bhyve.8: Clean up description of -r MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e08e2c7c1882818aeda954e7c3372a0a08530a57 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:01 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e08e2c7c1882818aeda954e7c3372a0a08530a57 commit e08e2c7c1882818aeda954e7c3372a0a08530a57 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:03:40 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:55:56 +0000 bhyve.8: Clean up description of -r There is no need to wrap those flags in Op macros. MFC after: 2 weeks (cherry picked from commit b24eea8c7a2ff2bf19b1bdbb2838d185e578581a) --- usr.sbin/bhyve/bhyve.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index eaef0548e209..7147e203640f 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -226,9 +226,9 @@ and the guest device and vCPU state are restored from the file Note that the current snapshot file format requires that the configuration of devices in the new VM match the VM from which the snapshot was taken by specifying the same -.Op Fl s +.Fl s and -.Op Fl l +.Fl l options. The count of vCPUs and memory configuration are read from the snapshot. .It Fl S From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6705667012D; Mon, 16 Aug 2021 09:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WS6vN1z3RDl; Mon, 16 Aug 2021 09:04:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D20E0269B7; Mon, 16 Aug 2021 09:04:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G944PO069298; Mon, 16 Aug 2021 09:04:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G944iF069297; Mon, 16 Aug 2021 09:04:04 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:04 GMT Message-Id: <202108160904.17G944iF069297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 7dcc31c9b790 - stable/13 - bhyve.8: Clean up the slot description of -s MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7dcc31c9b790a8b3a7e9d00b22e41740d18dddea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:05 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7dcc31c9b790a8b3a7e9d00b22e41740d18dddea commit 7dcc31c9b790a8b3a7e9d00b22e41740d18dddea Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:56:19 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:56:50 +0000 bhyve.8: Clean up the slot description of -s Also, remove the macros of the nested list which contained slot, emulation and conf. This decreases the indention of the -s description. It was necessary to clean up the slot description. MFC after: 2 weeks (cherry picked from commit 234d8c470b44160fe0cbce49b972b3b19f246a89) --- usr.sbin/bhyve/bhyve.8 | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index e58c877dacbe..8e1a33ea4b42 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -243,10 +243,23 @@ provides PCI bus emulation and virtual devices that can be attached to slots on the bus. There are 32 available slots, with the option of providing up to 8 functions per slot. -.Bl -tag -width 10n -.It Ar slot -.Ar pcislot[:function] -.Ar bus:pcislot:function +.Pp +The +.Ar slot +can be specified in one of the following formats: +.Pp +.Bl -bullet -compact +.It +.Ar pcislot +.It +.Sm off +.Ar pcislot Cm \&: Ar function +.Sm on +.It +.Sm off +.Ar bus Cm \&: Ar pcislot Cm \&: Ar function +.Sm on +.El .Pp The .Ar pcislot @@ -263,7 +276,11 @@ value defaults to 0. If not specified, the .Ar bus value defaults to 0. -.It Ar emulation +.Pp +The +.Ar emulation +argument +can be one of the following: .Bl -tag -width 10n .It Li hostbridge | Li amd_hostbridge .Pp @@ -313,8 +330,10 @@ NVM Express (NVMe) controller. .It Li hda High Definition Audio Controller. .El -.It Op Ar conf -This optional parameter describes the backend for device emulations. +.Pp +The optional parameter +.Ar conf +describes the backend for device emulations. If .Ar conf is not specified, the device emulation has no backend and can be From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAC7666FE55; Mon, 16 Aug 2021 09:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WR5jXXz3R7n; Mon, 16 Aug 2021 09:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA32526B9F; Mon, 16 Aug 2021 09:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G943NF069274; Mon, 16 Aug 2021 09:04:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G943Et069273; Mon, 16 Aug 2021 09:04:03 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:03 GMT Message-Id: <202108160904.17G943Et069273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: f5329137c9ea - stable/13 - bhyve.8: Clean-up synopsis of -s MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f5329137c9eaf90d901105e608ba15284dfc8993 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:04 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f5329137c9eaf90d901105e608ba15284dfc8993 commit f5329137c9eaf90d901105e608ba15284dfc8993 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:28:47 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:56:25 +0000 bhyve.8: Clean-up synopsis of -s - Document "-s help" separately for readability. - Use appropriate mdoc macros. MFC after: 2 weeks (cherry picked from commit 449f0e48e902ed36ec0de31279eefad9e6200cdc) --- usr.sbin/bhyve/bhyve.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index d3d44a5a6232..e58c877dacbe 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -233,7 +233,9 @@ options. The count of vCPUs and memory configuration are read from the snapshot. .It Fl S Wire guest memory. -.It Fl s Op Ar help|slot,emulation Ns Op , Ns Ar conf +.It Fl s Cm help +Print a list of supported PCI devices. +.It Fl s Ar slot Ns Cm \&, Ns Ar emulation Ns Op Cm \&, Ns Ar conf Configure a virtual PCI slot and function. .Pp .Nm @@ -242,8 +244,6 @@ slots on the bus. There are 32 available slots, with the option of providing up to 8 functions per slot. .Bl -tag -width 10n -.It Ar help -print a list of supported PCI devices. .It Ar slot .Ar pcislot[:function] .Ar bus:pcislot:function From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4802666FC7F; Mon, 16 Aug 2021 09:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WV0tHHz3RG9; Mon, 16 Aug 2021 09:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECA2526BA0; Mon, 16 Aug 2021 09:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G945pu069322; Mon, 16 Aug 2021 09:04:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G945pF069321; Mon, 16 Aug 2021 09:04:05 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:05 GMT Message-Id: <202108160904.17G945pF069321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: d314e354755a - stable/13 - bhyve.8: Improve emulation description of the -s flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d314e354755a221390364435378be0fbb30f9963 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:06 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d314e354755a221390364435378be0fbb30f9963 commit d314e354755a221390364435378be0fbb30f9963 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:08:39 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:57:12 +0000 bhyve.8: Improve emulation description of the -s flag - Set width of the list to the longest key word for readability. - Separate descriptions of amd_hostbridge and hostbridge emulations. Also, wordsmith their descriptions for consistency with other entries. - Use Cm instead of Li for command modifiers. - Do not stylize AMD with Li, there's no need to do it. - Mention COM3 and COM4 in the definition of lpc. - Fix a typo in the definition of ahci-hd ("hard drive" instead of "hard-drive"). MFC after: 2 weeks (cherry picked from commit 7014cb2393594ee4a8389c65d507afacf729c041) --- usr.sbin/bhyve/bhyve.8 | 54 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 8e1a33ea4b42..6db14afa07c3 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -281,53 +281,53 @@ The .Ar emulation argument can be one of the following: -.Bl -tag -width 10n -.It Li hostbridge | Li amd_hostbridge -.Pp -Provide a simple host bridge. +.Bl -tag -width "amd_hostbridge" +.It Cm hostbridge +A simple host bridge. This is usually configured at slot 0, and is required by most guest operating systems. -The -.Li amd_hostbridge -emulation is identical but uses a PCI vendor ID of -.Li AMD . -.It Li passthru +.It Cm amd_hostbridge +Emulation identical to +.Cm hostbridge +using a PCI vendor ID of AMD. +.It Cm passthru PCI pass-through device. -.It Li virtio-net +.It Cm virtio-net Virtio network interface. -.It Li virtio-blk +.It Cm virtio-blk Virtio block storage interface. -.It Li virtio-scsi +.It Cm virtio-scsi Virtio SCSI interface. -.It Li virtio-9p +.It Cm virtio-9p Virtio 9p (VirtFS) interface. -.It Li virtio-rnd +.It Cm virtio-rnd Virtio RNG interface. -.It Li virtio-console +.It Cm virtio-console Virtio console interface, which exposes multiple ports to the guest in the form of simple char devices for simple IO between the guest and host userspaces. -.It Li ahci +.It Cm ahci AHCI controller attached to arbitrary devices. -.It Li ahci-cd +.It Cm ahci-cd AHCI controller attached to an ATAPI CD/DVD. -.It Li ahci-hd -AHCI controller attached to a SATA hard-drive. -.It Li e1000 +.It Cm ahci-hd +AHCI controller attached to a SATA hard drive. +.It Cm e1000 Intel e82545 network interface. -.It Li uart +.It Cm uart PCI 16550 serial device. -.It Li lpc -LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports, a boot ROM, and, +.It Cm lpc +LPC PCI-ISA bridge with COM1, COM2, COM3, and COM4 16550 serial ports, +a boot ROM, and, optionally, the debug/test device. The LPC bridge emulation can only be configured on bus 0. -.It Li fbuf +.It Cm fbuf Raw framebuffer device attached to VNC server. -.It Li xhci +.It Cm xhci eXtensible Host Controller Interface (xHCI) USB controller. -.It Li nvme +.It Cm nvme NVM Express (NVMe) controller. -.It Li hda +.It Cm hda High Definition Audio Controller. .El .Pp From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03B04670183; Mon, 16 Aug 2021 09:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WQ4tYSz3Qrq; Mon, 16 Aug 2021 09:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8304C269B6; Mon, 16 Aug 2021 09:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G942nL069244; Mon, 16 Aug 2021 09:04:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G942PE069243; Mon, 16 Aug 2021 09:04:02 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:02 GMT Message-Id: <202108160904.17G942PE069243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: b473a7a9e2f0 - stable/13 - bhyve.8: Fix indention in the signals table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b473a7a9e2f0ce47ddd00a82cb8230ca303a4665 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:03 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b473a7a9e2f0ce47ddd00a82cb8230ca303a4665 commit b473a7a9e2f0ce47ddd00a82cb8230ca303a4665 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:06:12 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:56:10 +0000 bhyve.8: Fix indention in the signals table MFC after: 2 weeks (cherry picked from commit 3357e9482fe8a0ee153ec62d4bd8cb96966bbf26) --- usr.sbin/bhyve/bhyve.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 7147e203640f..d3d44a5a6232 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -680,7 +680,7 @@ stepping over the breakpoint. .Nm deals with the following signals: .Pp -.Bl -tag -width indent -compact +.Bl -tag -width SIGTERM -compact .It SIGTERM Trigger ACPI poweroff for a VM .El From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9A59670305; Mon, 16 Aug 2021 09:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WW2mjtz3QxP; Mon, 16 Aug 2021 09:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B89426B14; Mon, 16 Aug 2021 09:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G9472U069346; Mon, 16 Aug 2021 09:04:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G947oT069345; Mon, 16 Aug 2021 09:04:07 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:07 GMT Message-Id: <202108160904.17G947oT069345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 63b55e8312dc - stable/13 - bhyve.8: Clean up network backends section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 63b55e8312dc6a8b42e9e6ca52c74a4fe4cadd0e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:07 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=63b55e8312dc6a8b42e9e6ca52c74a4fe4cadd0e commit 63b55e8312dc6a8b42e9e6ca52c74a4fe4cadd0e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:29:30 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:57:50 +0000 bhyve.8: Clean up network backends section - Reformat the format lists, use appropriate mdoc macros for readability. - Add a missing Oxford comma. MFC after: 2 weeks (cherry picked from commit 7fb22729816ef6c9e65e5c544047e669edd2f06d) --- usr.sbin/bhyve/bhyve.8 | 55 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 6db14afa07c3..4eba24455b69 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -339,14 +339,34 @@ If is not specified, the device emulation has no backend and can be considered unconnected. .Pp -Network backends: -.Bl -tag -width 10n -.It Ar tapN Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc -.It Ar vmnetN Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc -.It Ar netgraph,path=ADDRESS,peerhook=HOOK Ns Oo , Ns Ar socket=NAME Oc Ns Oo , Ns Ar hook=HOOK Oc Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc -.Pp +Network backends formats for +.Ar conf : +.Sm off +.Bl -bullet +.It +.Xo +.Cm tap Ar N +.Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx +.Op Cm \&,mtu= Ar N +.Xc +.It +.Xo +.Cm vmnet Ar N +.Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx +.Op Cm \&,mtu= Ar N +.Xc +.It +.Xo +.Cm netgraph,path= Ar ADDRESS Cm \&,peerhook= Ar HOOK +.Op Cm \&,socket= Ar NAME +.Op Cm \&,hook= Ar HOOK +.Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx +.Op Cm \&,mtu= Ar N +.Xc +.El +.Sm on If -.Ar mac +.Cm mac is not specified, the MAC address is derived from a fixed OUI and the remaining bytes from an MD5 hash of the slot and function numbers and the device name. @@ -355,32 +375,35 @@ The MAC address is an ASCII string in .Xr ethers 5 format. .Pp -With virtio-net devices, the -.Ar mtu +With +.Cm virtio-net +devices, the +.Cm mtu parameter can be specified to inform the guest about the largest MTU that should be allowed, expressed in bytes. .Pp -With netgraph backend, the -.Ar path +With +.Cm netgraph +backend, the +.Cm path and -.Ar peerhook +.Cm peerhook parameters must be specified to set the destination node and corresponding hook. The optional parameters -.Ar socket +.Cm socket and -.Ar hook +.Cm hook may be used to set the .Xr ng_socket 4 node name and source hook. The .Ar ADDRESS , -.Ar HOOK +.Ar HOOK , and .Ar NAME must comply with .Xr netgraph 4 addressing rules. -.El .Pp Block storage devices: .Bl -tag -width 10n From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD964670199; Mon, 16 Aug 2021 09:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WX4Rysz3RB8; Mon, 16 Aug 2021 09:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 467F126B15; Mon, 16 Aug 2021 09:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G948Ud069370; Mon, 16 Aug 2021 09:04:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G948w9069369; Mon, 16 Aug 2021 09:04:08 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:08 GMT Message-Id: <202108160904.17G948w9069369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: c66d332730bf - stable/13 - bhyve.8: Clean up block storage device backends description MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c66d332730bfe5c13e45ed48768c8a9d994485bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:09 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c66d332730bfe5c13e45ed48768c8a9d994485bd commit c66d332730bfe5c13e45ed48768c8a9d994485bd Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:39:53 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:58:26 +0000 bhyve.8: Clean up block storage device backends description MFC after: 2 weeks (cherry picked from commit 5232a35f1ed7b8fa4f378897598438c2056ef60e) --- usr.sbin/bhyve/bhyve.8 | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 4eba24455b69..5c73852b422c 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -405,29 +405,33 @@ must comply with .Xr netgraph 4 addressing rules. .Pp -Block storage devices: -.Bl -tag -width 10n -.It Pa /filename Ns Oo , Ns Ar block-device-options Oc -.It Pa /dev/xxx Ns Oo , Ns Ar block-device-options Oc +Block storage device backends: +.Sm off +.Bl -bullet +.It +.Ar /filename Op Cm \&, Ar block-device-options +.It +.Ar /dev/xxx Op Cm \&, Ar block-device-options .El +.Sm on .Pp The .Ar block-device-options are: -.Bl -tag -width 8n -.It Li nocache +.Bl -tag -width 10n +.It Cm nocache Open the file with .Dv O_DIRECT . -.It Li direct +.It Cm direct Open the file using .Dv O_SYNC . -.It Li ro +.It Cm ro Force the file to be opened read-only. -.It Li sectorsize= Ns Ar logical Ns Oo / Ns Ar physical Oc +.It Cm sectorsize= Ns Ar logical Ns Oo Cm \&/ Ns Ar physical Oc Specify the logical and physical sector sizes of the emulated disk. The physical sector size is optional and is equal to the logical sector size if not explicitly specified. -.It Li nodelete +.It Cm nodelete Disable emulation of guest trim requests via .Dv DIOCGDELETE requests. @@ -647,7 +651,6 @@ Playback device, typically Recording device, typically .Ar /dev/dsp0 . .El -.El .It Fl U Ar uuid Set the universally unique identifier .Pq UUID From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B663670132; Mon, 16 Aug 2021 09:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WY5CRJz3QpH; Mon, 16 Aug 2021 09:04:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CAD226C0B; Mon, 16 Aug 2021 09:04:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G949Fj069400; Mon, 16 Aug 2021 09:04:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G949rr069399; Mon, 16 Aug 2021 09:04:09 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:09 GMT Message-Id: <202108160904.17G949rr069399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 78863cd50bb6 - stable/13 - bhyve.8: Clean up SCSI device backends section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 78863cd50bb6fc107a740bbb5538a173a5803032 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:10 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=78863cd50bb6fc107a740bbb5538a173a5803032 commit 78863cd50bb6fc107a740bbb5538a173a5803032 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:49:18 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:58:41 +0000 bhyve.8: Clean up SCSI device backends section MFC after: 2 weeks (cherry picked from commit 7c5829c942822561688c9b8239900773c6d82db4) --- usr.sbin/bhyve/bhyve.8 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 5c73852b422c..f0109fa3d969 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -437,16 +437,19 @@ Disable emulation of guest trim requests via requests. .El .Pp -SCSI devices: -.Bl -tag -width 10n -.It Pa /dev/cam/ctl Ns Oo Ar pp . Ns Ar vp Oc Ns Oo , Ns Ar scsi-device-options Oc +SCSI device backends: +.Sm off +.Bl -bullet +.It +.Pa /dev/cam/ctl Oo Ar pp Cm \&. Ar vp Oc Oo Cm \&, Ar scsi-device-options Oc .El +.Sm on .Pp The .Ar scsi-device-options are: .Bl -tag -width 10n -.It Li iid= Ns Ar IID +.It Cm iid= Ns Ar IID Initiator ID to use when sending requests to specified CTL port. The default value is 0. .El From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DD26670317; Mon, 16 Aug 2021 09:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7WZ6pG9z3QpQ; Mon, 16 Aug 2021 09:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BAD426BA1; Mon, 16 Aug 2021 09:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G94A3s069424; Mon, 16 Aug 2021 09:04:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G94A5o069423; Mon, 16 Aug 2021 09:04:10 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:10 GMT Message-Id: <202108160904.17G94A5o069423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5789e28b214f - stable/13 - bhyve.8: Clean up 9P device backends section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5789e28b214f3652f3969b00ea2ae1c97807b879 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:11 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5789e28b214f3652f3969b00ea2ae1c97807b879 commit 5789e28b214f3652f3969b00ea2ae1c97807b879 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:52:48 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:59:10 +0000 bhyve.8: Clean up 9P device backends section MFC after: 2 weeks (cherry picked from commit 2d00b57022f09561706afef9050e0b527c41314a) --- usr.sbin/bhyve/bhyve.8 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index f0109fa3d969..1410769d8a37 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -454,16 +454,19 @@ Initiator ID to use when sending requests to specified CTL port. The default value is 0. .El .Pp -9P devices: -.Bl -tag -width 10n -.It Pa sharename=/path/to/share[,9p-device-options] +9P device backends: +.Sm off +.Bl -bullet +.It +.Ar sharename Cm = Ar /path/to/share Op Cm \&, Ar 9p-device-options .El +.Sm on .Pp The .Ar 9p-device-options are: .Bl -tag -width 10n -.It Li ro +.It Cm ro Expose the share in read-only mode. .El .Pp From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCFAE6701A9; Mon, 16 Aug 2021 09:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7Wf2RBgz3RFT; Mon, 16 Aug 2021 09:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 033C3266FF; Mon, 16 Aug 2021 09:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G94DoX069496; Mon, 16 Aug 2021 09:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G94DQN069495; Mon, 16 Aug 2021 09:04:13 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:13 GMT Message-Id: <202108160904.17G94DQN069495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5f8dd688e0a9 - stable/13 - bhyve.8: Improve framebuffer backends description MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f8dd688e0a99d4ca16aff40ac61cf8643835b80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:15 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5f8dd688e0a99d4ca16aff40ac61cf8643835b80 commit 5f8dd688e0a99d4ca16aff40ac61cf8643835b80 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:59:44 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:00:02 +0000 bhyve.8: Improve framebuffer backends description - Use appropriate mdoc macros - Document that tcp= is a synonym to rfb= (tcp is used in the examples, but never mentioned) - Clarify the IP address specification MFC after: 2 weeks (cherry picked from commit 8b97e97548bdc74cf3b4939a0b21cfdd27d8c11c) --- usr.sbin/bhyve/bhyve.8 | 62 +++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 88be882039c4..afc3a5c615c8 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -540,35 +540,52 @@ resize at present. Emergency write is advertised, but no-op at present. .El .Pp -Framebuffer devices: +Framebuffer devices backends: +.Bl -bullet +.Sm off +.It +.Op Cm rfb= Ar ip-and-port +.Op Cm ,w= Ar width +.Op Cm ,h= Ar height +.Op Cm ,vga= Ar vgaconf +.Op Cm ,wait +.Op Cm ,password= Ar password +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Xo -.Oo rfb= Ns Oo Ar IP\&: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns -.Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns -.Ar password Oc -.Xc -.Bl -tag -width 8n -.It Ar IPv4:port No or Ar [IPv6%zone]:port -An -.Ar IP -address and a +.It Cm rfb= Ns Ar ip-and-port Pq or Cm tcp= Ns Ar ip-and-port +An IP address and a port VNC should listen on. +There are two formats: +.Pp +.Bl -bullet -compact +.It IPv4 +.Sm off +.Op Ar IPv4 Cm \&: .Ar port -VNC should listen on. +.Sm on +.It IPv6 +.Sm off +.Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port +.Sm on +.El +.Pp The default is to listen on localhost IPv4 address and default VNC port 5900. An IPv6 address must be enclosed in square brackets and may contain an optional zone identifier. -.It Ar width No and Ar height +.It Cm w= Ns Ar width No and Cm h= Ns Ar height A display resolution, width and height, respectively. If not specified, a default resolution of 1024x768 pixels will be used. Minimal supported resolution is 640x480 pixels, and maximum is 1920x1200 pixels. -.It Ar vgaconf +.It Cm vga= Ns Ar vgaconf Possible values for this option are -.Dq io +.Cm io (default), -.Dq on +.Cm on , and -.Dq off . +.Cm off . PCI graphics cards have a dual personality in that they are standard PCI devices with BAR addressing, but may also implicitly decode legacy VGA I/O space @@ -576,18 +593,18 @@ implicitly decode legacy VGA I/O space and memory space .Pq 64KB at Ad 0xA0000 . The default -.Dq io +.Cm io option should be used for guests that attempt to issue BIOS calls which result in I/O port queries, and fail to boot if I/O decode is disabled. .Pp The -.Dq on +.Cm on option should be used along with the CSM BIOS capability in UEFI to boot traditional BIOS guests that require the legacy VGA I/O and memory regions to be available. .Pp The -.Dq off +.Cm off option should be used for the UEFI guests that assume that VGA adapter is present if they detect the I/O ports. An example of such a guest is @@ -600,19 +617,18 @@ Please refer to the wiki page .Pq Lk https://wiki.freebsd.org/bhyve for configuration notes of particular guests. -.It wait +.It Cm wait Instruct .Nm to only boot upon the initiation of a VNC connection, simplifying the installation of operating systems that require immediate keyboard input. This can be removed for post-installation use. -.It password +.It Cm password= Ns Ar password This type of authentication is known to be cryptographically weak and is not intended for use on untrusted networks. Many implementations will want to use stronger security, such as running the session over an encrypted channel provided by IPsec or SSH. .El -.El .Pp xHCI USB devices: .Bl -tag -width 10n From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBFDB6701A5; Mon, 16 Aug 2021 09:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7Wd3H1Qz3Qxq; Mon, 16 Aug 2021 09:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5DCC26C84; Mon, 16 Aug 2021 09:04:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G94CFx069472; Mon, 16 Aug 2021 09:04:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G94CER069471; Mon, 16 Aug 2021 09:04:12 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:12 GMT Message-Id: <202108160904.17G94CER069471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 34b945ccf636 - stable/13 - bhyve.8: Clean up virtio console device backends description MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 34b945ccf636386478a63bc3913ac044db671426 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:13 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=34b945ccf636386478a63bc3913ac044db671426 commit 34b945ccf636386478a63bc3913ac044db671426 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:23:26 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:59:48 +0000 bhyve.8: Clean up virtio console device backends description MFC after: 2 weeks (cherry picked from commit 3f4c771f64e816750de08ab6fd7e7bf29398f5fb) --- usr.sbin/bhyve/bhyve.8 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 06356a64f596..88be882039c4 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -509,9 +509,14 @@ The host device must have been reserved at boot-time using the loader variable as described in .Xr vmm 4 . .Pp -Virtio console devices: -.Bl -tag -width 10n -.It Li port1= Ns Pa /path/to/port1.sock Ns ,anotherport= Ns Pa ... +Virtio console device backends: +.Bl -bullet +.Sm off +.It +.Cm port1= Ns Ar /path/to/port1.sock Ns Op Cm ,port Ns Ar N Cm \&= Ns Ar /path/to/port2.sock No \~ Ar ... +.Sm on +.El +.Pp A maximum of 16 ports per device can be created. Every port is named and corresponds to a Unix domain socket created by .Nm . @@ -519,7 +524,7 @@ Every port is named and corresponds to a Unix domain socket created by accepts at most one connection per port at a time. .Pp Limitations: -.Bl -bullet -offset 2n +.Bl -bullet -offset .It Due to lack of destructors in .Nm , @@ -527,12 +532,13 @@ sockets on the filesystem must be cleaned up manually after .Nm exits. .It -There is no way to use the "console port" feature, nor the console port +There is no way to use the +.Dq console port +feature, nor the console port resize at present. .It Emergency write is advertised, but no-op at present. .El -.El .Pp Framebuffer devices: .Bl -tag -width 10n From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83DA96702CD; Mon, 16 Aug 2021 09:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7Wk287vz3R0t; Mon, 16 Aug 2021 09:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77DF726C85; Mon, 16 Aug 2021 09:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G94HWn069574; Mon, 16 Aug 2021 09:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G94HYp069573; Mon, 16 Aug 2021 09:04:17 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:17 GMT Message-Id: <202108160904.17G94HYp069573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a3dcec67d1e9 - stable/13 - bhyve: Document the format for HD audio backends MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3dcec67d1e94d13602812dde9b74f100851cc09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:18 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a3dcec67d1e94d13602812dde9b74f100851cc09 commit a3dcec67d1e94d13602812dde9b74f100851cc09 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:50:29 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:00:38 +0000 bhyve: Document the format for HD audio backends - This change is done for consistency with other backend definitions. MFC after: 2 weeks (cherry picked from commit 061f37d280976e0f79f823c732fa80825ce48ded) --- usr.sbin/bhyve/bhyve.8 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 7bbb663665d7..bf3c792dd235 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -707,12 +707,21 @@ Revision Number with maximum 8 characters. Model Number with maximum 40 characters. .El .Pp -HD Audio devices: +HD Audio device backends: +.Bl -bullet +.It +.Sm off +.Op Cm play= Ar playback +.Op Cm ,rec= Ar recording +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li play +.It Cm play Playback device, typically .Ar /dev/dsp0 . -.It Li rec +.It Cm rec Recording device, typically .Ar /dev/dsp0 . .El From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE67566FE76; Mon, 16 Aug 2021 09:04:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7Wc2MZgz3RBP; Mon, 16 Aug 2021 09:04:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2C94269B8; Mon, 16 Aug 2021 09:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G94B7H069448; Mon, 16 Aug 2021 09:04:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G94BR3069447; Mon, 16 Aug 2021 09:04:11 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:11 GMT Message-Id: <202108160904.17G94BR3069447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 689d66d30af7 - stable/13 - bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 689d66d30af7d6693a9d8c6efb15ea6494edd71f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:12 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=689d66d30af7d6693a9d8c6efb15ea6494edd71f commit 689d66d30af7d6693a9d8c6efb15ea6494edd71f Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:09:22 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 08:59:33 +0000 bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions MFC after: 2 weeks (cherry picked from commit 2fda01a1b7e958e6cfffda512954b8d6c40a064e) --- usr.sbin/bhyve/bhyve.8 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 1410769d8a37..06356a64f596 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -470,28 +470,28 @@ are: Expose the share in read-only mode. .El .Pp -TTY devices: +TTY device backends: .Bl -tag -width 10n -.It Li stdio +.It Cm stdio Connect the serial port to the standard input and output of the .Nm process. -.It Pa /dev/xxx +.It Ar /dev/xxx Use the host TTY device for serial port I/O. .El .Pp -Boot ROM device: +Boot ROM device backends: .Bl -tag -width 10n -.It Pa romfile +.It Ar romfile Map .Ar romfile in the guest address space reserved for boot firmware. .El .Pp -Pass-through devices: +Pass-through device backends: .Bl -tag -width 10n -.It Ns Ar slot Ns / Ns Ar bus Ns / Ns Ar function +.It Ns Ar slot Ns Cm \&/ Ns Ar bus Ns Cm \&/ Ns Ar function Connect to a PCI device on the host at the selector described by .Ar slot , .Ar bus , From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C11B670246; Mon, 16 Aug 2021 09:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7Wh4NJ2z3RJq; Mon, 16 Aug 2021 09:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50723262EF; Mon, 16 Aug 2021 09:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G94GMt069550; Mon, 16 Aug 2021 09:04:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G94G3S069549; Mon, 16 Aug 2021 09:04:16 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:16 GMT Message-Id: <202108160904.17G94G3S069549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: fe7ce1f3b80a - stable/13 - bhyve.8: Improve AHCI backends documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fe7ce1f3b80a63ddfffc7b840069b08abb0afd0c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:17 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fe7ce1f3b80a63ddfffc7b840069b08abb0afd0c commit fe7ce1f3b80a63ddfffc7b840069b08abb0afd0c Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:44:23 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:00:27 +0000 bhyve.8: Improve AHCI backends documentation - Document the backend format. MFC after: 2 weeks (cherry picked from commit d5fcc4b6066e878ed70bce7a52d6aca605befde5) --- usr.sbin/bhyve/bhyve.8 | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index e5eec5288204..7bbb663665d7 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -681,15 +681,29 @@ and .Cm disable . .El .Pp -AHCI devices: +AHCI device backends: +.Bl -bullet +.It +.Sm off +.Op Oo Cm hd\&: | cd\&: Oc Ar path +.Op Cm ,nmrr= Ar nmrr +.Op Cm ,ser= Ar # +.Op Cm ,rev= Ar # +.Op Cm ,model= Ar # +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li nmrr -Nominal Media Rotation Rate, known as RPM. value 1 will indicate device as Solid State Disk. default value is 0, not report. -.It Li ser +.It Cm nmrr +Nominal Media Rotation Rate, known as RPM. +Value 1 will indicate device as Solid State Disk. +Default value is 0, not report. +.It Cm ser Serial Number with maximum 20 characters. -.It Li rev +.It Cm rev Revision Number with maximum 8 characters. -.It Li model +.It Cm model Model Number with maximum 40 characters. .El .Pp From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0853C670387; Mon, 16 Aug 2021 09:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7Wg2scYz3R8R; Mon, 16 Aug 2021 09:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 300BE269B9; Mon, 16 Aug 2021 09:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G94FUj069526; Mon, 16 Aug 2021 09:04:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G94FKa069525; Mon, 16 Aug 2021 09:04:15 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:15 GMT Message-Id: <202108160904.17G94FKa069525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a157ddbccada - stable/13 - bhyve.8: Improve documentation of NVME backend MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a157ddbccada17ed021cb3dd5566a8af604ebffd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:16 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a157ddbccada17ed021cb3dd5566a8af604ebffd commit a157ddbccada17ed021cb3dd5566a8af604ebffd Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:16:51 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:00:20 +0000 bhyve.8: Improve documentation of NVME backend - Document the configuration format. - Document two additional configuration options: eui64 and dsm. MFC after: 2 weeks (cherry picked from commit 6eff58acc776d8308863f49b89664997d4642a4e) --- usr.sbin/bhyve/bhyve.8 | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index afc3a5c615c8..e5eec5288204 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -630,32 +630,55 @@ Many implementations will want to use stronger security, such as running the session over an encrypted channel provided by IPsec or SSH. .El .Pp -xHCI USB devices: +xHCI USB device backends: .Bl -tag -width 10n -.It Li tablet +.It Cm tablet A USB tablet device which provides precise cursor synchronization when using VNC. .El .Pp -NVMe devices: +NVMe device backends: +.Bl -bullet +.Sm off +.It +.Ar devpath +.Op Cm ,maxq= Ar # +.Op Cm ,qsz= Ar # +.Op Cm ,ioslots= Ar # +.Op Cm ,sectsz= Ar # +.Op Cm ,ser= Ar # +.Op Cm ,eui64= Ar # +.Op Cm ,dsm= Ar opt +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li devpath +.It Ar devpath Accepted device paths are: .Ar /dev/blockdev or .Ar /path/to/image or -.Ar ram=size_in_MiB . -.It Li maxq +.Cm ram= Ns Ar size_in_MiB . +.It Cm maxq Max number of queues. -.It Li qsz +.It Cm qsz Max elements in each queue. -.It Li ioslots +.It Cm ioslots Max number of concurrent I/O requests. -.It Li sectsz +.It Cm sectsz Sector size (defaults to blockif sector size). -.It Li ser +.It Cm ser Serial number with maximum 20 characters. +.It Cm eui64 +IEEE Extended Unique Identifier (8 byte value). +.It Cm dsm +DataSet Management support. +Supported values are: +.Cm auto , enable , +and +.Cm disable . .El .Pp AHCI devices: From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:04:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA5FC670334; Mon, 16 Aug 2021 09:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7Wk6Ltbz3RFw; Mon, 16 Aug 2021 09:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F244269BA; Mon, 16 Aug 2021 09:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G94IpM069598; Mon, 16 Aug 2021 09:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G94IbV069597; Mon, 16 Aug 2021 09:04:18 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:04:18 GMT Message-Id: <202108160904.17G94IbV069597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: f1297ee6459a - stable/13 - bhyve.8: Fix mandoc -Tlint issues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f1297ee6459a8091c3b5a23e72fa499455f5a7eb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:04:19 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f1297ee6459a8091c3b5a23e72fa499455f5a7eb commit f1297ee6459a8091c3b5a23e72fa499455f5a7eb Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:53:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:00:54 +0000 bhyve.8: Fix mandoc -Tlint issues While here, keep network backends section consistent with other sections. MFC after: 2 weeks (cherry picked from commit 8d9fefe64334818a27812658bf9efd0371fbc77c) --- usr.sbin/bhyve/bhyve.8 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index bf3c792dd235..79b6d9bfb240 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -56,7 +56,7 @@ .Sm off .Ar memsize .Oo -.Cm K No | Cm k No | Cm M No | Cm m No | Cm G No | Cm g No | Cm T No | Cm t +.Cm K | Cm k | Cm M | Cm m | Cm G | Cm g | Cm T | Cm t .Oc .Sm on .Oc @@ -339,8 +339,7 @@ If is not specified, the device emulation has no backend and can be considered unconnected. .Pp -Network backends formats for -.Ar conf : +Network device backends: .Sm off .Bl -bullet .It @@ -524,7 +523,7 @@ Every port is named and corresponds to a Unix domain socket created by accepts at most one connection per port at a time. .Pp Limitations: -.Bl -bullet -offset +.Bl -bullet .It Due to lack of destructors in .Nm , @@ -560,12 +559,12 @@ An IP address and a port VNC should listen on. There are two formats: .Pp .Bl -bullet -compact -.It IPv4 +.It .Sm off .Op Ar IPv4 Cm \&: .Ar port .Sm on -.It IPv6 +.It .Sm off .Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port .Sm on From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:23:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7733E671183; Mon, 16 Aug 2021 09:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7xw2vGwz3jGp; Mon, 16 Aug 2021 09:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4710026BF8; Mon, 16 Aug 2021 09:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G9NWG6096608; Mon, 16 Aug 2021 09:23:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G9NWrV096607; Mon, 16 Aug 2021 09:23:32 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:23:32 GMT Message-Id: <202108160923.17G9NWrV096607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e6ff640738b5 - stable/13 - nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6ff640738b5a158fa7de33349ca51d278609dc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:23:32 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e6ff640738b5a158fa7de33349ca51d278609dc1 commit e6ff640738b5a158fa7de33349ca51d278609dc1 Author: Konstantin Belousov AuthorDate: 2021-01-22 21:47:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-16 09:23:12 +0000 nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write (cherry picked from commit aa8c1f8d84d2638a354e71f9593e978d00878243) --- sys/fs/nfsclient/nfs_clbio.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 67bc3b7ce4d5..f4b0855f7dda 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -903,7 +903,7 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount, noncontig_write, obcount; - int bp_cached, n, on, error = 0, error1, wouldcommit; + int bp_cached, n, on, error = 0, error1, save2, wouldcommit; size_t orig_resid, local_resid; off_t orig_size, tmp_off; @@ -995,6 +995,7 @@ ncl_write(struct vop_write_args *ap) if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); + save2 = curthread_pflags2_set(TDP2_SBPAGES); biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes @@ -1033,7 +1034,7 @@ ncl_write(struct vop_write_args *ap) error = ncl_vinvalbuf(vp, V_SAVE | ((ioflag & IO_VMIO) != 0 ? V_VMIO : 0), td, 1); if (error != 0) - return (error); + goto out; wouldcommit = biosize; } } @@ -1073,6 +1074,7 @@ again: NFSLOCKNODE(np); np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; + np->n_flag &= ~NVNSETSZSKIP; vnode_pager_setsize(vp, np->n_size); NFSUNLOCKNODE(np); @@ -1102,6 +1104,7 @@ again: if (uio->uio_offset + n > np->n_size) { np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; + np->n_flag &= ~NVNSETSZSKIP; vnode_pager_setsize(vp, np->n_size); } NFSUNLOCKNODE(np); @@ -1291,6 +1294,13 @@ again: } } +out: + curthread_pflags2_restore(save2); + if ((curthread->td_pflags2 & TDP2_SBPAGES) == 0) { + NFSLOCKNODE(np); + ncl_pager_setsize(vp, NULL); + } + return (error); } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:23:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F4B66710D0; Mon, 16 Aug 2021 09:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp7xx3ppKz3jfR; Mon, 16 Aug 2021 09:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68F2B27024; Mon, 16 Aug 2021 09:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G9NXJa096632; Mon, 16 Aug 2021 09:23:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G9NXvj096631; Mon, 16 Aug 2021 09:23:33 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:23:33 GMT Message-Id: <202108160923.17G9NXvj096631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f8cb59615252 - stable/13 - nfs_write(): do not call ncl_pager_setsize() after clearing TDP2_SBPAGES MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8cb59615252f38ad0855abfcd01fd564a7c4862 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:23:33 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f8cb59615252f38ad0855abfcd01fd564a7c4862 commit f8cb59615252f38ad0855abfcd01fd564a7c4862 Author: Konstantin Belousov AuthorDate: 2021-01-23 21:40:07 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-16 09:23:12 +0000 nfs_write(): do not call ncl_pager_setsize() after clearing TDP2_SBPAGES (cherry picked from commit bd01a69f4836994b50b492883fb5367db41fb506) --- sys/fs/nfsclient/nfs_clbio.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index f4b0855f7dda..ff9f446ff1ef 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -1296,11 +1296,6 @@ again: out: curthread_pflags2_restore(save2); - if ((curthread->td_pflags2 & TDP2_SBPAGES) == 0) { - NFSLOCKNODE(np); - ncl_pager_setsize(vp, NULL); - } - return (error); } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 09:36:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EE43670F5D; Mon, 16 Aug 2021 09:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gp8F03bnSz3l4d; Mon, 16 Aug 2021 09:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6423D2730F; Mon, 16 Aug 2021 09:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17G9aa5Q011045; Mon, 16 Aug 2021 09:36:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17G9aajD011044; Mon, 16 Aug 2021 09:36:36 GMT (envelope-from git) Date: Mon, 16 Aug 2021 09:36:36 GMT Message-Id: <202108160936.17G9aajD011044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: cc1345056b11 - main - Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc1345056b113d57f0c65b0ecf3e3d5da3f34276 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 09:36:36 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=cc1345056b113d57f0c65b0ecf3e3d5da3f34276 commit cc1345056b113d57f0c65b0ecf3e3d5da3f34276 Author: Alex Richardson AuthorDate: 2021-08-16 08:56:17 +0000 Commit: Alex Richardson CommitDate: 2021-08-16 08:57:33 +0000 Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap This causes build failures on macOS where the build can end up invoking an incompatible m4 binary. Fxies: 2de949cf85d0 ("Remove mkcsmapper_static and mkesdb_static from build-tools") --- Makefile.inc1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 2c1f72085110..2b631c2311f0 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2361,6 +2361,8 @@ ${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend} .if ${MK_ICONV} != "no" _mkesdb= usr.bin/mkesdb _mkcsmapper= usr.bin/mkcsmapper +${_bt}-usr.bin/mkesdb: ${_bt}-usr.bin/yacc ${_bt_lex_depend} +${_bt}-usr.bin/mkcsmapper: ${_bt}-usr.bin/yacc ${_bt_lex_depend} .endif .if ${MK_KERBEROS} != "no" From owner-dev-commits-src-all@freebsd.org Mon Aug 16 10:56:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDAD467220C; Mon, 16 Aug 2021 10:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpB0t6JWwz3nYH; Mon, 16 Aug 2021 10:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC1A91BE; Mon, 16 Aug 2021 10:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GAuECl017025; Mon, 16 Aug 2021 10:56:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GAuEsk017024; Mon, 16 Aug 2021 10:56:14 GMT (envelope-from git) Date: Mon, 16 Aug 2021 10:56:14 GMT Message-Id: <202108161056.17GAuEsk017024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e6c769620316 - main - rtld: Fix i386/amd64 TP offset when p_vaddr % p_align != 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6c76962031625d51fe4225ecfa15c85155eb13a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 10:56:15 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e6c76962031625d51fe4225ecfa15c85155eb13a commit e6c76962031625d51fe4225ecfa15c85155eb13a Author: Fangrui Song AuthorDate: 2021-08-14 16:56:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-16 10:55:34 +0000 rtld: Fix i386/amd64 TP offset when p_vaddr % p_align != 0 For a Variant II architecture, the TP offset of a TLS symbol is st_value - tlsoffset + r_addend. tlsoffset is computed by either calculate_tls_offset or calculate_first_tls_offset. The return value of calculate_first_tls_offset is the smallest integer satisfying res >= size and (-res) % p_align = p_vaddr % p_align (= p_offset % p_align). (The formula is a bit contrived. The basic idea is to subtract the minimum integer from size + align - 1 so that the result ihas the expected remainder.) Reviewed by: kib MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31538 Differential revision: https://reviews.freebsd.org/D31541 --- libexec/rtld-elf/amd64/reloc.c | 27 ++++++++++++--------------- libexec/rtld-elf/i386/reloc.c | 27 ++++++++++++--------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 689b0d8635d4..508ae04a7448 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -548,29 +548,26 @@ __tls_get_addr(tls_index *ti) } size_t -calculate_first_tls_offset(size_t size, size_t align, size_t offset) +calculate_tls_offset(size_t prev_offset, size_t prev_size __unused, + size_t size, size_t align, size_t offset) { size_t res; - res = roundup(size, align); - offset &= align - 1; - if (offset != 0) - res += align - offset; - return (res); + /* + * res is the smallest integer satisfying res - prev_offset >= size + * and (-res) % p_align = p_vaddr % p_align (= p_offset % p_align). + */ + res = prev_offset + size + align - 1; + res -= (res + offset) & (align - 1); + return (res); } size_t -calculate_tls_offset(size_t prev_offset, size_t prev_size __unused, size_t size, - size_t align, size_t offset) +calculate_first_tls_offset(size_t size, size_t align, size_t offset) { - size_t res; - - res = roundup(prev_offset + size, align); - offset &= align - 1; - if (offset != 0) - res += align - offset; - return (res); + return (calculate_tls_offset(0, 0, size, align, offset)); } + size_t calculate_tls_end(size_t off, size_t size __unused) { diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index cab163b35e6a..69da93347bbb 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -539,29 +539,26 @@ __tls_get_addr(tls_index *ti) } size_t -calculate_first_tls_offset(size_t size, size_t align, size_t offset) +calculate_tls_offset(size_t prev_offset, size_t prev_size __unused, + size_t size, size_t align, size_t offset) { size_t res; - res = roundup(size, align); - offset &= align - 1; - if (offset != 0) - res += align - offset; - return (res); + /* + * res is the smallest integer satisfying res - prev_offset >= size + * and (-res) % p_align = p_vaddr % p_align (= p_offset % p_align). + */ + res = prev_offset + size + align - 1; + res -= (res + offset) & (align - 1); + return (res); } size_t -calculate_tls_offset(size_t prev_offset, size_t prev_size __unused, size_t size, - size_t align, size_t offset) +calculate_first_tls_offset(size_t size, size_t align, size_t offset) { - size_t res; - - res = roundup(prev_offset + size, align); - offset &= align - 1; - if (offset != 0) - res += align - offset; - return (res); + return (calculate_tls_offset(0, 0, size, align, offset)); } + size_t calculate_tls_end(size_t off, size_t size __unused) { From owner-dev-commits-src-all@freebsd.org Mon Aug 16 10:56:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FD3567194B; Mon, 16 Aug 2021 10:56:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpB0v6xsMz3nqR; Mon, 16 Aug 2021 10:56:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D662F23B; Mon, 16 Aug 2021 10:56:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GAuFfN017049; Mon, 16 Aug 2021 10:56:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GAuFNC017048; Mon, 16 Aug 2021 10:56:15 GMT (envelope-from git) Date: Mon, 16 Aug 2021 10:56:15 GMT Message-Id: <202108161056.17GAuFNC017048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8f63fa78e84a - main - rtld: Remove calculate_tls_end MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f63fa78e84afd23fa68c82eabfe64763c92d4f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 10:56:16 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8f63fa78e84afd23fa68c82eabfe64763c92d4f5 commit 8f63fa78e84afd23fa68c82eabfe64763c92d4f5 Author: Fangrui Song AuthorDate: 2021-08-14 17:02:09 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-16 10:55:35 +0000 rtld: Remove calculate_tls_end Variant I architectures use off and Variant II ones use size + off. Define TLS_VARIANT_I/TLS_VARIANT_II symbols similarly to how libc handles it. Reviewed by: kib MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31539 Differential revision: https://reviews.freebsd.org/D31541 --- lib/libc/gen/tls.c | 8 -------- libexec/rtld-elf/aarch64/rtld_machdep.h | 2 +- libexec/rtld-elf/amd64/reloc.c | 6 ------ libexec/rtld-elf/amd64/rtld_machdep.h | 2 +- libexec/rtld-elf/arm/rtld_machdep.h | 2 +- libexec/rtld-elf/i386/reloc.c | 6 ------ libexec/rtld-elf/i386/rtld_machdep.h | 2 +- libexec/rtld-elf/mips/rtld_machdep.h | 2 +- libexec/rtld-elf/powerpc/rtld_machdep.h | 2 +- libexec/rtld-elf/powerpc64/rtld_machdep.h | 2 +- libexec/rtld-elf/riscv/rtld_machdep.h | 2 +- libexec/rtld-elf/rtld.c | 25 ++++++++++++++++--------- 12 files changed, 24 insertions(+), 37 deletions(-) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 98915ef4ddf7..b5f5dfd4d315 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -81,14 +81,6 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign); #error TLS_TCB_ALIGN undefined for target architecture #endif -#if defined(__aarch64__) || defined(__arm__) || defined(__mips__) || \ - defined(__powerpc__) || defined(__riscv) -#define TLS_VARIANT_I -#endif -#if defined(__i386__) || defined(__amd64__) -#define TLS_VARIANT_II -#endif - #if defined(__mips__) || defined(__powerpc__) || defined(__riscv) #define DTV_OFFSET 0x8000 #else diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h index bdd5620867ba..585689afe197 100644 --- a/libexec/rtld-elf/aarch64/rtld_machdep.h +++ b/libexec/rtld-elf/aarch64/rtld_machdep.h @@ -76,7 +76,6 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, round(16, align) #define calculate_tls_offset(prev_offset, prev_size, size, align, offset) \ round(prev_offset + prev_size, align) -#define calculate_tls_end(off, size) ((off) + (size)) #define calculate_tls_post_size(align) \ round(TLS_TCB_SIZE, align) - TLS_TCB_SIZE @@ -93,6 +92,7 @@ extern void *__tls_get_addr(tls_index *ti); #define md_abi_variant_hook(x) +#define TLS_VARIANT_I 1 #define TLS_DTV_OFFSET 0 #endif diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 508ae04a7448..1fec863c063b 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -567,9 +567,3 @@ calculate_first_tls_offset(size_t size, size_t align, size_t offset) { return (calculate_tls_offset(0, 0, size, align, offset)); } - -size_t -calculate_tls_end(size_t off, size_t size __unused) -{ - return (off); -} diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h index 30c82dcb0625..baa926445006 100644 --- a/libexec/rtld-elf/amd64/rtld_machdep.h +++ b/libexec/rtld-elf/amd64/rtld_machdep.h @@ -73,10 +73,10 @@ void *__tls_get_addr(tls_index *ti) __exported; #define md_abi_variant_hook(x) +#define TLS_VARIANT_II 1 #define TLS_DTV_OFFSET 0 size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset); size_t calculate_tls_offset(size_t prev_offset, size_t prev_size, size_t size, size_t align, size_t offset); -size_t calculate_tls_end(size_t off, size_t size); #endif diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index b333b1f153eb..d890cb377fa3 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -68,7 +68,6 @@ typedef struct { round(8, align) #define calculate_tls_offset(prev_offset, prev_size, size, align, offset) \ round(prev_offset + prev_size, align) -#define calculate_tls_end(off, size) ((off) + (size)) #define calculate_tls_post_size(align) \ round(TLS_TCB_SIZE, align) - TLS_TCB_SIZE @@ -86,6 +85,7 @@ extern void arm_abi_variant_hook(Elf_Auxinfo **); #define md_abi_variant_hook(x) #endif +#define TLS_VARIANT_I 1 #define TLS_DTV_OFFSET 0 #endif diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 69da93347bbb..603a93a2338c 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -558,9 +558,3 @@ calculate_first_tls_offset(size_t size, size_t align, size_t offset) { return (calculate_tls_offset(0, 0, size, align, offset)); } - -size_t -calculate_tls_end(size_t off, size_t size __unused) -{ - return (off); -} diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h index 78154a1992d4..33e7d95f966d 100644 --- a/libexec/rtld-elf/i386/rtld_machdep.h +++ b/libexec/rtld-elf/i386/rtld_machdep.h @@ -74,10 +74,10 @@ void *__tls_get_addr(tls_index *ti) __exported; #define md_abi_variant_hook(x) +#define TLS_VARIANT_II 1 #define TLS_DTV_OFFSET 0 size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset); size_t calculate_tls_offset(size_t prev_offset, size_t prev_size, size_t size, size_t align, size_t offset); -size_t calculate_tls_end(size_t off, size_t size); #endif diff --git a/libexec/rtld-elf/mips/rtld_machdep.h b/libexec/rtld-elf/mips/rtld_machdep.h index 041a5d05f9a7..0cb56290152e 100644 --- a/libexec/rtld-elf/mips/rtld_machdep.h +++ b/libexec/rtld-elf/mips/rtld_machdep.h @@ -68,7 +68,6 @@ typedef struct { TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align, offset) \ round(prev_offset + prev_size, align) -#define calculate_tls_end(off, size) ((off) + (size)) #define calculate_tls_post_size(align) 0 extern void *__tls_get_addr(tls_index *ti); @@ -78,6 +77,7 @@ extern void *__tls_get_addr(tls_index *ti); #define md_abi_variant_hook(x) +#define TLS_VARIANT_I 1 #define TLS_DTV_OFFSET 0 #endif diff --git a/libexec/rtld-elf/powerpc/rtld_machdep.h b/libexec/rtld-elf/powerpc/rtld_machdep.h index a35ac1f4ebf5..c98dc7d3acb5 100644 --- a/libexec/rtld-elf/powerpc/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc/rtld_machdep.h @@ -73,6 +73,7 @@ void _rtld_powerpc_pltcall(void); * TLS */ +#define TLS_VARIANT_I 1 #define TLS_TP_OFFSET 0x7000 #define TLS_DTV_OFFSET 0x8000 #define TLS_TCB_SIZE 8 @@ -83,7 +84,6 @@ void _rtld_powerpc_pltcall(void); TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align, offset) \ round(prev_offset + prev_size, align) -#define calculate_tls_end(off, size) ((off) + (size)) #define calculate_tls_post_size(align) 0 typedef struct { diff --git a/libexec/rtld-elf/powerpc64/rtld_machdep.h b/libexec/rtld-elf/powerpc64/rtld_machdep.h index 486f4ffe95bc..98bdbb33affe 100644 --- a/libexec/rtld-elf/powerpc64/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc64/rtld_machdep.h @@ -65,6 +65,7 @@ extern u_long cpu_features2; /* r4 */ * TLS */ +#define TLS_VARIANT_I 1 #define TLS_TP_OFFSET 0x7000 #define TLS_DTV_OFFSET 0x8000 #define TLS_TCB_SIZE 16 @@ -75,7 +76,6 @@ extern u_long cpu_features2; /* r4 */ TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align, offset) \ round(prev_offset + prev_size, align) -#define calculate_tls_end(off, size) ((off) + (size)) #define calculate_tls_post_size(align) 0 typedef struct { diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index 43349b4ab403..7a087ca2ab7c 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -82,6 +82,7 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, /* * TLS */ +#define TLS_VARIANT_I 1 #define TLS_TP_OFFSET 0x0 #define TLS_DTV_OFFSET 0x800 #define TLS_TCB_SIZE 16 @@ -92,7 +93,6 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align, offset) \ round(prev_offset + prev_size, align) -#define calculate_tls_end(off, size) ((off) + (size)) #define calculate_tls_post_size(align) 0 typedef struct { diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index eaad89339d07..23482e07fc5f 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4939,8 +4939,7 @@ tls_get_addr_common(Elf_Addr **dtvp, int index, size_t offset) return (tls_get_addr_slow(dtvp, index, offset, false)); } -#if defined(__aarch64__) || defined(__arm__) || defined(__mips__) || \ - defined(__powerpc__) || defined(__riscv) +#ifdef TLS_VARIANT_I /* * Return pointer to allocated TLS block @@ -5071,9 +5070,9 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused) free_aligned(get_tls_block_ptr(tcb, tcbsize)); } -#endif +#endif /* TLS_VARIANT_I */ -#if defined(__i386__) || defined(__amd64__) +#ifdef TLS_VARIANT_II /* * Allocate Static TLS using the Variant II method. @@ -5179,7 +5178,7 @@ free_tls(void *tls, size_t tcbsize __unused, size_t tcbalign) free((void*) dtv); } -#endif +#endif /* TLS_VARIANT_II */ /* * Allocate TLS block for module with given index. @@ -5227,6 +5226,11 @@ allocate_tls_offset(Obj_Entry *obj) off = calculate_tls_offset(tls_last_offset, tls_last_size, obj->tlssize, obj->tlsalign, obj->tlspoffset); + obj->tlsoffset = off; +#ifdef TLS_VARIANT_I + off += obj->tlssize; +#endif + /* * If we have already fixed the size of the static TLS block, we * must stay within that size. When allocating the static TLS, we @@ -5234,13 +5238,13 @@ allocate_tls_offset(Obj_Entry *obj) * loading modules which use static TLS. */ if (tls_static_space != 0) { - if (calculate_tls_end(off, obj->tlssize) > tls_static_space) + if (off > tls_static_space) return false; } else if (obj->tlsalign > tls_static_max_align) { tls_static_max_align = obj->tlsalign; } - tls_last_offset = obj->tlsoffset = off; + tls_last_offset = off; tls_last_size = obj->tlssize; obj->tls_done = true; @@ -5257,8 +5261,11 @@ free_tls_offset(Obj_Entry *obj) * simplistic workaround to allow libGL.so.1 to be loaded and * unloaded multiple times. */ - if (calculate_tls_end(obj->tlsoffset, obj->tlssize) - == calculate_tls_end(tls_last_offset, tls_last_size)) { + size_t off = obj->tlsoffset; +#ifdef TLS_VARIANT_I + off += obj->tlssize; +#endif + if (off == tls_last_offset) { tls_last_offset -= obj->tlssize; tls_last_size = 0; } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 10:56:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FDB3671954; Mon, 16 Aug 2021 10:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpB0x0mQHz3nh2; Mon, 16 Aug 2021 10:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA68023C; Mon, 16 Aug 2021 10:56:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GAuGu0017073; Mon, 16 Aug 2021 10:56:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GAuG9B017072; Mon, 16 Aug 2021 10:56:16 GMT (envelope-from git) Date: Mon, 16 Aug 2021 10:56:16 GMT Message-Id: <202108161056.17GAuG9B017072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 300e08933e80 - main - libc tls: use TLS_DTV_OFFSET defined by rtld.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 300e08933e80e9fce02d0d2f7a64e3ad27e4ce8e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 10:56:17 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=300e08933e80e9fce02d0d2f7a64e3ad27e4ce8e commit 300e08933e80e9fce02d0d2f7a64e3ad27e4ce8e Author: Konstantin Belousov AuthorDate: 2021-08-15 02:14:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-16 10:55:35 +0000 libc tls: use TLS_DTV_OFFSET defined by rtld.h Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31541 --- lib/libc/gen/tls.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index b5f5dfd4d315..d90aac028b88 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -81,12 +81,6 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign); #error TLS_TCB_ALIGN undefined for target architecture #endif -#if defined(__mips__) || defined(__powerpc__) || defined(__riscv) -#define DTV_OFFSET 0x8000 -#else -#define DTV_OFFSET 0 -#endif - #ifndef PIC static size_t libc_tls_static_space; @@ -289,7 +283,7 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) /* Adjust the DTV. */ dtv = tcb[0]; - dtv[2] = (Elf_Addr)(tls + DTV_OFFSET); + dtv[2] = (Elf_Addr)(tls + TLS_DTV_OFFSET); } else { dtv = __je_bootstrap_malloc(3 * sizeof(Elf_Addr)); if (dtv == NULL) { @@ -300,7 +294,7 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) tcb[0] = dtv; dtv[0] = 1; /* Generation. */ dtv[1] = 1; /* Segments count. */ - dtv[2] = (Elf_Addr)(tls + DTV_OFFSET); + dtv[2] = (Elf_Addr)(tls + TLS_DTV_OFFSET); if (libc_tls_init_size > 0) memcpy(tls, libc_tls_init, libc_tls_init_size); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 10:56:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BAF767195A; Mon, 16 Aug 2021 10:56:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpB0y1cVyz3nSh; Mon, 16 Aug 2021 10:56:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EAA123D; Mon, 16 Aug 2021 10:56:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GAuIxQ017097; Mon, 16 Aug 2021 10:56:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GAuI3q017096; Mon, 16 Aug 2021 10:56:18 GMT (envelope-from git) Date: Mon, 16 Aug 2021 10:56:18 GMT Message-Id: <202108161056.17GAuI3q017096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 7da378f9de1a - main - rtld: Switch to the standard symbol lookup behavior if LD_DYNAMIC_WEAK is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7da378f9de1a042ec0c81ba7ad39a392540d4721 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 10:56:18 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7da378f9de1a042ec0c81ba7ad39a392540d4721 commit 7da378f9de1a042ec0c81ba7ad39a392540d4721 Author: Fangrui Song AuthorDate: 2021-08-15 04:13:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-16 10:55:35 +0000 rtld: Switch to the standard symbol lookup behavior if LD_DYNAMIC_WEAK is set The current lookup prefers a strong definition to a STB_WEAK definition (similar to glibc pre-2.2 behavior) which does not conform to the ELF specification. The non-compliant behavior provoked https://reviews.llvm.org/D4418 which was intended to fix -shared-libasan but introduced new problems (and caused some sanitizer tests (e.g. test/asan/TestCases/interception_failure_test.cpp) to fail): sanitizer interceptors are STB_GLOBAL instead of STB_WEAK, so defining a second STB_GLOBAL interceptor can lead to a multiple definition linker error. For example, in a -fsanitize={address,memory,...} build, libc functions like malloc/free/strtol/... cannot be provided by user object files. See https://docs.freebsd.org/cgi/getmsg.cgi?fetch=16483939+0+archive/2014/freebsd-current/20140716.freebsd-current for discussions. This patch implements the ELF-compliant behavior when LD_DYNAMIC_WEAK is set. STB_WEAK wrestling in symbol lookups in `Search the dynamic linker itself` are untouched. Reviewed by: kib MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26352 --- libexec/rtld-elf/rtld.1 | 20 +++++++++++++++++++- libexec/rtld-elf/rtld.c | 40 ++++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 2d262f77aa13..8bc4cfade070 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2021 +.Dd August 15, 2021 .Dt RTLD 1 .Os .Sh NAME @@ -143,6 +143,24 @@ If set, .Nm will print a table containing all relocations before symbol binding and relocation. +.It Ev LD_DYNAMIC_WEAK +If set, use the ELF standard-compliant symbol lookup behavior: +resolve to the first found symbol definition. +.Pp +By default, +.Fx +provides the non-standard symbol lookup behavior: +when a weak symbol definition is found, remember the definition and +keep searching in the remaining shared objects for a non-weak definition. +If found, the non-weak definition is preferred, otherwise the remembered +weak definition is returned. +.Pp +Symbols exported by dynamic linker itself (see +.Xr dlfcn 3 ) +are always resolved using +.Fx +rules regardless of the presence of the variable. +This variable is unset for set-user-ID and set-group-ID programs. .It Ev LD_LIBMAP A library replacement list in the same format as .Xr libmap.conf 5 . diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 23482e07fc5f..61b823aaacf8 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -209,6 +209,8 @@ static bool dangerous_ld_env; /* True if environment variables have been bool ld_bind_not; /* Disable PLT update */ static char *ld_bind_now; /* Environment variable for immediate binding */ static char *ld_debug; /* Environment variable for debugging */ +static bool ld_dynamic_weak = true; /* True if non-weak definition overrides + weak definition */ static char *ld_library_path; /* Environment variable for search path */ static char *ld_library_dirs; /* Environment variable for library descriptors */ static char *ld_preload; /* Environment variable for libraries to @@ -583,7 +585,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) unsetenv(_LD("LIBMAP_DISABLE")) || unsetenv(_LD("BIND_NOT")) || unsetenv(_LD("DEBUG")) || unsetenv(_LD("ELF_HINTS_PATH")) || unsetenv(_LD("LOADFLTR")) || unsetenv(_LD("LIBRARY_PATH_RPATH")) || - unsetenv(_LD("PRELOAD_FDS"))) { + unsetenv(_LD("PRELOAD_FDS")) || unsetenv(_LD("DYNAMIC_WEAK"))) { _rtld_error("environment corrupt; aborting"); rtld_die(); } @@ -591,6 +593,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) ld_debug = getenv(_LD("DEBUG")); if (ld_bind_now == NULL) ld_bind_not = getenv(_LD("BIND_NOT")) != NULL; + ld_dynamic_weak = getenv(_LD("DYNAMIC_WEAK")) == NULL; libmap_disable = getenv(_LD("LIBMAP_DISABLE")) != NULL; libmap_override = getenv(_LD("LIBMAP")); ld_library_path = getenv(_LD("LIBRARY_PATH")); @@ -610,7 +613,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) } dangerous_ld_env = libmap_disable || (libmap_override != NULL) || (ld_library_path != NULL) || (ld_preload != NULL) || - (ld_elf_hints_path != NULL) || ld_loadfltr; + (ld_elf_hints_path != NULL) || ld_loadfltr || ld_dynamic_weak; ld_tracing = getenv(_LD("TRACE_LOADED_OBJECTS")); ld_utrace = getenv(_LD("UTRACE")); @@ -3673,11 +3676,12 @@ do_dlsym(void *handle, const char *name, void *retaddr, const Ver_Entry *ve, continue; res = symlook_obj(&req, obj); if (res == 0) { - if (def == NULL || - ELF_ST_BIND(req.sym_out->st_info) != STB_WEAK) { + if (def == NULL || (ld_dynamic_weak && + ELF_ST_BIND(req.sym_out->st_info) != STB_WEAK)) { def = req.sym_out; defobj = req.defobj_out; - if (ELF_ST_BIND(def->st_info) != STB_WEAK) + if (!ld_dynamic_weak || + ELF_ST_BIND(def->st_info) != STB_WEAK) break; } } @@ -3686,6 +3690,8 @@ do_dlsym(void *handle, const char *name, void *retaddr, const Ver_Entry *ve, * Search the dynamic linker itself, and possibly resolve the * symbol from there. This is how the application links to * dynamic linker services such as dlopen. + * Note that we ignore ld_dynamic_weak == false case, + * always overriding weak symbols by rtld definitions. */ if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { res = symlook_obj(&req, &obj_rtld); @@ -4288,10 +4294,10 @@ symlook_global(SymLook *req, DoneList *donelist) symlook_init_from_req(&req1, req); /* Search all objects loaded at program start up. */ - if (req->defobj_out == NULL || - ELF_ST_BIND(req->sym_out->st_info) == STB_WEAK) { + if (req->defobj_out == NULL || (ld_dynamic_weak && + ELF_ST_BIND(req->sym_out->st_info) == STB_WEAK)) { res = symlook_list(&req1, &list_main, donelist); - if (res == 0 && (req->defobj_out == NULL || + if (res == 0 && (!ld_dynamic_weak || req->defobj_out == NULL || ELF_ST_BIND(req1.sym_out->st_info) != STB_WEAK)) { req->sym_out = req1.sym_out; req->defobj_out = req1.defobj_out; @@ -4301,8 +4307,8 @@ symlook_global(SymLook *req, DoneList *donelist) /* Search all DAGs whose roots are RTLD_GLOBAL objects. */ STAILQ_FOREACH(elm, &list_global, link) { - if (req->defobj_out != NULL && - ELF_ST_BIND(req->sym_out->st_info) != STB_WEAK) + if (req->defobj_out != NULL && (!ld_dynamic_weak || + ELF_ST_BIND(req->sym_out->st_info) != STB_WEAK)) break; res = symlook_list(&req1, &elm->obj->dagmembers, donelist); if (res == 0 && (req->defobj_out == NULL || @@ -4351,8 +4357,8 @@ symlook_default(SymLook *req, const Obj_Entry *refobj) /* Search all dlopened DAGs containing the referencing object. */ STAILQ_FOREACH(elm, &refobj->dldags, link) { - if (req->sym_out != NULL && - ELF_ST_BIND(req->sym_out->st_info) != STB_WEAK) + if (req->sym_out != NULL && (!ld_dynamic_weak || + ELF_ST_BIND(req->sym_out->st_info) != STB_WEAK)) break; res = symlook_list(&req1, &elm->obj->dagmembers, &donelist); if (res == 0 && (req->sym_out == NULL || @@ -4397,10 +4403,11 @@ symlook_list(SymLook *req, const Objlist *objlist, DoneList *dlp) continue; symlook_init_from_req(&req1, req); if ((res = symlook_obj(&req1, elm->obj)) == 0) { - if (def == NULL || ELF_ST_BIND(req1.sym_out->st_info) != STB_WEAK) { + if (def == NULL || (ld_dynamic_weak && + ELF_ST_BIND(req1.sym_out->st_info) != STB_WEAK)) { def = req1.sym_out; defobj = req1.defobj_out; - if (ELF_ST_BIND(def->st_info) != STB_WEAK) + if (!ld_dynamic_weak || ELF_ST_BIND(def->st_info) != STB_WEAK) break; } } @@ -4435,10 +4442,11 @@ symlook_needed(SymLook *req, const Needed_Entry *needed, DoneList *dlp) if (n->obj == NULL || (res = symlook_list(&req1, &n->obj->dagmembers, dlp)) != 0) continue; - if (def == NULL || ELF_ST_BIND(req1.sym_out->st_info) != STB_WEAK) { + if (def == NULL || (ld_dynamic_weak && + ELF_ST_BIND(req1.sym_out->st_info) != STB_WEAK)) { def = req1.sym_out; defobj = req1.defobj_out; - if (ELF_ST_BIND(def->st_info) != STB_WEAK) + if (!ld_dynamic_weak || ELF_ST_BIND(def->st_info) != STB_WEAK) break; } } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:14:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FF096728D8; Mon, 16 Aug 2021 11:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQN1rvMz3qqG; Mon, 16 Aug 2021 11:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23B6E712; Mon, 16 Aug 2021 11:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBEq07043906; Mon, 16 Aug 2021 11:14:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBEqwZ043905; Mon, 16 Aug 2021 11:14:52 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:14:52 GMT Message-Id: <202108161114.17GBEqwZ043905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2b3a36e9f026 - stable/12 - bhyve.8: Make synopsis more readable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2b3a36e9f0263988d947c107095f9b8676fd432e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:14:52 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2b3a36e9f0263988d947c107095f9b8676fd432e commit 2b3a36e9f0263988d947c107095f9b8676fd432e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 17:54:45 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:21:48 +0000 bhyve.8: Make synopsis more readable There is no need to squeeze all the possible options into one synopsis entry. Let "-l help" and "-s help" be listed separately. While here, keep -s and its arguments on the same line. MFC after: 2 weeks (cherry picked from commit bfe40b692d087cdd5fdeea69e18496ab2a7f67ac) --- usr.sbin/bhyve/bhyve.8 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index a104a60ab21f..e99782bc22b8 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2020 +.Dd April 18, 2021 .Dt BHYVE 8 .Os .Sh NAME @@ -49,7 +49,7 @@ .Op Fl g Ar gdbport .Oo Fl l .Sm off -.Cm help | Ar lpcdev Op Cm \&, Ar conf +.Ar lpcdev Op Cm \&, Ar conf .Sm on .Oc .Oo Fl m @@ -61,13 +61,17 @@ .Sm on .Oc .Op Fl p Ar vcpu Ns Cm \&: Ns Ar hostcpu -.Oo Fl s .Sm off -.Cm help | Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf +.Oo Fl s\~ +.Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf .Sm on .Oc .Op Fl U Ar uuid .Ar vmname +.Nm +.Fl l Cm help +.Nm +.Fl s Cm help .Sh DESCRIPTION .Nm is a hypervisor that runs guest operating systems inside a From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:14:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 957476725F1; Mon, 16 Aug 2021 11:14:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQP36JXz3qh3; Mon, 16 Aug 2021 11:14:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40E1B713; Mon, 16 Aug 2021 11:14:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBErUW043930; Mon, 16 Aug 2021 11:14:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBErHJ043929; Mon, 16 Aug 2021 11:14:53 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:14:53 GMT Message-Id: <202108161114.17GBErHJ043929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 10afb2770bb9 - stable/12 - bhyve: Fix synopsis in the usage message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 10afb2770bb99a4e3cc4e1c8ddbe32d9f5b80f0a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:14:53 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=10afb2770bb99a4e3cc4e1c8ddbe32d9f5b80f0a commit 10afb2770bb99a4e3cc4e1c8ddbe32d9f5b80f0a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 18:04:12 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:24:56 +0000 bhyve: Fix synopsis in the usage message In particular: - Sort short options to align with style(9) - Add two missing flags: -G and -r - Drop unnecessary angle brackets for consistency - Rename the "vm" argument to vmname for consistency with the manual page MFC after: 2 weeks (cherry picked from commit 03c3e5e40d6497afa33df1d0b43857157c086729) Note: the -r flag is not present on branch stable/12. --- usr.sbin/bhyve/bhyverun.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index c2990d480808..fb7c0357c9f9 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -213,10 +213,10 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-abehuwxACDHPSWY]\n" + "Usage: %s [-AaCDeHhPSuWwxY]\n" " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" - " %*s [-g ] [-l ]\n" - " %*s [-m mem] [-p vcpu:hostcpu] [-s ] [-U uuid] \n" + " %*s [-G port] [-k file] [-l lpc] [-m mem] [-o var=value]\n" + " %*s [-p vcpu:hostcpu] [-s pci] [-U uuid] vmname\n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" " -c: number of cpus and/or topology specification\n" From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:14:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8788A6728DB; Mon, 16 Aug 2021 11:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQQ3L0mz3qn0; Mon, 16 Aug 2021 11:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B95E832; Mon, 16 Aug 2021 11:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBEsYs043961; Mon, 16 Aug 2021 11:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBEs6O043960; Mon, 16 Aug 2021 11:14:54 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:14:54 GMT Message-Id: <202108161114.17GBEs6O043960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 91ee8dc8a654 - stable/12 - bhyve: Improve the option description in the usage message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 91ee8dc8a654702c431d1dd9c3ec348e1e8acc6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:14:54 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=91ee8dc8a654702c431d1dd9c3ec348e1e8acc6b commit 91ee8dc8a654702c431d1dd9c3ec348e1e8acc6b Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 18:13:54 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:25:34 +0000 bhyve: Improve the option description in the usage message - Sort options as suggested by style(9) - Capitalize some words like CPU and HLT - Add a missing description for the -G flag MFC after: 2 weeks (cherry picked from commit b6a572d03f654236b929b91d376ad1a6dfaa2e9a) --- usr.sbin/bhyve/bhyverun.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index fb7c0357c9f9..74d239704388 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -217,26 +217,28 @@ usage(int code) " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" " %*s [-G port] [-k file] [-l lpc] [-m mem] [-o var=value]\n" " %*s [-p vcpu:hostcpu] [-s pci] [-U uuid] vmname\n" - " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" - " -c: number of cpus and/or topology specification\n" + " -a: local apic is in xAPIC mode (deprecated)\n" " -C: include guest memory in core file\n" + " -c: number of CPUs and/or topology specification\n" " -D: destroy on power-off\n" " -e: exit on unhandled I/O access\n" - " -g: gdb port\n" + " -G: start a debug server\n" + " -H: vmexit from the guest on HLT\n" " -h: help\n" - " -H: vmexit from the guest on hlt\n" + " -k: key=value flat config file\n" " -l: LPC device configuration\n" " -m: memory size in MB\n" - " -p: pin 'vcpu' to 'hostcpu'\n" + " -o: set config 'var' to 'value'\n" " -P: vmexit from the guest on pause\n" - " -s: PCI slot config\n" + " -p: pin 'vcpu' to 'hostcpu'\n" " -S: guest memory cannot be swapped\n" + " -s: PCI slot config\n" + " -U: UUID\n" " -u: RTC keeps UTC time\n" - " -U: uuid\n" - " -w: ignore unimplemented MSRs\n" " -W: force virtio to use single-vector MSI\n" - " -x: local apic is in x2APIC mode\n" + " -w: ignore unimplemented MSRs\n" + " -x: local APIC is in x2APIC mode\n" " -Y: disable MPtable generation\n", progname, (int)strlen(progname), "", (int)strlen(progname), "", (int)strlen(progname), ""); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:14:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C00A9672743; Mon, 16 Aug 2021 11:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQR4RmRz3ql1; Mon, 16 Aug 2021 11:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EFD0714; Mon, 16 Aug 2021 11:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBEtVn043985; Mon, 16 Aug 2021 11:14:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBEtx5043984; Mon, 16 Aug 2021 11:14:55 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:14:55 GMT Message-Id: <202108161114.17GBEtx5043984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2eb1963a95d7 - stable/12 - bhyve.8: Sort the options in the OPTIONS section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2eb1963a95d7a29c82f63a5f19b9de645e8ef64e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:14:55 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2eb1963a95d7a29c82f63a5f19b9de645e8ef64e commit 2eb1963a95d7a29c82f63a5f19b9de645e8ef64e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 18:26:04 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:40:03 +0000 bhyve.8: Sort the options in the OPTIONS section No content change intended. Just moving the option descriptions around to follow the order suggested by style(9). MFC after: 2 weeks (cherry picked from commit ccb1c87a6aa563a927a98a6f9175d95929535b21) --- usr.sbin/bhyve/bhyve.8 | 67 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index e99782bc22b8..9cdb0ec48323 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -93,15 +93,15 @@ runs until the guest operating system reboots or an unhandled hypervisor exit is detected. .Sh OPTIONS .Bl -tag -width 10n -.It Fl a -The guest's local APIC is configured in xAPIC mode. -The xAPIC mode is the default setting so this option is redundant. -It will be deprecated in a future version. .It Fl A Generate ACPI tables. Required for .Fx Ns /amd64 guests. +.It Fl a +The guest's local APIC is configured in xAPIC mode. +The xAPIC mode is the default setting so this option is redundant. +It will be deprecated in a future version. .It Fl b Enable a low-level console device supported by .Fx @@ -109,6 +109,8 @@ kernels compiled with .Cd "device bvmconsole" . This option is deprecated and will be removed in .Fx 13.0 . +.It Fl C +Include guest memory in core file. .It Fl c Op Ar setting ... Number of guest virtual CPUs and/or the CPU topology. @@ -133,8 +135,6 @@ and If a .Ar setting is specified more than once the last one has precedence. -.It Fl C -Include guest memory in core file. .It Fl D Destroy the VM on guest initiated power-off. .It Fl e @@ -142,15 +142,6 @@ Force .Nm to exit when a guest issues an access to an I/O port that is not emulated. This is intended for debug purposes. -.It Fl g Ar gdbport -For -.Fx -kernels compiled with -.Cd "device bvmdebug" , -allow a remote kernel kgdb to be relayed to the guest kernel gdb stub -via a local IPv4 address and this port. -This option is deprecated and will be removed in -.Fx 13.0 . .It Fl G Ar port Start a debug server that uses the GDB protocol to export guest state to a debugger. @@ -164,11 +155,31 @@ begins with .Sq w , .Nm will pause execution at the first instruction waiting for a debugger to attach. -.It Fl h -Print help message and exit. +.It Fl g Ar gdbport +For +.Fx +kernels compiled with +.Cd "device bvmdebug" , +allow a remote kernel kgdb to be relayed to the guest kernel gdb stub +via a local IPv4 address and this port. +This option is deprecated and will be removed in +.Fx 13.0 . .It Fl H Yield the virtual CPU thread when a HLT instruction is detected. If this option is not specified, virtual CPUs will use 100% of a host CPU. +.It Fl h +Print help message and exit. +.It Fl k Ar file +Set configuration variables from a simple, key-value config file. +Each line of the config file is expected to consist of a config variable +name, an equals sign +.Pq Sq = , +and a value. +No spaces are permitted between the variable name, equals sign, or +value. +Blank lines and lines starting with +.Sq # +are ignored. .It Fl l Op Ar help|lpcdev Ns Op , Ns Ar conf Allow devices behind the LPC PCI-ISA bridge to be configured. The only supported devices are the TTY-class devices @@ -194,6 +205,13 @@ If no suffix is given, the value is assumed to be in megabytes. .Pp .Ar memsize defaults to 256M. +.It Fl o Ar var Ns Cm = Ns Ar value +Set the configuration variable +.Ar var +to +.Ar value . +.It Fl P +Force the guest virtual CPU to exit when a PAUSE instruction is detected. .It Fl p Ar vcpu:hostcpu Pin guest's virtual CPU .Em vcpu @@ -201,6 +219,8 @@ to .Em hostcpu . .It Fl P Force the guest virtual CPU to exit when a PAUSE instruction is detected. +.It Fl S +Wire guest memory. .It Fl s Op Ar help|slot,emulation Ns Op , Ns Ar conf Configure a virtual PCI slot and function. .Pp @@ -525,22 +545,21 @@ Playback device, typically Recording device, typically .Ar /dev/dsp0 . .El -.It Fl S -Wire guest memory. -.It Fl u -RTC keeps UTC time. +.El .It Fl U Ar uuid Set the universally unique identifier .Pq UUID in the guest's System Management BIOS System Information structure. By default a UUID is generated from the host's hostname and .Ar vmname . -.It Fl w -Ignore accesses to unimplemented Model Specific Registers (MSRs). -This is intended for debug purposes. +.It Fl u +RTC keeps UTC time. .It Fl W Force virtio PCI device emulations to use MSI interrupts instead of MSI-X interrupts. +.It Fl w +Ignore accesses to unimplemented Model Specific Registers (MSRs). +This is intended for debug purposes. .It Fl x The guest's local APIC is configured in x2APIC mode. .It Fl Y From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:14:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62E6D67292A; Mon, 16 Aug 2021 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQV0stFz3qf3; Mon, 16 Aug 2021 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5FCF834; Mon, 16 Aug 2021 11:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBEv1d044033; Mon, 16 Aug 2021 11:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBEvWT044032; Mon, 16 Aug 2021 11:14:57 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:14:57 GMT Message-Id: <202108161114.17GBEvWT044032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 1df561c26845 - stable/12 - bhyve.8: Improve the description of the -m flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1df561c2684506cd2eb90bea5b51619819a181c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:14:58 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1df561c2684506cd2eb90bea5b51619819a181c3 commit 1df561c2684506cd2eb90bea5b51619819a181c3 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 19:56:13 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:42:40 +0000 bhyve.8: Improve the description of the -m flag - Stylize the synopsis with proper mdoc macros - Do some wordsmithing on the description for consistency. MFC after: 2 weeks (cherry picked from commit 7e0cb3df687695212ae20cc90d5f2f48bd42eba7) --- usr.sbin/bhyve/bhyve.8 | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index c5761844d22a..9f2ab5defbbf 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -198,18 +198,26 @@ The possible values for the argument are listed in the .Fl s flag description. -.It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t -Guest physical memory size in bytes. +.It Xo +.Fl m Ar memsize Ns Oo +.Sm off +.Cm K | k | M | m | G | g | T | t +.Sm on +.Oc +.Xc +Set the guest physical memory size This must be the same size that was given to .Xr bhyveload 8 . .Pp -The size argument may be suffixed with one of K, M, G or T (either upper -or lower case) to indicate a multiple of kilobytes, megabytes, gigabytes, -or terabytes. +The size argument may be suffixed with one of +.Cm K , M , G +or +.Cm T +(either upper or lower case) +to indicate a multiple of kilobytes, megabytes, gigabytes, or terabytes. If no suffix is given, the value is assumed to be in megabytes. .Pp -.Ar memsize -defaults to 256M. +The default is 256M. .It Fl o Ar var Ns Cm = Ns Ar value Set the configuration variable .Ar var From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:14:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38B326727E9; Mon, 16 Aug 2021 11:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQS6BF9z3qTK; Mon, 16 Aug 2021 11:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99E60833; Mon, 16 Aug 2021 11:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBEuTa044009; Mon, 16 Aug 2021 11:14:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBEu2c044008; Mon, 16 Aug 2021 11:14:56 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:14:56 GMT Message-Id: <202108161114.17GBEu2c044008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a226b3b4e28b - stable/12 - bhyve.8: Improve the description and synopsis of -l MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a226b3b4e28b0c2e93f14febf46ba01d0a5bd685 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:14:57 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a226b3b4e28b0c2e93f14febf46ba01d0a5bd685 commit a226b3b4e28b0c2e93f14febf46ba01d0a5bd685 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 19:41:15 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:42:27 +0000 bhyve.8: Improve the description and synopsis of -l - Describe "-l help" separately for readability. - List all the supported comX devices explicitly - Use Cm instead of Ar for command modifiers (i.e., literal values a user can specify as an argument to the command). - Explain where to get more information about the possible values of the conf argument. MFC after: 2 weeks (cherry picked from commit 4c08b978b276f8cfc25f72715e97898f629f7f89) --- usr.sbin/bhyve/bhyve.8 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 9cdb0ec48323..c5761844d22a 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -180,19 +180,24 @@ value. Blank lines and lines starting with .Sq # are ignored. -.It Fl l Op Ar help|lpcdev Ns Op , Ns Ar conf +.It Fl l Cm help +Print a list of supported LPC devices. +.It Fl l Ar lpcdev Ns Op Cm \&, Ns Ar conf Allow devices behind the LPC PCI-ISA bridge to be configured. The only supported devices are the TTY-class devices .Ar com1 and .Ar com2 , the boot ROM device -.Ar bootrom , +.Cm bootrom , and the debug/test device -.Ar pc-testdev . +.Cm pc-testdev . .Pp -.Ar help -print a list of supported LPC devices. +The possible values for the +.Ar conf +argument are listed in the +.Fl s +flag description. .It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t Guest physical memory size in bytes. This must be the same size that was given to From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:14:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4B58672A82; Mon, 16 Aug 2021 11:14:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQW1m4Hz3qf9; Mon, 16 Aug 2021 11:14:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1A5B697; Mon, 16 Aug 2021 11:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBEwSB044057; Mon, 16 Aug 2021 11:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBEw9r044056; Mon, 16 Aug 2021 11:14:58 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:14:58 GMT Message-Id: <202108161114.17GBEw9r044056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 96bf53430abb - stable/12 - bhyve.8: Fix the synopsis of -p MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 96bf53430abb0bd60acef50515634eacef8ee955 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:14:59 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=96bf53430abb0bd60acef50515634eacef8ee955 commit 96bf53430abb0bd60acef50515634eacef8ee955 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:01:30 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:42:53 +0000 bhyve.8: Fix the synopsis of -p Use appropriate mdoc macros. MFC after: 2 weeks (cherry picked from commit 90df54374f1ce1b94c10c34c2a5b06be0353ebae) --- usr.sbin/bhyve/bhyve.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 9f2ab5defbbf..c65da7f1de54 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -225,7 +225,7 @@ to .Ar value . .It Fl P Force the guest virtual CPU to exit when a PAUSE instruction is detected. -.It Fl p Ar vcpu:hostcpu +.It Fl p Ar vcpu Ns Cm \& : Ns Ar hostcpu Pin guest's virtual CPU .Em vcpu to From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E444A67293E; Mon, 16 Aug 2021 11:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQY34lZz3qTc; Mon, 16 Aug 2021 11:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E630836; Mon, 16 Aug 2021 11:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBF1Hj044117; Mon, 16 Aug 2021 11:15:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBF1xx044116; Mon, 16 Aug 2021 11:15:01 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:01 GMT Message-Id: <202108161115.17GBF1xx044116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 1b248e820c7b - stable/12 - bhyve.8: Clean-up synopsis of -s MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1b248e820c7b3fbf3afe1091ad6b5feee1277bb4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:02 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1b248e820c7b3fbf3afe1091ad6b5feee1277bb4 commit 1b248e820c7b3fbf3afe1091ad6b5feee1277bb4 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:28:47 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:43:54 +0000 bhyve.8: Clean-up synopsis of -s - Document "-s help" separately for readability. - Use appropriate mdoc macros. MFC after: 2 weeks (cherry picked from commit 449f0e48e902ed36ec0de31279eefad9e6200cdc) --- usr.sbin/bhyve/bhyve.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index ed2686a2c429..69fec13f554b 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -234,7 +234,9 @@ to Force the guest virtual CPU to exit when a PAUSE instruction is detected. .It Fl S Wire guest memory. -.It Fl s Op Ar help|slot,emulation Ns Op , Ns Ar conf +.It Fl s Cm help +Print a list of supported PCI devices. +.It Fl s Ar slot Ns Cm \&, Ns Ar emulation Ns Op Cm \&, Ns Ar conf Configure a virtual PCI slot and function. .Pp .Nm @@ -243,8 +245,6 @@ slots on the bus. There are 32 available slots, with the option of providing up to 8 functions per slot. .Bl -tag -width 10n -.It Ar help -print a list of supported PCI devices. .It Ar slot .Ar pcislot[:function] .Ar bus:pcislot:function From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 352E1672854; Mon, 16 Aug 2021 11:15:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQc02RLz3qlT; Mon, 16 Aug 2021 11:15:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C713698; Mon, 16 Aug 2021 11:15:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBF3xb044165; Mon, 16 Aug 2021 11:15:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBF3fv044164; Mon, 16 Aug 2021 11:15:03 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:03 GMT Message-Id: <202108161115.17GBF3fv044164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2e9958431f7b - stable/12 - bhyve.8: Improve emulation description of the -s flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2e9958431f7bad48d10b3b2531bca23b714643c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:04 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2e9958431f7bad48d10b3b2531bca23b714643c3 commit 2e9958431f7bad48d10b3b2531bca23b714643c3 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:08:39 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:48:56 +0000 bhyve.8: Improve emulation description of the -s flag - Set width of the list to the longest key word for readability. - Separate descriptions of amd_hostbridge and hostbridge emulations. Also, wordsmith their descriptions for consistency with other entries. - Use Cm instead of Li for command modifiers. - Do not stylize AMD with Li, there's no need to do it. - Fix a typo in the definition of ahci-hd ("hard drive" instead of "hard-drive"). MFC after: 2 weeks (cherry picked from commit 7014cb2393594ee4a8389c65d507afacf729c041) --- usr.sbin/bhyve/bhyve.8 | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index f4519e676f95..20eafd1858cd 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -282,49 +282,49 @@ The .Ar emulation argument can be one of the following: -.Bl -tag -width 10n -.It Li hostbridge | Li amd_hostbridge -.Pp -Provide a simple host bridge. +.Bl -tag -width "amd_hostbridge" +.It Cm hostbridge +A simple host bridge. This is usually configured at slot 0, and is required by most guest operating systems. -The -.Li amd_hostbridge -emulation is identical but uses a PCI vendor ID of -.Li AMD . -.It Li passthru +.It Cm amd_hostbridge +Emulation identical to +.Cm hostbridge +using a PCI vendor ID of AMD. +.It Cm passthru PCI pass-through device. -.It Li virtio-net +.It Cm virtio-net Virtio network interface. -.It Li virtio-blk +.It Cm virtio-blk Virtio block storage interface. -.It Li virtio-scsi +.It Cm virtio-scsi Virtio SCSI interface. -.It Li virtio-rnd +.It Cm virtio-rnd Virtio RNG interface. -.It Li virtio-console +.It Cm virtio-console Virtio console interface, which exposes multiple ports to the guest in the form of simple char devices for simple IO between the guest and host userspaces. -.It Li ahci +.It Cm ahci AHCI controller attached to arbitrary devices. -.It Li ahci-cd +.It Cm ahci-cd AHCI controller attached to an ATAPI CD/DVD. -.It Li ahci-hd -AHCI controller attached to a SATA hard-drive. -.It Li e1000 +.It Cm ahci-hd +AHCI controller attached to a SATA hard drive. +.It Cm e1000 Intel e82545 network interface. -.It Li uart +.It Cm uart PCI 16550 serial device. -.It Li lpc -LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports, a boot ROM, and, +.It Cm lpc +LPC PCI-ISA bridge with COM1, COM2, and 16550 serial ports, +a boot ROM, and, optionally, the debug/test device. The LPC bridge emulation can only be configured on bus 0. -.It Li fbuf +.It Cm fbuf Raw framebuffer device attached to VNC server. -.It Li xhci +.It Cm xhci eXtensible Host Controller Interface (xHCI) USB controller. -.It Li nvme +.It Cm nvme NVM Express (NVMe) controller. .El .Pp From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 977F26729CB; Mon, 16 Aug 2021 11:15:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQb02KDz3qlM; Mon, 16 Aug 2021 11:15:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 584EA837; Mon, 16 Aug 2021 11:15:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBF2Xd044141; Mon, 16 Aug 2021 11:15:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBF24p044140; Mon, 16 Aug 2021 11:15:02 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:02 GMT Message-Id: <202108161115.17GBF24p044140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 833b06052416 - stable/12 - bhyve.8: Clean up the slot description of -s MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 833b06052416c18d8f21be9550a9d84edb042538 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:03 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=833b06052416c18d8f21be9550a9d84edb042538 commit 833b06052416c18d8f21be9550a9d84edb042538 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:56:19 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:44:12 +0000 bhyve.8: Clean up the slot description of -s Also, remove the macros of the nested list which contained slot, emulation and conf. This decreases the indention of the -s description. It was necessary to clean up the slot description. MFC after: 2 weeks (cherry picked from commit 234d8c470b44160fe0cbce49b972b3b19f246a89) --- usr.sbin/bhyve/bhyve.8 | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 69fec13f554b..f4519e676f95 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -244,10 +244,23 @@ provides PCI bus emulation and virtual devices that can be attached to slots on the bus. There are 32 available slots, with the option of providing up to 8 functions per slot. -.Bl -tag -width 10n -.It Ar slot -.Ar pcislot[:function] -.Ar bus:pcislot:function +.Pp +The +.Ar slot +can be specified in one of the following formats: +.Pp +.Bl -bullet -compact +.It +.Ar pcislot +.It +.Sm off +.Ar pcislot Cm \&: Ar function +.Sm on +.It +.Sm off +.Ar bus Cm \&: Ar pcislot Cm \&: Ar function +.Sm on +.El .Pp The .Ar pcislot @@ -264,7 +277,11 @@ value defaults to 0. If not specified, the .Ar bus value defaults to 0. -.It Ar emulation +.Pp +The +.Ar emulation +argument +can be one of the following: .Bl -tag -width 10n .It Li hostbridge | Li amd_hostbridge .Pp @@ -310,8 +327,10 @@ eXtensible Host Controller Interface (xHCI) USB controller. .It Li nvme NVM Express (NVMe) controller. .El -.It Op Ar conf -This optional parameter describes the backend for device emulations. +.Pp +The optional parameter +.Ar conf +describes the backend for device emulations. If .Ar conf is not specified, the device emulation has no backend and can be From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5383267294E; Mon, 16 Aug 2021 11:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQf0lhNz3qwS; Mon, 16 Aug 2021 11:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE4A827E7C; Mon, 16 Aug 2021 11:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBF5fc044219; Mon, 16 Aug 2021 11:15:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBF5bB044218; Mon, 16 Aug 2021 11:15:05 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:05 GMT Message-Id: <202108161115.17GBF5bB044218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: dcdcff9278c1 - stable/12 - bhyve.8: Clean up block storage device backends description MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: dcdcff9278c175a01becd7d261556a2b10d0fcea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:07 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=dcdcff9278c175a01becd7d261556a2b10d0fcea commit dcdcff9278c175a01becd7d261556a2b10d0fcea Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:39:53 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:10:49 +0000 bhyve.8: Clean up block storage device backends description MFC after: 2 weeks (cherry picked from commit 5232a35f1ed7b8fa4f378897598438c2056ef60e) --- usr.sbin/bhyve/bhyve.8 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index bd8827dcd246..c07ec7a1b307 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -362,25 +362,29 @@ devices, the parameter can be specified to inform the guest about the largest MTU that should be allowed, expressed in bytes. .Pp -Block storage devices: -.Bl -tag -width 10n -.It Pa /filename Ns Oo , Ns Ar block-device-options Oc -.It Pa /dev/xxx Ns Oo , Ns Ar block-device-options Oc +Block storage device backends: +.Sm off +.Bl -bullet +.It +.Ar /filename Op Cm \&, Ar block-device-options +.It +.Ar /dev/xxx Op Cm \&, Ar block-device-options .El +.Sm on .Pp The .Ar block-device-options are: -.Bl -tag -width 8n -.It Li nocache +.Bl -tag -width 10n +.It Cm nocache Open the file with .Dv O_DIRECT . -.It Li direct +.It Cm direct Open the file using .Dv O_SYNC . -.It Li ro +.It Cm ro Force the file to be opened read-only. -.It Li sectorsize= Ns Ar logical Ns Oo / Ns Ar physical Oc +.It Cm sectorsize= Ns Ar logical Ns Oo Cm \&/ Ns Ar physical Oc Specify the logical and physical sector sizes of the emulated disk. The physical sector size is optional and is equal to the logical sector size if not explicitly specified. @@ -587,7 +591,6 @@ Playback device, typically Recording device, typically .Ar /dev/dsp0 . .El -.El .It Fl U Ar uuid Set the universally unique identifier .Pq UUID From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8C736728E9; Mon, 16 Aug 2021 11:15:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQX1Z5Mz3qcm; Mon, 16 Aug 2021 11:15:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19136835; Mon, 16 Aug 2021 11:15:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBExcw044087; Mon, 16 Aug 2021 11:14:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBExGN044086; Mon, 16 Aug 2021 11:14:59 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:14:59 GMT Message-Id: <202108161114.17GBExGN044086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: fbd3d1419865 - stable/12 - bhyve.8: Fix indention in the signals table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fbd3d141986589739d10ea233026b448406029e2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:00 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fbd3d141986589739d10ea233026b448406029e2 commit fbd3d141986589739d10ea233026b448406029e2 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 20:06:12 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 09:43:33 +0000 bhyve.8: Fix indention in the signals table MFC after: 2 weeks (cherry picked from commit 3357e9482fe8a0ee153ec62d4bd8cb96966bbf26) --- usr.sbin/bhyve/bhyve.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index c65da7f1de54..ed2686a2c429 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -608,7 +608,7 @@ stepping over the breakpoint. .Nm deals with the following signals: .Pp -.Bl -tag -width indent -compact +.Bl -tag -width SIGTERM -compact .It SIGTERM Trigger ACPI poweroff for a VM .El From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C9B3672B00; Mon, 16 Aug 2021 11:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQd13fQz3qrF; Mon, 16 Aug 2021 11:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1CB3699; Mon, 16 Aug 2021 11:15:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBF4Pl044189; Mon, 16 Aug 2021 11:15:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBF4E5044188; Mon, 16 Aug 2021 11:15:04 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:04 GMT Message-Id: <202108161115.17GBF4E5044188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 932129b612b5 - stable/12 - bhyve.8: Clean up network backends section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 932129b612b5557ac07a3ec2aa5d170ad02c418b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:07 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=932129b612b5557ac07a3ec2aa5d170ad02c418b commit 932129b612b5557ac07a3ec2aa5d170ad02c418b Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:29:30 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:09:00 +0000 bhyve.8: Clean up network backends section - Reformat the format lists, use appropriate mdoc macros for readability. - Add a missing Oxford comma. MFC after: 2 weeks (cherry picked from commit 7fb22729816ef6c9e65e5c544047e669edd2f06d) --- usr.sbin/bhyve/bhyve.8 | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 20eafd1858cd..bd8827dcd246 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -336,21 +336,31 @@ If is not specified, the device emulation has no backend and can be considered unconnected. .Pp -Network devices: -.Bl -tag -width 10n -.It Ar tapN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx -.It Ar vmnetN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx -.Pp -If -.Ar mac -is not specified, the MAC address is derived from a fixed OUI and the -remaining bytes from an MD5 hash of the slot and function numbers and -the device name. -.Pp -The MAC address is an ASCII string in -.Xr ethers 5 -format. +Network backends formats for +.Ar conf : +.Sm off +.Bl -bullet +.It +.Xo +.Cm tap Ar N +.Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx +.Op Cm \&,mtu= Ar N +.Xc +.It +.Xo +.Cm vmnet Ar N +.Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx +.Op Cm \&,mtu= Ar N +.Xc .El +.Sm on +.Pp +With +.Cm virtio-net +devices, the +.Cm mtu +parameter can be specified to inform the guest about the largest MTU +that should be allowed, expressed in bytes. .Pp Block storage devices: .Bl -tag -width 10n From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEA2E672A3C; Mon, 16 Aug 2021 11:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQg2Kwsz3qfV; Mon, 16 Aug 2021 11:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4F56595; Mon, 16 Aug 2021 11:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBF654044243; Mon, 16 Aug 2021 11:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBF6PP044242; Mon, 16 Aug 2021 11:15:06 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:06 GMT Message-Id: <202108161115.17GBF6PP044242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5eb600a27ec3 - stable/12 - bhyve.8: Clean up SCSI device backends section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5eb600a27ec3ff8f2e6e129d86fd0da6bacb2ead Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:08 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5eb600a27ec3ff8f2e6e129d86fd0da6bacb2ead commit 5eb600a27ec3ff8f2e6e129d86fd0da6bacb2ead Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:49:18 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:11:01 +0000 bhyve.8: Clean up SCSI device backends section MFC after: 2 weeks (cherry picked from commit 7c5829c942822561688c9b8239900773c6d82db4) --- usr.sbin/bhyve/bhyve.8 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index c07ec7a1b307..1c2b8429377a 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -390,16 +390,19 @@ The physical sector size is optional and is equal to the logical sector size if not explicitly specified. .El .Pp -SCSI devices: -.Bl -tag -width 10n -.It Pa /dev/cam/ctl Ns Oo Ar pp . Ns Ar vp Oc Ns Oo , Ns Ar scsi-device-options Oc +SCSI device backends: +.Sm off +.Bl -bullet +.It +.Pa /dev/cam/ctl Oo Ar pp Cm \&. Ar vp Oc Oo Cm \&, Ar scsi-device-options Oc .El +.Sm on .Pp The .Ar scsi-device-options are: .Bl -tag -width 10n -.It Li iid= Ns Ar IID +.It Cm iid= Ns Ar IID Initiator ID to use when sending requests to specified CTL port. The default value is 0. .El From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDF67672A45; Mon, 16 Aug 2021 11:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQl3YTkz3qj0; Mon, 16 Aug 2021 11:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48E3F69C; Mon, 16 Aug 2021 11:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBFAnV044315; Mon, 16 Aug 2021 11:15:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBFARZ044314; Mon, 16 Aug 2021 11:15:10 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:10 GMT Message-Id: <202108161115.17GBFARZ044314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 6229dc283db8 - stable/12 - bhyve.8: Improve framebuffer backends description MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6229dc283db8f7d860ed9e2d29aa8a4c3b1f01bc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:12 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6229dc283db8f7d860ed9e2d29aa8a4c3b1f01bc commit 6229dc283db8f7d860ed9e2d29aa8a4c3b1f01bc Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:59:44 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:12:50 +0000 bhyve.8: Improve framebuffer backends description - Use appropriate mdoc macros - Document that tcp= is a synonym to rfb= (tcp is used in the examples, but never mentioned) - Clarify the IP address specification MFC after: 2 weeks (cherry picked from commit 8b97e97548bdc74cf3b4939a0b21cfdd27d8c11c) --- usr.sbin/bhyve/bhyve.8 | 62 +++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 89cf4c074905..f9cc11341836 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -477,35 +477,52 @@ resize at present. Emergency write is advertised, but no-op at present. .El .Pp -Framebuffer devices: +Framebuffer devices backends: +.Bl -bullet +.Sm off +.It +.Op Cm rfb= Ar ip-and-port +.Op Cm ,w= Ar width +.Op Cm ,h= Ar height +.Op Cm ,vga= Ar vgaconf +.Op Cm ,wait +.Op Cm ,password= Ar password +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Xo -.Oo rfb= Ns Oo Ar IP\&: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns -.Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns -.Ar password Oc -.Xc -.Bl -tag -width 8n -.It Ar IPv4:port No or Ar [IPv6%zone]:port -An -.Ar IP -address and a +.It Cm rfb= Ns Ar ip-and-port Pq or Cm tcp= Ns Ar ip-and-port +An IP address and a port VNC should listen on. +There are two formats: +.Pp +.Bl -bullet -compact +.It IPv4 +.Sm off +.Op Ar IPv4 Cm \&: .Ar port -VNC should listen on. +.Sm on +.It IPv6 +.Sm off +.Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port +.Sm on +.El +.Pp The default is to listen on localhost IPv4 address and default VNC port 5900. An IPv6 address must be enclosed in square brackets and may contain an optional zone identifier. -.It Ar width No and Ar height +.It Cm w= Ns Ar width No and Cm h= Ns Ar height A display resolution, width and height, respectively. If not specified, a default resolution of 1024x768 pixels will be used. Minimal supported resolution is 640x480 pixels, and maximum is 1920x1200 pixels. -.It Ar vgaconf +.It Cm vga= Ns Ar vgaconf Possible values for this option are -.Dq io +.Cm io (default), -.Dq on +.Cm on , and -.Dq off . +.Cm off . PCI graphics cards have a dual personality in that they are standard PCI devices with BAR addressing, but may also implicitly decode legacy VGA I/O space @@ -513,18 +530,18 @@ implicitly decode legacy VGA I/O space and memory space .Pq 64KB at Ad 0xA0000 . The default -.Dq io +.Cm io option should be used for guests that attempt to issue BIOS calls which result in I/O port queries, and fail to boot if I/O decode is disabled. .Pp The -.Dq on +.Cm on option should be used along with the CSM BIOS capability in UEFI to boot traditional BIOS guests that require the legacy VGA I/O and memory regions to be available. .Pp The -.Dq off +.Cm off option should be used for the UEFI guests that assume that VGA adapter is present if they detect the I/O ports. An example of such a guest is @@ -537,19 +554,18 @@ Please refer to the wiki page .Pq Lk https://wiki.freebsd.org/bhyve for configuration notes of particular guests. -.It wait +.It Cm wait Instruct .Nm to only boot upon the initiation of a VNC connection, simplifying the installation of operating systems that require immediate keyboard input. This can be removed for post-installation use. -.It password +.It Cm password= Ns Ar password This type of authentication is known to be cryptographically weak and is not intended for use on untrusted networks. Many implementations will want to use stronger security, such as running the session over an encrypted channel provided by IPsec or SSH. .El -.El .Pp xHCI USB devices: .Bl -tag -width 10n From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CD9E672AA4; Mon, 16 Aug 2021 11:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQh6BBZz3qtB; Mon, 16 Aug 2021 11:15:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11968537; Mon, 16 Aug 2021 11:15:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBF7ZQ044267; Mon, 16 Aug 2021 11:15:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBF7mt044266; Mon, 16 Aug 2021 11:15:07 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:07 GMT Message-Id: <202108161115.17GBF7mt044266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: b9bf593b54fd - stable/12 - bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b9bf593b54fd45ec59069bcb9dab97c2f670dbbd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:09 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b9bf593b54fd45ec59069bcb9dab97c2f670dbbd commit b9bf593b54fd45ec59069bcb9dab97c2f670dbbd Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:09:22 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:12:26 +0000 bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions MFC after: 2 weeks (cherry picked from commit 2fda01a1b7e958e6cfffda512954b8d6c40a064e) --- usr.sbin/bhyve/bhyve.8 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 1c2b8429377a..dff1dabee57a 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -407,28 +407,28 @@ Initiator ID to use when sending requests to specified CTL port. The default value is 0. .El .Pp -TTY devices: +TTY device backends: .Bl -tag -width 10n -.It Li stdio +.It Cm stdio Connect the serial port to the standard input and output of the .Nm process. -.It Pa /dev/xxx +.It Ar /dev/xxx Use the host TTY device for serial port I/O. .El .Pp -Boot ROM device: +Boot ROM device backends: .Bl -tag -width 10n -.It Pa romfile +.It Ar romfile Map .Ar romfile in the guest address space reserved for boot firmware. .El .Pp -Pass-through devices: +Pass-through device backends: .Bl -tag -width 10n -.It Ns Ar slot Ns / Ns Ar bus Ns / Ns Ar function +.It Ns Ar slot Ns Cm \&/ Ns Ar bus Ns Cm \&/ Ns Ar function Connect to a PCI device on the host at the selector described by .Ar slot , .Ar bus , From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E7CA672764; Mon, 16 Aug 2021 11:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQj4sDzz3qfX; Mon, 16 Aug 2021 11:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3067C69B; Mon, 16 Aug 2021 11:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBF9rV044291; Mon, 16 Aug 2021 11:15:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBF9ZT044290; Mon, 16 Aug 2021 11:15:09 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:09 GMT Message-Id: <202108161115.17GBF9ZT044290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a59984e2fcd0 - stable/12 - bhyve.8: Clean up virtio console device backends description MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a59984e2fcd0ab425dd155d38c2f812b9686c9ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:10 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a59984e2fcd0ab425dd155d38c2f812b9686c9ea commit a59984e2fcd0ab425dd155d38c2f812b9686c9ea Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:23:26 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:12:37 +0000 bhyve.8: Clean up virtio console device backends description MFC after: 2 weeks (cherry picked from commit 3f4c771f64e816750de08ab6fd7e7bf29398f5fb) --- usr.sbin/bhyve/bhyve.8 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index dff1dabee57a..89cf4c074905 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -446,9 +446,14 @@ The host device must have been reserved at boot-time using the loader variable as described in .Xr vmm 4 . .Pp -Virtio console devices: -.Bl -tag -width 10n -.It Li port1= Ns Pa /path/to/port1.sock Ns ,anotherport= Ns Pa ... +Virtio console device backends: +.Bl -bullet +.Sm off +.It +.Cm port1= Ns Ar /path/to/port1.sock Ns Op Cm ,port Ns Ar N Cm \&= Ns Ar /path/to/port2.sock No \~ Ar ... +.Sm on +.El +.Pp A maximum of 16 ports per device can be created. Every port is named and corresponds to a Unix domain socket created by .Nm . @@ -456,7 +461,7 @@ Every port is named and corresponds to a Unix domain socket created by accepts at most one connection per port at a time. .Pp Limitations: -.Bl -bullet -offset 2n +.Bl -bullet -offset .It Due to lack of destructors in .Nm , @@ -464,12 +469,13 @@ sockets on the filesystem must be cleaned up manually after .Nm exits. .It -There is no way to use the "console port" feature, nor the console port +There is no way to use the +.Dq console port +feature, nor the console port resize at present. .It Emergency write is advertised, but no-op at present. .El -.El .Pp Framebuffer devices: .Bl -tag -width 10n From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90D73672AAF; Mon, 16 Aug 2021 11:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQn3kRfz3qtS; Mon, 16 Aug 2021 11:15:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AFF2715; Mon, 16 Aug 2021 11:15:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBFCfn044369; Mon, 16 Aug 2021 11:15:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBFCmK044368; Mon, 16 Aug 2021 11:15:12 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:12 GMT Message-Id: <202108161115.17GBFCmK044368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 880d73822d19 - stable/12 - bhyve.8: Improve AHCI backends documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 880d73822d19307ce827a9d6ffeb2c0cc692fe0c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:15 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=880d73822d19307ce827a9d6ffeb2c0cc692fe0c commit 880d73822d19307ce827a9d6ffeb2c0cc692fe0c Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:44:23 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:13:15 +0000 bhyve.8: Improve AHCI backends documentation - Document the backend format. MFC after: 2 weeks (cherry picked from commit d5fcc4b6066e878ed70bce7a52d6aca605befde5) --- usr.sbin/bhyve/bhyve.8 | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 3cc3a2c0ad3e..4fdca7d2e28d 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -618,15 +618,29 @@ and .Cm disable . .El .Pp -AHCI devices: +AHCI device backends: +.Bl -bullet +.It +.Sm off +.Op Oo Cm hd\&: | cd\&: Oc Ar path +.Op Cm ,nmrr= Ar nmrr +.Op Cm ,ser= Ar # +.Op Cm ,rev= Ar # +.Op Cm ,model= Ar # +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li nmrr -Nominal Media Rotation Rate, known as RPM. value 1 will indicate device as Solid State Disk. default value is 0, not report. -.It Li ser +.It Cm nmrr +Nominal Media Rotation Rate, known as RPM. +Value 1 will indicate device as Solid State Disk. +Default value is 0, not report. +.It Cm ser Serial Number with maximum 20 characters. -.It Li rev +.It Cm rev Revision Number with maximum 8 characters. -.It Li model +.It Cm model Model Number with maximum 40 characters. .El .Pp From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5D016729E9; Mon, 16 Aug 2021 11:15:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQp4C8Wz3qws; Mon, 16 Aug 2021 11:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9D27716; Mon, 16 Aug 2021 11:15:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBFD4i044393; Mon, 16 Aug 2021 11:15:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBFDeD044392; Mon, 16 Aug 2021 11:15:13 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:13 GMT Message-Id: <202108161115.17GBFDeD044392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 1807f353197c - stable/12 - bhyve: Document the format for HD audio backends MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1807f353197c91e328a2898192f3539b1b967ca3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:16 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1807f353197c91e328a2898192f3539b1b967ca3 commit 1807f353197c91e328a2898192f3539b1b967ca3 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:50:29 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:13:31 +0000 bhyve: Document the format for HD audio backends - This change is done for consistency with other backend definitions. MFC after: 2 weeks (cherry picked from commit 061f37d280976e0f79f823c732fa80825ce48ded) --- usr.sbin/bhyve/bhyve.8 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 4fdca7d2e28d..308ec972c2f3 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -644,12 +644,21 @@ Revision Number with maximum 8 characters. Model Number with maximum 40 characters. .El .Pp -HD Audio devices: +HD Audio device backends: +.Bl -bullet +.It +.Sm off +.Op Cm play= Ar playback +.Op Cm ,rec= Ar recording +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li play +.It Cm play Playback device, typically .Ar /dev/dsp0 . -.It Li rec +.It Cm rec Recording device, typically .Ar /dev/dsp0 . .El From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC05E672876; Mon, 16 Aug 2021 11:15:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQm4Jfjz3qln; Mon, 16 Aug 2021 11:15:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79AB927E7D; Mon, 16 Aug 2021 11:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBFBku044345; Mon, 16 Aug 2021 11:15:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBFB2Q044344; Mon, 16 Aug 2021 11:15:11 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:11 GMT Message-Id: <202108161115.17GBFB2Q044344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 6d6e520fee64 - stable/12 - bhyve.8: Improve documentation of NVME backend MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6d6e520fee648291e345394140a4108a9403fce2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:13 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6d6e520fee648291e345394140a4108a9403fce2 commit 6d6e520fee648291e345394140a4108a9403fce2 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:16:51 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:13:05 +0000 bhyve.8: Improve documentation of NVME backend - Document the configuration format. - Document two additional configuration options: eui64 and dsm. MFC after: 2 weeks (cherry picked from commit 6eff58acc776d8308863f49b89664997d4642a4e) --- usr.sbin/bhyve/bhyve.8 | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index f9cc11341836..3cc3a2c0ad3e 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -567,32 +567,55 @@ Many implementations will want to use stronger security, such as running the session over an encrypted channel provided by IPsec or SSH. .El .Pp -xHCI USB devices: +xHCI USB device backends: .Bl -tag -width 10n -.It Li tablet +.It Cm tablet A USB tablet device which provides precise cursor synchronization when using VNC. .El .Pp -NVMe devices: +NVMe device backends: +.Bl -bullet +.Sm off +.It +.Ar devpath +.Op Cm ,maxq= Ar # +.Op Cm ,qsz= Ar # +.Op Cm ,ioslots= Ar # +.Op Cm ,sectsz= Ar # +.Op Cm ,ser= Ar # +.Op Cm ,eui64= Ar # +.Op Cm ,dsm= Ar opt +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li devpath +.It Ar devpath Accepted device paths are: .Ar /dev/blockdev or .Ar /path/to/image or -.Ar ram=size_in_MiB . -.It Li maxq +.Cm ram= Ns Ar size_in_MiB . +.It Cm maxq Max number of queues. -.It Li qsz +.It Cm qsz Max elements in each queue. -.It Li ioslots +.It Cm ioslots Max number of concurrent I/O requests. -.It Li sectsz +.It Cm sectsz Sector size (defaults to blockif sector size). -.It Li ser +.It Cm ser Serial number with maximum 20 characters. +.It Cm eui64 +IEEE Extended Unique Identifier (8 byte value). +.It Cm dsm +DataSet Management support. +Supported values are: +.Cm auto , enable , +and +.Cm disable . .El .Pp AHCI devices: From owner-dev-commits-src-all@freebsd.org Mon Aug 16 11:15:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52A0F672D03; Mon, 16 Aug 2021 11:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpBQq4sVQz3qtc; Mon, 16 Aug 2021 11:15:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFBAF596; Mon, 16 Aug 2021 11:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GBFELM044417; Mon, 16 Aug 2021 11:15:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GBFE34044416; Mon, 16 Aug 2021 11:15:14 GMT (envelope-from git) Date: Mon, 16 Aug 2021 11:15:14 GMT Message-Id: <202108161115.17GBFE34044416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: ece209b70fce - stable/12 - bhyve.8: Fix mandoc -Tlint issues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ece209b70fcee35642338e5e42bb29d4a5762def Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:15:16 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ece209b70fcee35642338e5e42bb29d4a5762def commit ece209b70fcee35642338e5e42bb29d4a5762def Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:53:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-16 11:13:46 +0000 bhyve.8: Fix mandoc -Tlint issues While here, keep network backends section consistent with other sections. MFC after: 2 weeks (cherry picked from commit 8d9fefe64334818a27812658bf9efd0371fbc77c) --- usr.sbin/bhyve/bhyve.8 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 308ec972c2f3..0738a00d5878 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -56,7 +56,7 @@ .Sm off .Ar memsize .Oo -.Cm K No | Cm k No | Cm M No | Cm m No | Cm G No | Cm g No | Cm T No | Cm t +.Cm K | Cm k | Cm M | Cm m | Cm G | Cm g | Cm T | Cm t .Oc .Sm on .Oc @@ -336,8 +336,7 @@ If is not specified, the device emulation has no backend and can be considered unconnected. .Pp -Network backends formats for -.Ar conf : +Network device backends: .Sm off .Bl -bullet .It @@ -461,7 +460,7 @@ Every port is named and corresponds to a Unix domain socket created by accepts at most one connection per port at a time. .Pp Limitations: -.Bl -bullet -offset +.Bl -bullet .It Due to lack of destructors in .Nm , @@ -497,12 +496,12 @@ An IP address and a port VNC should listen on. There are two formats: .Pp .Bl -bullet -compact -.It IPv4 +.It .Sm off .Op Ar IPv4 Cm \&: .Ar port .Sm on -.It IPv6 +.It .Sm off .Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port .Sm on From owner-dev-commits-src-all@freebsd.org Mon Aug 16 13:02:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CE846749D3; Mon, 16 Aug 2021 13:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpDpS0ZK6z4R83; Mon, 16 Aug 2021 13:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0B171F9C; Mon, 16 Aug 2021 13:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GD2NUD092775; Mon, 16 Aug 2021 13:02:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GD2Nva092774; Mon, 16 Aug 2021 13:02:23 GMT (envelope-from git) Date: Mon, 16 Aug 2021 13:02:23 GMT Message-Id: <202108161302.17GD2Nva092774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 75c0e1a8e073 - stable/13 - nd6: Mark several callouts as MPSAFE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 75c0e1a8e073f1d5a89b863c84f4db3ccd042b64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 13:02:24 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=75c0e1a8e073f1d5a89b863c84f4db3ccd042b64 commit 75c0e1a8e073f1d5a89b863c84f4db3ccd042b64 Author: Mark Johnston AuthorDate: 2021-08-09 17:21:43 +0000 Commit: Mark Johnston CommitDate: 2021-08-16 13:01:11 +0000 nd6: Mark several callouts as MPSAFE The use of Giant here is vestigal and does not provide any useful synchronization. Furthermore, non-MPSAFE callouts can cause the softclock threads to block waiting for long-running newbus operations to complete. Reported by: mav Reviewed by: bz Sponsored by: The FreeBSD Foundation (cherry picked from commit 663428ea17e3a81f4c514d2571b90a13c065b1e8) --- sys/netinet6/in6_ifattach.c | 2 +- sys/netinet6/nd6.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 02d6a2b230b4..8d027e2fb1d9 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -887,7 +887,7 @@ in6_ifattach_init(void *dummy) { /* Timer for regeneranation of temporary addresses randomize ID. */ - callout_init(&V_in6_tmpaddrtimer_ch, 0); + callout_init(&V_in6_tmpaddrtimer_ch, 1); callout_reset(&V_in6_tmpaddrtimer_ch, (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor - V_ip6_temp_regen_advance) * hz, diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 62f0ac733a23..8dc5495d3ad9 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -225,11 +225,11 @@ nd6_init(void) nd6_defrouter_init(); /* Start timers. */ - callout_init(&V_nd6_slowtimo_ch, 0); + callout_init(&V_nd6_slowtimo_ch, 1); callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, curvnet); - callout_init(&V_nd6_timer_ch, 0); + callout_init(&V_nd6_timer_ch, 1); callout_reset(&V_nd6_timer_ch, hz, nd6_timer, curvnet); nd6_dad_init(); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 13:02:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 566C2674B74; Mon, 16 Aug 2021 13:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpDpT1fWPz4RGb; Mon, 16 Aug 2021 13:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 204C51BD3; Mon, 16 Aug 2021 13:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GD2PJf092801; Mon, 16 Aug 2021 13:02:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GD2PHn092800; Mon, 16 Aug 2021 13:02:25 GMT (envelope-from git) Date: Mon, 16 Aug 2021 13:02:25 GMT Message-Id: <202108161302.17GD2PHn092800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 034eea1ee5dd - stable/13 - vmm: Make iommu ops tables const MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 034eea1ee5dd25c6a3ff2ce544a990fdd04458fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 13:02:25 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=034eea1ee5dd25c6a3ff2ce544a990fdd04458fb commit 034eea1ee5dd25c6a3ff2ce544a990fdd04458fb Author: Mark Johnston AuthorDate: 2021-08-09 17:28:27 +0000 Commit: Mark Johnston CommitDate: 2021-08-16 13:01:20 +0000 vmm: Make iommu ops tables const While here, use designated initializers and rename some AMD iommu method implementations to match the corresponding op names. No functional change intended. Reviewed by: grehan Sponsored by: The FreeBSD Foundation (cherry picked from commit 41335c6b7f636f9ca59d0afba5728cf90020d6b1) --- sys/amd64/vmm/amd/amdvi_hw.c | 28 ++++++++++++++-------------- sys/amd64/vmm/intel/vtd.c | 24 ++++++++++++------------ sys/amd64/vmm/io/iommu.c | 2 +- sys/amd64/vmm/io/iommu.h | 4 ++-- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c index e488c5fd5f6a..57386b6bea88 100644 --- a/sys/amd64/vmm/amd/amdvi_hw.c +++ b/sys/amd64/vmm/amd/amdvi_hw.c @@ -1181,7 +1181,7 @@ amdvi_create_mapping(void *arg, vm_paddr_t gpa, vm_paddr_t hpa, } static uint64_t -amdvi_destroy_mapping(void *arg, vm_paddr_t gpa, uint64_t len) +amdvi_remove_mapping(void *arg, vm_paddr_t gpa, uint64_t len) { struct amdvi_domain *domain; @@ -1360,7 +1360,7 @@ amdvi_disable(void) } static void -amdvi_inv_tlb(void *arg) +amdvi_invalidate_tlb(void *arg) { struct amdvi_domain *domain; @@ -1369,16 +1369,16 @@ amdvi_inv_tlb(void *arg) amdvi_do_inv_domain(domain->id, false); } -struct iommu_ops iommu_ops_amd = { - amdvi_init, - amdvi_cleanup, - amdvi_enable, - amdvi_disable, - amdvi_create_domain, - amdvi_destroy_domain, - amdvi_create_mapping, - amdvi_destroy_mapping, - amdvi_add_device, - amdvi_remove_device, - amdvi_inv_tlb +const struct iommu_ops iommu_ops_amd = { + .init = amdvi_init, + .cleanup = amdvi_cleanup, + .enable = amdvi_enable, + .disable = amdvi_disable, + .create_domain = amdvi_create_domain, + .destroy_domain = amdvi_destroy_domain, + .create_mapping = amdvi_create_mapping, + .remove_mapping = amdvi_remove_mapping, + .add_device = amdvi_add_device, + .remove_device = amdvi_remove_device, + .invalidate_tlb = amdvi_invalidate_tlb }; diff --git a/sys/amd64/vmm/intel/vtd.c b/sys/amd64/vmm/intel/vtd.c index f47e2b56bdce..8f06dc823364 100644 --- a/sys/amd64/vmm/intel/vtd.c +++ b/sys/amd64/vmm/intel/vtd.c @@ -761,16 +761,16 @@ vtd_destroy_domain(void *arg) free(dom, M_VTD); } -struct iommu_ops iommu_ops_intel = { - vtd_init, - vtd_cleanup, - vtd_enable, - vtd_disable, - vtd_create_domain, - vtd_destroy_domain, - vtd_create_mapping, - vtd_remove_mapping, - vtd_add_device, - vtd_remove_device, - vtd_invalidate_tlb, +const struct iommu_ops iommu_ops_intel = { + .init = vtd_init, + .cleanup = vtd_cleanup, + .enable = vtd_enable, + .disable = vtd_disable, + .create_domain = vtd_create_domain, + .destroy_domain = vtd_destroy_domain, + .create_mapping = vtd_create_mapping, + .remove_mapping = vtd_remove_mapping, + .add_device = vtd_add_device, + .remove_device = vtd_remove_device, + .invalidate_tlb = vtd_invalidate_tlb, }; diff --git a/sys/amd64/vmm/io/iommu.c b/sys/amd64/vmm/io/iommu.c index 3fe4d299a497..6a589f153815 100644 --- a/sys/amd64/vmm/io/iommu.c +++ b/sys/amd64/vmm/io/iommu.c @@ -59,7 +59,7 @@ static int iommu_enable = 1; SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, enable, CTLFLAG_RDTUN, &iommu_enable, 0, "Enable use of I/O MMU (required for PCI passthrough)."); -static struct iommu_ops *ops; +static const struct iommu_ops *ops; static void *host_domain; static eventhandler_tag add_tag, delete_tag; diff --git a/sys/amd64/vmm/io/iommu.h b/sys/amd64/vmm/io/iommu.h index f8003a5d4552..090415b57505 100644 --- a/sys/amd64/vmm/io/iommu.h +++ b/sys/amd64/vmm/io/iommu.h @@ -60,8 +60,8 @@ struct iommu_ops { iommu_invalidate_tlb_t invalidate_tlb; }; -extern struct iommu_ops iommu_ops_intel; -extern struct iommu_ops iommu_ops_amd; +extern const struct iommu_ops iommu_ops_intel; +extern const struct iommu_ops iommu_ops_amd; void iommu_cleanup(void); void *iommu_host_domain(void); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 13:02:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D143674A0B; Mon, 16 Aug 2021 13:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpDpV2s2Sz4RZq; Mon, 16 Aug 2021 13:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EBF11D2A; Mon, 16 Aug 2021 13:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GD2QEZ092830; Mon, 16 Aug 2021 13:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GD2Qqs092829; Mon, 16 Aug 2021 13:02:26 GMT (envelope-from git) Date: Mon, 16 Aug 2021 13:02:26 GMT Message-Id: <202108161302.17GD2Qqs092829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ed03d0582498 - stable/13 - amd64: Fix output operand specs for the stmxcsr and vmread intrinsics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed03d05824982738335ea8273b0e5a5f020ba100 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 13:02:26 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ed03d05824982738335ea8273b0e5a5f020ba100 commit ed03d05824982738335ea8273b0e5a5f020ba100 Author: Mark Johnston AuthorDate: 2021-08-09 17:28:08 +0000 Commit: Mark Johnston CommitDate: 2021-08-16 13:01:29 +0000 amd64: Fix output operand specs for the stmxcsr and vmread intrinsics This does not appear to affect code generation, at least with the default toolchain. Noticed because incorrect output specifications lead to false positives from KMSAN, as the instrumentation uses them to update shadow state for output operands. Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit e54ae8258d6433ad2f2411dbeaa1fde6b817d5ef) --- sys/amd64/amd64/fpu.c | 2 +- sys/amd64/vmm/intel/vmx_cpufunc.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 20e3dd34405d..d7936b3b1922 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$"); #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) -#define stmxcsr(addr) __asm __volatile("stmxcsr %0" : : "m" (*(addr))) +#define stmxcsr(addr) __asm __volatile("stmxcsr %0" : "=m" (*(addr))) static __inline void xrstor32(char *addr, uint64_t mask) diff --git a/sys/amd64/vmm/intel/vmx_cpufunc.h b/sys/amd64/vmm/intel/vmx_cpufunc.h index 09d6d25a18e0..05ac56290cb9 100644 --- a/sys/amd64/vmm/intel/vmx_cpufunc.h +++ b/sys/amd64/vmm/intel/vmx_cpufunc.h @@ -137,10 +137,9 @@ vmread(uint64_t r, uint64_t *addr) __asm __volatile("vmread %[r], %[addr];" VMX_SET_ERROR_CODE - : [error] "=r" (error) - : [r] "r" (r), [addr] "m" (*addr) + : [error] "=r" (error), [addr] "=m" (*addr) + : [r] "r" (r) : "memory"); - return (error); } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 13:02:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EC2B6749DC; Mon, 16 Aug 2021 13:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpDpW31VSz4RXg; Mon, 16 Aug 2021 13:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E3B61BD5; Mon, 16 Aug 2021 13:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GD2RTo092854; Mon, 16 Aug 2021 13:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GD2Rot092853; Mon, 16 Aug 2021 13:02:27 GMT (envelope-from git) Date: Mon, 16 Aug 2021 13:02:27 GMT Message-Id: <202108161302.17GD2Rot092853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3c785b12e096 - stable/13 - in6: Enter the net epoch in in6_tmpaddrtimer() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c785b12e09612f100462e8f960236865cd47a88 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 13:02:27 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3c785b12e09612f100462e8f960236865cd47a88 commit 3c785b12e09612f100462e8f960236865cd47a88 Author: Mark Johnston AuthorDate: 2021-08-09 17:14:23 +0000 Commit: Mark Johnston CommitDate: 2021-08-16 13:01:39 +0000 in6: Enter the net epoch in in6_tmpaddrtimer() We need to do so to safely traverse the ifnet list. Reviewed by: bz Sponsored by: The FreeBSD Foundation (cherry picked from commit 8ee0826f75136f6ac6443f32c582882bc31abd73) --- sys/netinet6/in6_ifattach.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 8d027e2fb1d9..629509f61ac1 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -828,6 +828,7 @@ void in6_tmpaddrtimer(void *arg) { CURVNET_SET((struct vnet *) arg); + struct epoch_tracker et; struct nd_ifinfo *ndi; u_int8_t nullbuf[8]; struct ifnet *ifp; @@ -837,6 +838,7 @@ in6_tmpaddrtimer(void *arg) V_ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, curvnet); bzero(nullbuf, sizeof(nullbuf)); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp->if_afdata[AF_INET6] == NULL) continue; @@ -850,7 +852,7 @@ in6_tmpaddrtimer(void *arg) ndi->randomseed1, ndi->randomid); } } - + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 13:02:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6223D6749E1; Mon, 16 Aug 2021 13:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpDpX66DFz4RVr; Mon, 16 Aug 2021 13:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B8D01BD6; Mon, 16 Aug 2021 13:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GD2SVK092878; Mon, 16 Aug 2021 13:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GD2SRE092877; Mon, 16 Aug 2021 13:02:28 GMT (envelope-from git) Date: Mon, 16 Aug 2021 13:02:28 GMT Message-Id: <202108161302.17GD2SRE092877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 29d25561813f - stable/13 - vfs: Avoid a comparison with an uninitialized field in setutimes() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 29d25561813fd040e41d6588243eb4f32a39b57f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 13:02:29 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=29d25561813fd040e41d6588243eb4f32a39b57f commit 29d25561813fd040e41d6588243eb4f32a39b57f Author: Mark Johnston AuthorDate: 2021-08-09 17:27:20 +0000 Commit: Mark Johnston CommitDate: 2021-08-16 13:01:49 +0000 vfs: Avoid a comparison with an uninitialized field in setutimes() Some filesystems, e.g., devfs, do not populate va_birthtime in their GETATTR implementations. To handle this, make sure that va_birthtime is initialized to the quasi-standard value of { VNOVAL, 0 } before calling VOP_GETATTR. Reported by: KMSAN Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit eca9ac5a32e432313b1c7f52f43dd11504fceef4) --- sys/kern/vfs_syscalls.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 80bcc0cb4d41..855943adecef 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -3161,15 +3161,19 @@ setutimes(struct thread *td, struct vnode *vp, const struct timespec *ts, { struct mount *mp; struct vattr vattr; - int error, setbirthtime; + int error; + bool setbirthtime; + + setbirthtime = false; + vattr.va_birthtime.tv_sec = VNOVAL; + vattr.va_birthtime.tv_nsec = 0; if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - setbirthtime = 0; - if (numtimes < 3 && !VOP_GETATTR(vp, &vattr, td->td_ucred) && + if (numtimes < 3 && VOP_GETATTR(vp, &vattr, td->td_ucred) == 0 && timespeccmp(&ts[1], &vattr.va_birthtime, < )) - setbirthtime = 1; + setbirthtime = true; VATTR_NULL(&vattr); vattr.va_atime = ts[0]; vattr.va_mtime = ts[1]; From owner-dev-commits-src-all@freebsd.org Mon Aug 16 14:09:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16C036756A6; Mon, 16 Aug 2021 14:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpGHZ6y5Dz4XgB; Mon, 16 Aug 2021 14:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6C632869; Mon, 16 Aug 2021 14:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GE9E6F074011; Mon, 16 Aug 2021 14:09:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GE9EmQ074010; Mon, 16 Aug 2021 14:09:14 GMT (envelope-from git) Date: Mon, 16 Aug 2021 14:09:14 GMT Message-Id: <202108161409.17GE9EmQ074010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 81b895a95bda - main - pipe_paircreate(): do not leak pipepair memory on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81b895a95bdab28897bf948f5265fad1f51f8aa2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 14:09:15 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=81b895a95bdab28897bf948f5265fad1f51f8aa2 commit 81b895a95bdab28897bf948f5265fad1f51f8aa2 Author: Konstantin Belousov AuthorDate: 2021-08-16 09:24:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-16 14:08:44 +0000 pipe_paircreate(): do not leak pipepair memory on error Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/sys_pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index d226543c0118..ee6ccbbad322 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -415,6 +415,7 @@ fail: #ifdef MAC mac_pipe_destroy(pp); #endif + uma_zfree(pipe_zone, pp); return (error); } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 14:30:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5668D675C9B; Mon, 16 Aug 2021 14:30:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpGlm1lxpz4b4f; Mon, 16 Aug 2021 14:30:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2476330F3; Mon, 16 Aug 2021 14:30:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GEUCsj004876; Mon, 16 Aug 2021 14:30:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GEUCSL004871; Mon, 16 Aug 2021 14:30:12 GMT (envelope-from git) Date: Mon, 16 Aug 2021 14:30:12 GMT Message-Id: <202108161430.17GEUCSL004871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b1a217a36918 - main - sys/cddl: remove extraneous semicolons MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1a217a369186dc45c7df7bde13a87868fd5b2c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 14:30:12 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b1a217a369186dc45c7df7bde13a87868fd5b2c8 commit b1a217a369186dc45c7df7bde13a87868fd5b2c8 Author: Ed Maste AuthorDate: 2021-08-16 14:29:44 +0000 Commit: Ed Maste CommitDate: 2021-08-16 14:29:44 +0000 sys/cddl: remove extraneous semicolons Fixes: 5a1b490d502e ("FreeBSD changes to vendor source.") Fixes: 91eaf3e1831d ("Custom DTrace kernel module...") MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 2 +- sys/cddl/dev/fbt/fbt.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index a59edb05e2b6..ad14482b80b5 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -14830,7 +14830,7 @@ static int dtrace_state_buffer(dtrace_state_t *state, dtrace_buffer_t *buf, int which) { dtrace_optval_t *opt = state->dts_options, size; - processorid_t cpu = 0;; + processorid_t cpu = 0; int flags = 0, rval, factor, divisor = 1; ASSERT(MUTEX_HELD(&dtrace_lock)); diff --git a/sys/cddl/dev/fbt/fbt.c b/sys/cddl/dev/fbt/fbt.c index 3bad4243c040..2137075e3831 100644 --- a/sys/cddl/dev/fbt/fbt.c +++ b/sys/cddl/dev/fbt/fbt.c @@ -367,7 +367,7 @@ fbt_resume(void *arg, dtrace_id_t id, void *parg) static int fbt_ctfoff_init(modctl_t *lf, linker_ctf_t *lc) { - const Elf_Sym *symp = lc->symtab;; + const Elf_Sym *symp = lc->symtab; const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t); int i; @@ -799,7 +799,7 @@ fbt_array_info(linker_ctf_t *lc, ctf_id_t type, ctf_arinfo_t *arp) static const char * ctf_strptr(linker_ctf_t *lc, int name) { - const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;; + const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; const char *strp = ""; if (name < 0 || name >= hp->cth_strlen) From owner-dev-commits-src-all@freebsd.org Mon Aug 16 14:50:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52CF16763C2; Mon, 16 Aug 2021 14:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpHBk1nJ1z4cPT; Mon, 16 Aug 2021 14:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21BF933A4; Mon, 16 Aug 2021 14:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GEo5aT029906; Mon, 16 Aug 2021 14:50:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GEo5bF029875; Mon, 16 Aug 2021 14:50:05 GMT (envelope-from git) Date: Mon, 16 Aug 2021 14:50:05 GMT Message-Id: <202108161450.17GEo5bF029875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: c3295781fd5d - main - bxe: tag files to skip clang-format formatting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3295781fd5d58b6de2a2e0360b0b67b94dde1ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 14:50:06 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c3295781fd5d58b6de2a2e0360b0b67b94dde1ff commit c3295781fd5d58b6de2a2e0360b0b67b94dde1ff Author: Ed Maste AuthorDate: 2020-06-25 00:42:10 +0000 Commit: Ed Maste CommitDate: 2021-08-16 14:48:44 +0000 bxe: tag files to skip clang-format formatting bxe contains three files which are sets of constants or other data, and might be auto-generated or have an upstream. They are rather large files and clang-format takes quite some time when run against them, so just skip formatting. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27806 --- sys/dev/bxe/57710_init_values.c | 2 +- sys/dev/bxe/57711_init_values.c | 2 +- sys/dev/bxe/57712_init_values.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/bxe/57710_init_values.c b/sys/dev/bxe/57710_init_values.c index 7824cfc641b0..cd3fa466e67d 100644 --- a/sys/dev/bxe/57710_init_values.c +++ b/sys/dev/bxe/57710_init_values.c @@ -28,7 +28,7 @@ #include __FBSDID("$FreeBSD$"); - +/* clang-format off */ /* * This file contains an array of operations needed to initialize the chip: diff --git a/sys/dev/bxe/57711_init_values.c b/sys/dev/bxe/57711_init_values.c index b6bec1d4b636..7d3b00e23fd9 100644 --- a/sys/dev/bxe/57711_init_values.c +++ b/sys/dev/bxe/57711_init_values.c @@ -28,7 +28,7 @@ #include __FBSDID("$FreeBSD$"); - +/* clang-format off */ /* * This file contains an array of operations needed to initialize the chip: diff --git a/sys/dev/bxe/57712_init_values.c b/sys/dev/bxe/57712_init_values.c index 9e730584dae9..393cf795c76a 100644 --- a/sys/dev/bxe/57712_init_values.c +++ b/sys/dev/bxe/57712_init_values.c @@ -28,7 +28,7 @@ #include __FBSDID("$FreeBSD$"); - +/* clang-format off */ /* * This file contains an array of operations needed to initialize the chip: From owner-dev-commits-src-all@freebsd.org Mon Aug 16 16:11:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30C8065031A; Mon, 16 Aug 2021 16:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpK0g0dqsz4kqX; Mon, 16 Aug 2021 16:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F273F484D; Mon, 16 Aug 2021 16:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GGBUlf045775; Mon, 16 Aug 2021 16:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GGBUbW045774; Mon, 16 Aug 2021 16:11:30 GMT (envelope-from git) Date: Mon, 16 Aug 2021 16:11:30 GMT Message-Id: <202108161611.17GGBUbW045774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 5c010b3aa7c7 - stable/13 - arm64: Check dtb version against the one we're expecting to find MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c010b3aa7c775a1e8b1a41b59e923e1d0ccdba6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 16:11:31 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=5c010b3aa7c775a1e8b1a41b59e923e1d0ccdba6 commit 5c010b3aa7c775a1e8b1a41b59e923e1d0ccdba6 Author: Emmanuel Vadot AuthorDate: 2021-03-23 14:24:14 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-16 16:07:53 +0000 arm64: Check dtb version against the one we're expecting to find Do for arm64 what was done for armv7 in e63faa9ba832b6 (cherry picked from commit 63f344024a0d336b116f3563a1604fbd9b4253c7) --- sys/arm64/arm64/machdep.c | 16 ++++++++++++++++ sys/conf/Makefile.arm64 | 3 +++ 2 files changed, 19 insertions(+) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 071bf3e51ab2..3c77300f6f2b 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -1244,6 +1244,8 @@ initarm(struct arm64_bootparams *abp) #ifdef FDT struct mem_region mem_regions[FDT_MEM_REGIONS]; int mem_regions_sz; + phandle_t root; + char dts_version[255]; #endif vm_offset_t lastaddr; caddr_t kmdp; @@ -1356,6 +1358,20 @@ initarm(struct arm64_bootparams *abp) if (env != NULL) strlcpy(kernelname, env, sizeof(kernelname)); +#ifdef FDT + root = OF_finddevice("/"); + if (OF_getprop(root, "freebsd,dts-version", dts_version, sizeof(dts_version)) > 0) { + if (strcmp(LINUX_DTS_VERSION, dts_version) != 0) + printf("WARNING: DTB version is %s while kernel expects %s, " + "please update the DTB in the ESP\n", + dts_version, + LINUX_DTS_VERSION); + } else { + printf("WARNING: Cannot find freebsd,dts-version property, " + "cannot check DTB compliance\n"); + } +#endif + if (boothowto & RB_VERBOSE) { if (efihdr != NULL) print_efi_map_entries(efihdr); diff --git a/sys/conf/Makefile.arm64 b/sys/conf/Makefile.arm64 index c7951872ca2d..2e404664708c 100644 --- a/sys/conf/Makefile.arm64 +++ b/sys/conf/Makefile.arm64 @@ -27,6 +27,9 @@ S= ../../.. INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include +LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts +CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" + # Use a custom SYSTEM_LD command to generate the elf kernel, so we can # set the text segment start address, and also strip the "arm mapping # symbols" which have names like $a.0 and $d.2; see the document From owner-dev-commits-src-all@freebsd.org Mon Aug 16 16:11:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98628650221; Mon, 16 Aug 2021 16:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpK0h1gnsz4l4W; Mon, 16 Aug 2021 16:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 161974665; Mon, 16 Aug 2021 16:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GGBW4Z045799; Mon, 16 Aug 2021 16:11:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GGBWU2045798; Mon, 16 Aug 2021 16:11:32 GMT (envelope-from git) Date: Mon, 16 Aug 2021 16:11:32 GMT Message-Id: <202108161611.17GGBWU2045798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 920a66c0a3b8 - stable/13 - arm64: Only check for freebsd, dts-version if we are booted in FDT mode. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 920a66c0a3b879418b5ff0393b0bf07b87758999 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 16:11:32 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=920a66c0a3b879418b5ff0393b0bf07b87758999 commit 920a66c0a3b879418b5ff0393b0bf07b87758999 Author: Emmanuel Vadot AuthorDate: 2021-03-23 15:37:25 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-16 16:07:54 +0000 arm64: Only check for freebsd,dts-version if we are booted in FDT mode. Reported by: andrew (cherry picked from commit 6bcba8dac9a4ddaeabf84ad8d31b1113a9dcf8c2) --- sys/arm64/arm64/machdep.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 3c77300f6f2b..6b7e4be7c9d1 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -1359,16 +1359,18 @@ initarm(struct arm64_bootparams *abp) strlcpy(kernelname, env, sizeof(kernelname)); #ifdef FDT - root = OF_finddevice("/"); - if (OF_getprop(root, "freebsd,dts-version", dts_version, sizeof(dts_version)) > 0) { - if (strcmp(LINUX_DTS_VERSION, dts_version) != 0) - printf("WARNING: DTB version is %s while kernel expects %s, " - "please update the DTB in the ESP\n", - dts_version, - LINUX_DTS_VERSION); - } else { - printf("WARNING: Cannot find freebsd,dts-version property, " - "cannot check DTB compliance\n"); + if (arm64_bus_method == ARM64_BUS_FDT) { + root = OF_finddevice("/"); + if (OF_getprop(root, "freebsd,dts-version", dts_version, sizeof(dts_version)) > 0) { + if (strcmp(LINUX_DTS_VERSION, dts_version) != 0) + printf("WARNING: DTB version is %s while kernel expects %s, " + "please update the DTB in the ESP\n", + dts_version, + LINUX_DTS_VERSION); + } else { + printf("WARNING: Cannot find freebsd,dts-version property, " + "cannot check DTB compliance\n"); + } } #endif From owner-dev-commits-src-all@freebsd.org Mon Aug 16 16:14:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66989650263; Mon, 16 Aug 2021 16:14:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpK3t2QjJz4lRx; Mon, 16 Aug 2021 16:14:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B2F644D5; Mon, 16 Aug 2021 16:14:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GGEIcS048602; Mon, 16 Aug 2021 16:14:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GGEIbF048601; Mon, 16 Aug 2021 16:14:18 GMT (envelope-from git) Date: Mon, 16 Aug 2021 16:14:18 GMT Message-Id: <202108161614.17GGEIbF048601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: e99783747e49 - stable/13 - pkgbase: Add an src.conf option for splitting man pages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e99783747e49d0df4c9bccbc33907333e2d77a1e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 16:14:18 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=e99783747e49d0df4c9bccbc33907333e2d77a1e commit e99783747e49d0df4c9bccbc33907333e2d77a1e Author: Emmanuel Vadot AuthorDate: 2021-03-16 06:11:56 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-16 16:13:51 +0000 pkgbase: Add an src.conf option for splitting man pages Man pages can be big in total, add an options to split man pages in -man packages so we produce smaller packages. This is useful for small jails or mfsroot produced of pkgbase. The option is off by default. Reviewed by: bapt, Mina Galić Differential Revision: https://reviews.freebsd.org/D29169 MFC after: 2 weeks (cherry picked from commit c7e6cb9e08d6b51e677a9f5546b8e36d678687d0) --- release/packages/generate-ucl.sh | 5 +++++ share/man/man5/src.conf.5 | 2 ++ share/mk/bsd.man.mk | 9 +++++++++ share/mk/src.opts.mk | 1 + tools/build/options/WITH_MANSPLITPKG | 2 ++ 5 files changed, 19 insertions(+) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index e900f9991912..67c10e485eb7 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -71,6 +71,11 @@ main() { _descr="Debugging Symbols" pkgdeps="${outname}" ;; + *_man) + outname="${outname%%_man}" + _descr="Manual Pages" + pkgdeps="${outname}" + ;; ${origname}) pkgdeps="runtime" ;; diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index a0c1b4bb8b8a..f118471c2770 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1099,6 +1099,8 @@ is set explicitly) .It Va WITHOUT_MANCOMPRESS Set to not to install compressed man pages. Only the uncompressed versions will be installed. +.It Va WITH_MANSPLITPKG +Set to split man pages into their own packages during make package. .It Va WITHOUT_MAN_UTILS Set to not build utilities for manual pages, .Xr apropos 1 , diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 1e67928a2754..21c5fe4f2424 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -50,7 +50,11 @@ .error bsd.man.mk cannot be included directly. .endif +.if ${MK_MANSPLITPKG} == "no" MINSTALL?= ${INSTALL} ${TAG_ARGS} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} +.else +MINSTALL?= ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},man} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} +.endif CATDIR= ${MANDIR:H:S/$/\/cat/} CATEXT= .cat @@ -226,8 +230,13 @@ maninstall: ${MAN} .endif # ${MK_MANCOMPRESS} == "no" .endif .for l t in ${_MANLINKS} +.if ${MK_MANSPLITPKG} == "no" rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \ ${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} +.else + rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \ + ${INSTALL_MANLINK} ${TAG_ARGS:D${TAG_ARGS},man} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} +.endif .endfor manlint: diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 77c60aef0bc4..7d08b6a1da89 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -208,6 +208,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ + MANSPLITPKG \ OFED_EXTRA \ OPENLDAP \ OPENSSL_KTLS \ diff --git a/tools/build/options/WITH_MANSPLITPKG b/tools/build/options/WITH_MANSPLITPKG new file mode 100644 index 000000000000..122da24e0bb4 --- /dev/null +++ b/tools/build/options/WITH_MANSPLITPKG @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to split man pages into their own packages during make package. From owner-dev-commits-src-all@freebsd.org Mon Aug 16 16:16:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23A56650694; Mon, 16 Aug 2021 16:16:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpK6305KDz4lSb; Mon, 16 Aug 2021 16:16:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEEEC4670; Mon, 16 Aug 2021 16:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GGGAWH048958; Mon, 16 Aug 2021 16:16:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GGGAeY048957; Mon, 16 Aug 2021 16:16:10 GMT (envelope-from git) Date: Mon, 16 Aug 2021 16:16:10 GMT Message-Id: <202108161616.17GGGAeY048957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 1516cd873510 - stable/13 - pkgbase: make only vital packages vital, not their sub-packages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1516cd873510126a9d588ede3ea523d39bb30517 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 16:16:11 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1516cd873510126a9d588ede3ea523d39bb30517 commit 1516cd873510126a9d588ede3ea523d39bb30517 Author: Mina Igalic AuthorDate: 2021-03-28 10:16:45 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-16 16:15:46 +0000 pkgbase: make only vital packages vital, not their sub-packages make "vital" a replaceable, which defaults to "false" and only set it for the main clib, utilities and runtime packages, not their sub-packages PR: 254174 Differential Revision: https://reviews.freebsd.org/D29224 (cherry picked from commit 1c1ff7979571bf07c05a48e857b7b285b037410f) --- release/packages/generate-ucl.sh | 10 +++++++++- release/packages/jail.ucl | 2 +- release/packages/runtime.ucl | 2 +- release/packages/template.ucl | 1 + release/packages/utilities.ucl | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 67c10e485eb7..10d9d3162f9c 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -32,19 +32,25 @@ main() { shift $(( ${OPTIND} - 1 )) outname="$(echo ${outname} | tr '-' '_')" + vital="false" case "${outname}" in clibs) + vital="true" # clibs should not have any dependencies or anything # else imposed on it. ;; caroot) pkgdeps="utilities" ;; + utilities) + uclfile="${uclfile}" + vital="true" + ;; runtime) outname="runtime" - uclfile="${uclfile}" _descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)" + vital="true" ;; *_lib32_dev) outname="${outname%%_lib32_dev}" @@ -108,6 +114,7 @@ main() { echo "uclfile=${uclfile}" echo "desc=${desc}" echo "comment=${comment}" + echo "vital=${vital}" echo "cp ${uclsource} -> ${uclfile}" echo "===============================================================" echo "" @@ -135,6 +142,7 @@ EOF -e "s/%PKGNAME%/${origname}/" \ -e "s/%COMMENT%/${comment}/" \ -e "s/%DESC%/${desc}/" \ + -e "s/%VITAL%/${vital}/" \ -e "s/%CAP_MKDB_ENDIAN%/${cap_arg}/g" \ -e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \ -e "s|%PKG_WWW%|${PKG_WWW}|" \ diff --git a/release/packages/jail.ucl b/release/packages/jail.ucl index 8448a15ebf7b..cc22cf042a76 100644 --- a/release/packages/jail.ucl +++ b/release/packages/jail.ucl @@ -10,7 +10,7 @@ categories = [ base ] maintainer = "%PKG_MAINTAINER%" www = "%PKG_WWW%" prefix = "/" -vital = true +vital = %VITAL% licenselogic = "single" licenses = [ BSD2CLAUSE ] desc = < Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45B4D650275; Mon, 16 Aug 2021 16:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpK641CPhz4lZj; Mon, 16 Aug 2021 16:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DB0746D3; Mon, 16 Aug 2021 16:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GGGB4k048982; Mon, 16 Aug 2021 16:16:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GGGBrD048981; Mon, 16 Aug 2021 16:16:11 GMT (envelope-from git) Date: Mon, 16 Aug 2021 16:16:11 GMT Message-Id: <202108161616.17GGGBrD048981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: e6a32ddf3ff9 - stable/13 - pkgbase: Add nfsiod to the FreeBSD-nfs package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6a32ddf3ff9e0d12f5221b477bf71e7a926afc8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 16:16:12 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=e6a32ddf3ff9e0d12f5221b477bf71e7a926afc8 commit e6a32ddf3ff9e0d12f5221b477bf71e7a926afc8 Author: Emmanuel Vadot AuthorDate: 2021-08-05 16:17:34 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-16 16:15:47 +0000 pkgbase: Add nfsiod to the FreeBSD-nfs package Missed in 081fb644925f (cherry picked from commit e06b8f11280397d7fdaa27d8d6f8eec9e4c707b3) --- sbin/nfsiod/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/nfsiod/Makefile b/sbin/nfsiod/Makefile index 47cd290ec78e..912dd19e25cb 100644 --- a/sbin/nfsiod/Makefile +++ b/sbin/nfsiod/Makefile @@ -4,4 +4,6 @@ PROG= nfsiod MAN= nfsiod.8 +PACKAGE= nfs + .include From owner-dev-commits-src-all@freebsd.org Mon Aug 16 16:53:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07FD565101C; Mon, 16 Aug 2021 16:53:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpKxF6tQMz4nxK; Mon, 16 Aug 2021 16:53:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 6A551482F; Mon, 16 Aug 2021 16:53:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 8f63fa78e84a - main - rtld: Remove calculate_tls_end To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108161056.17GAuFNC017048@gitrepo.freebsd.org> From: John Baldwin Message-ID: <36c06d31-503b-121b-ca58-ad3f99bda22b@FreeBSD.org> Date: Mon, 16 Aug 2021 09:53:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <202108161056.17GAuFNC017048@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 16:53:38 -0000 On 8/16/21 3:56 AM, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=8f63fa78e84afd23fa68c82eabfe64763c92d4f5 > > commit 8f63fa78e84afd23fa68c82eabfe64763c92d4f5 > Author: Fangrui Song > AuthorDate: 2021-08-14 17:02:09 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-08-16 10:55:35 +0000 > > rtld: Remove calculate_tls_end > > Variant I architectures use off and Variant II ones use size + off. > Define TLS_VARIANT_I/TLS_VARIANT_II symbols similarly to how libc > handles it. > > Reviewed by: kib > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D31539 > Differential revision: https://reviews.freebsd.org/D31541 Would it make sense to have and move the TLS-related constants there? Right now we duplicate them in at least two places (libthr internal headers and libc/rtld). -- John Baldwin From owner-dev-commits-src-all@freebsd.org Mon Aug 16 16:57:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75E956510BC; Mon, 16 Aug 2021 16:57:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpL2H0nJ7z4nxx; Mon, 16 Aug 2021 16:57:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 17GGvpN1068953 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 16 Aug 2021 19:57:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 17GGvpN1068953 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 17GGvp26068952; Mon, 16 Aug 2021 19:57:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Aug 2021 19:57:51 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8f63fa78e84a - main - rtld: Remove calculate_tls_end Message-ID: References: <202108161056.17GAuFNC017048@gitrepo.freebsd.org> <36c06d31-503b-121b-ca58-ad3f99bda22b@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36c06d31-503b-121b-ca58-ad3f99bda22b@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4GpL2H0nJ7z4nxx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 16:57:59 -0000 On Mon, Aug 16, 2021 at 09:53:35AM -0700, John Baldwin wrote: > On 8/16/21 3:56 AM, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=8f63fa78e84afd23fa68c82eabfe64763c92d4f5 > > > > commit 8f63fa78e84afd23fa68c82eabfe64763c92d4f5 > > Author: Fangrui Song > > AuthorDate: 2021-08-14 17:02:09 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2021-08-16 10:55:35 +0000 > > > > rtld: Remove calculate_tls_end > > Variant I architectures use off and Variant II ones use size + off. > > Define TLS_VARIANT_I/TLS_VARIANT_II symbols similarly to how libc > > handles it. > > Reviewed by: kib > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D31539 > > Differential revision: https://reviews.freebsd.org/D31541 > > Would it make sense to have and move the TLS-related > constants there? Right now we duplicate them in at least two places > (libthr internal headers and libc/rtld). This is some slow progress. Before this commit, we have that in three places. Eventually yes, it should be consolidated. From owner-dev-commits-src-all@freebsd.org Mon Aug 16 17:01:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E255F65121B; Mon, 16 Aug 2021 17:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpL6J623Qz4p05; Mon, 16 Aug 2021 17:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6EF8536C; Mon, 16 Aug 2021 17:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GH1S7p014857; Mon, 16 Aug 2021 17:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GH1S1m014856; Mon, 16 Aug 2021 17:01:28 GMT (envelope-from git) Date: Mon, 16 Aug 2021 17:01:28 GMT Message-Id: <202108161701.17GH1S1m014856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: c1a540709a83 - main - Apply upstream lldb fix for unhandled Error causing abort MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1a540709a83f810aa47380b946552ab20020374 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 17:01:29 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c1a540709a83f810aa47380b946552ab20020374 commit c1a540709a83f810aa47380b946552ab20020374 Author: Dimitry Andric AuthorDate: 2021-08-16 16:56:41 +0000 Commit: Dimitry Andric CommitDate: 2021-08-16 16:57:24 +0000 Apply upstream lldb fix for unhandled Error causing abort Merge commit 5033f0793fe6 from llvm git (by Dimitry Andric): [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage When assertions are turned off, the `llvm::Error` value created at the start of this function is overwritten using the move-assignment operator, but the success value is never checked. Whenever a TypeSystem cannot be found or created, this can lead to lldb core dumping with: Program aborted due to an unhandled Error: Error value was Success. (Note: Success values must still be checked prior to being destroyed). Fix this by not creating a `llvm::Error` value in advance, and directly returning the result of `llvm::make_error` instead, whenever an error is encountered. See also: and . Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D108088 Reported by: dmgk, ota@j.email.ne.jp PR: 253881, 257829 MFC after: 3 days --- .../llvm-project/lldb/source/Symbol/TypeSystem.cpp | 90 +++++++++------------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/contrib/llvm-project/lldb/source/Symbol/TypeSystem.cpp b/contrib/llvm-project/lldb/source/Symbol/TypeSystem.cpp index 2adf36fa8276..83161f32444c 100644 --- a/contrib/llvm-project/lldb/source/Symbol/TypeSystem.cpp +++ b/contrib/llvm-project/lldb/source/Symbol/TypeSystem.cpp @@ -224,62 +224,32 @@ void TypeSystemMap::ForEach(std::function const &callback) { llvm::Expected TypeSystemMap::GetTypeSystemForLanguage( lldb::LanguageType language, llvm::Optional create_callback) { - llvm::Error error = llvm::Error::success(); - assert(!error); // Check the success value when assertions are enabled std::lock_guard guard(m_mutex); - if (m_clear_in_progress) { - error = llvm::make_error( + if (m_clear_in_progress) + return llvm::make_error( "Unable to get TypeSystem because TypeSystemMap is being cleared", llvm::inconvertibleErrorCode()); - } else { - collection::iterator pos = m_map.find(language); - if (pos != m_map.end()) { - auto *type_system = pos->second.get(); - if (type_system) { - llvm::consumeError(std::move(error)); - return *type_system; - } - error = llvm::make_error( - "TypeSystem for language " + - llvm::StringRef(Language::GetNameForLanguageType(language)) + - " doesn't exist", - llvm::inconvertibleErrorCode()); - return std::move(error); - } - for (const auto &pair : m_map) { - if (pair.second && pair.second->SupportsLanguage(language)) { - // Add a new mapping for "language" to point to an already existing - // TypeSystem that supports this language - m_map[language] = pair.second; - if (pair.second.get()) { - llvm::consumeError(std::move(error)); - return *pair.second.get(); - } - error = llvm::make_error( - "TypeSystem for language " + - llvm::StringRef(Language::GetNameForLanguageType(language)) + - " doesn't exist", - llvm::inconvertibleErrorCode()); - return std::move(error); - } - } + collection::iterator pos = m_map.find(language); + if (pos != m_map.end()) { + auto *type_system = pos->second.get(); + if (type_system) + return *type_system; + return llvm::make_error( + "TypeSystem for language " + + llvm::StringRef(Language::GetNameForLanguageType(language)) + + " doesn't exist", + llvm::inconvertibleErrorCode()); + } - if (!create_callback) { - error = llvm::make_error( - "Unable to find type system for language " + - llvm::StringRef(Language::GetNameForLanguageType(language)), - llvm::inconvertibleErrorCode()); - } else { - // Cache even if we get a shared pointer that contains a null type system - // back - TypeSystemSP type_system_sp = (*create_callback)(); - m_map[language] = type_system_sp; - if (type_system_sp.get()) { - llvm::consumeError(std::move(error)); - return *type_system_sp.get(); - } - error = llvm::make_error( + for (const auto &pair : m_map) { + if (pair.second && pair.second->SupportsLanguage(language)) { + // Add a new mapping for "language" to point to an already existing + // TypeSystem that supports this language + m_map[language] = pair.second; + if (pair.second.get()) + return *pair.second.get(); + return llvm::make_error( "TypeSystem for language " + llvm::StringRef(Language::GetNameForLanguageType(language)) + " doesn't exist", @@ -287,7 +257,23 @@ llvm::Expected TypeSystemMap::GetTypeSystemForLanguage( } } - return std::move(error); + if (!create_callback) + return llvm::make_error( + "Unable to find type system for language " + + llvm::StringRef(Language::GetNameForLanguageType(language)), + llvm::inconvertibleErrorCode()); + + // Cache even if we get a shared pointer that contains a null type system + // back + TypeSystemSP type_system_sp = (*create_callback)(); + m_map[language] = type_system_sp; + if (type_system_sp.get()) + return *type_system_sp.get(); + return llvm::make_error( + "TypeSystem for language " + + llvm::StringRef(Language::GetNameForLanguageType(language)) + + " doesn't exist", + llvm::inconvertibleErrorCode()); } llvm::Expected From owner-dev-commits-src-all@freebsd.org Mon Aug 16 17:17:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E254065160D; Mon, 16 Aug 2021 17:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpLSh63xgz4qGn; Mon, 16 Aug 2021 17:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4299543A; Mon, 16 Aug 2021 17:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GHHOO4030321; Mon, 16 Aug 2021 17:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GHHOZS030320; Mon, 16 Aug 2021 17:17:24 GMT (envelope-from git) Date: Mon, 16 Aug 2021 17:17:24 GMT Message-Id: <202108161717.17GHHOZS030320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 8fa63f44e64e - main - ipfilter: remove doubled semicolons MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8fa63f44e64ebac444a4ac6451ac5e150cdcf8b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 17:17:24 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8fa63f44e64ebac444a4ac6451ac5e150cdcf8b1 commit 8fa63f44e64ebac444a4ac6451ac5e150cdcf8b1 Author: Ed Maste AuthorDate: 2021-08-16 17:16:23 +0000 Commit: Ed Maste CommitDate: 2021-08-16 17:16:42 +0000 ipfilter: remove doubled semicolons Local commit; ipfilter upstream is inactive. Discussed with: cy MFC after: 3 days --- sys/contrib/ipfilter/netinet/ip_frag.c | 2 +- sys/contrib/ipfilter/netinet/ip_state.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_frag.c b/sys/contrib/ipfilter/netinet/ip_frag.c index 93bcc2ed9415..4a2596e72563 100644 --- a/sys/contrib/ipfilter/netinet/ip_frag.c +++ b/sys/contrib/ipfilter/netinet/ip_frag.c @@ -1181,7 +1181,7 @@ ipf_frag_nat_next(softc, token, itp) ipftoken_t *token; ipfgeniter_t *itp; { - ipf_frag_softc_t *softf = softc->ipf_frag_soft;; + ipf_frag_softc_t *softf = softc->ipf_frag_soft; #ifdef USE_MUTEXES return ipf_frag_next(softc, token, itp, &softf->ipfr_natlist, diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c index 0ebebb49297d..7918f34fe685 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.c +++ b/sys/contrib/ipfilter/netinet/ip_state.c @@ -2855,8 +2855,8 @@ ipf_checkicmpmatchingstate(fin) tcp = (tcphdr_t *)((char *)oip + (IP_HL(oip) << 2)); - hv += tcp->th_dport;; - hv += tcp->th_sport;; + hv += tcp->th_dport; + hv += tcp->th_sport; hv = DOUBLE_HASH(hv); READ_ENTER(&softc->ipf_state); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 17:24:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E83A0651A67; Mon, 16 Aug 2021 17:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpLcY5z7zz4qQG; Mon, 16 Aug 2021 17:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B558356A0; Mon, 16 Aug 2021 17:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GHODtM043189; Mon, 16 Aug 2021 17:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GHODFB043188; Mon, 16 Aug 2021 17:24:13 GMT (envelope-from git) Date: Mon, 16 Aug 2021 17:24:13 GMT Message-Id: <202108161724.17GHODFB043188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 69e8e8ea3d4b - main - e1000: always enable PCSD when RSS hashing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69e8e8ea3d4be9da6b5bc904a444b51958128ff5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 17:24:14 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=69e8e8ea3d4be9da6b5bc904a444b51958128ff5 commit 69e8e8ea3d4be9da6b5bc904a444b51958128ff5 Author: Kevin Bowling AuthorDate: 2021-08-16 17:17:34 +0000 Commit: Kevin Bowling CommitDate: 2021-08-16 17:24:01 +0000 e1000: always enable PCSD when RSS hashing To enable RSS hashing in the NIC, the PCSD bit must be set. By default, this is never set when RXCSUM is disabled - which causes problems higher up in the stack. While here improve the RXCSUM flag assignments when enabling or disabling IFCAP_RXCSUM. See also: https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076148.html Reviewed by: markj, Franco Fichtner , Stephan de Wit Obtained from: OPNsense MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31501 Co-authored-by: Stephan de Wit Co-authored-by: Franco Fichtner --- sys/dev/e1000/e1000_82575.h | 3 +-- sys/dev/e1000/e1000_defines.h | 11 ++++++----- sys/dev/e1000/if_em.c | 44 ++++++++++++++++++++----------------------- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h index a96b25f4169d..36045556661b 100644 --- a/sys/dev/e1000/e1000_82575.h +++ b/sys/dev/e1000/e1000_82575.h @@ -143,13 +143,12 @@ struct e1000_adv_context_desc { #define E1000_TX_HEAD_WB_ENABLE 0x1 #define E1000_TX_SEQNUM_WB_ENABLE 0x2 -#define E1000_MRQC_ENABLE_RSS_4Q 0x00000002 +#define E1000_MRQC_ENABLE_RSS_MQ 0x00000002 #define E1000_MRQC_ENABLE_VMDQ 0x00000003 #define E1000_MRQC_ENABLE_VMDQ_RSS_2Q 0x00000005 #define E1000_MRQC_RSS_FIELD_IPV4_UDP 0x00400000 #define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000 #define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000 -#define E1000_MRQC_ENABLE_RSS_8Q 0x00000002 #define E1000_VMRCTL_MIRROR_PORT_SHIFT 8 #define E1000_VMRCTL_MIRROR_DSTPORT_MASK (7 << \ diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 722596b36e34..262b01dd5b64 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -428,11 +428,12 @@ #define E1000_SCTL_ENABLE_SERDES_LOOPBACK 0x0410 /* Receive Checksum Control */ -#define E1000_RXCSUM_IPOFL 0x00000100 /* IPv4 checksum offload */ -#define E1000_RXCSUM_TUOFL 0x00000200 /* TCP / UDP checksum offload */ -#define E1000_RXCSUM_CRCOFL 0x00000800 /* CRC32 offload enable */ -#define E1000_RXCSUM_IPPCSE 0x00001000 /* IP payload checksum enable */ -#define E1000_RXCSUM_PCSD 0x00002000 /* packet checksum disabled */ +#define E1000_RXCSUM_IPOFL 0x00000100 /* IPv4 checksum offload */ +#define E1000_RXCSUM_TUOFL 0x00000200 /* TCP / UDP checksum offload */ +#define E1000_RXCSUM_IPV6OFL 0x00000400 /* lem(4) IPv6 checksum offload */ +#define E1000_RXCSUM_CRCOFL 0x00000800 /* CRC32 offload enable */ +#define E1000_RXCSUM_IPPCSE 0x00001000 /* IP payload checksum enable */ +#define E1000_RXCSUM_PCSD 0x00002000 /* packet checksum disabled */ /* Header split receive */ #define E1000_RFCTL_NFSW_DIS 0x00000040 diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 33d5341ed8ce..3f748b6bcacd 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -2838,7 +2838,7 @@ igb_initialize_rss_mapping(struct adapter *adapter) * MRQC: Multiple Receive Queues Command * Set queuing to RSS control, number depends on the device. */ - mrqc = E1000_MRQC_ENABLE_RSS_8Q; + mrqc = E1000_MRQC_ENABLE_RSS_MQ; #ifdef RSS /* XXX ew typecasting */ @@ -3245,37 +3245,33 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); } + /* Set up L3 and L4 csum Rx descriptor offloads */ rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); - if (if_getcapenable(ifp) & IFCAP_RXCSUM && - hw->mac.type >= e1000_82543) { - if (adapter->tx_num_queues > 1) { - if (hw->mac.type >= igb_mac_min) { - rxcsum |= E1000_RXCSUM_PCSD; - if (hw->mac.type != e1000_82575) - rxcsum |= E1000_RXCSUM_CRCOFL; - } else - rxcsum |= E1000_RXCSUM_TUOFL | - E1000_RXCSUM_IPOFL | - E1000_RXCSUM_PCSD; - } else { - if (hw->mac.type >= igb_mac_min) - rxcsum |= E1000_RXCSUM_IPPCSE; - else - rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL; - if (hw->mac.type > e1000_82575) - rxcsum |= E1000_RXCSUM_CRCOFL; - } - } else - rxcsum &= ~E1000_RXCSUM_TUOFL; - - E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); + if (scctx->isc_capenable & IFCAP_RXCSUM) { + rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL; + if (hw->mac.type > e1000_82575) + rxcsum |= E1000_RXCSUM_CRCOFL; + else if (hw->mac.type < em_mac_min && + scctx->isc_capenable & IFCAP_HWCSUM_IPV6) + rxcsum |= E1000_RXCSUM_IPV6OFL; + } else { + rxcsum &= ~(E1000_RXCSUM_IPOFL | E1000_RXCSUM_TUOFL); + if (hw->mac.type > e1000_82575) + rxcsum &= ~E1000_RXCSUM_CRCOFL; + else if (hw->mac.type < em_mac_min) + rxcsum &= ~E1000_RXCSUM_IPV6OFL; + } if (adapter->rx_num_queues > 1) { + /* RSS hash needed in the Rx descriptor */ + rxcsum |= E1000_RXCSUM_PCSD; + if (hw->mac.type >= igb_mac_min) igb_initialize_rss_mapping(adapter); else em_initialize_rss_mapping(adapter); } + E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); /* * XXX TEMPORARY WORKAROUND: on some systems with 82573 From owner-dev-commits-src-all@freebsd.org Mon Aug 16 17:49:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7EB5651E2E; Mon, 16 Aug 2021 17:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpM9N6Jwtz4rVC; Mon, 16 Aug 2021 17:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0F975A54; Mon, 16 Aug 2021 17:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GHnCI6070444; Mon, 16 Aug 2021 17:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GHnCSh070443; Mon, 16 Aug 2021 17:49:12 GMT (envelope-from git) Date: Mon, 16 Aug 2021 17:49:12 GMT Message-Id: <202108161749.17GHnCSh070443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d16cb228c1a6 - main - ktls: Fix accounting for TLS 1.0 empty fragments. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d16cb228c1a62a9641ffb2f0bfcacc3bffec5db1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 17:49:13 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d16cb228c1a62a9641ffb2f0bfcacc3bffec5db1 commit d16cb228c1a62a9641ffb2f0bfcacc3bffec5db1 Author: John Baldwin AuthorDate: 2021-08-16 17:42:46 +0000 Commit: John Baldwin CommitDate: 2021-08-16 17:42:46 +0000 ktls: Fix accounting for TLS 1.0 empty fragments. TLS 1.0 empty fragment mbufs have no payload and thus m_epg_npgs is zero. However, these mbufs need to occupy a "unit" of space for the purposes of M_NOTREADY tracking similar to regular mbufs. Previously this was done for the page count returned from ktls_frame() and passed to ktls_enqueue() as well as the page count passed to pru_ready(). However, sbready() and mb_free_notready() only use m_epg_nrdy to determine the number of "units" of space in an M_EXT mbuf, so when a TLS 1.0 fragment was marked ready it would mark one unit of the next mbuf in the socket buffer as ready as well. To fix, set m_epg_nrdy to 1 for empty fragments. This actually simplifies the code as now only ktls_frame() has to handle TLS 1.0 fragments explicitly and the rest of the KTLS functions can just use m_epg_nrdy. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31536 --- sys/kern/uipc_ktls.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 79da902095b3..34b4b15153ce 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1633,12 +1633,12 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, int *enq_cnt, */ if (tls->mode == TCP_TLS_MODE_SW) { m->m_flags |= M_NOTREADY; - m->m_epg_nrdy = m->m_epg_npgs; if (__predict_false(tls_len == 0)) { /* TLS 1.0 empty fragment. */ - *enq_cnt += 1; + m->m_epg_nrdy = 1; } else - *enq_cnt += m->m_epg_npgs; + m->m_epg_nrdy = m->m_epg_npgs; + *enq_cnt += m->m_epg_nrdy; } } } @@ -2181,11 +2181,7 @@ ktls_encrypt(struct ktls_wq *wq, struct mbuf *top) break; } - if (__predict_false(m->m_epg_npgs == 0)) { - /* TLS 1.0 empty fragment. */ - npages++; - } else - npages += m->m_epg_npgs; + npages += m->m_epg_nrdy; /* * Drop a reference to the session now that it is no From owner-dev-commits-src-all@freebsd.org Mon Aug 16 19:18:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6EDA6531AB; Mon, 16 Aug 2021 19:18:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpP7x3y9Jz3GCs; Mon, 16 Aug 2021 19:18:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D04670BE; Mon, 16 Aug 2021 19:18:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GJI5HX090141; Mon, 16 Aug 2021 19:18:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GJI53J090140; Mon, 16 Aug 2021 19:18:05 GMT (envelope-from git) Date: Mon, 16 Aug 2021 19:18:05 GMT Message-Id: <202108161918.17GJI53J090140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c4feb1ab0ae0 - main - sigtimedwait: Use a unique wait channel for sleeping MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4feb1ab0ae0c0e779af372e4c5f3b9e0d3e1388 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 19:18:05 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c4feb1ab0ae0c0e779af372e4c5f3b9e0d3e1388 commit c4feb1ab0ae0c0e779af372e4c5f3b9e0d3e1388 Author: Mark Johnston AuthorDate: 2021-08-16 17:15:25 +0000 Commit: Mark Johnston CommitDate: 2021-08-16 19:11:15 +0000 sigtimedwait: Use a unique wait channel for sleeping When a sigtimedwait(2) caller goes to sleep, it uses a wait channel of p->p_sigacts with the proc lock as the interlock. However, p_sigacts can be shared between processes if a child is created with rfork(RFSIGSHARE | RFPROC). Thus we can end up with two threads sleeping on the same wait channel using different locks, which is not permitted. Fix the problem simply by using a process-unique wait channel, following the example of sigsuspend. The actual wait channel value is irrelevant here, sleeping threads are awoken using sleepq_abort(). Reported by: syzbot+8c417afabadb50bb8827@syzkaller.appspotmail.com Reported by: syzbot+1d89fc2a9ef92ef64fa8@syzkaller.appspotmail.com Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31563 --- sys/kern/kern_sig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 4f6f424fb05d..d61812ad3043 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1341,7 +1341,8 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, break; } - error = msleep(ps, &p->p_mtx, PPAUSE|PCATCH, "sigwait", timo); + error = msleep(&p->p_sigacts, &p->p_mtx, PPAUSE | PCATCH, + "sigwait", timo); /* The syscalls can not be restarted. */ if (error == ERESTART) From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:02:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E2EE6544CA; Mon, 16 Aug 2021 21:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRSl33FZz3QWc; Mon, 16 Aug 2021 21:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 516A0105DC; Mon, 16 Aug 2021 21:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GL2lWG036851; Mon, 16 Aug 2021 21:02:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GL2liG036850; Mon, 16 Aug 2021 21:02:47 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:02:47 GMT Message-Id: <202108162102.17GL2liG036850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 95add157e341 - main - hmt(4): Store Contact Count in separate variable. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95add157e341f2c1ce47eaa19b3c5771705ea20d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:02:47 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=95add157e341f2c1ce47eaa19b3c5771705ea20d commit 95add157e341f2c1ce47eaa19b3c5771705ea20d Author: Vladimir Kondratyev AuthorDate: 2021-08-16 20:11:36 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 20:11:36 +0000 hmt(4): Store Contact Count in separate variable. No functional changes. MFC after: 1 week --- sys/dev/hid/hmt.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index fd50ea4de829..2eb02811a5a4 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -185,6 +185,7 @@ struct hmt_softc { device_t dev; enum hmt_type type; + int32_t cont_count_max; struct hid_absinfo ai[HMT_N_USAGES]; struct hid_location locs[MAX_MT_SLOTS][HMT_N_USAGES]; struct hid_location cont_count_loc; @@ -332,7 +333,7 @@ hmt_attach(device_t dev) * 'Contact Count Maximum' */ if (cont_count_max > 0) - sc->ai[HMT_SLOT].max = cont_count_max - 1; + sc->cont_count_max = cont_count_max; } else DPRINTF("hid_get_report error=%d\n", err); } else @@ -368,12 +369,19 @@ hmt_attach(device_t dev) } /* Cap contact count maximum to MAX_MT_SLOTS */ - if (sc->ai[HMT_SLOT].max >= MAX_MT_SLOTS) { + if (sc->cont_count_max > MAX_MT_SLOTS) { DPRINTF("Hardware reported %d contacts while only %d is " - "supported\n", (int)sc->ai[HMT_SLOT].max+1, MAX_MT_SLOTS); - sc->ai[HMT_SLOT].max = MAX_MT_SLOTS - 1; + "supported\n", sc->cont_count_max, MAX_MT_SLOTS); + sc->cont_count_max = MAX_MT_SLOTS; } + /* Set number of MT protocol type B slots */ + sc->ai[HMT_SLOT] = (struct hid_absinfo) { + .min = 0, + .max = sc->cont_count_max - 1, + .res = 0, + }; + if (hid_test_quirk(hw, HQ_MT_TIMESTAMP) || hmt_timestamps) sc->do_timestamps = true; #ifdef IICHID_SAMPLING @@ -445,7 +453,7 @@ hmt_attach(device_t dev) sc->is_clickpad ? ", click-pad" : ""); device_printf(sc->dev, "%d contacts with [%s%s%s%s%s] properties. Report range [%d:%d] - [%d:%d]\n", - (int)sc->ai[HMT_SLOT].max + 1, + (int)sc->cont_count_max, isset(sc->caps, HMT_IN_RANGE) ? "R" : "", isset(sc->caps, HMT_CONFIDENCE) ? "C" : "", isset(sc->caps, HMT_WIDTH) ? "W" : "", @@ -834,13 +842,6 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, if (cont_count_max < 1) cont_count_max = cont; - /* Set number of MT protocol type B slots */ - sc->ai[HMT_SLOT] = (struct hid_absinfo) { - .min = 0, - .max = cont_count_max - 1, - .res = 0, - }; - /* Report touch orientation if both width and height are supported */ if (isset(sc->caps, HMT_WIDTH) && isset(sc->caps, HMT_HEIGHT)) { setbit(sc->caps, HMT_ORIENTATION); @@ -857,6 +858,7 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, hid_feature, sc->thqa_cert_rid); sc->report_id = report_id; + sc->cont_count_max = cont_count_max; sc->nconts_per_report = cont; sc->has_int_button = has_int_button; From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:02:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E45796545DD; Mon, 16 Aug 2021 21:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRSm4f1Tz3QWd; Mon, 16 Aug 2021 21:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7672A10B47; Mon, 16 Aug 2021 21:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GL2mn5036882; Mon, 16 Aug 2021 21:02:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GL2mUT036881; Mon, 16 Aug 2021 21:02:48 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:02:48 GMT Message-Id: <202108162102.17GL2mUT036881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: e40fec4ec9a7 - main - evdev: Do not check maximal contact number for MT initialization MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e40fec4ec9a7a6625b3e332d4f856eb1d05f0def Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:02:49 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e40fec4ec9a7a6625b3e332d4f856eb1d05f0def commit e40fec4ec9a7a6625b3e332d4f856eb1d05f0def Author: Vladimir Kondratyev AuthorDate: 2021-08-16 20:12:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 20:12:01 +0000 evdev: Do not check maximal contact number for MT initialization This allows singletouch devices which use multitouch protocols to work. Reported by: Mark Kane MFC after: 1 week --- sys/dev/evdev/evdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/evdev/evdev.c b/sys/dev/evdev/evdev.c index 086ee36333dc..bc28ae0734f9 100644 --- a/sys/dev/evdev/evdev.c +++ b/sys/dev/evdev/evdev.c @@ -316,8 +316,7 @@ evdev_register_common(struct evdev_dev *evdev) } /* Initialize multitouch protocol type B states */ - if (bit_test(evdev->ev_abs_flags, ABS_MT_SLOT) && - evdev->ev_absinfo != NULL && MAXIMAL_MT_SLOT(evdev) > 0) + if (bit_test(evdev->ev_abs_flags, ABS_MT_SLOT)) evdev_mt_init(evdev); /* Estimate maximum report size */ From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:02:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C536B6548F2; Mon, 16 Aug 2021 21:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRSn4szcz3QFn; Mon, 16 Aug 2021 21:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BE4510978; Mon, 16 Aug 2021 21:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GL2naB036906; Mon, 16 Aug 2021 21:02:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GL2nFE036905; Mon, 16 Aug 2021 21:02:49 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:02:49 GMT Message-Id: <202108162102.17GL2nFE036905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: be75951af1ec - main - hid: Add extra constant to units of measurement MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be75951af1ec2d69d34a8701700b9bfd2a50679e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:02:50 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=be75951af1ec2d69d34a8701700b9bfd2a50679e commit be75951af1ec2d69d34a8701700b9bfd2a50679e Author: Vladimir Kondratyev AuthorDate: 2021-08-16 20:13:24 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 20:13:24 +0000 hid: Add extra constant to units of measurement Some devices like eGalax touchscreens use value of 0x33 instead of 0x13 for inches as unit of measure. Reported by: Mark Kane MFC after: 1 week --- sys/dev/hid/hid.c | 1 + sys/dev/hid/hid.h | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/hid/hid.c b/sys/dev/hid/hid.c index 699bfa4a8bb3..f201182ac20f 100644 --- a/sys/dev/hid/hid.c +++ b/sys/dev/hid/hid.c @@ -856,6 +856,7 @@ hid_item_resolution(struct hid_item *hi) divisor = 10; break; case HUM_INCH: + case HUM_INCH_EGALAX: multiplier = 10; divisor = 254; break; diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index 37ab8c9cdf7e..f0311bae689c 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -185,6 +185,7 @@ #define HUM_CENTIMETER 0x11 #define HUM_RADIAN 0x12 #define HUM_INCH 0x13 +#define HUM_INCH_EGALAX 0x33 #define HUM_DEGREE 0x14 #if defined(_KERNEL) || defined(_STANDALONE) From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:02:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 564066546E1; Mon, 16 Aug 2021 21:02:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRSq0tcMz3QFt; Mon, 16 Aug 2021 21:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF05910979; Mon, 16 Aug 2021 21:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GL2o6T036930; Mon, 16 Aug 2021 21:02:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GL2oJi036929; Mon, 16 Aug 2021 21:02:50 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:02:50 GMT Message-Id: <202108162102.17GL2oJi036929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: cb910670ac59 - main - hmt(4): Do not ignore constant usages in HID report descriptor parser MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb910670ac59e11808a629c8375c60200f909217 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:02:51 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=cb910670ac59e11808a629c8375c60200f909217 commit cb910670ac59e11808a629c8375c60200f909217 Author: Jack AuthorDate: 2021-08-16 20:17:41 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 20:24:05 +0000 hmt(4): Do not ignore constant usages in HID report descriptor parser This fixes hmt to work with MELF0411 1FD2:7012 touchscreen Obtained from: sysutils/iichid MFC after: 1 week --- sys/dev/hid/hmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index 2eb02811a5a4..d04db6954d00 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -676,8 +676,8 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, bool scan_time_found = false; bool has_int_button = false; -#define HMT_HI_ABSOLUTE(hi) \ - (((hi).flags & (HIO_CONST|HIO_VARIABLE|HIO_RELATIVE)) == HIO_VARIABLE) +#define HMT_HI_ABSOLUTE(hi) ((hi).nusages != 0 && \ + ((hi).flags & (HIO_VARIABLE | HIO_RELATIVE)) == HIO_VARIABLE) #define HUMS_THQA_CERT 0xC5 /* From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:02:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 211F46547C1; Mon, 16 Aug 2021 21:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRSq6xQ3z3QG1; Mon, 16 Aug 2021 21:02:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2C3E1083E; Mon, 16 Aug 2021 21:02:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GL2ptb036954; Mon, 16 Aug 2021 21:02:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GL2pjk036953; Mon, 16 Aug 2021 21:02:51 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:02:51 GMT Message-Id: <202108162102.17GL2pjk036953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 51b221611454 - main - hid: move proper hat switch handling from ps4dshock to hgame MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51b2216114546bb13b13002b29fb1263e600a0fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:02:52 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=51b2216114546bb13b13002b29fb1263e600a0fc commit 51b2216114546bb13b13002b29fb1263e600a0fc Author: Greg V AuthorDate: 2021-08-16 20:18:09 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 20:24:05 +0000 hid: move proper hat switch handling from ps4dshock to hgame Generic "DirectInput" HID gamepads need this handling too. Reviewed by: wulf MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31398 --- sys/dev/hid/hgame.c | 34 +++++++++++++++++++++++++++++++++- sys/dev/hid/hgame.h | 1 + sys/dev/hid/ps4dshock.c | 35 +++-------------------------------- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/sys/dev/hid/hgame.c b/sys/dev/hid/hgame.c index 545c72e76d93..97b1ac91960c 100644 --- a/sys/dev/hid/hgame.c +++ b/sys/dev/hid/hgame.c @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); { HIDMAP_KEY_RANGE(HUP_BUTTON, number_from, number_to, code) } #define HGAME_MAP_ABS(usage, code) \ { HIDMAP_ABS(HUP_GENERIC_DESKTOP, HUG_##usage, code) } +#define HGAME_MAP_GCB(usage, callback) \ + { HIDMAP_ANY_CB(HUP_GENERIC_DESKTOP, HUG_##usage, callback) } #define HGAME_MAP_CRG(usage_from, usage_to, callback) \ { HIDMAP_ANY_CB_RANGE(HUP_GENERIC_DESKTOP, \ HUG_##usage_from, HUG_##usage_to, callback) } @@ -66,7 +68,7 @@ static const struct hidmap_item hgame_map[] = { HGAME_MAP_ABS(RX, ABS_RX), HGAME_MAP_ABS(RY, ABS_RY), HGAME_MAP_ABS(RZ, ABS_RZ), - HGAME_MAP_ABS(HAT_SWITCH, ABS_HAT0X), + HGAME_MAP_GCB(HAT_SWITCH, hgame_hat_switch_cb), HGAME_MAP_CRG(D_PAD_UP, D_PAD_LEFT, hgame_dpad_cb), HGAME_MAP_BRG(17, 57, BTN_TRIGGER_HAPPY), HGAME_FINALCB( hgame_final_cb), @@ -79,6 +81,36 @@ static const struct hid_device_id hgame_devs[] = { HID_DRIVER_INFO(HUG_GAME_PAD) }, }; +int +hgame_hat_switch_cb(HIDMAP_CB_ARGS) +{ + static const struct { int32_t x; int32_t y; } hat_switch_map[] = { + {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, + {-1, -1},{0, 0} + }; + struct evdev_dev *evdev = HIDMAP_CB_GET_EVDEV(); + u_int idx; + + switch (HIDMAP_CB_GET_STATE()) { + case HIDMAP_CB_IS_ATTACHING: + evdev_support_event(evdev, EV_ABS); + evdev_support_abs(evdev, ABS_HAT0X, -1, 1, 0, 0, 0); + evdev_support_abs(evdev, ABS_HAT0Y, -1, 1, 0, 0, 0); + break; + + case HIDMAP_CB_IS_RUNNING: + idx = MIN(nitems(hat_switch_map) - 1, (u_int)ctx.data); + evdev_push_abs(evdev, ABS_HAT0X, hat_switch_map[idx].x); + evdev_push_abs(evdev, ABS_HAT0Y, hat_switch_map[idx].y); + break; + + default: + break; + } + + return (0); +} + /* * Emulate the hat switch report via the D-pad usages * found on XInput/XBox style devices diff --git a/sys/dev/hid/hgame.h b/sys/dev/hid/hgame.h index 32086ec4923c..702c65a4a4c1 100644 --- a/sys/dev/hid/hgame.h +++ b/sys/dev/hid/hgame.h @@ -31,6 +31,7 @@ #include +hidmap_cb_t hgame_hat_switch_cb; hidmap_cb_t hgame_dpad_cb; hidmap_cb_t hgame_final_cb; diff --git a/sys/dev/hid/ps4dshock.c b/sys/dev/hid/ps4dshock.c index eec26f808997..a4afba254c03 100644 --- a/sys/dev/hid/ps4dshock.c +++ b/sys/dev/hid/ps4dshock.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #define HID_DEBUG_VAR ps4dshock_debug +#include #include #include #include @@ -588,7 +589,6 @@ static const uint8_t ps4dshock_rdesc[] = { #define PS4DS_OUTPUT_REPORT5_SIZE 32 #define PS4DS_OUTPUT_REPORT11_SIZE 78 -static hidmap_cb_t ps4dshock_hat_switch_cb; static hidmap_cb_t ps4dshock_final_cb; static hidmap_cb_t ps4dsacc_data_cb; static hidmap_cb_t ps4dsacc_tstamp_cb; @@ -743,7 +743,7 @@ static const struct hidmap_item ps4dshock_map[] = { PS4DS_MAP_BTN(13, BTN_MODE), /* Click button is handled by touchpad driver */ /* PS4DS_MAP_BTN(14, BTN_LEFT), */ - PS4DS_MAP_GCB(HAT_SWITCH, ps4dshock_hat_switch_cb), + PS4DS_MAP_GCB(HAT_SWITCH, hgame_hat_switch_cb), PS4DS_FINALCB( ps4dshock_final_cb), }; static const struct hidmap_item ps4dsacc_map[] = { @@ -787,36 +787,6 @@ static const struct hid_device_id ps4dsmtp_devs[] = { HID_TLC(HUP_DIGITIZERS, HUD_TOUCHPAD) }, }; -static int -ps4dshock_hat_switch_cb(HIDMAP_CB_ARGS) -{ - static const struct { int32_t x; int32_t y; } hat_switch_map[] = { - {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, - {-1, -1},{0, 0} - }; - struct evdev_dev *evdev = HIDMAP_CB_GET_EVDEV(); - u_int idx; - - switch (HIDMAP_CB_GET_STATE()) { - case HIDMAP_CB_IS_ATTACHING: - evdev_support_event(evdev, EV_ABS); - evdev_support_abs(evdev, ABS_HAT0X, -1, 1, 0, 0, 0); - evdev_support_abs(evdev, ABS_HAT0Y, -1, 1, 0, 0, 0); - break; - - case HIDMAP_CB_IS_RUNNING: - idx = MIN(nitems(hat_switch_map) - 1, (u_int)ctx.data); - evdev_push_abs(evdev, ABS_HAT0X, hat_switch_map[idx].x); - evdev_push_abs(evdev, ABS_HAT0Y, hat_switch_map[idx].y); - break; - - default: - break; - } - - return (0); -} - static int ps4dshock_final_cb(HIDMAP_CB_ARGS) { @@ -1414,6 +1384,7 @@ DRIVER_MODULE(ps4dshock, hidbus, ps4dshock_driver, ps4dshock_devclass, NULL, 0); MODULE_DEPEND(ps4dshock, hid, 1, 1, 1); MODULE_DEPEND(ps4dshock, hidbus, 1, 1, 1); MODULE_DEPEND(ps4dshock, hidmap, 1, 1, 1); +MODULE_DEPEND(ps4dshock, hgame, 1, 1, 1); MODULE_DEPEND(ps4dshock, evdev, 1, 1, 1); MODULE_VERSION(ps4dshock, 1); HID_PNP_INFO(ps4dshock_devs); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:02:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F34B36545DF; Mon, 16 Aug 2021 21:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRSs1GtQz3QG5; Mon, 16 Aug 2021 21:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0DAF10D3E; Mon, 16 Aug 2021 21:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GL2q2o036978; Mon, 16 Aug 2021 21:02:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GL2qU9036977; Mon, 16 Aug 2021 21:02:52 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:02:52 GMT Message-Id: <202108162102.17GL2qU9036977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 9b2b5f42b4fe - main - ps4dshock(4): Fix touchpad width in HID report descriptor MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b2b5f42b4fee7fdb6c7653829da71e9706f849b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:02:54 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9b2b5f42b4fee7fdb6c7653829da71e9706f849b commit 9b2b5f42b4fee7fdb6c7653829da71e9706f849b Author: Vladimir Kondratyev AuthorDate: 2021-08-16 20:18:27 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 20:24:05 +0000 ps4dshock(4): Fix touchpad width in HID report descriptor MFC after: 1 week --- sys/dev/hid/ps4dshock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/hid/ps4dshock.c b/sys/dev/hid/ps4dshock.c index a4afba254c03..afb74bc4b843 100644 --- a/sys/dev/hid/ps4dshock.c +++ b/sys/dev/hid/ps4dshock.c @@ -215,7 +215,7 @@ static const uint8_t ps4dshock_rdesc[] = { 0x55, 0x0E, /* Unit Exponent (-2) */ 0x65, 0x11, /* Unit (System: SI Linear, Length: Centimeter) */ 0x35, 0x00, /* Physical Minimum (0) */ - 0x46, 0x80, 0x02, /* Physical Maximum (640) */ + 0x46, 0xB8, 0x01, /* Physical Maximum (440) */ 0x26, 0x80, 0x07, /* Logical Maximum (1920) */ 0x75, 0x0C, /* Report Size (12) */ 0x81, 0x02, /* Input (Data,Var,Abs) */ @@ -244,7 +244,7 @@ static const uint8_t ps4dshock_rdesc[] = { 0x55, 0x0E, /* Unit Exponent (-2) */ 0x65, 0x11, /* Unit (System: SI Linear, Length: Centimeter) */ 0x35, 0x00, /* Physical Minimum (0) */ - 0x46, 0x80, 0x02, /* Physical Maximum (640) */ + 0x46, 0xB8, 0x01, /* Physical Maximum (440) */ 0x26, 0x80, 0x07, /* Logical Maximum (1920) */ 0x75, 0x0C, /* Report Size (12) */ 0x81, 0x02, /* Input (Data,Var,Abs) */ @@ -284,7 +284,7 @@ static const uint8_t ps4dshock_rdesc[] = { 0x55, 0x0E, /* Unit Exponent (-2) */ 0x65, 0x11, /* Unit (System: SI Linear, Length: Centimeter) */ 0x35, 0x00, /* Physical Minimum (0) */ - 0x46, 0x80, 0x02, /* Physical Maximum (640) */ + 0x46, 0xB8, 0x01, /* Physical Maximum (440) */ 0x26, 0x80, 0x07, /* Logical Maximum (1920) */ 0x75, 0x0C, /* Report Size (12) */ 0x81, 0x02, /* Input (Data,Var,Abs) */ @@ -313,7 +313,7 @@ static const uint8_t ps4dshock_rdesc[] = { 0x55, 0x0E, /* Unit Exponent (-2) */ 0x65, 0x11, /* Unit (System: SI Linear, Length: Centimeter) */ 0x35, 0x00, /* Physical Minimum (0) */ - 0x46, 0x80, 0x02, /* Physical Maximum (640) */ + 0x46, 0xB8, 0x01, /* Physical Maximum (440) */ 0x26, 0x80, 0x07, /* Logical Maximum (1920) */ 0x75, 0x0C, /* Report Size (12) */ 0x81, 0x02, /* Input (Data,Var,Abs) */ @@ -353,7 +353,7 @@ static const uint8_t ps4dshock_rdesc[] = { 0x55, 0x0E, /* Unit Exponent (-2) */ 0x65, 0x11, /* Unit (System: SI Linear, Length: Centimeter) */ 0x35, 0x00, /* Physical Minimum (0) */ - 0x46, 0x80, 0x02, /* Physical Maximum (640) */ + 0x46, 0xB8, 0x01, /* Physical Maximum (440) */ 0x26, 0x80, 0x07, /* Logical Maximum (1920) */ 0x75, 0x0C, /* Report Size (12) */ 0x81, 0x02, /* Input (Data,Var,Abs) */ @@ -382,7 +382,7 @@ static const uint8_t ps4dshock_rdesc[] = { 0x55, 0x0E, /* Unit Exponent (-2) */ 0x65, 0x11, /* Unit (System: SI Linear, Length: Centimeter) */ 0x35, 0x00, /* Physical Minimum (0) */ - 0x46, 0x80, 0x02, /* Physical Maximum (640) */ + 0x46, 0xB8, 0x01, /* Physical Maximum (440) */ 0x26, 0x80, 0x07, /* Logical Maximum (1920) */ 0x75, 0x0C, /* Report Size (12) */ 0x81, 0x02, /* Input (Data,Var,Abs) */ From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:02:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67A036547E8; Mon, 16 Aug 2021 21:02:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRSv487qz3QRN; Mon, 16 Aug 2021 21:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40488105DD; Mon, 16 Aug 2021 21:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GL2tkU037032; Mon, 16 Aug 2021 21:02:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GL2ths037031; Mon, 16 Aug 2021 21:02:55 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:02:55 GMT Message-Id: <202108162102.17GL2ths037031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 14a4d6d01335 - main - bitstring(3): Add bitstring traversal macros. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14a4d6d01335dd233023834e05897377cb70d52a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:02:56 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=14a4d6d01335dd233023834e05897377cb70d52a commit 14a4d6d01335dd233023834e05897377cb70d52a Author: Vladimir Kondratyev AuthorDate: 2021-08-16 20:18:58 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 20:24:05 +0000 bitstring(3): Add bitstring traversal macros. The macro bit_foreach() traverses all set bits in the bitstring in the forward direction, assigning each location in turn to variable. The macro bit_foreach_at() traverses all set bits in the bitstring in the forward direction at or after the zero-based bit index, assigning each location in turn to variable. The bit_foreach_unset() and bit_foreach_unset_at() macros which traverses unset bits are implemented for completeness. Reviewed by: asomers, dougm MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31469 --- share/man/man3/bitstring.3 | 46 ++++++++- sys/sys/bitstring.h | 16 ++++ tests/sys/sys/bitstring_test.c | 207 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 268 insertions(+), 1 deletion(-) diff --git a/share/man/man3/bitstring.3 b/share/man/man3/bitstring.3 index 20f5bae24d4d..e5be67a89e4f 100644 --- a/share/man/man3/bitstring.3 +++ b/share/man/man3/bitstring.3 @@ -58,7 +58,7 @@ .\" @(#)bitstring.3 8.1 (Berkeley) 7/19/93 .\" $FreeBSD$ .\" -.Dd November 18, 2019 +.Dd August 8, 2021 .Dt BITSTRING 3 .Os .Sh NAME @@ -106,6 +106,10 @@ .Fn bit_ffc_area_at "bitstr_t *name" "int start" "int nbits" "int size" "int *value" .Ft void .Fn bit_ffs_area_at "bitstr_t *name" "int start" "int nbits" "int size" "int *value" +.Fn bit_foreach "bitstr_t *name" "int nbits" "int var" +.Fn bit_foreach_at "bitstr_t *name" "int start" "int nbits" "int var" +.Fn bit_foreach_unset "bitstr_t *name" "int nbits" "int var" +.Fn bit_foreach_unset_at "bitstr_t *name" "int start" "int nbits" "int var" .Ft void .Fn bit_nclear "bitstr_t *name" "int start" "int stop" .Ft void @@ -327,6 +331,46 @@ bits referenced by at or after the zero-based bit index .Fa start . .Pp +The macro +.Fn bit_foreach +traverses all set bits in the array of +.Fa nbits +referenced by +.Fa name +in the forward direction, assigning each location in turn to +.Fa var . +.Pp +The macro +.Fn bit_foreach_at +traverses all set bits in the array of +.Fa nbits +referenced by +.Fa name +in the forward direction at or after the zero-based bit index +.Fa start , +assigning each location in turn to +.Fa var . +.Pp +The macro +.Fn bit_foreach_unset +traverses all unset bits in the array of +.Fa nbits +referenced by +.Fa name +in the forward direction, assigning each location in turn to +.Fa var . +.Pp +The macro +.Fn bit_foreach_unset_at +traverses all unset bits in the array of +.Fa nbits +referenced by +.Fa name +in the forward direction at or after the zero-based bit index +.Fa start , +assigning each location in turn to +.Fa var . +.Pp The arguments in bit string macros are evaluated only once and may safely have side effects. .Sh EXAMPLES diff --git a/sys/sys/bitstring.h b/sys/sys/bitstring.h index 97b841bbdda6..f898a2392be6 100644 --- a/sys/sys/bitstring.h +++ b/sys/sys/bitstring.h @@ -419,4 +419,20 @@ out: *_result = _value; } +/* Traverse all set bits, assigning each location in turn to iter */ +#define bit_foreach_at(_bitstr, _start, _nbits, _iter) \ + for (bit_ffs_at((_bitstr), (_start), (_nbits), &(_iter)); \ + (_iter) != -1; \ + bit_ffs_at((_bitstr), (_iter) + 1, (_nbits), &(_iter))) +#define bit_foreach(_bitstr, _nbits, _iter) \ + bit_foreach_at(_bitstr, /*start*/0, _nbits, _iter) + +/* Traverse all unset bits, assigning each location in turn to iter */ +#define bit_foreach_unset_at(_bitstr, _start, _nbits, _iter) \ + for (bit_ffc_at((_bitstr), (_start), (_nbits), &(_iter)); \ + (_iter) != -1; \ + bit_ffc_at((_bitstr), (_iter) + 1, (_nbits), &(_iter))) +#define bit_foreach_unset(_bitstr, _nbits, _iter) \ + bit_foreach_unset_at(_bitstr, /*start*/0, _nbits, _iter) + #endif /* _SYS_BITSTRING_H_ */ diff --git a/tests/sys/sys/bitstring_test.c b/tests/sys/sys/bitstring_test.c index 8fdc68ecf68e..c891a98645f8 100644 --- a/tests/sys/sys/bitstring_test.c +++ b/tests/sys/sys/bitstring_test.c @@ -601,6 +601,209 @@ BITSTRING_TC_DEFINE(bit_count) } +BITSTRING_TC_DEFINE(bit_foreach) +/* bitstr_t *bitstr, int nbits, const char *memloc */ +{ + int i, set_bit; + + /* Empty bitstr */ + memset(bitstr, 0x00, bitstr_size(nbits)); + bit_foreach (bitstr, nbits, set_bit) { + atf_tc_fail("bit_foreach_%d_%s_%s: Failed at location %d", + nbits, "clear", memloc, set_bit); + } + + /* Full bitstr */ + i = 0; + memset(bitstr, 0xFF, bitstr_size(nbits)); + bit_foreach(bitstr, nbits, set_bit) { + ATF_REQUIRE_MSG(set_bit == i, + "bit_foreach_%d_%s_%s: Failed on turn %d at location %d", + nbits, "set", memloc, i, set_bit); + i++; + } + ATF_REQUIRE_MSG(i == nbits, + "bit_foreach_%d_%s_%s: Invalid number of turns %d", + nbits, "set", memloc, i); + + /* Alternating bitstr, starts with 0 */ + i = 0; + memset(bitstr, 0xAA, bitstr_size(nbits)); + bit_foreach(bitstr, nbits, set_bit) { + ATF_REQUIRE_MSG(set_bit == i * 2 + 1, + "bit_foreach_%d_%s_%d_%s: " + "Failed on turn %d at location %d", + nbits, "alternating", 0, memloc, i, set_bit); + i++; + } + ATF_REQUIRE_MSG(i == nbits / 2, + "bit_foreach_%d_%s_%d_%s: Invalid number of turns %d", + nbits, "alternating", 0, memloc, i); + + /* Alternating bitstr, starts with 1 */ + i = 0; + memset(bitstr, 0x55, bitstr_size(nbits)); + bit_foreach(bitstr, nbits, set_bit) { + ATF_REQUIRE_MSG(set_bit == i * 2, + "bit_foreach_%d_%s_%d_%s: " + "Failed on turn %d at location %d", + nbits, "alternating", 1, memloc, i, set_bit); + i++; + } + ATF_REQUIRE_MSG(i == (nbits + 1) / 2, + "bit_foreach_%d_%s_%d_%s: Invalid number of turns %d", + nbits, "alternating", 1, memloc, i); +} + +BITSTRING_TC_DEFINE(bit_foreach_at) +/* bitstr_t *bitstr, int nbits, const char *memloc */ +{ + int i, s, e, set_bit; + + /* Invalid _start value */ + memset(bitstr, 0xFF, bitstr_size(nbits)); + bit_foreach_at(bitstr, nbits, nbits, set_bit) { + atf_tc_fail("bit_foreach_at_%d_%s_%s: Failed at location %d", + nbits, "invalid_start", memloc, set_bit); + } + + /* Varying start location */ + memset(bitstr, 0xAA, bitstr_size(nbits)); + for (s = 0; s < nbits; s++) { + i = 0; + bit_foreach_at(bitstr, s, nbits, set_bit) { + ATF_REQUIRE_MSG(set_bit == (i + s / 2) * 2 + 1, + "bit_foreach_at_%d_%s_%d_%s: " + "Failed on turn %d at location %d", + nbits, "vary_start", s, memloc, i, set_bit); + i++; + } + ATF_REQUIRE_MSG(i == nbits / 2 - s / 2, + "bit_foreach_at_%d_%s_%d_%s: Invalid number of turns %d", + nbits, "vary_start", s, memloc, i); + } + + /* Varying end location */ + memset(bitstr, 0xAA, bitstr_size(nbits)); + for (e = 0; e < nbits; e++) { + i = 0; + bit_foreach_at(bitstr, 0, e, set_bit) { + ATF_REQUIRE_MSG(set_bit == i * 2 + 1, + "bit_foreach_at_%d_%s_%d_%s: " + "Failed on turn %d at location %d", + nbits, "vary_end", e, memloc, i, set_bit); + i++; + } + ATF_REQUIRE_MSG(i == e / 2, + "bit_foreach_at_%d_%s_%d_%s: Invalid number of turns %d", + nbits, "vary_end", e, memloc, i); + } +} + +BITSTRING_TC_DEFINE(bit_foreach_unset) +/* bitstr_t *bitstr, int nbits, const char *memloc */ +{ + int i, unset_bit; + + /* Empty bitstr */ + i = 0; + memset(bitstr, 0, bitstr_size(nbits)); + bit_foreach_unset(bitstr, nbits, unset_bit) { + ATF_REQUIRE_MSG(unset_bit == i, + "bit_foreach_unset_%d_%s_%s: " + "Failed on turn %d at location %d", + nbits, "clear", memloc, i, unset_bit); + i++; + } + ATF_REQUIRE_MSG(i == nbits, + "bit_foreach_unset_%d_%s_%s: Invalid number of turns %d", + nbits, "set", memloc, i); + + /* Full bitstr */ + memset(bitstr, 0xFF, bitstr_size(nbits)); + bit_foreach_unset(bitstr, nbits, unset_bit) { + atf_tc_fail("bit_foreach_unset_%d_%s_%s: " + "Failed at location %d", + nbits, "set", memloc, unset_bit); + } + + /* Alternating bitstr, starts with 0 */ + i = 0; + memset(bitstr, 0xAA, bitstr_size(nbits)); + bit_foreach_unset(bitstr, nbits, unset_bit) { + ATF_REQUIRE_MSG(unset_bit == i * 2, + "bit_foreach_unset_%d_%s_%d_%s: " + "Failed on turn %d at location %d", + nbits, "alternating", 0, memloc, i, unset_bit); + i++; + } + ATF_REQUIRE_MSG(i == (nbits + 1) / 2, + "bit_foreach_unset_%d_%s_%d_%s: Invalid number of turns %d", + nbits, "alternating", 0, memloc, i); + + /* Alternating bitstr, starts with 1 */ + i = 0; + memset(bitstr, 0x55, bitstr_size(nbits)); + bit_foreach_unset(bitstr, nbits, unset_bit) { + ATF_REQUIRE_MSG(unset_bit == i * 2 + 1, + "bit_foreach_unset_%d_%s_%d_%s: " + "Failed on turn %d at location %d", + nbits, "alternating", 1, memloc, i, unset_bit); + i++; + } + ATF_REQUIRE_MSG(i == nbits / 2, + "bit_foreach_unset_%d_%s_%d_%s: Invalid number of turns %d", + nbits, "alternating", 1, memloc, i); +} + +BITSTRING_TC_DEFINE(bit_foreach_unset_at) +/* bitstr_t *bitstr, int nbits, const char *memloc */ +{ + int i, s, e, unset_bit; + + /* Invalid _start value */ + memset(bitstr, 0, bitstr_size(nbits)); + bit_foreach_unset_at(bitstr, nbits, nbits, unset_bit) { + atf_tc_fail("bit_foreach_unset_at_%d_%s_%s: " + "Failed at location %d", + nbits, "invalid_start", memloc, unset_bit); + } + + /* Varying start location */ + memset(bitstr, 0xAA, bitstr_size(nbits)); + for (s = 0; s < nbits; s++) { + i = 0; + bit_foreach_unset_at(bitstr, s, nbits, unset_bit) { + ATF_REQUIRE_MSG(unset_bit == (i + (s + 1) / 2) * 2, + "bit_foreach_unset_at_%d_%s_%d_%s: " + "Failed on turn %d at location %d", + nbits, "vary_start", s, memloc, i, unset_bit); + i++; + } + ATF_REQUIRE_MSG(i == (nbits + 1) / 2 - (s + 1) / 2, + "bit_foreach_unset_at_%d_%s_%d_%s: " + "Invalid number of turns %d", + nbits, "vary_start", s, memloc, i); + } + + /* Varying end location */ + memset(bitstr, 0xAA, bitstr_size(nbits)); + for (e = 0; e < nbits; e++) { + i = 0; + bit_foreach_unset_at(bitstr, 0, e, unset_bit) { + ATF_REQUIRE_MSG(unset_bit == i * 2, + "bit_foreach_unset_at_%d_%s_%d_%s: " + "Failed on turn %d at location %d", + nbits, "vary_end", e, memloc, i, unset_bit); + i++; + } + ATF_REQUIRE_MSG(i == (e + 1) / 2, + "bit_foreach_unset_at_%d_%s_%d_%s: " + "Invalid number of turns %d", + nbits, "vary_end", e, memloc, i); + } +} + ATF_TP_ADD_TCS(tp) { @@ -619,6 +822,10 @@ ATF_TP_ADD_TCS(tp) BITSTRING_TC_ADD(tp, bit_count); BITSTRING_TC_ADD(tp, bit_ffs_area_no_match); BITSTRING_TC_ADD(tp, bit_ffc_area_no_match); + BITSTRING_TC_ADD(tp, bit_foreach); + BITSTRING_TC_ADD(tp, bit_foreach_at); + BITSTRING_TC_ADD(tp, bit_foreach_unset); + BITSTRING_TC_ADD(tp, bit_foreach_unset_at); return (atf_no_error()); } From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:02:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BC1C6546ED; Mon, 16 Aug 2021 21:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRSt1Xc6z3QPD; Mon, 16 Aug 2021 21:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1900E10A52; Mon, 16 Aug 2021 21:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GL2seA037008; Mon, 16 Aug 2021 21:02:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GL2rXN037007; Mon, 16 Aug 2021 21:02:53 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:02:53 GMT Message-Id: <202108162102.17GL2rXN037007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 9b78891df13d - main - hms(4): Allow attachment to pointer top level collection. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b78891df13d12abaf8d0f0b0ca3e7d5f0e857e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:02:54 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9b78891df13d12abaf8d0f0b0ca3e7d5f0e857e3 commit 9b78891df13d12abaf8d0f0b0ca3e7d5f0e857e3 Author: Vladimir Kondratyev AuthorDate: 2021-08-16 20:18:43 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 20:24:05 +0000 hms(4): Allow attachment to pointer top level collection. to be in line with Microsoft mouse driver [1] [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/top-level-collections-opened-by-windows-for-system-use MFC after: 1 week --- sys/dev/hid/hms.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/hid/hms.c b/sys/dev/hid/hms.c index 014354c3acc3..e9923f55861f 100644 --- a/sys/dev/hid/hms.c +++ b/sys/dev/hid/hms.c @@ -109,6 +109,7 @@ static const struct hidmap_item hms_map_wheel_rev[] = { /* A match on these entries will load hms */ static const struct hid_device_id hms_devs[] = { + { HID_TLC(HUP_GENERIC_DESKTOP, HUG_POINTER) }, { HID_TLC(HUP_GENERIC_DESKTOP, HUG_MOUSE) }, }; From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:24:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4936865519B; Mon, 16 Aug 2021 21:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpRxh13mPz3jc8; Mon, 16 Aug 2021 21:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02C4311206; Mon, 16 Aug 2021 21:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GLONg4063157; Mon, 16 Aug 2021 21:24:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GLONqu063156; Mon, 16 Aug 2021 21:24:23 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:24:23 GMT Message-Id: <202108162124.17GLONqu063156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d8aeab4b45a9 - main - Add gone_in(9) man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8aeab4b45a94b3e1ab4396235e4426747e310fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:24:24 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d8aeab4b45a94b3e1ab4396235e4426747e310fe commit d8aeab4b45a94b3e1ab4396235e4426747e310fe Author: Ed Maste AuthorDate: 2021-06-09 17:19:16 +0000 Commit: Ed Maste CommitDate: 2021-08-16 21:23:59 +0000 Add gone_in(9) man page Reviewed by: imp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30703 --- share/man/man9/Makefile | 2 ++ share/man/man9/gone_in.9 | 94 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index d7d26419b042..ac0451ece3fe 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -161,6 +161,7 @@ MAN= accept_filter.9 \ g_provider_by_name.9 \ groupmember.9 \ g_wither_geom.9 \ + gone_in.9 \ hardclock.9 \ hash.9 \ hashinit.9 \ @@ -1119,6 +1120,7 @@ MLINKS+=g_geom.9 g_destroy_geom.9 \ MLINKS+=g_provider.9 g_destroy_provider.9 \ g_provider.9 g_error_provider.9 \ g_provider.9 g_new_providerf.9 +MLINKS+=gone_in.9 gone_in_dev.9 MLINKS+=hash.9 hash32.9 \ hash.9 hash32_buf.9 \ hash.9 hash32_str.9 \ diff --git a/share/man/man9/gone_in.9 b/share/man/man9/gone_in.9 new file mode 100644 index 000000000000..b2474d610b24 --- /dev/null +++ b/share/man/man9/gone_in.9 @@ -0,0 +1,94 @@ +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" This document was written by Ed Maste under sponsorhip from +.\" The FreeBSD Foundation. +.\" +.\" 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 ``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. +.\" +.\" $FreeBSD$ +.\" +.Dd August 16, 2021 +.Dt GONE_IN 9 +.Os +.Sh NAME +.Nm gone_in , +.Nm gone_in_dev +.Nd deprecation notice functions +.Sh SYNOPSIS +.In sys/systm.h +.Ft void +.Fn gone_in "int major" "const char *msg" +.Ft void +.Fn gone_in_dev "device_t dev" "int major" "const char *msg" +.Sh DESCRIPTION +The +.Fn gone_in +functions are used to provide a notice that the kernel is using a driver or +some other functionality that is deprecated, and will be removed in a future +.Fx +release. +The notice is sent to the kernel +.Xr dmesg 8 +log and will appear on the console. +The +.Fa major +argument specifies the major version of the +.Fx +release that will remove the deprecated functionality. +.Pp +In releases before +.Fa major +the deprecation notice states +.Do +Deprecated code (to be removed in FreeBSD +.Fa major Ns ): +.Fa msg +.Dc . +In releases equal to and after +.Fa major +the notice states +.Do +Obsolete code will be removed soon: +.Fa msg +.Dc . +.Sh EXAMPLES +.Bd -literal -offset indent +void +sample_init(void) +{ + /* Initializaiton code omitted. */ + + gone_in(14, "Giant-locked filesystem"); +} + +int +example_driver_attach(struct example_driver_softc *sc) +{ + /* Attach code omitted. */ + + gone_in_dev(sc->dev, 14, "Giant-locked driver"); +} +.Ed +.Sh HISTORY +The +.Nm +functions first appeared in +.Fx 11 . From owner-dev-commits-src-all@freebsd.org Mon Aug 16 21:31:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3F86655610; Mon, 16 Aug 2021 21:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpS5k58zTz3jvN; Mon, 16 Aug 2021 21:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F13A11129; Mon, 16 Aug 2021 21:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GLVMa7073549; Mon, 16 Aug 2021 21:31:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GLVMao073548; Mon, 16 Aug 2021 21:31:22 GMT (envelope-from git) Date: Mon, 16 Aug 2021 21:31:22 GMT Message-Id: <202108162131.17GLVMao073548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 5f99ae56c919 - main - evdev: Use bit_foreach helper macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f99ae56c9196753ae162ad464c2969ad1a131b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 21:31:22 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5f99ae56c9196753ae162ad464c2969ad1a131b6 commit 5f99ae56c9196753ae162ad464c2969ad1a131b6 Author: Vladimir Kondratyev AuthorDate: 2021-08-16 21:28:37 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-08-16 21:29:47 +0000 evdev: Use bit_foreach helper macro for traversing all bits set in the bitstring(9). While here move bit_change() definition to common header. MFC after: 1 week --- sys/dev/evdev/evdev.c | 25 ++++++------------------- sys/dev/evdev/evdev_private.h | 10 ++++++++++ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/sys/dev/evdev/evdev.c b/sys/dev/evdev/evdev.c index bc28ae0734f9..597342a364af 100644 --- a/sys/dev/evdev/evdev.c +++ b/sys/dev/evdev/evdev.c @@ -93,15 +93,6 @@ static void evdev_start_repeat(struct evdev_dev *, uint16_t); static void evdev_stop_repeat(struct evdev_dev *); static int evdev_check_event(struct evdev_dev *, uint16_t, uint16_t, int32_t); -static inline void -bit_change(bitstr_t *bitstr, int bit, int value) -{ - if (value) - bit_set(bitstr, bit); - else - bit_clear(bitstr, bit); -} - struct evdev_dev * evdev_alloc(void) { @@ -908,20 +899,16 @@ evdev_restore_after_kdb(struct evdev_dev *evdev) EVDEV_LOCK_ASSERT(evdev); /* Report postponed leds */ - for (code = 0; code < LED_CNT; code++) - if (bit_test(evdev->ev_kdb_led_states, code)) - evdev_send_event(evdev, EV_LED, code, - !bit_test(evdev->ev_led_states, code)); + bit_foreach(evdev->ev_kdb_led_states, LED_CNT, code) + evdev_send_event(evdev, EV_LED, code, + !bit_test(evdev->ev_led_states, code)); bit_nclear(evdev->ev_kdb_led_states, 0, LED_MAX); /* Release stuck keys (CTRL + ALT + ESC) */ evdev_stop_repeat(evdev); - for (code = 0; code < KEY_CNT; code++) { - if (bit_test(evdev->ev_key_states, code)) { - evdev_send_event(evdev, EV_KEY, code, KEY_EVENT_UP); - evdev_send_event(evdev, EV_SYN, SYN_REPORT, 1); - } - } + bit_foreach(evdev->ev_key_states, KEY_CNT, code) + evdev_send_event(evdev, EV_KEY, code, KEY_EVENT_UP); + evdev_send_event(evdev, EV_SYN, SYN_REPORT, 1); } int diff --git a/sys/dev/evdev/evdev_private.h b/sys/dev/evdev/evdev_private.h index 19636823b804..463f93847295 100644 --- a/sys/dev/evdev/evdev_private.h +++ b/sys/dev/evdev/evdev_private.h @@ -247,6 +247,16 @@ struct evdev_client (((client)->ec_buffer_ready + (client)->ec_buffer_size - \ (client)->ec_buffer_head) % (client)->ec_buffer_size) +/* bitstring(3) helper */ +static inline void +bit_change(bitstr_t *bitstr, int bit, int value) +{ + if (value) + bit_set(bitstr, bit); + else + bit_clear(bitstr, bit); +} + /* Input device interface: */ void evdev_send_event(struct evdev_dev *, uint16_t, uint16_t, int32_t); int evdev_inject_event(struct evdev_dev *, uint16_t, uint16_t, int32_t); From owner-dev-commits-src-all@freebsd.org Mon Aug 16 23:08:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9018A6571F0; Mon, 16 Aug 2021 23:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpVFl3PmNz3sMG; Mon, 16 Aug 2021 23:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D0B9124A9; Mon, 16 Aug 2021 23:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GN8RQH097170; Mon, 16 Aug 2021 23:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GN8R1d097169; Mon, 16 Aug 2021 23:08:27 GMT (envelope-from git) Date: Mon, 16 Aug 2021 23:08:27 GMT Message-Id: <202108162308.17GN8R1d097169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: cbfba56c45ab - main - routing: add IPv6 fib validation procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbfba56c45ab77303a3e25a82cf750043849760b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 23:08:27 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=cbfba56c45ab77303a3e25a82cf750043849760b commit cbfba56c45ab77303a3e25a82cf750043849760b Author: Alexander V. Chernikov AuthorDate: 2021-08-16 23:02:29 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-16 23:04:01 +0000 routing: add IPv6 fib validation procedure. Allow consistency validation of the inet6 fib based on rib data. Validation can be kicked off by loading test_lookup module and running sysctl net.route.test.run_inet6_scan=1 MFC after: 1 week --- sys/tests/fib_lookup/fib_lookup.c | 232 +++++++++++++++++++++++++++++++++++++- 1 file changed, 231 insertions(+), 1 deletion(-) diff --git a/sys/tests/fib_lookup/fib_lookup.c b/sys/tests/fib_lookup/fib_lookup.c index 55d2f3d4a4df..975644607409 100644 --- a/sys/tests/fib_lookup/fib_lookup.c +++ b/sys/tests/fib_lookup/fib_lookup.c @@ -319,7 +319,44 @@ cmp_dst(uint32_t fibnum, struct in_addr a) printf("[RT BUG] lookup for %s: RIB: %s/%d,nh=%u FIB: nh=%u\n", key_str, dst_str, plen, nhop_get_idx(nhop_select(rnd.rnd_nhop, 0)), - nhop_get_idx(nh_fib)); + nh_fib ? nhop_get_idx(nh_fib) : 0); + } + + return (false); +} + +static bool +cmp_dst6(uint32_t fibnum, const struct in6_addr *a) +{ + struct nhop_object *nh_fib; + struct rtentry *rt; + struct route_nhop_data rnd = {}; + + nh_fib = fib6_lookup(fibnum, a, 0, NHR_NONE, 0); + rt = fib6_lookup_rt(fibnum, a, 0, NHR_NONE, &rnd); + + if (nh_fib == NULL && rt == NULL) { + return (true); + } else if (nh_fib == nhop_select(rnd.rnd_nhop, 0)) { + return (true); + } + + struct in6_addr dst; + int plen; + uint32_t scopeid; + char key_str[INET6_ADDRSTRLEN], dst_str[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, a, key_str, sizeof(key_str)); + if (rnd.rnd_nhop == NULL) { + printf("[RT BUG] lookup for %s: RIB: ENOENT FIB: nh=%u\n", + key_str, nhop_get_idx(nh_fib)); + } else { + rt_get_inet6_prefix_plen(rt, &dst, &plen, &scopeid); + inet_ntop(AF_INET6, &dst, dst_str, sizeof(dst_str)); + printf("[RT BUG] lookup for %s: RIB: %s/%d,nh=%u FIB: nh=%u\n", + key_str, dst_str, plen, + nhop_get_idx(nhop_select(rnd.rnd_nhop, 0)), + nh_fib ? nhop_get_idx(nh_fib) : 0); } return (false); @@ -519,6 +556,199 @@ SYSCTL_PROC(_net_route_test, OID_AUTO, run_inet_scan, CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, run_test_inet_scan, "I", "Execute fib4_lookup scan tests"); +struct inet6_array { + uint32_t alloc_items; + uint32_t num_items; + uint32_t rnh_prefixes; + int error; + struct in6_addr *arr; +}; + +static bool +safe_add(uint32_t *v, uint32_t inc) +{ + if (*v < (UINT32_MAX - inc)) { + *v += inc; + return (true); + } else { + *v -= (UINT32_MAX - inc + 1); + return (false); + } +} + +static bool +safe_dec(uint32_t *v, uint32_t inc) +{ + if (*v >= inc) { + *v -= inc; + return (true); + } else { + *v += (UINT32_MAX - inc + 1); + return (false); + } +} + +static void +inc_prefix6(struct in6_addr *addr, int inc) +{ + for (int i = 0; i < 4; i++) { + uint32_t v = ntohl(addr->s6_addr32[3 - i]); + bool ret = safe_add(&v, inc); + addr->s6_addr32[3 - i] = htonl(v); + if (ret) + return; + inc = 1; + } +} + +static void +dec_prefix6(struct in6_addr *addr, int dec) +{ + for (int i = 0; i < 4; i++) { + uint32_t v = ntohl(addr->s6_addr32[3 - i]); + bool ret = safe_dec(&v, dec); + addr->s6_addr32[3 - i] = htonl(v); + if (ret) + return; + dec = 1; + } +} + +static void +ipv6_writemask(struct in6_addr *addr6, uint8_t mask) +{ + uint32_t *cp; + + for (cp = (uint32_t *)addr6; mask >= 32; mask -= 32) + *cp++ = 0xFFFFFFFF; + if (mask > 0) + *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); +} + +/* + * For each prefix, add the following records to the lookup array: + * * prefix-1, prefix, prefix + 1, prefix_end, prefix_end + 1 + */ +static int +add_prefix6(struct rtentry *rt, void *_data) +{ + struct inet6_array *pa = (struct inet6_array *)_data; + struct in6_addr addr, naddr; + int plen; + uint32_t scopeid; + + pa->rnh_prefixes++; + + if (pa->num_items + 5 >= pa->alloc_items) { + if (pa->error == 0) + pa->error = ENOSPC; + return (0); + } + + rt_get_inet6_prefix_plen(rt, &addr, &plen, &scopeid); + + pa->arr[pa->num_items++] = addr; + if (!IN6_ARE_ADDR_EQUAL(&addr, &in6addr_any)) { + naddr = addr; + dec_prefix6(&naddr, 1); + pa->arr[pa->num_items++] = naddr; + naddr = addr; + inc_prefix6(&naddr, 1); + pa->arr[pa->num_items++] = naddr; + + /* assume mask != 0 */ + struct in6_addr mask6; + ipv6_writemask(&mask6, plen); + naddr = addr; + for (int i = 0; i < 3; i++) + naddr.s6_addr32[i] = htonl(ntohl(naddr.s6_addr32[i]) | ~ntohl(mask6.s6_addr32[i])); + + pa->arr[pa->num_items++] = naddr; + inc_prefix6(&naddr, 1); + pa->arr[pa->num_items++] = naddr; + } + + return (0); +} + +static bool +prepare_list6(uint32_t fibnum, struct inet6_array *pa) +{ + struct rib_head *rh; + + rh = rt_tables_get_rnh(fibnum, AF_INET6); + + uint32_t num_prefixes = rh->rnh_prefixes; + bzero(pa, sizeof(struct inet6_array)); + pa->alloc_items = (num_prefixes + 10) * 5; + pa->arr = mallocarray(pa->alloc_items, sizeof(struct in6_addr), + M_TEMP, M_ZERO | M_WAITOK); + + rib_walk(fibnum, AF_INET6, false, add_prefix6, pa); + + if (pa->error != 0) { + printf("prefixes: old: %u, current: %u, walked: %u, allocated: %u\n", + num_prefixes, rh->rnh_prefixes, pa->rnh_prefixes, pa->alloc_items); + } + + return (pa->error == 0); +} + +static int +run_test_inet6_scan(SYSCTL_HANDLER_ARGS) +{ + struct epoch_tracker et; + + int count = 0; + int error = sysctl_handle_int(oidp, &count, 0, req); + if (error != 0) + return (error); + + if (count == 0) + return (0); + + struct inet6_array pa = {}; + uint32_t fibnum = curthread->td_proc->p_fibnum; + + if (!prepare_list6(fibnum, &pa)) + return (pa.error); + + struct timespec ts_pre, ts_post; + int64_t total_diff = 1; + uint64_t total_packets = 0; + int failure_count = 0; + + NET_EPOCH_ENTER(et); + nanouptime(&ts_pre); + for (int i = 0; i < pa.num_items; i++) { + if (!cmp_dst6(fibnum, &pa.arr[i])) { + failure_count++; + } + total_packets++; + } + nanouptime(&ts_post); + NET_EPOCH_EXIT(et); + + if (pa.arr != NULL) + free(pa.arr, M_TEMP); + + /* Signal error to userland */ + if (failure_count > 0) { + printf("[RT ERROR] total failures: %d\n", failure_count); + return (EINVAL); + } + + total_diff = (ts_post.tv_sec - ts_pre.tv_sec) * 1000000000 + + (ts_post.tv_nsec - ts_pre.tv_nsec); + printf("%zu packets in %zu nanoseconds, %zu pps\n", + total_packets, total_diff, total_packets * 1000000000 / total_diff); + + return (0); +} +SYSCTL_PROC(_net_route_test, OID_AUTO, run_inet6_scan, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + 0, 0, run_test_inet6_scan, "I", "Execute fib6_lookup scan tests"); + #define LPS_SEQ 0x1 #define LPS_ANN 0x2 #define LPS_REP 0x4 From owner-dev-commits-src-all@freebsd.org Mon Aug 16 23:59:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28FD3657F07 for ; Mon, 16 Aug 2021 23:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpWN60dBJz4RSf; Mon, 16 Aug 2021 23:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE7B112D5C; Mon, 16 Aug 2021 23:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GNx1ft062799; Mon, 16 Aug 2021 23:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GNx1LR062798; Mon, 16 Aug 2021 23:59:01 GMT (envelope-from git) Date: Mon, 16 Aug 2021 23:59:01 GMT Message-Id: <202108162359.17GNx1LR062798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Cy Schubert Subject: git: cdb5bb25a540 - Create tag vendor/unbound/1.13.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/tags/vendor/unbound/1.13.2 X-Git-Reftype: annotated tag X-Git-Commit: cdb5bb25a5404abe886ff3791ae9069dbfc39f28 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 23:59:02 -0000 The annotated tag vendor/unbound/1.13.2 has been created by cy: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/unbound/1.13.2 tag vendor/unbound/1.13.2 Tagger: Cy Schubert TaggerDate: 2021-08-16 23:57:53 +0000 unbound: Tag unbound 1.13.2 commit 625f1c1312fb7defbd148c8ba121a0cf058707ef Author: Cy Schubert AuthorDate: 2021-08-16 23:55:17 +0000 Commit: Cy Schubert CommitDate: 2021-08-16 23:57:03 +0000 unbound: Vendor import 1.13.2 From owner-dev-commits-src-all@freebsd.org Mon Aug 16 23:59:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 293336571E8 for ; Mon, 16 Aug 2021 23:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpWN60Vq6z4RY1; Mon, 16 Aug 2021 23:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF2E213209; Mon, 16 Aug 2021 23:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17GNx1m6062775; Mon, 16 Aug 2021 23:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17GNx1Vb062774; Mon, 16 Aug 2021 23:59:01 GMT (envelope-from git) Date: Mon, 16 Aug 2021 23:59:01 GMT Message-Id: <202108162359.17GNx1Vb062774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Cy Schubert Subject: git: d60fa10fd872..625f1c1312fb - vendor/unbound - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/vendor/unbound X-Git-Reftype: branch X-Git-Commit: 625f1c1312fb7defbd148c8ba121a0cf058707ef X-Git-Oldrev: d60fa10fd872db7e3d8cb1e161cfdae026c43b14 X-Git-Newrev: 625f1c1312fb7defbd148c8ba121a0cf058707ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 23:59:02 -0000 The branch vendor/unbound has been updated by cy: URL: https://cgit.FreeBSD.org/src/log/?id=d60fa10fd872..625f1c1312fb 625f1c1312fb unbound: Vendor import 1.13.2 From owner-dev-commits-src-all@freebsd.org Tue Aug 17 01:36:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09D3E659D81; Tue, 17 Aug 2021 01:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpYXL6rdHz4cCv; Tue, 17 Aug 2021 01:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D300114784; Tue, 17 Aug 2021 01:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H1aImu095935; Tue, 17 Aug 2021 01:36:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H1aIBg095934; Tue, 17 Aug 2021 01:36:18 GMT (envelope-from git) Date: Tue, 17 Aug 2021 01:36:18 GMT Message-Id: <202108170136.17H1aIBg095934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b761f264926a - stable/13 - e1000: consistently use the hw variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b761f264926a80c87ea3d9f3e7de37fc9bf2c2ec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 01:36:19 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b761f264926a80c87ea3d9f3e7de37fc9bf2c2ec commit b761f264926a80c87ea3d9f3e7de37fc9bf2c2ec Author: Marius Strobl AuthorDate: 2021-01-23 18:18:28 +0000 Commit: Kevin Bowling CommitDate: 2021-08-17 01:29:19 +0000 e1000: consistently use the hw variables It's rather confusing when adapter->hw and hw are mixed and matched within a particular function. Some of this was missed in cd1cf2fc1d49c509ded05dcd41b7600a5957fb9a and r353778 respectively. (cherry picked from commit c1655b0f8998f9e842a004f33e7c9c01c5d9e879) --- sys/dev/e1000/if_em.c | 152 ++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 79 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index c9a6648b34a0..b2d563dbe796 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -837,7 +837,7 @@ em_if_attach_pre(if_ctx_t ctx) device_printf(dev, "attach_pre capping queues at %d\n", scctx->isc_ntxqsets_max); - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(union e1000_adv_tx_desc); @@ -849,7 +849,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities = scctx->isc_capenable = IGB_CAPS; scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP; - if (adapter->hw.mac.type != e1000_82575) + if (hw.mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; /* ** Some new devices, as with ixgbe, now may @@ -857,7 +857,7 @@ em_if_attach_pre(if_ctx_t ctx) ** track of which is used. */ scctx->isc_msix_bar = pci_msix_table_bar(dev); - } else if (adapter->hw.mac.type >= em_mac_min) { + } else if (hw.mac.type >= em_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); @@ -889,7 +889,7 @@ em_if_attach_pre(if_ctx_t ctx) * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. */ - if (adapter->hw.mac.type == e1000_82574) { + if (hw.mac.type == e1000_82574) { scctx->isc_msix_bar = pci_msix_table_bar(dev);; } else { scctx->isc_msix_bar = -1; @@ -903,7 +903,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; - if (adapter->hw.mac.type < e1000_82543) + if (hw.mac.type < e1000_82543) scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* INTx only */ scctx->isc_msix_bar = 0; @@ -996,9 +996,9 @@ em_if_attach_pre(if_ctx_t ctx) hw->phy.autoneg_wait_to_complete = FALSE; hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT; - if (adapter->hw.mac.type < em_mac_min) { - e1000_init_script_state_82541(&adapter->hw, TRUE); - e1000_set_tbi_compatibility_82543(&adapter->hw, TRUE); + if (hw.mac.type < em_mac_min) { + e1000_init_script_state_82541(hw, TRUE); + e1000_set_tbi_compatibility_82543(hw, TRUE); } /* Copper options */ if (hw->phy.media_type == e1000_media_type_copper) { @@ -1011,7 +1011,7 @@ em_if_attach_pre(if_ctx_t ctx) * Set the frame limits assuming * standard ethernet sized frames. */ - scctx->isc_max_frame_size = adapter->hw.mac.max_frame_size = + scctx->isc_max_frame_size = hw.mac.max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE; /* @@ -1221,7 +1221,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) struct adapter *adapter = iflib_get_softc(ctx); if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx); - IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); + IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); switch (adapter->hw.mac.type) { case e1000_82571: @@ -1808,7 +1808,7 @@ em_if_update_admin_status(if_ctx_t ctx) break; case e1000_media_type_internal_serdes: e1000_check_for_link(hw); - link_check = adapter->hw.mac.serdes_has_link; + link_check = hw.mac.serdes_has_link; break; /* VF device is type_unknown */ case e1000_media_type_unknown: @@ -1855,8 +1855,8 @@ em_if_update_admin_status(if_ctx_t ctx) (hw->phy.id == I210_I_PHY_ID)) msec_delay(I210_LINK_DELAY); /* Reset if the media type changed. */ - if ((hw->dev_spec._82575.media_changed) && - (adapter->hw.mac.type >= igb_mac_min)) { + if (hw->dev_spec._82575.media_changed && + hw.mac.type >= igb_mac_min) { hw->dev_spec._82575.media_changed = false; adapter->flags |= IGB_MEDIA_RESET; em_reset(ctx); @@ -2117,13 +2117,13 @@ igb_configure_queues(struct adapter *adapter) u32 tmp, ivar = 0, newitr = 0; /* First turn on RSS capability */ - if (adapter->hw.mac.type != e1000_82575) + if (hw.mac.type != e1000_82575) E1000_WRITE_REG(hw, E1000_GPIE, E1000_GPIE_MSIX_MODE | E1000_GPIE_EIAME | E1000_GPIE_PBA | E1000_GPIE_NSICR); /* Turn on MSI-X */ - switch (adapter->hw.mac.type) { + switch (hw.mac.type) { case e1000_82580: case e1000_i350: case e1000_i354: @@ -2531,7 +2531,7 @@ em_reset(if_ctx_t ctx) case e1000_ich9lan: case e1000_ich10lan: /* Boost Receive side for jumbo frames */ - if (adapter->hw.mac.max_frame_size > 4096) + if (hw.mac.max_frame_size > 4096) pba = E1000_PBA_14K; else pba = E1000_PBA_10K; @@ -2579,11 +2579,11 @@ em_reset(if_ctx_t ctx) pba = E1000_READ_REG(hw, E1000_PBA); tx_space = pba >> 16; pba &= 0xffff; - min_tx = (adapter->hw.mac.max_frame_size + + min_tx = (hw.mac.max_frame_size + sizeof(struct e1000_tx_desc) - ETHERNET_FCS_SIZE) * 2; min_tx = roundup2(min_tx, 1024); min_tx >>= 10; - min_rx = adapter->hw.mac.max_frame_size; + min_rx = hw.mac.max_frame_size; min_rx = roundup2(min_rx, 1024); min_rx >>= 10; if (tx_space < min_tx && @@ -2600,7 +2600,7 @@ em_reset(if_ctx_t ctx) } if (hw->mac.type < igb_mac_min) - E1000_WRITE_REG(&adapter->hw, E1000_PBA, pba); + E1000_WRITE_REG(hw, E1000_PBA, pba); INIT_DEBUGOUT1("em_reset: pba=%dK",pba); @@ -2620,7 +2620,7 @@ em_reset(if_ctx_t ctx) */ rx_buffer_size = (pba & 0xffff) << 10; hw->fc.high_water = rx_buffer_size - - roundup2(adapter->hw.mac.max_frame_size, 1024); + roundup2(hw.mac.max_frame_size, 1024); hw->fc.low_water = hw->fc.high_water - 1500; if (adapter->fc) /* locally set flow control value? */ @@ -2698,7 +2698,7 @@ em_reset(if_ctx_t ctx) /* Issue a global reset */ e1000_reset_hw(hw); - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { E1000_WRITE_REG(hw, E1000_WUC, 0); } else { E1000_WRITE_REG(hw, E1000_WUFC, 0); @@ -2714,7 +2714,7 @@ em_reset(if_ctx_t ctx) device_printf(dev, "Hardware Initialization Failed\n"); return; } - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) igb_init_dmac(adapter, pba); E1000_WRITE_REG(hw, E1000_VET, ETHERTYPE_VLAN); @@ -2779,7 +2779,7 @@ igb_initialize_rss_mapping(struct adapter *adapter) u32 rss_key[10], mrqc, shift = 0; /* XXX? */ - if (adapter->hw.mac.type == e1000_82575) + if (hw.mac.type == e1000_82575) shift = 6; /* @@ -2888,11 +2888,11 @@ em_setup_interface(if_ctx_t ctx) * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || - (adapter->hw.phy.media_type == e1000_media_type_internal_serdes)) { + if (hw.phy.media_type == e1000_media_type_fiber || + hw.phy.media_type == e1000_media_type_internal_serdes) { u_char fiber_type = IFM_1000_SX; /* default type */ - if (adapter->hw.mac.type == e1000_82545) + if (hw.mac.type == e1000_82545) fiber_type = IFM_1000_LX; ifmedia_add(adapter->media, IFM_ETHER | fiber_type | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | fiber_type, 0, NULL); @@ -2901,7 +2901,7 @@ em_setup_interface(if_ctx_t ctx) ifmedia_add(adapter->media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); - if (adapter->hw.phy.type != e1000_phy_ife) { + if (hw.phy.type != e1000_phy_ife) { ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T, 0, NULL); } @@ -3070,8 +3070,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_TDH(i), 0); HW_DEBUGOUT2("Base = %x, Length = %x\n", - E1000_READ_REG(&adapter->hw, E1000_TDBAL(i)), - E1000_READ_REG(&adapter->hw, E1000_TDLEN(i))); + E1000_READ_REG(hw, E1000_TDBAL(i)), + E1000_READ_REG(hw, E1000_TDLEN(i))); txdctl = 0; /* clear txdctl */ txdctl |= 0x1f; /* PTHRESH */ @@ -3085,7 +3085,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) } /* Set the default values for the Tx Inter Packet Gap timer */ - switch (adapter->hw.mac.type) { + switch (hw.mac.type) { case e1000_80003es2lan: tipg = DEFAULT_82543_TIPG_IPGR1; tipg |= DEFAULT_80003ES2LAN_TIPG_IPGR2 << @@ -3097,9 +3097,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; break; default: - if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || - (adapter->hw.phy.media_type == - e1000_media_type_internal_serdes)) + if (hw.phy.media_type == e1000_media_type_fiber || + hw.phy.media_type == e1000_media_type_internal_serdes) tipg = DEFAULT_82543_TIPG_IPGT_FIBER; else tipg = DEFAULT_82543_TIPG_IPGT_COPPER; @@ -3107,51 +3106,50 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; } - E1000_WRITE_REG(&adapter->hw, E1000_TIPG, tipg); - E1000_WRITE_REG(&adapter->hw, E1000_TIDV, adapter->tx_int_delay.value); + E1000_WRITE_REG(hw, E1000_TIPG, tipg); + E1000_WRITE_REG(hw, E1000_TIDV, adapter->tx_int_delay.value); - if(adapter->hw.mac.type >= e1000_82540) - E1000_WRITE_REG(&adapter->hw, E1000_TADV, + if(hw.mac.type >= e1000_82540) + E1000_WRITE_REG(hw, E1000_TADV, adapter->tx_abs_int_delay.value); - if ((adapter->hw.mac.type == e1000_82571) || - (adapter->hw.mac.type == e1000_82572)) { - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + if (hw.mac.type == e1000_82571 || hw.mac.type == e1000_82572) { + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_SPEED_MODE_BIT; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - } else if (adapter->hw.mac.type == e1000_80003es2lan) { + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + } else if (hw.mac.type == e1000_80003es2lan) { /* errata: program both queues to unweighted RR */ - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= 1; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(1)); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + tarc = E1000_READ_REG(hw, E1000_TARC(1)); tarc |= 1; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc); - } else if (adapter->hw.mac.type == e1000_82574) { - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + E1000_WRITE_REG(hw, E1000_TARC(1), tarc); + } else if (hw.mac.type == e1000_82574) { + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_ERRATA_BIT; if ( adapter->tx_num_queues > 1) { tarc |= (TARC_COMPENSATION_MODE | TARC_MQ_FIX); - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + E1000_WRITE_REG(hw, E1000_TARC(1), tarc); } else - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); } if (adapter->tx_int_delay.value > 0) adapter->txd_cmd |= E1000_TXD_CMD_IDE; /* Program the Transmit Control Register */ - tctl = E1000_READ_REG(&adapter->hw, E1000_TCTL); + tctl = E1000_READ_REG(hw, E1000_TCTL); tctl &= ~E1000_TCTL_CT; tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); - if (adapter->hw.mac.type >= e1000_82571) + if (hw.mac.type >= e1000_82571) tctl |= E1000_TCTL_MULR; /* This write will effectively turn on the transmit unit. */ - E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); + E1000_WRITE_REG(hw, E1000_TCTL, tctl); /* SPT and KBL errata workarounds */ if (hw->mac.type == e1000_pch_spt) { @@ -3214,9 +3212,9 @@ em_initialize_receive_unit(if_ctx_t ctx) if (!em_disable_crc_stripping) rctl |= E1000_RCTL_SECRC; - if (adapter->hw.mac.type >= e1000_82540) { - E1000_WRITE_REG(&adapter->hw, E1000_RADV, - adapter->rx_abs_int_delay.value); + if (hw.mac.type >= e1000_82540) { + E1000_WRITE_REG(hw, E1000_RADV, + adapter->rx_abs_int_delay.value); /* * Set the interrupt throttling rate. Value is calculated @@ -3224,8 +3222,7 @@ em_initialize_receive_unit(if_ctx_t ctx) */ E1000_WRITE_REG(hw, E1000_ITR, DEFAULT_ITR); } - E1000_WRITE_REG(&adapter->hw, E1000_RDTR, - adapter->rx_int_delay.value); + E1000_WRITE_REG(hw, E1000_RDTR, adapter->rx_int_delay.value); /* Use extended rx descriptor formats */ rfctl = E1000_READ_REG(hw, E1000_RFCTL); @@ -3245,9 +3242,9 @@ em_initialize_receive_unit(if_ctx_t ctx) rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM && - adapter->hw.mac.type >= e1000_82543) { + hw.mac.type >= e1000_82543) { if (adapter->tx_num_queues > 1) { - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { rxcsum |= E1000_RXCSUM_PCSD; if (hw->mac.type != e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; @@ -3256,11 +3253,11 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_RXCSUM_IPOFL | E1000_RXCSUM_PCSD; } else { - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) rxcsum |= E1000_RXCSUM_IPPCSE; else rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL; - if (adapter->hw.mac.type > e1000_82575) + if (hw.mac.type > e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; } } else @@ -3269,7 +3266,7 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); if (adapter->rx_num_queues > 1) { - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) igb_initialize_rss_mapping(adapter); else em_initialize_rss_mapping(adapter); @@ -3309,14 +3306,11 @@ em_initialize_receive_unit(if_ctx_t ctx) * Only write to RXDCTL(1) if there is a need for different * settings. */ - - if (((adapter->hw.mac.type == e1000_ich9lan) || - (adapter->hw.mac.type == e1000_pch2lan) || - (adapter->hw.mac.type == e1000_ich10lan)) && - (if_getmtu(ifp) > ETHERMTU)) { + if ((hw.mac.type == e1000_ich9lan || hw.mac.type == e1000_pch2lan || + hw.mac.type == e1000_ich10lan) && (if_getmtu(ifp) > ETHERMTU)) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); - } else if (adapter->hw.mac.type == e1000_82574) { + } else if (hw.mac.type == e1000_82574) { for (int i = 0; i < adapter->rx_num_queues; i++) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); rxdctl |= 0x20; /* PTHRESH */ @@ -3325,7 +3319,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= 1 << 24; /* Switch to granularity */ E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (adapter->hw.mac.type >= igb_mac_min) { + } else if (hw.mac.type >= igb_mac_min) { u32 psize, srrctl = 0; if (if_getmtu(ifp) > ETHERMTU) { @@ -3341,7 +3335,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* are we on a vlan? */ if (ifp->if_vlantrunk != NULL) psize += VLAN_TAG_SIZE; - E1000_WRITE_REG(&adapter->hw, E1000_RLPML, psize); + E1000_WRITE_REG(hw, E1000_RLPML, psize); } else { srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT; rctl |= E1000_RCTL_SZ_2048; @@ -3387,7 +3381,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= IGB_RX_WTHRESH << 16; E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (adapter->hw.mac.type >= e1000_pch2lan) { + } else if (hw.mac.type >= e1000_pch2lan) { if (if_getmtu(ifp) > ETHERMTU) e1000_lv_jumbo_workaround_ich8lan(hw, TRUE); else @@ -3397,7 +3391,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; - if (adapter->hw.mac.type < igb_mac_min) { + if (hw.mac.type < igb_mac_min) { if (adapter->rx_mbuf_sz == MCLBYTES) rctl |= E1000_RCTL_SZ_2048; else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) @@ -3860,7 +3854,7 @@ em_enable_phy_wakeup(struct adapter *adapter) e1000_copy_rx_addrs_to_phy_ich8lan(hw); /* copy MAC MTA to PHY MTA */ - for (int i = 0; i < adapter->hw.mac.mta_reg_count; i++) { + for (int i = 0; i < hw.mac.mta_reg_count; i++) { mreg = E1000_READ_REG_ARRAY(hw, E1000_MTA, i); e1000_write_phy_reg(hw, BM_MTA(i), (u16)(mreg & 0xFFFF)); e1000_write_phy_reg(hw, BM_MTA(i) + 1, @@ -3868,7 +3862,7 @@ em_enable_phy_wakeup(struct adapter *adapter) } /* configure PHY Rx Control register */ - e1000_read_phy_reg(&adapter->hw, BM_RCTL, &preg); + e1000_read_phy_reg(hw, BM_RCTL, &preg); mreg = E1000_READ_REG(hw, E1000_RCTL); if (mreg & E1000_RCTL_UPE) preg |= BM_RCTL_UPE; @@ -3885,7 +3879,7 @@ em_enable_phy_wakeup(struct adapter *adapter) mreg = E1000_READ_REG(hw, E1000_CTRL); if (mreg & E1000_CTRL_RFCE) preg |= BM_RCTL_RFCE; - e1000_write_phy_reg(&adapter->hw, BM_RCTL, preg); + e1000_write_phy_reg(hw, BM_RCTL, preg); /* enable PHY wakeup in MAC register */ E1000_WRITE_REG(hw, E1000_WUC, @@ -3893,8 +3887,8 @@ em_enable_phy_wakeup(struct adapter *adapter) E1000_WRITE_REG(hw, E1000_WUFC, adapter->wol); /* configure and enable PHY wakeup in PHY registers */ - e1000_write_phy_reg(&adapter->hw, BM_WUFC, adapter->wol); - e1000_write_phy_reg(&adapter->hw, BM_WUC, E1000_WUC_PME_EN); + e1000_write_phy_reg(hw, BM_WUFC, adapter->wol); + e1000_write_phy_reg(hw, BM_WUC, E1000_WUC_PME_EN); /* activate PHY wakeup */ ret = hw->phy.ops.acquire(hw); From owner-dev-commits-src-all@freebsd.org Tue Aug 17 01:36:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 261CE6597E5; Tue, 17 Aug 2021 01:36:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpYXN0Lpvz4bxG; Tue, 17 Aug 2021 01:36:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E817E141E8; Tue, 17 Aug 2021 01:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H1aJZX095966; Tue, 17 Aug 2021 01:36:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H1aJRp095965; Tue, 17 Aug 2021 01:36:19 GMT (envelope-from git) Date: Tue, 17 Aug 2021 01:36:19 GMT Message-Id: <202108170136.17H1aJRp095965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5dd1d72e5b3b - stable/13 - e1000: fix build after b761f264926a (orig c1655b0f) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5dd1d72e5b3bbdcfdc70facc940f42cd036ad626 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 01:36:20 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5dd1d72e5b3bbdcfdc70facc940f42cd036ad626 commit 5dd1d72e5b3bbdcfdc70facc940f42cd036ad626 Author: Marius Strobl AuthorDate: 2021-01-27 14:28:25 +0000 Commit: Kevin Bowling CommitDate: 2021-08-17 01:31:43 +0000 e1000: fix build after b761f264926a (orig c1655b0f) (cherry picked from commit c262e8e87e7b59b768c717c1779ef1ba28507f44) --- sys/dev/e1000/if_em.c | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b2d563dbe796..52d20e57519a 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -837,7 +837,7 @@ em_if_attach_pre(if_ctx_t ctx) device_printf(dev, "attach_pre capping queues at %d\n", scctx->isc_ntxqsets_max); - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(union e1000_adv_tx_desc); @@ -849,7 +849,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities = scctx->isc_capenable = IGB_CAPS; scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP; - if (hw.mac.type != e1000_82575) + if (hw->mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; /* ** Some new devices, as with ixgbe, now may @@ -857,7 +857,7 @@ em_if_attach_pre(if_ctx_t ctx) ** track of which is used. */ scctx->isc_msix_bar = pci_msix_table_bar(dev); - } else if (hw.mac.type >= em_mac_min) { + } else if (hw->mac.type >= em_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); @@ -889,7 +889,7 @@ em_if_attach_pre(if_ctx_t ctx) * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. */ - if (hw.mac.type == e1000_82574) { + if (hw->mac.type == e1000_82574) { scctx->isc_msix_bar = pci_msix_table_bar(dev);; } else { scctx->isc_msix_bar = -1; @@ -903,7 +903,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; - if (hw.mac.type < e1000_82543) + if (hw->mac.type < e1000_82543) scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* INTx only */ scctx->isc_msix_bar = 0; @@ -996,7 +996,7 @@ em_if_attach_pre(if_ctx_t ctx) hw->phy.autoneg_wait_to_complete = FALSE; hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT; - if (hw.mac.type < em_mac_min) { + if (hw->mac.type < em_mac_min) { e1000_init_script_state_82541(hw, TRUE); e1000_set_tbi_compatibility_82543(hw, TRUE); } @@ -1011,7 +1011,7 @@ em_if_attach_pre(if_ctx_t ctx) * Set the frame limits assuming * standard ethernet sized frames. */ - scctx->isc_max_frame_size = hw.mac.max_frame_size = + scctx->isc_max_frame_size = hw->mac.max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE; /* @@ -1808,7 +1808,7 @@ em_if_update_admin_status(if_ctx_t ctx) break; case e1000_media_type_internal_serdes: e1000_check_for_link(hw); - link_check = hw.mac.serdes_has_link; + link_check = hw->mac.serdes_has_link; break; /* VF device is type_unknown */ case e1000_media_type_unknown: @@ -1856,7 +1856,7 @@ em_if_update_admin_status(if_ctx_t ctx) msec_delay(I210_LINK_DELAY); /* Reset if the media type changed. */ if (hw->dev_spec._82575.media_changed && - hw.mac.type >= igb_mac_min) { + hw->mac.type >= igb_mac_min) { hw->dev_spec._82575.media_changed = false; adapter->flags |= IGB_MEDIA_RESET; em_reset(ctx); @@ -2117,13 +2117,13 @@ igb_configure_queues(struct adapter *adapter) u32 tmp, ivar = 0, newitr = 0; /* First turn on RSS capability */ - if (hw.mac.type != e1000_82575) + if (hw->mac.type != e1000_82575) E1000_WRITE_REG(hw, E1000_GPIE, E1000_GPIE_MSIX_MODE | E1000_GPIE_EIAME | E1000_GPIE_PBA | E1000_GPIE_NSICR); /* Turn on MSI-X */ - switch (hw.mac.type) { + switch (hw->mac.type) { case e1000_82580: case e1000_i350: case e1000_i354: @@ -2531,7 +2531,7 @@ em_reset(if_ctx_t ctx) case e1000_ich9lan: case e1000_ich10lan: /* Boost Receive side for jumbo frames */ - if (hw.mac.max_frame_size > 4096) + if (hw->mac.max_frame_size > 4096) pba = E1000_PBA_14K; else pba = E1000_PBA_10K; @@ -2579,11 +2579,11 @@ em_reset(if_ctx_t ctx) pba = E1000_READ_REG(hw, E1000_PBA); tx_space = pba >> 16; pba &= 0xffff; - min_tx = (hw.mac.max_frame_size + + min_tx = (hw->mac.max_frame_size + sizeof(struct e1000_tx_desc) - ETHERNET_FCS_SIZE) * 2; min_tx = roundup2(min_tx, 1024); min_tx >>= 10; - min_rx = hw.mac.max_frame_size; + min_rx = hw->mac.max_frame_size; min_rx = roundup2(min_rx, 1024); min_rx >>= 10; if (tx_space < min_tx && @@ -2620,7 +2620,7 @@ em_reset(if_ctx_t ctx) */ rx_buffer_size = (pba & 0xffff) << 10; hw->fc.high_water = rx_buffer_size - - roundup2(hw.mac.max_frame_size, 1024); + roundup2(hw->mac.max_frame_size, 1024); hw->fc.low_water = hw->fc.high_water - 1500; if (adapter->fc) /* locally set flow control value? */ @@ -2698,7 +2698,7 @@ em_reset(if_ctx_t ctx) /* Issue a global reset */ e1000_reset_hw(hw); - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { E1000_WRITE_REG(hw, E1000_WUC, 0); } else { E1000_WRITE_REG(hw, E1000_WUFC, 0); @@ -2714,7 +2714,7 @@ em_reset(if_ctx_t ctx) device_printf(dev, "Hardware Initialization Failed\n"); return; } - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) igb_init_dmac(adapter, pba); E1000_WRITE_REG(hw, E1000_VET, ETHERTYPE_VLAN); @@ -2779,7 +2779,7 @@ igb_initialize_rss_mapping(struct adapter *adapter) u32 rss_key[10], mrqc, shift = 0; /* XXX? */ - if (hw.mac.type == e1000_82575) + if (hw->mac.type == e1000_82575) shift = 6; /* @@ -2888,11 +2888,11 @@ em_setup_interface(if_ctx_t ctx) * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - if (hw.phy.media_type == e1000_media_type_fiber || - hw.phy.media_type == e1000_media_type_internal_serdes) { + if (adapter->hw.phy.media_type == e1000_media_type_fiber || + adapter->hw.phy.media_type == e1000_media_type_internal_serdes) { u_char fiber_type = IFM_1000_SX; /* default type */ - if (hw.mac.type == e1000_82545) + if (adapter->hw.mac.type == e1000_82545) fiber_type = IFM_1000_LX; ifmedia_add(adapter->media, IFM_ETHER | fiber_type | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | fiber_type, 0, NULL); @@ -2901,7 +2901,7 @@ em_setup_interface(if_ctx_t ctx) ifmedia_add(adapter->media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); - if (hw.phy.type != e1000_phy_ife) { + if (adapter->hw.phy.type != e1000_phy_ife) { ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T, 0, NULL); } @@ -3085,7 +3085,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) } /* Set the default values for the Tx Inter Packet Gap timer */ - switch (hw.mac.type) { + switch (hw->mac.type) { case e1000_80003es2lan: tipg = DEFAULT_82543_TIPG_IPGR1; tipg |= DEFAULT_80003ES2LAN_TIPG_IPGR2 << @@ -3097,8 +3097,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; break; default: - if (hw.phy.media_type == e1000_media_type_fiber || - hw.phy.media_type == e1000_media_type_internal_serdes) + if (hw->phy.media_type == e1000_media_type_fiber || + hw->phy.media_type == e1000_media_type_internal_serdes) tipg = DEFAULT_82543_TIPG_IPGT_FIBER; else tipg = DEFAULT_82543_TIPG_IPGT_COPPER; @@ -3109,15 +3109,15 @@ em_initialize_transmit_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_TIPG, tipg); E1000_WRITE_REG(hw, E1000_TIDV, adapter->tx_int_delay.value); - if(hw.mac.type >= e1000_82540) + if(hw->mac.type >= e1000_82540) E1000_WRITE_REG(hw, E1000_TADV, adapter->tx_abs_int_delay.value); - if (hw.mac.type == e1000_82571 || hw.mac.type == e1000_82572) { + if (hw->mac.type == e1000_82571 || hw->mac.type == e1000_82572) { tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_SPEED_MODE_BIT; E1000_WRITE_REG(hw, E1000_TARC(0), tarc); - } else if (hw.mac.type == e1000_80003es2lan) { + } else if (hw->mac.type == e1000_80003es2lan) { /* errata: program both queues to unweighted RR */ tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= 1; @@ -3125,7 +3125,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) tarc = E1000_READ_REG(hw, E1000_TARC(1)); tarc |= 1; E1000_WRITE_REG(hw, E1000_TARC(1), tarc); - } else if (hw.mac.type == e1000_82574) { + } else if (hw->mac.type == e1000_82574) { tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_ERRATA_BIT; if ( adapter->tx_num_queues > 1) { @@ -3145,7 +3145,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); - if (hw.mac.type >= e1000_82571) + if (hw->mac.type >= e1000_82571) tctl |= E1000_TCTL_MULR; /* This write will effectively turn on the transmit unit. */ @@ -3212,7 +3212,7 @@ em_initialize_receive_unit(if_ctx_t ctx) if (!em_disable_crc_stripping) rctl |= E1000_RCTL_SECRC; - if (hw.mac.type >= e1000_82540) { + if (hw->mac.type >= e1000_82540) { E1000_WRITE_REG(hw, E1000_RADV, adapter->rx_abs_int_delay.value); @@ -3242,9 +3242,9 @@ em_initialize_receive_unit(if_ctx_t ctx) rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM && - hw.mac.type >= e1000_82543) { + hw->mac.type >= e1000_82543) { if (adapter->tx_num_queues > 1) { - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { rxcsum |= E1000_RXCSUM_PCSD; if (hw->mac.type != e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; @@ -3253,11 +3253,11 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_RXCSUM_IPOFL | E1000_RXCSUM_PCSD; } else { - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) rxcsum |= E1000_RXCSUM_IPPCSE; else rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL; - if (hw.mac.type > e1000_82575) + if (hw->mac.type > e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; } } else @@ -3266,7 +3266,7 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); if (adapter->rx_num_queues > 1) { - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) igb_initialize_rss_mapping(adapter); else em_initialize_rss_mapping(adapter); @@ -3306,11 +3306,11 @@ em_initialize_receive_unit(if_ctx_t ctx) * Only write to RXDCTL(1) if there is a need for different * settings. */ - if ((hw.mac.type == e1000_ich9lan || hw.mac.type == e1000_pch2lan || - hw.mac.type == e1000_ich10lan) && (if_getmtu(ifp) > ETHERMTU)) { + if ((hw->mac.type == e1000_ich9lan || hw->mac.type == e1000_pch2lan || + hw->mac.type == e1000_ich10lan) && if_getmtu(ifp) > ETHERMTU) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); - } else if (hw.mac.type == e1000_82574) { + } else if (hw->mac.type == e1000_82574) { for (int i = 0; i < adapter->rx_num_queues; i++) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); rxdctl |= 0x20; /* PTHRESH */ @@ -3319,7 +3319,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= 1 << 24; /* Switch to granularity */ E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (hw.mac.type >= igb_mac_min) { + } else if (hw->mac.type >= igb_mac_min) { u32 psize, srrctl = 0; if (if_getmtu(ifp) > ETHERMTU) { @@ -3381,7 +3381,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= IGB_RX_WTHRESH << 16; E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (hw.mac.type >= e1000_pch2lan) { + } else if (hw->mac.type >= e1000_pch2lan) { if (if_getmtu(ifp) > ETHERMTU) e1000_lv_jumbo_workaround_ich8lan(hw, TRUE); else @@ -3391,7 +3391,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; - if (hw.mac.type < igb_mac_min) { + if (hw->mac.type < igb_mac_min) { if (adapter->rx_mbuf_sz == MCLBYTES) rctl |= E1000_RCTL_SZ_2048; else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) @@ -3854,7 +3854,7 @@ em_enable_phy_wakeup(struct adapter *adapter) e1000_copy_rx_addrs_to_phy_ich8lan(hw); /* copy MAC MTA to PHY MTA */ - for (int i = 0; i < hw.mac.mta_reg_count; i++) { + for (int i = 0; i < hw->mac.mta_reg_count; i++) { mreg = E1000_READ_REG_ARRAY(hw, E1000_MTA, i); e1000_write_phy_reg(hw, BM_MTA(i), (u16)(mreg & 0xFFFF)); e1000_write_phy_reg(hw, BM_MTA(i) + 1, From owner-dev-commits-src-all@freebsd.org Tue Aug 17 01:36:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5334B659BC4; Tue, 17 Aug 2021 01:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpYXP1cr9z4cB9; Tue, 17 Aug 2021 01:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19690141E9; Tue, 17 Aug 2021 01:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H1aKkw095990; Tue, 17 Aug 2021 01:36:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H1aKBh095989; Tue, 17 Aug 2021 01:36:20 GMT (envelope-from git) Date: Tue, 17 Aug 2021 01:36:20 GMT Message-Id: <202108170136.17H1aKBh095989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 15b57cbfde4d - stable/13 - e1000: rctl/srrctl buffer size init, rfctl fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 15b57cbfde4d5b5933d9280c4b718dd1f2c9f27c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 01:36:21 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=15b57cbfde4d5b5933d9280c4b718dd1f2c9f27c commit 15b57cbfde4d5b5933d9280c4b718dd1f2c9f27c Author: Kevin Bowling AuthorDate: 2021-08-10 19:47:22 +0000 Commit: Kevin Bowling CommitDate: 2021-08-17 01:35:04 +0000 e1000: rctl/srrctl buffer size init, rfctl fix Simplify the setup of srrctl.BSIZEPKT on igb class NICs. Improve the setup of rctl.BSIZE on lem and em class NICs. Don't try to touch rfctl on lem class NICs. Manipulate rctl.BSEX correctly on lem and em class NICs. Approved by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31457 (cherry picked from commit 12e8addd320df995bfb2b00f51c233541f741ae4) --- sys/dev/e1000/if_em.c | 76 +++++++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 52d20e57519a..33d5341ed8ce 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3170,6 +3170,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) * Enable receive unit. * **********************************************************************/ +#define BSIZEPKT_ROUNDUP ((1<hw; struct em_rx_queue *que; int i; - u32 rctl, rxcsum, rfctl; + uint32_t rctl, rxcsum; INIT_DEBUGOUT("em_initialize_receive_units: begin"); @@ -3224,21 +3225,25 @@ em_initialize_receive_unit(if_ctx_t ctx) } E1000_WRITE_REG(hw, E1000_RDTR, adapter->rx_int_delay.value); - /* Use extended rx descriptor formats */ - rfctl = E1000_READ_REG(hw, E1000_RFCTL); - rfctl |= E1000_RFCTL_EXTEN; - /* - * When using MSI-X interrupts we need to throttle - * using the EITR register (82574 only) - */ - if (hw->mac.type == e1000_82574) { - for (int i = 0; i < 4; i++) - E1000_WRITE_REG(hw, E1000_EITR_82574(i), - DEFAULT_ITR); - /* Disable accelerated acknowledge */ - rfctl |= E1000_RFCTL_ACK_DIS; + if (hw->mac.type >= em_mac_min) { + uint32_t rfctl; + /* Use extended rx descriptor formats */ + rfctl = E1000_READ_REG(hw, E1000_RFCTL); + rfctl |= E1000_RFCTL_EXTEN; + + /* + * When using MSI-X interrupts we need to throttle + * using the EITR register (82574 only) + */ + if (hw->mac.type == e1000_82574) { + for (int i = 0; i < 4; i++) + E1000_WRITE_REG(hw, E1000_EITR_82574(i), + DEFAULT_ITR); + /* Disable accelerated acknowledge */ + rfctl |= E1000_RFCTL_ACK_DIS; + } + E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); } - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM && @@ -3323,24 +3328,17 @@ em_initialize_receive_unit(if_ctx_t ctx) u32 psize, srrctl = 0; if (if_getmtu(ifp) > ETHERMTU) { - /* Set maximum packet len */ - if (adapter->rx_mbuf_sz <= 4096) { - srrctl |= 4096 >> E1000_SRRCTL_BSIZEPKT_SHIFT; - rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX; - } else if (adapter->rx_mbuf_sz > 4096) { - srrctl |= 8192 >> E1000_SRRCTL_BSIZEPKT_SHIFT; - rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; - } psize = scctx->isc_max_frame_size; /* are we on a vlan? */ if (ifp->if_vlantrunk != NULL) psize += VLAN_TAG_SIZE; E1000_WRITE_REG(hw, E1000_RLPML, psize); - } else { - srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT; - rctl |= E1000_RCTL_SZ_2048; } + /* Set maximum packet buffer len */ + srrctl |= (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> + E1000_SRRCTL_BSIZEPKT_SHIFT; + /* * If TX flow control is disabled and there's >1 queue defined, * enable DROP. @@ -3391,17 +3389,29 @@ em_initialize_receive_unit(if_ctx_t ctx) /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; + /* Set up packet buffer size, overridden by per queue srrctl on igb */ if (hw->mac.type < igb_mac_min) { - if (adapter->rx_mbuf_sz == MCLBYTES) - rctl |= E1000_RCTL_SZ_2048; - else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) + if (adapter->rx_mbuf_sz > 2048 && adapter->rx_mbuf_sz <= 4096) rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX; - else if (adapter->rx_mbuf_sz > MJUMPAGESIZE) + else if (adapter->rx_mbuf_sz > 4096 && adapter->rx_mbuf_sz <= 8192) rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; + else if (adapter->rx_mbuf_sz > 8192) + rctl |= E1000_RCTL_SZ_16384 | E1000_RCTL_BSEX; + else { + rctl |= E1000_RCTL_SZ_2048; + rctl &= ~E1000_RCTL_BSEX; + } + } else + rctl |= E1000_RCTL_SZ_2048; - /* ensure we clear use DTYPE of 00 here */ - rctl &= ~0x00000C00; - } + /* + * rctl bits 11:10 are as follows + * lem: reserved + * em: DTYPE + * igb: reserved + * and should be 00 on all of the above + */ + rctl &= ~0x00000C00; /* Write out the settings */ E1000_WRITE_REG(hw, E1000_RCTL, rctl); From owner-dev-commits-src-all@freebsd.org Tue Aug 17 01:56:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65C5D65A319; Tue, 17 Aug 2021 01:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpYzk2Pgyz4fC2; Tue, 17 Aug 2021 01:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AACF14AF2; Tue, 17 Aug 2021 01:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H1uY3s022704; Tue, 17 Aug 2021 01:56:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H1uYke022703; Tue, 17 Aug 2021 01:56:34 GMT (envelope-from git) Date: Tue, 17 Aug 2021 01:56:34 GMT Message-Id: <202108170156.17H1uYke022703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 35fa46ffd17e - stable/12 - e1000: consistently use the hw variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 35fa46ffd17e9b9c424b822e235c5db0ae5d21b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 01:56:34 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=35fa46ffd17e9b9c424b822e235c5db0ae5d21b3 commit 35fa46ffd17e9b9c424b822e235c5db0ae5d21b3 Author: Marius Strobl AuthorDate: 2021-01-23 18:18:28 +0000 Commit: Kevin Bowling CommitDate: 2021-08-17 01:56:20 +0000 e1000: consistently use the hw variables It's rather confusing when adapter->hw and hw are mixed and matched within a particular function. Some of this was missed in cd1cf2fc1d49c509ded05dcd41b7600a5957fb9a and r353778 respectively. (cherry picked from commit c1655b0f8998f9e842a004f33e7c9c01c5d9e879) --- sys/dev/e1000/if_em.c | 152 ++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 79 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index afafeed7602f..eeb52de497a9 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -838,7 +838,7 @@ em_if_attach_pre(if_ctx_t ctx) device_printf(dev, "attach_pre capping queues at %d\n", scctx->isc_ntxqsets_max); - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(union e1000_adv_tx_desc); @@ -850,7 +850,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities = scctx->isc_capenable = IGB_CAPS; scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP; - if (adapter->hw.mac.type != e1000_82575) + if (hw.mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; /* ** Some new devices, as with ixgbe, now may @@ -860,7 +860,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_msix_bar = PCIR_BAR(EM_MSIX_BAR); if (pci_read_config(dev, scctx->isc_msix_bar, 4) == 0) scctx->isc_msix_bar += 4; - } else if (adapter->hw.mac.type >= em_mac_min) { + } else if (hw.mac.type >= em_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); @@ -892,7 +892,7 @@ em_if_attach_pre(if_ctx_t ctx) * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. */ - if (adapter->hw.mac.type == e1000_82574) { + if (hw.mac.type == e1000_82574) { scctx->isc_msix_bar = PCIR_BAR(EM_MSIX_BAR); } else { scctx->isc_msix_bar = -1; @@ -906,7 +906,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; - if (adapter->hw.mac.type < e1000_82543) + if (hw.mac.type < e1000_82543) scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* INTx only */ scctx->isc_msix_bar = 0; @@ -999,9 +999,9 @@ em_if_attach_pre(if_ctx_t ctx) hw->phy.autoneg_wait_to_complete = FALSE; hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT; - if (adapter->hw.mac.type < em_mac_min) { - e1000_init_script_state_82541(&adapter->hw, TRUE); - e1000_set_tbi_compatibility_82543(&adapter->hw, TRUE); + if (hw.mac.type < em_mac_min) { + e1000_init_script_state_82541(hw, TRUE); + e1000_set_tbi_compatibility_82543(hw, TRUE); } /* Copper options */ if (hw->phy.media_type == e1000_media_type_copper) { @@ -1014,7 +1014,7 @@ em_if_attach_pre(if_ctx_t ctx) * Set the frame limits assuming * standard ethernet sized frames. */ - scctx->isc_max_frame_size = adapter->hw.mac.max_frame_size = + scctx->isc_max_frame_size = hw.mac.max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE; /* @@ -1224,7 +1224,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) struct adapter *adapter = iflib_get_softc(ctx); if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx); - IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); + IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); switch (adapter->hw.mac.type) { case e1000_82571: @@ -1798,7 +1798,7 @@ em_if_update_admin_status(if_ctx_t ctx) break; case e1000_media_type_internal_serdes: e1000_check_for_link(hw); - link_check = adapter->hw.mac.serdes_has_link; + link_check = hw.mac.serdes_has_link; break; /* VF device is type_unknown */ case e1000_media_type_unknown: @@ -1845,8 +1845,8 @@ em_if_update_admin_status(if_ctx_t ctx) (hw->phy.id == I210_I_PHY_ID)) msec_delay(I210_LINK_DELAY); /* Reset if the media type changed. */ - if ((hw->dev_spec._82575.media_changed) && - (adapter->hw.mac.type >= igb_mac_min)) { + if (hw->dev_spec._82575.media_changed && + hw.mac.type >= igb_mac_min) { hw->dev_spec._82575.media_changed = false; adapter->flags |= IGB_MEDIA_RESET; em_reset(ctx); @@ -2107,13 +2107,13 @@ igb_configure_queues(struct adapter *adapter) u32 tmp, ivar = 0, newitr = 0; /* First turn on RSS capability */ - if (adapter->hw.mac.type != e1000_82575) + if (hw.mac.type != e1000_82575) E1000_WRITE_REG(hw, E1000_GPIE, E1000_GPIE_MSIX_MODE | E1000_GPIE_EIAME | E1000_GPIE_PBA | E1000_GPIE_NSICR); /* Turn on MSI-X */ - switch (adapter->hw.mac.type) { + switch (hw.mac.type) { case e1000_82580: case e1000_i350: case e1000_i354: @@ -2521,7 +2521,7 @@ em_reset(if_ctx_t ctx) case e1000_ich9lan: case e1000_ich10lan: /* Boost Receive side for jumbo frames */ - if (adapter->hw.mac.max_frame_size > 4096) + if (hw.mac.max_frame_size > 4096) pba = E1000_PBA_14K; else pba = E1000_PBA_10K; @@ -2569,11 +2569,11 @@ em_reset(if_ctx_t ctx) pba = E1000_READ_REG(hw, E1000_PBA); tx_space = pba >> 16; pba &= 0xffff; - min_tx = (adapter->hw.mac.max_frame_size + + min_tx = (hw.mac.max_frame_size + sizeof(struct e1000_tx_desc) - ETHERNET_FCS_SIZE) * 2; min_tx = roundup2(min_tx, 1024); min_tx >>= 10; - min_rx = adapter->hw.mac.max_frame_size; + min_rx = hw.mac.max_frame_size; min_rx = roundup2(min_rx, 1024); min_rx >>= 10; if (tx_space < min_tx && @@ -2590,7 +2590,7 @@ em_reset(if_ctx_t ctx) } if (hw->mac.type < igb_mac_min) - E1000_WRITE_REG(&adapter->hw, E1000_PBA, pba); + E1000_WRITE_REG(hw, E1000_PBA, pba); INIT_DEBUGOUT1("em_reset: pba=%dK",pba); @@ -2610,7 +2610,7 @@ em_reset(if_ctx_t ctx) */ rx_buffer_size = (pba & 0xffff) << 10; hw->fc.high_water = rx_buffer_size - - roundup2(adapter->hw.mac.max_frame_size, 1024); + roundup2(hw.mac.max_frame_size, 1024); hw->fc.low_water = hw->fc.high_water - 1500; if (adapter->fc) /* locally set flow control value? */ @@ -2688,7 +2688,7 @@ em_reset(if_ctx_t ctx) /* Issue a global reset */ e1000_reset_hw(hw); - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { E1000_WRITE_REG(hw, E1000_WUC, 0); } else { E1000_WRITE_REG(hw, E1000_WUFC, 0); @@ -2704,7 +2704,7 @@ em_reset(if_ctx_t ctx) device_printf(dev, "Hardware Initialization Failed\n"); return; } - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) igb_init_dmac(adapter, pba); E1000_WRITE_REG(hw, E1000_VET, ETHERTYPE_VLAN); @@ -2769,7 +2769,7 @@ igb_initialize_rss_mapping(struct adapter *adapter) u32 rss_key[10], mrqc, shift = 0; /* XXX? */ - if (adapter->hw.mac.type == e1000_82575) + if (hw.mac.type == e1000_82575) shift = 6; /* @@ -2878,11 +2878,11 @@ em_setup_interface(if_ctx_t ctx) * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || - (adapter->hw.phy.media_type == e1000_media_type_internal_serdes)) { + if (hw.phy.media_type == e1000_media_type_fiber || + hw.phy.media_type == e1000_media_type_internal_serdes) { u_char fiber_type = IFM_1000_SX; /* default type */ - if (adapter->hw.mac.type == e1000_82545) + if (hw.mac.type == e1000_82545) fiber_type = IFM_1000_LX; ifmedia_add(adapter->media, IFM_ETHER | fiber_type | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | fiber_type, 0, NULL); @@ -2891,7 +2891,7 @@ em_setup_interface(if_ctx_t ctx) ifmedia_add(adapter->media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); - if (adapter->hw.phy.type != e1000_phy_ife) { + if (hw.phy.type != e1000_phy_ife) { ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T, 0, NULL); } @@ -3066,8 +3066,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_TDH(i), 0); HW_DEBUGOUT2("Base = %x, Length = %x\n", - E1000_READ_REG(&adapter->hw, E1000_TDBAL(i)), - E1000_READ_REG(&adapter->hw, E1000_TDLEN(i))); + E1000_READ_REG(hw, E1000_TDBAL(i)), + E1000_READ_REG(hw, E1000_TDLEN(i))); txdctl = 0; /* clear txdctl */ txdctl |= 0x1f; /* PTHRESH */ @@ -3081,7 +3081,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) } /* Set the default values for the Tx Inter Packet Gap timer */ - switch (adapter->hw.mac.type) { + switch (hw.mac.type) { case e1000_80003es2lan: tipg = DEFAULT_82543_TIPG_IPGR1; tipg |= DEFAULT_80003ES2LAN_TIPG_IPGR2 << @@ -3093,9 +3093,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; break; default: - if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || - (adapter->hw.phy.media_type == - e1000_media_type_internal_serdes)) + if (hw.phy.media_type == e1000_media_type_fiber || + hw.phy.media_type == e1000_media_type_internal_serdes) tipg = DEFAULT_82543_TIPG_IPGT_FIBER; else tipg = DEFAULT_82543_TIPG_IPGT_COPPER; @@ -3103,51 +3102,50 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; } - E1000_WRITE_REG(&adapter->hw, E1000_TIPG, tipg); - E1000_WRITE_REG(&adapter->hw, E1000_TIDV, adapter->tx_int_delay.value); + E1000_WRITE_REG(hw, E1000_TIPG, tipg); + E1000_WRITE_REG(hw, E1000_TIDV, adapter->tx_int_delay.value); - if(adapter->hw.mac.type >= e1000_82540) - E1000_WRITE_REG(&adapter->hw, E1000_TADV, + if(hw.mac.type >= e1000_82540) + E1000_WRITE_REG(hw, E1000_TADV, adapter->tx_abs_int_delay.value); - if ((adapter->hw.mac.type == e1000_82571) || - (adapter->hw.mac.type == e1000_82572)) { - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + if (hw.mac.type == e1000_82571 || hw.mac.type == e1000_82572) { + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_SPEED_MODE_BIT; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - } else if (adapter->hw.mac.type == e1000_80003es2lan) { + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + } else if (hw.mac.type == e1000_80003es2lan) { /* errata: program both queues to unweighted RR */ - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= 1; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(1)); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + tarc = E1000_READ_REG(hw, E1000_TARC(1)); tarc |= 1; - E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc); - } else if (adapter->hw.mac.type == e1000_82574) { - tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0)); + E1000_WRITE_REG(hw, E1000_TARC(1), tarc); + } else if (hw.mac.type == e1000_82574) { + tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_ERRATA_BIT; if ( adapter->tx_num_queues > 1) { tarc |= (TARC_COMPENSATION_MODE | TARC_MQ_FIX); - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); - E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); + E1000_WRITE_REG(hw, E1000_TARC(1), tarc); } else - E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc); + E1000_WRITE_REG(hw, E1000_TARC(0), tarc); } if (adapter->tx_int_delay.value > 0) adapter->txd_cmd |= E1000_TXD_CMD_IDE; /* Program the Transmit Control Register */ - tctl = E1000_READ_REG(&adapter->hw, E1000_TCTL); + tctl = E1000_READ_REG(hw, E1000_TCTL); tctl &= ~E1000_TCTL_CT; tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); - if (adapter->hw.mac.type >= e1000_82571) + if (hw.mac.type >= e1000_82571) tctl |= E1000_TCTL_MULR; /* This write will effectively turn on the transmit unit. */ - E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); + E1000_WRITE_REG(hw, E1000_TCTL, tctl); /* SPT and KBL errata workarounds */ if (hw->mac.type == e1000_pch_spt) { @@ -3210,9 +3208,9 @@ em_initialize_receive_unit(if_ctx_t ctx) if (!em_disable_crc_stripping) rctl |= E1000_RCTL_SECRC; - if (adapter->hw.mac.type >= e1000_82540) { - E1000_WRITE_REG(&adapter->hw, E1000_RADV, - adapter->rx_abs_int_delay.value); + if (hw.mac.type >= e1000_82540) { + E1000_WRITE_REG(hw, E1000_RADV, + adapter->rx_abs_int_delay.value); /* * Set the interrupt throttling rate. Value is calculated @@ -3220,8 +3218,7 @@ em_initialize_receive_unit(if_ctx_t ctx) */ E1000_WRITE_REG(hw, E1000_ITR, DEFAULT_ITR); } - E1000_WRITE_REG(&adapter->hw, E1000_RDTR, - adapter->rx_int_delay.value); + E1000_WRITE_REG(hw, E1000_RDTR, adapter->rx_int_delay.value); /* Use extended rx descriptor formats */ rfctl = E1000_READ_REG(hw, E1000_RFCTL); @@ -3241,9 +3238,9 @@ em_initialize_receive_unit(if_ctx_t ctx) rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM && - adapter->hw.mac.type >= e1000_82543) { + hw.mac.type >= e1000_82543) { if (adapter->tx_num_queues > 1) { - if (adapter->hw.mac.type >= igb_mac_min) { + if (hw.mac.type >= igb_mac_min) { rxcsum |= E1000_RXCSUM_PCSD; if (hw->mac.type != e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; @@ -3252,11 +3249,11 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_RXCSUM_IPOFL | E1000_RXCSUM_PCSD; } else { - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) rxcsum |= E1000_RXCSUM_IPPCSE; else rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL; - if (adapter->hw.mac.type > e1000_82575) + if (hw.mac.type > e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; } } else @@ -3265,7 +3262,7 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); if (adapter->rx_num_queues > 1) { - if (adapter->hw.mac.type >= igb_mac_min) + if (hw.mac.type >= igb_mac_min) igb_initialize_rss_mapping(adapter); else em_initialize_rss_mapping(adapter); @@ -3305,14 +3302,11 @@ em_initialize_receive_unit(if_ctx_t ctx) * Only write to RXDCTL(1) if there is a need for different * settings. */ - - if (((adapter->hw.mac.type == e1000_ich9lan) || - (adapter->hw.mac.type == e1000_pch2lan) || - (adapter->hw.mac.type == e1000_ich10lan)) && - (if_getmtu(ifp) > ETHERMTU)) { + if ((hw.mac.type == e1000_ich9lan || hw.mac.type == e1000_pch2lan || + hw.mac.type == e1000_ich10lan) && (if_getmtu(ifp) > ETHERMTU)) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); - } else if (adapter->hw.mac.type == e1000_82574) { + } else if (hw.mac.type == e1000_82574) { for (int i = 0; i < adapter->rx_num_queues; i++) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); rxdctl |= 0x20; /* PTHRESH */ @@ -3321,7 +3315,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= 1 << 24; /* Switch to granularity */ E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (adapter->hw.mac.type >= igb_mac_min) { + } else if (hw.mac.type >= igb_mac_min) { u32 psize, srrctl = 0; if (if_getmtu(ifp) > ETHERMTU) { @@ -3337,7 +3331,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* are we on a vlan? */ if (ifp->if_vlantrunk != NULL) psize += VLAN_TAG_SIZE; - E1000_WRITE_REG(&adapter->hw, E1000_RLPML, psize); + E1000_WRITE_REG(hw, E1000_RLPML, psize); } else { srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT; rctl |= E1000_RCTL_SZ_2048; @@ -3383,7 +3377,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= IGB_RX_WTHRESH << 16; E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (adapter->hw.mac.type >= e1000_pch2lan) { + } else if (hw.mac.type >= e1000_pch2lan) { if (if_getmtu(ifp) > ETHERMTU) e1000_lv_jumbo_workaround_ich8lan(hw, TRUE); else @@ -3393,7 +3387,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; - if (adapter->hw.mac.type < igb_mac_min) { + if (hw.mac.type < igb_mac_min) { if (adapter->rx_mbuf_sz == MCLBYTES) rctl |= E1000_RCTL_SZ_2048; else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) @@ -3856,7 +3850,7 @@ em_enable_phy_wakeup(struct adapter *adapter) e1000_copy_rx_addrs_to_phy_ich8lan(hw); /* copy MAC MTA to PHY MTA */ - for (int i = 0; i < adapter->hw.mac.mta_reg_count; i++) { + for (int i = 0; i < hw.mac.mta_reg_count; i++) { mreg = E1000_READ_REG_ARRAY(hw, E1000_MTA, i); e1000_write_phy_reg(hw, BM_MTA(i), (u16)(mreg & 0xFFFF)); e1000_write_phy_reg(hw, BM_MTA(i) + 1, @@ -3864,7 +3858,7 @@ em_enable_phy_wakeup(struct adapter *adapter) } /* configure PHY Rx Control register */ - e1000_read_phy_reg(&adapter->hw, BM_RCTL, &preg); + e1000_read_phy_reg(hw, BM_RCTL, &preg); mreg = E1000_READ_REG(hw, E1000_RCTL); if (mreg & E1000_RCTL_UPE) preg |= BM_RCTL_UPE; @@ -3881,7 +3875,7 @@ em_enable_phy_wakeup(struct adapter *adapter) mreg = E1000_READ_REG(hw, E1000_CTRL); if (mreg & E1000_CTRL_RFCE) preg |= BM_RCTL_RFCE; - e1000_write_phy_reg(&adapter->hw, BM_RCTL, preg); + e1000_write_phy_reg(hw, BM_RCTL, preg); /* enable PHY wakeup in MAC register */ E1000_WRITE_REG(hw, E1000_WUC, @@ -3889,8 +3883,8 @@ em_enable_phy_wakeup(struct adapter *adapter) E1000_WRITE_REG(hw, E1000_WUFC, adapter->wol); /* configure and enable PHY wakeup in PHY registers */ - e1000_write_phy_reg(&adapter->hw, BM_WUFC, adapter->wol); - e1000_write_phy_reg(&adapter->hw, BM_WUC, E1000_WUC_PME_EN); + e1000_write_phy_reg(hw, BM_WUFC, adapter->wol); + e1000_write_phy_reg(hw, BM_WUC, E1000_WUC_PME_EN); /* activate PHY wakeup */ ret = hw->phy.ops.acquire(hw); From owner-dev-commits-src-all@freebsd.org Tue Aug 17 01:56:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAEEF659E71; Tue, 17 Aug 2021 01:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpYzl3fJDz4fLM; Tue, 17 Aug 2021 01:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57104147DB; Tue, 17 Aug 2021 01:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H1uZcc022728; Tue, 17 Aug 2021 01:56:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H1uZmg022727; Tue, 17 Aug 2021 01:56:35 GMT (envelope-from git) Date: Tue, 17 Aug 2021 01:56:35 GMT Message-Id: <202108170156.17H1uZmg022727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: ded3123049a5 - stable/12 - e1000: fix build after 92804cf3dc48 (orig c1655b0f) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ded3123049a592ec1f9c5b757e3f0f98f104d6cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 01:56:36 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ded3123049a592ec1f9c5b757e3f0f98f104d6cf commit ded3123049a592ec1f9c5b757e3f0f98f104d6cf Author: Marius Strobl AuthorDate: 2021-01-27 14:28:25 +0000 Commit: Kevin Bowling CommitDate: 2021-08-17 01:56:20 +0000 e1000: fix build after 92804cf3dc48 (orig c1655b0f) (cherry picked from commit c262e8e87e7b59b768c717c1779ef1ba28507f44) --- sys/dev/e1000/if_em.c | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index eeb52de497a9..bcf7e0e9ec56 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -838,7 +838,7 @@ em_if_attach_pre(if_ctx_t ctx) device_printf(dev, "attach_pre capping queues at %d\n", scctx->isc_ntxqsets_max); - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union e1000_adv_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_adv_rx_desc), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(union e1000_adv_tx_desc); @@ -850,7 +850,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities = scctx->isc_capenable = IGB_CAPS; scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP; - if (hw.mac.type != e1000_82575) + if (hw->mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; /* ** Some new devices, as with ixgbe, now may @@ -860,7 +860,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_msix_bar = PCIR_BAR(EM_MSIX_BAR); if (pci_read_config(dev, scctx->isc_msix_bar, 4) == 0) scctx->isc_msix_bar += 4; - } else if (hw.mac.type >= em_mac_min) { + } else if (hw->mac.type >= em_mac_min) { scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0]* sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); @@ -892,7 +892,7 @@ em_if_attach_pre(if_ctx_t ctx) * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. */ - if (hw.mac.type == e1000_82574) { + if (hw->mac.type == e1000_82574) { scctx->isc_msix_bar = PCIR_BAR(EM_MSIX_BAR); } else { scctx->isc_msix_bar = -1; @@ -906,7 +906,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; - if (hw.mac.type < e1000_82543) + if (hw->mac.type < e1000_82543) scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* INTx only */ scctx->isc_msix_bar = 0; @@ -999,7 +999,7 @@ em_if_attach_pre(if_ctx_t ctx) hw->phy.autoneg_wait_to_complete = FALSE; hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT; - if (hw.mac.type < em_mac_min) { + if (hw->mac.type < em_mac_min) { e1000_init_script_state_82541(hw, TRUE); e1000_set_tbi_compatibility_82543(hw, TRUE); } @@ -1014,7 +1014,7 @@ em_if_attach_pre(if_ctx_t ctx) * Set the frame limits assuming * standard ethernet sized frames. */ - scctx->isc_max_frame_size = hw.mac.max_frame_size = + scctx->isc_max_frame_size = hw->mac.max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE; /* @@ -1798,7 +1798,7 @@ em_if_update_admin_status(if_ctx_t ctx) break; case e1000_media_type_internal_serdes: e1000_check_for_link(hw); - link_check = hw.mac.serdes_has_link; + link_check = hw->mac.serdes_has_link; break; /* VF device is type_unknown */ case e1000_media_type_unknown: @@ -1846,7 +1846,7 @@ em_if_update_admin_status(if_ctx_t ctx) msec_delay(I210_LINK_DELAY); /* Reset if the media type changed. */ if (hw->dev_spec._82575.media_changed && - hw.mac.type >= igb_mac_min) { + hw->mac.type >= igb_mac_min) { hw->dev_spec._82575.media_changed = false; adapter->flags |= IGB_MEDIA_RESET; em_reset(ctx); @@ -2107,13 +2107,13 @@ igb_configure_queues(struct adapter *adapter) u32 tmp, ivar = 0, newitr = 0; /* First turn on RSS capability */ - if (hw.mac.type != e1000_82575) + if (hw->mac.type != e1000_82575) E1000_WRITE_REG(hw, E1000_GPIE, E1000_GPIE_MSIX_MODE | E1000_GPIE_EIAME | E1000_GPIE_PBA | E1000_GPIE_NSICR); /* Turn on MSI-X */ - switch (hw.mac.type) { + switch (hw->mac.type) { case e1000_82580: case e1000_i350: case e1000_i354: @@ -2521,7 +2521,7 @@ em_reset(if_ctx_t ctx) case e1000_ich9lan: case e1000_ich10lan: /* Boost Receive side for jumbo frames */ - if (hw.mac.max_frame_size > 4096) + if (hw->mac.max_frame_size > 4096) pba = E1000_PBA_14K; else pba = E1000_PBA_10K; @@ -2569,11 +2569,11 @@ em_reset(if_ctx_t ctx) pba = E1000_READ_REG(hw, E1000_PBA); tx_space = pba >> 16; pba &= 0xffff; - min_tx = (hw.mac.max_frame_size + + min_tx = (hw->mac.max_frame_size + sizeof(struct e1000_tx_desc) - ETHERNET_FCS_SIZE) * 2; min_tx = roundup2(min_tx, 1024); min_tx >>= 10; - min_rx = hw.mac.max_frame_size; + min_rx = hw->mac.max_frame_size; min_rx = roundup2(min_rx, 1024); min_rx >>= 10; if (tx_space < min_tx && @@ -2610,7 +2610,7 @@ em_reset(if_ctx_t ctx) */ rx_buffer_size = (pba & 0xffff) << 10; hw->fc.high_water = rx_buffer_size - - roundup2(hw.mac.max_frame_size, 1024); + roundup2(hw->mac.max_frame_size, 1024); hw->fc.low_water = hw->fc.high_water - 1500; if (adapter->fc) /* locally set flow control value? */ @@ -2688,7 +2688,7 @@ em_reset(if_ctx_t ctx) /* Issue a global reset */ e1000_reset_hw(hw); - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { E1000_WRITE_REG(hw, E1000_WUC, 0); } else { E1000_WRITE_REG(hw, E1000_WUFC, 0); @@ -2704,7 +2704,7 @@ em_reset(if_ctx_t ctx) device_printf(dev, "Hardware Initialization Failed\n"); return; } - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) igb_init_dmac(adapter, pba); E1000_WRITE_REG(hw, E1000_VET, ETHERTYPE_VLAN); @@ -2769,7 +2769,7 @@ igb_initialize_rss_mapping(struct adapter *adapter) u32 rss_key[10], mrqc, shift = 0; /* XXX? */ - if (hw.mac.type == e1000_82575) + if (hw->mac.type == e1000_82575) shift = 6; /* @@ -2878,11 +2878,11 @@ em_setup_interface(if_ctx_t ctx) * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - if (hw.phy.media_type == e1000_media_type_fiber || - hw.phy.media_type == e1000_media_type_internal_serdes) { + if (adapter->hw.phy.media_type == e1000_media_type_fiber || + adapter->hw.phy.media_type == e1000_media_type_internal_serdes) { u_char fiber_type = IFM_1000_SX; /* default type */ - if (hw.mac.type == e1000_82545) + if (adapter->hw.mac.type == e1000_82545) fiber_type = IFM_1000_LX; ifmedia_add(adapter->media, IFM_ETHER | fiber_type | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | fiber_type, 0, NULL); @@ -2891,7 +2891,7 @@ em_setup_interface(if_ctx_t ctx) ifmedia_add(adapter->media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL); - if (hw.phy.type != e1000_phy_ife) { + if (adapter->hw.phy.type != e1000_phy_ife) { ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(adapter->media, IFM_ETHER | IFM_1000_T, 0, NULL); } @@ -3081,7 +3081,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) } /* Set the default values for the Tx Inter Packet Gap timer */ - switch (hw.mac.type) { + switch (hw->mac.type) { case e1000_80003es2lan: tipg = DEFAULT_82543_TIPG_IPGR1; tipg |= DEFAULT_80003ES2LAN_TIPG_IPGR2 << @@ -3093,8 +3093,8 @@ em_initialize_transmit_unit(if_ctx_t ctx) tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; break; default: - if (hw.phy.media_type == e1000_media_type_fiber || - hw.phy.media_type == e1000_media_type_internal_serdes) + if (hw->phy.media_type == e1000_media_type_fiber || + hw->phy.media_type == e1000_media_type_internal_serdes) tipg = DEFAULT_82543_TIPG_IPGT_FIBER; else tipg = DEFAULT_82543_TIPG_IPGT_COPPER; @@ -3105,15 +3105,15 @@ em_initialize_transmit_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_TIPG, tipg); E1000_WRITE_REG(hw, E1000_TIDV, adapter->tx_int_delay.value); - if(hw.mac.type >= e1000_82540) + if(hw->mac.type >= e1000_82540) E1000_WRITE_REG(hw, E1000_TADV, adapter->tx_abs_int_delay.value); - if (hw.mac.type == e1000_82571 || hw.mac.type == e1000_82572) { + if (hw->mac.type == e1000_82571 || hw->mac.type == e1000_82572) { tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_SPEED_MODE_BIT; E1000_WRITE_REG(hw, E1000_TARC(0), tarc); - } else if (hw.mac.type == e1000_80003es2lan) { + } else if (hw->mac.type == e1000_80003es2lan) { /* errata: program both queues to unweighted RR */ tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= 1; @@ -3121,7 +3121,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) tarc = E1000_READ_REG(hw, E1000_TARC(1)); tarc |= 1; E1000_WRITE_REG(hw, E1000_TARC(1), tarc); - } else if (hw.mac.type == e1000_82574) { + } else if (hw->mac.type == e1000_82574) { tarc = E1000_READ_REG(hw, E1000_TARC(0)); tarc |= TARC_ERRATA_BIT; if ( adapter->tx_num_queues > 1) { @@ -3141,7 +3141,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); - if (hw.mac.type >= e1000_82571) + if (hw->mac.type >= e1000_82571) tctl |= E1000_TCTL_MULR; /* This write will effectively turn on the transmit unit. */ @@ -3208,7 +3208,7 @@ em_initialize_receive_unit(if_ctx_t ctx) if (!em_disable_crc_stripping) rctl |= E1000_RCTL_SECRC; - if (hw.mac.type >= e1000_82540) { + if (hw->mac.type >= e1000_82540) { E1000_WRITE_REG(hw, E1000_RADV, adapter->rx_abs_int_delay.value); @@ -3238,9 +3238,9 @@ em_initialize_receive_unit(if_ctx_t ctx) rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM && - hw.mac.type >= e1000_82543) { + hw->mac.type >= e1000_82543) { if (adapter->tx_num_queues > 1) { - if (hw.mac.type >= igb_mac_min) { + if (hw->mac.type >= igb_mac_min) { rxcsum |= E1000_RXCSUM_PCSD; if (hw->mac.type != e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; @@ -3249,11 +3249,11 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_RXCSUM_IPOFL | E1000_RXCSUM_PCSD; } else { - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) rxcsum |= E1000_RXCSUM_IPPCSE; else rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPOFL; - if (hw.mac.type > e1000_82575) + if (hw->mac.type > e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; } } else @@ -3262,7 +3262,7 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); if (adapter->rx_num_queues > 1) { - if (hw.mac.type >= igb_mac_min) + if (hw->mac.type >= igb_mac_min) igb_initialize_rss_mapping(adapter); else em_initialize_rss_mapping(adapter); @@ -3302,11 +3302,11 @@ em_initialize_receive_unit(if_ctx_t ctx) * Only write to RXDCTL(1) if there is a need for different * settings. */ - if ((hw.mac.type == e1000_ich9lan || hw.mac.type == e1000_pch2lan || - hw.mac.type == e1000_ich10lan) && (if_getmtu(ifp) > ETHERMTU)) { + if ((hw->mac.type == e1000_ich9lan || hw->mac.type == e1000_pch2lan || + hw->mac.type == e1000_ich10lan) && if_getmtu(ifp) > ETHERMTU) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); - } else if (hw.mac.type == e1000_82574) { + } else if (hw->mac.type == e1000_82574) { for (int i = 0; i < adapter->rx_num_queues; i++) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); rxdctl |= 0x20; /* PTHRESH */ @@ -3315,7 +3315,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= 1 << 24; /* Switch to granularity */ E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (hw.mac.type >= igb_mac_min) { + } else if (hw->mac.type >= igb_mac_min) { u32 psize, srrctl = 0; if (if_getmtu(ifp) > ETHERMTU) { @@ -3377,7 +3377,7 @@ em_initialize_receive_unit(if_ctx_t ctx) rxdctl |= IGB_RX_WTHRESH << 16; E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } - } else if (hw.mac.type >= e1000_pch2lan) { + } else if (hw->mac.type >= e1000_pch2lan) { if (if_getmtu(ifp) > ETHERMTU) e1000_lv_jumbo_workaround_ich8lan(hw, TRUE); else @@ -3387,7 +3387,7 @@ em_initialize_receive_unit(if_ctx_t ctx) /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; - if (hw.mac.type < igb_mac_min) { + if (hw->mac.type < igb_mac_min) { if (adapter->rx_mbuf_sz == MCLBYTES) rctl |= E1000_RCTL_SZ_2048; else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) @@ -3850,7 +3850,7 @@ em_enable_phy_wakeup(struct adapter *adapter) e1000_copy_rx_addrs_to_phy_ich8lan(hw); /* copy MAC MTA to PHY MTA */ - for (int i = 0; i < hw.mac.mta_reg_count; i++) { + for (int i = 0; i < hw->mac.mta_reg_count; i++) { mreg = E1000_READ_REG_ARRAY(hw, E1000_MTA, i); e1000_write_phy_reg(hw, BM_MTA(i), (u16)(mreg & 0xFFFF)); e1000_write_phy_reg(hw, BM_MTA(i) + 1, From owner-dev-commits-src-all@freebsd.org Tue Aug 17 01:56:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABAD465A31C; Tue, 17 Aug 2021 01:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpYzm4B6tz4fJJ; Tue, 17 Aug 2021 01:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73D721491E; Tue, 17 Aug 2021 01:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H1uaCV022752; Tue, 17 Aug 2021 01:56:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H1uaEa022751; Tue, 17 Aug 2021 01:56:36 GMT (envelope-from git) Date: Tue, 17 Aug 2021 01:56:36 GMT Message-Id: <202108170156.17H1uaEa022751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 4188e54d3fa7 - stable/12 - e1000: rctl/srrctl buffer size init, rfctl fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4188e54d3fa729b4ca337231f4f5825905535212 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 01:56:36 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4188e54d3fa729b4ca337231f4f5825905535212 commit 4188e54d3fa729b4ca337231f4f5825905535212 Author: Kevin Bowling AuthorDate: 2021-08-10 19:47:22 +0000 Commit: Kevin Bowling CommitDate: 2021-08-17 01:56:20 +0000 e1000: rctl/srrctl buffer size init, rfctl fix Simplify the setup of srrctl.BSIZEPKT on igb class NICs. Improve the setup of rctl.BSIZE on lem and em class NICs. Don't try to touch rfctl on lem class NICs. Manipulate rctl.BSEX correctly on lem and em class NICs. Approved by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31457 (cherry picked from commit 12e8addd320df995bfb2b00f51c233541f741ae4) --- sys/dev/e1000/if_em.c | 76 +++++++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index bcf7e0e9ec56..74641acbb3b3 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3166,6 +3166,7 @@ em_initialize_transmit_unit(if_ctx_t ctx) * Enable receive unit. * **********************************************************************/ +#define BSIZEPKT_ROUNDUP ((1<hw; struct em_rx_queue *que; int i; - u32 rctl, rxcsum, rfctl; + uint32_t rctl, rxcsum; INIT_DEBUGOUT("em_initialize_receive_units: begin"); @@ -3220,21 +3221,25 @@ em_initialize_receive_unit(if_ctx_t ctx) } E1000_WRITE_REG(hw, E1000_RDTR, adapter->rx_int_delay.value); - /* Use extended rx descriptor formats */ - rfctl = E1000_READ_REG(hw, E1000_RFCTL); - rfctl |= E1000_RFCTL_EXTEN; - /* - * When using MSI-X interrupts we need to throttle - * using the EITR register (82574 only) - */ - if (hw->mac.type == e1000_82574) { - for (int i = 0; i < 4; i++) - E1000_WRITE_REG(hw, E1000_EITR_82574(i), - DEFAULT_ITR); - /* Disable accelerated acknowledge */ - rfctl |= E1000_RFCTL_ACK_DIS; + if (hw->mac.type >= em_mac_min) { + uint32_t rfctl; + /* Use extended rx descriptor formats */ + rfctl = E1000_READ_REG(hw, E1000_RFCTL); + rfctl |= E1000_RFCTL_EXTEN; + + /* + * When using MSI-X interrupts we need to throttle + * using the EITR register (82574 only) + */ + if (hw->mac.type == e1000_82574) { + for (int i = 0; i < 4; i++) + E1000_WRITE_REG(hw, E1000_EITR_82574(i), + DEFAULT_ITR); + /* Disable accelerated acknowledge */ + rfctl |= E1000_RFCTL_ACK_DIS; + } + E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); } - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM && @@ -3319,24 +3324,17 @@ em_initialize_receive_unit(if_ctx_t ctx) u32 psize, srrctl = 0; if (if_getmtu(ifp) > ETHERMTU) { - /* Set maximum packet len */ - if (adapter->rx_mbuf_sz <= 4096) { - srrctl |= 4096 >> E1000_SRRCTL_BSIZEPKT_SHIFT; - rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX; - } else if (adapter->rx_mbuf_sz > 4096) { - srrctl |= 8192 >> E1000_SRRCTL_BSIZEPKT_SHIFT; - rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; - } psize = scctx->isc_max_frame_size; /* are we on a vlan? */ if (ifp->if_vlantrunk != NULL) psize += VLAN_TAG_SIZE; E1000_WRITE_REG(hw, E1000_RLPML, psize); - } else { - srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT; - rctl |= E1000_RCTL_SZ_2048; } + /* Set maximum packet buffer len */ + srrctl |= (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> + E1000_SRRCTL_BSIZEPKT_SHIFT; + /* * If TX flow control is disabled and there's >1 queue defined, * enable DROP. @@ -3387,17 +3385,29 @@ em_initialize_receive_unit(if_ctx_t ctx) /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; + /* Set up packet buffer size, overridden by per queue srrctl on igb */ if (hw->mac.type < igb_mac_min) { - if (adapter->rx_mbuf_sz == MCLBYTES) - rctl |= E1000_RCTL_SZ_2048; - else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) + if (adapter->rx_mbuf_sz > 2048 && adapter->rx_mbuf_sz <= 4096) rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX; - else if (adapter->rx_mbuf_sz > MJUMPAGESIZE) + else if (adapter->rx_mbuf_sz > 4096 && adapter->rx_mbuf_sz <= 8192) rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; + else if (adapter->rx_mbuf_sz > 8192) + rctl |= E1000_RCTL_SZ_16384 | E1000_RCTL_BSEX; + else { + rctl |= E1000_RCTL_SZ_2048; + rctl &= ~E1000_RCTL_BSEX; + } + } else + rctl |= E1000_RCTL_SZ_2048; - /* ensure we clear use DTYPE of 00 here */ - rctl &= ~0x00000C00; - } + /* + * rctl bits 11:10 are as follows + * lem: reserved + * em: DTYPE + * igb: reserved + * and should be 00 on all of the above + */ + rctl &= ~0x00000C00; /* Write out the settings */ E1000_WRITE_REG(hw, E1000_RCTL, rctl); From owner-dev-commits-src-all@freebsd.org Tue Aug 17 06:31:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4279A65D772; Tue, 17 Aug 2021 06:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gph5P1THnz3p56; Tue, 17 Aug 2021 06:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AF77185D4; Tue, 17 Aug 2021 06:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H6VrxW094330; Tue, 17 Aug 2021 06:31:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H6VrAE094329; Tue, 17 Aug 2021 06:31:53 GMT (envelope-from git) Date: Tue, 17 Aug 2021 06:31:53 GMT Message-Id: <202108170631.17H6VrAE094329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: e8ad0a0059af - main - ipmi: New tunable to deactivate IPMI watchdog MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8ad0a0059afe1cd0af39bab49018ae7bc9be937 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 06:31:53 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=e8ad0a0059afe1cd0af39bab49018ae7bc9be937 commit e8ad0a0059afe1cd0af39bab49018ae7bc9be937 Author: Wojciech Macek AuthorDate: 2021-08-17 06:28:21 +0000 Commit: Wojciech Macek CommitDate: 2021-08-17 06:31:00 +0000 ipmi: New tunable to deactivate IPMI watchdog In case we want to use other WD than IPMI-provided, add sysctl to disable initialization. Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D31548 --- sys/dev/ipmi/ipmi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c index cd2a289b25cb..77fd4b68ae96 100644 --- a/sys/dev/ipmi/ipmi.c +++ b/sys/dev/ipmi/ipmi.c @@ -96,11 +96,14 @@ static int wd_shutdown_countdown = 0; /* sec */ static int wd_startup_countdown = 0; /* sec */ static int wd_pretimeout_countdown = 120; /* sec */ static int cycle_wait = 10; /* sec */ +static int wd_init_disable = 0; static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "IPMI driver parameters"); SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RWTUN, &on, 0, ""); +SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_init_disable, CTLFLAG_RWTUN, + &wd_init_disable, 0, ""); SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_timer_actions, CTLFLAG_RW, &wd_timer_actions, 0, "IPMI watchdog timer actions (including pre-timeout interrupt)"); @@ -909,7 +912,7 @@ ipmi_startup(void *arg) * Probe for watchdog, but only for backends which support * polled driver requests. */ - if (sc->ipmi_driver_requests_polled) { + if (!wd_init_disable && sc->ipmi_driver_requests_polled) { IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_GET_WDOG, 0, 0); From owner-dev-commits-src-all@freebsd.org Tue Aug 17 07:04:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF91565E608; Tue, 17 Aug 2021 07:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GphpY5l6Mz3qB7; Tue, 17 Aug 2021 07:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD29A1933D; Tue, 17 Aug 2021 07:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H7458i037292; Tue, 17 Aug 2021 07:04:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H745ld037291; Tue, 17 Aug 2021 07:04:05 GMT (envelope-from git) Date: Tue, 17 Aug 2021 07:04:05 GMT Message-Id: <202108170704.17H745ld037291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 1b9ce0885e5f - main - sdhci_xenon: add AP807 compatible string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b9ce0885e5f53ea5818ee593babf11f6b5d5761 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 07:04:05 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=1b9ce0885e5f53ea5818ee593babf11f6b5d5761 commit 1b9ce0885e5f53ea5818ee593babf11f6b5d5761 Author: Bartlomiej Grzesik AuthorDate: 2021-07-14 12:47:40 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-17 07:03:37 +0000 sdhci_xenon: add AP807 compatible string This patch adds compatible string for xenon controller found on AP807 north brige. It is fully compatible with existing driver. Reviewed by: manu Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D31407 --- sys/dev/sdhci/sdhci_xenon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/sdhci/sdhci_xenon.c b/sys/dev/sdhci/sdhci_xenon.c index 3f312921154f..10cbc5991119 100644 --- a/sys/dev/sdhci/sdhci_xenon.c +++ b/sys/dev/sdhci/sdhci_xenon.c @@ -74,6 +74,7 @@ static struct ofw_compat_data compat_data[] = { #ifdef SOC_MARVELL_8K { "marvell,armada-cp110-sdhci", 1 }, { "marvell,armada-ap806-sdhci", 1 }, + { "marvell,armada-ap807-sdhci", 1 }, #endif { NULL, 0 } }; From owner-dev-commits-src-all@freebsd.org Tue Aug 17 07:04:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 115C765E5CC; Tue, 17 Aug 2021 07:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GphpZ6md4z3qX2; Tue, 17 Aug 2021 07:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFFF31967F; Tue, 17 Aug 2021 07:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H7461a037316; Tue, 17 Aug 2021 07:04:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H746L2037315; Tue, 17 Aug 2021 07:04:06 GMT (envelope-from git) Date: Tue, 17 Aug 2021 07:04:06 GMT Message-Id: <202108170704.17H746L2037315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 6ad816a99917 - main - sdhci_xenon: remove redundant code in property parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ad816a999171874c36c73d5794d0d25ff8fd311 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 07:04:07 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=6ad816a999171874c36c73d5794d0d25ff8fd311 commit 6ad816a999171874c36c73d5794d0d25ff8fd311 Author: Bartlomiej Grzesik AuthorDate: 2021-07-15 15:20:46 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-17 07:03:45 +0000 sdhci_xenon: remove redundant code in property parsing Remove redundant ofw property parsing in driver code, is already taken care of in mmc_fdt_helpers. Move ofw parsing to attach method. Reviewed by: manu Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D31409 --- sys/dev/sdhci/sdhci_xenon.c | 69 +++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/sys/dev/sdhci/sdhci_xenon.c b/sys/dev/sdhci/sdhci_xenon.c index 10cbc5991119..b6f7513245eb 100644 --- a/sys/dev/sdhci/sdhci_xenon.c +++ b/sys/dev/sdhci/sdhci_xenon.c @@ -83,9 +83,6 @@ struct sdhci_xenon_softc { device_t dev; /* Controller device */ int slot_id; /* Controller ID */ phandle_t node; /* FDT node */ - uint32_t quirks; /* Chip specific quirks */ - uint32_t caps; /* If we override SDHCI_CAPABILITIES */ - uint32_t max_clk; /* Max possible freq */ struct resource *irq_res; /* IRQ resource */ void *intrhand; /* Interrupt handle */ struct sdhci_fdt_gpio *gpio; /* GPIO pins for CD detection. */ @@ -95,7 +92,6 @@ struct sdhci_xenon_softc { uint8_t znr; /* PHY ZNR */ uint8_t zpr; /* PHY ZPR */ - bool no_18v; /* No 1.8V support */ bool slow_mode; /* PHY slow mode */ struct mmc_fdt_helper mmc_helper; /* MMC helper for parsing FDT */ @@ -509,32 +505,17 @@ sdhci_xenon_switch_vccq(device_t brdev, device_t reqdev) } } -static int -sdhci_xenon_probe(device_t dev) +static void +sdhci_xenon_fdt_parse(device_t dev, struct sdhci_slot *slot) { struct sdhci_xenon_softc *sc = device_get_softc(dev); pcell_t cid; - sc->quirks = 0; - sc->slot_id = 0; - sc->max_clk = XENON_MMC_MAX_CLK; - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) - return (ENXIO); - - sc->node = ofw_bus_get_node(dev); - device_set_desc(dev, "Armada Xenon SDHCI controller"); + mmc_fdt_parse(dev, 0, &sc->mmc_helper, &slot->host); /* Allow dts to patch quirks, slots, and max-frequency. */ if ((OF_getencprop(sc->node, "quirks", &cid, sizeof(cid))) > 0) - sc->quirks = cid; - if ((OF_getencprop(sc->node, "max-frequency", &cid, sizeof(cid))) > 0) - sc->max_clk = cid; - if (OF_hasprop(sc->node, "no-1-8-v")) - sc->no_18v = true; + slot->quirks = cid; if (OF_hasprop(sc->node, "marvell,xenon-phy-slow-mode")) sc->slow_mode = true; sc->znr = XENON_ZNR_DEF_VALUE; @@ -545,6 +526,18 @@ sdhci_xenon_probe(device_t dev) if ((OF_getencprop(sc->node, "marvell,xenon-phy-zpr", &cid, sizeof(cid))) > 0) sc->zpr = cid & XENON_ZPR_MASK; +} + +static int +sdhci_xenon_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Armada Xenon SDHCI controller"); return (0); } @@ -558,6 +551,8 @@ sdhci_xenon_attach(device_t dev) uint32_t reg; sc->dev = dev; + sc->slot_id = 0; + sc->node = ofw_bus_get_node(dev); /* Allocate IRQ. */ rid = 0; @@ -581,34 +576,34 @@ sdhci_xenon_attach(device_t dev) slot = malloc(sizeof(*slot), M_DEVBUF, M_ZERO | M_WAITOK); + /* + * Set up any gpio pin handling described in the FDT data. This cannot + * fail; see comments in sdhci_fdt_gpio.h for details. + */ + sc->gpio = sdhci_fdt_gpio_setup(dev, slot); + + sdhci_xenon_fdt_parse(dev, slot); + + slot->max_clk = XENON_MMC_MAX_CLK; + if (slot->host.f_max > 0) + slot->max_clk = slot->host.f_max; /* Check if the device is flagged as non-removable. */ - if (OF_hasprop(sc->node, "non-removable")) { + if (sc->mmc_helper.props & MMC_PROP_NON_REMOVABLE) { slot->opt |= SDHCI_NON_REMOVABLE; if (bootverbose) device_printf(dev, "Non-removable media\n"); } - slot->quirks = sc->quirks; - slot->caps = sc->caps; - slot->max_clk = sc->max_clk; sc->slot = slot; - /* - * Set up any gpio pin handling described in the FDT data. This cannot - * fail; see comments in sdhci_fdt_gpio.h for details. - */ - sc->gpio = sdhci_fdt_gpio_setup(dev, slot); - - mmc_fdt_parse(dev, 0, &sc->mmc_helper, &sc->slot->host); - if (sdhci_init_slot(dev, sc->slot, 0)) goto fail; /* 1.2V signaling is not supported. */ sc->slot->host.caps &= ~MMC_CAP_SIGNALING_120; - /* Disable UHS in case of lack of 1.8V VCCQ or the PHY slow mode. */ - if (sc->no_18v || sc->slow_mode) + /* Disable UHS in case of the PHY slow mode. */ + if (sc->slow_mode) sc->slot->host.caps &= ~MMC_CAP_SIGNALING_180; /* Activate the interrupt */ From owner-dev-commits-src-all@freebsd.org Tue Aug 17 08:35:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB44365FA05; Tue, 17 Aug 2021 08:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpkqZ4cyMz4SJK; Tue, 17 Aug 2021 08:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86DB01A34B; Tue, 17 Aug 2021 08:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H8Z6fa057322; Tue, 17 Aug 2021 08:35:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H8Z6KC057321; Tue, 17 Aug 2021 08:35:06 GMT (envelope-from git) Date: Tue, 17 Aug 2021 08:35:06 GMT Message-Id: <202108170835.17H8Z6KC057321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 322e5efda857 - main - ipfw: fix possible data race between jump cache reading and updating. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 322e5efda8578bb9c0a0ab0ef785cd1e1c222c85 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 08:35:06 -0000 The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=322e5efda8578bb9c0a0ab0ef785cd1e1c222c85 commit 322e5efda8578bb9c0a0ab0ef785cd1e1c222c85 Author: Andrey V. Elsukov AuthorDate: 2021-08-17 08:08:28 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-08-17 08:08:28 +0000 ipfw: fix possible data race between jump cache reading and updating. Jump cache is used to reduce the cost of rule lookup for O_SKIPTO and O_CALLRETURN actions. It uses rules chain id to check correctness of cached value. But due to the possible race, there is the chance that one thread can read invalid value. In some cases this can lead to out of bounds access and panic. Use thread fence operations to constrain the reordering of accesses. Also rename jump_fast and jump_linear functions to jump_cached and jump_lookup_pos respectively. Submitted by: Arseny Smalyuk Reviewed by: melifaro Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D31484 --- sys/netpfil/ipfw/ip_fw2.c | 107 ++++++++++++++++++++++++--------------- sys/netpfil/ipfw/ip_fw_private.h | 12 ++++- 2 files changed, 75 insertions(+), 44 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index f03180cd3bca..bcf775009d25 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -144,14 +144,14 @@ VNET_DEFINE(unsigned int, fw_tables_sets) = 0; /* Don't use set-aware tables */ /* Use 128 tables by default */ static unsigned int default_fw_tables = IPFW_TABLES_DEFAULT; +static int jump_lookup_pos(struct ip_fw_chain *chain, struct ip_fw *f, int num, + int tablearg, int jump_backwards); #ifndef LINEAR_SKIPTO -static int jump_fast(struct ip_fw_chain *chain, struct ip_fw *f, int num, +static int jump_cached(struct ip_fw_chain *chain, struct ip_fw *f, int num, int tablearg, int jump_backwards); -#define JUMP(ch, f, num, targ, back) jump_fast(ch, f, num, targ, back) +#define JUMP(ch, f, num, targ, back) jump_cached(ch, f, num, targ, back) #else -static int jump_linear(struct ip_fw_chain *chain, struct ip_fw *f, int num, - int tablearg, int jump_backwards); -#define JUMP(ch, f, num, targ, back) jump_linear(ch, f, num, targ, back) +#define JUMP(ch, f, num, targ, back) jump_lookup_pos(ch, f, num, targ, back) #endif /* @@ -1227,60 +1227,83 @@ set_match(struct ip_fw_args *args, int slot, args->flags |= IPFW_ARGS_REF; } -#ifndef LINEAR_SKIPTO -/* - * Helper function to enable cached rule lookups using - * cached_id and cached_pos fields in ipfw rule. - */ static int -jump_fast(struct ip_fw_chain *chain, struct ip_fw *f, int num, +jump_lookup_pos(struct ip_fw_chain *chain, struct ip_fw *f, int num, int tablearg, int jump_backwards) { - int f_pos; + int f_pos, i; - /* If possible use cached f_pos (in f->cached_pos), - * whose version is written in f->cached_id - * (horrible hacks to avoid changing the ABI). - */ - if (num != IP_FW_TARG && f->cached_id == chain->id) - f_pos = f->cached_pos; - else { - int i = IP_FW_ARG_TABLEARG(chain, num, skipto); - /* make sure we do not jump backward */ - if (jump_backwards == 0 && i <= f->rulenum) - i = f->rulenum + 1; - if (chain->idxmap != NULL) - f_pos = chain->idxmap[i]; - else - f_pos = ipfw_find_rule(chain, i, 0); - /* update the cache */ - if (num != IP_FW_TARG) { - f->cached_id = chain->id; - f->cached_pos = f_pos; - } - } + i = IP_FW_ARG_TABLEARG(chain, num, skipto); + /* make sure we do not jump backward */ + if (jump_backwards == 0 && i <= f->rulenum) + i = f->rulenum + 1; + +#ifndef LINEAR_SKIPTO + if (chain->idxmap != NULL) + f_pos = chain->idxmap[i]; + else + f_pos = ipfw_find_rule(chain, i, 0); +#else + f_pos = chain->idxmap[i]; +#endif /* LINEAR_SKIPTO */ return (f_pos); } -#else + + +#ifndef LINEAR_SKIPTO /* - * Helper function to enable real fast rule lookups. + * Helper function to enable cached rule lookups using + * cache.id and cache.pos fields in ipfw rule. */ static int -jump_linear(struct ip_fw_chain *chain, struct ip_fw *f, int num, +jump_cached(struct ip_fw_chain *chain, struct ip_fw *f, int num, int tablearg, int jump_backwards) { int f_pos; - num = IP_FW_ARG_TABLEARG(chain, num, skipto); - /* make sure we do not jump backward */ - if (jump_backwards == 0 && num <= f->rulenum) - num = f->rulenum + 1; - f_pos = chain->idxmap[num]; + /* Can't use cache with IP_FW_TARG */ + if (num == IP_FW_TARG) + return jump_lookup_pos(chain, f, num, tablearg, jump_backwards); + + /* + * If possible use cached f_pos (in f->cache.pos), + * whose version is written in f->cache.id (horrible hacks + * to avoid changing the ABI). + * + * Multiple threads can execute the same rule simultaneously, + * we need to ensure that cache.pos is updated before cache.id. + */ +#ifdef __LP64__ + struct ip_fw_jump_cache cache; + + cache.raw_value = f->cache.raw_value; + if (cache.id == chain->id) + return (cache.pos); + + f_pos = jump_lookup_pos(chain, f, num, tablearg, jump_backwards); + + cache.pos = f_pos; + cache.id = chain->id; + f->cache.raw_value = cache.raw_value; +#else + if (f->cache.id == chain->id) { + /* Load pos after id */ + atomic_thread_fence_acq(); + return (f->cache.pos); + } + + f_pos = jump_lookup_pos(chain, f, num, tablearg, jump_backwards); + + f->cache.pos = f_pos; + /* Store id after pos */ + atomic_thread_fence_rel(); + f->cache.id = chain->id; +#endif /* !__LP64__ */ return (f_pos); } -#endif +#endif /* !LINEAR_SKIPTO */ #define TARG(k, f) IP_FW_ARG_TABLEARG(chain, k, f) /* diff --git a/sys/netpfil/ipfw/ip_fw_private.h b/sys/netpfil/ipfw/ip_fw_private.h index 56624209e4cb..1440b1a40eee 100644 --- a/sys/netpfil/ipfw/ip_fw_private.h +++ b/sys/netpfil/ipfw/ip_fw_private.h @@ -265,6 +265,15 @@ struct tables_config; * ACTION_PTR(r) is the start of the first action (things to do * once a rule matched). */ +struct ip_fw_jump_cache { + union { + struct { + uint32_t id; + uint32_t pos; + }; + uint64_t raw_value; + }; +}; struct ip_fw { uint16_t act_ofs; /* offset of action in 32-bit units */ @@ -273,10 +282,9 @@ struct ip_fw { uint8_t set; /* rule set (0..31) */ uint8_t flags; /* currently unused */ counter_u64_t cntr; /* Pointer to rule counters */ + struct ip_fw_jump_cache cache; /* used by jump_fast */ uint32_t timestamp; /* tv_sec of last match */ uint32_t id; /* rule id */ - uint32_t cached_id; /* used by jump_fast */ - uint32_t cached_pos; /* used by jump_fast */ uint32_t refcnt; /* number of references */ struct ip_fw *next; /* linked list of deleted rules */ From owner-dev-commits-src-all@freebsd.org Tue Aug 17 09:09:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 380516600D0; Tue, 17 Aug 2021 09:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GplZz0rK4z4V6P; Tue, 17 Aug 2021 09:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0519B1AF89; Tue, 17 Aug 2021 09:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H99E31098362; Tue, 17 Aug 2021 09:09:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H99EmP098361; Tue, 17 Aug 2021 09:09:14 GMT (envelope-from git) Date: Tue, 17 Aug 2021 09:09:14 GMT Message-Id: <202108170909.17H99EmP098361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 35cf9fecbd80 - main - Enable rc.d/jail within jails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35cf9fecbd80f56e39524f480240acfd953c93e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 09:09:15 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=35cf9fecbd80f56e39524f480240acfd953c93e1 commit 35cf9fecbd80f56e39524f480240acfd953c93e1 Author: Dan Langille AuthorDate: 2021-08-15 16:53:16 +0000 Commit: Kristof Provost CommitDate: 2021-08-17 07:07:53 +0000 Enable rc.d/jail within jails Jails with jails is a supported. This change allows the script to run upon startup with a jail. Without this, jails are not automatically started within jails. --- libexec/rc/rc.d/jail | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail index 1a3b551c9a4c..ff4336131bc9 100755 --- a/libexec/rc/rc.d/jail +++ b/libexec/rc/rc.d/jail @@ -6,7 +6,7 @@ # PROVIDE: jail # REQUIRE: LOGIN FILESYSTEMS # BEFORE: securelevel -# KEYWORD: nojail shutdown +# KEYWORD: shutdown . /etc/rc.subr From owner-dev-commits-src-all@freebsd.org Tue Aug 17 09:34:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 549F9660459; Tue, 17 Aug 2021 09:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gpm7d1fcJz4Wds; Tue, 17 Aug 2021 09:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 208AE1B26B; Tue, 17 Aug 2021 09:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17H9Y5Ik037008; Tue, 17 Aug 2021 09:34:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17H9Y4uU037007; Tue, 17 Aug 2021 09:34:04 GMT (envelope-from git) Date: Tue, 17 Aug 2021 09:34:04 GMT Message-Id: <202108170934.17H9Y4uU037007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 5469a9953005 - main - unbound: Vendor import 1.13.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5469a9953005a9a4d4aad7be88545d441622e9a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 09:34:05 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5469a9953005a9a4d4aad7be88545d441622e9a0 commit 5469a9953005a9a4d4aad7be88545d441622e9a0 Merge: 35cf9fecbd80 625f1c1312fb Author: Cy Schubert AuthorDate: 2021-08-17 09:32:56 +0000 Commit: Cy Schubert CommitDate: 2021-08-17 09:32:56 +0000 unbound: Vendor import 1.13.2 Merge commit '625f1c1312fb7defbd148c8ba121a0cf058707ef' MFC after: 1 month .../unbound/.github/ISSUE_TEMPLATE/bug_report.md | 41 + .../.github/ISSUE_TEMPLATE/feature_request.md | 31 + .../unbound/.github/workflows/analysis_ports.yml | 346 +++++ contrib/unbound/.github/workflows/ci.yml | 21 + contrib/unbound/.travis.yml | 124 +- contrib/unbound/Makefile.in | 509 ++++--- contrib/unbound/README.md | 1 + contrib/unbound/acx_nlnetlabs.m4 | 23 +- contrib/unbound/cachedb/cachedb.c | 8 +- contrib/unbound/compat/ctime_r.c | 2 +- contrib/unbound/config.guess | 1222 +++++++++-------- contrib/unbound/config.h.in | 26 + contrib/unbound/config.sub | 59 +- contrib/unbound/configure | 134 +- contrib/unbound/configure.ac | 72 +- contrib/unbound/contrib/ios/install_tools.sh | 8 +- contrib/unbound/contrib/unbound.service.in | 4 + contrib/unbound/contrib/unbound.spec | 20 +- contrib/unbound/contrib/unbound_munin_ | 71 +- contrib/unbound/daemon/daemon.c | 13 +- contrib/unbound/daemon/remote.c | 111 +- contrib/unbound/daemon/unbound.c | 29 + contrib/unbound/daemon/worker.c | 85 +- contrib/unbound/dnscrypt/dnscrypt.c | 2 + contrib/unbound/dnstap/dnstap.c | 120 +- contrib/unbound/dnstap/dnstap.h | 12 +- contrib/unbound/dnstap/unbound-dnstap-socket.c | 26 +- contrib/unbound/doc/Changelog | 374 ++++++ contrib/unbound/doc/README | 2 +- contrib/unbound/doc/example.conf.in | 30 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 2 +- contrib/unbound/doc/unbound-control.8.in | 7 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 184 ++- contrib/unbound/doc/unbound.doxygen | 2 +- contrib/unbound/edns-subnet/subnetmod.c | 36 +- contrib/unbound/ipsecmod/ipsecmod.c | 17 + contrib/unbound/iterator/iter_scrub.c | 24 +- contrib/unbound/iterator/iter_utils.c | 34 +- contrib/unbound/iterator/iter_utils.h | 23 +- contrib/unbound/iterator/iterator.c | 79 +- contrib/unbound/iterator/iterator.h | 8 +- contrib/unbound/libunbound/context.c | 4 +- contrib/unbound/libunbound/libworker.c | 69 +- contrib/unbound/libunbound/worker.h | 8 - contrib/unbound/respip/respip.c | 2 +- contrib/unbound/services/authzone.c | 1405 +++++++++++++++++++- contrib/unbound/services/authzone.h | 96 +- contrib/unbound/services/cache/dns.c | 5 +- contrib/unbound/services/cache/dns.h | 4 +- contrib/unbound/services/cache/infra.c | 3 + contrib/unbound/services/listen_dnsport.c | 263 +++- contrib/unbound/services/listen_dnsport.h | 28 +- contrib/unbound/services/localzone.c | 16 +- contrib/unbound/services/localzone.h | 2 +- contrib/unbound/services/mesh.c | 17 +- contrib/unbound/services/modstack.c | 65 +- contrib/unbound/services/outside_network.c | 463 +++++-- contrib/unbound/services/outside_network.h | 45 +- contrib/unbound/services/rpz.c | 26 +- contrib/unbound/sldns/keyraw.c | 333 ++++- contrib/unbound/sldns/keyraw.h | 20 + contrib/unbound/sldns/parse.c | 3 + contrib/unbound/sldns/parse.h | 3 - contrib/unbound/sldns/parseutil.c | 15 + contrib/unbound/sldns/parseutil.h | 1 + contrib/unbound/sldns/rrdef.c | 15 +- contrib/unbound/sldns/rrdef.h | 10 +- contrib/unbound/sldns/sbuffer.h | 2 - contrib/unbound/sldns/str2wire.c | 683 +++++++++- contrib/unbound/sldns/str2wire.h | 31 + contrib/unbound/sldns/wire2str.c | 279 ++++ contrib/unbound/sldns/wire2str.h | 12 + contrib/unbound/smallapp/unbound-checkconf.c | 4 +- contrib/unbound/smallapp/unbound-control.c | 37 +- contrib/unbound/smallapp/unbound-host.c | 2 +- contrib/unbound/smallapp/worker_cb.c | 18 +- contrib/unbound/testcode/readzone.c | 158 +++ contrib/unbound/testcode/unittcpreuse.c | 236 ++++ contrib/unbound/testcode/unitzonemd.c | 537 ++++++++ contrib/unbound/testdata/auth_zonemd_anchor.rpl | 234 ++++ .../unbound/testdata/auth_zonemd_anchor_fail.rpl | 236 ++++ contrib/unbound/testdata/auth_zonemd_chain.rpl | 234 ++++ .../unbound/testdata/auth_zonemd_chain_fail.rpl | 236 ++++ contrib/unbound/testdata/auth_zonemd_file.rpl | 183 +++ contrib/unbound/testdata/auth_zonemd_file_fail.rpl | 185 +++ contrib/unbound/testdata/auth_zonemd_insecure.rpl | 215 +++ .../testdata/auth_zonemd_insecure_absent.rpl | 217 +++ .../auth_zonemd_insecure_absent_reject.rpl | 218 +++ .../unbound/testdata/auth_zonemd_insecure_fail.rpl | 218 +++ contrib/unbound/testdata/auth_zonemd_nokey.rpl | 212 +++ .../testdata/auth_zonemd_permissive_mode.rpl | 187 +++ contrib/unbound/testdata/auth_zonemd_xfr.rpl | 238 ++++ .../unbound/testdata/auth_zonemd_xfr_anchor.rpl | 285 ++++ .../testdata/auth_zonemd_xfr_anchor_fail.rpl | 266 ++++ contrib/unbound/testdata/auth_zonemd_xfr_chain.rpl | 310 +++++ .../testdata/auth_zonemd_xfr_chain_fail.rpl | 321 +++++ contrib/unbound/testdata/auth_zonemd_xfr_fail.rpl | 241 ++++ .../127.0.0.1/example.com.zone | 3 + .../http_user_agent.tdir/http_user_agent.conf | 24 + .../http_user_agent.tdir/http_user_agent.dsc | 16 + .../http_user_agent.tdir/http_user_agent.post | 11 + .../http_user_agent.tdir/http_user_agent.pre | 37 + .../http_user_agent.tdir/http_user_agent.test | 103 ++ .../testdata/http_user_agent.tdir/petal.key | 21 + .../testdata/http_user_agent.tdir/petal.pem | 14 + .../http_user_agent.tdir/unbound_control.key | 39 + .../http_user_agent.tdir/unbound_control.pem | 22 + .../http_user_agent.tdir/unbound_server.key | 39 + .../http_user_agent.tdir/unbound_server.pem | 22 + contrib/unbound/testdata/rpz_rootwc.rpl | 162 +++ .../testdata/svcb.tdir/crypto.cloudflare.com.zone | 9 + contrib/unbound/testdata/svcb.tdir/svcb.dsc | 16 + .../testdata/svcb.tdir/svcb.failure-cases-01 | 9 + .../testdata/svcb.tdir/svcb.failure-cases-02 | 8 + .../testdata/svcb.tdir/svcb.failure-cases-03 | 8 + .../testdata/svcb.tdir/svcb.failure-cases-04 | 8 + .../testdata/svcb.tdir/svcb.success-cases.zone | 47 + .../testdata/svcb.tdir/svcb.success-cases.zone.cmp | 10 + contrib/unbound/testdata/svcb.tdir/svcb.test | 97 ++ .../testdata/svcb.tdir/svcb.test-vectors-pf.zone | 92 ++ .../testdata/svcb.tdir/svcb.test-vectors-wf.zone | 232 ++++ contrib/unbound/testdata/zonemd.example1.zone | 4 + contrib/unbound/testdata/zonemd.example10.zone | 35 + contrib/unbound/testdata/zonemd.example11.zone | 33 + contrib/unbound/testdata/zonemd.example12.zone | 35 + contrib/unbound/testdata/zonemd.example13.zone | 33 + contrib/unbound/testdata/zonemd.example14.zone | 35 + contrib/unbound/testdata/zonemd.example15.zone | 35 + contrib/unbound/testdata/zonemd.example16.zone | 11 + contrib/unbound/testdata/zonemd.example17.zone | 11 + contrib/unbound/testdata/zonemd.example2.zone | 15 + contrib/unbound/testdata/zonemd.example3.zone | 34 + contrib/unbound/testdata/zonemd.example4.zone | 36 + contrib/unbound/testdata/zonemd.example5.zone | 34 + contrib/unbound/testdata/zonemd.example6.zone | 36 + contrib/unbound/testdata/zonemd.example7.zone | 31 + contrib/unbound/testdata/zonemd.example8.zone | 34 + contrib/unbound/testdata/zonemd.example9.zone | 35 + contrib/unbound/testdata/zonemd.example_a1.zone | 6 + contrib/unbound/testdata/zonemd.example_a2.zone | 25 + contrib/unbound/testdata/zonemd.example_a3.zone | 30 + contrib/unbound/testdata/zonemd.example_a4.zone | 127 ++ contrib/unbound/testdata/zonemd.example_a5.zone | 48 + .../testdata/zonemd_reload.tdir/zonemd_reload.conf | 23 + .../testdata/zonemd_reload.tdir/zonemd_reload.dsc | 16 + .../testdata/zonemd_reload.tdir/zonemd_reload.post | 14 + .../testdata/zonemd_reload.tdir/zonemd_reload.pre | 35 + .../testdata/zonemd_reload.tdir/zonemd_reload.test | 74 ++ .../zonemd_reload.tdir/zonemd_reload.testns | 27 + .../testdata/zonemd_reload.tdir/zonemd_reload.zone | 8 + contrib/unbound/util/config_file.c | 84 +- contrib/unbound/util/config_file.h | 39 + contrib/unbound/util/configlexer.lex | 9 + contrib/unbound/util/configparser.y | 138 +- contrib/unbound/util/data/dname.h | 4 +- contrib/unbound/util/data/msgreply.c | 22 +- contrib/unbound/util/fptr_wlist.c | 5 +- contrib/unbound/util/iana_ports.inc | 5 +- contrib/unbound/util/net_help.c | 3 +- contrib/unbound/util/net_help.h | 6 +- contrib/unbound/util/netevent.c | 126 +- contrib/unbound/util/netevent.h | 12 +- contrib/unbound/util/shm_side/shm_main.c | 6 + contrib/unbound/util/storage/lookup3.c | 102 +- contrib/unbound/util/ub_event_pluggable.c | 3 +- contrib/unbound/validator/autotrust.c | 31 +- contrib/unbound/validator/val_anchor.c | 7 +- contrib/unbound/validator/val_nsec.c | 1 + contrib/unbound/validator/val_secalgo.c | 247 +++- contrib/unbound/validator/val_secalgo.h | 43 + contrib/unbound/validator/val_sigcrypt.c | 98 +- contrib/unbound/validator/val_sigcrypt.h | 29 + contrib/unbound/validator/val_utils.c | 39 +- contrib/unbound/validator/validator.c | 18 +- contrib/unbound/validator/validator.h | 6 +- 179 files changed, 14359 insertions(+), 1803 deletions(-) diff --cc contrib/unbound/.github/ISSUE_TEMPLATE/bug_report.md index 000000000000,35d7ee94f9da..35d7ee94f9da mode 000000,100644..100644 --- a/contrib/unbound/.github/ISSUE_TEMPLATE/bug_report.md +++ b/contrib/unbound/.github/ISSUE_TEMPLATE/bug_report.md diff --cc contrib/unbound/.github/ISSUE_TEMPLATE/feature_request.md index 000000000000,e9ca08b7ab65..e9ca08b7ab65 mode 000000,100644..100644 --- a/contrib/unbound/.github/ISSUE_TEMPLATE/feature_request.md +++ b/contrib/unbound/.github/ISSUE_TEMPLATE/feature_request.md diff --cc contrib/unbound/.github/workflows/analysis_ports.yml index 000000000000,fbbdd80185a9..fbbdd80185a9 mode 000000,100644..100644 --- a/contrib/unbound/.github/workflows/analysis_ports.yml +++ b/contrib/unbound/.github/workflows/analysis_ports.yml diff --cc contrib/unbound/.github/workflows/ci.yml index 000000000000,73d68fbf35c9..73d68fbf35c9 mode 000000,100644..100644 --- a/contrib/unbound/.github/workflows/ci.yml +++ b/contrib/unbound/.github/workflows/ci.yml diff --cc contrib/unbound/README.md index 3e11ce58ce0d,000000000000..c8877d1e9df5 mode 100644,000000..100644 --- a/contrib/unbound/README.md +++ b/contrib/unbound/README.md @@@ -1,38 -1,0 +1,39 @@@ +# Unbound + +[![Travis Build Status](https://travis-ci.org/NLnetLabs/unbound.svg?branch=master)](https://travis-ci.org/NLnetLabs/unbound) +[![Packaging status](https://repology.org/badge/tiny-repos/unbound.svg)](https://repology.org/project/unbound/versions) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/unbound.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:unbound) ++[![Documentation Status](https://readthedocs.org/projects/unbound/badge/?version=latest)](https://unbound.readthedocs.io/en/latest/?badge=latest) + +Unbound is a validating, recursive, caching DNS resolver. It is designed to be +fast and lean and incorporates modern features based on open standards. If you +have any feedback, we would love to hear from you. Don’t hesitate to +[create an issue on Github](https://github.com/NLnetLabs/unbound/issues/new) +or post a message on the [Unbound mailing list](https://lists.nlnetlabs.nl/mailman/listinfo/unbound-users). +You can learn more about Unbound by reading our +[documentation](https://nlnetlabs.nl/documentation/unbound/). + +## Compiling + +Make sure you have the C toolchain, OpenSSL and its include files, and libexpat +installed. Unbound can be compiled and installed using: + +``` +./configure && make && make install +``` + +You can use libevent if you want. libevent is useful when using many (10000) +outgoing ports. By default max 256 ports are opened at the same time and the +builtin alternative is equally capable and a little faster. + +Use the `--with-libevent=dir` configure option to compile Unbound with libevent +support. + +## Unbound configuration + +All of Unbound's configuration options are described in the man pages, which +will be installed and are available on the Unbound +[documentation page](https://nlnetlabs.nl/documentation/unbound/). + +An example configuration file is located in +[doc/example.conf](https://github.com/NLnetLabs/unbound/blob/master/doc/example.conf.in). diff --cc contrib/unbound/testcode/readzone.c index 000000000000,94511e5771f4..94511e5771f4 mode 000000,100644..100644 --- a/contrib/unbound/testcode/readzone.c +++ b/contrib/unbound/testcode/readzone.c diff --cc contrib/unbound/testcode/unittcpreuse.c index 000000000000,087c6c1b9d50..087c6c1b9d50 mode 000000,100644..100644 --- a/contrib/unbound/testcode/unittcpreuse.c +++ b/contrib/unbound/testcode/unittcpreuse.c diff --cc contrib/unbound/testcode/unitzonemd.c index 000000000000,5caa68a102c3..5caa68a102c3 mode 000000,100644..100644 --- a/contrib/unbound/testcode/unitzonemd.c +++ b/contrib/unbound/testcode/unitzonemd.c diff --cc contrib/unbound/testdata/auth_zonemd_anchor.rpl index 000000000000,c443f7d43f10..c443f7d43f10 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_anchor.rpl +++ b/contrib/unbound/testdata/auth_zonemd_anchor.rpl diff --cc contrib/unbound/testdata/auth_zonemd_anchor_fail.rpl index 000000000000,d055174dcbe7..d055174dcbe7 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_anchor_fail.rpl +++ b/contrib/unbound/testdata/auth_zonemd_anchor_fail.rpl diff --cc contrib/unbound/testdata/auth_zonemd_chain.rpl index 000000000000,74479274fa97..74479274fa97 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_chain.rpl +++ b/contrib/unbound/testdata/auth_zonemd_chain.rpl diff --cc contrib/unbound/testdata/auth_zonemd_chain_fail.rpl index 000000000000,393b1c028fa9..393b1c028fa9 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_chain_fail.rpl +++ b/contrib/unbound/testdata/auth_zonemd_chain_fail.rpl diff --cc contrib/unbound/testdata/auth_zonemd_file.rpl index 000000000000,bdf0ccbae74f..bdf0ccbae74f mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_file.rpl +++ b/contrib/unbound/testdata/auth_zonemd_file.rpl diff --cc contrib/unbound/testdata/auth_zonemd_file_fail.rpl index 000000000000,69487cf6512c..69487cf6512c mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_file_fail.rpl +++ b/contrib/unbound/testdata/auth_zonemd_file_fail.rpl diff --cc contrib/unbound/testdata/auth_zonemd_insecure.rpl index 000000000000,18a4117d86ac..18a4117d86ac mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_insecure.rpl +++ b/contrib/unbound/testdata/auth_zonemd_insecure.rpl diff --cc contrib/unbound/testdata/auth_zonemd_insecure_absent.rpl index 000000000000,1c3f488080ee..1c3f488080ee mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_insecure_absent.rpl +++ b/contrib/unbound/testdata/auth_zonemd_insecure_absent.rpl diff --cc contrib/unbound/testdata/auth_zonemd_insecure_absent_reject.rpl index 000000000000,beb9f5b9ac89..beb9f5b9ac89 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_insecure_absent_reject.rpl +++ b/contrib/unbound/testdata/auth_zonemd_insecure_absent_reject.rpl diff --cc contrib/unbound/testdata/auth_zonemd_insecure_fail.rpl index 000000000000,f7aad071e3b9..f7aad071e3b9 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_insecure_fail.rpl +++ b/contrib/unbound/testdata/auth_zonemd_insecure_fail.rpl diff --cc contrib/unbound/testdata/auth_zonemd_nokey.rpl index 000000000000,a89414bf631c..a89414bf631c mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_nokey.rpl +++ b/contrib/unbound/testdata/auth_zonemd_nokey.rpl diff --cc contrib/unbound/testdata/auth_zonemd_permissive_mode.rpl index 000000000000,4149daa927f4..4149daa927f4 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_permissive_mode.rpl +++ b/contrib/unbound/testdata/auth_zonemd_permissive_mode.rpl diff --cc contrib/unbound/testdata/auth_zonemd_xfr.rpl index 000000000000,89e22cea1472..89e22cea1472 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_xfr.rpl +++ b/contrib/unbound/testdata/auth_zonemd_xfr.rpl diff --cc contrib/unbound/testdata/auth_zonemd_xfr_anchor.rpl index 000000000000,667de2eae0da..667de2eae0da mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_xfr_anchor.rpl +++ b/contrib/unbound/testdata/auth_zonemd_xfr_anchor.rpl diff --cc contrib/unbound/testdata/auth_zonemd_xfr_anchor_fail.rpl index 000000000000,237ed9498e39..237ed9498e39 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_xfr_anchor_fail.rpl +++ b/contrib/unbound/testdata/auth_zonemd_xfr_anchor_fail.rpl diff --cc contrib/unbound/testdata/auth_zonemd_xfr_chain.rpl index 000000000000,4deb99bcbd8a..4deb99bcbd8a mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_xfr_chain.rpl +++ b/contrib/unbound/testdata/auth_zonemd_xfr_chain.rpl diff --cc contrib/unbound/testdata/auth_zonemd_xfr_chain_fail.rpl index 000000000000,3e09c9e8e40b..3e09c9e8e40b mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_xfr_chain_fail.rpl +++ b/contrib/unbound/testdata/auth_zonemd_xfr_chain_fail.rpl diff --cc contrib/unbound/testdata/auth_zonemd_xfr_fail.rpl index 000000000000,f54ca7e086f0..f54ca7e086f0 mode 000000,100644..100644 --- a/contrib/unbound/testdata/auth_zonemd_xfr_fail.rpl +++ b/contrib/unbound/testdata/auth_zonemd_xfr_fail.rpl diff --cc contrib/unbound/testdata/http_user_agent.tdir/127.0.0.1/example.com.zone index 000000000000,695eb1c32bd4..695eb1c32bd4 mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/127.0.0.1/example.com.zone +++ b/contrib/unbound/testdata/http_user_agent.tdir/127.0.0.1/example.com.zone diff --cc contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.conf index 000000000000,c563416aefbe..c563416aefbe mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.conf +++ b/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.conf diff --cc contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.dsc index 000000000000,6b24c43fc7ab..6b24c43fc7ab mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.dsc +++ b/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.dsc diff --cc contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.post index 000000000000,797ff57c8bbc..797ff57c8bbc mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.post +++ b/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.post diff --cc contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.pre index 000000000000,e94bd536edb4..e94bd536edb4 mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.pre +++ b/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.pre diff --cc contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.test index 000000000000,afc0fbbe6f4b..afc0fbbe6f4b mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.test +++ b/contrib/unbound/testdata/http_user_agent.tdir/http_user_agent.test diff --cc contrib/unbound/testdata/http_user_agent.tdir/petal.key index 000000000000,6614e498fcd2..6614e498fcd2 mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/petal.key +++ b/contrib/unbound/testdata/http_user_agent.tdir/petal.key diff --cc contrib/unbound/testdata/http_user_agent.tdir/petal.pem index 000000000000,19c8b895ba86..19c8b895ba86 mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/petal.pem +++ b/contrib/unbound/testdata/http_user_agent.tdir/petal.pem diff --cc contrib/unbound/testdata/http_user_agent.tdir/unbound_control.key index 000000000000,753a4ef6162e..753a4ef6162e mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/unbound_control.key +++ b/contrib/unbound/testdata/http_user_agent.tdir/unbound_control.key diff --cc contrib/unbound/testdata/http_user_agent.tdir/unbound_control.pem index 000000000000,a1edf7017f1d..a1edf7017f1d mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/unbound_control.pem +++ b/contrib/unbound/testdata/http_user_agent.tdir/unbound_control.pem diff --cc contrib/unbound/testdata/http_user_agent.tdir/unbound_server.key index 000000000000,370a7bbb2f22..370a7bbb2f22 mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/unbound_server.key +++ b/contrib/unbound/testdata/http_user_agent.tdir/unbound_server.key diff --cc contrib/unbound/testdata/http_user_agent.tdir/unbound_server.pem index 000000000000,986807310f2b..986807310f2b mode 000000,100644..100644 --- a/contrib/unbound/testdata/http_user_agent.tdir/unbound_server.pem +++ b/contrib/unbound/testdata/http_user_agent.tdir/unbound_server.pem diff --cc contrib/unbound/testdata/rpz_rootwc.rpl index 000000000000,1fb94a1439fa..1fb94a1439fa mode 000000,100644..100644 --- a/contrib/unbound/testdata/rpz_rootwc.rpl +++ b/contrib/unbound/testdata/rpz_rootwc.rpl diff --cc contrib/unbound/testdata/svcb.tdir/crypto.cloudflare.com.zone index 000000000000,53c89c735ba1..53c89c735ba1 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/crypto.cloudflare.com.zone +++ b/contrib/unbound/testdata/svcb.tdir/crypto.cloudflare.com.zone diff --cc contrib/unbound/testdata/svcb.tdir/svcb.dsc index 000000000000,6eae7638e9b0..6eae7638e9b0 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.dsc +++ b/contrib/unbound/testdata/svcb.tdir/svcb.dsc diff --cc contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-01 index 000000000000,c60151692ee8..c60151692ee8 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-01 +++ b/contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-01 diff --cc contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-02 index 000000000000,9d6f0186d535..9d6f0186d535 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-02 +++ b/contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-02 diff --cc contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-03 index 000000000000,bb819daae316..bb819daae316 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-03 +++ b/contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-03 diff --cc contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-04 index 000000000000,ae02ac417b1b..ae02ac417b1b mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-04 +++ b/contrib/unbound/testdata/svcb.tdir/svcb.failure-cases-04 diff --cc contrib/unbound/testdata/svcb.tdir/svcb.success-cases.zone index 000000000000,5d6339542f67..5d6339542f67 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.success-cases.zone +++ b/contrib/unbound/testdata/svcb.tdir/svcb.success-cases.zone diff --cc contrib/unbound/testdata/svcb.tdir/svcb.success-cases.zone.cmp index 000000000000,e504e7b18ad5..e504e7b18ad5 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.success-cases.zone.cmp +++ b/contrib/unbound/testdata/svcb.tdir/svcb.success-cases.zone.cmp diff --cc contrib/unbound/testdata/svcb.tdir/svcb.test index 000000000000,707287d5cf89..707287d5cf89 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.test +++ b/contrib/unbound/testdata/svcb.tdir/svcb.test diff --cc contrib/unbound/testdata/svcb.tdir/svcb.test-vectors-pf.zone index 000000000000,d2cb5087bf9a..d2cb5087bf9a mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.test-vectors-pf.zone +++ b/contrib/unbound/testdata/svcb.tdir/svcb.test-vectors-pf.zone diff --cc contrib/unbound/testdata/svcb.tdir/svcb.test-vectors-wf.zone index 000000000000,bf47ab75c594..bf47ab75c594 mode 000000,100644..100644 --- a/contrib/unbound/testdata/svcb.tdir/svcb.test-vectors-wf.zone +++ b/contrib/unbound/testdata/svcb.tdir/svcb.test-vectors-wf.zone diff --cc contrib/unbound/testdata/zonemd.example1.zone index 000000000000,b1a44895f05c..b1a44895f05c mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example1.zone +++ b/contrib/unbound/testdata/zonemd.example1.zone diff --cc contrib/unbound/testdata/zonemd.example10.zone index 000000000000,33ca2828e019..33ca2828e019 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example10.zone +++ b/contrib/unbound/testdata/zonemd.example10.zone diff --cc contrib/unbound/testdata/zonemd.example11.zone index 000000000000,7562f79729b7..7562f79729b7 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example11.zone +++ b/contrib/unbound/testdata/zonemd.example11.zone diff --cc contrib/unbound/testdata/zonemd.example12.zone index 000000000000,4fc04bf88eb2..4fc04bf88eb2 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example12.zone +++ b/contrib/unbound/testdata/zonemd.example12.zone diff --cc contrib/unbound/testdata/zonemd.example13.zone index 000000000000,9f311c91291e..9f311c91291e mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example13.zone +++ b/contrib/unbound/testdata/zonemd.example13.zone diff --cc contrib/unbound/testdata/zonemd.example14.zone index 000000000000,bc4cdacdbbf5..bc4cdacdbbf5 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example14.zone +++ b/contrib/unbound/testdata/zonemd.example14.zone diff --cc contrib/unbound/testdata/zonemd.example15.zone index 000000000000,8a10689101d7..8a10689101d7 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example15.zone +++ b/contrib/unbound/testdata/zonemd.example15.zone diff --cc contrib/unbound/testdata/zonemd.example16.zone index 000000000000,7520744d3180..7520744d3180 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example16.zone +++ b/contrib/unbound/testdata/zonemd.example16.zone diff --cc contrib/unbound/testdata/zonemd.example17.zone index 000000000000,4315f9054af4..4315f9054af4 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example17.zone +++ b/contrib/unbound/testdata/zonemd.example17.zone diff --cc contrib/unbound/testdata/zonemd.example2.zone index 000000000000,14b7ea689ffa..14b7ea689ffa mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example2.zone +++ b/contrib/unbound/testdata/zonemd.example2.zone diff --cc contrib/unbound/testdata/zonemd.example3.zone index 000000000000,12389f3d5181..12389f3d5181 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example3.zone +++ b/contrib/unbound/testdata/zonemd.example3.zone diff --cc contrib/unbound/testdata/zonemd.example4.zone index 000000000000,dae0f17c708c..dae0f17c708c mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example4.zone +++ b/contrib/unbound/testdata/zonemd.example4.zone diff --cc contrib/unbound/testdata/zonemd.example5.zone index 000000000000,d88380ade09f..d88380ade09f mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example5.zone +++ b/contrib/unbound/testdata/zonemd.example5.zone diff --cc contrib/unbound/testdata/zonemd.example6.zone index 000000000000,0a7b05a8dcea..0a7b05a8dcea mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example6.zone +++ b/contrib/unbound/testdata/zonemd.example6.zone diff --cc contrib/unbound/testdata/zonemd.example7.zone index 000000000000,4339bd570c56..4339bd570c56 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example7.zone +++ b/contrib/unbound/testdata/zonemd.example7.zone diff --cc contrib/unbound/testdata/zonemd.example8.zone index 000000000000,2900753c0483..2900753c0483 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example8.zone +++ b/contrib/unbound/testdata/zonemd.example8.zone diff --cc contrib/unbound/testdata/zonemd.example9.zone index 000000000000,9c035aa1310d..9c035aa1310d mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example9.zone +++ b/contrib/unbound/testdata/zonemd.example9.zone diff --cc contrib/unbound/testdata/zonemd.example_a1.zone index 000000000000,331b45a153d6..331b45a153d6 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example_a1.zone +++ b/contrib/unbound/testdata/zonemd.example_a1.zone diff --cc contrib/unbound/testdata/zonemd.example_a2.zone index 000000000000,56d06ae066bf..56d06ae066bf mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example_a2.zone +++ b/contrib/unbound/testdata/zonemd.example_a2.zone diff --cc contrib/unbound/testdata/zonemd.example_a3.zone index 000000000000,45c47ad0508e..45c47ad0508e mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example_a3.zone +++ b/contrib/unbound/testdata/zonemd.example_a3.zone diff --cc contrib/unbound/testdata/zonemd.example_a4.zone index 000000000000,74b913c89e2b..74b913c89e2b mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example_a4.zone +++ b/contrib/unbound/testdata/zonemd.example_a4.zone diff --cc contrib/unbound/testdata/zonemd.example_a5.zone index 000000000000,246f5e2376db..246f5e2376db mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd.example_a5.zone +++ b/contrib/unbound/testdata/zonemd.example_a5.zone diff --cc contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.conf index 000000000000,9afd6e2b1e23..9afd6e2b1e23 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.conf +++ b/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.conf diff --cc contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.dsc index 000000000000,016c3d6c7ff0..016c3d6c7ff0 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.dsc +++ b/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.dsc diff --cc contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.post index 000000000000,5e315088a097..5e315088a097 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.post +++ b/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.post diff --cc contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.pre index 000000000000,fa5e4ca29bbf..fa5e4ca29bbf mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.pre +++ b/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.pre diff --cc contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.test index 000000000000,fbdf07511306..fbdf07511306 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.test +++ b/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.test diff --cc contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.testns index 000000000000,f1678a1ccc30..f1678a1ccc30 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.testns +++ b/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.testns diff --cc contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.zone index 000000000000,01e57a738e37..01e57a738e37 mode 000000,100644..100644 --- a/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.zone +++ b/contrib/unbound/testdata/zonemd_reload.tdir/zonemd_reload.zone diff --cc contrib/unbound/util/config_file.c index f3b7536d07eb,000000000000..083654ebad4c mode 100644,000000..100644 --- a/contrib/unbound/util/config_file.c +++ b/contrib/unbound/util/config_file.c @@@ -1,2607 -1,0 +1,2685 @@@ +/* + * util/config_file.c - reads and stores the config file for unbound. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER 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. + */ + +/** + * \file + * + * This file contains functions for the config file. + */ + +#include "config.h" +#include +#include +#ifdef HAVE_TIME_H +#include +#endif +#include "util/log.h" +#include "util/configyyrename.h" +#include "util/config_file.h" +#include "configparser.h" +#include "util/net_help.h" +#include "util/data/msgparse.h" +#include "util/module.h" +#include "util/regional.h" +#include "util/fptr_wlist.h" +#include "util/data/dname.h" +#include "util/rtt.h" +#include "services/cache/infra.h" +#include "sldns/wire2str.h" +#include "sldns/parseutil.h" +#include "iterator/iterator.h" +#ifdef HAVE_GLOB_H +# include +#endif +#ifdef CLIENT_SUBNET +#include "edns-subnet/edns-subnet.h" +#endif +#ifdef HAVE_PWD_H +#include +#endif + +/** from cfg username, after daemonize setup performed */ +uid_t cfg_uid = (uid_t)-1; +/** from cfg username, after daemonize setup performed */ +gid_t cfg_gid = (gid_t)-1; +/** for debug allow small timeout values for fast rollovers */ +int autr_permit_small_holddown = 0; +/** size (in bytes) of stream wait buffers max */ +size_t stream_wait_max = 4 * 1024 * 1024; +size_t http2_query_buffer_max = 4 * 1024 * 1024; +size_t http2_response_buffer_max = 4 * 1024 * 1024; + +/** global config during parsing */ +struct config_parser_state* cfg_parser = 0; + +/** init ports possible for use */ +static void init_outgoing_availports(int* array, int num); + +struct config_file* +config_create(void) +{ + struct config_file* cfg; + cfg = (struct config_file*)calloc(1, sizeof(struct config_file)); + if(!cfg) + return NULL; + /* the defaults if no config is present */ + cfg->verbosity = 1; + cfg->stat_interval = 0; + cfg->stat_cumulative = 0; + cfg->stat_extended = 0; + cfg->num_threads = 1; + cfg->port = UNBOUND_DNS_PORT; + cfg->do_ip4 = 1; + cfg->do_ip6 = 1; + cfg->do_udp = 1; + cfg->do_tcp = 1; ++ cfg->tcp_reuse_timeout = 60 * 1000; /* 60s in milisecs */ ++ cfg->max_reuse_tcp_queries = 200; + cfg->tcp_upstream = 0; + cfg->udp_upstream_without_downstream = 0; + cfg->tcp_mss = 0; + cfg->outgoing_tcp_mss = 0; + cfg->tcp_idle_timeout = 30 * 1000; /* 30s in millisecs */ ++ cfg->tcp_auth_query_timeout = 3 * 1000; /* 3s in millisecs */ + cfg->do_tcp_keepalive = 0; + cfg->tcp_keepalive_timeout = 120 * 1000; /* 120s in millisecs */ + cfg->ssl_service_key = NULL; + cfg->ssl_service_pem = NULL; + cfg->ssl_port = UNBOUND_DNS_OVER_TLS_PORT; + cfg->ssl_upstream = 0; + cfg->tls_cert_bundle = NULL; + cfg->tls_win_cert = 0; + cfg->tls_use_sni = 1; + cfg->https_port = UNBOUND_DNS_OVER_HTTPS_PORT; + if(!(cfg->http_endpoint = strdup("/dns-query"))) goto error_exit; + cfg->http_max_streams = 100; + cfg->http_query_buffer_size = 4*1024*1024; + cfg->http_response_buffer_size = 4*1024*1024; + cfg->http_nodelay = 1; + cfg->use_syslog = 1; + cfg->log_identity = NULL; /* changed later with argv[0] */ + cfg->log_time_ascii = 0; + cfg->log_queries = 0; + cfg->log_replies = 0; + cfg->log_tag_queryreply = 0; + cfg->log_local_actions = 0; + cfg->log_servfail = 0; +#ifndef USE_WINSOCK +# ifdef USE_MINI_EVENT + /* select max 1024 sockets */ + cfg->outgoing_num_ports = 960; + cfg->num_queries_per_thread = 512; +# else + /* libevent can use many sockets */ + cfg->outgoing_num_ports = 4096; + cfg->num_queries_per_thread = 1024; +# endif + cfg->outgoing_num_tcp = 10; + cfg->incoming_num_tcp = 10; +#else + cfg->outgoing_num_ports = 48; /* windows is limited in num fds */ + cfg->num_queries_per_thread = 24; + cfg->outgoing_num_tcp = 2; /* leaves 64-52=12 for: 4if,1stop,thread4 */ + cfg->incoming_num_tcp = 2; +#endif + cfg->stream_wait_size = 4 * 1024 * 1024; + cfg->edns_buffer_size = 1232; /* from DNS flagday recommendation */ + cfg->msg_buffer_size = 65552; /* 64 k + a small margin */ + cfg->msg_cache_size = 4 * 1024 * 1024; + cfg->msg_cache_slabs = 4; + cfg->jostle_time = 200; + cfg->rrset_cache_size = 4 * 1024 * 1024; + cfg->rrset_cache_slabs = 4; + cfg->host_ttl = 900; + cfg->bogus_ttl = 60; + cfg->min_ttl = 0; + cfg->max_ttl = 3600 * 24; + cfg->max_negative_ttl = 3600; + cfg->prefetch = 0; + cfg->prefetch_key = 0; + cfg->deny_any = 0; + cfg->infra_cache_slabs = 4; + cfg->infra_cache_numhosts = 10000; + cfg->infra_cache_min_rtt = 50; + cfg->infra_keep_probing = 0; + cfg->delay_close = 0; + cfg->udp_connect = 1; + if(!(cfg->outgoing_avail_ports = (int*)calloc(65536, sizeof(int)))) + goto error_exit; + init_outgoing_availports(cfg->outgoing_avail_ports, 65536); + if(!(cfg->username = strdup(UB_USERNAME))) goto error_exit; +#ifdef HAVE_CHROOT + if(!(cfg->chrootdir = strdup(CHROOT_DIR))) goto error_exit; +#endif + if(!(cfg->directory = strdup(RUN_DIR))) goto error_exit; + if(!(cfg->logfile = strdup(""))) goto error_exit; + if(!(cfg->pidfile = strdup(PIDFILE))) goto error_exit; + if(!(cfg->target_fetch_policy = strdup("3 2 1 0 0"))) goto error_exit; + cfg->fast_server_permil = 0; + cfg->fast_server_num = 3; + cfg->donotqueryaddrs = NULL; + cfg->donotquery_localhost = 1; + cfg->root_hints = NULL; + cfg->use_systemd = 0; + cfg->do_daemonize = 1; + cfg->if_automatic = 0; + cfg->so_rcvbuf = 0; + cfg->so_sndbuf = 0; + cfg->so_reuseport = REUSEPORT_DEFAULT; + cfg->ip_transparent = 0; + cfg->ip_freebind = 0; + cfg->ip_dscp = 0; + cfg->num_ifs = 0; + cfg->ifs = NULL; + cfg->num_out_ifs = 0; + cfg->out_ifs = NULL; + cfg->stubs = NULL; + cfg->forwards = NULL; + cfg->auths = NULL; +#ifdef CLIENT_SUBNET + cfg->client_subnet = NULL; + cfg->client_subnet_zone = NULL; + cfg->client_subnet_opcode = LDNS_EDNS_CLIENT_SUBNET; + cfg->client_subnet_always_forward = 0; + cfg->max_client_subnet_ipv4 = 24; + cfg->max_client_subnet_ipv6 = 56; + cfg->min_client_subnet_ipv4 = 0; + cfg->min_client_subnet_ipv6 = 0; + cfg->max_ecs_tree_size_ipv4 = 100; + cfg->max_ecs_tree_size_ipv6 = 100; +#endif + cfg->views = NULL; + cfg->acls = NULL; + cfg->tcp_connection_limits = NULL; + cfg->harden_short_bufsize = 1; + cfg->harden_large_queries = 0; + cfg->harden_glue = 1; + cfg->harden_dnssec_stripped = 1; + cfg->harden_below_nxdomain = 1; + cfg->harden_referral_path = 0; + cfg->harden_algo_downgrade = 0; + cfg->use_caps_bits_for_id = 0; + cfg->caps_whitelist = NULL; + cfg->private_address = NULL; + cfg->private_domain = NULL; + cfg->unwanted_threshold = 0; + cfg->hide_identity = 0; + cfg->hide_version = 0; + cfg->hide_trustanchor = 0; ++ cfg->hide_http_user_agent = 0; + cfg->identity = NULL; + cfg->version = NULL; ++ cfg->http_user_agent = NULL; + cfg->nsid_cfg_str = NULL; + cfg->nsid = NULL; + cfg->nsid_len = 0; + cfg->auto_trust_anchor_file_list = NULL; + cfg->trust_anchor_file_list = NULL; + cfg->trust_anchor_list = NULL; + cfg->trusted_keys_file_list = NULL; + cfg->trust_anchor_signaling = 1; + cfg->root_key_sentinel = 1; + cfg->domain_insecure = NULL; + cfg->val_date_override = 0; + cfg->val_sig_skew_min = 3600; /* at least daylight savings trouble */ + cfg->val_sig_skew_max = 86400; /* at most timezone settings trouble */ ++ cfg->val_max_restart = 5; + cfg->val_clean_additional = 1; + cfg->val_log_level = 0; + cfg->val_log_squelch = 0; + cfg->val_permissive_mode = 0; + cfg->aggressive_nsec = 0; + cfg->ignore_cd = 0; + cfg->serve_expired = 0; + cfg->serve_expired_ttl = 0; + cfg->serve_expired_ttl_reset = 0; + cfg->serve_expired_reply_ttl = 30; + cfg->serve_expired_client_timeout = 0; + cfg->serve_original_ttl = 0; ++ cfg->zonemd_permissive_mode = 0; + cfg->add_holddown = 30*24*3600; + cfg->del_holddown = 30*24*3600; + cfg->keep_missing = 366*24*3600; /* one year plus a little leeway */ + cfg->permit_small_holddown = 0; + cfg->key_cache_size = 4 * 1024 * 1024; + cfg->key_cache_slabs = 4; + cfg->neg_cache_size = 1 * 1024 * 1024; + cfg->local_zones = NULL; + cfg->local_zones_nodefault = NULL; +#ifdef USE_IPSET + cfg->local_zones_ipset = NULL; +#endif + cfg->local_zones_disable_default = 0; + cfg->local_data = NULL; + cfg->local_zone_overrides = NULL; + cfg->unblock_lan_zones = 0; + cfg->insecure_lan_zones = 0; + cfg->python_script = NULL; + cfg->dynlib_file = NULL; + cfg->remote_control_enable = 0; + cfg->control_ifs.first = NULL; + cfg->control_ifs.last = NULL; + cfg->control_port = UNBOUND_CONTROL_PORT; + cfg->control_use_cert = 1; + cfg->minimal_responses = 1; + cfg->rrset_roundrobin = 1; + cfg->unknown_server_time_limit = 376; + cfg->max_udp_size = 4096; + if(!(cfg->server_key_file = strdup(RUN_DIR"/unbound_server.key"))) + goto error_exit; + if(!(cfg->server_cert_file = strdup(RUN_DIR"/unbound_server.pem"))) + goto error_exit; + if(!(cfg->control_key_file = strdup(RUN_DIR"/unbound_control.key"))) + goto error_exit; + if(!(cfg->control_cert_file = strdup(RUN_DIR"/unbound_control.pem"))) + goto error_exit; + +#ifdef CLIENT_SUBNET + if(!(cfg->module_conf = strdup("subnetcache validator iterator"))) goto error_exit; +#else + if(!(cfg->module_conf = strdup("validator iterator"))) goto error_exit; +#endif + if(!(cfg->val_nsec3_key_iterations = - strdup("1024 150 2048 500 4096 2500"))) goto error_exit; ++ strdup("1024 150 2048 150 4096 150"))) goto error_exit; +#if defined(DNSTAP_SOCKET_PATH) + if(!(cfg->dnstap_socket_path = strdup(DNSTAP_SOCKET_PATH))) + goto error_exit; +#endif + cfg->dnstap_bidirectional = 1; + cfg->dnstap_tls = 1; + cfg->disable_dnssec_lame_check = 0; + cfg->ip_ratelimit = 0; + cfg->ratelimit = 0; + cfg->ip_ratelimit_slabs = 4; + cfg->ratelimit_slabs = 4; + cfg->ip_ratelimit_size = 4*1024*1024; + cfg->ratelimit_size = 4*1024*1024; + cfg->ratelimit_for_domain = NULL; + cfg->ratelimit_below_domain = NULL; + cfg->ip_ratelimit_factor = 10; + cfg->ratelimit_factor = 10; + cfg->qname_minimisation = 1; + cfg->qname_minimisation_strict = 0; + cfg->shm_enable = 0; + cfg->shm_key = 11777; + cfg->edns_client_strings = NULL; + cfg->edns_client_string_opcode = 65001; + cfg->dnscrypt = 0; + cfg->dnscrypt_port = 0; + cfg->dnscrypt_provider = NULL; + cfg->dnscrypt_provider_cert = NULL; + cfg->dnscrypt_provider_cert_rotated = NULL; + cfg->dnscrypt_secret_key = NULL; + cfg->dnscrypt_shared_secret_cache_size = 4*1024*1024; + cfg->dnscrypt_shared_secret_cache_slabs = 4; + cfg->dnscrypt_nonce_cache_size = 4*1024*1024; *** 2340 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Aug 17 12:06:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3FFF66322A; Tue, 17 Aug 2021 12:06:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpqWs2qyxz4hdw; Tue, 17 Aug 2021 12:06:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33A251D33E; Tue, 17 Aug 2021 12:06:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HC6nbI038587; Tue, 17 Aug 2021 12:06:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HC6nwI038586; Tue, 17 Aug 2021 12:06:49 GMT (envelope-from git) Date: Tue, 17 Aug 2021 12:06:49 GMT Message-Id: <202108171206.17HC6nwI038586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 451dc2b7cc0c - main - rtld: rework how environment variables are named MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 451dc2b7cc0c845a3f76f9ee670f16699c49b491 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 12:06:49 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=451dc2b7cc0c845a3f76f9ee670f16699c49b491 commit 451dc2b7cc0c845a3f76f9ee670f16699c49b491 Author: Konstantin Belousov AuthorDate: 2021-08-15 18:57:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-17 12:05:46 +0000 rtld: rework how environment variables are named Instead of specifying the main name part of the environment variable as the string literal, create array of the var names and access them by symbolic index. Convert main name parts into complete names by prefixing with ABI-specific ld_env_vars. This way the name is not repeated, and also it can carry additional proporties explicitly. For instance, cleanup of the environment for the setuid image does not require retyping all names. Reviewed by: arichardson, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D31545 --- libexec/rtld-elf/arm/rtld_machdep.h | 1 - libexec/rtld-elf/rtld.c | 178 ++++++++++++++++++++++++++---------- 2 files changed, 131 insertions(+), 48 deletions(-) diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index d890cb377fa3..26e677f26d5a 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -80,7 +80,6 @@ extern void arm_abi_variant_hook(Elf_Auxinfo **); #ifdef __ARM_FP #define md_abi_variant_hook(x) arm_abi_variant_hook(x) -#define RTLD_VARIANT_ENV_NAMES #else #define md_abi_variant_hook(x) #endif diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 61b823aaacf8..6826dde8a160 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -342,23 +342,106 @@ ld_utrace_log(int event, void *handle, void *mapbase, size_t mapsize, utrace(&ut, sizeof(ut)); } -#ifdef RTLD_VARIANT_ENV_NAMES -/* - * construct the env variable based on the type of binary that's - * running. - */ -static inline const char * -_LD(const char *var) +enum { + LD_BIND_NOW = 0, + LD_PRELOAD, + LD_LIBMAP, + LD_LIBRARY_PATH, + LD_LIBRARY_PATH_FDS, + LD_LIBMAP_DISABLE, + LD_BIND_NOT, + LD_DEBUG, + LD_ELF_HINTS_PATH, + LD_LOADFLTR, + LD_LIBRARY_PATH_RPATH, + LD_PRELOAD_FDS, + LD_DYNAMIC_WEAK, + LD_TRACE_LOADED_OBJECTS, + LD_UTRACE, + LD_DUMP_REL_PRE, + LD_DUMP_REL_POST, + LD_TRACE_LOADED_OBJECTS_PROGNAME, + LD_TRACE_LOADED_OBJECTS_FMT1, + LD_TRACE_LOADED_OBJECTS_FMT2, + LD_TRACE_LOADED_OBJECTS_ALL, +}; + +struct ld_env_var_desc { + char n[64]; + bool unsecure; +}; + +static struct ld_env_var_desc ld_env_vars[] = { + [LD_BIND_NOW] = + { .n = "BIND_NOW", .unsecure = false }, + [LD_PRELOAD] = + { .n = "PRELOAD", .unsecure = true }, + [LD_LIBMAP] = + { .n = "LIBMAP", .unsecure = true }, + [LD_LIBRARY_PATH] = + { .n = "LIBRARY_PATH", .unsecure = true }, + [LD_LIBRARY_PATH_FDS] = + { .n = "LIBRARY_PATH_FDS", .unsecure = true }, + [LD_LIBMAP_DISABLE] = + { .n = "LIBMAP_DISABLE", .unsecure = true }, + [LD_BIND_NOT] = + { .n = "BIND_NOT", .unsecure = true }, + [LD_DEBUG] = + { .n = "DEBUG", .unsecure = true }, + [LD_ELF_HINTS_PATH] = + { .n = "ELF_HINTS_PATH", .unsecure = true }, + [LD_LOADFLTR] = + { .n = "LOADFLTR", .unsecure = true }, + [LD_LIBRARY_PATH_RPATH] = + { .n = "LIBRARY_PATH_RPATH", .unsecure = true }, + [LD_PRELOAD_FDS] = + { .n = "PRELOAD_FDS", .unsecure = true }, + [LD_DYNAMIC_WEAK] = + { .n = "DYNAMIC_WEAK", .unsecure = true }, + [LD_TRACE_LOADED_OBJECTS] = + { .n = "TRACE_LOADED_OBJECTS", .unsecure = false }, + [LD_UTRACE] = + { .n = "UTRACE", .unsecure = false }, + [LD_DUMP_REL_PRE] = + { .n = "DUMP_REL_PRE", .unsecure = false }, + [LD_DUMP_REL_POST] = + { .n = "DUMP_REL_POST", .unsecure = false }, + [LD_TRACE_LOADED_OBJECTS_PROGNAME] = + { .n = "TRACE_LOADED_OBJECTS_PROGNAME", .unsecure = false}, + [LD_TRACE_LOADED_OBJECTS_FMT1] = + { .n = "TRACE_LOADED_OBJECTS_FMT1", .unsecure = false}, + [LD_TRACE_LOADED_OBJECTS_FMT2] = + { .n = "TRACE_LOADED_OBJECTS_FMT2", .unsecure = false}, + [LD_TRACE_LOADED_OBJECTS_ALL] = + { .n = "TRACE_LOADED_OBJECTS_ALL", .unsecure = false}, +}; + +static const char * +ld_var(int idx) { - static char buffer[128]; + return (ld_env_vars[idx].n); +} - strlcpy(buffer, ld_env_prefix, sizeof(buffer)); - strlcat(buffer, var, sizeof(buffer)); - return (buffer); +static char * +ld_get_env_var(int idx) +{ + return (getenv(ld_var(idx))); +} + +static void +rtld_init_env_vars(void) +{ + struct ld_env_var_desc *lvd; + size_t sz; + int i; + + sz = strlen(ld_env_prefix); + for (i = 0; i < (int)nitems(ld_env_vars); i++) { + lvd = &ld_env_vars[i]; + memmove(lvd->n + sz, lvd->n, strlen(lvd->n) + 1); + memcpy(lvd->n, ld_env_prefix, sz); + } } -#else -#define _LD(x) LD_ x -#endif /* * Main entry point for dynamic linking. The first argument is the @@ -389,6 +472,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) Elf_Addr *argcp; char **argv, **env, **envp, *kexecpath, *library_path_rpath; const char *argv0, *binpath; + struct ld_env_var_desc *lvd; caddr_t imgentry; char buf[MAXPATHLEN]; int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc; @@ -464,6 +548,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) direct_exec = false; md_abi_variant_hook(aux_info); + rtld_init_env_vars(); fd = -1; if (aux_info[AT_EXECFD] != NULL) { @@ -571,7 +656,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) } } - ld_bind_now = getenv(_LD("BIND_NOW")); + ld_bind_now = ld_get_env_var(LD_BIND_NOW); /* * If the process is tainted, then we un-set the dangerous environment @@ -580,29 +665,27 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) * future processes to honor the potentially un-safe variables. */ if (!trust) { - if (unsetenv(_LD("PRELOAD")) || unsetenv(_LD("LIBMAP")) || - unsetenv(_LD("LIBRARY_PATH")) || unsetenv(_LD("LIBRARY_PATH_FDS")) || - unsetenv(_LD("LIBMAP_DISABLE")) || unsetenv(_LD("BIND_NOT")) || - unsetenv(_LD("DEBUG")) || unsetenv(_LD("ELF_HINTS_PATH")) || - unsetenv(_LD("LOADFLTR")) || unsetenv(_LD("LIBRARY_PATH_RPATH")) || - unsetenv(_LD("PRELOAD_FDS")) || unsetenv(_LD("DYNAMIC_WEAK"))) { - _rtld_error("environment corrupt; aborting"); - rtld_die(); - } + for (i = 0; i < (int)nitems(ld_env_vars); i++) { + lvd = &ld_env_vars[i]; + if (lvd->unsecure && unsetenv(lvd->n)) { + _rtld_error("environment corrupt; aborting"); + rtld_die(); + } + } } - ld_debug = getenv(_LD("DEBUG")); + ld_debug = ld_get_env_var(LD_DEBUG); if (ld_bind_now == NULL) - ld_bind_not = getenv(_LD("BIND_NOT")) != NULL; - ld_dynamic_weak = getenv(_LD("DYNAMIC_WEAK")) == NULL; - libmap_disable = getenv(_LD("LIBMAP_DISABLE")) != NULL; - libmap_override = getenv(_LD("LIBMAP")); - ld_library_path = getenv(_LD("LIBRARY_PATH")); - ld_library_dirs = getenv(_LD("LIBRARY_PATH_FDS")); - ld_preload = getenv(_LD("PRELOAD")); - ld_preload_fds = getenv(_LD("PRELOAD_FDS")); - ld_elf_hints_path = getenv(_LD("ELF_HINTS_PATH")); - ld_loadfltr = getenv(_LD("LOADFLTR")) != NULL; - library_path_rpath = getenv(_LD("LIBRARY_PATH_RPATH")); + ld_bind_not = ld_get_env_var(LD_BIND_NOT) != NULL; + ld_dynamic_weak = ld_get_env_var(LD_DYNAMIC_WEAK) == NULL; + libmap_disable = ld_get_env_var(LD_LIBMAP_DISABLE) != NULL; + libmap_override = ld_get_env_var(LD_LIBMAP); + ld_library_path = ld_get_env_var(LD_LIBRARY_PATH); + ld_library_dirs = ld_get_env_var(LD_LIBRARY_PATH_FDS); + ld_preload = ld_get_env_var(LD_PRELOAD); + ld_preload_fds = ld_get_env_var(LD_PRELOAD_FDS); + ld_elf_hints_path = ld_get_env_var(LD_ELF_HINTS_PATH); + ld_loadfltr = ld_get_env_var(LD_LOADFLTR) != NULL; + library_path_rpath = ld_get_env_var(LD_LIBRARY_PATH_RPATH); if (library_path_rpath != NULL) { if (library_path_rpath[0] == 'y' || library_path_rpath[0] == 'Y' || @@ -611,11 +694,11 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) else ld_library_path_rpath = false; } - dangerous_ld_env = libmap_disable || (libmap_override != NULL) || - (ld_library_path != NULL) || (ld_preload != NULL) || - (ld_elf_hints_path != NULL) || ld_loadfltr || ld_dynamic_weak; - ld_tracing = getenv(_LD("TRACE_LOADED_OBJECTS")); - ld_utrace = getenv(_LD("UTRACE")); + dangerous_ld_env = libmap_disable || libmap_override != NULL || + ld_library_path != NULL || ld_preload != NULL || + ld_elf_hints_path != NULL || ld_loadfltr || ld_dynamic_weak; + ld_tracing = ld_get_env_var(LD_TRACE_LOADED_OBJECTS); + ld_utrace = ld_get_env_var(LD_UTRACE); if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0) ld_elf_hints_path = ld_elf_hints_default; @@ -751,7 +834,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) exit(0); } - if (getenv(_LD("DUMP_REL_PRE")) != NULL) { + if (ld_get_env_var(LD_DUMP_REL_PRE) != NULL) { dump_relocations(obj_main); exit (0); } @@ -779,7 +862,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) if (do_copy_relocations(obj_main) == -1) rtld_die(); - if (getenv(_LD("DUMP_REL_POST")) != NULL) { + if (ld_get_env_var(LD_DUMP_REL_POST) != NULL) { dump_relocations(obj_main); exit (0); } @@ -4715,16 +4798,17 @@ trace_loaded_objects(Obj_Entry *obj) const char *fmt1, *fmt2, *fmt, *main_local, *list_containers; int c; - if ((main_local = getenv(_LD("TRACE_LOADED_OBJECTS_PROGNAME"))) == NULL) + if ((main_local = ld_get_env_var(LD_TRACE_LOADED_OBJECTS_PROGNAME)) == + NULL) main_local = ""; - if ((fmt1 = getenv(_LD("TRACE_LOADED_OBJECTS_FMT1"))) == NULL) + if ((fmt1 = ld_get_env_var(LD_TRACE_LOADED_OBJECTS_FMT1)) == NULL) fmt1 = "\t%o => %p (%x)\n"; - if ((fmt2 = getenv(_LD("TRACE_LOADED_OBJECTS_FMT2"))) == NULL) + if ((fmt2 = ld_get_env_var(LD_TRACE_LOADED_OBJECTS_FMT2)) == NULL) fmt2 = "\t%o (%x)\n"; - list_containers = getenv(_LD("TRACE_LOADED_OBJECTS_ALL")); + list_containers = ld_get_env_var(LD_TRACE_LOADED_OBJECTS_ALL); for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) { Needed_Entry *needed; From owner-dev-commits-src-all@freebsd.org Tue Aug 17 12:06:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4AA266322C; Tue, 17 Aug 2021 12:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpqWt3ZXzz4hf2; Tue, 17 Aug 2021 12:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FA7B1D07B; Tue, 17 Aug 2021 12:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HC6o6q038611; Tue, 17 Aug 2021 12:06:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HC6o6i038610; Tue, 17 Aug 2021 12:06:50 GMT (envelope-from git) Date: Tue, 17 Aug 2021 12:06:50 GMT Message-Id: <202108171206.17HC6o6i038610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bfd4c875a105 - main - rtld: avoid use of of getenv(3) for evaluating rtld env vars (LD_XXX) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bfd4c875a10560aaa2f41e82114df79fde008fdb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 12:06:50 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bfd4c875a10560aaa2f41e82114df79fde008fdb commit bfd4c875a10560aaa2f41e82114df79fde008fdb Author: Konstantin Belousov AuthorDate: 2021-08-16 12:59:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-17 12:05:47 +0000 rtld: avoid use of of getenv(3) for evaluating rtld env vars (LD_XXX) Scan through the set of environment variables during initialization and store values in the corresponding ld_env_var_desc structure, in the single pass at init time. This does not eliminate use of getenv(3) and unsetenv(3) completely, but provides a foundation to do that as the next step. Also organize the scan in a way that makes it easier to support aliases like LD_DEBUG vs. LD_64_DEBUG. Suggested by: arichardson Reviewed by: arichardson, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31545 --- libexec/rtld-elf/rtld.c | 144 ++++++++++++++++++++++++++++-------------------- 1 file changed, 83 insertions(+), 61 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 6826dde8a160..39c41fe0ed24 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -367,82 +367,105 @@ enum { }; struct ld_env_var_desc { - char n[64]; - bool unsecure; + const char *n; + char *val; + const bool unsecure; }; +#define LD_ENV_DESC(var, unsec) \ + [LD_##var] = { .n = #var, .unsecure = unsec } static struct ld_env_var_desc ld_env_vars[] = { - [LD_BIND_NOW] = - { .n = "BIND_NOW", .unsecure = false }, - [LD_PRELOAD] = - { .n = "PRELOAD", .unsecure = true }, - [LD_LIBMAP] = - { .n = "LIBMAP", .unsecure = true }, - [LD_LIBRARY_PATH] = - { .n = "LIBRARY_PATH", .unsecure = true }, - [LD_LIBRARY_PATH_FDS] = - { .n = "LIBRARY_PATH_FDS", .unsecure = true }, - [LD_LIBMAP_DISABLE] = - { .n = "LIBMAP_DISABLE", .unsecure = true }, - [LD_BIND_NOT] = - { .n = "BIND_NOT", .unsecure = true }, - [LD_DEBUG] = - { .n = "DEBUG", .unsecure = true }, - [LD_ELF_HINTS_PATH] = - { .n = "ELF_HINTS_PATH", .unsecure = true }, - [LD_LOADFLTR] = - { .n = "LOADFLTR", .unsecure = true }, - [LD_LIBRARY_PATH_RPATH] = - { .n = "LIBRARY_PATH_RPATH", .unsecure = true }, - [LD_PRELOAD_FDS] = - { .n = "PRELOAD_FDS", .unsecure = true }, - [LD_DYNAMIC_WEAK] = - { .n = "DYNAMIC_WEAK", .unsecure = true }, - [LD_TRACE_LOADED_OBJECTS] = - { .n = "TRACE_LOADED_OBJECTS", .unsecure = false }, - [LD_UTRACE] = - { .n = "UTRACE", .unsecure = false }, - [LD_DUMP_REL_PRE] = - { .n = "DUMP_REL_PRE", .unsecure = false }, - [LD_DUMP_REL_POST] = - { .n = "DUMP_REL_POST", .unsecure = false }, - [LD_TRACE_LOADED_OBJECTS_PROGNAME] = - { .n = "TRACE_LOADED_OBJECTS_PROGNAME", .unsecure = false}, - [LD_TRACE_LOADED_OBJECTS_FMT1] = - { .n = "TRACE_LOADED_OBJECTS_FMT1", .unsecure = false}, - [LD_TRACE_LOADED_OBJECTS_FMT2] = - { .n = "TRACE_LOADED_OBJECTS_FMT2", .unsecure = false}, - [LD_TRACE_LOADED_OBJECTS_ALL] = - { .n = "TRACE_LOADED_OBJECTS_ALL", .unsecure = false}, + LD_ENV_DESC(BIND_NOW, false), + LD_ENV_DESC(PRELOAD, true), + LD_ENV_DESC(LIBMAP, true), + LD_ENV_DESC(LIBRARY_PATH, true), + LD_ENV_DESC(LIBRARY_PATH_FDS, true), + LD_ENV_DESC(LIBMAP_DISABLE, true), + LD_ENV_DESC(BIND_NOT, true), + LD_ENV_DESC(DEBUG, true), + LD_ENV_DESC(ELF_HINTS_PATH, true), + LD_ENV_DESC(LOADFLTR, true), + LD_ENV_DESC(LIBRARY_PATH_RPATH, true), + LD_ENV_DESC(PRELOAD_FDS, true), + LD_ENV_DESC(DYNAMIC_WEAK, true), + LD_ENV_DESC(TRACE_LOADED_OBJECTS, false), + LD_ENV_DESC(UTRACE, false), + LD_ENV_DESC(DUMP_REL_PRE, false), + LD_ENV_DESC(DUMP_REL_POST, false), + LD_ENV_DESC(TRACE_LOADED_OBJECTS_PROGNAME, false), + LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), + LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), + LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), }; -static const char * -ld_var(int idx) +static char * +ld_get_env_var(int idx) { - return (ld_env_vars[idx].n); + return (ld_env_vars[idx].val); } static char * -ld_get_env_var(int idx) +rtld_get_env_val(char **env, const char *name, size_t name_len) { - return (getenv(ld_var(idx))); + char **m, *n, *v; + + for (m = env; *m != NULL; m++) { + n = *m; + v = strchr(n, '='); + if (v == NULL) { + /* corrupt environment? */ + continue; + } + if (v - n == (ptrdiff_t)name_len && + strncmp(name, n, name_len) == 0) + return (v + 1); + } + return (NULL); } static void -rtld_init_env_vars(void) +rtld_init_env_vars_for_prefix(char **env, const char *env_prefix) { struct ld_env_var_desc *lvd; - size_t sz; + size_t prefix_len, nlen; + char **m, *n, *v; int i; - sz = strlen(ld_env_prefix); - for (i = 0; i < (int)nitems(ld_env_vars); i++) { - lvd = &ld_env_vars[i]; - memmove(lvd->n + sz, lvd->n, strlen(lvd->n) + 1); - memcpy(lvd->n, ld_env_prefix, sz); + prefix_len = strlen(env_prefix); + for (m = env; *m != NULL; m++) { + n = *m; + if (strncmp(env_prefix, n, prefix_len) != 0) { + /* Not a rtld environment variable. */ + continue; + } + n += prefix_len; + v = strchr(n, '='); + if (v == NULL) { + /* corrupt environment? */ + continue; + } + for (i = 0; i < (int)nitems(ld_env_vars); i++) { + lvd = &ld_env_vars[i]; + if (lvd->val != NULL) { + /* Saw higher-priority variable name already. */ + continue; + } + nlen = strlen(lvd->n); + if (v - n == (ptrdiff_t)nlen && + strncmp(lvd->n, n, nlen) == 0) { + lvd->val = v + 1; + break; + } + } } } +static void +rtld_init_env_vars(char **env) +{ + rtld_init_env_vars_for_prefix(env, ld_env_prefix); +} + /* * Main entry point for dynamic linking. The first argument is the * stack pointer. The stack is expected to be laid out as described @@ -548,7 +571,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) direct_exec = false; md_abi_variant_hook(aux_info); - rtld_init_env_vars(); + rtld_init_env_vars(env); fd = -1; if (aux_info[AT_EXECFD] != NULL) { @@ -667,12 +690,11 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) if (!trust) { for (i = 0; i < (int)nitems(ld_env_vars); i++) { lvd = &ld_env_vars[i]; - if (lvd->unsecure && unsetenv(lvd->n)) { - _rtld_error("environment corrupt; aborting"); - rtld_die(); - } + if (lvd->unsecure) + lvd->val = NULL; } } + ld_debug = ld_get_env_var(LD_DEBUG); if (ld_bind_now == NULL) ld_bind_not = ld_get_env_var(LD_BIND_NOT) != NULL; From owner-dev-commits-src-all@freebsd.org Tue Aug 17 12:06:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D125C6635CC; Tue, 17 Aug 2021 12:06:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpqWv4wSrz4hYj; Tue, 17 Aug 2021 12:06:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 883CA1D7AB; Tue, 17 Aug 2021 12:06:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HC6pNb038642; Tue, 17 Aug 2021 12:06:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HC6pE2038641; Tue, 17 Aug 2021 12:06:51 GMT (envelope-from git) Date: Tue, 17 Aug 2021 12:06:51 GMT Message-Id: <202108171206.17HC6pE2038641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b4b274889145 - main - rtld: provide private getenv(3) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4b274889145bbc559613b54e7520b95f43e51e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 12:06:51 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b4b274889145bbc559613b54e7520b95f43e51e6 commit b4b274889145bbc559613b54e7520b95f43e51e6 Author: Konstantin Belousov AuthorDate: 2021-08-16 14:02:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-17 12:05:47 +0000 rtld: provide private getenv(3) Reviewed by: arichardson, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31545 --- libexec/rtld-elf/rtld-libc/Makefile.inc | 2 +- libexec/rtld-elf/rtld.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index 7ffcb6e41ec7..ade2dc962aa2 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -27,7 +27,7 @@ SRCS+= rtld_libc.c # Now build the remaining files from libc: .PATH: ${LIBC_SRCTOP}/stdlib -SRCS+= reallocf.c realpath.c getenv.c merge.c reallocarray.c +SRCS+= reallocf.c realpath.c merge.c reallocarray.c # TODO: fix merge.c to build with WARNS=6 .if ${COMPILER_TYPE} == "clang" CFLAGS.merge.c+=-Wno-error=null-pointer-arithmetic diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 39c41fe0ed24..8fb99246a4c1 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6027,6 +6027,12 @@ rtld_strerror(int errnum) return (sys_errlist[errnum]); } +char * +getenv(const char *name) +{ + return (rtld_get_env_val(environ, name, strlen(name))); +} + /* malloc */ void * malloc(size_t nbytes) From owner-dev-commits-src-all@freebsd.org Tue Aug 17 12:06:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 279EB663448; Tue, 17 Aug 2021 12:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpqWw6FQ4z4hfJ; Tue, 17 Aug 2021 12:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1A631D631; Tue, 17 Aug 2021 12:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HC6q3n038666; Tue, 17 Aug 2021 12:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HC6que038665; Tue, 17 Aug 2021 12:06:52 GMT (envelope-from git) Date: Tue, 17 Aug 2021 12:06:52 GMT Message-Id: <202108171206.17HC6que038665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: aa68b3bb2e11 - main - rtld: constify most variables holding references to the environment values MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa68b3bb2e11392f4636b3656b0f0bcacec3385a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 12:06:53 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=aa68b3bb2e11392f4636b3656b0f0bcacec3385a commit aa68b3bb2e11392f4636b3656b0f0bcacec3385a Author: Konstantin Belousov AuthorDate: 2021-08-16 16:55:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-17 12:06:08 +0000 rtld: constify most variables holding references to the environment values Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31545 --- libexec/rtld-elf/libmap.c | 14 ++++++------ libexec/rtld-elf/libmap.h | 2 +- libexec/rtld-elf/rtld.c | 56 +++++++++++++++++++++++++++-------------------- 3 files changed, 40 insertions(+), 32 deletions(-) diff --git a/libexec/rtld-elf/libmap.c b/libexec/rtld-elf/libmap.c index 499d2cd2a1d9..e4388d14b951 100644 --- a/libexec/rtld-elf/libmap.c +++ b/libexec/rtld-elf/libmap.c @@ -64,22 +64,22 @@ static const char *quickbasename(const char *); #define rtld_isspace(c) ((c) == ' ' || (c) == '\t') int -lm_init(char *libmap_override) +lm_init(const char *libmap_override) { - char *p; + char *l, *p; dbg("lm_init(\"%s\")", libmap_override); TAILQ_INIT(&lmp_head); lmc_parse_file(ld_path_libmap_conf); - if (libmap_override) { + if (libmap_override != NULL) { /* * Do some character replacement to make $LDLIBMAP look * like a text file, then parse it. */ - libmap_override = xstrdup(libmap_override); - for (p = libmap_override; *p; p++) { + l = xstrdup(libmap_override); + for (p = l; *p != 0; p++) { switch (*p) { case '=': *p = ' '; @@ -89,8 +89,8 @@ lm_init(char *libmap_override) break; } } - lmc_parse(libmap_override, p - libmap_override); - free(libmap_override); + lmc_parse(l, p - l); + free(l); } return (lm_count == 0); diff --git a/libexec/rtld-elf/libmap.h b/libexec/rtld-elf/libmap.h index 0e9c668b4444..a5ba143f211f 100644 --- a/libexec/rtld-elf/libmap.h +++ b/libexec/rtld-elf/libmap.h @@ -2,7 +2,7 @@ * $FreeBSD$ */ -int lm_init (char *); +int lm_init(const char *); void lm_fini (void); char * lm_find (const char *, const char *); char * lm_findn (const char *, const char *, const size_t); diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 8fb99246a4c1..1a89a7b2c1de 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -123,7 +123,7 @@ static void linkmap_delete(Obj_Entry *); static void load_filtees(Obj_Entry *, int flags, RtldLockState *); static void unload_filtees(Obj_Entry *, RtldLockState *); static int load_needed_objects(Obj_Entry *, int); -static int load_preload_objects(char *, bool); +static int load_preload_objects(const char *, bool); static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); static int obj_disable_relro(Obj_Entry *); @@ -202,24 +202,24 @@ int __sys_openat(int, const char *, int, ...); struct r_debug r_debug __exported; /* for GDB; */ static bool libmap_disable; /* Disable libmap */ static bool ld_loadfltr; /* Immediate filters processing */ -static char *libmap_override; /* Maps to use in addition to libmap.conf */ +static const char *libmap_override;/* Maps to use in addition to libmap.conf */ static bool trust; /* False for setuid and setgid programs */ static bool dangerous_ld_env; /* True if environment variables have been used to affect the libraries loaded */ bool ld_bind_not; /* Disable PLT update */ -static char *ld_bind_now; /* Environment variable for immediate binding */ -static char *ld_debug; /* Environment variable for debugging */ +static const char *ld_bind_now; /* Environment variable for immediate binding */ +static const char *ld_debug; /* Environment variable for debugging */ static bool ld_dynamic_weak = true; /* True if non-weak definition overrides weak definition */ -static char *ld_library_path; /* Environment variable for search path */ -static char *ld_library_dirs; /* Environment variable for library descriptors */ -static char *ld_preload; /* Environment variable for libraries to +static const char *ld_library_path;/* Environment variable for search path */ +static const char *ld_library_dirs;/* Environment variable for library descriptors */ +static const char *ld_preload; /* Environment variable for libraries to load first */ -static char *ld_preload_fds; /* Environment variable for libraries represented by +static const char *ld_preload_fds;/* Environment variable for libraries represented by descriptors */ static const char *ld_elf_hints_path; /* Environment variable for alternative hints path */ static const char *ld_tracing; /* Called from ldd to print libs */ -static char *ld_utrace; /* Use utrace() to log events. */ +static const char *ld_utrace; /* Use utrace() to log events. */ static struct obj_entry_q obj_list; /* Queue of all loaded objects */ static Obj_Entry *obj_main; /* The main program shared object */ static Obj_Entry obj_rtld; /* The dynamic linker shared object */ @@ -367,8 +367,8 @@ enum { }; struct ld_env_var_desc { - const char *n; - char *val; + const char * const n; + const char *val; const bool unsecure; }; #define LD_ENV_DESC(var, unsec) \ @@ -398,13 +398,13 @@ static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), }; -static char * +static const char * ld_get_env_var(int idx) { return (ld_env_vars[idx].val); } -static char * +static const char * rtld_get_env_val(char **env, const char *name, size_t name_len) { char **m, *n, *v; @@ -493,8 +493,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) RtldLockState lockstate; struct stat st; Elf_Addr *argcp; - char **argv, **env, **envp, *kexecpath, *library_path_rpath; - const char *argv0, *binpath; + char **argv, **env, **envp, *kexecpath; + const char *argv0, *binpath, *library_path_rpath; struct ld_env_var_desc *lvd; caddr_t imgentry; char buf[MAXPATHLEN]; @@ -2600,36 +2600,42 @@ load_needed_objects(Obj_Entry *first, int flags) } static int -load_preload_objects(char *p, bool isfd) +load_preload_objects(const char *penv, bool isfd) { Obj_Entry *obj; + const char *name; + size_t len; + char savech, *p, *psave; + int fd; static const char delim[] = " \t:;"; - if (p == NULL) + if (penv == NULL) return (0); + p = psave = xstrdup(penv); p += strspn(p, delim); while (*p != '\0') { - const char *name; - size_t len = strcspn(p, delim); - char savech; - int fd; + len = strcspn(p, delim); savech = p[len]; p[len] = '\0'; if (isfd) { name = NULL; fd = parse_integer(p); - if (fd == -1) + if (fd == -1) { + free(psave); return (-1); + } } else { name = p; fd = -1; } obj = load_object(name, fd, NULL, 0); - if (obj == NULL) + if (obj == NULL) { + free(psave); return (-1); /* XXX - cleanup */ + } obj->z_interpose = true; p[len] = savech; p += len; @@ -2637,6 +2643,7 @@ load_preload_objects(char *p, bool isfd) } LD_UTRACE(UTRACE_PRELOAD_FINISHED, NULL, NULL, 0, 0, NULL); + free(psave); return (0); } @@ -6030,7 +6037,8 @@ rtld_strerror(int errnum) char * getenv(const char *name) { - return (rtld_get_env_val(environ, name, strlen(name))); + return (__DECONST(char *, rtld_get_env_val(environ, name, + strlen(name)))); } /* malloc */ From owner-dev-commits-src-all@freebsd.org Tue Aug 17 13:56:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E6EB664E60; Tue, 17 Aug 2021 13:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpsyL75ZBz4q55; Tue, 17 Aug 2021 13:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B27F21EF04; Tue, 17 Aug 2021 13:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HDuQsm084943; Tue, 17 Aug 2021 13:56:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HDuQ6I084942; Tue, 17 Aug 2021 13:56:26 GMT (envelope-from git) Date: Tue, 17 Aug 2021 13:56:26 GMT Message-Id: <202108171356.17HDuQ6I084942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 72a8cdd3226e - stable/13 - build.7: Describe the default value for LOCAL_MODULES MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 72a8cdd3226e472e21976ef918d4692fe55ee553 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 13:56:27 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=72a8cdd3226e472e21976ef918d4692fe55ee553 commit 72a8cdd3226e472e21976ef918d4692fe55ee553 Author: Mark Johnston AuthorDate: 2021-08-10 17:34:57 +0000 Commit: Mark Johnston CommitDate: 2021-08-17 13:56:15 +0000 build.7: Describe the default value for LOCAL_MODULES Suggested by: jhb (cherry picked from commit 805c3af898a8fed6a92caa069011c0ce7fa542ef) --- share/man/man7/build.7 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index d0806fa79dbb..015e80c4bc24 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -609,6 +609,8 @@ as part of the and .Cm installkernel process. +Defaults to the list of sub-directories of +.Va LOCAL_MODULES_DIR . .It Va LOCAL_MODULES_DIR The directory in which to search for the kernel modules specified by .Va LOCAL_MODULES . From owner-dev-commits-src-all@freebsd.org Tue Aug 17 13:56:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D894D664F0F; Tue, 17 Aug 2021 13:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpsyK5l2wz4ppd; Tue, 17 Aug 2021 13:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B5AD1EE8F; Tue, 17 Aug 2021 13:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HDuPIE084919; Tue, 17 Aug 2021 13:56:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HDuP4o084918; Tue, 17 Aug 2021 13:56:25 GMT (envelope-from git) Date: Tue, 17 Aug 2021 13:56:25 GMT Message-Id: <202108171356.17HDuP4o084918@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1ee912e80e37 - stable/13 - build.7: Document LOCAL_MODULES and LOCAL_MODULES_DIR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1ee912e80e37a702df4af6df20cc19b767da7bd9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 13:56:27 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1ee912e80e37a702df4af6df20cc19b767da7bd9 commit 1ee912e80e37a702df4af6df20cc19b767da7bd9 Author: Mark Johnston AuthorDate: 2021-08-10 15:42:35 +0000 Commit: Mark Johnston CommitDate: 2021-08-17 13:56:13 +0000 build.7: Document LOCAL_MODULES and LOCAL_MODULES_DIR Reviewed by: 0mp, imp Sponsored by: The FreeBSD Foundation (cherry picked from commit e7a13643b17c3ec7357b26324986587dab810da5) --- share/man/man7/build.7 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index bad3da789e5a..d0806fa79dbb 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 15, 2021 +.Dd August 10, 2021 .Dt BUILD 7 .Os .Sh NAME @@ -602,6 +602,19 @@ process. .Bd -literal -offset indent make PORTS_MODULES=emulators/virtualbox-ose-kmod kernel .Ed +.It Va LOCAL_MODULES +A list of external kernel modules that should be built and installed +as part of the +.Cm buildkernel +and +.Cm installkernel +process. +.It Va LOCAL_MODULES_DIR +The directory in which to search for the kernel modules specified by +.Va LOCAL_MODULES . +Each kernel module should consist of a directory containing a makefile. +Defaults to +.Pa ${LOCALBASE}/sys/modules . .It Va SRCCONF Specify a file to override the default .Pa /etc/src.conf . From owner-dev-commits-src-all@freebsd.org Tue Aug 17 14:17:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6902166511D; Tue, 17 Aug 2021 14:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GptQw2D6Zz4s5G; Tue, 17 Aug 2021 14:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9751EF36; Tue, 17 Aug 2021 14:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HEHivH012484; Tue, 17 Aug 2021 14:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HEHifv012483; Tue, 17 Aug 2021 14:17:44 GMT (envelope-from git) Date: Tue, 17 Aug 2021 14:17:44 GMT Message-Id: <202108171417.17HEHifv012483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: ee3ca711a898 - main - libfetch: use more portable getline() interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee3ca711a898cf41330c320826ea1e0e6e451f1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 14:17:44 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ee3ca711a898cf41330c320826ea1e0e6e451f1d commit ee3ca711a898cf41330c320826ea1e0e6e451f1d Author: Daniel Kolesa AuthorDate: 2021-08-17 14:01:46 +0000 Commit: Baptiste Daroussin CommitDate: 2021-08-17 14:17:22 +0000 libfetch: use more portable getline() interface this is for better portability in order to avoid using a function which is BSD-only or available via libbsd MFC after: 3 weeks --- lib/libfetch/http.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index e61e23b1425a..61f0f393ed98 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1526,12 +1526,12 @@ http_get_proxy(struct url * url, const char *flags) static void http_print_html(FILE *out, FILE *in) { - size_t len; - char *line, *p, *q; + size_t len = 0; + char *line = NULL, *p, *q; int comment, tag; comment = tag = 0; - while ((line = fgetln(in, &len)) != NULL) { + while (getline(&line, &len, in) >= 0) { while (len && isspace((unsigned char)line[len - 1])) --len; for (p = q = line; q < line + len; ++q) { @@ -1559,6 +1559,8 @@ http_print_html(FILE *out, FILE *in) fwrite(p, q - p, 1, out); fputc('\n', out); } + + free(line); } From owner-dev-commits-src-all@freebsd.org Tue Aug 17 15:01:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 628A4665E1A; Tue, 17 Aug 2021 15:01:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpvPn25bBz4vL1; Tue, 17 Aug 2021 15:01:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FD701FC4C; Tue, 17 Aug 2021 15:01:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HF1nUb077631; Tue, 17 Aug 2021 15:01:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HF1nrm077630; Tue, 17 Aug 2021 15:01:49 GMT (envelope-from git) Date: Tue, 17 Aug 2021 15:01:49 GMT Message-Id: <202108171501.17HF1nrm077630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: e86469075c5e - main - netinet tests: delete an interface with pending lookups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e86469075c5e391cc86e5bcd4f252712a69de37e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 15:01:49 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e86469075c5e391cc86e5bcd4f252712a69de37e commit e86469075c5e391cc86e5bcd4f252712a69de37e Author: Kristof Provost AuthorDate: 2021-08-17 14:19:29 +0000 Commit: Kristof Provost CommitDate: 2021-08-17 15:01:21 +0000 netinet tests: delete an interface with pending lookups This has been known to trigger panics. It currently doesn't, but we may as well have a test for it. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netinet/arp.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/sys/netinet/arp.sh b/tests/sys/netinet/arp.sh index 8b5b30911314..b909b9a48fb3 100755 --- a/tests/sys/netinet/arp.sh +++ b/tests/sys/netinet/arp.sh @@ -85,12 +85,48 @@ arp_del_success_cleanup() { vnet_cleanup } +atf_test_case "pending_delete_if" "cleanup" +pending_delete_if_head() { + atf_set descr 'Test having pending link layer lookups on interface delete' + atf_set require.user root +} + +pending_delete_if_body() { + vnet_init + + jname="arp_pending_delete_if" + epair=$(vnet_mkepair) + + ifconfig ${epair}b up + + vnet_mkjail ${jname} ${epair}a + jexec ${jname} ifconfig ${epair}a 198.51.100.1/24 + for i in `seq 2 200` + do + jexec ${jname} ping 198.51.100.${i} & + done + + # Give the ping processes time to send their ARP requests + sleep 1 + + jexec ${jname} arp -an + jexec ${jname} killall ping + + # Delete the interface. Test failure panics the machine. + ifconfig ${epair}b destroy +} + +pending_delete_if_cleanup() { + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "arp_add_success" atf_add_test_case "arp_del_success" + atf_add_test_case "pending_delete_if" } # end From owner-dev-commits-src-all@freebsd.org Tue Aug 17 15:51:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F6516667DF; Tue, 17 Aug 2021 15:51:35 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpwWC39pfz3GCw; Tue, 17 Aug 2021 15:51:35 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f50.google.com with SMTP id e186so28272746iof.12; Tue, 17 Aug 2021 08:51:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sKz+mtzsE77MSMOk+xYmAua9lzPLgVI0Wpg7qnUuhY0=; b=Ia+DxBo5cvmW4lPM7SpKaACRbyBHdwswVATSzVfKnZkXC6xB8aApa1yC8B/YnAc5Sf J2+HDi8ct8kR1SUBj0AgMszrO4J2AUBoKvP6POc891Sm3ttP9YqvVwJv9xKPSM6+FZtY JX8kpmjFSIHfjSf6m8+Hse2v48gfUNN3ja/DpYUXYU0SSwxlSmQl1/dLNE9Tfi7t9oCo hH2w7ZbInz6WCYv3mBUTKkan9mYIfdDzd6FK9FR4nuH8+ckV7IQ4DDpfYGLHHbH1P0TP j0/hdixhciBl1MVLTOwDS71tUFuHrC4uxAdBf6Hos3Nj/ZC3s+UhP8ukEV5tp+FZYRfe IPLg== X-Gm-Message-State: AOAM532G0PqsydFdY1dCdL730YOtZAOLQHGh4lzCMauapPg1WxOyEhjx fiIg5YS2840iqU7yfHgArNFUNUhmSfv0hzrRl3MZO32I+vg= X-Google-Smtp-Source: ABdhPJwwF80nCEUzDOYXT5XVEY9K0+HiVFSt/Oxhy6rf6shStkJ8qK9fEulSHU+9nssLA6qiJnblvkZE95T8g1SXFSk= X-Received: by 2002:a02:90d0:: with SMTP id c16mr3548873jag.106.1629215488476; Tue, 17 Aug 2021 08:51:28 -0700 (PDT) MIME-Version: 1.0 References: <202108170631.17H6VrAE094329@gitrepo.freebsd.org> In-Reply-To: <202108170631.17H6VrAE094329@gitrepo.freebsd.org> From: Ed Maste Date: Tue, 17 Aug 2021 11:51:12 -0400 Message-ID: Subject: Re: git: e8ad0a0059af - main - ipmi: New tunable to deactivate IPMI watchdog To: Wojciech Macek Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GpwWC39pfz3GCw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 15:51:35 -0000 On Tue, 17 Aug 2021 at 02:31, Wojciech Macek wrote: > > The branch main has been updated by wma: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e8ad0a0059afe1cd0af39bab49018ae7bc9be937 > > commit e8ad0a0059afe1cd0af39bab49018ae7bc9be937 > Author: Wojciech Macek > AuthorDate: 2021-08-17 06:28:21 +0000 > Commit: Wojciech Macek > CommitDate: 2021-08-17 06:31:00 +0000 > > ipmi: New tunable to deactivate IPMI watchdog A bit of post-commit review: >From sysctl.9: "For boolean sysctls, negative logic should be totally avoided. That is, do not use names like no_foobar or foobar_disable. They are confusing and lead to configuration errors. Use positive logic instead: foobar, foobar_enable." So, preferable to have wd_init_enable = 1 instead. > +SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_init_disable, CTLFLAG_RWTUN, > + &wd_init_disable, 0, ""); and we should have a description here. From owner-dev-commits-src-all@freebsd.org Tue Aug 17 16:11:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C974A666D5C; Tue, 17 Aug 2021 16:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gpwxf4L7cz3H9M; Tue, 17 Aug 2021 16:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D2BE20925; Tue, 17 Aug 2021 16:11:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HGB2EL069729; Tue, 17 Aug 2021 16:11:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HGB2P9069728; Tue, 17 Aug 2021 16:11:02 GMT (envelope-from git) Date: Tue, 17 Aug 2021 16:11:02 GMT Message-Id: <202108171611.17HGB2P9069728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: dff1ba09f747 - main - sysctl.9: put negative sense sysctl note in own paragraph MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dff1ba09f74725bb0a0b7b8c229ed4e6665b43e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 16:11:02 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dff1ba09f74725bb0a0b7b8c229ed4e6665b43e6 commit dff1ba09f74725bb0a0b7b8c229ed4e6665b43e6 Author: Ed Maste AuthorDate: 2021-08-17 15:58:03 +0000 Commit: Ed Maste CommitDate: 2021-08-17 16:10:44 +0000 sysctl.9: put negative sense sysctl note in own paragraph The sysctl man page cautions against negative-sense boolean sysctls (foobar_disable), but it gets lost at the end of a large paragraph. Move it to a separate paragraph in an attempt to make it more clear. This man page could use a more holistic review and edit pass. This change is simple and straightforward and I hope provides a small but immediate benefit. --- share/man/man9/sysctl.9 | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man9/sysctl.9 b/share/man/man9/sysctl.9 index bae693489c73..f2b1159e71a8 100644 --- a/share/man/man9/sysctl.9 +++ b/share/man/man9/sysctl.9 @@ -1024,6 +1024,7 @@ underscore characters, as in Underscore characters may be omitted only if the name consists of not more than two words, each being not longer than four characters, as in .Va bootfile . +.Pp For boolean sysctls, negative logic should be totally avoided. That is, do not use names like .Va no_foobar From owner-dev-commits-src-all@freebsd.org Tue Aug 17 16:16:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 449DD666E52; Tue, 17 Aug 2021 16:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gpx3s1Gjtz3HHR; Tue, 17 Aug 2021 16:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12DE420C73; Tue, 17 Aug 2021 16:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HGGOm8072584; Tue, 17 Aug 2021 16:16:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HGGOwv072583; Tue, 17 Aug 2021 16:16:24 GMT (envelope-from git) Date: Tue, 17 Aug 2021 16:16:24 GMT Message-Id: <202108171616.17HGGOwv072583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 0e92585cde51 - main - fstyp: add BeFS support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e92585cde5101506720ca1b904372317b7d84b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 16:16:25 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=0e92585cde5101506720ca1b904372317b7d84b6 commit 0e92585cde5101506720ca1b904372317b7d84b6 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-17 15:07:31 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-08-17 16:16:07 +0000 fstyp: add BeFS support A simple support for detecting BeFS (BeOS) filesystem Submitted by: Miguel Gocobachi Differential Revision: https://reviews.freebsd.org/D29917 --- usr.sbin/fstyp/Makefile | 2 +- usr.sbin/fstyp/befs.c | 70 +++++++++++++++++++++++++++++++++++++ usr.sbin/fstyp/fstyp.8 | 4 ++- usr.sbin/fstyp/fstyp.c | 1 + usr.sbin/fstyp/fstyp.h | 1 + usr.sbin/fstyp/tests/Makefile | 1 + usr.sbin/fstyp/tests/befs.img.bz2 | Bin 0 -> 132 bytes usr.sbin/fstyp/tests/fstyp_test.sh | 11 ++++++ 8 files changed, 88 insertions(+), 2 deletions(-) diff --git a/usr.sbin/fstyp/Makefile b/usr.sbin/fstyp/Makefile index 14b5d9dfd9c3..384e2f7dee60 100644 --- a/usr.sbin/fstyp/Makefile +++ b/usr.sbin/fstyp/Makefile @@ -3,7 +3,7 @@ .include PROG= fstyp -SRCS= apfs.c cd9660.c exfat.c ext2fs.c fstyp.c geli.c hammer.c \ +SRCS= apfs.c befs.c cd9660.c exfat.c ext2fs.c fstyp.c geli.c hammer.c \ hammer2.c hfsplus.c msdosfs.c ntfs.c ufs.c .if ${MK_ZFS} != "no" diff --git a/usr.sbin/fstyp/befs.c b/usr.sbin/fstyp/befs.c new file mode 100644 index 000000000000..352fe7d4c296 --- /dev/null +++ b/usr.sbin/fstyp/befs.c @@ -0,0 +1,70 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Miguel Gocobachi + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "fstyp.h" + +#define B_OS_NAME_LENGTH 32 +#define BEFS_BLOCK_OFFSET 512 +#define BEFS_SUPER_BLOCK_MAGIC1 0x42465331 + +struct disk_super_block { + char name[B_OS_NAME_LENGTH]; + int32_t magic1; +}; + +int +fstyp_befs(FILE *fp, char *label, size_t size) +{ + struct disk_super_block *volume; + + volume = read_buf(fp, BEFS_BLOCK_OFFSET, sizeof(*volume)); + + if (volume == NULL) { + return (1); + } + + if (volume->magic1 == BEFS_SUPER_BLOCK_MAGIC1) { + strlcpy(label, volume->name, size); + free(volume); + + return (0); + } + + free(volume); + + return (1); +} diff --git a/usr.sbin/fstyp/fstyp.8 b/usr.sbin/fstyp/fstyp.8 index d587e331490f..22d41628d8d5 100644 --- a/usr.sbin/fstyp/fstyp.8 +++ b/usr.sbin/fstyp/fstyp.8 @@ -42,7 +42,7 @@ The .Nm utility is used to determine the filesystem type on a given device. -It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS filesystems. +It can recognize BeFS (BeOS), ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS filesystems. When the .Fl u flag is specified, @@ -59,6 +59,8 @@ The filesystem name is printed to the standard output as, respectively: .Bl -item -offset indent -compact .It +befs +.It cd9660 .It exfat diff --git a/usr.sbin/fstyp/fstyp.c b/usr.sbin/fstyp/fstyp.c index 46b5d6100011..b39277914aed 100644 --- a/usr.sbin/fstyp/fstyp.c +++ b/usr.sbin/fstyp/fstyp.c @@ -64,6 +64,7 @@ static struct { char *precache_encoding; } fstypes[] = { { "apfs", &fstyp_apfs, true, NULL }, + { "befs", &fstyp_befs, false, NULL }, { "cd9660", &fstyp_cd9660, false, NULL }, { "exfat", &fstyp_exfat, false, EXFAT_ENC }, { "ext2fs", &fstyp_ext2fs, false, NULL }, diff --git a/usr.sbin/fstyp/fstyp.h b/usr.sbin/fstyp/fstyp.h index 73861d7fdc0d..f11d66f5ffc2 100644 --- a/usr.sbin/fstyp/fstyp.h +++ b/usr.sbin/fstyp/fstyp.h @@ -50,6 +50,7 @@ char *checked_strdup(const char *s); void rtrim(char *label, size_t size); int fstyp_apfs(FILE *fp, char *label, size_t size); +int fstyp_befs(FILE *fp, char *label, size_t size); int fstyp_cd9660(FILE *fp, char *label, size_t size); int fstyp_exfat(FILE *fp, char *label, size_t size); int fstyp_ext2fs(FILE *fp, char *label, size_t size); diff --git a/usr.sbin/fstyp/tests/Makefile b/usr.sbin/fstyp/tests/Makefile index 9c4624af3a4c..c821bc9b45eb 100644 --- a/usr.sbin/fstyp/tests/Makefile +++ b/usr.sbin/fstyp/tests/Makefile @@ -4,6 +4,7 @@ PACKAGE= tests ATF_TESTS_SH= fstyp_test +${PACKAGE}FILES+= befs.img.bz2 ${PACKAGE}FILES+= dfr-01-xfat.img.bz2 ${PACKAGE}FILES+= ext2.img.bz2 ${PACKAGE}FILES+= ext3.img.bz2 diff --git a/usr.sbin/fstyp/tests/befs.img.bz2 b/usr.sbin/fstyp/tests/befs.img.bz2 new file mode 100644 index 000000000000..c2a6693216d5 Binary files /dev/null and b/usr.sbin/fstyp/tests/befs.img.bz2 differ diff --git a/usr.sbin/fstyp/tests/fstyp_test.sh b/usr.sbin/fstyp/tests/fstyp_test.sh index 8f76424f5f75..81a549629dd7 100755 --- a/usr.sbin/fstyp/tests/fstyp_test.sh +++ b/usr.sbin/fstyp/tests/fstyp_test.sh @@ -27,6 +27,16 @@ # $FreeBSD$ +atf_test_case befs +befs_head() { + atf_set "descr" "fstyp(8) can detect BeFS and label filesystem" +} +befs_body() { + bzcat $(atf_get_srcdir)/befs.img.bz2 > befs.img + atf_check -s exit:0 -o inline:"befs\n" fstyp befs.img + atf_check -s exit:0 -o inline:"befs BeFS\n" fstyp -l befs.img +} + atf_test_case cd9660 cd9660_head() { atf_set "descr" "fstyp(8) should detect cd9660 filesystems" @@ -257,6 +267,7 @@ zeros_body() { atf_init_test_cases() { + atf_add_test_case befs atf_add_test_case cd9660 atf_add_test_case cd9660_label atf_add_test_case dir From owner-dev-commits-src-all@freebsd.org Tue Aug 17 16:45:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92716667B12; Tue, 17 Aug 2021 16:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpxjH3TgTz3KL0; Tue, 17 Aug 2021 16:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FA4D2116D; Tue, 17 Aug 2021 16:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HGjNJ8012770; Tue, 17 Aug 2021 16:45:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HGjNL3012769; Tue, 17 Aug 2021 16:45:23 GMT (envelope-from git) Date: Tue, 17 Aug 2021 16:45:23 GMT Message-Id: <202108171645.17HGjNL3012769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: d9f25575a29f - main - Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9f25575a29ff7c83f226349a10a37b9aaf75ad5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 16:45:23 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d9f25575a29ff7c83f226349a10a37b9aaf75ad5 commit d9f25575a29ff7c83f226349a10a37b9aaf75ad5 Author: Alex Richardson AuthorDate: 2021-08-17 16:44:40 +0000 Commit: Alex Richardson CommitDate: 2021-08-17 16:44:52 +0000 Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now I enabled these options again in 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3, but unfortunately only my specific build configuration worked whereas the build with default options is still broken. --- share/mk/src.opts.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index bd360dd1ad29..e4427cb637a1 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -360,6 +360,13 @@ __DEFAULT_YES_OPTIONS+=OPENMP __DEFAULT_NO_OPTIONS+=OPENMP .endif +.if ${.MAKE.OS} != "FreeBSD" +# Bootstrapping the toolchain and building LLDB currently results in build +# failures non-FreeBSD, so disable these options until the fixes that are +# currently under review have landed. +BROKEN_OPTIONS+=LLDB CLANG_BOOTSTRAP LLD_BOOTSTRAP +.endif + .include # From owner-dev-commits-src-all@freebsd.org Tue Aug 17 17:00:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B0B1667B53 for ; Tue, 17 Aug 2021 17:00:46 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gpy316B96z3LGc for ; Tue, 17 Aug 2021 17:00:45 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f53.google.com with SMTP id w21-20020a7bc1150000b02902e69ba66ce6so2620666wmi.1 for ; Tue, 17 Aug 2021 10:00:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=B+GUQWjEyKw/XCznC/FyWMLdH+W/leftPpwx2pujvAA=; b=PYmxm2Mwzwob0gpbrIk4tAyVuXhFOtbdGm4TthMfAn6P5t3x5QclL7ZyxYKVsrKytJ wZ5Xs3WmawNjmEN/RQVpH2FccakBQ6iWK8x4xkKkNpUC7JUCfc+7gU9l6sVN3MYkRCPd 8Oss0AixyUyxP97ktCed9dq22D0ZANIfbFc5jEZYV0EIWo2NIPP0Pzkx/i8Ct6Fl5fcX yceeOG6qvaYfwr474SSsXY8H8PDtRPzM/FHTT7oGRfNbfLygnq8UP6UgQXv0CkH/Aa3Z 08WAIpY5t2TMy2Qu78bvfm9r4CP8L7ZaXf3U42wy0rEbnGg9qMQv1nTMo5vzQm/tNrNA 3uGw== X-Gm-Message-State: AOAM532TXIu0Xvh6hVy7gkyp0t43i0AyDj8R639BOFxEuONkSWjxUt/A EEWA4gSB/bLGKR8VmrS143wDmg== X-Google-Smtp-Source: ABdhPJwpuxlm41Jpzw6pmP0q5Ydq1xmFDK+PzTiPbBDMFdAVE21gKmI2RzXg16B64ONJHtwgrPhzQA== X-Received: by 2002:a1c:a7c2:: with SMTP id q185mr449541wme.91.1629219639585; Tue, 17 Aug 2021 10:00:39 -0700 (PDT) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id a11sm3118243wrw.67.2021.08.17.10.00.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Aug 2021 10:00:39 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: d9f25575a29f - main - Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now From: Jessica Clarke In-Reply-To: <202108171645.17HGjNL3012769@gitrepo.freebsd.org> Date: Tue, 17 Aug 2021 18:00:38 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4C25E4D8-D33E-4397-956E-D21B80239EBA@freebsd.org> References: <202108171645.17HGjNL3012769@gitrepo.freebsd.org> To: Alex Richardson X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4Gpy316B96z3LGc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 17:00:46 -0000 On 17 Aug 2021, at 17:45, Alex Richardson = wrote: >=20 > The branch main has been updated by arichardson: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd9f25575a29ff7c83f226349a10a37b9= aaf75ad5 >=20 > commit d9f25575a29ff7c83f226349a10a37b9aaf75ad5 > Author: Alex Richardson > AuthorDate: 2021-08-17 16:44:40 +0000 > Commit: Alex Richardson > CommitDate: 2021-08-17 16:44:52 +0000 >=20 > Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD = for now >=20 > I enabled these options again in = 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3, > but unfortunately only my specific build configuration worked = whereas the > build with default options is still broken. Insta-MFC to fix stable/13 cross-builds? Jess From owner-dev-commits-src-all@freebsd.org Tue Aug 17 17:15:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CA246684C2; Tue, 17 Aug 2021 17:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpyNK6yZwz3Nbw; Tue, 17 Aug 2021 17:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D741A21847; Tue, 17 Aug 2021 17:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HHFjo3053392; Tue, 17 Aug 2021 17:15:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HHFjXM053391; Tue, 17 Aug 2021 17:15:45 GMT (envelope-from git) Date: Tue, 17 Aug 2021 17:15:45 GMT Message-Id: <202108171715.17HHFjXM053391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: f49931c1423e - main - style.9: remove an outdated comment about indent(1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f49931c1423e1c9454214f82bbb3ec30d0fee57d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 17:15:46 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=f49931c1423e1c9454214f82bbb3ec30d0fee57d commit f49931c1423e1c9454214f82bbb3ec30d0fee57d Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-17 15:56:41 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-08-17 17:06:24 +0000 style.9: remove an outdated comment about indent(1) indent(1) has had -ncs and -nbs for some time now. --- share/man/man9/style.9 | 3 --- 1 file changed, 3 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index fff0e3815c13..beeb8d4568d2 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -734,9 +734,6 @@ scope is undesirable and will elicit complaints from a good compiler. Casts and .Ic sizeof Ns 's are not followed by a space. -Note that -.Xr indent 1 -does not understand this rule. .Ic sizeof Ns 's are written with parenthesis always. The redundant parenthesis rules do not apply to From owner-dev-commits-src-all@freebsd.org Tue Aug 17 17:15:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DDE16682A4; Tue, 17 Aug 2021 17:15:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpyNM0p75z3NQP; Tue, 17 Aug 2021 17:15:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 016362198F; Tue, 17 Aug 2021 17:15:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HHFknI053416; Tue, 17 Aug 2021 17:15:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HHFkBe053415; Tue, 17 Aug 2021 17:15:46 GMT (envelope-from git) Date: Tue, 17 Aug 2021 17:15:46 GMT Message-Id: <202108171715.17HHFkBe053415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: c66e9307ea95 - main - mount.h: improve a comment about flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c66e9307ea9520f3d6e4d38dc842a99a31ae80bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 17:15:47 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=c66e9307ea9520f3d6e4d38dc842a99a31ae80bf commit c66e9307ea9520f3d6e4d38dc842a99a31ae80bf Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-14 20:07:09 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-08-17 17:08:33 +0000 mount.h: improve a comment about flags The comment only specifies MNT_ROOTFS - which is set by the kernel when mounting its root file system. So it's not clear if any other flags are not quite right and for what reason. --- sys/sys/mount.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 016c7e9c188d..f4b5945d3ad0 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -398,9 +398,7 @@ struct mntoptnames { #define MNT_EXTLSCERTUSER 0x0000010000000000ULL /* require TLS with user cert */ /* - * Flags set by internal operations, - * but visible to the user. - * XXX some of these are not quite right.. (I've never seen the root flag set) + * Flags set by internal operations, but visible to the user. */ #define MNT_LOCAL 0x0000000000001000ULL /* filesystem is stored locally */ #define MNT_QUOTA 0x0000000000002000ULL /* quotas are enabled on fs */ From owner-dev-commits-src-all@freebsd.org Tue Aug 17 18:08:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FE1B668CB9 for ; Tue, 17 Aug 2021 18:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GpzY50LWrz3hVD; Tue, 17 Aug 2021 18:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E82222212E; Tue, 17 Aug 2021 18:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HI8OY7020452; Tue, 17 Aug 2021 18:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HI8Ods020451; Tue, 17 Aug 2021 18:08:24 GMT (envelope-from git) Date: Tue, 17 Aug 2021 18:08:24 GMT Message-Id: <202108171808.17HI8Ods020451@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: f3678d70ff8f..8ae86e2edc73 - vendor/openzfs/master - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/master X-Git-Reftype: branch X-Git-Commit: 8ae86e2edc736483c1530fd689525aa2460eaec8 X-Git-Oldrev: f3678d70ff8f98d67caf377ec0326c9a6c7bcf29 X-Git-Newrev: 8ae86e2edc736483c1530fd689525aa2460eaec8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 18:08:25 -0000 The branch vendor/openzfs/master has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=f3678d70ff8f..8ae86e2edc73 6bc61d22c439 Run arc_evict thread at higher priority a7491f999086 Fix usage of find in tests/Makefile.am 6daf036ab506 Add zfs.sh -r flag to reload modules 41bee4039c54 zfs: add missed dependency of zfs module on zlib e945e8d7f4fc Restore FreeBSD sysctl processing for arc.min and arc.max 5bfc3a99f93d ZTS: Avoid unset $tmpdir in redacted_panic e829a865bf64 Use more atomics in refcounts 7f9d9e6f39fd Avoid vq_lock drop in vdev_queue_aggregate() cfe8e960f193 Fix/improve dbuf hits accounting bb7ad5d326a0 Optimize arc_l2c_only lists assertions 72f0521abadd Increase default volblocksize from 8KB to 16KB 6b88b4b501a9 Remove b_pabd/b_rabd allocation from arc_hdr_alloc() 0f402668f994 zfs.4: Fix typo s/compatiblity/compatibility/ abbf0bd4eba8 Linux 4.11 compat: statx support 8ae86e2edc73 ZTS: Add tests for creation time From owner-dev-commits-src-all@freebsd.org Tue Aug 17 18:34:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9609669274; Tue, 17 Aug 2021 18:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq07453Cqz3kGL; Tue, 17 Aug 2021 18:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 958902286C; Tue, 17 Aug 2021 18:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HIYOMr061760; Tue, 17 Aug 2021 18:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HIYOjv061759; Tue, 17 Aug 2021 18:34:24 GMT (envelope-from git) Date: Tue, 17 Aug 2021 18:34:24 GMT Message-Id: <202108171834.17HIYOjv061759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: cbc186360c65 - main - cxgbei: Restructure how PDU limits are managed. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbc186360c658eda884ed97f37cdc2d1b6512b91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 18:34:24 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cbc186360c658eda884ed97f37cdc2d1b6512b91 commit cbc186360c658eda884ed97f37cdc2d1b6512b91 Author: John Baldwin AuthorDate: 2021-08-17 18:14:11 +0000 Commit: John Baldwin CommitDate: 2021-08-17 18:14:11 +0000 cxgbei: Restructure how PDU limits are managed. - Compute data segment limits in read_pdu_limits() rather than PDU length limits. - Add back connection-specific PDU overhead lengths to compute PDU length limits in icl_cxgbei_conn_handoff(). Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31574 --- sys/dev/cxgbe/cxgbei/cxgbei.c | 19 ++++++++++++++----- sys/dev/cxgbe/cxgbei/cxgbei.h | 4 ++-- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 30 ++++++++++++++++++------------ 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index 5cce7d3fce05..24187c862fe6 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -97,8 +97,8 @@ static struct cxgbei_worker_thread_softc *cwt_softc; static struct proc *cxgbei_proc; static void -read_pdu_limits(struct adapter *sc, uint32_t *max_tx_pdu_len, - uint32_t *max_rx_pdu_len) +read_pdu_limits(struct adapter *sc, uint32_t *max_tx_data_len, + uint32_t *max_rx_data_len) { uint32_t tx_len, rx_len, r, v; @@ -114,8 +114,17 @@ read_pdu_limits(struct adapter *sc, uint32_t *max_tx_pdu_len, rx_len = min(rx_len, v); tx_len = min(tx_len, v); - *max_tx_pdu_len = rounddown2(tx_len, 512); - *max_rx_pdu_len = rounddown2(rx_len, 512); + /* + * AHS is not supported by the kernel so we'll not account for + * it either in our PDU len -> data segment len conversions. + */ + rx_len -= ISCSI_BHS_SIZE + ISCSI_HEADER_DIGEST_SIZE + + ISCSI_DATA_DIGEST_SIZE; + tx_len -= ISCSI_BHS_SIZE + ISCSI_HEADER_DIGEST_SIZE + + ISCSI_DATA_DIGEST_SIZE; + + *max_tx_data_len = rounddown2(tx_len, 512); + *max_rx_data_len = rounddown2(rx_len, 512); } /* @@ -135,7 +144,7 @@ cxgbei_init(struct adapter *sc, struct cxgbei_data *ci) MPASS(sc->vres.iscsi.size > 0); MPASS(ci != NULL); - read_pdu_limits(sc, &ci->max_tx_pdu_len, &ci->max_rx_pdu_len); + read_pdu_limits(sc, &ci->max_tx_data_len, &ci->max_rx_data_len); pr = &ci->pr; r = t4_read_reg(sc, A_ULP_RX_ISCSI_PSZ); diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.h b/sys/dev/cxgbe/cxgbei/cxgbei.h index 433f15b743fe..20754fa893a8 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.h +++ b/sys/dev/cxgbe/cxgbei/cxgbei.h @@ -125,8 +125,8 @@ ip_to_icp(struct icl_pdu *ip) } struct cxgbei_data { - u_int max_tx_pdu_len; - u_int max_rx_pdu_len; + u_int max_tx_data_len; + u_int max_rx_data_len; u_int ddp_threshold; struct ppod_region pr; diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 5526388915f7..a6e7f8b95815 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -783,6 +783,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) struct tcpcb *tp; struct toepcb *toep; cap_rights_t rights; + u_int max_rx_pdu_len, max_tx_pdu_len; int error, max_iso_pdus; MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); @@ -828,6 +829,17 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) icc->sc = fa.sc; ci = icc->sc->iscsi_ulp_softc; + max_rx_pdu_len = ISCSI_BHS_SIZE + ic->ic_max_recv_data_segment_length; + max_tx_pdu_len = ISCSI_BHS_SIZE + ic->ic_max_send_data_segment_length; + if (ic->ic_header_crc32c) { + max_rx_pdu_len += ISCSI_HEADER_DIGEST_SIZE; + max_tx_pdu_len += ISCSI_HEADER_DIGEST_SIZE; + } + if (ic->ic_data_crc32c) { + max_rx_pdu_len += ISCSI_DATA_DIGEST_SIZE; + max_tx_pdu_len += ISCSI_DATA_DIGEST_SIZE; + } + inp = sotoinpcb(so); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -853,7 +865,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5) { max_iso_pdus = CXGBEI_MAX_ISO_PAYLOAD / - ci->max_tx_pdu_len; + max_tx_pdu_len; ic->ic_hw_isomax = max_iso_pdus * ic->ic_max_send_data_segment_length; } else @@ -864,15 +876,15 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) toep->ulpcb = icc; send_iscsi_flowc_wr(icc->sc, toep, - roundup(max_iso_pdus * ci->max_tx_pdu_len, tp->t_maxseg)); + roundup(max_iso_pdus * max_tx_pdu_len, tp->t_maxseg)); set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode); error = 0; } INP_WUNLOCK(inp); if (error == 0) { - error = icl_cxgbei_setsockopt(ic, so, ci->max_tx_pdu_len, - ci->max_rx_pdu_len); + error = icl_cxgbei_setsockopt(ic, so, max_tx_pdu_len, + max_rx_pdu_len); } return (error); @@ -1378,18 +1390,12 @@ cxgbei_limits(struct adapter *sc, void *arg) ci = sc->iscsi_ulp_softc; MPASS(ci != NULL); - /* - * AHS is not supported by the kernel so we'll not account for - * it either in our PDU len -> data segment len conversions. - */ - max_dsl = ci->max_rx_pdu_len - ISCSI_BHS_SIZE - - ISCSI_HEADER_DIGEST_SIZE - ISCSI_DATA_DIGEST_SIZE; + max_dsl = ci->max_rx_data_len; if (idl->idl_max_recv_data_segment_length > max_dsl) idl->idl_max_recv_data_segment_length = max_dsl; - max_dsl = ci->max_tx_pdu_len - ISCSI_BHS_SIZE - - ISCSI_HEADER_DIGEST_SIZE - ISCSI_DATA_DIGEST_SIZE; + max_dsl = ci->max_tx_data_len; if (idl->idl_max_send_data_segment_length > max_dsl) idl->idl_max_send_data_segment_length = max_dsl; } From owner-dev-commits-src-all@freebsd.org Tue Aug 17 18:34:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECA12669744; Tue, 17 Aug 2021 18:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq0756Fdmz3kW8; Tue, 17 Aug 2021 18:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA2E4225E2; Tue, 17 Aug 2021 18:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HIYPDp061789; Tue, 17 Aug 2021 18:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HIYPY0061787; Tue, 17 Aug 2021 18:34:25 GMT (envelope-from git) Date: Tue, 17 Aug 2021 18:34:25 GMT Message-Id: <202108171834.17HIYPY0061787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f28715fdc1f7 - main - cxgbei: Only round PDU data segment lengths down by 512 on T5. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f28715fdc1f7e801b260369787e7bcd633a481bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 18:34:26 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f28715fdc1f7e801b260369787e7bcd633a481bb commit f28715fdc1f7e801b260369787e7bcd633a481bb Author: John Baldwin AuthorDate: 2021-08-17 18:14:29 +0000 Commit: John Baldwin CommitDate: 2021-08-17 18:14:29 +0000 cxgbei: Only round PDU data segment lengths down by 512 on T5. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31575 --- sys/dev/cxgbe/cxgbei/cxgbei.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index 24187c862fe6..acf6ee74c94f 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -123,8 +123,13 @@ read_pdu_limits(struct adapter *sc, uint32_t *max_tx_data_len, tx_len -= ISCSI_BHS_SIZE + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE; - *max_tx_data_len = rounddown2(tx_len, 512); - *max_rx_data_len = rounddown2(rx_len, 512); + if (chip_id(sc) == CHELSIO_T5) { + rx_len = rounddown2(rx_len, 512); + tx_len = rounddown2(tx_len, 512); + } + + *max_tx_data_len = tx_len; + *max_rx_data_len = rx_len; } /* From owner-dev-commits-src-all@freebsd.org Tue Aug 17 18:34:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 098676695BB; Tue, 17 Aug 2021 18:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq0766kScz3kYg; Tue, 17 Aug 2021 18:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE5322286D; Tue, 17 Aug 2021 18:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HIYQk8061815; Tue, 17 Aug 2021 18:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HIYQJT061814; Tue, 17 Aug 2021 18:34:26 GMT (envelope-from git) Date: Tue, 17 Aug 2021 18:34:26 GMT Message-Id: <202108171834.17HIYQJT061814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d75b0870e542 - main - cxgbei: Restrict received PDUs to 4 DDP pages in length. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d75b0870e542613e63d9f4ac8ec9fb22817e34fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 18:34:27 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d75b0870e542613e63d9f4ac8ec9fb22817e34fa commit d75b0870e542613e63d9f4ac8ec9fb22817e34fa Author: John Baldwin AuthorDate: 2021-08-17 18:14:37 +0000 Commit: John Baldwin CommitDate: 2021-08-17 18:14:37 +0000 cxgbei: Restrict received PDUs to 4 DDP pages in length. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31576 --- sys/dev/cxgbe/cxgbei/cxgbei.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index acf6ee74c94f..8dc580d65770 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -98,7 +98,7 @@ static struct proc *cxgbei_proc; static void read_pdu_limits(struct adapter *sc, uint32_t *max_tx_data_len, - uint32_t *max_rx_data_len) + uint32_t *max_rx_data_len, struct ppod_region *pr) { uint32_t tx_len, rx_len, r, v; @@ -123,6 +123,14 @@ read_pdu_limits(struct adapter *sc, uint32_t *max_tx_data_len, tx_len -= ISCSI_BHS_SIZE + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE; + /* + * DDP can place only 4 pages for a single PDU. A single + * request might use larger pages than the smallest page size, + * but that cannot be guaranteed. Assume the smallest DDP + * page size for this limit. + */ + rx_len = min(rx_len, 4 * (1U << pr->pr_page_shift[0])); + if (chip_id(sc) == CHELSIO_T5) { rx_len = rounddown2(rx_len, 512); tx_len = rounddown2(tx_len, 512); @@ -149,8 +157,6 @@ cxgbei_init(struct adapter *sc, struct cxgbei_data *ci) MPASS(sc->vres.iscsi.size > 0); MPASS(ci != NULL); - read_pdu_limits(sc, &ci->max_tx_data_len, &ci->max_rx_data_len); - pr = &ci->pr; r = t4_read_reg(sc, A_ULP_RX_ISCSI_PSZ); rc = t4_init_ppod_region(pr, &sc->vres.iscsi, r, "iSCSI page pods"); @@ -176,6 +182,8 @@ cxgbei_init(struct adapter *sc, struct cxgbei_data *ci) V_ISCSITAGMASK(M_ISCSITAGMASK), pr->pr_tag_mask); } + read_pdu_limits(sc, &ci->max_tx_data_len, &ci->max_rx_data_len, pr); + sysctl_ctx_init(&ci->ctx); oid = device_get_sysctl_tree(sc->dev); /* dev.t5nex.X */ children = SYSCTL_CHILDREN(oid); From owner-dev-commits-src-all@freebsd.org Tue Aug 17 19:07:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F01216697D3; Tue, 17 Aug 2021 19:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq0rp6D3Dz3m3w; Tue, 17 Aug 2021 19:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDD1E22E7C; Tue, 17 Aug 2021 19:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HJ76LE002675; Tue, 17 Aug 2021 19:07:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HJ76kd002674; Tue, 17 Aug 2021 19:07:06 GMT (envelope-from git) Date: Tue, 17 Aug 2021 19:07:06 GMT Message-Id: <202108171907.17HJ76kd002674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: a3ddd7c92b99 - main - _worldtmp: Fix some sub-makes not working with make -n MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3ddd7c92b9947ac4518fb0b55c2275422d0d627 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 19:07:07 -0000 The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=a3ddd7c92b9947ac4518fb0b55c2275422d0d627 commit a3ddd7c92b9947ac4518fb0b55c2275422d0d627 Author: Bryan Drewery AuthorDate: 2021-08-17 19:06:14 +0000 Commit: Bryan Drewery CommitDate: 2021-08-17 19:06:40 +0000 _worldtmp: Fix some sub-makes not working with make -n --- Makefile.inc1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 2b631c2311f0..9209f0ef053c 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1046,11 +1046,11 @@ _worldtmp: .PHONY @touch ${WORLDTMP}/${.TARGET} # We can't use mtree to create the worldtmp directories since it may not be # available on the target system (this happens e.g. when building on non-FreeBSD) - cd ${.CURDIR}/tools/build; \ + ${_+_}cd ${.CURDIR}/tools/build; \ ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy installdirs # In order to build without inheriting $PATH we need to add symlinks to the host # tools in $WORLDTMP for the tools that we don't build during bootstrap-tools - cd ${.CURDIR}/tools/build; \ + ${_+_}cd ${.CURDIR}/tools/build; \ ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy host-symlinks _legacy: From owner-dev-commits-src-all@freebsd.org Tue Aug 17 19:11:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43EF8669EE8; Tue, 17 Aug 2021 19:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq0xl1S3tz3mXC; Tue, 17 Aug 2021 19:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19DD823256; Tue, 17 Aug 2021 19:11:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HJBNPN015907; Tue, 17 Aug 2021 19:11:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HJBMu3015906; Tue, 17 Aug 2021 19:11:22 GMT (envelope-from git) Date: Tue, 17 Aug 2021 19:11:22 GMT Message-Id: <202108171911.17HJBMu3015906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 2faf504d1ab8 - main - zfs: merge openzfs/zfs@8ae86e2ed (master) into main MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2faf504d1ab821fe2b9df9d2afb49bb35e1334f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 19:11:23 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=2faf504d1ab821fe2b9df9d2afb49bb35e1334f4 commit 2faf504d1ab821fe2b9df9d2afb49bb35e1334f4 Merge: a3ddd7c92b99 8ae86e2edc73 Author: Martin Matuska AuthorDate: 2021-08-17 19:10:18 +0000 Commit: Martin Matuska CommitDate: 2021-08-17 19:10:44 +0000 zfs: merge openzfs/zfs@8ae86e2ed (master) into main Notable upstream pull request merges: #12422 Fix/improve dbuf hits accounting #12406 Increase default volblocksize from 8KB to 16KB #12398 Remove b_pabd/b_rabd allocation from arc_hdr_alloc() #12397 Run arc_evict thread at higher priority #12297 Avoid vq_lock drop in vdev_queue_aggregate() #12161 Restore FreeBSD sysctl processing for arc.min and arc.max Obtained from: OpenZFS OpenZFS commit: 8ae86e2edc736483c1530fd689525aa2460eaec8 sys/contrib/openzfs/configure.ac | 1 + .../openzfs/include/os/freebsd/spl/sys/mod_os.h | 6 + .../openzfs/include/os/linux/zfs/sys/trace_arc.h | 4 +- .../include/os/linux/zfs/sys/zfs_znode_impl.h | 4 +- sys/contrib/openzfs/include/sys/arc.h | 7 + sys/contrib/openzfs/include/sys/arc_impl.h | 14 +- sys/contrib/openzfs/include/sys/fs/zfs.h | 2 +- sys/contrib/openzfs/include/sys/zfs_refcount.h | 8 +- sys/contrib/openzfs/include/sys/zthr.h | 5 +- sys/contrib/openzfs/man/man4/zfs.4 | 2 +- sys/contrib/openzfs/man/man7/zfsprops.7 | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c | 2 +- .../openzfs/module/os/freebsd/zfs/sysctl_os.c | 53 +++++- sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 14 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 12 +- .../openzfs/module/os/linux/zfs/zpl_inode.c | 34 +++- sys/contrib/openzfs/module/zfs/arc.c | 192 ++++++++++++--------- sys/contrib/openzfs/module/zfs/refcount.c | 51 +++--- sys/contrib/openzfs/module/zfs/spa.c | 7 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_queue.c | 63 +++---- sys/contrib/openzfs/module/zfs/zthr.c | 19 +- sys/contrib/openzfs/scripts/zfs.sh | 12 +- sys/contrib/openzfs/tests/Makefile.am | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 4 + .../openzfs/tests/test-runner/bin/zts-report.py.in | 7 + .../openzfs/tests/zfs-tests/include/libtest.shlib | 28 +++ .../tests/zfs-tests/tests/functional/Makefile.am | 1 + .../functional/cli_root/zfs_create/zfs_create.cfg | 2 +- .../cli_root/zfs_diff/zfs_diff_timestamp.ksh | 6 +- .../zfs-tests/tests/functional/crtime/Makefile.am | 5 + .../zfs-tests/tests/functional/crtime/cleanup.ksh | 34 ++++ .../tests/functional/crtime/crtime_001_pos.ksh | 71 ++++++++ .../zfs-tests/tests/functional/crtime/setup.ksh | 35 ++++ .../tests/functional/nopwrite/nopwrite_volume.ksh | 4 +- .../functional/redacted_send/redacted_panic.ksh | 10 +- .../tests/functional/reservation/reservation.shlib | 6 +- sys/modules/zfs/zfs_config.h | 4 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 39 files changed, 535 insertions(+), 202 deletions(-) diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am index 000000000000,13e1c2dde31b..13e1c2dde31b mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh index 000000000000,3166bd6ec16e..3166bd6ec16e mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh index 000000000000,4f9810553fa6..4f9810553fa6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh index 000000000000,fc5cec3063a6..fc5cec3063a6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh diff --cc sys/modules/zfs/zfs_config.h index 9542f241179f,000000000000..75eec9c705a4 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,849 -1,0 +1,849 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* ->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ +/* #undef HAVE_VFS_READDIR */ + +/* fops->read/write_iter() are available */ +/* #undef HAVE_VFS_RW_ITERATE */ + +/* __set_page_dirty_nobuffers exists */ +/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* yes */ +/* #undef HAVE_WAIT_ON_BIT_ACTION */ + +/* wait_queue_entry_t exists */ +/* #undef HAVE_WAIT_QUEUE_ENTRY_T */ + +/* wq_head->head and wq_entry->entry exist */ +/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */ + +/* xattr_handler->get() wants dentry */ +/* #undef HAVE_XATTR_GET_DENTRY */ + +/* xattr_handler->get() wants both dentry and inode */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE */ + +/* xattr_handler->get() wants xattr_handler */ +/* #undef HAVE_XATTR_GET_HANDLER */ + +/* xattr_handler has name */ +/* #undef HAVE_XATTR_HANDLER_NAME */ + +/* xattr_handler->list() wants dentry */ +/* #undef HAVE_XATTR_LIST_DENTRY */ + +/* xattr_handler->list() wants xattr_handler */ +/* #undef HAVE_XATTR_LIST_HANDLER */ + +/* xattr_handler->list() wants simple */ +/* #undef HAVE_XATTR_LIST_SIMPLE */ + +/* xattr_handler->set() wants dentry */ +/* #undef HAVE_XATTR_SET_DENTRY */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() wants xattr_handler */ +/* #undef HAVE_XATTR_SET_HANDLER */ + +/* xattr_handler->set() takes user_namespace */ +/* #undef HAVE_XATTR_SET_USERNS */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* __posix_acl_chmod() exists */ +/* #undef HAVE___POSIX_ACL_CHMOD */ + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* TBD: fetch(3) support */ +#if 0 +/* whether the chosen libfetch is to be loaded at run-time */ +#define LIBFETCH_DYNAMIC 1 + +/* libfetch is fetch(3) */ +#define LIBFETCH_IS_FETCH 1 + +/* libfetch is libcurl */ +#define LIBFETCH_IS_LIBCURL 0 + +/* soname of chosen libfetch */ +#define LIBFETCH_SONAME "libfetch.so.6" +#endif + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* hardened module_param_call */ +/* #undef MODULE_PARAM_CALL_CONST */ + +/* struct shrink_control has nid */ +/* #undef SHRINK_CONTROL_HAS_NID */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* True if ZFS is to be compiled for a FreeBSD system */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* zfs debugging enabled */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* enum node_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum node_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum node_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* enum zone_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum zone_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum zone_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* global_node_page_state() exists */ +/* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ + +/* global_zone_page_state() exists */ +/* #undef ZFS_GLOBAL_ZONE_PAGE_STATE */ + +/* Define to 1 if GPL-only symbols can be used */ +/* #undef ZFS_IS_GPL_COMPATIBLE */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.1.99-FreeBSD_gf3678d70f" ++#define ZFS_META_ALIAS "zfs-2.1.99-FreeBSD_g8ae86e2ed" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + +/* Define the maximum compatible kernel version. */ +#define ZFS_META_KVER_MAX "5.13" + +/* Define the minimum compatible kernel version. */ +#define ZFS_META_KVER_MIN "3.10" + +/* Define the project license. */ +#define ZFS_META_LICENSE "CDDL" + +/* Define the libtool library 'age' version information. */ +/* #undef ZFS_META_LT_AGE */ + +/* Define the libtool library 'current' version information. */ +/* #undef ZFS_META_LT_CURRENT */ + +/* Define the libtool library 'revision' version information. */ +/* #undef ZFS_META_LT_REVISION */ + +/* Define the project name. */ +#define ZFS_META_NAME "zfs" + +/* Define the project release. */ - #define ZFS_META_RELEASE "FreeBSD_gf3678d70f" ++#define ZFS_META_RELEASE "FreeBSD_g8ae86e2ed" + +/* Define the project version. */ +#define ZFS_META_VERSION "2.1.99" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ + diff --cc sys/modules/zfs/zfs_gitrev.h index fc9656910a1f,000000000000..264add9028dd mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_gitrev.h +++ b/sys/modules/zfs/zfs_gitrev.h @@@ -1,5 -1,0 +1,5 @@@ +/* + * $FreeBSD$ + */ + - #define ZFS_META_GITREV "zfs-2.1.99-404-gf3678d70f" ++#define ZFS_META_GITREV "zfs-2.1.99-419-g8ae86e2ed" From owner-dev-commits-src-all@freebsd.org Tue Aug 17 19:26:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 538A666A317; Tue, 17 Aug 2021 19:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq1Gl1Wrzz3my8; Tue, 17 Aug 2021 19:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 183A92327D; Tue, 17 Aug 2021 19:26:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HJQ6oG030774; Tue, 17 Aug 2021 19:26:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HJQ6E5030773; Tue, 17 Aug 2021 19:26:06 GMT (envelope-from git) Date: Tue, 17 Aug 2021 19:26:06 GMT Message-Id: <202108171926.17HJQ6E5030773@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: 4b7bf8424892 - main - bootstrap-tools: Don't copy host tools with make -n MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b7bf84248920fbafa5cbe2f7d3389c5eca4ef1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 19:26:07 -0000 The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=4b7bf84248920fbafa5cbe2f7d3389c5eca4ef1d commit 4b7bf84248920fbafa5cbe2f7d3389c5eca4ef1d Author: Bryan Drewery AuthorDate: 2021-08-17 19:25:44 +0000 Commit: Bryan Drewery CommitDate: 2021-08-17 19:26:03 +0000 bootstrap-tools: Don't copy host tools with make -n --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 9209f0ef053c..eb69d660cede 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2475,7 +2475,7 @@ _bootstrap_tools_links+=${_links:S/,/ /g} ${_bt}-links: .PHONY .for _tool in ${_bootstrap_tools_links} -${_bt}-link-${_tool}: .PHONY .MAKE +${_bt}-link-${_tool}: .PHONY @rm -f "${WORLDTMP}/legacy/bin/${_tool}"; \ source_path=`which ${_tool}`; \ if [ ! -e "$${source_path}" ] ; then \ From owner-dev-commits-src-all@freebsd.org Tue Aug 17 19:42:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7F6C66A1D8 for ; Tue, 17 Aug 2021 19:42:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq1dS46LYz3qmp for ; Tue, 17 Aug 2021 19:42:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id 14so99157qkc.4 for ; Tue, 17 Aug 2021 12:42:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IAudOLDIzRDLtfu3nGIeG39VRrfz3SUySS5e9Z8w4SA=; b=JRjPO8Gr6X3JqauKwMAfdcbfHUAisBCVJkFAZ907fzubmP5zzn6ixUNdC+YLz79gdj ngD2nBv1h3PtxEdLDxdnKenPSGkC7iNiKR5FKmvFRRXqD7t1RftfStZru5yCb5G5A3mc VQdOgoXzcn2ePEqEDbTmJxiVVmic/Xq37TRAX4tSz/uF6cRy+pBa06oFVc/LSreQEgeu KlgEnHiWY/g9ur/4Bz6F4k4NCNapMo0UW3f70dViQZG0hguf/bcFrXB4JhubXWRgFUMm 3nOHzYW0d0A6t4MGe6cxx7MkmhEw4SfYHjaDaUP2/7MHteUwFG8uVx0ctIefVB7HbpOd O9/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IAudOLDIzRDLtfu3nGIeG39VRrfz3SUySS5e9Z8w4SA=; b=e86BgMWnSuUnFsGqQSZ4Z87bT73iKkhAchHWH24cftJXFyvyAkc3xt95MHGvQYzvP5 DjYXi1N2N0Ykami440t1svWSyZNGoqgw0Q6t/BCB8S6Bi0BBF4oo5bwB20D29teIKmHy 5/Zy5KtF1VCK+Zhb7E/UIYGxog3WAt3t5uSBUsJGwVoE+S15hBhnc43gzP/fwtzAiJQM GVEBk5iuS5fBJQq0CkN2PDGeuCS/0OP2AmOWR+pdrHUyymgd1ukHYT9IuHugp+kR/ynZ TXdxhdzX/bRL/Uc3GdUFs8PttxBRJGRSs5wB/TOkdZdPejHTvFmwmawvxNUlByJwbPI+ mp7g== X-Gm-Message-State: AOAM530BlJVMJIXdXjysjBqnnxKKw3cpBtmcvEvH0xLZXnPRHj9HO2eW VZHDoAxl4t6ePa2k7AzONjNY5dyxcAh00SbTakYHaA== X-Google-Smtp-Source: ABdhPJy2WjT/t3VAYxPlNew2izorXcBNjMjoS/MAFqJPJtpz4JOlXQ078mOG8yfMWNcEo5OgIWt2xnCN+EgJynmS2EU= X-Received: by 2002:ae9:e30c:: with SMTP id v12mr5282474qkf.206.1629229339977; Tue, 17 Aug 2021 12:42:19 -0700 (PDT) MIME-Version: 1.0 References: <202108171645.17HGjNL3012769@gitrepo.freebsd.org> <4C25E4D8-D33E-4397-956E-D21B80239EBA@freebsd.org> In-Reply-To: <4C25E4D8-D33E-4397-956E-D21B80239EBA@freebsd.org> From: Warner Losh Date: Tue, 17 Aug 2021 13:42:09 -0600 Message-ID: Subject: Re: git: d9f25575a29f - main - Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now To: Jessica Clarke Cc: Alex Richardson , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" X-Rspamd-Queue-Id: 4Gq1dS46LYz3qmp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 19:42:20 -0000 On Tue, Aug 17, 2021 at 11:00 AM Jessica Clarke wrote: > On 17 Aug 2021, at 17:45, Alex Richardson wrote: > > > > The branch main has been updated by arichardson: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=d9f25575a29ff7c83f226349a10a37b9aaf75ad5 > > > > commit d9f25575a29ff7c83f226349a10a37b9aaf75ad5 > > Author: Alex Richardson > > AuthorDate: 2021-08-17 16:44:40 +0000 > > Commit: Alex Richardson > > CommitDate: 2021-08-17 16:44:52 +0000 > > > > Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for > now > > > > I enabled these options again in > 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3, > > but unfortunately only my specific build configuration worked whereas > the > > build with default options is still broken. > > Insta-MFC to fix stable/13 cross-builds? > I'd say it falls into the build-breakage exception that's we've been doing for the past few years. Warner From owner-dev-commits-src-all@freebsd.org Tue Aug 17 19:48:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E7EC66A885; Tue, 17 Aug 2021 19:48:40 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq1mm1khTz3ql4; Tue, 17 Aug 2021 19:48:40 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1629229720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1VGxnZ6827QXg3jEG8+D024qtyGl1qKR54XO6G7Rh7w=; b=GXTGf4bRuZWvzwbpmUyX++RytxyC8BBnm19Hf43eS7Xq6CbXEAWBwHKMBHdY9jUg5epIbT bHNrpjIpS7tBXjw71jBdTMLLpsSsj1Mk3/DxNmBAyG+l2EwTydzyf2tUObfHDybbvYUfUA 47Q2gEdpG9MD2jtQG1Jfp/c/2w2gy6YCGog8vknCaMuyaqvyFI7LQaCowQb5+Ygx3YLjCB 1M1RxI1cQLnhfDYN++2X94PaDoL8wxCLRvOUfi65+XKPp3/fdRaupKyhHOzgJ9bfA7NL53 kEoK5Vi/GMv05vAt9b/6JKmVgIh9/l1UFv5A1c5zSZ+xy+SFvgUe1/X4S0b/Gw== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id B49DAC9B2; Tue, 17 Aug 2021 19:48:39 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Tue, 17 Aug 2021 19:48:37 +0000 From: Glen Barber To: Warner Losh Cc: Jessica Clarke , Alex Richardson , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: d9f25575a29f - main - Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now Message-ID: <20210817194837.GH5802@FreeBSD.org> References: <202108171645.17HGjNL3012769@gitrepo.freebsd.org> <4C25E4D8-D33E-4397-956E-D21B80239EBA@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TA4f0niHM6tHt3xR" Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1629229720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1VGxnZ6827QXg3jEG8+D024qtyGl1qKR54XO6G7Rh7w=; b=c4eRwgiGKKkGMbZ5W5iLwl3LFay3uJs/H1AhZybu12vmv9OLpLmvtns1Gqc2MIar4UIuTL s2QMADXyAViOOAgtDCaqh3Dkvx9ewkCzktqHTfg7fHVrt3fHS0TY4TWp1vD33kJ62J3WsT ESipSm28L0MXApb3CZXTEOy3N9qfRrXQU2qvCdf1wmYrNEmD4G2YR0E2G1PLWQgf3W8kRo nP5BzxXN+hBsgcZjhN86r7z2QIkY52pMa2efA6reFpqKL4oz1VsmP3eN6CZR2v/r3yEWfp 5SbNtol+m524i2mcaNtwZOCk188FMM2z4+yeF+IuFkxj6tiSc2tQDgIcSwXuWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1629229720; a=rsa-sha256; cv=none; b=Pk4XvP+6kZrIv6utBekzwGI/AudP9IWzKRjN/mJ8pql71XiRmXQmIN/ndLdIUDlbcCQL/q XOTtMvyU/mV8l5BT6D9XdjDg2Qkh2vtwNKWVOVhhoH9wu0eic8wJeWW/fGSGa5cBH4nbtH inqlTjM0ZR8CC0ScF39vxi4ylztIhMmPu1aIxSFyRRr465Bcckk3WVHozNzPdAH8DSBI7V yqVe0P0HmAHC8X+BKKmext/khvoQTEsLpXj+8fFsTPXspN6obUaDOcuFwTztAbqq0qVAMA xHtxMTRU6toQ0s+b6L7YnHY4zDQltEryQ3GLOQ8hmvZvyM4UgwT8q9v/zTm43g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 19:48:40 -0000 --TA4f0niHM6tHt3xR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 17, 2021 at 01:42:09PM -0600, Warner Losh wrote: > On Tue, Aug 17, 2021 at 11:00 AM Jessica Clarke wrot= e: >=20 > > On 17 Aug 2021, at 17:45, Alex Richardson wro= te: > > > > > > The branch main has been updated by arichardson: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=3Dd9f25575a29ff7c83f226349a10a3= 7b9aaf75ad5 > > > > > > commit d9f25575a29ff7c83f226349a10a37b9aaf75ad5 > > > Author: Alex Richardson > > > AuthorDate: 2021-08-17 16:44:40 +0000 > > > Commit: Alex Richardson > > > CommitDate: 2021-08-17 16:44:52 +0000 > > > > > > Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD f= or > > now > > > > > > I enabled these options again in > > 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3, > > > but unfortunately only my specific build configuration worked wher= eas > > the > > > build with default options is still broken. > > > > Insta-MFC to fix stable/13 cross-builds? > > >=20 > I'd say it falls into the build-breakage exception that's we've been doing > for the past few years. >=20 Agreed. Glen --TA4f0niHM6tHt3xR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmEcEo4ACgkQAxRYpUeP 4pOVWQ/+MCftaxivyuKTTQ3nQeaM7CVZoO5yMhCh0pAYfoRSom3SKne3JhpErhPe 49MsKrVxINqaa37CgbOnay8Ag5kuwOuBDVC2Ys+JaIzqYmaDmJ/JvXApbRsUdSzT iK99Fw2L2tJUGHKVj3fnspZrkrO2lToezzVeEPdyQp2zcmRYfpumj5y+uhwhtsu/ uLoNCEN50yM5AblhULqtcqgjj6p4lyd9N3yxzXLGfSzEi/cy/meyGHLkd9hFCAbP UpQlEj+nL4j/+eM3YDfwwihzP3dFwijaaaeHta4XQ4MGIJidCHoCEH73CLP/5RKb FLhpfWC58LKSUKMLHbxhhRcE+3zFFHaVU0yYY59Cw50W1qBPWaXttnmkOpfOTSQe HzgmgvH7ombddoU98VhBFg8Ub8o6z0f0BE80V8LssEsUP5AfMKwa55dv0fwVIJZZ ugttmcZtGrZ+GEMpfaKKGX/EA34Kwgp7NGzMRB10LbYO770wtLR23E6SlMaP0MsG IloyLhTxro9e+w181sapERrCphacyaCz603JH+X2TXBhRFcsHWQmRAJQWwH/RlVy 07zn/peuwWkVko4PzpXqpOkxGIzb8HEiTg23PnvH1jC22fXFoxMWPOcEc7RCVssu QiOfQb6veqxLmIVZ2hSf3dRwzGPofGppqKKGmVxXw2aUlcofi2Q= =xjZX -----END PGP SIGNATURE----- --TA4f0niHM6tHt3xR-- From owner-dev-commits-src-all@freebsd.org Tue Aug 17 19:59:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA56366A367; Tue, 17 Aug 2021 19:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq20j5ftqz3r0l; Tue, 17 Aug 2021 19:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6AB923738; Tue, 17 Aug 2021 19:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HJx1M8069833; Tue, 17 Aug 2021 19:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HJx16Z069832; Tue, 17 Aug 2021 19:59:01 GMT (envelope-from git) Date: Tue, 17 Aug 2021 19:59:01 GMT Message-Id: <202108171959.17HJx16Z069832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: e0a17c3f063f - main - uipc: create dedicated lists for fast and slow timeout callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0a17c3f063fd51430fb2b4f5bc667f79d2967c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 19:59:02 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e0a17c3f063fd51430fb2b4f5bc667f79d2967c2 commit e0a17c3f063fd51430fb2b4f5bc667f79d2967c2 Author: Mateusz Guzik AuthorDate: 2021-08-15 21:41:47 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-17 19:56:05 +0000 uipc: create dedicated lists for fast and slow timeout callbacks This avoids having to walk all possible protocols only to check if they have one (vast majority does not). Original patch by kevans@. Reviewed by: kevans Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/uipc_domain.c | 59 +++++++++++++++++++++++++++++++++++--------------- sys/sys/protosw.h | 4 ++++ 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index b6aefec9556a..0946a2a75326 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -76,6 +77,14 @@ static struct callout pfslow_callout; static void pffasttimo(void *); static void pfslowtimo(void *); +static struct rmlock pftimo_lock; +RM_SYSINIT(pftimo_lock, &pftimo_lock, "pftimo"); + +static LIST_HEAD(, protosw) pffast_list = + LIST_HEAD_INITIALIZER(pffast_list); +static LIST_HEAD(, protosw) pfslow_list = + LIST_HEAD_INITIALIZER(pfslow_list); + struct domain *domains; /* registered protocol domains */ int domain_init_status = 0; static struct mtx dom_mtx; /* domain list lock */ @@ -183,8 +192,16 @@ domain_init(void *arg) ("Premature initialization of domain in non-default vnet")); if (dp->dom_init) (*dp->dom_init)(); - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) + for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) { protosw_init(pr); + rm_wlock(&pftimo_lock); + if (pr->pr_fasttimo != NULL) + LIST_INSERT_HEAD(&pffast_list, pr, pr_fasttimos); + if (pr->pr_slowtimo != NULL) + LIST_INSERT_HEAD(&pfslow_list, pr, pr_slowtimos); + rm_wunlock(&pftimo_lock); + } + /* * update global information about maximums */ @@ -387,6 +404,13 @@ pf_proto_register(int family, struct protosw *npr) /* Copy the new struct protosw over the spacer. */ bcopy(npr, fpr, sizeof(*fpr)); + rm_wlock(&pftimo_lock); + if (fpr->pr_fasttimo != NULL) + LIST_INSERT_HEAD(&pffast_list, fpr, pr_fasttimos); + if (fpr->pr_slowtimo != NULL) + LIST_INSERT_HEAD(&pfslow_list, fpr, pr_slowtimos); + rm_wunlock(&pftimo_lock); + /* Job is done, no more protection required. */ mtx_unlock(&dom_mtx); @@ -447,6 +471,13 @@ pf_proto_unregister(int family, int protocol, int type) return (EPROTONOSUPPORT); } + rm_wlock(&pftimo_lock); + if (dpr->pr_fasttimo != NULL) + LIST_REMOVE(dpr, pr_fasttimos); + if (dpr->pr_slowtimo != NULL) + LIST_REMOVE(dpr, pr_slowtimos); + rm_wunlock(&pftimo_lock); + /* De-orbit the protocol and make the slot available again. */ dpr->pr_type = 0; dpr->pr_domain = dp; @@ -483,39 +514,33 @@ pfctlinput(int cmd, struct sockaddr *sa) static void pfslowtimo(void *arg) { + struct rm_priotracker tracker; struct epoch_tracker et; - struct domain *dp; struct protosw *pr; + rm_rlock(&pftimo_lock, &tracker); NET_EPOCH_ENTER(et); - for (dp = domains; dp; dp = dp->dom_next) { - if ((atomic_load_int(&dp->dom_flags) & DOMF_INITED) == 0) - continue; - atomic_thread_fence_acq(); - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) - if (pr->pr_slowtimo) - (*pr->pr_slowtimo)(); + LIST_FOREACH(pr, &pfslow_list, pr_slowtimos) { + (*pr->pr_slowtimo)(); } NET_EPOCH_EXIT(et); + rm_runlock(&pftimo_lock, &tracker); callout_reset(&pfslow_callout, hz/2, pfslowtimo, NULL); } static void pffasttimo(void *arg) { + struct rm_priotracker tracker; struct epoch_tracker et; - struct domain *dp; struct protosw *pr; + rm_rlock(&pftimo_lock, &tracker); NET_EPOCH_ENTER(et); - for (dp = domains; dp; dp = dp->dom_next) { - if ((atomic_load_int(&dp->dom_flags) & DOMF_INITED) == 0) - continue; - atomic_thread_fence_acq(); - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) - if (pr->pr_fasttimo) - (*pr->pr_fasttimo)(); + LIST_FOREACH(pr, &pffast_list, pr_fasttimos) { + (*pr->pr_fasttimo)(); } NET_EPOCH_EXIT(et); + rm_runlock(&pftimo_lock, &tracker); callout_reset(&pffast_callout, hz/5, pffasttimo, NULL); } diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 5c2fa2d4077e..a929544501f4 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -35,6 +35,8 @@ #ifndef _SYS_PROTOSW_H_ #define _SYS_PROTOSW_H_ +#include + /* Forward declare these structures referenced from prototypes below. */ struct kaiocb; struct mbuf; @@ -93,6 +95,8 @@ struct protosw { pr_drain_t *pr_drain; /* flush any excess space possible */ struct pr_usrreqs *pr_usrreqs; /* user-protocol hook */ + LIST_ENTRY(protosw) pr_fasttimos; + LIST_ENTRY(protosw) pr_slowtimos; }; /*#endif*/ From owner-dev-commits-src-all@freebsd.org Tue Aug 17 19:59:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A35F66A376; Tue, 17 Aug 2021 19:59:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq20k6RRXz3qxP; Tue, 17 Aug 2021 19:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE1E0239ED; Tue, 17 Aug 2021 19:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HJx2qb069857; Tue, 17 Aug 2021 19:59:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HJx2lL069856; Tue, 17 Aug 2021 19:59:02 GMT (envelope-from git) Date: Tue, 17 Aug 2021 19:59:02 GMT Message-Id: <202108171959.17HJx2lL069856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 5091ca26507b - main - pf: save on branching in the common case in pf_test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5091ca26507b83ebd5ce677dd26bd10e4bad4153 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 19:59:03 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5091ca26507b83ebd5ce677dd26bd10e4bad4153 commit 5091ca26507b83ebd5ce677dd26bd10e4bad4153 Author: Mateusz Guzik AuthorDate: 2021-08-17 18:04:31 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-17 19:56:33 +0000 pf: save on branching in the common case in pf_test Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e2dd3eb7c0de..add76c7b98d4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6151,7 +6151,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * PF_RULES_RLOCK(); - if (ip_divert_ptr != NULL && + if (__predict_false(ip_divert_ptr != NULL) && ((ipfwtag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL)) != NULL)) { struct ipfw_rule_ref *rr = (struct ipfw_rule_ref *)(ipfwtag+1); if (rr->info & IPFW_IS_DIVERT && rr->rulenum == 0) { @@ -6419,8 +6419,8 @@ done: IN_LOOPBACK(ntohl(pd.dst->v4.s_addr))) m->m_flags |= M_SKIP_FIREWALL; - if (action == PF_PASS && r->divert.port && ip_divert_ptr != NULL && - !PACKET_LOOPED(&pd)) { + if (__predict_false(ip_divert_ptr != NULL) && action == PF_PASS && + r->divert.port && !PACKET_LOOPED(&pd)) { ipfwtag = m_tag_alloc(MTAG_IPFW_RULE, 0, sizeof(struct ipfw_rule_ref), M_NOWAIT | M_ZERO); if (ipfwtag != NULL) { From owner-dev-commits-src-all@freebsd.org Tue Aug 17 19:59:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6908466A8C8; Tue, 17 Aug 2021 19:59:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq20m0hQwz3qxV; Tue, 17 Aug 2021 19:59:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E84A023D10; Tue, 17 Aug 2021 19:59:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HJx3fJ069888; Tue, 17 Aug 2021 19:59:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HJx38g069887; Tue, 17 Aug 2021 19:59:03 GMT (envelope-from git) Date: Tue, 17 Aug 2021 19:59:03 GMT Message-Id: <202108171959.17HJx38g069887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 3e875f952af0 - main - pf: assert dir state on pf_test{,6} MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e875f952af05697807139b460e5124eb5f6137b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 19:59:04 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3e875f952af05697807139b460e5124eb5f6137b commit 3e875f952af05697807139b460e5124eb5f6137b Author: Mateusz Guzik AuthorDate: 2021-08-17 18:16:09 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-17 19:56:50 +0000 pf: assert dir state on pf_test{,6} The intent is to line up various enums so that branching in the lines of: idx = (dir == PF_IN ? PF_SK_WIRE : PF_SK_STACK); is avoided. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index add76c7b98d4..66c11a450030 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6126,7 +6126,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * int off, dirndx, pqid = 0; PF_RULES_RLOCK_TRACKER; - + KASSERT(dir == PF_IN || dir == PF_OUT, ("%s: bad direction %d\n", __func__, dir)); M_ASSERTPKTHDR(m); if (!V_pf_status.running) @@ -6575,6 +6575,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb int off, terminal = 0, dirndx, rh_cnt = 0, pqid = 0; PF_RULES_RLOCK_TRACKER; + KASSERT(dir == PF_IN || dir == PF_OUT, ("%s: bad direction %d\n", __func__, dir)); M_ASSERTPKTHDR(m); if (!V_pf_status.running) From owner-dev-commits-src-all@freebsd.org Tue Aug 17 20:30:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2493766B23D; Tue, 17 Aug 2021 20:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq2jF6ZqGz3t6g; Tue, 17 Aug 2021 20:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC2023F6F; Tue, 17 Aug 2021 20:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HKUfrC018681; Tue, 17 Aug 2021 20:30:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HKUf9L018680; Tue, 17 Aug 2021 20:30:41 GMT (envelope-from git) Date: Tue, 17 Aug 2021 20:30:41 GMT Message-Id: <202108172030.17HKUf9L018680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 5baf32c97a1d - main - tcp: Add support for DSACK based reordering window to rack. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5baf32c97a1ded3398efd0677ea9b73204629b2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 20:30:42 -0000 The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=5baf32c97a1ded3398efd0677ea9b73204629b2f commit 5baf32c97a1ded3398efd0677ea9b73204629b2f Author: Randall Stewart AuthorDate: 2021-08-17 20:29:22 +0000 Commit: Randall Stewart CommitDate: 2021-08-17 20:29:22 +0000 tcp: Add support for DSACK based reordering window to rack. The rack stack, with respect to the rack bits in it, was originally built based on an early I-D of rack. In fact at that time the TLP bits were in a separate I-D. The dynamic reordering window based on DSACK events was not present in rack at that time. It is now part of the RFC and we need to update our stack to include these features. However we want to have a way to control the feature so that we can, if the admin decides, make it stay the same way system wide as well as via socket option. The new sysctl and socket option has the following meaning for setting: 00 (0) - Keep the old way, i.e. reordering window is 1 and do not use DSACK bytes to add to reorder window 01 (1) - Change the Reordering window to 1/4 of an RTT but do not use DSACK bytes to add to reorder window 10 (2) - Keep the reordering window as 1, but do use SACK bytes to add additional 1/4 RTT delay to the reorder window 11 (3) - reordering window is 1/4 of an RTT and add additional DSACK bytes to increase the reordering window (RFC behavior) The default currently in the sysctl is 3 so we get standards based behavior. Reviewed by: tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D31506 --- sys/netinet/tcp.h | 1 + sys/netinet/tcp_log_buf.h | 3 +- sys/netinet/tcp_stacks/rack.c | 596 ++++++++++++++++++++++++++++++++------ sys/netinet/tcp_stacks/tcp_rack.h | 21 +- 4 files changed, 529 insertions(+), 92 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index a79dbeaad748..29c1e376c8de 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -309,6 +309,7 @@ struct tcphdr { #define TCP_RACK_PACING_BETA 1138 /* Changing the beta for pacing */ #define TCP_RACK_PACING_BETA_ECN 1139 /* Changing the beta for ecn with pacing */ #define TCP_RACK_TIMER_SLOP 1140 /* Set or get the timer slop used */ +#define TCP_RACK_DSACK_OPT 1141 /* How do we setup rack timer DSACK options bit 1/2 */ /* Start of reserved space for third-party user-settable options. */ #define TCP_VENDOR SO_VENDOR diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 47993660cb1f..2203fd061213 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -234,7 +234,8 @@ enum tcp_log_events { TCP_LOG_HTTP_T, /* logging of http request tracking 61 */ TCP_LOG_ACCOUNTING, /* Log of TCP Accounting data 62 */ TCP_LOG_FSB, /* FSB information 63 */ - TCP_LOG_END /* End (keep at end) 64 */ + RACK_DSACK_HANDLING, /* Handling of DSACK in rack for reordering window 64 */ + TCP_LOG_END /* End (keep at end) 65 */ }; enum tcp_log_states { diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index f417f8a4ee7f..947f9f619929 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -217,6 +217,7 @@ static int32_t rack_use_rfo = 1; static int32_t rack_use_rsm_rfo = 1; static int32_t rack_max_abc_post_recovery = 2; static int32_t rack_client_low_buf = 0; +static int32_t rack_dsack_std_based = 0x3; /* bit field bit 1 sets rc_rack_tmr_std_based and bit 2 sets rc_rack_use_dsack */ #ifdef TCP_ACCOUNTING static int32_t rack_tcp_accounting = 0; #endif @@ -1375,6 +1376,12 @@ rack_init_sysctls(void) &rack_tcp_accounting, 0, "Should we turn on TCP accounting for all rack sessions?"); #endif + + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_misc), + OID_AUTO, "rack_dsack_ctl", CTLFLAG_RW, + &rack_dsack_std_based, 3, + "How do we process dsack with respect to rack timers, bit field, 3 is standards based?"); SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_misc), OID_AUTO, "prr_addback_max", CTLFLAG_RW, @@ -2071,6 +2078,44 @@ configured_rate: return (rack->r_ctl.rack_per_of_gp_ca); } +static void +rack_log_dsack_event(struct tcp_rack *rack, uint8_t mod, uint32_t flex4, uint32_t flex5, uint32_t flex6) +{ + /* + * Types of logs (mod value) + * 1 = dsack_persists reduced by 1 via T-O or fast recovery exit. + * 2 = a dsack round begins, persist is reset to 16. + * 3 = a dsack round ends + * 4 = Dsack option increases rack rtt flex5 is the srtt input, flex6 is thresh + * 5 = Socket option set changing the control flags rc_rack_tmr_std_based, rc_rack_use_dsack + * 6 = Final rack rtt, flex4 is srtt and flex6 is final limited thresh. + */ + if (rack->rc_tp->t_logstate != TCP_LOG_STATE_OFF) { + union tcp_log_stackspecific log; + struct timeval tv; + + memset(&log, 0, sizeof(log)); + log.u_bbr.flex1 = rack->rc_rack_tmr_std_based; + log.u_bbr.flex1 <<= 1; + log.u_bbr.flex1 |= rack->rc_rack_use_dsack; + log.u_bbr.flex1 <<= 1; + log.u_bbr.flex1 |= rack->rc_dsack_round_seen; + log.u_bbr.flex2 = rack->r_ctl.dsack_round_end; + log.u_bbr.flex3 = rack->r_ctl.num_dsack; + log.u_bbr.flex4 = flex4; + log.u_bbr.flex5 = flex5; + log.u_bbr.flex6 = flex6; + log.u_bbr.flex7 = rack->r_ctl.dsack_persist; + log.u_bbr.flex8 = mod; + log.u_bbr.timeStamp = tcp_get_usecs(&tv); + TCP_LOG_EVENTP(rack->rc_tp, NULL, + &rack->rc_inp->inp_socket->so_rcv, + &rack->rc_inp->inp_socket->so_snd, + RACK_DSACK_HANDLING, 0, + 0, &log, false, &tv); + } +} + static void rack_log_hdwr_pacing(struct tcp_rack *rack, uint64_t rate, uint64_t hw_rate, int line, @@ -4862,6 +4907,13 @@ rack_post_recovery(struct tcpcb *tp, uint32_t th_ack) } rack_log_to_prr(rack, 14, orig_cwnd); tp->snd_recover = tp->snd_una; + if (rack->r_ctl.dsack_persist) { + rack->r_ctl.dsack_persist--; + if (rack->r_ctl.num_dsack && (rack->r_ctl.dsack_persist == 0)) { + rack->r_ctl.num_dsack = 0; + } + rack_log_dsack_event(rack, 1, __LINE__, 0, 0); + } EXIT_RECOVERY(tp->t_flags); } @@ -5097,24 +5149,38 @@ rack_calc_thresh_rack(struct tcp_rack *rack, uint32_t srtt, uint32_t cts) } else { lro = 0; } - thresh = srtt + rack->r_ctl.rc_pkt_delay; - if (lro) { + if (rack->rc_rack_tmr_std_based == 0) { + thresh = srtt + rack->r_ctl.rc_pkt_delay; + } else { + /* Standards based pkt-delay is 1/4 srtt */ + thresh = srtt + (srtt >> 2); + } + if (lro && (rack->rc_rack_tmr_std_based == 0)) { /* It must be set, if not you get 1/4 rtt */ if (rack->r_ctl.rc_reorder_shift) thresh += (srtt >> rack->r_ctl.rc_reorder_shift); else thresh += (srtt >> 2); - } else { - thresh += 1; } - /* We don't let the rack timeout be above a RTO */ - if (thresh > rack->rc_tp->t_rxtcur) { - thresh = rack->rc_tp->t_rxtcur; + if (rack->rc_rack_use_dsack && + lro && + (rack->r_ctl.num_dsack > 0)) { + /* + * We only increase the reordering window if we + * have seen reordering we have a DSACK count. + */ + thresh += rack->r_ctl.num_dsack * (srtt >> 2); + rack_log_dsack_event(rack, 4, __LINE__, srtt, thresh); + } + /* SRTT * 2 is the ceiling */ + if (thresh > (srtt * 2)) { + thresh = srtt * 2; } /* And we don't want it above the RTO max either */ if (thresh > rack_rto_max) { thresh = rack_rto_max; } + rack_log_dsack_event(rack, 6, __LINE__, srtt, thresh); return (thresh); } @@ -6219,6 +6285,13 @@ rack_timeout_tlp(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts, uint8_t collapsed_win = 1; goto need_retran; } + if (rack->r_ctl.dsack_persist && (rack->r_ctl.rc_tlp_cnt_out >= 1)) { + rack->r_ctl.dsack_persist--; + if (rack->r_ctl.num_dsack && (rack->r_ctl.dsack_persist == 0)) { + rack->r_ctl.num_dsack = 0; + } + rack_log_dsack_event(rack, 1, __LINE__, 0, 0); + } if ((tp->t_flags & TF_GPUTINPROG) && (rack->r_ctl.rc_tlp_cnt_out == 1)) { /* @@ -6349,7 +6422,6 @@ need_retran: TAILQ_INSERT_AFTER(&rack->r_ctl.rc_tmap, rsm, nrsm, r_tnext); nrsm->r_in_tmap = 1; } - rsm->r_flags &= (~RACK_HAS_FIN); rsm = nrsm; } rack->r_ctl.rc_tlpsend = rsm; @@ -6755,6 +6827,13 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) /* Nothing outstanding .. nothing to do */ return (0); } + if (rack->r_ctl.dsack_persist) { + rack->r_ctl.dsack_persist--; + if (rack->r_ctl.num_dsack && (rack->r_ctl.dsack_persist == 0)) { + rack->r_ctl.num_dsack = 0; + } + rack_log_dsack_event(rack, 1, __LINE__, 0, 0); + } /* * Rack can only run one timer at a time, so we cannot * run a KEEPINIT (gating SYN sending) and a retransmit @@ -8218,6 +8297,22 @@ rack_need_set_test(struct tcpcb *tp, } } +static inline int +is_rsm_inside_declared_tlp_block(struct tcp_rack *rack, struct rack_sendmap *rsm) +{ + if (SEQ_LT(rsm->r_end, rack->r_ctl.last_tlp_acked_start)) { + /* Behind our TLP definition or right at */ + return (0); + } + if (SEQ_GT(rsm->r_start, rack->r_ctl.last_tlp_acked_end)) { + /* The start is beyond or right at our end of TLP definition */ + return (0); + } + /* It has to be a sub-part of the original TLP recorded */ + return (1); +} + + static uint32_t rack_proc_sack_blk(struct tcpcb *tp, struct tcp_rack *rack, struct sackblk *sack, struct tcpopt *to, struct rack_sendmap **prsm, uint32_t cts, int *moved_two) @@ -8253,6 +8348,46 @@ do_rest_ofb: /* Ok we have an ACK for some piece of this rsm */ if (rsm->r_start != start) { if ((rsm->r_flags & RACK_ACKED) == 0) { + /* + * Before any splitting or hookery is + * done is it a TLP of interest i.e. rxt? + */ + if ((rsm->r_flags & RACK_TLP) && + (rsm->r_rtr_cnt > 1)) { + /* + * We are splitting a rxt TLP, check + * if we need to save off the start/end + */ + if (rack->rc_last_tlp_acked_set && + (is_rsm_inside_declared_tlp_block(rack, rsm))) { + /* + * We already turned this on since we are inside + * the previous one was a partially sack now we + * are getting another one (maybe all of it). + * + */ + rack_log_dsack_event(rack, 10, __LINE__, rsm->r_start, rsm->r_end); + /* + * Lets make sure we have all of it though. + */ + if (SEQ_LT(rsm->r_start, rack->r_ctl.last_tlp_acked_start)) { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + if (SEQ_GT(rsm->r_end, rack->r_ctl.last_tlp_acked_end)) { + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + } else { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack->rc_last_tlp_past_cumack = 0; + rack->rc_last_tlp_acked_set = 1; + rack_log_dsack_event(rack, 8, __LINE__, rsm->r_start, rsm->r_end); + } + } /** * Need to split this in two pieces the before and after, * the before remains in the map, the after must be @@ -8267,6 +8402,7 @@ do_rest_ofb: * But before we start down that path lets * see if the sack spans over on top of * the next guy and it is already sacked. + * */ next = RB_NEXT(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); if (next && (next->r_flags & RACK_ACKED) && @@ -8426,6 +8562,44 @@ do_rest_ofb: * end |---------| */ if ((rsm->r_flags & RACK_ACKED) == 0) { + /* + * Is it a TLP of interest? + */ + if ((rsm->r_flags & RACK_TLP) && + (rsm->r_rtr_cnt > 1)) { + /* + * We are splitting a rxt TLP, check + * if we need to save off the start/end + */ + if (rack->rc_last_tlp_acked_set && + (is_rsm_inside_declared_tlp_block(rack, rsm))) { + /* + * We already turned this on since we are inside + * the previous one was a partially sack now we + * are getting another one (maybe all of it). + */ + rack_log_dsack_event(rack, 10, __LINE__, rsm->r_start, rsm->r_end); + /* + * Lets make sure we have all of it though. + */ + if (SEQ_LT(rsm->r_start, rack->r_ctl.last_tlp_acked_start)) { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + if (SEQ_GT(rsm->r_end, rack->r_ctl.last_tlp_acked_end)) { + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + } else { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack->rc_last_tlp_past_cumack = 0; + rack->rc_last_tlp_acked_set = 1; + rack_log_dsack_event(rack, 8, __LINE__, rsm->r_start, rsm->r_end); + } + } rack_update_rtt(tp, rack, rsm, to, cts, SACKED, 0); changed += (rsm->r_end - rsm->r_start); rack->r_ctl.rc_sacked += (rsm->r_end - rsm->r_start); @@ -8441,7 +8615,6 @@ do_rest_ofb: rack_need_set_test(tp, rack, rsm, tp->snd_una, __LINE__, RACK_USE_END); rsm->r_ack_arrival = rack_to_usec_ts(&rack->r_ctl.act_rcv_time); rsm->r_flags |= RACK_ACKED; - rsm->r_flags &= ~RACK_TLP; if (rsm->r_in_tmap) { TAILQ_REMOVE(&rack->r_ctl.rc_tmap, rsm, r_tnext); rsm->r_in_tmap = 0; @@ -8473,8 +8646,47 @@ do_rest_ofb: * end |--| */ if ((rsm->r_flags & RACK_ACKED) == 0) { + /* + * Is it a TLP of interest? + */ + if ((rsm->r_flags & RACK_TLP) && + (rsm->r_rtr_cnt > 1)) { + /* + * We are splitting a rxt TLP, check + * if we need to save off the start/end + */ + if (rack->rc_last_tlp_acked_set && + (is_rsm_inside_declared_tlp_block(rack, rsm))) { + /* + * We already turned this on since we are inside + * the previous one was a partially sack now we + * are getting another one (maybe all of it). + */ + rack_log_dsack_event(rack, 10, __LINE__, rsm->r_start, rsm->r_end); + /* + * Lets make sure we have all of it though. + */ + if (SEQ_LT(rsm->r_start, rack->r_ctl.last_tlp_acked_start)) { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + if (SEQ_GT(rsm->r_end, rack->r_ctl.last_tlp_acked_end)) { + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + } else { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack->rc_last_tlp_past_cumack = 0; + rack->rc_last_tlp_acked_set = 1; + rack_log_dsack_event(rack, 8, __LINE__, rsm->r_start, rsm->r_end); + } + } prev = RB_PREV(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); - if (prev && (prev->r_flags & RACK_ACKED)) { + if (prev && + (prev->r_flags & RACK_ACKED)) { /** * Goal, we want the right remainder of rsm to shrink * in place and span from (rsm->r_start = end) to rsm->r_end. @@ -8488,6 +8700,9 @@ do_rest_ofb: * prev |----------| (acked) * rsm |-----| (non-acked) * nrsm |-| (temporary) + * + * Note if either prev/rsm is a TLP we don't + * do this. */ nrsm = &stack_map; memcpy(nrsm, rsm, sizeof(struct rack_sendmap)); @@ -8534,6 +8749,41 @@ do_rest_ofb: /* failed rrs what can we do but loose the sack info? */ goto out; } + if ((rsm->r_flags & RACK_TLP) && + (rsm->r_rtr_cnt > 1)) { + /* + * We are splitting a rxt TLP, check + * if we need to save off the start/end + */ + if (rack->rc_last_tlp_acked_set && + (is_rsm_inside_declared_tlp_block(rack, rsm))) { + /* + * We already turned this on since this block is inside + * the previous one was a partially sack now we + * are getting another one (maybe all of it). + */ + rack_log_dsack_event(rack, 10, __LINE__, rsm->r_start, rsm->r_end); + /* + * Lets make sure we have all of it though. + */ + if (SEQ_LT(rsm->r_start, rack->r_ctl.last_tlp_acked_start)) { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + if (SEQ_GT(rsm->r_end, rack->r_ctl.last_tlp_acked_end)) { + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + } else { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack->rc_last_tlp_acked_set = 1; + rack->rc_last_tlp_past_cumack = 0; + rack_log_dsack_event(rack, 8, __LINE__, rsm->r_start, rsm->r_end); + } + } /** * In this case nrsm becomes * nrsm->r_start = end; @@ -8584,7 +8834,6 @@ do_rest_ofb: rack_need_set_test(tp, rack, rsm, tp->snd_una, __LINE__, RACK_USE_END); rsm->r_ack_arrival = rack_to_usec_ts(&rack->r_ctl.act_rcv_time); rsm->r_flags |= RACK_ACKED; - rsm->r_flags &= ~RACK_TLP; rack_log_map_chg(tp, rack, NULL, rsm, nrsm, MAP_SACK_M5, end, __LINE__); if (rsm->r_in_tmap) { TAILQ_REMOVE(&rack->r_ctl.rc_tmap, rsm, r_tnext); @@ -8599,7 +8848,9 @@ do_rest_ofb: moved++; } out: - if (rsm && (rsm->r_flags & RACK_ACKED)) { + if (rsm && + ((rsm->r_flags & RACK_TLP) == 0) && + (rsm->r_flags & RACK_ACKED)) { /* * Now can we merge where we worked * with either the previous or @@ -8607,22 +8858,26 @@ out: */ next = RB_NEXT(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); while (next) { - if (next->r_flags & RACK_ACKED) { + if (next->r_flags & RACK_TLP) + break; + if (next->r_flags & RACK_ACKED) { /* yep this and next can be merged */ - rsm = rack_merge_rsm(rack, rsm, next); - next = RB_NEXT(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); - } else - break; + rsm = rack_merge_rsm(rack, rsm, next); + next = RB_NEXT(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); + } else + break; } /* Now what about the previous? */ prev = RB_PREV(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); while (prev) { - if (prev->r_flags & RACK_ACKED) { - /* yep the previous and this can be merged */ - rsm = rack_merge_rsm(rack, prev, rsm); - prev = RB_PREV(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); - } else - break; + if (prev->r_flags & RACK_TLP) + break; + if (prev->r_flags & RACK_ACKED) { + /* yep the previous and this can be merged */ + rsm = rack_merge_rsm(rack, prev, rsm); + prev = RB_PREV(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); + } else + break; } } if (used_ref == 0) { @@ -8744,6 +8999,55 @@ rack_process_to_cumack(struct tcpcb *tp, struct tcp_rack *rack, register uint32_ * RTT's. */ rack->r_wanted_output = 1; + + /* Tend any TLP that has been marked for 1/2 the seq space (its old) */ + if ((rack->rc_last_tlp_acked_set == 1)&& + (rack->rc_last_tlp_past_cumack == 1) && + (SEQ_GT(rack->r_ctl.last_tlp_acked_start, th_ack))) { + /* + * We have reached the point where our last rack + * tlp retransmit sequence is ahead of the cum-ack. + * This can only happen when the cum-ack moves all + * the way around (its been a full 2^^31+1 bytes + * or more since we sent a retransmitted TLP). Lets + * turn off the valid flag since its not really valid. + * + * Note since sack's also turn on this event we have + * a complication, we have to wait to age it out until + * the cum-ack is by the TLP before checking which is + * what the next else clause does. + */ + rack_log_dsack_event(rack, 9, __LINE__, + rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + rack->rc_last_tlp_acked_set = 0; + rack->rc_last_tlp_past_cumack = 0; + } else if ((rack->rc_last_tlp_acked_set == 1) && + (rack->rc_last_tlp_past_cumack == 0) && + (SEQ_GEQ(th_ack, rack->r_ctl.last_tlp_acked_end))) { + /* + * It is safe to start aging TLP's out. + */ + rack->rc_last_tlp_past_cumack = 1; + } + /* We do the same for the tlp send seq as well */ + if ((rack->rc_last_sent_tlp_seq_valid == 1) && + (rack->rc_last_sent_tlp_past_cumack == 1) && + (SEQ_GT(rack->r_ctl.last_sent_tlp_seq, th_ack))) { + rack_log_dsack_event(rack, 9, __LINE__, + rack->r_ctl.last_sent_tlp_seq, + (rack->r_ctl.last_sent_tlp_seq + + rack->r_ctl.last_sent_tlp_len)); + rack->rc_last_sent_tlp_seq_valid = 0; + rack->rc_last_sent_tlp_past_cumack = 0; + } else if ((rack->rc_last_sent_tlp_seq_valid == 1) && + (rack->rc_last_sent_tlp_past_cumack == 0) && + (SEQ_GEQ(th_ack, rack->r_ctl.last_sent_tlp_seq))) { + /* + * It is safe to start aging TLP's send. + */ + rack->rc_last_sent_tlp_past_cumack = 1; + } more: rsm = RB_MIN(rack_rb_tree_head, &rack->r_ctl.rc_mtree); if (rsm == NULL) { @@ -8778,6 +9082,48 @@ more: return; } rack_update_rtt(tp, rack, rsm, to, cts, CUM_ACKED, th_ack); + + /* Now was it a retransmitted TLP? */ + if ((rsm->r_flags & RACK_TLP) && + (rsm->r_rtr_cnt > 1)) { + /* + * Yes, this rsm was a TLP and retransmitted, remember that + * since if a DSACK comes back on this we don't want + * to think of it as a reordered segment. This may + * get updated again with possibly even other TLPs + * in flight, but thats ok. Only when we don't send + * a retransmitted TLP for 1/2 the sequences space + * will it get turned off (above). + */ + if (rack->rc_last_tlp_acked_set && + (is_rsm_inside_declared_tlp_block(rack, rsm))) { + /* + * We already turned this on since the end matches, + * the previous one was a partially ack now we + * are getting another one (maybe all of it). + */ + rack_log_dsack_event(rack, 10, __LINE__, rsm->r_start, rsm->r_end); + /* + * Lets make sure we have all of it though. + */ + if (SEQ_LT(rsm->r_start, rack->r_ctl.last_tlp_acked_start)) { + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + if (SEQ_GT(rsm->r_end, rack->r_ctl.last_tlp_acked_end)) { + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack_log_dsack_event(rack, 11, __LINE__, rack->r_ctl.last_tlp_acked_start, + rack->r_ctl.last_tlp_acked_end); + } + } else { + rack->rc_last_tlp_past_cumack = 1; + rack->r_ctl.last_tlp_acked_start = rsm->r_start; + rack->r_ctl.last_tlp_acked_end = rsm->r_end; + rack->rc_last_tlp_acked_set = 1; + rack_log_dsack_event(rack, 8, __LINE__, rsm->r_start, rsm->r_end); + } + } /* Now do we consume the whole thing? */ if (SEQ_GEQ(th_ack, rsm->r_end)) { /* Its all consumed. */ @@ -9059,12 +9405,44 @@ static void rack_note_dsack(struct tcp_rack *rack, tcp_seq start, tcp_seq end) { - uint32_t am; + uint32_t am, l_end; if (SEQ_GT(end, start)) am = end - start; else am = 0; + if ((rack->rc_last_tlp_acked_set ) && + (SEQ_GEQ(start, rack->r_ctl.last_tlp_acked_start)) && + (SEQ_LEQ(end, rack->r_ctl.last_tlp_acked_end))) { + /* + * The DSACK is because of a TLP which we don't + * do anything with the reordering window over since + * it was not reordering that caused the DSACK but + * our previous retransmit TLP. + */ + rack_log_dsack_event(rack, 7, __LINE__, start, end); + goto skip_dsack_round; + } + if (rack->rc_last_sent_tlp_seq_valid) { + l_end = rack->r_ctl.last_sent_tlp_seq + rack->r_ctl.last_sent_tlp_len; + if (SEQ_GEQ(start, rack->r_ctl.last_sent_tlp_seq) && + (SEQ_LEQ(end, l_end))) { + /* + * This dsack is from the last sent TLP, ignore it + * for reordering purposes. + */ + rack_log_dsack_event(rack, 7, __LINE__, start, end); + goto skip_dsack_round; + } + } + if (rack->rc_dsack_round_seen == 0) { + rack->rc_dsack_round_seen = 1; + rack->r_ctl.dsack_round_end = rack->rc_tp->snd_max; + rack->r_ctl.num_dsack++; + rack->r_ctl.dsack_persist = 16; /* 16 is from the standard */ + rack_log_dsack_event(rack, 2, __LINE__, 0, 0); + } +skip_dsack_round: /* * We keep track of how many DSACK blocks we get * after a recovery incident. @@ -9233,9 +9611,9 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered SEQ_LEQ(sack.end, tp->snd_max)) { sack_blocks[num_sack_blks] = sack; num_sack_blks++; -#ifdef NETFLIX_STATS } else if (SEQ_LEQ(sack.start, th_ack) && SEQ_LEQ(sack.end, th_ack)) { +#ifdef NETFLIX_STATS /* * Its a D-SACK block. */ @@ -9244,6 +9622,14 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered rack_note_dsack(rack, sack.start, sack.end); } } + if (rack->rc_dsack_round_seen) { + /* Is the dsack roound over? */ + if (SEQ_GEQ(th_ack, rack->r_ctl.dsack_round_end)) { + /* Yes it is */ + rack->rc_dsack_round_seen = 0; + rack_log_dsack_event(rack, 3, __LINE__, 0, 0); + } + } /* * Sort the SACK blocks so we can update the rack scoreboard with * just one pass. @@ -9823,7 +10209,9 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); } - if ((th->th_ack == tp->snd_una) && (tiwin == tp->snd_wnd)) { + if ((th->th_ack == tp->snd_una) && + (tiwin == tp->snd_wnd) && + ((to->to_flags & TOF_SACK) == 0)) { rack_strike_dupack(rack); dup_ack_struck = 1; } @@ -12043,9 +12431,7 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) #ifdef INET struct ip *ip = NULL; #endif -#if defined(INET) || defined(INET6) struct udphdr *udp = NULL; -#endif /* Ok lets fill in the fast block, it can only be used with no IP options! */ #ifdef INET6 @@ -12069,7 +12455,6 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) ip6, rack->r_ctl.fsb.th); } else #endif /* INET6 */ -#ifdef INET { rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr); ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; @@ -12089,7 +12474,6 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) tp->t_port, ip, rack->r_ctl.fsb.th); } -#endif rack->r_fsb_inited = 1; } @@ -12245,6 +12629,14 @@ rack_init(struct tcpcb *tp) rack->r_ctl.rc_time_of_last_probertt = us_cts; rack->r_ctl.challenge_ack_ts = tcp_ts_getticks(); rack->r_ctl.rc_time_probertt_starts = 0; + if (rack_dsack_std_based & 0x1) { + /* Basically this means all rack timers are at least (srtt + 1/4 srtt) */ + rack->rc_rack_tmr_std_based = 1; + } + if (rack_dsack_std_based & 0x2) { + /* Basically this means rack timers are extended based on dsack by up to (2 * srtt) */ + rack->rc_rack_use_dsack = 1; + } /* We require at least one measurement, even if the sysctl is 0 */ if (rack_req_measurements) rack->r_ctl.req_measurements = rack_req_measurements; @@ -13122,7 +13514,6 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb } } else if (ae->ack_val_set == ACK_DUPACK) { /* Case D */ - rack_strike_dupack(rack); } else if (ae->ack_val_set == ACK_RWND) { /* Case C */ @@ -13172,6 +13563,14 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb rack->r_ctl.act_rcv_time = *tv; } rack_process_to_cumack(tp, rack, ae->ack, cts, to); + if (rack->rc_dsack_round_seen) { + /* Is the dsack roound over? */ + if (SEQ_GEQ(ae->ack, rack->r_ctl.dsack_round_end)) { + /* Yes it is */ + rack->rc_dsack_round_seen = 0; + rack_log_dsack_event(rack, 3, __LINE__, 0, 0); + } + } } } /* And lets be sure to commit the rtt measurements for this ack */ @@ -13609,13 +14008,6 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, * the scale is zero. */ tiwin = th->th_win << tp->snd_scale; - /* - * Parse options on any incoming segment. - */ - memset(&to, 0, sizeof(to)); - tcp_dooptions(&to, (u_char *)(th + 1), - (th->th_off << 2) - sizeof(struct tcphdr), - (thflags & TH_SYN) ? TO_SYN : 0); #ifdef TCP_ACCOUNTING if (thflags & TH_ACK) { /* @@ -13639,6 +14031,13 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, ctf_fixed_maxseg(tp)); } #endif + /* + * Parse options on any incoming segment. + */ + memset(&to, 0, sizeof(to)); + tcp_dooptions(&to, (u_char *)(th + 1), + (th->th_off << 2) - sizeof(struct tcphdr), + (thflags & TH_SYN) ? TO_SYN : 0); NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(tp->t_inpcb); KASSERT(tp->t_state > TCPS_LISTEN, ("%s: TCPS_LISTEN", @@ -13769,14 +14168,6 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, #endif return (1); } - - /* - * Parse options on any incoming segment. - */ - tcp_dooptions(&to, (u_char *)(th + 1), - (th->th_off << 2) - sizeof(struct tcphdr), - (thflags & TH_SYN) ? TO_SYN : 0); - /* * If timestamps were negotiated during SYN/ACK and a * segment without a timestamp is received, silently drop @@ -15230,7 +15621,7 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma struct tcpopt to; u_char opt[TCP_MAXOLEN]; uint32_t hdrlen, optlen; - int32_t slot, segsiz, max_val, tso = 0, error = 0, flags, ulen = 0; + int32_t slot, segsiz, max_val, tso = 0, error, flags, ulen = 0; uint32_t us_cts; uint32_t if_hw_tsomaxsegcount = 0, startseq; uint32_t if_hw_tsomaxsegsize; @@ -15250,10 +15641,13 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma if (tp->t_port && (V_tcp_udp_tunneling_port == 0)) { goto failed; } - if (rsm->r_flags & RACK_TLP) - doing_tlp = 1; - else if (doing_tlp) + if (doing_tlp) { + /* Its a TLP add the flag, it may already be there but be sure */ rsm->r_flags |= RACK_TLP; + } else { + /* If it was a TLP it is not not on this retransmit */ + rsm->r_flags &= ~RACK_TLP; + } startseq = rsm->r_start; segsiz = min(ctf_fixed_maxseg(tp), rack->r_ctl.rc_pace_min_segs); inp = rack->rc_inp; @@ -15555,8 +15949,15 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma rack->rc_tlp_in_progress = 1; rack->r_ctl.rc_tlp_cnt_out++; } - if (error == 0) + if (error == 0) { tcp_account_for_send(tp, len, 1, doing_tlp, rsm->r_hw_tls); + if (doing_tlp) { + rack->rc_last_sent_tlp_past_cumack = 0; + rack->rc_last_sent_tlp_seq_valid = 1; + rack->r_ctl.last_sent_tlp_seq = rsm->r_start; + rack->r_ctl.last_sent_tlp_len = rsm->r_end - rsm->r_start; + } + } tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); rack->forced_ack = 0; /* If we send something zap the FA flag */ if (IN_FASTRECOVERY(tp->t_flags) && rsm) @@ -15710,7 +16111,7 @@ rack_fast_output(struct tcpcb *tp, struct tcp_rack *rack, uint64_t ts_val, u_char opt[TCP_MAXOLEN]; uint32_t hdrlen, optlen; int cnt_thru = 1; - int32_t slot, segsiz, len, max_val, tso = 0, sb_offset, error = 0, flags, ulen = 0; + int32_t slot, segsiz, len, max_val, tso = 0, sb_offset, error, flags, ulen = 0; uint32_t us_cts, s_soff; uint32_t if_hw_tsomaxsegcount = 0, startseq; uint32_t if_hw_tsomaxsegsize; @@ -16123,9 +16524,9 @@ rack_output(struct tcpcb *tp) long tot_len_this_send = 0; #ifdef INET struct ip *ip = NULL; +#endif #ifdef TCPDEBUG struct ipovly *ipov = NULL; -#endif #endif struct udphdr *udp = NULL; struct tcp_rack *rack; @@ -16134,10 +16535,7 @@ rack_output(struct tcpcb *tp) uint8_t mark = 0; uint8_t wanted_cookie = 0; u_char opt[TCP_MAXOLEN]; - unsigned ipoptlen, optlen, hdrlen; -#if defined(INET) || defined(INET6) - unsigned ulen=0; -#endif + unsigned ipoptlen, optlen, hdrlen, ulen=0; uint32_t rack_seq; #if defined(IPSEC) || defined(IPSEC_SUPPORT) @@ -16420,7 +16818,6 @@ again: /* Retransmit timer */ rsm = rack->r_ctl.rc_resend; rack->r_ctl.rc_resend = NULL; - rsm->r_flags &= ~RACK_TLP; len = rsm->r_end - rsm->r_start; sack_rxmit = 1; sendalot = 0; @@ -16433,7 +16830,6 @@ again: len = segsiz; } else if ((rsm = tcp_rack_output(tp, rack, cts)) != NULL) { /* We have a retransmit that takes precedence */ - rsm->r_flags &= ~RACK_TLP; if ((!IN_FASTRECOVERY(tp->t_flags)) && ((tp->t_flags & TF_WASFRECOVERY) == 0)) { /* Enter recovery if not induced by a time-out */ @@ -16476,8 +16872,8 @@ again: * went off. */ rsm = rack->r_ctl.rc_tlpsend; + /* We are doing a TLP make sure the flag is preent */ rsm->r_flags |= RACK_TLP; - rack->r_ctl.rc_tlpsend = NULL; sack_rxmit = 1; tlen = rsm->r_end - rsm->r_start; @@ -17837,29 +18233,21 @@ send: #endif if ((ipoptlen == 0) && (rack->r_ctl.fsb.tcp_ip_hdr) && rack->r_fsb_inited) { #ifdef INET6 - if (isipv6) { + if (isipv6) ip6 = (struct ip6_hdr *)rack->r_ctl.fsb.tcp_ip_hdr; - } else + else #endif /* INET6 */ - { -#ifdef INET ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; -#endif - } th = rack->r_ctl.fsb.th; udp = rack->r_ctl.fsb.udp; if (udp) { #ifdef INET6 - if (isipv6) { + if (isipv6) ulen = hdrlen + len - sizeof(struct ip6_hdr); - } else + else #endif /* INET6 */ - { -#ifdef INET ulen = hdrlen + len - sizeof(struct ip); - udp->uh_ulen = htons(ulen); -#endif - } + udp->uh_ulen = htons(ulen); } } else { #ifdef INET6 @@ -17878,7 +18266,6 @@ send: } else #endif /* INET6 */ { -#ifdef INET ip = mtod(m, struct ip *); #ifdef TCPDEBUG ipov = (struct ipovly *)ip; @@ -17893,7 +18280,6 @@ send: } else th = (struct tcphdr *)(ip + 1); tcpip_fillheaders(inp, tp->t_port, ip, th); -#endif /* INET */ } } /* @@ -17932,15 +18318,11 @@ send: if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && (sack_rxmit == 0)) { #ifdef INET6 - if (isipv6) { + if (isipv6) ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); - } else + else #endif - { -#ifdef INET ip->ip_tos |= IPTOS_ECN_ECT0; -#endif - } KMOD_TCPSTAT_INC(tcps_ecn_ect0); /* * Reply with proper ECN notifications. @@ -18045,9 +18427,7 @@ send: ip6 = mtod(m, struct ip6_hdr *); else #endif /* INET6 */ *** 176 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:12:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACE1A66B5D7; Tue, 17 Aug 2021 21:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq3cz4GNsz3wRt; Tue, 17 Aug 2021 21:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A5CA24AB9; Tue, 17 Aug 2021 21:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLC303076282; Tue, 17 Aug 2021 21:12:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLC3X3076281; Tue, 17 Aug 2021 21:12:03 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:12:03 GMT Message-Id: <202108172112.17HLC3X3076281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 36e15b717eec - main - routing: Fix crashes with dpdk_lpm[46] algo. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36e15b717eec80047fe7442898b5752101f2fbca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:12:03 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=36e15b717eec80047fe7442898b5752101f2fbca commit 36e15b717eec80047fe7442898b5752101f2fbca Author: Alexander V. Chernikov AuthorDate: 2021-08-15 22:25:21 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-17 20:46:22 +0000 routing: Fix crashes with dpdk_lpm[46] algo. When a prefix gets deleted from the RIB, dpdk_lpm algo needs to know the nexthop of the "parent" prefix to update its internal state. The glue code, which utilises RIB as a backing route store, uses fib[46]_lookup_rt() for the prefix destination after its deletion to fetch the desired nexthop. This approach does not work when deleting less-specific prefixes with most-specific ones are still present. For example, if 10.0.0.0/24, 10.0.0.0/23 and 10.0.0.0/22 exist in RIB, deleting 10.0.0.0/23 would result in 10.0.0.0/24 being returned as a search result instead of 10.0.0.0/22. This, in turn, results in the failed datastructure update: part of the deleted /23 prefix will still contain the reference to an old nexthop. This leads to the use-after-free behaviour, ending with the eventual crashes. Fix the logic flaw by properly fetching the prefix "parent" via newly-created rt_get_inet[6]_parent() helpers. Differential Revision: https://reviews.freebsd.org/D31546 PR: 256882,256833 MFC after: 1 week --- sys/contrib/dpdk_rte_lpm/dpdk_lpm.c | 32 ++++---- sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c | 42 +++++----- sys/net/radix.c | 14 ++++ sys/net/radix.h | 1 + sys/net/route/route_ctl.h | 3 + sys/net/route/route_helpers.c | 150 +++++++++++++++++++++++++++++++++++ 6 files changed, 208 insertions(+), 34 deletions(-) diff --git a/sys/contrib/dpdk_rte_lpm/dpdk_lpm.c b/sys/contrib/dpdk_rte_lpm/dpdk_lpm.c index af145997c4d6..51cd134132f6 100644 --- a/sys/contrib/dpdk_rte_lpm/dpdk_lpm.c +++ b/sys/contrib/dpdk_rte_lpm/dpdk_lpm.c @@ -134,26 +134,27 @@ handle_default_change(struct dpdk_lpm_data *dd, struct rib_cmd_info *rc) } static void -get_parent_rule(struct dpdk_lpm_data *dd, struct in_addr addr, uint8_t *plen, uint32_t *nhop_idx) +get_parent_rule(struct dpdk_lpm_data *dd, struct in_addr addr, int plen, + uint8_t *pplen, uint32_t *nhop_idx) { - struct route_nhop_data rnd; struct rtentry *rt; - rt = fib4_lookup_rt(dd->fibnum, addr, 0, NHR_UNLOCKED, &rnd); + rt = rt_get_inet_parent(dd->fibnum, addr, plen); if (rt != NULL) { struct in_addr addr4; uint32_t scopeid; - int inet_plen; - rt_get_inet_prefix_plen(rt, &addr4, &inet_plen, &scopeid); - if (inet_plen > 0) { - *plen = inet_plen; - *nhop_idx = fib_get_nhop_idx(dd->fd, rnd.rnd_nhop); + int parent_plen; + + rt_get_inet_prefix_plen(rt, &addr4, &parent_plen, &scopeid); + if (parent_plen > 0) { + *pplen = parent_plen; + *nhop_idx = fib_get_nhop_idx(dd->fd, rt_get_raw_nhop(rt)); return; } } *nhop_idx = 0; - *plen = 0; + *pplen = 0; } static enum flm_op_result @@ -181,20 +182,23 @@ handle_gu_change(struct dpdk_lpm_data *dd, const struct rib_cmd_info *rc, } ret = rte_lpm_add(dd->lpm, ip, plen, nhidx); - FIB_PRINTF(LOG_DEBUG, dd->fd, "DPDK GU: %s %s/%d nhop %u = %d", + FIB_PRINTF(LOG_DEBUG, dd->fd, "DPDK GU: %s %s/%d nhop %u -> %u ret: %d", (rc->rc_cmd == RTM_ADD) ? "ADD" : "UPDATE", - abuf, plen, nhidx, ret); + abuf, plen, + rc->rc_nh_old != NULL ? fib_get_nhop_idx(dd->fd, rc->rc_nh_old) : 0, + nhidx, ret); } else { /* * Need to lookup parent. Assume deletion happened already */ uint8_t parent_plen; uint32_t parent_nhop_idx; - get_parent_rule(dd, addr, &parent_plen, &parent_nhop_idx); + get_parent_rule(dd, addr, plen, &parent_plen, &parent_nhop_idx); ret = rte_lpm_delete(dd->lpm, ip, plen, parent_plen, parent_nhop_idx); - FIB_PRINTF(LOG_DEBUG, dd->fd, "DPDK: %s %s/%d nhop %u = %d", - "DEL", abuf, plen, nhidx, ret); + FIB_PRINTF(LOG_DEBUG, dd->fd, "DPDK: %s %s/%d -> /%d nhop %u -> %u ret: %d", + "DEL", abuf, plen, parent_plen, fib_get_nhop_idx(dd->fd, rc->rc_nh_old), + parent_nhop_idx, ret); } if (ret != 0) { diff --git a/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c b/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c index 17d35c16346d..ec1a3228d42b 100644 --- a/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c +++ b/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c @@ -165,30 +165,26 @@ handle_ll_change(struct dpdk_lpm6_data *dd, struct rib_cmd_info *rc, } static struct rte_lpm6_rule * -pack_parent_rule(struct dpdk_lpm6_data *dd, const struct in6_addr *addr6, - char *buffer) +pack_parent_rule(struct dpdk_lpm6_data *dd, const struct in6_addr *addr6, int plen, + int *pplen, uint32_t *pnhop_idx, char *buffer) { struct rte_lpm6_rule *lsp_rule = NULL; - struct route_nhop_data rnd; struct rtentry *rt; - int plen; - rt = fib6_lookup_rt(dd->fibnum, addr6, 0, NHR_UNLOCKED, &rnd); + *pnhop_idx = 0; + *pplen = 0; + + rt = rt_get_inet6_parent(dd->fibnum, addr6, plen); /* plen = 0 means default route and it's out of scope */ if (rt != NULL) { - uint32_t scopeid; + uint32_t nhop_idx, scopeid; struct in6_addr new_addr6; rt_get_inet6_prefix_plen(rt, &new_addr6, &plen, &scopeid); if (plen > 0) { - uint32_t nhidx = fib_get_nhop_idx(dd->fd, rnd.rnd_nhop); - if (nhidx == 0) { - /* - * shouldn't happen as we already have parent route. - * It will trigger rebuild automatically. - */ - return (NULL); - } - lsp_rule = fill_rule6(buffer, (uint8_t *)&new_addr6, plen, nhidx); + nhop_idx = fib_get_nhop_idx(dd->fd, rt_get_raw_nhop(rt)); + lsp_rule = fill_rule6(buffer, (uint8_t *)&new_addr6, plen, nhop_idx); + *pnhop_idx = nhop_idx; + *pplen = plen; } } @@ -217,20 +213,26 @@ handle_gu_change(struct dpdk_lpm6_data *dd, const struct rib_cmd_info *rc, ret = rte_lpm6_add(dd->lpm6, (const uint8_t *)addr6, plen, nhidx, (rc->rc_cmd == RTM_ADD) ? 1 : 0); - FIB_PRINTF(LOG_DEBUG, dd->fd, "DPDK GU: %s %s/%d nhop %u = %d", + FIB_PRINTF(LOG_DEBUG, dd->fd, "DPDK GU: %s %s/%d nhop %u -> %u ret: %d", (rc->rc_cmd == RTM_ADD) ? "ADD" : "UPDATE", - abuf, plen, nhidx, ret); + abuf, plen, + rc->rc_nh_old != NULL ? fib_get_nhop_idx(dd->fd, rc->rc_nh_old) : 0, + nhidx, ret); } else { /* * Need to lookup parent. Assume deletion happened already */ char buffer[RTE_LPM6_RULE_SIZE]; struct rte_lpm6_rule *lsp_rule = NULL; - lsp_rule = pack_parent_rule(dd, addr6, buffer); + int parent_plen; + uint32_t parent_nhop_idx; + lsp_rule = pack_parent_rule(dd, addr6, plen, &parent_plen, + &parent_nhop_idx, buffer); ret = rte_lpm6_delete(dd->lpm6, (const uint8_t *)addr6, plen, lsp_rule); - FIB_PRINTF(LOG_DEBUG, dd->fd, "DPDK GU: %s %s/%d nhop ? = %d", - "DEL", abuf, plen, ret); + FIB_PRINTF(LOG_DEBUG, dd->fd, "DPDK GU: %s %s/%d -> /%d nhop %u -> %u ret: %d", + "DEL", abuf, plen, parent_plen, fib_get_nhop_idx(dd->fd, rc->rc_nh_old), + parent_nhop_idx, ret); } if (ret != 0) { diff --git a/sys/net/radix.c b/sys/net/radix.c index 931bf6db871b..2169361c7229 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -371,6 +371,20 @@ on1: return (0); } +/* + * Returns the next (wider) prefix for the key defined by @rn + * if exists. + */ +struct radix_node * +rn_nextprefix(struct radix_node *rn) +{ + for (rn = rn->rn_dupedkey; rn != NULL; rn = rn->rn_dupedkey) { + if (!(rn->rn_flags & RNF_ROOT)) + return (rn); + } + return (NULL); +} + #ifdef RN_DEBUG int rn_nodenum; struct radix_node *rn_clist; diff --git a/sys/net/radix.h b/sys/net/radix.h index a0e5e5c5aa3f..97555ee9e16d 100644 --- a/sys/net/radix.h +++ b/sys/net/radix.h @@ -119,6 +119,7 @@ typedef int rn_walktree_t(struct radix_head *head, walktree_f_t *f, typedef int rn_walktree_from_t(struct radix_head *head, void *a, void *m, walktree_f_t *f, void *w); typedef void rn_close_t(struct radix_node *rn, struct radix_head *head); +struct radix_node *rn_nextprefix(struct radix_node *rn); struct radix_mask_head; diff --git a/sys/net/route/route_ctl.h b/sys/net/route/route_ctl.h index 229c762d4a73..a670979df8c9 100644 --- a/sys/net/route/route_ctl.h +++ b/sys/net/route/route_ctl.h @@ -117,6 +117,7 @@ void rt_get_inet_prefix_plen(const struct rtentry *rt, struct in_addr *paddr, int *plen, uint32_t *pscopeid); void rt_get_inet_prefix_pmask(const struct rtentry *rt, struct in_addr *paddr, struct in_addr *pmask, uint32_t *pscopeid); +struct rtentry *rt_get_inet_parent(uint32_t fibnum, struct in_addr addr, int plen); #endif #ifdef INET6 struct in6_addr; @@ -124,6 +125,8 @@ void rt_get_inet6_prefix_plen(const struct rtentry *rt, struct in6_addr *paddr, int *plen, uint32_t *pscopeid); void rt_get_inet6_prefix_pmask(const struct rtentry *rt, struct in6_addr *paddr, struct in6_addr *pmask, uint32_t *pscopeid); +struct rtentry *rt_get_inet6_parent(uint32_t fibnum, const struct in6_addr *paddr, + int plen); #endif /* Nexthops */ diff --git a/sys/net/route/route_helpers.c b/sys/net/route/route_helpers.c index 5d29197cc4fb..569e13a308eb 100644 --- a/sys/net/route/route_helpers.c +++ b/sys/net/route/route_helpers.c @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #endif #ifdef INET6 #include +#include #endif #include @@ -415,3 +416,152 @@ rib_decompose_notification(struct rib_cmd_info *rc, route_notification_t *cb, } } #endif + +#ifdef INET +/* + * Checks if the found key in the trie contains (<=) a prefix covering + * @paddr/@plen. + * Returns the most specific rtentry matching the condition or NULL. + */ +static struct rtentry * +get_inet_parent_prefix(uint32_t fibnum, struct in_addr addr, int plen) +{ + struct route_nhop_data rnd; + struct rtentry *rt; + struct in_addr addr4; + uint32_t scopeid; + int parent_plen; + struct radix_node *rn; + + rt = fib4_lookup_rt(fibnum, addr, 0, NHR_UNLOCKED, &rnd); + rt_get_inet_prefix_plen(rt, &addr4, &parent_plen, &scopeid); + if (parent_plen <= plen) + return (rt); + + /* + * There can be multiple prefixes associated with the found key: + * 10.0.0.0 -> 10.0.0.0/24, 10.0.0.0/23, 10.0.0.0/22, etc. + * All such prefixes are linked via rn_dupedkey, from most specific + * to least specific. Iterate over them to check if any of these + * prefixes are wider than desired plen. + */ + rn = (struct radix_node *)rt; + while ((rn = rn_nextprefix(rn)) != NULL) { + rt = RNTORT(rn); + rt_get_inet_prefix_plen(rt, &addr4, &parent_plen, &scopeid); + if (parent_plen <= plen) + return (rt); + } + + return (NULL); +} + +/* + * Returns the most specific prefix containing (>) @paddr/plen. + */ +struct rtentry * +rt_get_inet_parent(uint32_t fibnum, struct in_addr addr, int plen) +{ + struct in_addr lookup_addr = { .s_addr = INADDR_BROADCAST }; + struct in_addr addr4 = addr; + struct in_addr mask4; + struct rtentry *rt; + + while (plen-- > 0) { + /* Calculate wider mask & new key to lookup */ + mask4.s_addr = htonl(plen ? ~((1 << (32 - plen)) - 1) : 0); + addr4.s_addr = htonl(ntohl(addr4.s_addr) & ntohl(mask4.s_addr)); + if (addr4.s_addr == lookup_addr.s_addr) { + /* Skip lookup if the key is the same */ + continue; + } + lookup_addr = addr4; + + rt = get_inet_parent_prefix(fibnum, lookup_addr, plen); + if (rt != NULL) + return (rt); + } + + return (NULL); +} +#endif + +#ifdef INET6 +/* + * Checks if the found key in the trie contains (<=) a prefix covering + * @paddr/@plen. + * Returns the most specific rtentry matching the condition or NULL. + */ +static struct rtentry * +get_inet6_parent_prefix(uint32_t fibnum, const struct in6_addr *paddr, int plen) +{ + struct route_nhop_data rnd; + struct rtentry *rt; + struct in6_addr addr6; + uint32_t scopeid; + int parent_plen; + struct radix_node *rn; + + rt = fib6_lookup_rt(fibnum, paddr, 0, NHR_UNLOCKED, &rnd); + rt_get_inet6_prefix_plen(rt, &addr6, &parent_plen, &scopeid); + if (parent_plen <= plen) + return (rt); + + /* + * There can be multiple prefixes associated with the found key: + * 2001:db8:1::/64 -> 2001:db8:1::/56, 2001:db8:1::/48, etc. + * All such prefixes are linked via rn_dupedkey, from most specific + * to least specific. Iterate over them to check if any of these + * prefixes are wider than desired plen. + */ + rn = (struct radix_node *)rt; + while ((rn = rn_nextprefix(rn)) != NULL) { + rt = RNTORT(rn); + rt_get_inet6_prefix_plen(rt, &addr6, &parent_plen, &scopeid); + if (parent_plen <= plen) + return (rt); + } + + return (NULL); +} + +static void +ipv6_writemask(struct in6_addr *addr6, uint8_t mask) +{ + uint32_t *cp; + + for (cp = (uint32_t *)addr6; mask >= 32; mask -= 32) + *cp++ = 0xFFFFFFFF; + if (mask > 0) + *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); +} + +/* + * Returns the most specific prefix containing (>) @paddr/plen. + */ +struct rtentry * +rt_get_inet6_parent(uint32_t fibnum, const struct in6_addr *paddr, int plen) +{ + struct in6_addr lookup_addr = in6mask128; + struct in6_addr addr6 = *paddr; + struct in6_addr mask6; + struct rtentry *rt; + + while (plen-- > 0) { + /* Calculate wider mask & new key to lookup */ + ipv6_writemask(&mask6, plen); + IN6_MASK_ADDR(&addr6, &mask6); + if (IN6_ARE_ADDR_EQUAL(&addr6, &lookup_addr)) { + /* Skip lookup if the key is the same */ + continue; + } + lookup_addr = addr6; + + rt = get_inet6_parent_prefix(fibnum, &lookup_addr, plen); + if (rt != NULL) + return (rt); + } + + return (NULL); +} +#endif From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:15:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2906566BB4C; Tue, 17 Aug 2021 21:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq3hj0VNZz4Rsr; Tue, 17 Aug 2021 21:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED1AE24AC3; Tue, 17 Aug 2021 21:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLFG79076676; Tue, 17 Aug 2021 21:15:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLFG8Z076675; Tue, 17 Aug 2021 21:15:16 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:15:16 GMT Message-Id: <202108172115.17HLFG8Z076675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 406a4b37a24e - stable/13 - [multipath][nhops] Fix random crashes with high route churn rate. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 406a4b37a24e655b8a5d8f3401e636ba43f37978 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:15:17 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=406a4b37a24e655b8a5d8f3401e636ba43f37978 commit 406a4b37a24e655b8a5d8f3401e636ba43f37978 Author: Alexander V. Chernikov AuthorDate: 2021-08-01 09:46:05 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-17 21:14:42 +0000 [multipath][nhops] Fix random crashes with high route churn rate. When certain multipath route begins flapping really fast, it may result in creating multiple identical nexthop groups. The code responsible for unlinking unused nexthop groups had an implicit assumption that there could be only one nexthop group for the same combination of nexthops with weights. This assumption resulted in always unlinking the first "identical" group, instead of the desired one. Such action, in turn, produced a used-but-unlinked nhg along with freed-and-linked nhg, ending up in random crashes. Similarly, it is possible that multiple identical nexthops gets created in the case of high route churn, resulting in the same problem when deleting one of such nexthops. Fix by matching the nexthop/nexhop group pointer when deleting the item. Reported by: avg (cherry picked from commit 054948bd81bb9e4e32449cf351b62e501b8831ff) --- sys/net/route/nhgrp.c | 2 +- sys/net/route/nhop.c | 2 +- sys/net/route/nhop_utils.h | 23 +++-------------------- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/sys/net/route/nhgrp.c b/sys/net/route/nhgrp.c index f6638b12ebea..f40ee3c2981c 100644 --- a/sys/net/route/nhgrp.c +++ b/sys/net/route/nhgrp.c @@ -187,7 +187,7 @@ unlink_nhgrp(struct nh_control *ctl, struct nhgrp_priv *key) NHOPS_WLOCK(ctl); - CHT_SLIST_REMOVE_BYOBJ(&ctl->gr_head, mpath, key, nhg_priv_ret); + CHT_SLIST_REMOVE(&ctl->gr_head, mpath, key, nhg_priv_ret); if (nhg_priv_ret == NULL) { DPRINTF("Unable to find nhop group!"); diff --git a/sys/net/route/nhop.c b/sys/net/route/nhop.c index 0db47db9916e..ab5e393ae56a 100644 --- a/sys/net/route/nhop.c +++ b/sys/net/route/nhop.c @@ -337,7 +337,7 @@ unlink_nhop(struct nh_control *ctl, struct nhop_priv *nh_priv_del) idx = 0; NHOPS_WLOCK(ctl); - CHT_SLIST_REMOVE_BYOBJ(&ctl->nh_head, nhops, nh_priv_del, priv_ret); + CHT_SLIST_REMOVE(&ctl->nh_head, nhops, nh_priv_del, priv_ret); if (priv_ret != NULL) { idx = priv_ret->nh_idx; diff --git a/sys/net/route/nhop_utils.h b/sys/net/route/nhop_utils.h index a0d7cd564e72..1f56f4cb8b0b 100644 --- a/sys/net/route/nhop_utils.h +++ b/sys/net/route/nhop_utils.h @@ -115,31 +115,13 @@ struct _HNAME##_head { \ (_head)->items_count++; \ } while(0) -#define CHT_SLIST_REMOVE(_head, _PX, _key, _ret) do { \ - typeof(*(_head)->ptr) _tmp; \ - uint32_t _buck = CHT_GET_BUCK(_head, _PX, _key); \ - _ret = CHT_FIRST(_head, _buck); \ - _tmp = NULL; \ - for ( ; _ret != NULL; _tmp = _ret, _ret = _PX##_next(_ret)) { \ - if (_PX##_cmp(_key, _ret)) \ - break; \ - } \ - if (_ret != NULL) { \ - if (_tmp == NULL) \ - CHT_FIRST(_head, _buck) = _PX##_next(_ret); \ - else \ - _PX##_next(_tmp) = _PX##_next(_ret); \ - (_head)->items_count--; \ - } \ -} while(0) - -#define CHT_SLIST_REMOVE_BYOBJ(_head, _PX, _obj, _ret) do { \ +#define CHT_SLIST_REMOVE(_head, _PX, _obj, _ret) do { \ typeof(*(_head)->ptr) _tmp; \ uint32_t _buck = CHT_GET_BUCK_OBJ(_head, _PX, _obj); \ _ret = CHT_FIRST(_head, _buck); \ _tmp = NULL; \ for ( ; _ret != NULL; _tmp = _ret, _ret = _PX##_next(_ret)) { \ - if (_PX##_cmp(_obj, _ret)) \ + if (_obj == _ret) \ break; \ } \ if (_ret != NULL) { \ @@ -150,6 +132,7 @@ struct _HNAME##_head { \ (_head)->items_count--; \ } \ } while(0) +#define CHT_SLIST_REMOVE_BYOBJ CHT_SLIST_REMOVE #define CHT_SLIST_FOREACH(_head, _PX, _x) \ for (uint32_t _i = 0; _i < (_head)->hash_size; _i++) { \ From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:45:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 506D066C5FB; Tue, 17 Aug 2021 21:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4N447hgz4TqF; Tue, 17 Aug 2021 21:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52FA225517; Tue, 17 Aug 2021 21:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLju9c017721; Tue, 17 Aug 2021 21:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLjuvm017720; Tue, 17 Aug 2021 21:45:56 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:45:56 GMT Message-Id: <202108172145.17HLjuvm017720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 334d228a204c - main - OpenSSL: Correct the return value of BIO_get_ktls_*(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 334d228a204c16d1384a978ab9b209e4e7e33275 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:45:57 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=334d228a204c16d1384a978ab9b209e4e7e33275 commit 334d228a204c16d1384a978ab9b209e4e7e33275 Author: John Baldwin AuthorDate: 2021-08-17 21:37:47 +0000 Commit: John Baldwin CommitDate: 2021-08-17 21:41:12 +0000 OpenSSL: Correct the return value of BIO_get_ktls_*(). BIO_get_ktls_send() and BIO_get_ktls_recv() are documented as returning either 0 or 1. However, they were actually returning the internal value of the associated BIO flag for the true case instead of 1. Also trim redundant ternary operators. Reviewed by: jkim Obtained from: OpenSSL (f16e52b67c9261bdc7e1284a50502a802921ac6d) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31438 --- crypto/openssl/crypto/bio/bss_conn.c | 6 +++--- crypto/openssl/crypto/bio/bss_fd.c | 2 +- crypto/openssl/crypto/bio/bss_sock.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crypto/openssl/crypto/bio/bss_conn.c b/crypto/openssl/crypto/bio/bss_conn.c index d4786442803e..10cf20871cb0 100644 --- a/crypto/openssl/crypto/bio/bss_conn.c +++ b/crypto/openssl/crypto/bio/bss_conn.c @@ -539,7 +539,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) } break; case BIO_CTRL_EOF: - ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; + ret = (b->flags & BIO_FLAGS_IN_EOF) != 0; break; # ifndef OPENSSL_NO_KTLS case BIO_CTRL_SET_KTLS: @@ -549,9 +549,9 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) BIO_set_ktls_flag(b, num); break; case BIO_CTRL_GET_KTLS_SEND: - return BIO_should_ktls_flag(b, 1); + return BIO_should_ktls_flag(b, 1) != 0; case BIO_CTRL_GET_KTLS_RECV: - return BIO_should_ktls_flag(b, 0); + return BIO_should_ktls_flag(b, 0) != 0; case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: BIO_set_ktls_ctrl_msg_flag(b); data->record_type = num; diff --git a/crypto/openssl/crypto/bio/bss_fd.c b/crypto/openssl/crypto/bio/bss_fd.c index ccbe1626baf2..8d03e48ce993 100644 --- a/crypto/openssl/crypto/bio/bss_fd.c +++ b/crypto/openssl/crypto/bio/bss_fd.c @@ -189,7 +189,7 @@ static long fd_ctrl(BIO *b, int cmd, long num, void *ptr) ret = 1; break; case BIO_CTRL_EOF: - ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; + ret = (b->flags & BIO_FLAGS_IN_EOF) != 0; break; default: ret = 0; diff --git a/crypto/openssl/crypto/bio/bss_sock.c b/crypto/openssl/crypto/bio/bss_sock.c index a1fc23c7c938..8de1f5829207 100644 --- a/crypto/openssl/crypto/bio/bss_sock.c +++ b/crypto/openssl/crypto/bio/bss_sock.c @@ -191,9 +191,9 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) BIO_set_ktls_flag(b, num); break; case BIO_CTRL_GET_KTLS_SEND: - return BIO_should_ktls_flag(b, 1); + return BIO_should_ktls_flag(b, 1) != 0; case BIO_CTRL_GET_KTLS_RECV: - return BIO_should_ktls_flag(b, 0); + return BIO_should_ktls_flag(b, 0) != 0; case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: BIO_set_ktls_ctrl_msg_flag(b); b->ptr = (void *)num; @@ -205,7 +205,7 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) break; # endif case BIO_CTRL_EOF: - ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; + ret = (b->flags & BIO_FLAGS_IN_EOF) != 0; break; default: ret = 0; From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:45:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3065866C421; Tue, 17 Aug 2021 21:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4N5467fz4TVh; Tue, 17 Aug 2021 21:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7610025424; Tue, 17 Aug 2021 21:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLjvAP017745; Tue, 17 Aug 2021 21:45:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLjvHo017744; Tue, 17 Aug 2021 21:45:57 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:45:57 GMT Message-Id: <202108172145.17HLjvHo017744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 63c6d3e283eb - main - OpenSSL: ktls: Initial support for ChaCha20-Poly1305 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63c6d3e283eb01d32f54e2a153e6719d19e4a80d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:45:58 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=63c6d3e283eb01d32f54e2a153e6719d19e4a80d commit 63c6d3e283eb01d32f54e2a153e6719d19e4a80d Author: John Baldwin AuthorDate: 2021-08-17 21:38:47 +0000 Commit: John Baldwin CommitDate: 2021-08-17 21:41:19 +0000 OpenSSL: ktls: Initial support for ChaCha20-Poly1305 Linux kernel is going to support ChaCha20-Poly1305 in TLS offload. Add support for this cipher. Reviewed by: jkim Obtained from: OpenSSL (3aa7212e0a4fd1533c8a28b8587dd8b022f3a66f) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31439 --- crypto/openssl/include/internal/ktls.h | 8 ++++++++ crypto/openssl/ssl/ktls.c | 21 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h index 622d7be76d1e..393794298ccd 100644 --- a/crypto/openssl/include/internal/ktls.h +++ b/crypto/openssl/include/internal/ktls.h @@ -219,6 +219,11 @@ static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, # define OPENSSL_KTLS_TLS13 # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) # define OPENSSL_KTLS_AES_CCM_128 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) +# ifndef OPENSSL_NO_CHACHA +# define OPENSSL_KTLS_CHACHA20_POLY1305 +# endif +# endif # endif # endif @@ -251,6 +256,9 @@ struct tls_crypto_info_all { # endif # ifdef OPENSSL_KTLS_AES_CCM_128 struct tls12_crypto_info_aes_ccm_128 ccm128; +# endif +# ifdef OPENSSL_KTLS_CHACHA20_POLY1305 + struct tls12_crypto_info_chacha20_poly1305 chacha20poly1305; # endif }; size_t tls_crypto_info_len; diff --git a/crypto/openssl/ssl/ktls.c b/crypto/openssl/ssl/ktls.c index 7123ecac0051..f82946b260ab 100644 --- a/crypto/openssl/ssl/ktls.c +++ b/crypto/openssl/ssl/ktls.c @@ -126,7 +126,9 @@ int ktls_check_supported_cipher(const SSL *s, const EVP_CIPHER *c, return 0; } - /* check that cipher is AES_GCM_128, AES_GCM_256, AES_CCM_128 */ + /* check that cipher is AES_GCM_128, AES_GCM_256, AES_CCM_128 + * or Chacha20-Poly1305 + */ switch (EVP_CIPHER_nid(c)) { # ifdef OPENSSL_KTLS_AES_CCM_128 @@ -139,6 +141,9 @@ int ktls_check_supported_cipher(const SSL *s, const EVP_CIPHER *c, # endif # ifdef OPENSSL_KTLS_AES_GCM_256 case NID_aes_256_gcm: +# endif +# ifdef OPENSSL_KTLS_CHACHA20_POLY1305 + case NID_chacha20_poly1305: # endif return 1; default: @@ -211,6 +216,20 @@ int ktls_configure_crypto(const SSL *s, const EVP_CIPHER *c, EVP_CIPHER_CTX *dd, if (rec_seq != NULL) *rec_seq = crypto_info->ccm128.rec_seq; return 1; +# endif +# ifdef OPENSSL_KTLS_CHACHA20_POLY1305 + case NID_chacha20_poly1305: + crypto_info->chacha20poly1305.info.cipher_type = TLS_CIPHER_CHACHA20_POLY1305; + crypto_info->chacha20poly1305.info.version = s->version; + crypto_info->tls_crypto_info_len = sizeof(crypto_info->chacha20poly1305); + memcpy(crypto_info->chacha20poly1305.iv, iiv, + TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE); + memcpy(crypto_info->chacha20poly1305.key, key, EVP_CIPHER_key_length(c)); + memcpy(crypto_info->chacha20poly1305.rec_seq, rl_sequence, + TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE); + if (rec_seq != NULL) + *rec_seq = crypto_info->chacha20poly1305.rec_seq; + return 1; # endif default: return 0; From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:46:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CC7366C422; Tue, 17 Aug 2021 21:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4N76WKVz4Tdc; Tue, 17 Aug 2021 21:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B725B251E0; Tue, 17 Aug 2021 21:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLjxxs017802; Tue, 17 Aug 2021 21:45:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLjxa4017801; Tue, 17 Aug 2021 21:45:59 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:45:59 GMT Message-Id: <202108172145.17HLjxa4017801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: a208223130fb - main - OpenSSL: Update KTLS documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a208223130fb12daac9b4f52be1b3477b03ac521 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:46:00 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a208223130fb12daac9b4f52be1b3477b03ac521 commit a208223130fb12daac9b4f52be1b3477b03ac521 Author: John Baldwin AuthorDate: 2021-08-17 21:39:32 +0000 Commit: John Baldwin CommitDate: 2021-08-17 21:41:31 +0000 OpenSSL: Update KTLS documentation KTLS support has been changed to be off by default, and configuration is via a single "option" rather two "modes". Documentation is updated accordingly. Reviewed by: jkim Obtained from: OpenSSL (6878f4300213cfd7d4f01e26a8b97f70344da100) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31441 --- crypto/openssl/doc/man3/SSL_CONF_cmd.pod | 4 ++++ crypto/openssl/doc/man3/SSL_CTX_set_mode.pod | 17 ----------------- crypto/openssl/doc/man3/SSL_CTX_set_options.pod | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/crypto/openssl/doc/man3/SSL_CONF_cmd.pod b/crypto/openssl/doc/man3/SSL_CONF_cmd.pod index 900c4f3a5648..a3f447a986e3 100644 --- a/crypto/openssl/doc/man3/SSL_CONF_cmd.pod +++ b/crypto/openssl/doc/man3/SSL_CONF_cmd.pod @@ -495,6 +495,10 @@ specification. Some applications may be able to mitigate the replay risks in other ways and in such cases the built-in OpenSSL functionality is not required. Disabling anti-replay is equivalent to setting B. +B: Enables kernel TLS if support has been compiled in, and it is supported +by the negotiated ciphersuites and extensions. Equivalent to +B. + =item B The B argument is a comma separated list of flags to set. diff --git a/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod b/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod index 27eaebad1ea0..85e3353e0e2c 100644 --- a/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod +++ b/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod @@ -114,22 +114,6 @@ enables this behaviour to allow interoperability with such broken implementations. Please note that setting this option breaks interoperability with correct implementations. This option only applies to DTLS over SCTP. -=item SSL_MODE_NO_KTLS_TX - -Disable the use of the kernel TLS egress data-path. -By default kernel TLS is enabled if it is supported by the negotiated ciphersuites -and extensions and OpenSSL has been compiled with support for it. -The kernel TLS data-path implements the record layer, -and the crypto algorithm. The kernel will utilize the best hardware -available for crypto. Using the kernel data-path should reduce the memory -footprint of OpenSSL because no buffering is required. Also, the throughput -should improve because data copy is avoided when user data is encrypted into -kernel memory instead of the usual encrypt than copy to kernel. - -Kernel TLS might not support all the features of OpenSSL. For instance, -renegotiation, and setting the maximum fragment size is not possible as of -Linux 4.20. - =back All modes are off by default except for SSL_MODE_AUTO_RETRY which is on by @@ -150,7 +134,6 @@ L, L =head1 HISTORY SSL_MODE_ASYNC was added in OpenSSL 1.1.0. -SSL_MODE_NO_KTLS_TX was first added to OpenSSL 3.0.0. =head1 COPYRIGHT diff --git a/crypto/openssl/doc/man3/SSL_CTX_set_options.pod b/crypto/openssl/doc/man3/SSL_CTX_set_options.pod index 969e0366c45a..231fe92d8e78 100644 --- a/crypto/openssl/doc/man3/SSL_CTX_set_options.pod +++ b/crypto/openssl/doc/man3/SSL_CTX_set_options.pod @@ -237,6 +237,29 @@ functionality is not required. Those applications can turn this feature off by setting this option. This is a server-side opton only. It is ignored by clients. +=item SSL_OP_ENABLE_KTLS + +Enable the use of kernel TLS. In order to benefit from kernel TLS OpenSSL must +have been compiled with support for it, and it must be supported by the +negotiated ciphersuites and extensions. The specific ciphersuites and extensions +that are supported may vary by platform and kernel version. + +The kernel TLS data-path implements the record layer, and the encryption +algorithm. The kernel will utilize the best hardware +available for encryption. Using the kernel data-path should reduce the memory +footprint of OpenSSL because no buffering is required. Also, the throughput +should improve because data copy is avoided when user data is encrypted into +kernel memory instead of the usual encrypt then copy to kernel. + +Kernel TLS might not support all the features of OpenSSL. For instance, +renegotiation, and setting the maximum fragment size is not possible as of +Linux 4.20. + +Note that with kernel TLS enabled some cryptographic operations are performed +by the kernel directly and not via any available OpenSSL Providers. This might +be undesirable if, for example, the application requires all cryptographic +operations to be performed by the FIPS provider. + =back The following options no longer have any effect but their identifiers are From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:45:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E10DB66C14F; Tue, 17 Aug 2021 21:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4N658TNz4ThQ; Tue, 17 Aug 2021 21:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A61025425; Tue, 17 Aug 2021 21:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLjwvA017769; Tue, 17 Aug 2021 21:45:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLjwBn017768; Tue, 17 Aug 2021 21:45:58 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:45:58 GMT Message-Id: <202108172145.17HLjwBn017768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 62ca9fc1ad56 - main - OpenSSL: Only enable KTLS if it is explicitly configured MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62ca9fc1ad569eb3fafd281e03812a598b9856ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:46:00 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=62ca9fc1ad569eb3fafd281e03812a598b9856ee commit 62ca9fc1ad569eb3fafd281e03812a598b9856ee Author: John Baldwin AuthorDate: 2021-08-17 21:39:03 +0000 Commit: John Baldwin CommitDate: 2021-08-17 21:41:24 +0000 OpenSSL: Only enable KTLS if it is explicitly configured It has always been the case that KTLS is not compiled by default. However if it is compiled then it was automatically used unless specifically configured not to. This is problematic because it avoids any crypto implementations from providers. A user who configures all crypto to use the FIPS provider may unexpectedly find that TLS related crypto is actually being performed outside of the FIPS boundary. Instead we change KTLS so that it is disabled by default. We also swap to using a single "option" (i.e. SSL_OP_ENABLE_KTLS) rather than two separate "modes", (i.e. SSL_MODE_NO_KTLS_RX and SSL_MODE_NO_KTLS_TX). Reviewed by: jkim Obtained from: OpenSSL (a3a54179b6754fbed6d88e434baac710a83aaf80) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31440 --- crypto/openssl/include/openssl/ssl.h | 12 +++--------- crypto/openssl/ssl/ktls.c | 1 + crypto/openssl/ssl/ssl_conf.c | 3 ++- crypto/openssl/ssl/t1_enc.c | 6 +----- crypto/openssl/ssl/tls13_enc.c | 5 +++-- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/crypto/openssl/include/openssl/ssl.h b/crypto/openssl/include/openssl/ssl.h index 09620489bc20..cfb87e63226e 100644 --- a/crypto/openssl/include/openssl/ssl.h +++ b/crypto/openssl/include/openssl/ssl.h @@ -303,7 +303,9 @@ typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); /* Allow initial connection to servers that don't support RI */ # define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004U -/* Reserved value (until OpenSSL 1.2.0) 0x00000008U */ +/* Enable support for Kernel TLS */ +# define SSL_OP_ENABLE_KTLS 0x00000008U + # define SSL_OP_TLSEXT_PADDING 0x00000010U /* Reserved value (until OpenSSL 1.2.0) 0x00000020U */ # define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040U @@ -493,10 +495,6 @@ typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); * Support Asynchronous operation */ # define SSL_MODE_ASYNC 0x00000100U -/* - * Don't use the kernel TLS data-path for sending. - */ -# define SSL_MODE_NO_KTLS_TX 0x00000200U /* * When using DTLS/SCTP, include the terminating zero in the label @@ -510,10 +508,6 @@ typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); * - OpenSSL 1.1.1 and 1.1.1a */ # define SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG 0x00000400U -/* - * Don't use the kernel TLS data-path for receiving. - */ -# define SSL_MODE_NO_KTLS_RX 0x00000800U /* Cert related flags */ /* diff --git a/crypto/openssl/ssl/ktls.c b/crypto/openssl/ssl/ktls.c index f82946b260ab..47328a7c7c73 100644 --- a/crypto/openssl/ssl/ktls.c +++ b/crypto/openssl/ssl/ktls.c @@ -137,6 +137,7 @@ int ktls_check_supported_cipher(const SSL *s, const EVP_CIPHER *c, return 0; # endif # ifdef OPENSSL_KTLS_AES_GCM_128 + /* Fall through */ case NID_aes_128_gcm: # endif # ifdef OPENSSL_KTLS_AES_GCM_256 diff --git a/crypto/openssl/ssl/ssl_conf.c b/crypto/openssl/ssl/ssl_conf.c index 0a3fef7c8c14..8013c62f0770 100644 --- a/crypto/openssl/ssl/ssl_conf.c +++ b/crypto/openssl/ssl/ssl_conf.c @@ -391,7 +391,8 @@ static int cmd_Options(SSL_CONF_CTX *cctx, const char *value) SSL_FLAG_TBL("AllowNoDHEKEX", SSL_OP_ALLOW_NO_DHE_KEX), SSL_FLAG_TBL("PrioritizeChaCha", SSL_OP_PRIORITIZE_CHACHA), SSL_FLAG_TBL("MiddleboxCompat", SSL_OP_ENABLE_MIDDLEBOX_COMPAT), - SSL_FLAG_TBL_INV("AntiReplay", SSL_OP_NO_ANTI_REPLAY) + SSL_FLAG_TBL_INV("AntiReplay", SSL_OP_NO_ANTI_REPLAY), + SSL_FLAG_TBL("KTLS", SSL_OP_ENABLE_KTLS) }; if (value == NULL) return -3; diff --git a/crypto/openssl/ssl/t1_enc.c b/crypto/openssl/ssl/t1_enc.c index d4614210685a..7d2eb381af1a 100644 --- a/crypto/openssl/ssl/t1_enc.c +++ b/crypto/openssl/ssl/t1_enc.c @@ -362,11 +362,7 @@ int tls1_change_cipher_state(SSL *s, int which) goto err; } #ifndef OPENSSL_NO_KTLS - if (s->compress) - goto skip_ktls; - - if (((which & SSL3_CC_READ) && (s->mode & SSL_MODE_NO_KTLS_RX)) - || ((which & SSL3_CC_WRITE) && (s->mode & SSL_MODE_NO_KTLS_TX))) + if (s->compress || (s->options & SSL_OP_ENABLE_KTLS) == 0) goto skip_ktls; /* ktls supports only the maximum fragment size */ diff --git a/crypto/openssl/ssl/tls13_enc.c b/crypto/openssl/ssl/tls13_enc.c index d9f050ee346d..39530237d897 100644 --- a/crypto/openssl/ssl/tls13_enc.c +++ b/crypto/openssl/ssl/tls13_enc.c @@ -724,8 +724,9 @@ int tls13_change_cipher_state(SSL *s, int which) s->statem.enc_write_state = ENC_WRITE_STATE_VALID; #ifndef OPENSSL_NO_KTLS # if defined(OPENSSL_KTLS_TLS13) - if (!(which & SSL3_CC_WRITE) || !(which & SSL3_CC_APPLICATION) - || ((which & SSL3_CC_WRITE) && (s->mode & SSL_MODE_NO_KTLS_TX))) + if (!(which & SSL3_CC_WRITE) + || !(which & SSL3_CC_APPLICATION) + || (s->options & SSL_OP_ENABLE_KTLS) == 0) goto skip_ktls; /* ktls supports only the maximum fragment size */ From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:46:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80BAF66C03F; Tue, 17 Aug 2021 21:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4N91GJQz4TvF; Tue, 17 Aug 2021 21:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB63525426; Tue, 17 Aug 2021 21:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLk0Ze017826; Tue, 17 Aug 2021 21:46:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLk02v017825; Tue, 17 Aug 2021 21:46:00 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:46:00 GMT Message-Id: <202108172146.17HLk02v017825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d6e78ecb0bcd - main - OpenSSL: Refactor KTLS tests to better support TLS 1.3. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6e78ecb0bcd5af750c72745c4c51fe211046bff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:46:02 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d6e78ecb0bcd5af750c72745c4c51fe211046bff commit d6e78ecb0bcd5af750c72745c4c51fe211046bff Author: John Baldwin AuthorDate: 2021-08-17 21:39:58 +0000 Commit: John Baldwin CommitDate: 2021-08-17 21:41:37 +0000 OpenSSL: Refactor KTLS tests to better support TLS 1.3. Most of this upstream commit touched tests not included in the vendor import. The one change merged in is to remove a constant only present in an internal header to appease the older tests. Reviewed by: jkim Obtained from: OpenSSL (e1fdd5262e4a45ce3aaa631768e877ee7b6da21b) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31442 --- crypto/openssl/include/internal/ktls.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h index 393794298ccd..e824cf3f3f92 100644 --- a/crypto/openssl/include/internal/ktls.h +++ b/crypto/openssl/include/internal/ktls.h @@ -39,12 +39,6 @@ # define OPENSSL_KTLS_AES_GCM_256 # define OPENSSL_KTLS_TLS13 -/* - * Only used by the tests in sslapitest.c. - */ -# define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE 8 -# define TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE 8 - typedef struct tls_enable ktls_crypto_info_t; /* From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:46:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81C2366C15C; Tue, 17 Aug 2021 21:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4NB1Mlpz4Thh; Tue, 17 Aug 2021 21:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07214251E1; Tue, 17 Aug 2021 21:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLk1vo017850; Tue, 17 Aug 2021 21:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLk1IO017849; Tue, 17 Aug 2021 21:46:01 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:46:01 GMT Message-Id: <202108172146.17HLk1IO017849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 6372fd253e32 - main - OpenSSL: Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6372fd253e3266c6eb271f49159f1632d527c9bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:46:02 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6372fd253e3266c6eb271f49159f1632d527c9bd commit 6372fd253e3266c6eb271f49159f1632d527c9bd Author: John Baldwin AuthorDate: 2021-08-17 21:40:16 +0000 Commit: John Baldwin CommitDate: 2021-08-17 21:41:42 +0000 OpenSSL: Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD. FreeBSD's kernel TLS supports Chacha20 for both TLS 1.2 and TLS 1.3. NB: This commit has not yet been merged upstream as it is deemed a new feature and did not make the feature freeze cutoff for OpenSSL 3.0. Reviewed by: jkim MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31443 --- crypto/openssl/include/internal/ktls.h | 5 +++++ crypto/openssl/ssl/ktls.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h index e824cf3f3f92..5f9e3f91edb2 100644 --- a/crypto/openssl/include/internal/ktls.h +++ b/crypto/openssl/include/internal/ktls.h @@ -38,6 +38,11 @@ # define OPENSSL_KTLS_AES_GCM_128 # define OPENSSL_KTLS_AES_GCM_256 # define OPENSSL_KTLS_TLS13 +# ifdef TLS_CHACHA20_IV_LEN +# ifndef OPENSSL_NO_CHACHA +# define OPENSSL_KTLS_CHACHA20_POLY1305 +# endif +# endif typedef struct tls_enable ktls_crypto_info_t; diff --git a/crypto/openssl/ssl/ktls.c b/crypto/openssl/ssl/ktls.c index 47328a7c7c73..c7a440b79bd2 100644 --- a/crypto/openssl/ssl/ktls.c +++ b/crypto/openssl/ssl/ktls.c @@ -37,6 +37,10 @@ int ktls_check_supported_cipher(const SSL *s, const EVP_CIPHER *c, case SSL_AES128GCM: case SSL_AES256GCM: return 1; +# ifdef OPENSSL_KTLS_CHACHA20_POLY1305 + case SSL_CHACHA20POLY1305: + return 1; +# endif case SSL_AES128: case SSL_AES256: if (s->ext.use_etm) @@ -71,6 +75,12 @@ int ktls_configure_crypto(const SSL *s, const EVP_CIPHER *c, EVP_CIPHER_CTX *dd, else crypto_info->iv_len = EVP_GCM_TLS_FIXED_IV_LEN; break; +# ifdef OPENSSL_KTLS_CHACHA20_POLY1305 + case SSL_CHACHA20POLY1305: + crypto_info->cipher_algorithm = CRYPTO_CHACHA20_POLY1305; + crypto_info->iv_len = EVP_CIPHER_CTX_iv_length(dd); + break; +# endif case SSL_AES128: case SSL_AES256: switch (s->s3->tmp.new_cipher->algorithm_mac) { From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:46:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58BCE66C1C4; Tue, 17 Aug 2021 21:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4NC3Xkfz4Tdv; Tue, 17 Aug 2021 21:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C6F325590; Tue, 17 Aug 2021 21:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLk3fT017876; Tue, 17 Aug 2021 21:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLk3aK017875; Tue, 17 Aug 2021 21:46:03 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:46:03 GMT Message-Id: <202108172146.17HLk3aK017875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 671a35b176e4 - main - UPDATING: Add a note about OpenSSL defaulting KTLS to off. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 671a35b176e4b3c445696a8b423db5f8de26c285 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:46:04 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=671a35b176e4b3c445696a8b423db5f8de26c285 commit 671a35b176e4b3c445696a8b423db5f8de26c285 Author: John Baldwin AuthorDate: 2021-08-17 21:40:33 +0000 Commit: John Baldwin CommitDate: 2021-08-17 21:43:46 +0000 UPDATING: Add a note about OpenSSL defaulting KTLS to off. Sponsored by: Netflix MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D31444 --- UPDATING | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UPDATING b/UPDATING index 512f33e9b43d..7293a336c99c 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20210817: + As of commit 62ca9fc1ad56 OpenSSL no longer enables kernel TLS + by default. Users can enable kernel TLS via the "KTLS" SSL + option. This can be enabled globally by using a custom + OpenSSL config file via OPENSSL_CONF or via an + application-specific configuration option for applications + which permit setting SSL options via SSL_CONF_cmd(3). + 20210811: Commit 3ad1e1c1ce20 changed the internal KAPI between the NFS modules. Therefore, all need to be rebuilt from sources. From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:50:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E274B66CA98; Tue, 17 Aug 2021 21:50:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4Sz66rMz4VFd; Tue, 17 Aug 2021 21:50:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 5E20522C3F; Tue, 17 Aug 2021 21:50:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 671a35b176e4 - main - UPDATING: Add a note about OpenSSL defaulting KTLS to off. From: John Baldwin To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108172146.17HLk3aK017875@gitrepo.freebsd.org> Message-ID: Date: Tue, 17 Aug 2021 14:50:10 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <202108172146.17HLk3aK017875@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:50:11 -0000 On 8/17/21 2:46 PM, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=671a35b176e4b3c445696a8b423db5f8de26c285 > > commit 671a35b176e4b3c445696a8b423db5f8de26c285 > Author: John Baldwin > AuthorDate: 2021-08-17 21:40:33 +0000 > Commit: John Baldwin > CommitDate: 2021-08-17 21:43:46 +0000 > > UPDATING: Add a note about OpenSSL defaulting KTLS to off. > > Sponsored by: Netflix > MFC after: 5 days > Differential Revision: https://reviews.freebsd.org/D31444 The NFS TLS daemons have been patched to enable KTLS explicitly. For other applications, a config file that can be used with OPENSSL_CONF to enable KTLS is below: openssl_conf = openssl_init [openssl_init] ssl_conf = ssl_sect [ssl_sect] system_default = system_default_sect [system_default_sect] Options = KTLS -- John Baldwin From owner-dev-commits-src-all@freebsd.org Tue Aug 17 21:54:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 960AD66CABD; Tue, 17 Aug 2021 21:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq4ZF3jKWz4Vbr; Tue, 17 Aug 2021 21:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67607256A5; Tue, 17 Aug 2021 21:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17HLsjaJ031781; Tue, 17 Aug 2021 21:54:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17HLsjg7031780; Tue, 17 Aug 2021 21:54:45 GMT (envelope-from git) Date: Tue, 17 Aug 2021 21:54:45 GMT Message-Id: <202108172154.17HLsjg7031780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Scott Long Subject: git: 045001075ed1 - main - - Fix the growfs rc script to cope with diskid labels. - Fix a warning in growfs. gpart commit is supposed to be called on disk device. - Silence a gpart commit warning in growfs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: scottl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 045001075ed18295288176211456dde3df7faf46 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 21:54:45 -0000 The branch main has been updated by scottl: URL: https://cgit.FreeBSD.org/src/commit/?id=045001075ed18295288176211456dde3df7faf46 commit 045001075ed18295288176211456dde3df7faf46 Author: Scott Long AuthorDate: 2021-08-17 21:50:18 +0000 Commit: Scott Long CommitDate: 2021-08-17 21:50:18 +0000 - Fix the growfs rc script to cope with diskid labels. - Fix a warning in growfs. gpart commit is supposed to be called on disk device. - Silence a gpart commit warning in growfs. Submitted by: loos Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31587 Sponsored by: Rubicon Communications, LLC ("Netgate") --- libexec/rc/rc.d/growfs | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/growfs b/libexec/rc/rc.d/growfs index c2955c740d43..5402bd442279 100755 --- a/libexec/rc/rc.d/growfs +++ b/libexec/rc/rc.d/growfs @@ -48,6 +48,19 @@ start_cmd="growfs_start" stop_cmd=":" rcvar="growfs_enable" +growfs_get_diskdev () +{ + local _search=${1} + sysctl -b kern.geom.conftxt | + while read x1 _type _dev line + do + if [ "${_type}" = "DISK" -a -n "$(echo ${_search} | grep ${_dev})" ]; then + echo -n ${_dev} + break + fi + done +} + growfs_start () { echo "Growing root partition to fill device" @@ -69,13 +82,24 @@ growfs_start () # raw device rawdev="$rootdev" else - rawdev=$(glabel status | awk '$1 == "'"$rootdev"'" { print $3 }') + rawdev=$(glabel status | awk -v rootdev=$rootdev 'index(rootdev, $1) { print $3; }') if [ x"$rawdev" = x"" ]; then echo "Can't figure out device for: $rootdev" return fi fi + if [ x"diskid" = x"${rootdev%/*}" ]; then + search=$rootdev + else + search=$rawdev + fi + + diskdev=$(growfs_get_diskdev ${search}) + if [ -z "${diskdev}" ]; then + diskdev=${rootdev} + fi + sysctl -b kern.geom.conftxt | awk ' { lvl=$1 @@ -104,8 +128,8 @@ growfs_start () } exit 0 } -}' dev="$rawdev" - gpart commit "$rootdev" +}' dev="$search" + gpart commit "$diskdev" 2> /dev/null case "$FSTYPE" in ufs) growfs -y /dev/"$rootdev" From owner-dev-commits-src-all@freebsd.org Tue Aug 17 22:17:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B6C566CF8F; Tue, 17 Aug 2021 22:17:57 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq5510JwGz4WQF; Tue, 17 Aug 2021 22:17:57 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ed1-f42.google.com with SMTP id cq23so16350533edb.12; Tue, 17 Aug 2021 15:17:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oYL/tPfagGbxJCg794ae2ErsaZ0D3kYt8cclbDceYoM=; b=fnOcESp3N5zsyct/WDzBc3cs1aECMwDMUWknrlxBImqJEd8uJyEHvvNp2dgDYpn4U+ mbWV9YUhSVhfigXnmUrOt2jV7s1VS5YlxPeIZErPxi6S28x3KcQejqzXaJ2Oe9cvTMev STuvdzObAhguUQL9zUdDyDqvazn1Pv6upN90iq3LoAreAkKCi6E9g73AXypLtt2O56/d 4dldt8qTB5Hj0QgWBdoMrYHAz0VBE8buQeOW3JIiTXZ6VFXXDMu/VkrJ6vx0xYtszuc6 abxfWF29dKikVgbtmXupJtFWf1yKmFrv7m3boxOZ3az+svHZPt1U82VHOO+Z3hmPfVwq OfQw== X-Gm-Message-State: AOAM532Gba/eMr3Vh+N/bSGGKrpmZXjEuiE6tazikwMONFPbLNm8e3qx EpaGWtKEJ402URlvnGoW+GP4HcJ2F0E= X-Google-Smtp-Source: ABdhPJyG6TErtDY4TY9wPpGqkN1t/gK8ZCHTSFQ7gqwcdJ0As0tjlLMExSystW53ekLs5HJa5HDdjw== X-Received: by 2002:a05:6402:13c5:: with SMTP id a5mr6178191edx.132.1629238669990; Tue, 17 Aug 2021 15:17:49 -0700 (PDT) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com. [209.85.221.51]) by smtp.gmail.com with ESMTPSA id b5sm1254031ejq.56.2021.08.17.15.17.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Aug 2021 15:17:49 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id q6so312577wrv.6; Tue, 17 Aug 2021 15:17:49 -0700 (PDT) X-Received: by 2002:a5d:618c:: with SMTP id j12mr6702476wru.374.1629238669511; Tue, 17 Aug 2021 15:17:49 -0700 (PDT) MIME-Version: 1.0 References: <202108171645.17HGjNL3012769@gitrepo.freebsd.org> <4C25E4D8-D33E-4397-956E-D21B80239EBA@freebsd.org> In-Reply-To: <4C25E4D8-D33E-4397-956E-D21B80239EBA@freebsd.org> From: Alexander Richardson Date: Tue, 17 Aug 2021 23:17:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: d9f25575a29f - main - Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now To: Jessica Clarke Cc: src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4Gq5510JwGz4WQF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 22:17:57 -0000 On Tue, 17 Aug 2021, 18:00 Jessica Clarke, wrote: > On 17 Aug 2021, at 17:45, Alex Richardson wrote: > > > > The branch main has been updated by arichardson: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=d9f25575a29ff7c83f226349a10a37b9aaf75ad5 > > > > commit d9f25575a29ff7c83f226349a10a37b9aaf75ad5 > > Author: Alex Richardson > > AuthorDate: 2021-08-17 16:44:40 +0000 > > Commit: Alex Richardson > > CommitDate: 2021-08-17 16:44:52 +0000 > > > > Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for > now > > > > I enabled these options again in > 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3, > > but unfortunately only my specific build configuration worked whereas > the > > build with default options is still broken. > > Insta-MFC to fix stable/13 cross-builds? > > Jess Oh yes good point. For some reason I thought I hadn't MFCd the broken commit. Will do that first thing tomorrow morning. Alex From owner-dev-commits-src-all@freebsd.org Wed Aug 18 01:30:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70BB066F3F2; Wed, 18 Aug 2021 01:30:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq9MS2WwXz4jFx; Wed, 18 Aug 2021 01:30:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EE6D42A; Wed, 18 Aug 2021 01:30:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I1UifO018411; Wed, 18 Aug 2021 01:30:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I1Uids018410; Wed, 18 Aug 2021 01:30:44 GMT (envelope-from git) Date: Wed, 18 Aug 2021 01:30:44 GMT Message-Id: <202108180130.17I1Uids018410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d1d9ee6f781d - stable/13 - ar: remove invalid extra param in bsdar_warnc calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d1d9ee6f781d4ff4ca487c48f92e186e2f07b378 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 01:30:44 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d1d9ee6f781d4ff4ca487c48f92e186e2f07b378 commit d1d9ee6f781d4ff4ca487c48f92e186e2f07b378 Author: Ed Maste AuthorDate: 2021-08-11 17:22:23 +0000 Commit: Ed Maste CommitDate: 2021-08-18 01:27:41 +0000 ar: remove invalid extra param in bsdar_warnc calls A number of warnings passed an exit status code to bsdar_warnc, but it does not take exit status (as a warning, it does not exit). MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 09319f7d3f8aefe8a6b37b1c2a6d842126a2c181) --- usr.bin/ar/write.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c index 24bac2f25b92..f515b2b4eb1e 100644 --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -787,7 +787,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) return; } if (elf_getshstrndx(e, &shstrndx) == 0) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, "elf_getshstrndx failed: %s", + bsdar_warnc(bsdar, 0, "elf_getshstrndx failed: %s", elf_errmsg(-1)); elf_end(e); return; @@ -824,8 +824,8 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) scn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { if (gelf_getshdr(scn, &shdr) != &shdr) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, - "elf_getshdr failed: %s", elf_errmsg(-1)); + bsdar_warnc(bsdar, 0, "elf_getshdr failed: %s", + elf_errmsg(-1)); continue; } if (shdr.sh_type != SHT_SYMTAB) @@ -838,7 +838,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) len = data->d_size / shdr.sh_entsize; for (i = 0; i < len; i++) { if (gelf_getsym(data, i, &sym) != &sym) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, + bsdar_warnc(bsdar, 0, "gelf_getsym failed: %s", elf_errmsg(-1)); continue; @@ -855,7 +855,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) if ((name = elf_strptr(e, tabndx, sym.st_name)) == NULL) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, + bsdar_warnc(bsdar, 0, "elf_strptr failed: %s", elf_errmsg(-1)); continue; @@ -867,7 +867,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) } elferr = elf_errno(); if (elferr != 0) - bsdar_warnc(bsdar, EX_SOFTWARE, 0, "elf_nextscn failed: %s", + bsdar_warnc(bsdar, 0, "elf_nextscn failed: %s", elf_errmsg(elferr)); elf_end(e); From owner-dev-commits-src-all@freebsd.org Wed Aug 18 01:31:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B07166EE42; Wed, 18 Aug 2021 01:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq9NP2f8Mz4jWg; Wed, 18 Aug 2021 01:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43D7E27BFB; Wed, 18 Aug 2021 01:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I1VXK0022405; Wed, 18 Aug 2021 01:31:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I1VX3I022404; Wed, 18 Aug 2021 01:31:33 GMT (envelope-from git) Date: Wed, 18 Aug 2021 01:31:33 GMT Message-Id: <202108180131.17I1VX3I022404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: e3580ab6e64a - stable/12 - ar: remove invalid extra param in bsdar_warnc calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e3580ab6e64a9ae6b8535419ad1724b37e30ce38 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 01:31:33 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e3580ab6e64a9ae6b8535419ad1724b37e30ce38 commit e3580ab6e64a9ae6b8535419ad1724b37e30ce38 Author: Ed Maste AuthorDate: 2021-08-11 17:22:23 +0000 Commit: Ed Maste CommitDate: 2021-08-18 01:30:58 +0000 ar: remove invalid extra param in bsdar_warnc calls A number of warnings passed an exit status code to bsdar_warnc, but it does not take exit status (as a warning, it does not exit). MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 09319f7d3f8aefe8a6b37b1c2a6d842126a2c181) --- usr.bin/ar/write.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c index 24bac2f25b92..f515b2b4eb1e 100644 --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -787,7 +787,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) return; } if (elf_getshstrndx(e, &shstrndx) == 0) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, "elf_getshstrndx failed: %s", + bsdar_warnc(bsdar, 0, "elf_getshstrndx failed: %s", elf_errmsg(-1)); elf_end(e); return; @@ -824,8 +824,8 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) scn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { if (gelf_getshdr(scn, &shdr) != &shdr) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, - "elf_getshdr failed: %s", elf_errmsg(-1)); + bsdar_warnc(bsdar, 0, "elf_getshdr failed: %s", + elf_errmsg(-1)); continue; } if (shdr.sh_type != SHT_SYMTAB) @@ -838,7 +838,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) len = data->d_size / shdr.sh_entsize; for (i = 0; i < len; i++) { if (gelf_getsym(data, i, &sym) != &sym) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, + bsdar_warnc(bsdar, 0, "gelf_getsym failed: %s", elf_errmsg(-1)); continue; @@ -855,7 +855,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) if ((name = elf_strptr(e, tabndx, sym.st_name)) == NULL) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, + bsdar_warnc(bsdar, 0, "elf_strptr failed: %s", elf_errmsg(-1)); continue; @@ -867,7 +867,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) } elferr = elf_errno(); if (elferr != 0) - bsdar_warnc(bsdar, EX_SOFTWARE, 0, "elf_nextscn failed: %s", + bsdar_warnc(bsdar, 0, "elf_nextscn failed: %s", elf_errmsg(elferr)); elf_end(e); From owner-dev-commits-src-all@freebsd.org Wed Aug 18 01:32:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AAFF66EBD5; Wed, 18 Aug 2021 01:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gq9Q02fsdz4jXM; Wed, 18 Aug 2021 01:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44543350; Wed, 18 Aug 2021 01:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I1WuHh023484; Wed, 18 Aug 2021 01:32:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I1Wu6e023483; Wed, 18 Aug 2021 01:32:56 GMT (envelope-from git) Date: Wed, 18 Aug 2021 01:32:56 GMT Message-Id: <202108180132.17I1Wu6e023483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: adc3aa84fb32 - stable/11 - ar: remove invalid extra param in bsdar_warnc calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: adc3aa84fb32333fc20d989096f967e6524ab0e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 01:32:56 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=adc3aa84fb32333fc20d989096f967e6524ab0e0 commit adc3aa84fb32333fc20d989096f967e6524ab0e0 Author: Ed Maste AuthorDate: 2021-08-11 17:22:23 +0000 Commit: Ed Maste CommitDate: 2021-08-18 01:32:36 +0000 ar: remove invalid extra param in bsdar_warnc calls A number of warnings passed an exit status code to bsdar_warnc, but it does not take exit status (as a warning, it does not exit). MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 09319f7d3f8aefe8a6b37b1c2a6d842126a2c181) --- usr.bin/ar/write.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c index 96821cf2e4b7..0a0c7ec75bda 100644 --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -787,7 +787,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) return; } if (elf_getshstrndx(e, &shstrndx) == 0) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, "elf_getshstrndx failed: %s", + bsdar_warnc(bsdar, 0, "elf_getshstrndx failed: %s", elf_errmsg(-1)); elf_end(e); return; @@ -824,8 +824,8 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) scn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { if (gelf_getshdr(scn, &shdr) != &shdr) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, - "elf_getshdr failed: %s", elf_errmsg(-1)); + bsdar_warnc(bsdar, 0, "elf_getshdr failed: %s", + elf_errmsg(-1)); continue; } if (shdr.sh_type != SHT_SYMTAB) @@ -838,7 +838,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) len = data->d_size / shdr.sh_entsize; for (i = 0; i < len; i++) { if (gelf_getsym(data, i, &sym) != &sym) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, + bsdar_warnc(bsdar, 0, "gelf_getsym failed: %s", elf_errmsg(-1)); continue; @@ -855,7 +855,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) if ((name = elf_strptr(e, tabndx, sym.st_name)) == NULL) { - bsdar_warnc(bsdar, EX_SOFTWARE, 0, + bsdar_warnc(bsdar, 0, "elf_strptr failed: %s", elf_errmsg(-1)); continue; @@ -867,7 +867,7 @@ create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size) } elferr = elf_errno(); if (elferr != 0) - bsdar_warnc(bsdar, EX_SOFTWARE, 0, "elf_nextscn failed: %s", + bsdar_warnc(bsdar, 0, "elf_nextscn failed: %s", elf_errmsg(elferr)); elf_end(e); From owner-dev-commits-src-all@freebsd.org Wed Aug 18 06:25:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1D31672464; Wed, 18 Aug 2021 06:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqHvM5mFBz3DJ1; Wed, 18 Aug 2021 06:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9D9646C5; Wed, 18 Aug 2021 06:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I6PJci010785; Wed, 18 Aug 2021 06:25:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I6PJmQ010784; Wed, 18 Aug 2021 06:25:19 GMT (envelope-from git) Date: Wed, 18 Aug 2021 06:25:19 GMT Message-Id: <202108180625.17I6PJmQ010784@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: e3500c602b13 - main - ipmi: fix negative logic in watchdog control flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3500c602b13f8252eb8bb779849c41d47306cee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 06:25:19 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=e3500c602b13f8252eb8bb779849c41d47306cee commit e3500c602b13f8252eb8bb779849c41d47306cee Author: Wojciech Macek AuthorDate: 2021-08-18 06:21:14 +0000 Commit: Wojciech Macek CommitDate: 2021-08-18 06:21:14 +0000 ipmi: fix negative logic in watchdog control flag Use wd_enable instead of wd_disable --- sys/dev/ipmi/ipmi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c index 77fd4b68ae96..77baf652b4bc 100644 --- a/sys/dev/ipmi/ipmi.c +++ b/sys/dev/ipmi/ipmi.c @@ -96,14 +96,14 @@ static int wd_shutdown_countdown = 0; /* sec */ static int wd_startup_countdown = 0; /* sec */ static int wd_pretimeout_countdown = 120; /* sec */ static int cycle_wait = 10; /* sec */ -static int wd_init_disable = 0; +static int wd_init_enable = 1; static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "IPMI driver parameters"); SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RWTUN, &on, 0, ""); -SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_init_disable, CTLFLAG_RWTUN, - &wd_init_disable, 0, ""); +SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_init_enable, CTLFLAG_RWTUN, + &wd_init_enable, 1, "Enable watchdog initialization"); SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_timer_actions, CTLFLAG_RW, &wd_timer_actions, 0, "IPMI watchdog timer actions (including pre-timeout interrupt)"); @@ -912,7 +912,7 @@ ipmi_startup(void *arg) * Probe for watchdog, but only for backends which support * polled driver requests. */ - if (!wd_init_disable && sc->ipmi_driver_requests_polled) { + if (wd_init_enable && sc->ipmi_driver_requests_polled) { IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_GET_WDOG, 0, 0); From owner-dev-commits-src-all@freebsd.org Wed Aug 18 07:19:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3E45672F27; Wed, 18 Aug 2021 07:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqK6M5QKsz3Gxd; Wed, 18 Aug 2021 07:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 977AD4BE3; Wed, 18 Aug 2021 07:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I7Jtff077850; Wed, 18 Aug 2021 07:19:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I7JtxQ077849; Wed, 18 Aug 2021 07:19:55 GMT (envelope-from git) Date: Wed, 18 Aug 2021 07:19:55 GMT Message-Id: <202108180719.17I7JtxQ077849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 66fa12d8fb61 - main - iflib: emulate counters in netmap mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66fa12d8fb61485780f32f0226e79d3389567496 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 07:19:55 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=66fa12d8fb61485780f32f0226e79d3389567496 commit 66fa12d8fb61485780f32f0226e79d3389567496 Author: Stephan de Wit AuthorDate: 2021-08-18 07:17:43 +0000 Commit: Kevin Bowling CommitDate: 2021-08-18 07:17:43 +0000 iflib: emulate counters in netmap mode When iflib devices are in netmap mode the driver counters are no longer updated making it look from userspace tools that traffic has stopped. Reported by: Franco Fichtner Reviewed by: vmaffione, iflib (erj, gallatin) Obtained from: OPNsense MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31550 --- sys/net/iflib.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index abd6bd32cd4e..8c8cc6936f7e 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -993,6 +993,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) u_int const lim = kring->nkr_num_slots - 1; u_int const head = kring->rhead; struct if_pkt_info pi; + int tx_pkts = 0, tx_bytes = 0; /* * interrupts on every tx packet are expensive so request @@ -1077,6 +1078,10 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) ctx->isc_txd_encap(ctx->ifc_softc, &pi); DBG_COUNTER_INC(tx_encap); + /* Update transmit counters */ + tx_bytes += pi.ipi_len; + tx_pkts++; + /* Reinit per-packet info for the next one. */ flags = seg_idx = pkt_len = 0; nic_i_start = -1; @@ -1135,6 +1140,10 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) iflib_netmap_timer, txq, txq->ift_netmap_timer.c_cpu, 0); } + + if_inc_counter(ifp, IFCOUNTER_OBYTES, tx_bytes); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, tx_pkts); + return (0); } @@ -1162,7 +1171,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) u_int n; u_int const lim = kring->nkr_num_slots - 1; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; - int i = 0; + int i = 0, rx_bytes = 0, rx_pkts = 0; if_ctx_t ctx = ifp->if_softc; if_shared_ctx_t sctx = ctx->ifc_sctx; @@ -1233,6 +1242,10 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) if (i == (ri.iri_nfrags - 1)) { ring->slot[nm_i].len -= crclen; ring->slot[nm_i].flags = 0; + + /* Update receive counters */ + rx_bytes += ri.iri_len; + rx_pkts++; } else ring->slot[nm_i].flags = NS_MOREFRAG; } @@ -1270,6 +1283,9 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) */ netmap_fl_refill(rxq, kring, false); + if_inc_counter(ifp, IFCOUNTER_IBYTES, rx_bytes); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, rx_pkts); + return (0); } From owner-dev-commits-src-all@freebsd.org Wed Aug 18 08:52:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E27676740B5; Wed, 18 Aug 2021 08:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqM8f5vMcz3R4V; Wed, 18 Aug 2021 08:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2CF35BFD; Wed, 18 Aug 2021 08:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I8q2C8009886; Wed, 18 Aug 2021 08:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I8q2Wl009885; Wed, 18 Aug 2021 08:52:02 GMT (envelope-from git) Date: Wed, 18 Aug 2021 08:52:02 GMT Message-Id: <202108180852.17I8q2Wl009885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a051ca72e281 - main - Introduce m_get3() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a051ca72e2815b9bbba1e422f5abf22bc2a01551 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 08:52:03 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a051ca72e2815b9bbba1e422f5abf22bc2a01551 commit a051ca72e2815b9bbba1e422f5abf22bc2a01551 Author: Kristof Provost AuthorDate: 2021-08-07 18:02:21 +0000 Commit: Kristof Provost CommitDate: 2021-08-18 06:48:27 +0000 Introduce m_get3() Introduce m_get3() which is similar to m_get2(), but can allocate up to MJUM16BYTES bytes (m_get2() can only allocate up to MJUMPAGESIZE). This simplifies the bpf improvement in f13da24715. Suggested by: glebius Differential Revision: https://reviews.freebsd.org/D31455 --- share/man/man9/mbuf.9 | 11 ++++++++++- sys/kern/kern_mbuf.c | 38 ++++++++++++++++++++++++++++++++++++++ sys/net/bpf.c | 9 +-------- sys/sys/mbuf.h | 1 + 4 files changed, 50 insertions(+), 9 deletions(-) diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9 index f6361cdc7c06..ea3f66e3e218 100644 --- a/share/man/man9/mbuf.9 +++ b/share/man/man9/mbuf.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2021 +.Dd August 8, 2021 .Dt MBUF 9 .Os .\" @@ -73,6 +73,8 @@ .Ft struct mbuf * .Fn m_get2 "int size" "int how" "short type" "int flags" .Ft struct mbuf * +.Fn m_get3 "int size" "int how" "short type" "int flags" +.Ft struct mbuf * .Fn m_getm "struct mbuf *orig" "int len" "int how" "short type" .Ft struct mbuf * .Fn m_getjcl "int how" "short type" "int flags" "int size" @@ -577,6 +579,13 @@ with enough space to hold specified amount of data. If the size is is larger than .Dv MJUMPAGESIZE , NULL will be returned. +.It Fn m_get3 size how type flags +Allocate an +.Vt mbuf +with enough space to hold specified amount of data. +If the size is is larger than +.Dv MJUM16BYTES, NULL +will be returned. .It Fn m_getm orig len how type Allocate .Fa len diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index ae4aa7d7e96a..123985a7dec2 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -1371,6 +1371,44 @@ m_get2(int size, int how, short type, int flags) return (m); } +/* + * m_get3() allocates minimum mbuf that would fit "size" argument. + * Unlike m_get2() it can allocate clusters up to MJUM16BYTES. + */ +struct mbuf * +m_get3(int size, int how, short type, int flags) +{ + struct mb_args args; + struct mbuf *m, *n; + uma_zone_t zone; + + if (size <= MJUMPAGESIZE) + return (m_get2(size, how, type, flags)); + + if (size > MJUM16BYTES) + return (NULL); + + args.flags = flags; + args.type = type; + + m = uma_zalloc_arg(zone_mbuf, &args, how); + if (m == NULL) + return (NULL); + + if (size <= MJUM9BYTES) + zone = zone_jumbo9; + else + zone = zone_jumbo16; + + n = uma_zalloc_arg(zone_jumbop, m, how); + if (n == NULL) { + m_free_raw(m); + return (NULL); + } + + return (m); +} + /* * m_getjcl() returns an mbuf with a cluster of the specified size attached. * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. diff --git a/sys/net/bpf.c b/sys/net/bpf.c index ff14152c086c..77c85cc91aae 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -644,14 +644,7 @@ bpf_movein(struct uio *uio, int linktype, struct ifnet *ifp, struct mbuf **mp, return (EMSGSIZE); /* Allocate a mbuf for our write, since m_get2 fails if len >= to MJUMPAGESIZE, use m_getjcl for bigger buffers */ - if (len < MJUMPAGESIZE) - m = m_get2(len, M_WAITOK, MT_DATA, M_PKTHDR); - else if (len <= MJUM9BYTES) - m = m_getjcl(M_WAITOK, MT_DATA, M_PKTHDR, MJUM9BYTES); - else if (len <= MJUM16BYTES) - m = m_getjcl(M_WAITOK, MT_DATA, M_PKTHDR, MJUM16BYTES); - else - m = NULL; + m = m_get3(len, M_WAITOK, MT_DATA, M_PKTHDR); if (m == NULL) return (EIO); m->m_pkthdr.len = m->m_len = len; diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 2936966f6acc..58ada4d0b7b2 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -829,6 +829,7 @@ struct mbuf *m_fragment(struct mbuf *, int, int); void m_freem(struct mbuf *); void m_free_raw(struct mbuf *); struct mbuf *m_get2(int, int, short, int); +struct mbuf *m_get3(int, int, short, int); struct mbuf *m_getjcl(int, short, int, int); struct mbuf *m_getm2(struct mbuf *, int, int, short, int); struct mbuf *m_getptr(struct mbuf *, int, int *); From owner-dev-commits-src-all@freebsd.org Wed Aug 18 08:52:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05C556740BA; Wed, 18 Aug 2021 08:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqM8g6cL9z3R01; Wed, 18 Aug 2021 08:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA62665B2; Wed, 18 Aug 2021 08:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I8q3Cu009912; Wed, 18 Aug 2021 08:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I8q3as009911; Wed, 18 Aug 2021 08:52:03 GMT (envelope-from git) Date: Wed, 18 Aug 2021 08:52:03 GMT Message-Id: <202108180852.17I8q3as009911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 07edc89c393c - main - witness: remove ifnet_rw MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07edc89c393c1c4f09e0afe8e528f5d091f0ae04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 08:52:04 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=07edc89c393c1c4f09e0afe8e528f5d091f0ae04 commit 07edc89c393c1c4f09e0afe8e528f5d091f0ae04 Author: Kristof Provost AuthorDate: 2021-08-17 10:56:11 +0000 Commit: Kristof Provost CommitDate: 2021-08-18 06:51:26 +0000 witness: remove ifnet_rw This lock no longer exists. It was removed in a60100fdfc10 (if: Remove ifnet_rwlock, 2020-11-25) Reviewed by: mjg Pointed out by: Dheeraj Kandula Different Revision: https://reviews.freebsd.org/D31585 --- sys/kern/subr_witness.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index c849a191bf16..e3fcbbb31311 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -541,7 +541,6 @@ static struct witness_order_list_entry order_lists[] = { { "udpinp", &lock_class_rw }, { "in_multi_list_mtx", &lock_class_mtx_sleep }, { "igmp_mtx", &lock_class_mtx_sleep }, - { "ifnet_rw", &lock_class_rw }, { "if_addr_lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* @@ -552,7 +551,6 @@ static struct witness_order_list_entry order_lists[] = { { "udpinp", &lock_class_rw }, { "in6_multi_list_mtx", &lock_class_mtx_sleep }, { "mld_mtx", &lock_class_mtx_sleep }, - { "ifnet_rw", &lock_class_rw }, { "if_addr_lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* From owner-dev-commits-src-all@freebsd.org Wed Aug 18 08:54:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13D856742AB; Wed, 18 Aug 2021 08:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqMCN05wRz3R3V; Wed, 18 Aug 2021 08:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB2BC637F; Wed, 18 Aug 2021 08:54:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I8sNcw010272; Wed, 18 Aug 2021 08:54:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I8sNkM010271; Wed, 18 Aug 2021 08:54:23 GMT (envelope-from git) Date: Wed, 18 Aug 2021 08:54:23 GMT Message-Id: <202108180854.17I8sNkM010271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: ba91a76793d9 - stable/13 - Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ba91a76793d9a385e53d8bed00c0da806a5a60e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 08:54:24 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=ba91a76793d9a385e53d8bed00c0da806a5a60e7 commit ba91a76793d9a385e53d8bed00c0da806a5a60e7 Author: Alex Richardson AuthorDate: 2021-08-16 08:56:17 +0000 Commit: Alex Richardson CommitDate: 2021-08-18 08:34:11 +0000 Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap This causes build failures on macOS where the build can end up invoking an incompatible m4 binary. Fxies: 2de949cf85d0 ("Remove mkcsmapper_static and mkesdb_static from build-tools") (cherry picked from commit cc1345056b113d57f0c65b0ecf3e3d5da3f34276) --- Makefile.inc1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index cc854fbebbb1..941589324a80 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2373,6 +2373,8 @@ ${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend} .if ${MK_ICONV} != "no" _mkesdb= usr.bin/mkesdb _mkcsmapper= usr.bin/mkcsmapper +${_bt}-usr.bin/mkesdb: ${_bt}-usr.bin/yacc ${_bt_lex_depend} +${_bt}-usr.bin/mkcsmapper: ${_bt}-usr.bin/yacc ${_bt_lex_depend} .endif .if ${MK_KERBEROS} != "no" From owner-dev-commits-src-all@freebsd.org Wed Aug 18 08:54:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8983E67430A; Wed, 18 Aug 2021 08:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqMCP11fJz3RBX; Wed, 18 Aug 2021 08:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 012076611; Wed, 18 Aug 2021 08:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I8sOhB010296; Wed, 18 Aug 2021 08:54:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I8sOe9010295; Wed, 18 Aug 2021 08:54:24 GMT (envelope-from git) Date: Wed, 18 Aug 2021 08:54:24 GMT Message-Id: <202108180854.17I8sOe9010295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 64f6c8d616b9 - stable/13 - Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 64f6c8d616b95a6ca153dd7d9e07bad3cf86e51f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 08:54:25 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=64f6c8d616b95a6ca153dd7d9e07bad3cf86e51f commit 64f6c8d616b95a6ca153dd7d9e07bad3cf86e51f Author: Alex Richardson AuthorDate: 2021-08-17 16:44:40 +0000 Commit: Alex Richardson CommitDate: 2021-08-18 08:34:19 +0000 Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now I enabled these options again in 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3, but unfortunately only my specific build configuration worked whereas the build with default options is still broken. (cherry picked from commit d9f25575a29ff7c83f226349a10a37b9aaf75ad5) --- share/mk/src.opts.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 7d08b6a1da89..6fb8c6c855a1 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -359,6 +359,13 @@ __DEFAULT_YES_OPTIONS+=OPENMP __DEFAULT_NO_OPTIONS+=OPENMP .endif +.if ${.MAKE.OS} != "FreeBSD" +# Bootstrapping the toolchain and building LLDB currently results in build +# failures non-FreeBSD, so disable these options until the fixes that are +# currently under review have landed. +BROKEN_OPTIONS+=LLDB CLANG_BOOTSTRAP LLD_BOOTSTRAP +.endif + .include # From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:43:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30B9F674CB7; Wed, 18 Aug 2021 09:43:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNHn0kHGz3lYm; Wed, 18 Aug 2021 09:43:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00918730B; Wed, 18 Aug 2021 09:43:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9hGJ6077706; Wed, 18 Aug 2021 09:43:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9hGPh077705; Wed, 18 Aug 2021 09:43:16 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:43:16 GMT Message-Id: <202108180943.17I9hGPh077705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 8a46f021c240 - main - Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a46f021c2408c82375a1f5127efb7ac6b78596e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:43:17 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=8a46f021c2408c82375a1f5127efb7ac6b78596e commit 8a46f021c2408c82375a1f5127efb7ac6b78596e Author: Hans Petter Selasky AuthorDate: 2021-08-18 09:41:49 +0000 Commit: Hans Petter Selasky CommitDate: 2021-08-18 09:42:37 +0000 Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/serial/uftdi.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c index 9dc00e82253f..eaf4a9e78086 100644 --- a/sys/dev/usb/serial/uftdi.c +++ b/sys/dev/usb/serial/uftdi.c @@ -1212,14 +1212,9 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error) DPRINTFN(3, "\n"); switch (USB_GET_STATE(xfer)) { - default: /* Error */ - if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - } - /* FALLTHROUGH */ case USB_ST_SETUP: case USB_ST_TRANSFERRED: +tr_setup: if (usbd_xfer_get_and_clr_zlp(xfer)) break; @@ -1257,6 +1252,13 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error) usbd_transfer_submit(xfer); } break; + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; } } From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:47:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 390EF674760; Wed, 18 Aug 2021 09:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNNB1BC5z3mCR; Wed, 18 Aug 2021 09:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10EE16F58; Wed, 18 Aug 2021 09:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9l5i5078091; Wed, 18 Aug 2021 09:47:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9l5mW078090; Wed, 18 Aug 2021 09:47:05 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:47:05 GMT Message-Id: <202108180947.17I9l5mW078090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: ad9671955a40 - stable/13 - ip_reass: drop the volatile keyword from nfrags and mark with __exclusive_cache_line MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad9671955a40ed69432e66d4ff6579c42a6e048d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:47:06 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ad9671955a40ed69432e66d4ff6579c42a6e048d commit ad9671955a40ed69432e66d4ff6579c42a6e048d Author: Mateusz Guzik AuthorDate: 2021-08-13 09:29:57 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 09:44:43 +0000 ip_reass: drop the volatile keyword from nfrags and mark with __exclusive_cache_line The keyword adds nothing as all operations on the var are performed through atomic_* Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31526 (cherry picked from commit d2b95af1c27ed51d72bef5d9f3d89860edc4fd40) --- sys/netinet/ip_reass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index f5cc6ad68125..8a071345677a 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -137,12 +137,12 @@ ipq_drop(struct ipqbucket *bucket, struct ipq *fp) #define IP_MAXFRAGPACKETS (imin(IP_MAXFRAGS, IPREASS_NHASH * 50)) static int maxfrags; -static volatile u_int nfrags; +static u_int __exclusive_cache_line nfrags; SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfrags, CTLFLAG_RW, &maxfrags, 0, "Maximum number of IPv4 fragments allowed across all reassembly queues"); SYSCTL_UINT(_net_inet_ip, OID_AUTO, curfrags, CTLFLAG_RD, - __DEVOLATILE(u_int *, &nfrags), 0, + &nfrags, 0, "Current number of IPv4 fragments across all reassembly queues"); VNET_DEFINE_STATIC(uma_zone_t, ipq_zone); From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:47:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6995674766; Wed, 18 Aug 2021 09:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNNC2FLTz3mJB; Wed, 18 Aug 2021 09:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3121F71A7; Wed, 18 Aug 2021 09:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9l7D4078121; Wed, 18 Aug 2021 09:47:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9l7C4078120; Wed, 18 Aug 2021 09:47:07 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:47:07 GMT Message-Id: <202108180947.17I9l7C4078120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 990e592daeb3 - stable/13 - ip_reass: do less work in ipreass_slowtimo if possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 990e592daeb3aa7aad1881d999a6b95c15320df7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:47:07 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=990e592daeb3aa7aad1881d999a6b95c15320df7 commit 990e592daeb3aa7aad1881d999a6b95c15320df7 Author: Mateusz Guzik AuthorDate: 2021-08-13 09:32:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 09:44:44 +0000 ip_reass: do less work in ipreass_slowtimo if possible ipreass_slowtimo avoidably uses CPU on otherwise idle boxes Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31526 (cherry picked from commit 3be3cbe06d6107486d67d8eb80480d34d084c39c) --- sys/netinet/ip_reass.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index 8a071345677a..db32e6a312f2 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -593,11 +593,16 @@ ipreass_slowtimo(void) { struct ipq *fp, *tmp; + if (atomic_load_int(&nfrags) == 0) + return; + for (int i = 0; i < IPREASS_NHASH; i++) { + if (TAILQ_EMPTY(&V_ipq[i].head)) + continue; IPQ_LOCK(i); TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, tmp) if (--fp->ipq_ttl == 0) - ipq_timeout(&V_ipq[i], fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } } From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:47:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88C14674F01; Wed, 18 Aug 2021 09:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNNF2tTqz3m9s; Wed, 18 Aug 2021 09:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70492730D; Wed, 18 Aug 2021 09:47:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9l8IM078146; Wed, 18 Aug 2021 09:47:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9l8J3078145; Wed, 18 Aug 2021 09:47:08 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:47:08 GMT Message-Id: <202108180947.17I9l8J3078145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: d368dc0b420a - stable/13 - frag6: drop the volatile keyword from frag6_nfrags and mark with __exclusive_cache_line MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d368dc0b420af723e85a224636e23998b3e14c07 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:47:09 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d368dc0b420af723e85a224636e23998b3e14c07 commit d368dc0b420af723e85a224636e23998b3e14c07 Author: Mateusz Guzik AuthorDate: 2021-08-13 11:28:39 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 09:44:44 +0000 frag6: drop the volatile keyword from frag6_nfrags and mark with __exclusive_cache_line The keyword adds nothing as all operations on the var are performed through atomic_* Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31528 (cherry picked from commit c17ae18080b4412435aa2fb91cd6e81dd6cd180b) --- sys/netinet6/frag6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 1903b01e03d4..ec35e98d25ec 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -116,7 +116,7 @@ VNET_DEFINE_STATIC(bool, frag6_on); /* System wide (global) maximum and count of packets in reassembly queues. */ static int ip6_maxfrags; -static volatile u_int frag6_nfrags = 0; +static u_int __exclusive_cache_line frag6_nfrags; /* Maximum and current packets in per-VNET reassembly queue. */ VNET_DEFINE_STATIC(int, ip6_maxfragpackets); @@ -164,7 +164,7 @@ VNET_DEFINE_STATIC(uint32_t, ip6qb_hashseed); SYSCTL_DECL(_net_inet6_ip6); SYSCTL_UINT(_net_inet6_ip6, OID_AUTO, frag6_nfrags, - CTLFLAG_RD, __DEVOLATILE(u_int *, &frag6_nfrags), 0, + CTLFLAG_RD, &frag6_nfrags, 0, "Global number of IPv6 fragments across all reassembly queues."); static void From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:47:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 265FF674E1C; Wed, 18 Aug 2021 09:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNNF4QMcz3mRG; Wed, 18 Aug 2021 09:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79865730E; Wed, 18 Aug 2021 09:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9l9nx078170; Wed, 18 Aug 2021 09:47:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9l98B078169; Wed, 18 Aug 2021 09:47:09 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:47:09 GMT Message-Id: <202108180947.17I9l98B078169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 86a96281df03 - stable/13 - frag6: do less work in frag6_slowtimo if possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 86a96281df03901f7930669c4ad488fab9ca64e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:47:10 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=86a96281df03901f7930669c4ad488fab9ca64e1 commit 86a96281df03901f7930669c4ad488fab9ca64e1 Author: Mateusz Guzik AuthorDate: 2021-08-13 11:32:03 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 09:44:45 +0000 frag6: do less work in frag6_slowtimo if possible frag6_slowtimo avoidably uses CPU on otherwise idle boxes Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31528 (cherry picked from commit 8afe9481cfa382337b8a885f358fe888bddf5982) --- sys/netinet6/frag6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index ec35e98d25ec..222bd157fddd 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -891,10 +891,15 @@ frag6_slowtimo(void) struct ip6q *q6, *q6tmp; uint32_t bucket; + if (atomic_load_int(&frag6_nfrags) == 0) + return; + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); for (bucket = 0; bucket < IP6REASS_NHASH; bucket++) { + if (V_ip6qb[bucket].count == 0) + continue; IP6QB_LOCK(bucket); head = IP6QB_HEAD(bucket); TAILQ_FOREACH_SAFE(q6, head, ip6q_tq, q6tmp) From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:50:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CE1C674DCE; Wed, 18 Aug 2021 09:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNSQ2X0Mz3mqH; Wed, 18 Aug 2021 09:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F5EC71B7; Wed, 18 Aug 2021 09:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9oksj086726; Wed, 18 Aug 2021 09:50:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9oknJ086725; Wed, 18 Aug 2021 09:50:46 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:50:46 GMT Message-Id: <202108180950.17I9oknJ086725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 8d9f1e9f2be1 - stable/12 - ip_reass: drop the volatile keyword from nfrags and mark with __exclusive_cache_line MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8d9f1e9f2be113a62b280fa3610fbdd3b97af729 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:50:46 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8d9f1e9f2be113a62b280fa3610fbdd3b97af729 commit 8d9f1e9f2be113a62b280fa3610fbdd3b97af729 Author: Mateusz Guzik AuthorDate: 2021-08-13 09:29:57 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 09:48:14 +0000 ip_reass: drop the volatile keyword from nfrags and mark with __exclusive_cache_line The keyword adds nothing as all operations on the var are performed through atomic_* Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31526 (cherry picked from commit d2b95af1c27ed51d72bef5d9f3d89860edc4fd40) --- sys/netinet/ip_reass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index a0503cd614c2..5aa75474ad60 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -137,12 +137,12 @@ ipq_drop(struct ipqbucket *bucket, struct ipq *fp) #define IP_MAXFRAGPACKETS (imin(IP_MAXFRAGS, IPREASS_NHASH * 50)) static int maxfrags; -static volatile u_int nfrags; +static u_int __exclusive_cache_line nfrags; SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfrags, CTLFLAG_RW, &maxfrags, 0, "Maximum number of IPv4 fragments allowed across all reassembly queues"); SYSCTL_UINT(_net_inet_ip, OID_AUTO, curfrags, CTLFLAG_RD, - __DEVOLATILE(u_int *, &nfrags), 0, + &nfrags, 0, "Current number of IPv4 fragments across all reassembly queues"); VNET_DEFINE_STATIC(uma_zone_t, ipq_zone); From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:50:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8451D674EC2; Wed, 18 Aug 2021 09:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNSR3H7qz3mwD; Wed, 18 Aug 2021 09:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 595496F64; Wed, 18 Aug 2021 09:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9olbM086750; Wed, 18 Aug 2021 09:50:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9ol4n086749; Wed, 18 Aug 2021 09:50:47 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:50:47 GMT Message-Id: <202108180950.17I9ol4n086749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2666f081bac0 - stable/12 - ip_reass: do less work in ipreass_slowtimo if possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2666f081bac0c9225b7db2cb7a6776ed52bd568a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:50:47 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2666f081bac0c9225b7db2cb7a6776ed52bd568a commit 2666f081bac0c9225b7db2cb7a6776ed52bd568a Author: Mateusz Guzik AuthorDate: 2021-08-13 09:32:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 09:48:16 +0000 ip_reass: do less work in ipreass_slowtimo if possible ipreass_slowtimo avoidably uses CPU on otherwise idle boxes Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31526 (cherry picked from commit 3be3cbe06d6107486d67d8eb80480d34d084c39c) --- sys/netinet/ip_reass.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index 5aa75474ad60..0d5300d7382b 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -592,11 +592,16 @@ ipreass_slowtimo(void) { struct ipq *fp, *tmp; + if (atomic_load_int(&nfrags) == 0) + return; + for (int i = 0; i < IPREASS_NHASH; i++) { + if (TAILQ_EMPTY(&V_ipq[i].head)) + continue; IPQ_LOCK(i); TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, tmp) if (--fp->ipq_ttl == 0) - ipq_timeout(&V_ipq[i], fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } } From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:50:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A533675102; Wed, 18 Aug 2021 09:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNSS6GVBz3mst; Wed, 18 Aug 2021 09:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 826BE6F66; Wed, 18 Aug 2021 09:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9omLC086780; Wed, 18 Aug 2021 09:50:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9omlQ086779; Wed, 18 Aug 2021 09:50:48 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:50:48 GMT Message-Id: <202108180950.17I9omlQ086779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 3fdd170c5825 - stable/12 - frag6: drop the volatile keyword from frag6_nfrags and mark with __exclusive_cache_line MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3fdd170c5825fd90b050a54b6da5f985ad573159 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:50:49 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3fdd170c5825fd90b050a54b6da5f985ad573159 commit 3fdd170c5825fd90b050a54b6da5f985ad573159 Author: Mateusz Guzik AuthorDate: 2021-08-13 11:28:39 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 09:48:19 +0000 frag6: drop the volatile keyword from frag6_nfrags and mark with __exclusive_cache_line The keyword adds nothing as all operations on the var are performed through atomic_* Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31528 (cherry picked from commit c17ae18080b4412435aa2fb91cd6e81dd6cd180b) --- sys/netinet6/frag6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 15b2c2a14af0..d27d21e536fe 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -116,7 +116,7 @@ VNET_DEFINE_STATIC(bool, frag6_on); /* System wide (global) maximum and count of packets in reassembly queues. */ static int ip6_maxfrags; -static volatile u_int frag6_nfrags = 0; +static u_int __exclusive_cache_line frag6_nfrags; /* Maximum and current packets in per-VNET reassembly queue. */ VNET_DEFINE_STATIC(int, ip6_maxfragpackets); @@ -165,7 +165,7 @@ VNET_DEFINE_STATIC(uint32_t, ip6qb_hashseed); SYSCTL_DECL(_net_inet6_ip6); SYSCTL_UINT(_net_inet6_ip6, OID_AUTO, frag6_nfrags, - CTLFLAG_RD, __DEVOLATILE(u_int *, &frag6_nfrags), 0, + CTLFLAG_RD, &frag6_nfrags, 0, "Global number of IPv6 fragments across all reassembly queues."); static void From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:50:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10E1E675106; Wed, 18 Aug 2021 09:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNST63yYz3mwT; Wed, 18 Aug 2021 09:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A80367125; Wed, 18 Aug 2021 09:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17I9on4U086805; Wed, 18 Aug 2021 09:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17I9onfY086804; Wed, 18 Aug 2021 09:50:49 GMT (envelope-from git) Date: Wed, 18 Aug 2021 09:50:49 GMT Message-Id: <202108180950.17I9onfY086804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2da4005188ce - stable/12 - frag6: do less work in frag6_slowtimo if possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2da4005188ced25eee5ccb803586bf31f4574fca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:50:50 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2da4005188ced25eee5ccb803586bf31f4574fca commit 2da4005188ced25eee5ccb803586bf31f4574fca Author: Mateusz Guzik AuthorDate: 2021-08-13 11:32:03 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 09:48:22 +0000 frag6: do less work in frag6_slowtimo if possible frag6_slowtimo avoidably uses CPU on otherwise idle boxes Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31528 (cherry picked from commit 8afe9481cfa382337b8a885f358fe888bddf5982) --- sys/netinet6/frag6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index d27d21e536fe..5a31bbff9747 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -901,10 +901,15 @@ frag6_slowtimo(void) struct ip6q *q6, *q6tmp; uint32_t bucket; + if (atomic_load_int(&frag6_nfrags) == 0) + return; + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); for (bucket = 0; bucket < IP6REASS_NHASH; bucket++) { + if (V_ip6qb[bucket].count == 0) + continue; IP6QB_LOCK(bucket); head = IP6QB_HEAD(bucket); TAILQ_FOREACH_SAFE(q6, head, ip6q_tq, q6tmp) From owner-dev-commits-src-all@freebsd.org Wed Aug 18 09:56:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E9926752A1; Wed, 18 Aug 2021 09:56:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqNbB3gtkz3nMw; Wed, 18 Aug 2021 09:56:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4CD4128FEB; Wed, 18 Aug 2021 09:56:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id CCA6C496AA; Wed, 18 Aug 2021 11:56:36 +0200 (CEST) From: "Kristof Provost" To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a051ca72e281 - main - Introduce m_get3() Date: Wed, 18 Aug 2021 11:56:36 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: <3C4C4BD6-CBD6-4A35-BA4B-13070DCDC448@FreeBSD.org> In-Reply-To: <202108180852.17I8q2Wl009885@gitrepo.freebsd.org> References: <202108180852.17I8q2Wl009885@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 09:56:38 -0000 On 18 Aug 2021, at 10:52, Kristof Provost wrote: > The branch main has been updated by kp: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3Da051ca72e2815b9bbba1e422f5abf= 22bc2a01551 > > commit a051ca72e2815b9bbba1e422f5abf22bc2a01551 > Author: Kristof Provost > AuthorDate: 2021-08-07 18:02:21 +0000 > Commit: Kristof Provost > CommitDate: 2021-08-18 06:48:27 +0000 > > Introduce m_get3() > > Introduce m_get3() which is similar to m_get2(), but can allocate = > up to > MJUM16BYTES bytes (m_get2() can only allocate up to MJUMPAGESIZE). > > This simplifies the bpf improvement in f13da24715. > Reviewed by: glebius, np But I accidentally pushed this along with the = 07edc89c393c1c4f09e0afe8e528f5d091f0ae04 before I added the tag. Kristof From owner-dev-commits-src-all@freebsd.org Wed Aug 18 15:26:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BADAC650F50; Wed, 18 Aug 2021 15:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqWw94mY2z4cf6; Wed, 18 Aug 2021 15:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8865A1395D; Wed, 18 Aug 2021 15:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17IFQnhV029506; Wed, 18 Aug 2021 15:26:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17IFQnch029505; Wed, 18 Aug 2021 15:26:49 GMT (envelope-from git) Date: Wed, 18 Aug 2021 15:26:49 GMT Message-Id: <202108181526.17IFQnch029505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: aec8ad8a9e6a - main - arm: hide busdma statistics behind ifdef ARM_BUSDMA_MAPLOAD_STATS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aec8ad8a9e6aba2d73c98bd41f2994744aae3d01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 15:26:49 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=aec8ad8a9e6aba2d73c98bd41f2994744aae3d01 commit aec8ad8a9e6aba2d73c98bd41f2994744aae3d01 Author: Mateusz Guzik AuthorDate: 2021-07-21 03:34:32 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-18 15:24:53 +0000 arm: hide busdma statistics behind ifdef ARM_BUSDMA_MAPLOAD_STATS Stat collection using counter(9) is quite expensive on this platform and these counters are normally not needed. In particular we see about 1.5% bump in packet rate using Cortex-A9 Reviewed by: ian Sponsored by: Rubicon Communications, LLC ("Netgate") Different Revision: https://reviews.freebsd.org/D31592 --- sys/arm/arm/busdma_machdep.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c index 7d978ca0163d..8a06e7245cd9 100644 --- a/sys/arm/arm/busdma_machdep.c +++ b/sys/arm/arm/busdma_machdep.c @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +//#define ARM_BUSDMA_MAPLOAD_STATS + #define BUSDMA_DCACHE_ALIGN cpuinfo.dcache_line_size #define BUSDMA_DCACHE_MASK cpuinfo.dcache_line_mask @@ -139,12 +141,14 @@ static uint32_t tags_total; static uint32_t maps_total; static uint32_t maps_dmamem; static uint32_t maps_coherent; +#ifdef ARM_BUSDMA_MAPLOAD_STATS static counter_u64_t maploads_total; static counter_u64_t maploads_bounced; static counter_u64_t maploads_coherent; static counter_u64_t maploads_dmamem; static counter_u64_t maploads_mbuf; static counter_u64_t maploads_physmem; +#endif static STAILQ_HEAD(, bounce_zone) bounce_zone_list; @@ -158,6 +162,7 @@ SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_dmamem, CTLFLAG_RD, &maps_dmamem, 0, "Number of active maps for bus_dmamem_alloc buffers"); SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_coherent, CTLFLAG_RD, &maps_coherent, 0, "Number of active maps with BUS_DMA_COHERENT flag set"); +#ifdef ARM_BUSDMA_MAPLOAD_STATS SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_total, CTLFLAG_RD, &maploads_total, "Number of load operations performed"); SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_bounced, CTLFLAG_RD, @@ -170,6 +175,7 @@ SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_mbuf, CTLFLAG_RD, &maploads_mbuf, "Number of load operations for mbufs"); SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_physmem, CTLFLAG_RD, &maploads_physmem, "Number of load operations on physical buffers"); +#endif SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); @@ -222,12 +228,14 @@ busdma_init(void *dummy) { int uma_flags; +#ifdef ARM_BUSDMA_MAPLOAD_STATS maploads_total = counter_u64_alloc(M_WAITOK); maploads_bounced = counter_u64_alloc(M_WAITOK); maploads_coherent = counter_u64_alloc(M_WAITOK); maploads_dmamem = counter_u64_alloc(M_WAITOK); maploads_mbuf = counter_u64_alloc(M_WAITOK); maploads_physmem = counter_u64_alloc(M_WAITOK); +#endif uma_flags = 0; @@ -1058,13 +1066,17 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, if (segs == NULL) segs = map->segments; +#ifdef ARM_BUSDMA_MAPLOAD_STATS counter_u64_add(maploads_total, 1); counter_u64_add(maploads_physmem, 1); +#endif if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) { _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); if (map->pagesneeded != 0) { +#ifdef ARM_BUSDMA_MAPLOAD_STATS counter_u64_add(maploads_bounced, 1); +#endif error = _bus_dmamap_reserve_pages(dmat, map, flags); if (error) return (error); @@ -1143,24 +1155,30 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, struct sync_list *sl; int error; +#ifdef ARM_BUSDMA_MAPLOAD_STATS counter_u64_add(maploads_total, 1); if (map->flags & DMAMAP_COHERENT) counter_u64_add(maploads_coherent, 1); if (map->flags & DMAMAP_DMAMEM_ALLOC) counter_u64_add(maploads_dmamem, 1); +#endif if (segs == NULL) segs = map->segments; if (flags & BUS_DMA_LOAD_MBUF) { +#ifdef ARM_BUSDMA_MAPLOAD_STATS counter_u64_add(maploads_mbuf, 1); +#endif map->flags |= DMAMAP_MBUF; } if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) { _bus_dmamap_count_pages(dmat, pmap, map, buf, buflen, flags); if (map->pagesneeded != 0) { +#ifdef ARM_BUSDMA_MAPLOAD_STATS counter_u64_add(maploads_bounced, 1); +#endif error = _bus_dmamap_reserve_pages(dmat, map, flags); if (error) return (error); From owner-dev-commits-src-all@freebsd.org Wed Aug 18 15:46:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6256A6517BF; Wed, 18 Aug 2021 15:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqXM82Q7hz4dMq; Wed, 18 Aug 2021 15:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B2D3141E2; Wed, 18 Aug 2021 15:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17IFkiYl057190; Wed, 18 Aug 2021 15:46:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17IFkica057189; Wed, 18 Aug 2021 15:46:44 GMT (envelope-from git) Date: Wed, 18 Aug 2021 15:46:44 GMT Message-Id: <202108181546.17IFkica057189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 89c0d2b1906d - main - truncate(1): main() return statement style fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89c0d2b1906d166478949398a361edb22553c855 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 15:46:44 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=89c0d2b1906d166478949398a361edb22553c855 commit 89c0d2b1906d166478949398a361edb22553c855 Author: Ka Ho Ng AuthorDate: 2021-08-18 15:45:20 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-18 15:45:59 +0000 truncate(1): main() return statement style fix Sponsored by: The FreeBSD Foundation --- usr.bin/truncate/truncate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/truncate/truncate.c b/usr.bin/truncate/truncate.c index 0f6c14b15c16..a7579227f299 100644 --- a/usr.bin/truncate/truncate.c +++ b/usr.bin/truncate/truncate.c @@ -175,7 +175,7 @@ main(int argc, char **argv) if (fd != -1) close(fd); - return error ? EXIT_FAILURE : EXIT_SUCCESS; + return (error ? EXIT_FAILURE : EXIT_SUCCESS); } static void From owner-dev-commits-src-all@freebsd.org Wed Aug 18 15:57:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6DF3651BD4; Wed, 18 Aug 2021 15:57:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqXb24Ygbz4f7S; Wed, 18 Aug 2021 15:57:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f175.google.com with SMTP id h29so2752012ila.2; Wed, 18 Aug 2021 08:57:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QWdq6Uxlyxyukoh36bOcJfRur6ZhWx6ZS/ahvcGG6eY=; b=DZt2+EH3DaqHPJvBXP997ZV0jy9nH5SFBqqJtWUg0HiZr2eaEyNcrhH3hUPsPbH9nE viXIbwGe4U8u+tJ3q2whH9uMLrUgJOZVxnwBzf59369hxJfxpUbxbRDIi+xIUBKwubJd HHJ53mDxHkalN5sJiPWcBHM40rZyv0aVVjA8+qe3RxEl6LKpQsNbUTUFivTQ/pVJ26mY pn+JMBkLq0ePzjjE1+ujzBsIIfbFdPzsfL+JLMAIqqE5SUkq5OpjhDNcJ76uuI2hCJsz ykWEaX9NQBld8KD4hKGLx0yrl75J2gm+gXKC86UNjbWjo/YGu94rf0tKDHimRRdVGH0h OsNw== X-Gm-Message-State: AOAM5315+AYNveHDRVk/PXtGm3rzo6Hc85toq6TiQSSWAuCVSlxmAhVd qDsvCaa5zwdJq4+7vvyBUiDmn1texXzQ5ZjL8TzLARnI X-Google-Smtp-Source: ABdhPJyZb91gnDUTl1yH8tu01SOj8nM7L5RMaeSdIoNAvkqJJdpkqae8nLAUEgtV0f5t3Qm9qg91/RzFHDCkZFuWVF0= X-Received: by 2002:a92:2e12:: with SMTP id v18mr6641035ile.100.1629302215660; Wed, 18 Aug 2021 08:56:55 -0700 (PDT) MIME-Version: 1.0 References: <202108180625.17I6PJmQ010784@gitrepo.freebsd.org> In-Reply-To: <202108180625.17I6PJmQ010784@gitrepo.freebsd.org> From: Ed Maste Date: Wed, 18 Aug 2021 11:56:35 -0400 Message-ID: Subject: Re: git: e3500c602b13 - main - ipmi: fix negative logic in watchdog control flag To: Wojciech Macek Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GqXb24Ygbz4f7S X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 15:57:02 -0000 On Wed, 18 Aug 2021 at 02:25, Wojciech Macek wrote: > > The branch main has been updated by wma: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e3500c602b13f8252eb8bb779849c41d47306cee > > commit e3500c602b13f8252eb8bb779849c41d47306cee > Author: Wojciech Macek > AuthorDate: 2021-08-18 06:21:14 +0000 > Commit: Wojciech Macek > CommitDate: 2021-08-18 06:21:14 +0000 > > ipmi: fix negative logic in watchdog control flag Thanks! Avoiding negative logic is something that has been passed on as developer lore but isn't documented in a particularly obvious way. Yesterday I made a very small change to sysctl.9 to try to make the note about -ve logic stand out, but in the coming days I will try to take a more holistic look at style.9 to make guidance on sysctl naming and values more clear. From owner-dev-commits-src-all@freebsd.org Wed Aug 18 17:07:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9BD2652CA9; Wed, 18 Aug 2021 17:07:16 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqZ844r42z4kbC; Wed, 18 Aug 2021 17:07:16 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x82a.google.com with SMTP id x5so2072719qtq.13; Wed, 18 Aug 2021 10:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=GzpDQvGxr2J3YK312J/Ok9TmG5F8UfDT12PkQIT3Rws=; b=A59I2k3SblTggwx1gQxwrYfeEqeq0eTSh3wovoD4BK/ifJgvuUFFUrjq38dHZgfXIr gg708Sv/noSH+sZMSQXyPwdyTtJav16z3cnIuvrhR+33QJvCVjFqUqV1xjU1o9KoYyaC IC0uRSa551zhBZAfN27PFoPECtgNMRQgUMW8yH3+mh9IT9PdwODshyFgZRzMM90oFi2v 3V7m9LC4fRIDMk8+9lyuUc+xQkBAd2xaB7OO/QtnTRdihqAehm8vyQNvbwGJ80EZeanZ h1pMJWbvQmYBi1MbAz30xVsP6eaBjoBZ89ju7xMBdeJgyuI+pvQMU7KHHXRW4VUG57I0 7qhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=GzpDQvGxr2J3YK312J/Ok9TmG5F8UfDT12PkQIT3Rws=; b=ZS5VfzOVGwr6AuCekNpkjiFRO+ufmDwDFim59oIpF5JkWOEfQg5GkcDI+Ioc350kaJ Q3jI07kfTsmJP9Q8LpPmwC9ZBPVwJ2a9H0QlhJMDA58EQEgcBAc9xVZffh2tcLMUvjx1 KCEwD0Qp/dp6t0t8FAXunAM0/i6/VNp7fSHcVGhoBSFbpt0+3PpwlqAzGjAEuo404uRc VCvyXBbAFMoE0HNJwdpAP5xdZvEugGNnLKVXj7lpGOt8+JDE5SO3quVaO2+LRAiIAgyL U73ug4MIwOK+8EVNmFF4iHuyVDJvttowSzQVGa+c8E7vK2RBdsN4BZWzCHBu6W5cObg7 BbPw== X-Gm-Message-State: AOAM532YZxSwMrsvz32a8UNDEACeOve82CO2C7fPdoLS1fySA4v9bNtj uznWcXF970459OBO/NnIkUkxH6lfXOA= X-Google-Smtp-Source: ABdhPJyv+TXxugj7Ya+61byJi47yqkLgbhTcbCEPqme7+lzqZwC/ecmanS5ZDrewybNcRvmyszM1Hg== X-Received: by 2002:aed:2149:: with SMTP id 67mr8486935qtc.60.1629306435513; Wed, 18 Aug 2021 10:07:15 -0700 (PDT) Received: from nuc ([142.126.162.193]) by smtp.gmail.com with ESMTPSA id k8sm260669qtp.14.2021.08.18.10.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 10:07:15 -0700 (PDT) Sender: Mark Johnston Date: Wed, 18 Aug 2021 13:07:17 -0400 From: Mark Johnston To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e0a17c3f063f - main - uipc: create dedicated lists for fast and slow timeout callbacks Message-ID: References: <202108171959.17HJx16Z069832@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202108171959.17HJx16Z069832@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4GqZ844r42z4kbC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 17:07:16 -0000 On Tue, Aug 17, 2021 at 07:59:01PM +0000, Mateusz Guzik wrote: > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e0a17c3f063fd51430fb2b4f5bc667f79d2967c2 > > commit e0a17c3f063fd51430fb2b4f5bc667f79d2967c2 > Author: Mateusz Guzik > AuthorDate: 2021-08-15 21:41:47 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-08-17 19:56:05 +0000 > > uipc: create dedicated lists for fast and slow timeout callbacks > > This avoids having to walk all possible protocols only to check if they > have one (vast majority does not). > > Original patch by kevans@. > > Reviewed by: kevans > Sponsored by: Rubicon Communications, LLC ("Netgate") > --- > sys/kern/uipc_domain.c | 59 +++++++++++++++++++++++++++++++++++--------------- > sys/sys/protosw.h | 4 ++++ > 2 files changed, 46 insertions(+), 17 deletions(-) > > diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c > index b6aefec9556a..0946a2a75326 100644 > --- a/sys/kern/uipc_domain.c > +++ b/sys/kern/uipc_domain.c > @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -76,6 +77,14 @@ static struct callout pfslow_callout; > static void pffasttimo(void *); > static void pfslowtimo(void *); > > +static struct rmlock pftimo_lock; > +RM_SYSINIT(pftimo_lock, &pftimo_lock, "pftimo"); > + > +static LIST_HEAD(, protosw) pffast_list = > + LIST_HEAD_INITIALIZER(pffast_list); > +static LIST_HEAD(, protosw) pfslow_list = > + LIST_HEAD_INITIALIZER(pfslow_list); > + > struct domain *domains; /* registered protocol domains */ > int domain_init_status = 0; > static struct mtx dom_mtx; /* domain list lock */ > @@ -183,8 +192,16 @@ domain_init(void *arg) > ("Premature initialization of domain in non-default vnet")); > if (dp->dom_init) > (*dp->dom_init)(); > - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) > + for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) { > protosw_init(pr); > + rm_wlock(&pftimo_lock); > + if (pr->pr_fasttimo != NULL) > + LIST_INSERT_HEAD(&pffast_list, pr, pr_fasttimos); > + if (pr->pr_slowtimo != NULL) > + LIST_INSERT_HEAD(&pfslow_list, pr, pr_slowtimos); > + rm_wunlock(&pftimo_lock); I think this is wrong for VNETs: each time a VNET is created, vnet_domain_init() calls domain_init() and re-inserts the callbacks into the global list. This results in a circular list, so a softclock thread just invokes callbacks in an infinite loop. > + } > + > /* > * update global information about maximums > */ > @@ -387,6 +404,13 @@ pf_proto_register(int family, struct protosw *npr) > /* Copy the new struct protosw over the spacer. */ > bcopy(npr, fpr, sizeof(*fpr)); > > + rm_wlock(&pftimo_lock); > + if (fpr->pr_fasttimo != NULL) > + LIST_INSERT_HEAD(&pffast_list, fpr, pr_fasttimos); > + if (fpr->pr_slowtimo != NULL) > + LIST_INSERT_HEAD(&pfslow_list, fpr, pr_slowtimos); > + rm_wunlock(&pftimo_lock); > + > /* Job is done, no more protection required. */ > mtx_unlock(&dom_mtx); > > @@ -447,6 +471,13 @@ pf_proto_unregister(int family, int protocol, int type) > return (EPROTONOSUPPORT); > } > > + rm_wlock(&pftimo_lock); > + if (dpr->pr_fasttimo != NULL) > + LIST_REMOVE(dpr, pr_fasttimos); > + if (dpr->pr_slowtimo != NULL) > + LIST_REMOVE(dpr, pr_slowtimos); > + rm_wunlock(&pftimo_lock); > + > /* De-orbit the protocol and make the slot available again. */ > dpr->pr_type = 0; > dpr->pr_domain = dp; > @@ -483,39 +514,33 @@ pfctlinput(int cmd, struct sockaddr *sa) > static void > pfslowtimo(void *arg) > { > + struct rm_priotracker tracker; > struct epoch_tracker et; > - struct domain *dp; > struct protosw *pr; > > + rm_rlock(&pftimo_lock, &tracker); > NET_EPOCH_ENTER(et); > - for (dp = domains; dp; dp = dp->dom_next) { > - if ((atomic_load_int(&dp->dom_flags) & DOMF_INITED) == 0) > - continue; > - atomic_thread_fence_acq(); > - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) > - if (pr->pr_slowtimo) > - (*pr->pr_slowtimo)(); > + LIST_FOREACH(pr, &pfslow_list, pr_slowtimos) { > + (*pr->pr_slowtimo)(); > } > NET_EPOCH_EXIT(et); > + rm_runlock(&pftimo_lock, &tracker); > callout_reset(&pfslow_callout, hz/2, pfslowtimo, NULL); > } > > static void > pffasttimo(void *arg) > { > + struct rm_priotracker tracker; > struct epoch_tracker et; > - struct domain *dp; > struct protosw *pr; > > + rm_rlock(&pftimo_lock, &tracker); > NET_EPOCH_ENTER(et); > - for (dp = domains; dp; dp = dp->dom_next) { > - if ((atomic_load_int(&dp->dom_flags) & DOMF_INITED) == 0) > - continue; > - atomic_thread_fence_acq(); > - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) > - if (pr->pr_fasttimo) > - (*pr->pr_fasttimo)(); > + LIST_FOREACH(pr, &pffast_list, pr_fasttimos) { > + (*pr->pr_fasttimo)(); > } > NET_EPOCH_EXIT(et); > + rm_runlock(&pftimo_lock, &tracker); > callout_reset(&pffast_callout, hz/5, pffasttimo, NULL); > } > diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h > index 5c2fa2d4077e..a929544501f4 100644 > --- a/sys/sys/protosw.h > +++ b/sys/sys/protosw.h > @@ -35,6 +35,8 @@ > #ifndef _SYS_PROTOSW_H_ > #define _SYS_PROTOSW_H_ > > +#include > + > /* Forward declare these structures referenced from prototypes below. */ > struct kaiocb; > struct mbuf; > @@ -93,6 +95,8 @@ struct protosw { > pr_drain_t *pr_drain; /* flush any excess space possible */ > > struct pr_usrreqs *pr_usrreqs; /* user-protocol hook */ > + LIST_ENTRY(protosw) pr_fasttimos; > + LIST_ENTRY(protosw) pr_slowtimos; > }; > /*#endif*/ > > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@freebsd.org" From owner-dev-commits-src-all@freebsd.org Wed Aug 18 17:08:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7909A652E73; Wed, 18 Aug 2021 17:08:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqZ9z333Kz4ktC; Wed, 18 Aug 2021 17:08:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D01015294; Wed, 18 Aug 2021 17:08:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17IH8tkn064614; Wed, 18 Aug 2021 17:08:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17IH8trx064613; Wed, 18 Aug 2021 17:08:55 GMT (envelope-from git) Date: Wed, 18 Aug 2021 17:08:55 GMT Message-Id: <202108181708.17IH8trx064613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: bb250fae9e9e - main - gre: simplify RSS ifdefs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb250fae9e9e278b681cf3a71ced718700ecf74c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 17:08:55 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bb250fae9e9e278b681cf3a71ced718700ecf74c commit bb250fae9e9e278b681cf3a71ced718700ecf74c Author: Franco Fichtner AuthorDate: 2021-08-18 17:05:29 +0000 Commit: Kevin Bowling CommitDate: 2021-08-18 17:05:29 +0000 gre: simplify RSS ifdefs Use the early break to avoid else definitions. When RSS gains a runtime option previous constructs would duplicate and convolute the existing code. While here init flowid and skip magic numbers and late default assignment. Reviewed by: melifaro, kbowling Obtained from: OPNsense MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31584 --- sys/net/if_gre.c | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index aa3e4062b060..19014f9fd3de 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -643,46 +643,37 @@ gre_setseqn(struct grehdr *gh, uint32_t seq) static uint32_t gre_flowid(struct gre_softc *sc, struct mbuf *m, uint32_t af) { - uint32_t flowid; + uint32_t flowid = 0; if ((sc->gre_options & GRE_UDPENCAP) == 0 || sc->gre_port != 0) - return (0); -#ifndef RSS - switch (af) { -#ifdef INET - case AF_INET: - flowid = mtod(m, struct ip *)->ip_src.s_addr ^ - mtod(m, struct ip *)->ip_dst.s_addr; - break; -#endif -#ifdef INET6 - case AF_INET6: - flowid = mtod(m, struct ip6_hdr *)->ip6_src.s6_addr32[3] ^ - mtod(m, struct ip6_hdr *)->ip6_dst.s6_addr32[3]; - break; -#endif - default: - flowid = 0; - } -#else /* RSS */ + return (flowid); switch (af) { #ifdef INET case AF_INET: +#ifdef RSS flowid = rss_hash_ip4_2tuple(mtod(m, struct ip *)->ip_src, mtod(m, struct ip *)->ip_dst); break; +#endif + flowid = mtod(m, struct ip *)->ip_src.s_addr ^ + mtod(m, struct ip *)->ip_dst.s_addr; + break; #endif #ifdef INET6 case AF_INET6: +#ifdef RSS flowid = rss_hash_ip6_2tuple( &mtod(m, struct ip6_hdr *)->ip6_src, &mtod(m, struct ip6_hdr *)->ip6_dst); break; +#endif + flowid = mtod(m, struct ip6_hdr *)->ip6_src.s6_addr32[3] ^ + mtod(m, struct ip6_hdr *)->ip6_dst.s6_addr32[3]; + break; #endif default: - flowid = 0; + break; } -#endif return (flowid); } From owner-dev-commits-src-all@freebsd.org Wed Aug 18 17:16:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2730652B1C; Wed, 18 Aug 2021 17:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqZLD4ffDz4lMg; Wed, 18 Aug 2021 17:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87E7C153AD; Wed, 18 Aug 2021 17:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17IHG4V2077372; Wed, 18 Aug 2021 17:16:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17IHG4Ca077371; Wed, 18 Aug 2021 17:16:04 GMT (envelope-from git) Date: Wed, 18 Aug 2021 17:16:04 GMT Message-Id: <202108181716.17IHG4Ca077371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 0a539a0f005e - main - dhclient: support supersede statement for option 54 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a539a0f005e8acbe4974ede30aa928099c988b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 17:16:04 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0a539a0f005e8acbe4974ede30aa928099c988b9 commit 0a539a0f005e8acbe4974ede30aa928099c988b9 Author: Fabian Kurtz AuthorDate: 2021-08-18 17:12:48 +0000 Commit: Kevin Bowling CommitDate: 2021-08-18 17:15:28 +0000 dhclient: support supersede statement for option 54 PR: 217978 Reported by: Franco Fichtner Reviewed by: markj Obtained from: OPNsense MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31503 --- sbin/dhclient/dhclient.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 8c2615e4c3dc..a1628f0ee22f 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -931,6 +931,8 @@ void state_bound(void *ipp) { struct interface_info *ip = ipp; + u_int8_t *dp = NULL; + int len; ASSERT_STATE(state, S_BOUND); @@ -938,10 +940,17 @@ state_bound(void *ipp) make_request(ip, ip->client->active); ip->client->xid = ip->client->packet.xid; - if (ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].len == 4) { - memcpy(ip->client->destination.iabuf, ip->client->active-> - options[DHO_DHCP_SERVER_IDENTIFIER].data, 4); - ip->client->destination.len = 4; + if (ip->client->config->default_actions[DHO_DHCP_SERVER_IDENTIFIER] == + ACTION_SUPERSEDE) { + dp = ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].data; + len = ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].len; + } else { + dp = ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].data; + len = ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].len; + } + if (len == 4) { + memcpy(ip->client->destination.iabuf, dp, len); + ip->client->destination.len = len; } else ip->client->destination = iaddr_broadcast; From owner-dev-commits-src-all@freebsd.org Wed Aug 18 17:21:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A783653227; Wed, 18 Aug 2021 17:21:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqZSR31Vqz4pDp; Wed, 18 Aug 2021 17:21:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 491572CA18; Wed, 18 Aug 2021 17:21:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f43.google.com with SMTP id dt3so2061643qvb.6; Wed, 18 Aug 2021 10:21:27 -0700 (PDT) X-Gm-Message-State: AOAM533+NsppPVUSHhKmXKPWh/rRpgUHEt6KwG8zCOcIcrGgJ/e5erSg xDm8W4pCIq0Q+FJH8t9V+mSjICmJm/i7Ka2LkwU= X-Google-Smtp-Source: ABdhPJy9yfAQgfZCgWKqDNr4G6kPGOGRduzYLpWVpRJw6Bd3uUJ2HJvQCoRojlXeFaVBIpyrBO88MV7YkASvTKyFNLY= X-Received: by 2002:a05:6214:892:: with SMTP id cz18mr10023416qvb.60.1629307286791; Wed, 18 Aug 2021 10:21:26 -0700 (PDT) MIME-Version: 1.0 References: <202108171959.17HJx16Z069832@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 18 Aug 2021 12:21:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: e0a17c3f063f - main - uipc: create dedicated lists for fast and slow timeout callbacks To: Mark Johnston Cc: Mateusz Guzik , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 17:21:27 -0000 On Wed, Aug 18, 2021 at 12:07 PM Mark Johnston wrote: > > On Tue, Aug 17, 2021 at 07:59:01PM +0000, Mateusz Guzik wrote: > > The branch main has been updated by mjg: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e0a17c3f063fd51430fb2b4f5bc667f79d2967c2 > > > > commit e0a17c3f063fd51430fb2b4f5bc667f79d2967c2 > > Author: Mateusz Guzik > > AuthorDate: 2021-08-15 21:41:47 +0000 > > Commit: Mateusz Guzik > > CommitDate: 2021-08-17 19:56:05 +0000 > > > > uipc: create dedicated lists for fast and slow timeout callbacks > > > > This avoids having to walk all possible protocols only to check if they > > have one (vast majority does not). > > > > Original patch by kevans@. > > > > Reviewed by: kevans > > Sponsored by: Rubicon Communications, LLC ("Netgate") > > --- > > sys/kern/uipc_domain.c | 59 +++++++++++++++++++++++++++++++++++--------------- > > sys/sys/protosw.h | 4 ++++ > > 2 files changed, 46 insertions(+), 17 deletions(-) > > > > diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c > > index b6aefec9556a..0946a2a75326 100644 > > --- a/sys/kern/uipc_domain.c > > +++ b/sys/kern/uipc_domain.c > > @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > #include > > #include > > > > @@ -76,6 +77,14 @@ static struct callout pfslow_callout; > > static void pffasttimo(void *); > > static void pfslowtimo(void *); > > > > +static struct rmlock pftimo_lock; > > +RM_SYSINIT(pftimo_lock, &pftimo_lock, "pftimo"); > > + > > +static LIST_HEAD(, protosw) pffast_list = > > + LIST_HEAD_INITIALIZER(pffast_list); > > +static LIST_HEAD(, protosw) pfslow_list = > > + LIST_HEAD_INITIALIZER(pfslow_list); > > + > > struct domain *domains; /* registered protocol domains */ > > int domain_init_status = 0; > > static struct mtx dom_mtx; /* domain list lock */ > > @@ -183,8 +192,16 @@ domain_init(void *arg) > > ("Premature initialization of domain in non-default vnet")); > > if (dp->dom_init) > > (*dp->dom_init)(); > > - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) > > + for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) { > > protosw_init(pr); > > + rm_wlock(&pftimo_lock); > > + if (pr->pr_fasttimo != NULL) > > + LIST_INSERT_HEAD(&pffast_list, pr, pr_fasttimos); > > + if (pr->pr_slowtimo != NULL) > > + LIST_INSERT_HEAD(&pfslow_list, pr, pr_slowtimos); > > + rm_wunlock(&pftimo_lock); > > I think this is wrong for VNETs: each time a VNET is created, > vnet_domain_init() calls domain_init() and re-inserts the callbacks into > the global list. This results in a circular list, so a softclock thread > just invokes callbacks in an infinite loop. > The latest version I have locally gated this segment behind IS_DEFAULT_VNET(curvnet), but it appears that I hadn't updated the previous review and forgot about it... I'll fix it? From owner-dev-commits-src-all@freebsd.org Wed Aug 18 17:39:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A79B865347E; Wed, 18 Aug 2021 17:39:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqZsf48RXz4pm9; Wed, 18 Aug 2021 17:39:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E56652C544; Wed, 18 Aug 2021 17:39:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: a051ca72e281 - main - Introduce m_get3() To: Kristof Provost , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108180852.17I8q2Wl009885@gitrepo.freebsd.org> Cc: Navdeep Parhar From: John Baldwin Message-ID: Date: Wed, 18 Aug 2021 10:39:45 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <202108180852.17I8q2Wl009885@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 17:39:50 -0000 On 8/18/21 1:52 AM, Kristof Provost wrote: > The branch main has been updated by kp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a051ca72e2815b9bbba1e422f5abf22bc2a01551 > > commit a051ca72e2815b9bbba1e422f5abf22bc2a01551 > Author: Kristof Provost > AuthorDate: 2021-08-07 18:02:21 +0000 > Commit: Kristof Provost > CommitDate: 2021-08-18 06:48:27 +0000 > > Introduce m_get3() > > Introduce m_get3() which is similar to m_get2(), but can allocate up to > MJUM16BYTES bytes (m_get2() can only allocate up to MJUMPAGESIZE). > > This simplifies the bpf improvement in f13da24715. > > Suggested by: glebius > Differential Revision: https://reviews.freebsd.org/D31455 Hmm, if this looped the way m_getm2() does I could use this in icl_cxgbei_conn_pdu_append_data() in sys/dev/cxgbe/cxgbei/icl_cxgbei.c where the code currently allocates 16k jumbo's by hand and then uses m_getm2() for the trailer. One almost wants a variant of m_getm*() where you can give an explicit "max cluster size" perhaps instead of having to know the magic implicit sizes for m_getm2 vs m_getm3. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Wed Aug 18 17:44:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 643F4653AA6; Wed, 18 Aug 2021 17:44:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqZyX2CQ3z4qC4; Wed, 18 Aug 2021 17:44:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33F58155D1; Wed, 18 Aug 2021 17:44:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17IHi4IE017258; Wed, 18 Aug 2021 17:44:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17IHi4ub017257; Wed, 18 Aug 2021 17:44:04 GMT (envelope-from git) Date: Wed, 18 Aug 2021 17:44:04 GMT Message-Id: <202108181744.17IHi4ub017257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a85404906bc8 - main - vmm: Add credential to cdev object MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a85404906bc8f402318524b4ccd196712fc09fbd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 17:44:04 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a85404906bc8f402318524b4ccd196712fc09fbd commit a85404906bc8f402318524b4ccd196712fc09fbd Author: Cyril Zhang AuthorDate: 2021-08-18 17:41:33 +0000 Commit: Mark Johnston CommitDate: 2021-08-18 17:41:33 +0000 vmm: Add credential to cdev object Add a credential to the cdev object in sysctl_vmm_create(), then check that we have the correct credentials in sysctl_vmm_destroy(). This prevents a process in one jail from opening or destroying the /dev/vmm file corresponding to a VM in a sibling jail. Add regression tests. Reviewed by: jhb, markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31156 --- etc/mtree/BSD.tests.dist | 2 ++ sys/amd64/vmm/vmm_dev.c | 15 ++++++-- tests/sys/Makefile | 1 + tests/sys/vmm/Makefile | 11 ++++++ tests/sys/vmm/utils.subr | 47 +++++++++++++++++++++++++ tests/sys/vmm/vmm_cred_jail.sh | 80 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 154 insertions(+), 2 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 60cdca439887..f7965dac2884 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -866,6 +866,8 @@ .. vm .. + vmm + .. .. usr.bin apply diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c index 2da6225fdddd..2ce9470cf6dd 100644 --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -80,6 +80,7 @@ struct devmem_softc { struct vmmdev_softc { struct vm *vm; /* vm instance cookie */ struct cdev *cdev; + struct ucred *ucred; SLIST_ENTRY(vmmdev_softc) link; SLIST_HEAD(, devmem_softc) devmem; int flags; @@ -182,6 +183,12 @@ vmmdev_lookup(const char *name) break; } + if (sc == NULL) + return (NULL); + + if (cr_cansee(curthread->td_ucred, sc->ucred)) + return (NULL); + return (sc); } @@ -979,6 +986,9 @@ vmmdev_destroy(void *arg) if (sc->vm != NULL) vm_destroy(sc->vm); + if (sc->ucred != NULL) + crfree(sc->ucred); + if ((sc->flags & VSC_LINKED) != 0) { mtx_lock(&vmmdev_mtx); SLIST_REMOVE(&head, sc, vmmdev_softc, link); @@ -1096,6 +1106,7 @@ sysctl_vmm_create(SYSCTL_HANDLER_ARGS) goto out; sc = malloc(sizeof(struct vmmdev_softc), M_VMMDEV, M_WAITOK | M_ZERO); + sc->ucred = crhold(curthread->td_ucred); sc->vm = vm; SLIST_INIT(&sc->devmem); @@ -1117,8 +1128,8 @@ sysctl_vmm_create(SYSCTL_HANDLER_ARGS) goto out; } - error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &vmmdevsw, NULL, - UID_ROOT, GID_WHEEL, 0600, "vmm/%s", buf); + error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &vmmdevsw, sc->ucred, + UID_ROOT, GID_WHEEL, 0600, "vmm/%s", buf); if (error != 0) { vmmdev_destroy(sc); goto out; diff --git a/tests/sys/Makefile b/tests/sys/Makefile index 2781f7fb4ded..2ba60f41b76c 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -31,6 +31,7 @@ TESTS_SUBDIRS+= posixshm TESTS_SUBDIRS+= sys TESTS_SUBDIRS+= vfs TESTS_SUBDIRS+= vm +TESTS_SUBDIRS+= vmm .if ${MK_AUDIT} != "no" _audit= audit diff --git a/tests/sys/vmm/Makefile b/tests/sys/vmm/Makefile new file mode 100644 index 000000000000..544d98421a95 --- /dev/null +++ b/tests/sys/vmm/Makefile @@ -0,0 +1,11 @@ +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/vmm + +BINDIR= ${TESTSDIR} + +ATF_TESTS_SH+= vmm_cred_jail + +${PACKAGE}FILES+= utils.subr + +.include diff --git a/tests/sys/vmm/utils.subr b/tests/sys/vmm/utils.subr new file mode 100644 index 000000000000..0de9c6c671ea --- /dev/null +++ b/tests/sys/vmm/utils.subr @@ -0,0 +1,47 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 The FreeBSD Foundation +# +# This software was developed by Cyril Zhang under sponsorship from +# the FreeBSD Foundation. +# +# 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. +# + +vmm_mkjail() +{ + jailname=$1 + jail -c name=${jailname} persist allow.vmm + echo $jailname >> created_jails.lst +} +vmm_cleanup() +{ + if [ -f created_jails.lst ] + then + for jailname in `cat created_jails.lst` + do + jail -r ${jailname} + done + rm created_jails.lst + fi +} diff --git a/tests/sys/vmm/vmm_cred_jail.sh b/tests/sys/vmm/vmm_cred_jail.sh new file mode 100644 index 000000000000..5dcb30e628c2 --- /dev/null +++ b/tests/sys/vmm/vmm_cred_jail.sh @@ -0,0 +1,80 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 The FreeBSD Foundation +# +# This software was developed by Cyril Zhang under sponsorship from +# the FreeBSD Foundation. +# +# 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. +# + +. $(atf_get_srcdir)/utils.subr + +atf_test_case vmm_cred_jail_host cleanup +vmm_cred_jail_host_head() +{ + atf_set "descr" "Tests deleting the host's VM from within a jail" + atf_set "require.user" "root" +} +vmm_cred_jail_host_body() +{ + if ! kldstat -qn vmm; then + atf_skip "vmm is not loaded" + fi + bhyvectl --vm=testvm --create + vmm_mkjail myjail + atf_check -s exit:1 -e ignore jexec myjail bhyvectl --vm=testvm --destroy +} +vmm_cred_jail_host_cleanup() +{ + bhyvectl --vm=testvm --destroy + vmm_cleanup +} + +atf_test_case vmm_cred_jail_other cleanup +vmm_cred_jail_other_head() +{ + atf_set "descr" "Tests deleting a jail's VM from within another jail" + atf_set "require.user" "root" +} +vmm_cred_jail_other_body() +{ + if ! kldstat -qn vmm; then + atf_skip "vmm is not loaded" + fi + vmm_mkjail myjail1 + vmm_mkjail myjail2 + atf_check -s exit:0 jexec myjail1 bhyvectl --vm=testvm --create + atf_check -s exit:1 -e ignore jexec myjail2 bhyvectl --vm=testvm --destroy +} +vmm_cred_jail_other_cleanup() +{ + bhyvectl --vm=testvm --destroy + vmm_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case vmm_cred_jail_host + atf_add_test_case vmm_cred_jail_other +} From owner-dev-commits-src-all@freebsd.org Wed Aug 18 17:54:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67FCC653A48; Wed, 18 Aug 2021 17:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqbB12DJ8z4r45; Wed, 18 Aug 2021 17:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34BEA15A58; Wed, 18 Aug 2021 17:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17IHs161030990; Wed, 18 Aug 2021 17:54:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17IHs1Ub030989; Wed, 18 Aug 2021 17:54:01 GMT (envelope-from git) Date: Wed, 18 Aug 2021 17:54:01 GMT Message-Id: <202108181754.17IHs1Ub030989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: d7e1bdfebacc - main - uipc: avoid circular pr_{slow,fast}timos MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7e1bdfebacc4de25dc51e14a91d66bb429677c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 17:54:01 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d7e1bdfebacc4de25dc51e14a91d66bb429677c9 commit d7e1bdfebacc4de25dc51e14a91d66bb429677c9 Author: Kyle Evans AuthorDate: 2021-08-18 17:31:45 +0000 Commit: Kyle Evans CommitDate: 2021-08-18 17:46:54 +0000 uipc: avoid circular pr_{slow,fast}timos domain_init() gets reinvoked for each vnet on a system, so we must not alter global state. Practically speaking, we were creating circular lists and tying up a softclock thread into an infinite loop. The breakage here was most easily observed by simply creating a jail in a new vnet and watching the system suddenly become erratic. Reported by: markj Fixes: e0a17c3f063f ("uipc: create dedicated lists for fast ...") Pointy hat: kevans --- sys/kern/uipc_domain.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 0946a2a75326..d572e0ec19db 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -194,12 +194,23 @@ domain_init(void *arg) (*dp->dom_init)(); for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) { protosw_init(pr); - rm_wlock(&pftimo_lock); - if (pr->pr_fasttimo != NULL) - LIST_INSERT_HEAD(&pffast_list, pr, pr_fasttimos); - if (pr->pr_slowtimo != NULL) - LIST_INSERT_HEAD(&pfslow_list, pr, pr_slowtimos); - rm_wunlock(&pftimo_lock); + + /* + * Note that with VIMAGE enabled, domain_init() will be + * re-invoked for each new vnet that's created. The below lists + * are intended to be system-wide, so avoid altering global + * state for non-default vnets. + */ + if (IS_DEFAULT_VNET(curvnet)) { + rm_wlock(&pftimo_lock); + if (pr->pr_fasttimo != NULL) + LIST_INSERT_HEAD(&pffast_list, pr, + pr_fasttimos); + if (pr->pr_slowtimo != NULL) + LIST_INSERT_HEAD(&pfslow_list, pr, + pr_slowtimos); + rm_wunlock(&pftimo_lock); + } } /* From owner-dev-commits-src-all@freebsd.org Wed Aug 18 17:55:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF433653E1A for ; Wed, 18 Aug 2021 17:55:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqbCB4Z43z4r0D for ; Wed, 18 Aug 2021 17:55:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 7D2632CB44 for ; Wed, 18 Aug 2021 17:55:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f176.google.com with SMTP id p22so3955442qki.10 for ; Wed, 18 Aug 2021 10:55:02 -0700 (PDT) X-Gm-Message-State: AOAM531mT4TeDizc8DuaMmPDsU0Mq1f6/vvP/xPylaua5nxTr6LOy8No nVvhOfrI3avxZYJItHdn0HRKFaXZHYK1tyjw2IU= X-Received: by 2002:a37:a58b:: with SMTP id o133mt11334821qke.120.1629309302075; Wed, 18 Aug 2021 10:55:02 -0700 (PDT) MIME-Version: 1.0 References: <202108181754.17IHs1Ub030989@gitrepo.freebsd.org> In-Reply-To: <202108181754.17IHs1Ub030989@gitrepo.freebsd.org> From: Kyle Evans Date: Wed, 18 Aug 2021 12:54:49 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: d7e1bdfebacc - main - uipc: avoid circular pr_{slow, fast}timos Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 17:55:02 -0000 On Wed, Aug 18, 2021 at 12:54 PM Kyle Evans wrote: > > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d7e1bdfebacc4de25dc51e14a91d66bb429677c9 > > commit d7e1bdfebacc4de25dc51e14a91d66bb429677c9 > Author: Kyle Evans > AuthorDate: 2021-08-18 17:31:45 +0000 > Commit: Kyle Evans > CommitDate: 2021-08-18 17:46:54 +0000 > > uipc: avoid circular pr_{slow,fast}timos > This should read "avoid circular pf{fast,slow}_list", sorry. > domain_init() gets reinvoked for each vnet on a system, so we must not > alter global state. Practically speaking, we were creating circular > lists and tying up a softclock thread into an infinite loop. > > The breakage here was most easily observed by simply creating a jail > in a new vnet and watching the system suddenly become erratic. > > Reported by: markj > Fixes: e0a17c3f063f ("uipc: create dedicated lists for fast ...") > Pointy hat: kevans > --- > sys/kern/uipc_domain.c | 23 +++++++++++++++++------ > 1 file changed, 17 insertions(+), 6 deletions(-) > > diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c > index 0946a2a75326..d572e0ec19db 100644 > --- a/sys/kern/uipc_domain.c > +++ b/sys/kern/uipc_domain.c > @@ -194,12 +194,23 @@ domain_init(void *arg) > (*dp->dom_init)(); > for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) { > protosw_init(pr); > - rm_wlock(&pftimo_lock); > - if (pr->pr_fasttimo != NULL) > - LIST_INSERT_HEAD(&pffast_list, pr, pr_fasttimos); > - if (pr->pr_slowtimo != NULL) > - LIST_INSERT_HEAD(&pfslow_list, pr, pr_slowtimos); > - rm_wunlock(&pftimo_lock); > + > + /* > + * Note that with VIMAGE enabled, domain_init() will be > + * re-invoked for each new vnet that's created. The below lists > + * are intended to be system-wide, so avoid altering global > + * state for non-default vnets. > + */ > + if (IS_DEFAULT_VNET(curvnet)) { > + rm_wlock(&pftimo_lock); > + if (pr->pr_fasttimo != NULL) > + LIST_INSERT_HEAD(&pffast_list, pr, > + pr_fasttimos); > + if (pr->pr_slowtimo != NULL) > + LIST_INSERT_HEAD(&pfslow_list, pr, > + pr_slowtimos); > + rm_wunlock(&pftimo_lock); > + } > } > > /* From owner-dev-commits-src-all@freebsd.org Wed Aug 18 18:05:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83C9E654634; Wed, 18 Aug 2021 18:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqbRK3BNJz4rfk; Wed, 18 Aug 2021 18:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4786316066; Wed, 18 Aug 2021 18:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17II5Xs8045677; Wed, 18 Aug 2021 18:05:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17II5XqV045676; Wed, 18 Aug 2021 18:05:33 GMT (envelope-from git) Date: Wed, 18 Aug 2021 18:05:33 GMT Message-Id: <202108181805.17II5XqV045676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c261b6ea4e2e - main - iscsi: Teach the iSCSI stack about "large" received PDUs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c261b6ea4e2ef1fc6a446443ee594ad76f392350 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 18:05:33 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c261b6ea4e2ef1fc6a446443ee594ad76f392350 commit c261b6ea4e2ef1fc6a446443ee594ad76f392350 Author: John Baldwin AuthorDate: 2021-08-18 17:56:28 +0000 Commit: John Baldwin CommitDate: 2021-08-18 17:56:28 +0000 iscsi: Teach the iSCSI stack about "large" received PDUs. When using iSCSI PDU offload (cxgbei) on T6 adapters, a burst of received PDUs can be reported via a single message to the driver. Previously the driver passed these multi-PDU bursts up to the iSCSI stack up as a single "large" PDU by rewriting the buffer offset, data segment length, and DataSN fields in the iSCSI header. The DataSN field in particular was rewritten so that each of the "large" PDUs used consecutively increasing values. While this worked, the forged DataSN values did not match the ExpDataSN value in the subsequent SCSI Response PDU. The initiator does not currently verify this value, but the forged DataSN values prevent adding a check. To avoid this, allow a logical iSCSI PDU (struct icl_pdu) to describe a burst of PDUs via a new 'ip_additional_pdus' field. Normally this field is set to zero when 'struct icl_pdu' represents a single PDU. If logical PDU represents a burst of on-the-wire PDUs, then 'ip_npdus' contains the count of additional on-the-wire PDUs. The header of this "large" PDU is still modified, but the DataSN field now contains the DataSN value of the first on-the-wire PDU in the burst. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31577 --- sys/cam/ctl/ctl_frontend_iscsi.c | 2 +- sys/dev/cxgbe/cxgbei/cxgbei.c | 18 +++++++++++------- sys/dev/cxgbe/cxgbei/cxgbei.h | 1 - sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 1 - sys/dev/iscsi/icl.h | 8 ++++++++ 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index b8fafcea69ed..0cbe3bcefc73 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -917,7 +917,7 @@ cfiscsi_pdu_handle_data_out(struct icl_pdu *request) cfiscsi_session_terminate(cs); return; } - cdw->cdw_datasn++; + cdw->cdw_datasn += request->ip_additional_pdus + 1; io = cdw->cdw_ctl_io; KASSERT((io->io_hdr.flags & CTL_FLAG_DATA_MASK) != CTL_FLAG_DATA_IN, diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index 8dc580d65770..6af7043460fb 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -583,10 +583,12 @@ do_rx_iscsi_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) cmp->next_buffer_offset; if (prev_seg_len != 0) { + uint32_t orig_datasn; + /* - * Since cfiscsi doesn't know about previous - * headers, pretend that the entire r2t data - * length was received in this single segment. + * Return a "large" PDU representing the burst + * of PDUs. Adjust the offset and length of + * this PDU to represent the entire burst. */ ip->ip_data_len += prev_seg_len; bhsdo->bhsdo_data_segment_len[2] = ip->ip_data_len; @@ -595,17 +597,19 @@ do_rx_iscsi_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) bhsdo->bhsdo_buffer_offset = htobe32(cmp->next_buffer_offset); - npdus = htobe32(bhsdo->bhsdo_datasn) - cmp->last_datasn; + orig_datasn = htobe32(bhsdo->bhsdo_datasn); + npdus = orig_datasn - cmp->last_datasn; + bhsdo->bhsdo_datasn = htobe32(cmp->last_datasn + 1); + cmp->last_datasn = orig_datasn; + ip->ip_additional_pdus = npdus - 1; } else { MPASS(htobe32(bhsdo->bhsdo_datasn) == cmp->last_datasn + 1); npdus = 1; + cmp->last_datasn = htobe32(bhsdo->bhsdo_datasn); } cmp->next_buffer_offset += ip->ip_data_len; - cmp->last_datasn = htobe32(bhsdo->bhsdo_datasn); - bhsdo->bhsdo_datasn = htobe32(cmp->next_datasn); - cmp->next_datasn++; toep->ofld_rxq->rx_iscsi_ddp_pdus += npdus; toep->ofld_rxq->rx_iscsi_ddp_octets += ip->ip_data_len; } else { diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.h b/sys/dev/cxgbe/cxgbei/cxgbei.h index 20754fa893a8..09d556988091 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.h +++ b/sys/dev/cxgbe/cxgbei/cxgbei.h @@ -58,7 +58,6 @@ struct cxgbei_cmp { uint32_t tt; /* Transfer tag. */ - uint32_t next_datasn; uint32_t next_buffer_offset; uint32_t last_datasn; }; diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index a6e7f8b95815..687fc545cebd 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -1346,7 +1346,6 @@ no_ddp: prsv->prsv_tag &= ~pr->pr_alias_mask; prsv->prsv_tag |= alias << pr->pr_alias_shift & pr->pr_alias_mask; - ddp->cmp.next_datasn = 0; ddp->cmp.last_datasn = -1; cxgbei_insert_cmp(icc, &ddp->cmp, prsv->prsv_tag); *tttp = htobe32(prsv->prsv_tag); diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h index bd12569a8957..07dcbbf2a0b5 100644 --- a/sys/dev/iscsi/icl.h +++ b/sys/dev/iscsi/icl.h @@ -75,6 +75,14 @@ struct icl_pdu { size_t ip_data_len; struct mbuf *ip_data_mbuf; + /* + * When a "large" received PDU represents multiple on-the-wire + * PDUs, this is the count of additional on-the-wire PDUs. + * For PDUs that match on-the-wire PDUs, this should be set to + * zero. + */ + u_int ip_additional_pdus; + /* * User (initiator or provider) private fields. */ From owner-dev-commits-src-all@freebsd.org Wed Aug 18 21:21:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEEE06562F3; Wed, 18 Aug 2021 21:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gqgms55VRz3L4r; Wed, 18 Aug 2021 21:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 971C318AC1; Wed, 18 Aug 2021 21:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17ILL1Qb010177; Wed, 18 Aug 2021 21:21:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17ILL1Oa010176; Wed, 18 Aug 2021 21:21:01 GMT (envelope-from git) Date: Wed, 18 Aug 2021 21:21:01 GMT Message-Id: <202108182121.17ILL1Oa010176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: c7cf100aafb4 - main - geli(8): Do not report error on resize to the same size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7cf100aafb4cb881e05a5153de152907f6c07f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 21:21:01 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c7cf100aafb4cb881e05a5153de152907f6c07f3 commit c7cf100aafb4cb881e05a5153de152907f6c07f3 Author: Alexander Motin AuthorDate: 2021-08-18 21:11:03 +0000 Commit: Alexander Motin CommitDate: 2021-08-18 21:11:03 +0000 geli(8): Do not report error on resize to the same size. Just validate the old metadata and exit. Originally the check was added to not thash the only copy of metadata, but we can achieve the same just by skipping the writing/trashing. The metadata validation should protect user from wrongly specifying new size instead of old. MFC after: 1 month Sponsored by: iXsystems, Inc. --- lib/geom/eli/geom_eli.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index 8ee4643e3c91..4c04a9256b5e 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -1823,10 +1823,6 @@ eli_resize(struct gctl_req *req) gctl_error(req, "Invalid oldsize: Out of range."); goto out; } - if (oldsize == mediasize) { - gctl_error(req, "Size hasn't changed."); - goto out; - } /* Read metadata from the 'oldsize' offset. */ if (pread(provfd, sector, secsize, oldsize - secsize) != secsize) { @@ -1865,6 +1861,10 @@ eli_resize(struct gctl_req *req) goto out; } + /* The metadata is valid and nothing has changed. Just exit. */ + if (oldsize == mediasize) + goto out; + /* * Update the old metadata with the current provider size and write * it back to the correct place on the provider. From owner-dev-commits-src-all@freebsd.org Wed Aug 18 22:33:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F5BC657F20; Wed, 18 Aug 2021 22:33:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqjNn6r4Lz3PQP; Wed, 18 Aug 2021 22:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2C2019A42; Wed, 18 Aug 2021 22:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17IMXjMp007620; Wed, 18 Aug 2021 22:33:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17IMXjhI007619; Wed, 18 Aug 2021 22:33:45 GMT (envelope-from git) Date: Wed, 18 Aug 2021 22:33:45 GMT Message-Id: <202108182233.17IMXjhI007619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: eba8e643b19c - main - sctp: improve handling of INIT chunks with invalid parameters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eba8e643b19cb7acd7c9a79acfab376b3967f20d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 22:33:46 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=eba8e643b19cb7acd7c9a79acfab376b3967f20d commit eba8e643b19cb7acd7c9a79acfab376b3967f20d Author: Michael Tuexen AuthorDate: 2021-08-18 22:31:35 +0000 Commit: Michael Tuexen CommitDate: 2021-08-18 22:33:28 +0000 sctp: improve handling of INIT chunks with invalid parameters MFC after: 3 days --- sys/netinet/sctp_input.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index ed15b81ba3e5..66ec2d6a577a 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -86,7 +86,7 @@ static void sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, + struct sctp_tcb *stcb, struct sctp_nets *net, uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { @@ -100,17 +100,17 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offset, } /* Validate parameters */ init = &cp->init; - if ((ntohl(init->initiate_tag) == 0) || - (ntohl(init->a_rwnd) < SCTP_MIN_RWND) || + if (ntohl(init->initiate_tag) == 0) { + goto outnow; + } + if ((ntohl(init->a_rwnd) < SCTP_MIN_RWND) || (ntohs(init->num_inbound_streams) == 0) || (ntohs(init->num_outbound_streams) == 0)) { /* protocol error... send abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, + sctp_send_abort(m, iphlen, src, dst, sh, init->initiate_tag, op_err, + mflowtype, mflowid, inp->fibnum, vrf_id, port); - if (stcb) - *abort_no_unlock = 1; goto outnow; } if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), @@ -118,11 +118,9 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offset, /* auth parameter(s) error... send abort */ op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Problem with AUTH parameters"); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, + sctp_send_abort(m, iphlen, src, dst, sh, init->initiate_tag, op_err, + mflowtype, mflowid, inp->fibnum, vrf_id, port); - if (stcb) - *abort_no_unlock = 1; goto outnow; } /* We are only accepting if we have a listening socket. */ @@ -4613,20 +4611,22 @@ process_control_chunks: /* Honor our resource limit. */ if (chk_length > SCTP_LARGEST_INIT_ACCEPTED) { op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); - sctp_abort_association(inp, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, + sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, + mflowtype, mflowid, inp->fibnum, vrf_id, port); *offset = length; + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } return (NULL); } sctp_handle_init(m, iphlen, *offset, src, dst, sh, (struct sctp_init_chunk *)ch, inp, - stcb, *netp, &abort_no_unlock, + stcb, *netp, mflowtype, mflowid, vrf_id, port); *offset = length; - if ((!abort_no_unlock) && (stcb != NULL)) { + if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } return (NULL); From owner-dev-commits-src-all@freebsd.org Thu Aug 19 00:24:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A21136592CF; Thu, 19 Aug 2021 00:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqlrF4BxFz3ljQ; Thu, 19 Aug 2021 00:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 783771AEF7; Thu, 19 Aug 2021 00:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J0ODwp053820; Thu, 19 Aug 2021 00:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J0OD5D053819; Thu, 19 Aug 2021 00:24:13 GMT (envelope-from git) Date: Thu, 19 Aug 2021 00:24:13 GMT Message-Id: <202108190024.17J0OD5D053819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 60833696c2e9 - stable/13 - ipfilter: remove doubled semicolons MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 60833696c2e90ab929ac12e9da2ac2b381f02563 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 00:24:13 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=60833696c2e90ab929ac12e9da2ac2b381f02563 commit 60833696c2e90ab929ac12e9da2ac2b381f02563 Author: Ed Maste AuthorDate: 2021-08-16 17:16:23 +0000 Commit: Ed Maste CommitDate: 2021-08-19 00:23:50 +0000 ipfilter: remove doubled semicolons Local commit; ipfilter upstream is inactive. Discussed with: cy MFC after: 3 days --- sys/contrib/ipfilter/netinet/ip_frag.c | 2 +- sys/contrib/ipfilter/netinet/ip_state.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_frag.c b/sys/contrib/ipfilter/netinet/ip_frag.c index 93bcc2ed9415..4a2596e72563 100644 --- a/sys/contrib/ipfilter/netinet/ip_frag.c +++ b/sys/contrib/ipfilter/netinet/ip_frag.c @@ -1181,7 +1181,7 @@ ipf_frag_nat_next(softc, token, itp) ipftoken_t *token; ipfgeniter_t *itp; { - ipf_frag_softc_t *softf = softc->ipf_frag_soft;; + ipf_frag_softc_t *softf = softc->ipf_frag_soft; #ifdef USE_MUTEXES return ipf_frag_next(softc, token, itp, &softf->ipfr_natlist, diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c index 0ebebb49297d..7918f34fe685 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.c +++ b/sys/contrib/ipfilter/netinet/ip_state.c @@ -2855,8 +2855,8 @@ ipf_checkicmpmatchingstate(fin) tcp = (tcphdr_t *)((char *)oip + (IP_HL(oip) << 2)); - hv += tcp->th_dport;; - hv += tcp->th_sport;; + hv += tcp->th_dport; + hv += tcp->th_sport; hv = DOUBLE_HASH(hv); READ_ENTER(&softc->ipf_state); From owner-dev-commits-src-all@freebsd.org Thu Aug 19 00:24:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 760E265907E; Thu, 19 Aug 2021 00:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gqlrg2s4sz3lZZ; Thu, 19 Aug 2021 00:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 498AF1ACF3; Thu, 19 Aug 2021 00:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J0OZbx054380; Thu, 19 Aug 2021 00:24:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J0OZoU054379; Thu, 19 Aug 2021 00:24:35 GMT (envelope-from git) Date: Thu, 19 Aug 2021 00:24:35 GMT Message-Id: <202108190024.17J0OZoU054379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7429c75a19d2 - stable/12 - ipfilter: remove doubled semicolons MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7429c75a19d297f4ab80042662292ac9ec668e99 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 00:24:35 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7429c75a19d297f4ab80042662292ac9ec668e99 commit 7429c75a19d297f4ab80042662292ac9ec668e99 Author: Ed Maste AuthorDate: 2021-08-16 17:16:23 +0000 Commit: Ed Maste CommitDate: 2021-08-19 00:24:17 +0000 ipfilter: remove doubled semicolons Local commit; ipfilter upstream is inactive. Discussed with: cy MFC after: 3 days --- sys/contrib/ipfilter/netinet/ip_frag.c | 2 +- sys/contrib/ipfilter/netinet/ip_state.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_frag.c b/sys/contrib/ipfilter/netinet/ip_frag.c index 93bcc2ed9415..4a2596e72563 100644 --- a/sys/contrib/ipfilter/netinet/ip_frag.c +++ b/sys/contrib/ipfilter/netinet/ip_frag.c @@ -1181,7 +1181,7 @@ ipf_frag_nat_next(softc, token, itp) ipftoken_t *token; ipfgeniter_t *itp; { - ipf_frag_softc_t *softf = softc->ipf_frag_soft;; + ipf_frag_softc_t *softf = softc->ipf_frag_soft; #ifdef USE_MUTEXES return ipf_frag_next(softc, token, itp, &softf->ipfr_natlist, diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c index 0ebebb49297d..7918f34fe685 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.c +++ b/sys/contrib/ipfilter/netinet/ip_state.c @@ -2855,8 +2855,8 @@ ipf_checkicmpmatchingstate(fin) tcp = (tcphdr_t *)((char *)oip + (IP_HL(oip) << 2)); - hv += tcp->th_dport;; - hv += tcp->th_sport;; + hv += tcp->th_dport; + hv += tcp->th_sport; hv = DOUBLE_HASH(hv); READ_ENTER(&softc->ipf_state); From owner-dev-commits-src-all@freebsd.org Thu Aug 19 00:25:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04E6C659BCC; Thu, 19 Aug 2021 00:25:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqlsM6kgbz3lxD; Thu, 19 Aug 2021 00:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF2861B0CF; Thu, 19 Aug 2021 00:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J0PBqV054539; Thu, 19 Aug 2021 00:25:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J0PBOR054538; Thu, 19 Aug 2021 00:25:11 GMT (envelope-from git) Date: Thu, 19 Aug 2021 00:25:11 GMT Message-Id: <202108190025.17J0PBOR054538@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f3616c6d7ff5 - stable/11 - ipfilter: remove doubled semicolons MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: f3616c6d7ff5168d2e7883a831b60bbdc31367c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 00:25:12 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f3616c6d7ff5168d2e7883a831b60bbdc31367c6 commit f3616c6d7ff5168d2e7883a831b60bbdc31367c6 Author: Ed Maste AuthorDate: 2021-08-16 17:16:23 +0000 Commit: Ed Maste CommitDate: 2021-08-19 00:24:46 +0000 ipfilter: remove doubled semicolons Local commit; ipfilter upstream is inactive. Discussed with: cy MFC after: 3 days (cherry picked from commit 8fa63f44e64ebac444a4ac6451ac5e150cdcf8b1) --- sys/contrib/ipfilter/netinet/ip_frag.c | 2 +- sys/contrib/ipfilter/netinet/ip_state.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_frag.c b/sys/contrib/ipfilter/netinet/ip_frag.c index 93bcc2ed9415..4a2596e72563 100644 --- a/sys/contrib/ipfilter/netinet/ip_frag.c +++ b/sys/contrib/ipfilter/netinet/ip_frag.c @@ -1181,7 +1181,7 @@ ipf_frag_nat_next(softc, token, itp) ipftoken_t *token; ipfgeniter_t *itp; { - ipf_frag_softc_t *softf = softc->ipf_frag_soft;; + ipf_frag_softc_t *softf = softc->ipf_frag_soft; #ifdef USE_MUTEXES return ipf_frag_next(softc, token, itp, &softf->ipfr_natlist, diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c index 0ebebb49297d..7918f34fe685 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.c +++ b/sys/contrib/ipfilter/netinet/ip_state.c @@ -2855,8 +2855,8 @@ ipf_checkicmpmatchingstate(fin) tcp = (tcphdr_t *)((char *)oip + (IP_HL(oip) << 2)); - hv += tcp->th_dport;; - hv += tcp->th_sport;; + hv += tcp->th_dport; + hv += tcp->th_sport; hv = DOUBLE_HASH(hv); READ_ENTER(&softc->ipf_state); From owner-dev-commits-src-all@freebsd.org Thu Aug 19 01:12:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76CA765A152; Thu, 19 Aug 2021 01:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqmvQ2nNHz3pjl; Thu, 19 Aug 2021 01:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47C661BF00; Thu, 19 Aug 2021 01:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J1C2DS017435; Thu, 19 Aug 2021 01:12:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J1C2Ea017434; Thu, 19 Aug 2021 01:12:02 GMT (envelope-from git) Date: Thu, 19 Aug 2021 01:12:02 GMT Message-Id: <202108190112.17J1C2Ea017434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 09d4fe40e039 - stable/13 - Fix race between first rand(3) calls with _once(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 09d4fe40e039d4b08a034454c36aed86571725b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 01:12:02 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=09d4fe40e039d4b08a034454c36aed86571725b0 commit 09d4fe40e039d4b08a034454c36aed86571725b0 Author: Alexander Motin AuthorDate: 2021-07-21 15:25:46 +0000 Commit: Alexander Motin CommitDate: 2021-08-19 01:11:51 +0000 Fix race between first rand(3) calls with _once(). Before this patch there was a chance for thread that called rand(3) slightly later to see rand3_state already allocated, but not yet initialized. While this API is not expected to be thread-safe, it is not expected to crash. ztest on 64-thread system reproduced it reliably for me. Submitted by: avg@ MFC after: 1 month (cherry picked from commit 3a57f08b5042f15bb8ffb2fcce99d082d225d4cf) --- lib/libc/stdlib/rand.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c index bddb0f040302..e448d1b1fd14 100644 --- a/lib/libc/stdlib/rand.c +++ b/lib/libc/stdlib/rand.c @@ -41,11 +41,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include "un-namespace.h" +#include "libc_private.h" #include "random.h" /* @@ -64,6 +66,7 @@ __FBSDID("$FreeBSD$"); * the advantage of being the one already in the tree. */ static struct __random_state *rand3_state; +static pthread_once_t rand3_state_once = PTHREAD_ONCE_INIT; static void initialize_rand3(void) @@ -78,16 +81,14 @@ initialize_rand3(void) int rand(void) { - if (rand3_state == NULL) - initialize_rand3(); + _once(&rand3_state_once, initialize_rand3); return ((int)random_r(rand3_state)); } void srand(unsigned seed) { - if (rand3_state == NULL) - initialize_rand3(); + _once(&rand3_state_once, initialize_rand3); srandom_r(rand3_state, seed); } From owner-dev-commits-src-all@freebsd.org Thu Aug 19 04:58:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF25465D7AE; Thu, 19 Aug 2021 04:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqsxH3LJ8z3Csj; Thu, 19 Aug 2021 04:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B8FF1F373; Thu, 19 Aug 2021 04:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J4wx7A014248; Thu, 19 Aug 2021 04:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J4wxDY014247; Thu, 19 Aug 2021 04:58:59 GMT (envelope-from git) Date: Thu, 19 Aug 2021 04:58:59 GMT Message-Id: <202108190458.17J4wxDY014247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 35b253d9d238 - main - sh: fix NO_HISTORY build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35b253d9d238c46a710a0cd7ba027ec87ba7c8ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 04:58:59 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=35b253d9d238c46a710a0cd7ba027ec87ba7c8ba commit 35b253d9d238c46a710a0cd7ba027ec87ba7c8ba Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-18 20:40:39 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-08-19 04:57:06 +0000 sh: fix NO_HISTORY build Move code added in b315a7296d2a ("autocomplete commands") to conditionally compiled part under #ifndef NO_HISTORY. Reported by: bdrewery Fixes: b315a7296d2a --- bin/sh/histedit.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 596145790f31..bd82016c33cb 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -565,27 +565,6 @@ bindcmd(int argc, char **argv) return ret; } -#else -#include "error.h" - -int -histcmd(int argc __unused, char **argv __unused) -{ - - error("not compiled with history support"); - /*NOTREACHED*/ - return (0); -} - -int -bindcmd(int argc __unused, char **argv __unused) -{ - - error("not compiled with line editing support"); - return (0); -} -#endif - /* * Comparator function for qsort(). The use of curpos here is to skip * characters that we already know to compare equal (common prefix). @@ -706,3 +685,24 @@ sh_complete(EditLine *sel, int ch __unused) L" \t\n\"\\'`@$><=;|&{(", NULL, NULL, (size_t)100, NULL, &((int) {0}), NULL, NULL, FN_QUOTE_MATCH); } + +#else +#include "error.h" + +int +histcmd(int argc __unused, char **argv __unused) +{ + + error("not compiled with history support"); + /*NOTREACHED*/ + return (0); +} + +int +bindcmd(int argc __unused, char **argv __unused) +{ + + error("not compiled with line editing support"); + return (0); +} +#endif From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:08:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1766965F241; Thu, 19 Aug 2021 07:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gqwpq6zvPz3krT; Thu, 19 Aug 2021 07:08:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D44F021215; Thu, 19 Aug 2021 07:08:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J78ZFN088227; Thu, 19 Aug 2021 07:08:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J78ZnY088226; Thu, 19 Aug 2021 07:08:35 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:08:35 GMT Message-Id: <202108190708.17J78ZnY088226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 17fe7de111dd - stable/13 - pkgbase: Fix building out-of-tree manual pages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17fe7de111dd9df3ab047f9f7a7dcdb670aecc74 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:08:36 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=17fe7de111dd9df3ab047f9f7a7dcdb670aecc74 commit 17fe7de111dd9df3ab047f9f7a7dcdb670aecc74 Author: Jung-uk Kim AuthorDate: 2021-03-16 18:16:10 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-19 07:08:06 +0000 pkgbase: Fix building out-of-tree manual pages c7e6cb9e08d6 introduced MK_MANSPLITPKG but it was not available for building out-of-tree manual pages. For example, x11/nvidia-driver fails with the following error: ===> doc (all) make[3]: "/usr/share/mk/bsd.man.mk" line 53: Malformed conditional (${MK_MANSPLITPKG} == "no") make[3]: Fatal errors encountered -- cannot continue Move the definition from src.opts.mk to bsd.opts.mk to make it visible. (cherry picked from commit 6827435548d257c672f934db5c6ff01012d96995) --- share/mk/bsd.opts.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 88c73cc6bfe4..934f3d36df77 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -76,6 +76,7 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_ZERO \ INSTALL_AS_USER \ PIE \ + MANSPLITPKG \ RETPOLINE \ STALE_STAGED From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:10:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E9C065EDDA; Thu, 19 Aug 2021 07:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqwsF3DBcz3lJK; Thu, 19 Aug 2021 07:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5682E21403; Thu, 19 Aug 2021 07:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7AfNO096795; Thu, 19 Aug 2021 07:10:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7AfhE096793; Thu, 19 Aug 2021 07:10:41 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:10:41 GMT Message-Id: <202108190710.17J7AfhE096793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: c432a007529f - stable/13 - pkgbase: Fix cherry-pick conflict MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c432a007529f8d7315ac30da36fb0ac1128ec977 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:10:41 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c432a007529f8d7315ac30da36fb0ac1128ec977 commit c432a007529f8d7315ac30da36fb0ac1128ec977 Author: Emmanuel Vadot AuthorDate: 2021-08-19 07:09:39 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-19 07:09:39 +0000 pkgbase: Fix cherry-pick conflict 17fe7de111dd was supposed to remove the option from src.opts.mk --- share/mk/src.opts.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 6fb8c6c855a1..f5f582688161 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -208,7 +208,6 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ - MANSPLITPKG \ OFED_EXTRA \ OPENLDAP \ OPENSSL_KTLS \ From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:18:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1487565F926; Thu, 19 Aug 2021 07:18:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gqx2k6sVjz3lF5; Thu, 19 Aug 2021 07:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF7A021499; Thu, 19 Aug 2021 07:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7IsdS001583; Thu, 19 Aug 2021 07:18:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7IseQ001582; Thu, 19 Aug 2021 07:18:54 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:18:54 GMT Message-Id: <202108190718.17J7IseQ001582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: f296898fb797 - stable/13 - Fix a common typo in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f296898fb797e294377a13d0ca8a0b4379ec91be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:18:55 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f296898fb797e294377a13d0ca8a0b4379ec91be commit f296898fb797e294377a13d0ca8a0b4379ec91be Author: Gordon Bergling AuthorDate: 2021-08-14 12:17:48 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:18:35 +0000 Fix a common typo in source code comments - s/aligment/alignment/ (cherry picked from commit a1581cd73594bbbde638859c31226c2c21be1ab3) --- lib/libc/gen/tls.c | 4 ++-- share/man/man9/rman.9 | 4 ++-- sys/arm/allwinner/if_emac.c | 2 +- sys/dev/sound/pci/hda/hdaa.c | 2 +- sys/dev/usb/controller/uhci.c | 2 +- sys/dev/usb/usb_busdma.c | 2 +- sys/i386/i386/locore.s | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 69b87aea52bf..98915ef4ddf7 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -249,9 +249,9 @@ __libc_free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused) * * where: * extra_size is tcbsize - TLS_TCB_SIZE - * post_size is used to adjust TCB to TLS aligment for first version of TLS + * post_size is used to adjust TCB to TLS alignment for first version of TLS * layout and is always 0 for second version. - * pre_size is used to adjust TCB aligment for first version and to adjust + * pre_size is used to adjust TCB alignment for first version and to adjust * TLS alignment for second version. * */ diff --git a/share/man/man9/rman.9 b/share/man/man9/rman.9 index 3faea2a014fc..a5a8c34cde90 100644 --- a/share/man/man9/rman.9 +++ b/share/man/man9/rman.9 @@ -275,7 +275,7 @@ The caller can specify the and .Fa end of an acceptable range, -as well as a boundary restriction and required aligment, +as well as a boundary restriction and required alignment, and the code will attempt to find a free segment which fits. The .Fa start @@ -288,7 +288,7 @@ Therefore, must be \[<=] .Fa end for any allocation to happen. -The aligment requirement +The alignment requirement .Pq if any is specified in .Fa flags . diff --git a/sys/arm/allwinner/if_emac.c b/sys/arm/allwinner/if_emac.c index 73e7e889916a..5110ce2f9fb4 100644 --- a/sys/arm/allwinner/if_emac.c +++ b/sys/arm/allwinner/if_emac.c @@ -409,7 +409,7 @@ emac_rxeof(struct emac_softc *sc, int count) m->m_len = m->m_pkthdr.len = len - ETHER_CRC_LEN; /* - * Emac controller needs strict aligment, so to avoid + * Emac controller needs strict alignment, so to avoid * copying over an entire frame to align, we allocate * a new mbuf and copy ethernet header + IP header to * the new mbuf. The new mbuf is prepended into the diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index 8eeeadce6666..4d872dc88405 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -2191,7 +2191,7 @@ hdaa_channel_getptr(kobj_t obj, void *data) hdaa_unlock(devinfo); /* - * Round to available space and force 128 bytes aligment. + * Round to available space and force 128 bytes alignment. */ ptr %= ch->blksz * ch->blkcnt; ptr &= HDA_BLK_ALIGN; diff --git a/sys/dev/usb/controller/uhci.c b/sys/dev/usb/controller/uhci.c index 59453359deb0..86bfe0b1108a 100644 --- a/sys/dev/usb/controller/uhci.c +++ b/sys/dev/usb/controller/uhci.c @@ -2898,7 +2898,7 @@ uhci_xfer_setup(struct usb_setup_params *parm) * We don't allow alignments of * less than 8 bytes: * - * NOTE: Allocating using an aligment + * NOTE: Allocating using an alignment * of 1 byte has special meaning! */ if (n < 3) { diff --git a/sys/dev/usb/usb_busdma.c b/sys/dev/usb/usb_busdma.c index 26fddaef65b2..4806903fa83a 100644 --- a/sys/dev/usb/usb_busdma.c +++ b/sys/dev/usb/usb_busdma.c @@ -546,7 +546,7 @@ usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg, /* * XXX BUS-DMA workaround - FIXME later: * - * We assume that that the aligment at this point of + * We assume that that the alignment at this point of * the code is greater than or equal to the size and * less than two times the size, so that if we double * the size, the size will be greater than the diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index 2bc751ba8ffc..d350c3abaeaa 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -340,7 +340,7 @@ ENTRY(identify_cpu) testl %eax,%eax jnz try486 - /* NexGen CPU does not have aligment check flag. */ + /* NexGen CPU does not have alignment check flag. */ pushfl movl $0x5555, %eax xorl %edx, %edx From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:27:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F75D65F633; Thu, 19 Aug 2021 07:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxDP6nD4z3ljT; Thu, 19 Aug 2021 07:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D142D214BC; Thu, 19 Aug 2021 07:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7RH9H014518; Thu, 19 Aug 2021 07:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7RHH0014517; Thu, 19 Aug 2021 07:27:17 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:27:17 GMT Message-Id: <202108190727.17J7RHH0014517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ca2e359c02c8 - stable/13 - Fix a common typo in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca2e359c02c83c921bad881ab80232cf51830749 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:27:18 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ca2e359c02c83c921bad881ab80232cf51830749 commit ca2e359c02c83c921bad881ab80232cf51830749 Author: Gordon Bergling AuthorDate: 2021-08-14 11:29:51 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:26:58 +0000 Fix a common typo in a comment - s/enrty/entry/ (cherry picked from commit 86b74b736818a0b025ef520f8a4f570f48741666) --- sys/dev/bxe/bxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index a8aa0a89aae1..9145f11e5bf1 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -17179,7 +17179,7 @@ bxe_init_hw_common(struct bxe_softc *sc) * stay set) * f. If this is VNIC 3 of a port then also init * first_timers_ilt_entry to zero and last_timers_ilt_entry - * to the last enrty in the ILT. + * to the last enrtry in the ILT. * * Notes: * Currently the PF error in the PGLC is non recoverable. From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:27:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9ED8E65FA7D; Thu, 19 Aug 2021 07:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxF243xBz3ljh; Thu, 19 Aug 2021 07:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 745B3213B7; Thu, 19 Aug 2021 07:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7RoiU014664; Thu, 19 Aug 2021 07:27:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7Ro8p014663; Thu, 19 Aug 2021 07:27:50 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:27:50 GMT Message-Id: <202108190727.17J7Ro8p014663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ac7cf0c6364f - stable/13 - Fix a few typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ac7cf0c6364f1ff29a0be34ab579881674074e0b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:27:50 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ac7cf0c6364f1ff29a0be34ab579881674074e0b commit ac7cf0c6364f1ff29a0be34ab579881674074e0b Author: Gordon Bergling AuthorDate: 2021-08-14 08:08:49 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:27:34 +0000 Fix a few typos in source code comments - s/procesing/processing/ (cherry picked from commit 288e553623d3f8ac33baaabc93a4f030689755d2) --- sys/dev/ce/ceddk.c | 4 ++-- usr.bin/indent/lexi.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ce/ceddk.c b/sys/dev/ce/ceddk.c index cca95c891964..569476040a93 100644 --- a/sys/dev/ce/ceddk.c +++ b/sys/dev/ce/ceddk.c @@ -245,7 +245,7 @@ static void TAU32_CALLBACK_TYPE ce_on_receive c->error (c, CE_OVERRUN); } else { CE_DDK_DEBUG (b, c, ("Another receive error: %x\n", error)); - /* Do some procesing */ + /* Do some processing */ } CE_ASSERT (!req->pInternal); @@ -297,7 +297,7 @@ static void TAU32_CALLBACK_TYPE ce_on_transmit } else { CE_DDK_DEBUG (c->board, c, ("Another transmit error: %x\n", error)); - /* Do some procesing */ + /* Do some processing */ } CE_ENQUEUE (c->tx_queue, req); diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c index 1a5938689e26..83178a72b4f6 100644 --- a/usr.bin/indent/lexi.c +++ b/usr.bin/indent/lexi.c @@ -354,7 +354,7 @@ lexi(struct parser_state *state) * then following sign is unary */ state->last_u_d = true; /* will make "int a -1" work */ return (ident); /* the ident is not in the list */ - } /* end of procesing for alpanum character */ + } /* end of processing for alpanum character */ /* Scan a non-alphanumeric token */ From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:28:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB8C665FC1C; Thu, 19 Aug 2021 07:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxFf4RrRz3lk3; Thu, 19 Aug 2021 07:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81FDA214BD; Thu, 19 Aug 2021 07:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7SMmd014814; Thu, 19 Aug 2021 07:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7SMTh014813; Thu, 19 Aug 2021 07:28:22 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:28:22 GMT Message-Id: <202108190728.17J7SMTh014813@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ab4864fba27a - stable/13 - Fix some common typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ab4864fba27a141dba0929afd8432b94ad77e873 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:28:22 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ab4864fba27a141dba0929afd8432b94ad77e873 commit ab4864fba27a141dba0929afd8432b94ad77e873 Author: Gordon Bergling AuthorDate: 2021-08-14 06:55:58 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:28:06 +0000 Fix some common typos in source code comments - s/struture/structure/ - s/structre/structure/ (cherry picked from commit 17db4b52fb41aeabeb945c68c1b5edd4db4eac31) --- sys/dev/bce/if_bce.c | 4 ++-- sys/dev/drm2/drm_platform.c | 2 +- sys/dev/isci/scil/intel_ata.h | 2 +- sys/dev/isci/scil/sci_overview.h | 2 +- sys/dev/liquidio/base/lio_device.h | 2 +- sys/dev/pms/RefTisa/sallsdk/api/sa.h | 2 +- sys/dev/pms/RefTisa/sallsdk/spc/sallist.h | 2 +- sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c | 2 +- sys/dev/pms/freebsd/driver/common/lxcommon.h | 2 +- sys/sys/jail.h | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index d6c5a2bf091f..869d8f9fc40e 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -3163,7 +3163,7 @@ bce_init_media(struct bce_softc *sc) /****************************************************************************/ /* Free any DMA memory owned by the driver. */ /* */ -/* Scans through each data structre that requires DMA memory and frees */ +/* Scans through each data structure that requires DMA memory and frees */ /* the memory if allocated. */ /* */ /* Returns: */ @@ -5553,7 +5553,7 @@ bce_init_tx_chain(struct bce_softc *sc) DBRUN(sc->tx_full_count = 0); /* - * The NetXtreme II supports a linked-list structre called + * The NetXtreme II supports a linked-list structure called * a Buffer Descriptor Chain (or BD chain). A BD chain * consists of a series of 1 or more chain pages, each of which * consists of a fixed number of BD entries. diff --git a/sys/dev/drm2/drm_platform.c b/sys/dev/drm2/drm_platform.c index a8972b44f5f1..17f3367719e2 100644 --- a/sys/dev/drm2/drm_platform.c +++ b/sys/dev/drm2/drm_platform.c @@ -107,7 +107,7 @@ static struct drm_bus drm_platform_bus = { /** * Register. * - * \param platdev - Platform device struture + * \param platdev - Platform device structure * \return zero on success or a negative number on failure. * * Attempt to gets inter module "drm" information. If we are first diff --git a/sys/dev/isci/scil/intel_ata.h b/sys/dev/isci/scil/intel_ata.h index 86f584b35d61..e213d0efcb06 100644 --- a/sys/dev/isci/scil/intel_ata.h +++ b/sys/dev/isci/scil/intel_ata.h @@ -244,7 +244,7 @@ * * The following constants define bit masks utilized to determine if a * feature is supported/enabled or if a bit is simply set inside of the - * IDENTIFY DEVICE data structre. + * IDENTIFY DEVICE data structure. */ /*@{*/ #define ATA_IDENTIFY_REMOVABLE_MEDIA_ENABLE 0x0080 diff --git a/sys/dev/isci/scil/sci_overview.h b/sys/dev/isci/scil/sci_overview.h index 3cde341efb1f..cba4f8351fbd 100644 --- a/sys/dev/isci/scil/sci_overview.h +++ b/sys/dev/isci/scil/sci_overview.h @@ -216,7 +216,7 @@ associate one object to another. An SCI object can be made to have an association to another SCI object. Additionally, an SCI object can be made to have an association to a non-SCI based object. For example, an SCI Framework library can have it's association set to an operating system -specific adapter/device driver structre. +specific adapter/device driver structure. Simply put, the association that an object has is a handle (i.e. a void pointer) to a user structure. This enables the user of the SCI object to diff --git a/sys/dev/liquidio/base/lio_device.h b/sys/dev/liquidio/base/lio_device.h index d5ba3361b2fc..de07f604fd9c 100644 --- a/sys/dev/liquidio/base/lio_device.h +++ b/sys/dev/liquidio/base/lio_device.h @@ -799,7 +799,7 @@ void *lio_get_config_info(struct octeon_device *oct, uint16_t card_type); /* * Gets the octeon device configuration - * @return - pointer to the octeon configuration struture + * @return - pointer to the octeon configuration structure */ struct lio_config *lio_get_conf(struct octeon_device *oct); diff --git a/sys/dev/pms/RefTisa/sallsdk/api/sa.h b/sys/dev/pms/RefTisa/sallsdk/api/sa.h index e13db5390f4e..e702dd4fb23a 100644 --- a/sys/dev/pms/RefTisa/sallsdk/api/sa.h +++ b/sys/dev/pms/RefTisa/sallsdk/api/sa.h @@ -1660,7 +1660,7 @@ typedef struct agsaContext_s void *sdkData; /**< Pointer-sized value used internally by the LL Layer */ } agsaContext_t; -/** \brief hold points to global data strutures used by the LL and OS Layers +/** \brief hold points to global data structures used by the LL and OS Layers * * The agsaRoot_t data structure is used to hold pointer-sized values for * internal use by the LL and OS Layers. It is intended that the diff --git a/sys/dev/pms/RefTisa/sallsdk/spc/sallist.h b/sys/dev/pms/RefTisa/sallsdk/spc/sallist.h index 0203a64f6f65..8ed9fb325445 100644 --- a/sys/dev/pms/RefTisa/sallsdk/spc/sallist.h +++ b/sys/dev/pms/RefTisa/sallsdk/spc/sallist.h @@ -40,7 +40,7 @@ /** \brief Structure of Link Data * * link data, need to be included at the start (offset 0) - * of any strutures that are to be stored in the link list + * of any structures that are to be stored in the link list * */ typedef struct _SALINK diff --git a/sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c b/sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c index 89ac376caaff..eeaac814d1c2 100644 --- a/sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c +++ b/sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c @@ -2496,7 +2496,7 @@ tdsaSharedMemCalculate( #endif #ifdef TD_DISCOVER - /* adding expander data strutures */ + /* adding expander data structures */ tdSharedMem->tdSharedCachedMem1.singleElementLength += sizeof(tdsaExpander_t) * MaxTargets; #endif diff --git a/sys/dev/pms/freebsd/driver/common/lxcommon.h b/sys/dev/pms/freebsd/driver/common/lxcommon.h index bbe33cf1fef7..5968ecba8021 100644 --- a/sys/dev/pms/freebsd/driver/common/lxcommon.h +++ b/sys/dev/pms/freebsd/driver/common/lxcommon.h @@ -614,7 +614,7 @@ bit8 *data; //buffer /* ** link data, need to be included at the start (offset 0) -** of any strutures that are to be stored in the link list +** of any structures that are to be stored in the link list */ typedef struct _LINK_NODE { diff --git a/sys/sys/jail.h b/sys/sys/jail.h index c9d4c65e4d9e..f863a523b917 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -148,7 +148,7 @@ struct prison_racct; /* * This structure describes a prison. It is pointed to by all struct * ucreds's of the inmates. pr_ref keeps track of them and is used to - * delete the struture when the last inmate is dead. + * delete the structure when the last inmate is dead. * * Lock key: * (a) allprison_lock From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:28:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4983665FD8C; Thu, 19 Aug 2021 07:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxG81bXYz3ln1; Thu, 19 Aug 2021 07:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE21214BE; Thu, 19 Aug 2021 07:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7SmkU014953; Thu, 19 Aug 2021 07:28:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7SmQF014952; Thu, 19 Aug 2021 07:28:48 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:28:48 GMT Message-Id: <202108190728.17J7SmQF014952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 7aa0f2904567 - stable/13 - Fix a common typo in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7aa0f29045671e42aa19992d45c0d7bd1ddbe96d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:28:48 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7aa0f29045671e42aa19992d45c0d7bd1ddbe96d commit 7aa0f29045671e42aa19992d45c0d7bd1ddbe96d Author: Gordon Bergling AuthorDate: 2021-08-14 12:08:46 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:28:34 +0000 Fix a common typo in source code comments - s/definitons/definitions/ (cherry picked from commit 1da11b8ac3474817f38330e272f50553f2ef21a4) --- sys/cam/scsi/scsi_da.c | 2 +- sys/mips/include/cpuregs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index c13b51921745..b281dbfd4ee1 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -4469,7 +4469,7 @@ dazonedone(struct cam_periph *periph, union ccb *ccb) /* * NOTE: we're mapping the values here directly * from the SCSI/ATA bit definitions to the bio.h - * definitons. There is also a warning in + * definitions. There is also a warning in * disk_zone.h, but the impact is that if * additional values are added in the SCSI/ATA * specs these will be visible to consumers of diff --git a/sys/mips/include/cpuregs.h b/sys/mips/include/cpuregs.h index c61724564a59..2b5a0ce554dc 100644 --- a/sys/mips/include/cpuregs.h +++ b/sys/mips/include/cpuregs.h @@ -222,7 +222,7 @@ #define MIPS_SR_INT_MASK 0x0000ff00 /* - * R4000 status register bit definitons, + * R4000 status register bit definitions, * where different from r2000/r3000. */ #define MIPS_SR_XX 0x80000000 From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:29:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FA5F65FB4E; Thu, 19 Aug 2021 07:29:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxGg3jw4z3m5l; Thu, 19 Aug 2021 07:29:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6841721460; Thu, 19 Aug 2021 07:29:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7TFJf015098; Thu, 19 Aug 2021 07:29:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7TFOI015097; Thu, 19 Aug 2021 07:29:15 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:29:15 GMT Message-Id: <202108190729.17J7TFOI015097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: df8242497082 - stable/13 - md5(1): Fix a typo in the manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df82424970828bc91fa1f9a299bb3b17fd4b9003 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:29:15 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=df82424970828bc91fa1f9a299bb3b17fd4b9003 commit df82424970828bc91fa1f9a299bb3b17fd4b9003 Author: Gordon Bergling AuthorDate: 2021-08-14 12:48:39 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:29:01 +0000 md5(1): Fix a typo in the manual page - s/compatibilty/compatibility/ (cherry picked from commit 0d71cea832f4b6e1db9d28d3ca393682d577b43e) --- sbin/md5/md5.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/md5/md5.1 b/sbin/md5/md5.1 index 2b1da85c080f..ddda24196d9e 100644 --- a/sbin/md5/md5.1 +++ b/sbin/md5/md5.1 @@ -164,7 +164,7 @@ d80bf36c332dc0fdc479366ec3fa44cd /etc/rc.conf .Pd The .Nm -sum -variants put 2 blank characters between hash and file name for full compatibilty +variants put 2 blank characters between hash and file name for full compatibility with the coreutils versions of these commands. .Ed .Pp From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:29:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8CEC65FDB2; Thu, 19 Aug 2021 07:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxHB4qkJz3m0B; Thu, 19 Aug 2021 07:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E832214BF; Thu, 19 Aug 2021 07:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7Tggd015243; Thu, 19 Aug 2021 07:29:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7TgTV015242; Thu, 19 Aug 2021 07:29:42 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:29:42 GMT Message-Id: <202108190729.17J7TgTV015242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: a6bc738260c2 - stable/13 - Fix a few typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a6bc738260c27905af29eaf81cc3e50744a54cda Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:29:42 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a6bc738260c27905af29eaf81cc3e50744a54cda commit a6bc738260c27905af29eaf81cc3e50744a54cda Author: Gordon Bergling AuthorDate: 2021-08-14 07:39:17 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:29:25 +0000 Fix a few typos in source code comments - s/posbile/possible/ (cherry picked from commit 34f620f1d0cfa67f5987452ac3fdd8c113b6b099) --- sys/cam/scsi/scsi_all.c | 2 +- sys/netgraph/ng_base.c | 2 +- tools/regression/netinet/ipsockopt/ipsockopt.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 1b60003a4ac7..a84c5b8d6c22 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -9150,7 +9150,7 @@ scsi_devid_match(uint8_t *lhs, size_t lhs_len, uint8_t *rhs, size_t rhs_len) rhs_end = rhs + rhs_len; /* - * rhs_last and lhs_last are the last posible position of a valid + * rhs_last and lhs_last are the last possible position of a valid * descriptor assuming it had a zero length identifier. We use * these variables to insure we can safely dereference the length * field in our loop termination tests. diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index ae179cf13a45..ba60acb53502 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -3454,7 +3454,7 @@ ngthread(void *arg) /* * XXX - * It's posible that a debugging NG_NODE_REF may need + * It's possible that a debugging NG_NODE_REF may need * to be outside the mutex zone */ static void diff --git a/tools/regression/netinet/ipsockopt/ipsockopt.c b/tools/regression/netinet/ipsockopt/ipsockopt.c index d03ddf652f42..16805b9e6412 100644 --- a/tools/regression/netinet/ipsockopt/ipsockopt.c +++ b/tools/regression/netinet/ipsockopt/ipsockopt.c @@ -163,7 +163,7 @@ test_ip_options(int sock, const char *socktypename) "returned %d bytes of data", socktypename, len); /* - * One posible failure mode is that the call succeeds but neglects to + * One possible failure mode is that the call succeeds but neglects to * copy out the data. */ if (test_options[0] == TEST_MAGIC) From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:30:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0248065FE26; Thu, 19 Aug 2021 07:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxHd6T7bz3m1Z; Thu, 19 Aug 2021 07:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C703A20DF6; Thu, 19 Aug 2021 07:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7U5Xq017790; Thu, 19 Aug 2021 07:30:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7U57T017787; Thu, 19 Aug 2021 07:30:05 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:30:05 GMT Message-Id: <202108190730.17J7U57T017787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 337c9718387d - stable/13 - Fix a few typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 337c9718387df72af2e30175c0b9aeddc04117df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:30:06 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=337c9718387df72af2e30175c0b9aeddc04117df commit 337c9718387df72af2e30175c0b9aeddc04117df Author: Gordon Bergling AuthorDate: 2021-08-14 07:06:09 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:29:50 +0000 Fix a few typos in source code comments - s/becase/because/ (cherry picked from commit fa7a635f7ee277960eb37b9102a3aef76b36b825) --- stand/i386/libfirewire/dconsole.c | 2 +- sys/vm/vm_pageout.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/i386/libfirewire/dconsole.c b/stand/i386/libfirewire/dconsole.c index 1528fafdf787..338ed26aa417 100644 --- a/stand/i386/libfirewire/dconsole.c +++ b/stand/i386/libfirewire/dconsole.c @@ -47,7 +47,7 @@ static int dcons_started = 0; static struct dcons_softc sc[DCONS_NPORT]; uint32_t dcons_paddr; -/* The buffer must be allocated in BSS becase: +/* The buffer must be allocated in BSS because: * - The dcons driver in the kernel is initialized before VM/pmap is * initialized, so that the buffer must be allocate in the region * that is mapped at the very early boot state. diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 9a0b295569e2..ff0c90843037 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -539,7 +539,7 @@ vm_pageout_flush(vm_page_t *mc, int count, int flags, int mreq, int *prunlen, * the PQ_UNSWAPPABLE holding queue. This is an * optimization that prevents the page daemon from * wasting CPU cycles on pages that cannot be reclaimed - * becase no swap device is configured. + * because no swap device is configured. * * Otherwise, reactivate the page so that it doesn't * clog the laundry and inactive queues. (We will try From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:31:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6D0D660000; Thu, 19 Aug 2021 07:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxKR4G2Cz3mLn; Thu, 19 Aug 2021 07:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A94F21477; Thu, 19 Aug 2021 07:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7VdUi026891; Thu, 19 Aug 2021 07:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7Vd9O026890; Thu, 19 Aug 2021 07:31:39 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:31:39 GMT Message-Id: <202108190731.17J7Vd9O026890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: b26056a6bd68 - stable/12 - Fix a few typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b26056a6bd68fab3e083d0fa1ad8a49de787b20e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:31:39 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b26056a6bd68fab3e083d0fa1ad8a49de787b20e commit b26056a6bd68fab3e083d0fa1ad8a49de787b20e Author: Gordon Bergling AuthorDate: 2021-08-14 07:06:09 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:31:24 +0000 Fix a few typos in source code comments - s/becase/because/ (cherry picked from commit fa7a635f7ee277960eb37b9102a3aef76b36b825) --- stand/i386/libfirewire/dconsole.c | 2 +- sys/vm/vm_pageout.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/i386/libfirewire/dconsole.c b/stand/i386/libfirewire/dconsole.c index 1528fafdf787..338ed26aa417 100644 --- a/stand/i386/libfirewire/dconsole.c +++ b/stand/i386/libfirewire/dconsole.c @@ -47,7 +47,7 @@ static int dcons_started = 0; static struct dcons_softc sc[DCONS_NPORT]; uint32_t dcons_paddr; -/* The buffer must be allocated in BSS becase: +/* The buffer must be allocated in BSS because: * - The dcons driver in the kernel is initialized before VM/pmap is * initialized, so that the buffer must be allocate in the region * that is mapped at the very early boot state. diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index fc7219d868bb..d38f3d7d5946 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -509,7 +509,7 @@ vm_pageout_flush(vm_page_t *mc, int count, int flags, int mreq, int *prunlen, * the PQ_UNSWAPPABLE holding queue. This is an * optimization that prevents the page daemon from * wasting CPU cycles on pages that cannot be reclaimed - * becase no swap device is configured. + * because no swap device is configured. * * Otherwise, reactivate the page so that it doesn't * clog the laundry and inactive queues. (We will try From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:32:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BEC665FFB2; Thu, 19 Aug 2021 07:32:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxKz0q2Zz3mCw; Thu, 19 Aug 2021 07:32:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 044D4214DD; Thu, 19 Aug 2021 07:32:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7W6UF027903; Thu, 19 Aug 2021 07:32:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7W6Dp027902; Thu, 19 Aug 2021 07:32:06 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:32:06 GMT Message-Id: <202108190732.17J7W6Dp027902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: a9ec80d82360 - stable/12 - Fix a few typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a9ec80d82360e766b34fad4905016c1e30ea03d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:32:07 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a9ec80d82360e766b34fad4905016c1e30ea03d9 commit a9ec80d82360e766b34fad4905016c1e30ea03d9 Author: Gordon Bergling AuthorDate: 2021-08-14 07:39:17 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:31:53 +0000 Fix a few typos in source code comments - s/posbile/possible/ (cherry picked from commit 34f620f1d0cfa67f5987452ac3fdd8c113b6b099) --- sys/cam/scsi/scsi_all.c | 2 +- sys/netgraph/ng_base.c | 2 +- tools/regression/netinet/ipsockopt/ipsockopt.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index cc114ace1d75..6c8dec7cc235 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -9153,7 +9153,7 @@ scsi_devid_match(uint8_t *lhs, size_t lhs_len, uint8_t *rhs, size_t rhs_len) rhs_end = rhs + rhs_len; /* - * rhs_last and lhs_last are the last posible position of a valid + * rhs_last and lhs_last are the last possible position of a valid * descriptor assuming it had a zero length identifier. We use * these variables to insure we can safely dereference the length * field in our loop termination tests. diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index f7c2cdb9afb0..13dd44cd4f4a 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -3448,7 +3448,7 @@ ngthread(void *arg) /* * XXX - * It's posible that a debugging NG_NODE_REF may need + * It's possible that a debugging NG_NODE_REF may need * to be outside the mutex zone */ static void diff --git a/tools/regression/netinet/ipsockopt/ipsockopt.c b/tools/regression/netinet/ipsockopt/ipsockopt.c index d03ddf652f42..16805b9e6412 100644 --- a/tools/regression/netinet/ipsockopt/ipsockopt.c +++ b/tools/regression/netinet/ipsockopt/ipsockopt.c @@ -163,7 +163,7 @@ test_ip_options(int sock, const char *socktypename) "returned %d bytes of data", socktypename, len); /* - * One posible failure mode is that the call succeeds but neglects to + * One possible failure mode is that the call succeeds but neglects to * copy out the data. */ if (test_options[0] == TEST_MAGIC) From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:33:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 686E66600A0; Thu, 19 Aug 2021 07:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxMh2Npvz3mSD; Thu, 19 Aug 2021 07:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A30621A0C; Thu, 19 Aug 2021 07:33:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7Xawm028173; Thu, 19 Aug 2021 07:33:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7XaV7028172; Thu, 19 Aug 2021 07:33:36 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:33:36 GMT Message-Id: <202108190733.17J7XaV7028172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ccd9a87e56ff - stable/12 - md5(1): Fix a typo in the manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ccd9a87e56ff3333435a9b5b9a50b5d60f1691d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:33:36 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ccd9a87e56ff3333435a9b5b9a50b5d60f1691d9 commit ccd9a87e56ff3333435a9b5b9a50b5d60f1691d9 Author: Gordon Bergling AuthorDate: 2021-08-14 12:48:39 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:33:21 +0000 md5(1): Fix a typo in the manual page - s/compatibilty/compatibility/ (cherry picked from commit 0d71cea832f4b6e1db9d28d3ca393682d577b43e) --- sbin/md5/md5.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/md5/md5.1 b/sbin/md5/md5.1 index f91e0b759dc7..8cef5650b7c1 100644 --- a/sbin/md5/md5.1 +++ b/sbin/md5/md5.1 @@ -180,7 +180,7 @@ d80bf36c332dc0fdc479366ec3fa44cd /etc/rc.conf .Pd The .Nm -sum -variants put 2 blank characters between hash and file name for full compatibilty +variants put 2 blank characters between hash and file name for full compatibility with the coreutils versions of these commands. .Ed .Pp From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:34:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A19B65FF29; Thu, 19 Aug 2021 07:34:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxNK0gqLz3mSR; Thu, 19 Aug 2021 07:34:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0017C217C3; Thu, 19 Aug 2021 07:34:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7Y8Qo028318; Thu, 19 Aug 2021 07:34:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7Y8Yt028317; Thu, 19 Aug 2021 07:34:08 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:34:08 GMT Message-Id: <202108190734.17J7Y8Yt028317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ddab34da3d22 - stable/12 - Fix a common typo in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ddab34da3d22827fcb2d37c28f1a8862b7895905 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:34:09 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ddab34da3d22827fcb2d37c28f1a8862b7895905 commit ddab34da3d22827fcb2d37c28f1a8862b7895905 Author: Gordon Bergling AuthorDate: 2021-08-14 12:08:46 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:33:54 +0000 Fix a common typo in source code comments - s/definitons/definitions/ (cherry picked from commit 1da11b8ac3474817f38330e272f50553f2ef21a4) --- sys/cam/scsi/scsi_da.c | 2 +- sys/mips/include/cpuregs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 1e9112e815d4..4f773b75498b 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -4374,7 +4374,7 @@ dazonedone(struct cam_periph *periph, union ccb *ccb) /* * NOTE: we're mapping the values here directly * from the SCSI/ATA bit definitions to the bio.h - * definitons. There is also a warning in + * definitions. There is also a warning in * disk_zone.h, but the impact is that if * additional values are added in the SCSI/ATA * specs these will be visible to consumers of diff --git a/sys/mips/include/cpuregs.h b/sys/mips/include/cpuregs.h index 096f322d672d..830b1aed412c 100644 --- a/sys/mips/include/cpuregs.h +++ b/sys/mips/include/cpuregs.h @@ -222,7 +222,7 @@ #define MIPS_SR_INT_MASK 0x0000ff00 /* - * R4000 status register bit definitons, + * R4000 status register bit definitions, * where different from r2000/r3000. */ #define MIPS_SR_XX 0x80000000 From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:35:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 526996600BD; Thu, 19 Aug 2021 07:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxPj1rjzz3mYy; Thu, 19 Aug 2021 07:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27C3D214E8; Thu, 19 Aug 2021 07:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7ZLHq028528; Thu, 19 Aug 2021 07:35:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7ZLjj028527; Thu, 19 Aug 2021 07:35:21 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:35:21 GMT Message-Id: <202108190735.17J7ZLjj028527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 54e111ec0c74 - stable/12 - Fix some common typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 54e111ec0c74dc7ae50758aaaa8d34571a3bc3b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:35:21 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=54e111ec0c74dc7ae50758aaaa8d34571a3bc3b0 commit 54e111ec0c74dc7ae50758aaaa8d34571a3bc3b0 Author: Gordon Bergling AuthorDate: 2021-08-14 06:55:58 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:35:05 +0000 Fix some common typos in source code comments - s/struture/structure/ - s/structre/structure/ (cherry picked from commit 17db4b52fb41aeabeb945c68c1b5edd4db4eac31) --- sys/dev/bce/if_bce.c | 4 ++-- sys/dev/drm2/drm_platform.c | 2 +- sys/dev/isci/scil/intel_ata.h | 2 +- sys/dev/isci/scil/sci_overview.h | 2 +- sys/dev/liquidio/base/lio_device.h | 2 +- sys/dev/pms/RefTisa/sallsdk/api/sa.h | 2 +- sys/dev/pms/RefTisa/sallsdk/spc/sallist.h | 2 +- sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c | 2 +- sys/dev/pms/freebsd/driver/common/lxcommon.h | 2 +- sys/sys/jail.h | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 3d5c0742580c..5277e8f59cc6 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -3227,7 +3227,7 @@ bce_init_media(struct bce_softc *sc) /****************************************************************************/ /* Free any DMA memory owned by the driver. */ /* */ -/* Scans through each data structre that requires DMA memory and frees */ +/* Scans through each data structure that requires DMA memory and frees */ /* the memory if allocated. */ /* */ /* Returns: */ @@ -5657,7 +5657,7 @@ bce_init_tx_chain(struct bce_softc *sc) DBRUN(sc->tx_full_count = 0); /* - * The NetXtreme II supports a linked-list structre called + * The NetXtreme II supports a linked-list structure called * a Buffer Descriptor Chain (or BD chain). A BD chain * consists of a series of 1 or more chain pages, each of which * consists of a fixed number of BD entries. diff --git a/sys/dev/drm2/drm_platform.c b/sys/dev/drm2/drm_platform.c index a8972b44f5f1..17f3367719e2 100644 --- a/sys/dev/drm2/drm_platform.c +++ b/sys/dev/drm2/drm_platform.c @@ -107,7 +107,7 @@ static struct drm_bus drm_platform_bus = { /** * Register. * - * \param platdev - Platform device struture + * \param platdev - Platform device structure * \return zero on success or a negative number on failure. * * Attempt to gets inter module "drm" information. If we are first diff --git a/sys/dev/isci/scil/intel_ata.h b/sys/dev/isci/scil/intel_ata.h index 86f584b35d61..e213d0efcb06 100644 --- a/sys/dev/isci/scil/intel_ata.h +++ b/sys/dev/isci/scil/intel_ata.h @@ -244,7 +244,7 @@ * * The following constants define bit masks utilized to determine if a * feature is supported/enabled or if a bit is simply set inside of the - * IDENTIFY DEVICE data structre. + * IDENTIFY DEVICE data structure. */ /*@{*/ #define ATA_IDENTIFY_REMOVABLE_MEDIA_ENABLE 0x0080 diff --git a/sys/dev/isci/scil/sci_overview.h b/sys/dev/isci/scil/sci_overview.h index 3cde341efb1f..cba4f8351fbd 100644 --- a/sys/dev/isci/scil/sci_overview.h +++ b/sys/dev/isci/scil/sci_overview.h @@ -216,7 +216,7 @@ associate one object to another. An SCI object can be made to have an association to another SCI object. Additionally, an SCI object can be made to have an association to a non-SCI based object. For example, an SCI Framework library can have it's association set to an operating system -specific adapter/device driver structre. +specific adapter/device driver structure. Simply put, the association that an object has is a handle (i.e. a void pointer) to a user structure. This enables the user of the SCI object to diff --git a/sys/dev/liquidio/base/lio_device.h b/sys/dev/liquidio/base/lio_device.h index d5ba3361b2fc..de07f604fd9c 100644 --- a/sys/dev/liquidio/base/lio_device.h +++ b/sys/dev/liquidio/base/lio_device.h @@ -799,7 +799,7 @@ void *lio_get_config_info(struct octeon_device *oct, uint16_t card_type); /* * Gets the octeon device configuration - * @return - pointer to the octeon configuration struture + * @return - pointer to the octeon configuration structure */ struct lio_config *lio_get_conf(struct octeon_device *oct); diff --git a/sys/dev/pms/RefTisa/sallsdk/api/sa.h b/sys/dev/pms/RefTisa/sallsdk/api/sa.h index e13db5390f4e..e702dd4fb23a 100644 --- a/sys/dev/pms/RefTisa/sallsdk/api/sa.h +++ b/sys/dev/pms/RefTisa/sallsdk/api/sa.h @@ -1660,7 +1660,7 @@ typedef struct agsaContext_s void *sdkData; /**< Pointer-sized value used internally by the LL Layer */ } agsaContext_t; -/** \brief hold points to global data strutures used by the LL and OS Layers +/** \brief hold points to global data structures used by the LL and OS Layers * * The agsaRoot_t data structure is used to hold pointer-sized values for * internal use by the LL and OS Layers. It is intended that the diff --git a/sys/dev/pms/RefTisa/sallsdk/spc/sallist.h b/sys/dev/pms/RefTisa/sallsdk/spc/sallist.h index 0203a64f6f65..8ed9fb325445 100644 --- a/sys/dev/pms/RefTisa/sallsdk/spc/sallist.h +++ b/sys/dev/pms/RefTisa/sallsdk/spc/sallist.h @@ -40,7 +40,7 @@ /** \brief Structure of Link Data * * link data, need to be included at the start (offset 0) - * of any strutures that are to be stored in the link list + * of any structures that are to be stored in the link list * */ typedef struct _SALINK diff --git a/sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c b/sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c index 89ac376caaff..eeaac814d1c2 100644 --- a/sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c +++ b/sys/dev/pms/RefTisa/tisa/sassata/common/tdinit.c @@ -2496,7 +2496,7 @@ tdsaSharedMemCalculate( #endif #ifdef TD_DISCOVER - /* adding expander data strutures */ + /* adding expander data structures */ tdSharedMem->tdSharedCachedMem1.singleElementLength += sizeof(tdsaExpander_t) * MaxTargets; #endif diff --git a/sys/dev/pms/freebsd/driver/common/lxcommon.h b/sys/dev/pms/freebsd/driver/common/lxcommon.h index 71ce230c3812..3b12822fc8d1 100644 --- a/sys/dev/pms/freebsd/driver/common/lxcommon.h +++ b/sys/dev/pms/freebsd/driver/common/lxcommon.h @@ -614,7 +614,7 @@ bit8 *data; //buffer /* ** link data, need to be included at the start (offset 0) -** of any strutures that are to be stored in the link list +** of any structures that are to be stored in the link list */ typedef struct _LINK_NODE { diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 8baf784d6b6d..590fb4488262 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -146,7 +146,7 @@ struct prison_racct; /* * This structure describes a prison. It is pointed to by all struct * ucreds's of the inmates. pr_ref keeps track of them and is used to - * delete the struture when the last inmate is dead. + * delete the structure when the last inmate is dead. * * Lock key: * (a) allprison_lock From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:35:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C025B6602B3; Thu, 19 Aug 2021 07:35:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxQD4zNJz3mx4; Thu, 19 Aug 2021 07:35:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92829214E9; Thu, 19 Aug 2021 07:35:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7ZmnZ028667; Thu, 19 Aug 2021 07:35:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7Zm6p028666; Thu, 19 Aug 2021 07:35:48 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:35:48 GMT Message-Id: <202108190735.17J7Zm6p028666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 85639326a98a - stable/12 - Fix a few typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 85639326a98a34f818c01472ccfdb06b8473ede8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:35:48 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=85639326a98a34f818c01472ccfdb06b8473ede8 commit 85639326a98a34f818c01472ccfdb06b8473ede8 Author: Gordon Bergling AuthorDate: 2021-08-14 08:08:49 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:35:33 +0000 Fix a few typos in source code comments - s/procesing/processing/ (cherry picked from commit 288e553623d3f8ac33baaabc93a4f030689755d2) --- sys/dev/ce/ceddk.c | 4 ++-- usr.bin/indent/lexi.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ce/ceddk.c b/sys/dev/ce/ceddk.c index 96419ee086d3..9934cbfb6b99 100644 --- a/sys/dev/ce/ceddk.c +++ b/sys/dev/ce/ceddk.c @@ -245,7 +245,7 @@ static void TAU32_CALLBACK_TYPE ce_on_receive c->error (c, CE_OVERRUN); } else { CE_DDK_DEBUG (b, c, ("Another receive error: %x\n", error)); - /* Do some procesing */ + /* Do some processing */ } CE_ASSERT (!req->pInternal); @@ -297,7 +297,7 @@ static void TAU32_CALLBACK_TYPE ce_on_transmit } else { CE_DDK_DEBUG (c->board, c, ("Another transmit error: %x\n", error)); - /* Do some procesing */ + /* Do some processing */ } CE_ENQUEUE (c->tx_queue, req); diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c index 1a5938689e26..83178a72b4f6 100644 --- a/usr.bin/indent/lexi.c +++ b/usr.bin/indent/lexi.c @@ -354,7 +354,7 @@ lexi(struct parser_state *state) * then following sign is unary */ state->last_u_d = true; /* will make "int a -1" work */ return (ident); /* the ident is not in the list */ - } /* end of procesing for alpanum character */ + } /* end of processing for alpanum character */ /* Scan a non-alphanumeric token */ From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:36:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 247D36602C0; Thu, 19 Aug 2021 07:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxQp0Tg4z3nBD; Thu, 19 Aug 2021 07:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECBFD216E8; Thu, 19 Aug 2021 07:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7aHJo028812; Thu, 19 Aug 2021 07:36:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7aHO8028811; Thu, 19 Aug 2021 07:36:17 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:36:17 GMT Message-Id: <202108190736.17J7aHO8028811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 2971cf09c819 - stable/12 - Fix a common typo in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2971cf09c819e19a4a664b08e2b548f0b6ea475f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:36:18 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2971cf09c819e19a4a664b08e2b548f0b6ea475f commit 2971cf09c819e19a4a664b08e2b548f0b6ea475f Author: Gordon Bergling AuthorDate: 2021-08-14 11:29:51 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:36:02 +0000 Fix a common typo in a comment - s/enrty/entry/ (cherry picked from commit 86b74b736818a0b025ef520f8a4f570f48741666) --- sys/dev/bxe/bxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index f66cf8239571..70f070389de9 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -17275,7 +17275,7 @@ bxe_init_hw_common(struct bxe_softc *sc) * stay set) * f. If this is VNIC 3 of a port then also init * first_timers_ilt_entry to zero and last_timers_ilt_entry - * to the last enrty in the ILT. + * to the last enrtry in the ILT. * * Notes: * Currently the PF error in the PGLC is non recoverable. From owner-dev-commits-src-all@freebsd.org Thu Aug 19 07:36:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E32FD6600F0; Thu, 19 Aug 2021 07:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqxRL62DSz3nFZ; Thu, 19 Aug 2021 07:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7BCF216E9; Thu, 19 Aug 2021 07:36:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J7aknn028957; Thu, 19 Aug 2021 07:36:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J7akvx028956; Thu, 19 Aug 2021 07:36:46 GMT (envelope-from git) Date: Thu, 19 Aug 2021 07:36:46 GMT Message-Id: <202108190736.17J7akvx028956@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 535182ea0f95 - stable/12 - Fix a common typo in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 535182ea0f95b944f7e5d2337373b2a22ae3b2b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 07:36:47 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=535182ea0f95b944f7e5d2337373b2a22ae3b2b1 commit 535182ea0f95b944f7e5d2337373b2a22ae3b2b1 Author: Gordon Bergling AuthorDate: 2021-08-14 12:17:48 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 07:36:32 +0000 Fix a common typo in source code comments - s/aligment/alignment/ (cherry picked from commit a1581cd73594bbbde638859c31226c2c21be1ab3) --- lib/libc/gen/tls.c | 4 ++-- share/man/man9/rman.9 | 4 ++-- sys/arm/allwinner/if_emac.c | 2 +- sys/dev/sound/pci/hda/hdaa.c | 2 +- sys/dev/usb/controller/uhci.c | 2 +- sys/dev/usb/usb_busdma.c | 2 +- sys/i386/i386/locore.s | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index d1cab7a504e1..bb6f24774a7c 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -243,9 +243,9 @@ __libc_free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused) * * where: * extra_size is tcbsize - TLS_TCB_SIZE - * post_size is used to adjust TCB to TLS aligment for first version of TLS + * post_size is used to adjust TCB to TLS alignment for first version of TLS * layout and is always 0 for second version. - * pre_size is used to adjust TCB aligment for first version and to adjust + * pre_size is used to adjust TCB alignment for first version and to adjust * TLS alignment for second version. * */ diff --git a/share/man/man9/rman.9 b/share/man/man9/rman.9 index 3e03c05f9088..9d954fdba22f 100644 --- a/share/man/man9/rman.9 +++ b/share/man/man9/rman.9 @@ -275,7 +275,7 @@ The caller can specify the and .Fa end of an acceptable range, -as well as a boundary restriction and required aligment, +as well as a boundary restriction and required alignment, and the code will attempt to find a free segment which fits. The .Fa start @@ -288,7 +288,7 @@ Therefore, must be \[<=] .Fa end for any allocation to happen. -The aligment requirement +The alignment requirement .Pq if any is specified in .Fa flags . diff --git a/sys/arm/allwinner/if_emac.c b/sys/arm/allwinner/if_emac.c index 0b19783fb58b..bd6d0c752ded 100644 --- a/sys/arm/allwinner/if_emac.c +++ b/sys/arm/allwinner/if_emac.c @@ -408,7 +408,7 @@ emac_rxeof(struct emac_softc *sc, int count) m->m_len = m->m_pkthdr.len = len - ETHER_CRC_LEN; /* - * Emac controller needs strict aligment, so to avoid + * Emac controller needs strict alignment, so to avoid * copying over an entire frame to align, we allocate * a new mbuf and copy ethernet header + IP header to * the new mbuf. The new mbuf is prepended into the diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index 5a926a125de5..91e9a65457d4 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -2193,7 +2193,7 @@ hdaa_channel_getptr(kobj_t obj, void *data) hdaa_unlock(devinfo); /* - * Round to available space and force 128 bytes aligment. + * Round to available space and force 128 bytes alignment. */ ptr %= ch->blksz * ch->blkcnt; ptr &= HDA_BLK_ALIGN; diff --git a/sys/dev/usb/controller/uhci.c b/sys/dev/usb/controller/uhci.c index 16ffa7756878..709d413e3599 100644 --- a/sys/dev/usb/controller/uhci.c +++ b/sys/dev/usb/controller/uhci.c @@ -2934,7 +2934,7 @@ uhci_xfer_setup(struct usb_setup_params *parm) * We don't allow alignments of * less than 8 bytes: * - * NOTE: Allocating using an aligment + * NOTE: Allocating using an alignment * of 1 byte has special meaning! */ if (n < 3) { diff --git a/sys/dev/usb/usb_busdma.c b/sys/dev/usb/usb_busdma.c index f43926d04aac..b7f0464c1767 100644 --- a/sys/dev/usb/usb_busdma.c +++ b/sys/dev/usb/usb_busdma.c @@ -557,7 +557,7 @@ usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg, /* * XXX BUS-DMA workaround - FIXME later: * - * We assume that that the aligment at this point of + * We assume that that the alignment at this point of * the code is greater than or equal to the size and * less than two times the size, so that if we double * the size, the size will be greater than the diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index 454f7f0a1010..035be23a0a7a 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -349,7 +349,7 @@ ENTRY(identify_cpu) testl %eax,%eax jnz try486 - /* NexGen CPU does not have aligment check flag. */ + /* NexGen CPU does not have alignment check flag. */ pushfl movl $0x5555, %eax xorl %edx, %edx From owner-dev-commits-src-all@freebsd.org Thu Aug 19 09:46:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B86A661D91; Thu, 19 Aug 2021 09:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr0KJ3l1Xz4XK2; Thu, 19 Aug 2021 09:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6819A2333D; Thu, 19 Aug 2021 09:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J9kiho002592; Thu, 19 Aug 2021 09:46:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J9kimE002591; Thu, 19 Aug 2021 09:46:44 GMT (envelope-from git) Date: Thu, 19 Aug 2021 09:46:44 GMT Message-Id: <202108190946.17J9kimE002591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 20ffd88ed54f - main - ipfw: use unsigned int for dummynet bandwidth MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20ffd88ed54fe3fd098ac30bd221275b2a14f52c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 09:46:44 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=20ffd88ed54fe3fd098ac30bd221275b2a14f52c commit 20ffd88ed54fe3fd098ac30bd221275b2a14f52c Author: Luiz Otavio O Souza AuthorDate: 2021-08-17 07:54:40 +0000 Commit: Kristof Provost CommitDate: 2021-08-19 08:48:53 +0000 ipfw: use unsigned int for dummynet bandwidth This allows the maximum value of 4294967295 (~4Gb/s) instead of previous value of 2147483647 (~2Gb/s). Reviewed by: np, scottl Obtained from: pfSense MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31582 --- sbin/ipfw/dummynet.c | 13 +++++++------ sys/netinet/ip_dummynet.h | 4 ++-- sys/netpfil/ipfw/ip_dn_glue.c | 4 ++-- sys/netpfil/ipfw/ip_dn_io.c | 3 ++- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c index 24d835fbb98e..88367694a404 100644 --- a/sbin/ipfw/dummynet.c +++ b/sbin/ipfw/dummynet.c @@ -23,6 +23,7 @@ */ #define NEW_AQM +#include #include #include /* XXX there are several sysctl leftover here */ @@ -794,9 +795,9 @@ is_valid_number(const char *s) * set clocking interface or bandwidth value */ static void -read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen) +read_bandwidth(char *arg, uint32_t *bandwidth, char *if_name, int namelen) { - if (*bandwidth != -1) + if (*bandwidth != (uint32_t)-1) warnx("duplicate token, override bandwidth value!"); if (arg[0] >= 'a' && arg[0] <= 'z') { @@ -810,7 +811,7 @@ read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen) strlcpy(if_name, arg, namelen); *bandwidth = 0; } else { /* read bandwidth value */ - int bw; + uint64_t bw; char *end = NULL; bw = strtoul(arg, &end, 0); @@ -829,10 +830,10 @@ read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen) _substrcmp2(end, "by", "bytes") == 0) bw *= 8; - if (bw < 0) + if (bw > UINT_MAX) errx(EX_DATAERR, "bandwidth too large"); - *bandwidth = bw; + *bandwidth = (uint32_t)bw; if (if_name) if_name[0] = '\0'; } @@ -1737,7 +1738,7 @@ end_mask: if (p) { if (p->delay > 10000) errx(EX_DATAERR, "delay must be < 10000"); - if (p->bandwidth == -1) + if (p->bandwidth == (uint32_t)-1) p->bandwidth = 0; } if (fs) { diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h index de38ed9fbedf..533dc5ccd85f 100644 --- a/sys/netinet/ip_dummynet.h +++ b/sys/netinet/ip_dummynet.h @@ -131,7 +131,7 @@ struct dn_link { * XXX what about burst ? */ int32_t link_nr; - int bandwidth; /* bit/s or bits/tick. */ + uint32_t bandwidth; /* bit/s or bits/tick. */ int delay; /* ms and ticks */ uint64_t burst; /* scaled. bits*Hz XXX */ }; @@ -214,7 +214,7 @@ struct dn_profile { char name[ED_MAX_NAME_LEN]; int link_nr; int loss_level; - int bandwidth; // XXX use link bandwidth? + uint32_t bandwidth; // XXX use link bandwidth? int samples_no; /* actual len of samples[] */ int samples[ED_MAX_SAMPLES_NO]; /* may be shorter */ }; diff --git a/sys/netpfil/ipfw/ip_dn_glue.c b/sys/netpfil/ipfw/ip_dn_glue.c index e035fedaaf91..a690aa0290d7 100644 --- a/sys/netpfil/ipfw/ip_dn_glue.c +++ b/sys/netpfil/ipfw/ip_dn_glue.c @@ -166,7 +166,7 @@ struct dn_pipe7 { /* a pipe */ SLIST_ENTRY(dn_pipe7) next; /* linked list in a hash slot */ int pipe_nr ; /* number */ - int bandwidth; /* really, bytes/tick. */ + uint32_t bandwidth; /* really, bytes/tick. */ int delay ; /* really, ticks */ struct mbuf *head, *tail ; /* packets in delay line */ @@ -231,7 +231,7 @@ struct dn_pipe8 { /* a pipe */ SLIST_ENTRY(dn_pipe8) next; /* linked list in a hash slot */ int pipe_nr ; /* number */ - int bandwidth; /* really, bytes/tick. */ + uint32_t bandwidth; /* really, bytes/tick. */ int delay ; /* really, ticks */ struct mbuf *head, *tail ; /* packets in delay line */ diff --git a/sys/netpfil/ipfw/ip_dn_io.c b/sys/netpfil/ipfw/ip_dn_io.c index 11357b44e05e..dad5cb087b39 100644 --- a/sys/netpfil/ipfw/ip_dn_io.c +++ b/sys/netpfil/ipfw/ip_dn_io.c @@ -591,7 +591,8 @@ serve_sched(struct mq *q, struct dn_sch_inst *si, uint64_t now) struct dn_schk *s = si->sched; struct mbuf *m = NULL; int delay_line_idle = (si->dline.mq.head == NULL); - int done, bw; + int done; + uint32_t bw; if (q == NULL) { q = &def_q; From owner-dev-commits-src-all@freebsd.org Thu Aug 19 09:46:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18F8A661EB9; Thu, 19 Aug 2021 09:46:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr0KK4qJKz4X8D; Thu, 19 Aug 2021 09:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A133232AE; Thu, 19 Aug 2021 09:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J9kjkk002616; Thu, 19 Aug 2021 09:46:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J9kjuh002615; Thu, 19 Aug 2021 09:46:45 GMT (envelope-from git) Date: Thu, 19 Aug 2021 09:46:45 GMT Message-Id: <202108190946.17J9kjuh002615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c138424148f9 - main - lagg: don't update link layer addresses on destroy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c138424148f900dc449c757869453120ae3277f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 09:46:46 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c138424148f900dc449c757869453120ae3277f3 commit c138424148f900dc449c757869453120ae3277f3 Author: Luiz Otavio O Souza AuthorDate: 2021-08-17 14:23:50 +0000 Commit: Kristof Provost CommitDate: 2021-08-19 08:49:32 +0000 lagg: don't update link layer addresses on destroy When the lagg is being destroyed it is not necessary update the lladdr of all the lagg members every time we update the primary interface. Reviewed by: scottl Obtained from: pfSense MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31586 --- sys/net/if_lagg.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 9a3c22789fa5..c53e5b283b76 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -969,14 +969,16 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport) bcopy(lladdr, IF_LLADDR(sc->sc_ifp), sc->sc_ifp->if_addrlen); lagg_proto_lladdr(sc); EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp); - } - /* - * Update lladdr for each port (new primary needs update - * as well, to switch from old lladdr to its 'real' one) - */ - CK_SLIST_FOREACH(lp_ptr, &sc->sc_ports, lp_entries) - if_setlladdr(lp_ptr->lp_ifp, lladdr, lp_ptr->lp_ifp->if_addrlen); + /* + * Update lladdr for each port (new primary needs update + * as well, to switch from old lladdr to its 'real' one). + * We can skip this if the lagg is being destroyed. + */ + CK_SLIST_FOREACH(lp_ptr, &sc->sc_ports, lp_entries) + if_setlladdr(lp_ptr->lp_ifp, lladdr, + lp_ptr->lp_ifp->if_addrlen); + } } if (lp->lp_ifflags) From owner-dev-commits-src-all@freebsd.org Thu Aug 19 10:08:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD30466256A; Thu, 19 Aug 2021 10:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr0pJ5BdHz4Yc7; Thu, 19 Aug 2021 10:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A40623854; Thu, 19 Aug 2021 10:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JA8OSG031467; Thu, 19 Aug 2021 10:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JA8OnT031466; Thu, 19 Aug 2021 10:08:24 GMT (envelope-from git) Date: Thu, 19 Aug 2021 10:08:24 GMT Message-Id: <202108191008.17JA8OnT031466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0a7d1fc6f632 - main - pf: implement set-tos for IPv6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a7d1fc6f6324e62458e72546cc06ac8c76c494b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 10:08:24 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0a7d1fc6f6324e62458e72546cc06ac8c76c494b commit 0a7d1fc6f6324e62458e72546cc06ac8c76c494b Author: Samuel Robinette AuthorDate: 2021-08-15 18:26:41 +0000 Commit: Kristof Provost CommitDate: 2021-08-19 08:07:56 +0000 pf: implement set-tos for IPv6 Extend the existing set-tos keyword to also be able to set traffic class on IPv6 traffic. Add tests for this as well. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D31564 --- sys/netpfil/pf/pf_norm.c | 12 +++-- tests/sys/netpfil/common/pft_ping.py | 29 +++++++++++- tests/sys/netpfil/pf/set_tos.sh | 88 ++++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index e9674d21ec5a..796d445607e7 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -157,7 +157,7 @@ static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *); #ifdef INET6 static int pf_reassemble6(struct mbuf **, struct ip6_hdr *, struct ip6_frag *, uint16_t, uint16_t, u_short *); -static void pf_scrub_ip6(struct mbuf **, uint8_t); +static void pf_scrub_ip6(struct mbuf **, uint32_t, uint8_t, uint8_t); #endif /* INET6 */ #define DPFPRINTF(x) do { \ @@ -1283,7 +1283,7 @@ pf_normalize_ip6(struct mbuf **m0, int dir, struct pfi_kkif *kif, if (sizeof(struct ip6_hdr) + plen > m->m_pkthdr.len) goto shortpkt; - pf_scrub_ip6(&m, r->min_ttl); + pf_scrub_ip6(&m, r->rule_flag, r->min_ttl, r->set_tos); return (PF_PASS); @@ -2032,7 +2032,7 @@ pf_scrub_ip(struct mbuf **m0, u_int32_t flags, u_int8_t min_ttl, u_int8_t tos) #ifdef INET6 static void -pf_scrub_ip6(struct mbuf **m0, u_int8_t min_ttl) +pf_scrub_ip6(struct mbuf **m0, u_int32_t flags, u_int8_t min_ttl, u_int8_t tos) { struct mbuf *m = *m0; struct ip6_hdr *h = mtod(m, struct ip6_hdr *); @@ -2040,5 +2040,11 @@ pf_scrub_ip6(struct mbuf **m0, u_int8_t min_ttl) /* Enforce a minimum ttl, may cause endless packet loops */ if (min_ttl && h->ip6_hlim < min_ttl) h->ip6_hlim = min_ttl; + + /* Enforce tos. Set traffic class bits */ + if (flags & PFRULE_SET_TOS) { + h->ip6_flow &= IPV6_FLOWLABEL_MASK | IPV6_VERSION_MASK; + h->ip6_flow |= htonl((tos | IPV6_ECN(h)) << 20); + } } #endif diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 9cc7c5d5c5c0..9ed6a00cab34 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -115,6 +115,14 @@ def check_ping6_request(args, packet): if icmp.data != PAYLOAD_MAGIC: return False + # Wait to check expectations until we've established this is the packet we + # sent. + if args.expect_tc: + if ip.tc != int(args.expect_tc[0]): + print("Unexpected traffic class value %d, expected %d" \ + % (ip.tc, int(args.expect_tc[0]))) + return False + return True def check_ping_reply(args, packet): @@ -147,6 +155,12 @@ def check_ping4_reply(args, packet): if raw.load != PAYLOAD_MAGIC: return False + if args.expect_tos: + if ip.tos != int(args.expect_tos[0]): + print("Unexpected ToS value %d, expected %d" \ + % (ip.tos, int(args.expect_tos[0]))) + return False + return True def check_ping6_reply(args, packet): @@ -170,6 +184,12 @@ def check_ping6_reply(args, packet): print("data mismatch") return False + if args.expect_tc: + if ip.tc != int(args.expect_tc[0]): + print("Unexpected traffic class value %d, expected %d" \ + % (ip.tc, int(args.expect_tc[0]))) + return False + return True def ping(send_if, dst_ip, args): @@ -192,8 +212,11 @@ def ping6(send_if, dst_ip, args): ip6 = sp.IPv6(dst=dst_ip) icmp = sp.ICMPv6EchoRequest(data=sp.raw(PAYLOAD_MAGIC)) + if args.send_tc: + ip6.tc = int(args.send_tc[0]) + if args.fromaddr: - ip.src = args.fromaddr[0] + ip6.src = args.fromaddr[0] req = ether / ip6 / icmp sp.sendp(req, iface=send_if, verbose=False) @@ -274,10 +297,14 @@ def main(): # Packet settings parser.add_argument('--send-tos', nargs=1, help='Set the ToS value for the transmitted packet') + parser.add_argument('--send-tc', nargs=1, + help='Set the traffic class value for the transmitted packet') # Expectations parser.add_argument('--expect-tos', nargs=1, help='The expected ToS value in the received packet') + parser.add_argument('--expect-tc', nargs=1, + help='The expected traffic class value in the received packet') args = parser.parse_args() diff --git a/tests/sys/netpfil/pf/set_tos.sh b/tests/sys/netpfil/pf/set_tos.sh index 55d0059aa133..2dbca54a1ee9 100644 --- a/tests/sys/netpfil/pf/set_tos.sh +++ b/tests/sys/netpfil/pf/set_tos.sh @@ -4,6 +4,8 @@ # # Copyright (c) 2017 Kristof Provost # +# Copyright (c) 2021 Samuel Robinette +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -114,7 +116,93 @@ v4_cleanup() pft_cleanup } +atf_test_case "v6" "cleanup" +v6_head() +{ + atf_set descr 'set-tos6 test' + atf_set require.user root + + # We need scapy to be installed for out test scripts to work + atf_set require.progs scapy +} + +v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 add 2001:db8:192::1 + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 add 2001:db8:192::2 + + route -6 add 2001:db8:192::2 2001:db8:192::1 + jexec alcatraz route -6 add 2001:db8:192::1 2001:db8:192::2 + + jexec alcatraz pfctl -e + + # No change is done if not requested + pft_set_rules alcatraz "scrub out proto ipv6-icmp" + atf_check -s exit:1 -o ignore -e ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8:192::2 \ + --replyif ${epair}a \ + --expect-tc 42 + + # The requested ToS is set + pft_set_rules alcatraz "scrub out proto ipv6-icmp set-tos 42" + atf_check -s exit:0 -o ignore -e ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8:192::2 \ + --replyif ${epair}a \ + --expect-tc 42 + + # ToS is not changed if the scrub rule does not match + pft_set_rules alcatraz "scrub out from 2001:db8:192::3 set-tos 42" + atf_check -s exit:1 -o ignore -e ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8:192::2 \ + --replyif ${epair}a \ + --expect-tc 42 + + # Multiple scrub rules match as expected + pft_set_rules alcatraz "scrub out from 2001:db8:192::3 set-tos 13" \ + "scrub out proto ipv6-icmp set-tos 14" + atf_check -s exit:0 -o ignore -e ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8:192::2 \ + --replyif ${epair}a \ + --expect-tc 14 + + # And this works even if the packet already has ToS values set + atf_check -s exit:0 -o ignore -e ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8:192::2 \ + --replyif ${epair}a \ + --send-tc 42 \ + --expect-tc 14 + + # ToS values are unmolested if the packets do not match a scrub rule + pft_set_rules alcatraz "scrub out from 2001:db8:192::3 set-tos 13" + atf_check -s exit:0 -o ignore -e ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8:192::2 \ + --replyif ${epair}a \ + --expect-tc 0 +} + +v6_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" + atf_add_test_case "v6" } From owner-dev-commits-src-all@freebsd.org Thu Aug 19 10:31:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B394866269C; Thu, 19 Aug 2021 10:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr1KC4ZrBz4Zxl; Thu, 19 Aug 2021 10:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AD8423BB8; Thu, 19 Aug 2021 10:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JAVhW0067448; Thu, 19 Aug 2021 10:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JAVhdJ067447; Thu, 19 Aug 2021 10:31:43 GMT (envelope-from git) Date: Thu, 19 Aug 2021 10:31:43 GMT Message-Id: <202108191031.17JAVhdJ067447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 78267c2e703c - main - md: Replace BIO_DELETE emulation with vn_deallocate(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78267c2e703c236d37692da77a4ee92da9502943 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 10:31:43 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=78267c2e703c236d37692da77a4ee92da9502943 commit 78267c2e703c236d37692da77a4ee92da9502943 Author: Ka Ho Ng AuthorDate: 2021-08-19 10:30:13 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-19 10:30:13 +0000 md: Replace BIO_DELETE emulation with vn_deallocate(9) Both zero-filling and/or deallocation can be done with vn_deallocate(9). Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D28899 --- sys/dev/md/md.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index c5c90d9173ad..1627ee2e5fa6 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -875,7 +875,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) struct buf *pb; bus_dma_segment_t *vlist; struct thread *td; - off_t iolen, iostart, len, zerosize; + off_t iolen, iostart, off, len; int ma_offs, npages; switch (bp->bio_cmd) { @@ -883,9 +883,9 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) auio.uio_rw = UIO_READ; break; case BIO_WRITE: - case BIO_DELETE: auio.uio_rw = UIO_WRITE; break; + case BIO_DELETE: case BIO_FLUSH: break; default: @@ -897,6 +897,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) pb = NULL; piov = NULL; ma_offs = bp->bio_ma_offset; + off = bp->bio_offset; len = bp->bio_length; /* @@ -914,6 +915,11 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) VOP_UNLOCK(vp); vn_finished_write(mp); return (error); + } else if (bp->bio_cmd == BIO_DELETE) { + error = vn_deallocate(vp, &off, &len, 0, + sc->flags & MD_ASYNC ? 0 : IO_SYNC, sc->cred, NOCRED); + bp->bio_resid = len; + return (error); } auio.uio_offset = (vm_ooffset_t)bp->bio_offset; @@ -921,25 +927,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) auio.uio_segflg = UIO_SYSSPACE; auio.uio_td = td; - if (bp->bio_cmd == BIO_DELETE) { - /* - * Emulate BIO_DELETE by writing zeros. - */ - zerosize = ZERO_REGION_SIZE - - (ZERO_REGION_SIZE % sc->sectorsize); - auio.uio_iovcnt = howmany(bp->bio_length, zerosize); - piov = malloc(sizeof(*piov) * auio.uio_iovcnt, M_MD, M_WAITOK); - auio.uio_iov = piov; - while (len > 0) { - piov->iov_base = __DECONST(void *, zero_region); - piov->iov_len = len; - if (len > zerosize) - piov->iov_len = zerosize; - len -= piov->iov_len; - piov++; - } - piov = auio.uio_iov; - } else if ((bp->bio_flags & BIO_VLIST) != 0) { + if ((bp->bio_flags & BIO_VLIST) != 0) { piov = malloc(sizeof(*piov) * bp->bio_ma_n, M_MD, M_WAITOK); auio.uio_iov = piov; vlist = (bus_dma_segment_t *)bp->bio_data; From owner-dev-commits-src-all@freebsd.org Thu Aug 19 10:31:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D85FA662B16; Thu, 19 Aug 2021 10:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr1KD5YgLz4bQK; Thu, 19 Aug 2021 10:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9980E23D2C; Thu, 19 Aug 2021 10:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JAViiC067472; Thu, 19 Aug 2021 10:31:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JAViPg067471; Thu, 19 Aug 2021 10:31:44 GMT (envelope-from git) Date: Thu, 19 Aug 2021 10:31:44 GMT Message-Id: <202108191031.17JAViPg067471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 5ee2c35751ef - main - truncate(1): Add hole-punching support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ee2c35751ef5d131222423bf3e25073f997c337 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 10:31:45 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=5ee2c35751ef5d131222423bf3e25073f997c337 commit 5ee2c35751ef5d131222423bf3e25073f997c337 Author: Ka Ho Ng AuthorDate: 2021-08-19 10:30:41 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-19 10:30:41 +0000 truncate(1): Add hole-punching support This commit adds hole-punching support to the truncate(1) utility. If the option -d is specified, truncate(1) performs zeroing, and if possible hole-punching in case the operation is supported by the underlying file system of the specified files. Sponsored by: The FreeBSD Foundation Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D31556 --- usr.bin/truncate/truncate.1 | 63 +++++++++++++++++++++++++++++++----- usr.bin/truncate/truncate.c | 79 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 115 insertions(+), 27 deletions(-) diff --git a/usr.bin/truncate/truncate.1 b/usr.bin/truncate/truncate.1 index 2058530162c5..54780ccbca83 100644 --- a/usr.bin/truncate/truncate.1 +++ b/usr.bin/truncate/truncate.1 @@ -1,6 +1,10 @@ .\" .\" Copyright (c) 2000 Sheldon Hearn . .\" All rights reserved. +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" Portions of this manual page were written by Ka Ho Ng +.\" under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -25,12 +29,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2020 +.Dd August 18, 2021 .Dt TRUNCATE 1 .Os .Sh NAME .Nm truncate -.Nd truncate or extend the length of files +.Nd truncate, extend the length of files, or perform space management in files .Sh SYNOPSIS .Nm .Op Fl c @@ -39,7 +43,7 @@ .Sm off .Op Cm + | - | % | / .Ar size -.Op Cm K | k | M | m | G | g | T | t +.Op Cm SUFFIX .Sm on .Xc .Ek @@ -50,10 +54,32 @@ .Fl r Ar rfile .Ek .Ar +.Nm +.Op Fl c +.Bk -words +.Fl d +.Oo +.Fl o Xo +.Sm off +.Ar offset +.Op Cm SUFFIX +.Sm on +.Xc +.Oc +.Fl l Xo +.Sm off +.Ar length +.Op Cm SUFFIX +.Sm on +.Xc +.Ek +.Ar .Sh DESCRIPTION The .Nm -utility adjusts the length of each regular file given on the command-line. +utility adjusts the length of each regular file given on the command-line, or +performs space management with the given offset and the length over a regular +file given on the command-line. .Pp The following options are available: .Bl -tag -width indent @@ -71,7 +97,7 @@ Truncate or extend files to the length of the file .Sm off .Op Cm + | - | % | / .Ar size -.Op Cm K | k | M | m | G | g | T | t +.Op Cm SUFFIX .Sm on .Xc If the @@ -100,10 +126,28 @@ Otherwise, the .Ar size argument specifies an absolute length to which all files should be extended or reduced as appropriate. +.It Fl d +Zero a region in the specified file. +If the underlying file system of the given file supports hole-punching, +file system space deallocation may be performed in the operation region. +.It Fl o Ar offset +The space management operation is performed at the given +.Ar offset +bytes in the file. +If this option is not specified, the operation is performed at the beginning of the file. +.It Fl l Ar length +The length of the operation range in bytes. +This option must always be specified if option +.Fl d +is specified, and must be greater than 0. +.El .Pp The -.Ar size -argument may be suffixed with one of +.Ar size , +.Ar offset +and +.Ar length +arguments may be suffixed with one of .Cm K , .Cm M , .Cm G @@ -112,7 +156,6 @@ or (either upper or lower case) to indicate a multiple of Kilobytes, Megabytes, Gigabytes or Terabytes respectively. -.El .Pp Exactly one of the .Fl r @@ -183,6 +226,7 @@ ls -l test_file* .Sh SEE ALSO .Xr dd 1 , .Xr touch 1 , +.Xr fspacectl 2 , .Xr truncate 2 .Sh STANDARDS The @@ -198,3 +242,6 @@ The .Nm utility was written by .An Sheldon Hearn Aq Mt sheldonh@starjuice.net . +Hole-punching support of this +utility was developed by +.An Ka Ho Ng Aq Mt khng@FreeBSD.org . diff --git a/usr.bin/truncate/truncate.c b/usr.bin/truncate/truncate.c index a7579227f299..529d2c7e6dab 100644 --- a/usr.bin/truncate/truncate.c +++ b/usr.bin/truncate/truncate.c @@ -4,6 +4,11 @@ * Copyright (c) 2000 Sheldon Hearn . * All rights reserved. * + * Copyright (c) 2021 The FreeBSD Foundation + * + * Portions of this software were developed by Ka Ho Ng + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -49,26 +54,36 @@ main(int argc, char **argv) { struct stat sb; mode_t omode; - off_t oflow, rsize, sz, tsize, round; + off_t oflow, rsize, sz, tsize, round, off, len; uint64_t usz; - int ch, error, fd, oflags; + int ch, error, fd, oflags, r; + int do_dealloc; + int do_truncate; int no_create; int do_relative; int do_round; int do_refer; int got_size; char *fname, *rname; + struct spacectl_range sr; fd = -1; - rsize = tsize = sz = 0; - no_create = do_relative = do_round = do_refer = got_size = 0; - error = 0; + rsize = tsize = sz = off = 0; + len = -1; + do_dealloc = no_create = do_relative = do_round = do_refer = + got_size = 0; + do_truncate = 1; + error = r = 0; rname = NULL; - while ((ch = getopt(argc, argv, "cr:s:")) != -1) + while ((ch = getopt(argc, argv, "cdr:s:o:l:")) != -1) switch (ch) { case 'c': no_create = 1; break; + case 'd': + do_dealloc = 1; + do_truncate = 0; + break; case 'r': do_refer = 1; rname = optarg; @@ -89,6 +104,22 @@ main(int argc, char **argv) -(off_t)usz : (off_t)usz; got_size = 1; break; + case 'o': + if (expand_number(optarg, &usz) == -1 || + (off_t)usz < 0) + errx(EXIT_FAILURE, + "invalid offset argument `%s'", optarg); + + off = usz; + break; + case 'l': + if (expand_number(optarg, &usz) == -1 || + (off_t)usz <= 0) + errx(EXIT_FAILURE, + "invalid length argument `%s'", optarg); + + len = usz; + break; default: usage(); /* NOTREACHED */ @@ -98,19 +129,22 @@ main(int argc, char **argv) argc -= optind; /* - * Exactly one of do_refer or got_size must be specified. Since - * do_relative implies got_size, do_relative and do_refer are - * also mutually exclusive. See usage() for allowed invocations. + * Exactly one of do_refer, got_size or do_dealloc must be specified. + * Since do_relative implies got_size, do_relative, do_refer and + * do_dealloc are also mutually exclusive. If do_dealloc is specified, + * the length argument must be set. See usage() for allowed + * invocations. */ - if (do_refer + got_size != 1 || argc < 1) + if (argc < 1 || do_refer + got_size + do_dealloc != 1 || + (do_dealloc == 1 && len == -1)) usage(); - if (do_refer) { + if (do_refer == 1) { if (stat(rname, &sb) == -1) err(EXIT_FAILURE, "%s", rname); tsize = sb.st_size; - } else if (do_relative || do_round) + } else if (do_relative == 1 || do_round == 1) rsize = sz; - else + else if (do_dealloc == 0) tsize = sz; if (no_create) @@ -129,7 +163,7 @@ main(int argc, char **argv) } continue; } - if (do_relative) { + if (do_relative == 1) { if (fstat(fd, &sb) == -1) { warn("%s", fname); error++; @@ -144,7 +178,7 @@ main(int argc, char **argv) } tsize = oflow; } - if (do_round) { + if (do_round == 1) { if (fstat(fd, &sb) == -1) { warn("%s", fname); error++; @@ -166,10 +200,16 @@ main(int argc, char **argv) if (tsize < 0) tsize = 0; - if (ftruncate(fd, tsize) == -1) { + if (do_dealloc == 1) { + sr.r_offset = off; + sr.r_len = len; + r = fspacectl(fd, SPACECTL_DEALLOC, &sr, 0, &sr); + } + if (do_truncate == 1) + r = ftruncate(fd, tsize); + if (r == -1) { warn("%s", fname); error++; - continue; } } if (fd != -1) @@ -181,8 +221,9 @@ main(int argc, char **argv) static void usage(void) { - fprintf(stderr, "%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n", "usage: truncate [-c] -s [+|-|%|/]size[K|k|M|m|G|g|T|t] file ...", - " truncate [-c] -r rfile file ..."); + " truncate [-c] -r rfile file ...", + " truncate [-c] -d [-o offset[K|k|M|m|G|g|T|t]] -l length[K|k|M|m|G|g|T|t] file ..."); exit(EXIT_FAILURE); } From owner-dev-commits-src-all@freebsd.org Thu Aug 19 10:45:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20A0C662E0B; Thu, 19 Aug 2021 10:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr1dP0Dhhz4cSX; Thu, 19 Aug 2021 10:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4E29242F5; Thu, 19 Aug 2021 10:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JAjiGe083876; Thu, 19 Aug 2021 10:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JAjiv5083875; Thu, 19 Aug 2021 10:45:44 GMT (envelope-from git) Date: Thu, 19 Aug 2021 10:45:44 GMT Message-Id: <202108191045.17JAjiv5083875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: a54abe119e3b - main - truncate(1): Fix missing -d option manpage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a54abe119e3b4c6e000a1058afab4904d205850b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 10:45:45 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=a54abe119e3b4c6e000a1058afab4904d205850b commit a54abe119e3b4c6e000a1058afab4904d205850b Author: Ka Ho Ng AuthorDate: 2021-08-19 10:45:25 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-19 10:45:25 +0000 truncate(1): Fix missing -d option manpage Mention that either one of the -r, -s and -d options must be specified. Sponsored by: The FreeBSD Foundation --- usr.bin/truncate/truncate.1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/truncate/truncate.1 b/usr.bin/truncate/truncate.1 index 54780ccbca83..0ea224deaff5 100644 --- a/usr.bin/truncate/truncate.1 +++ b/usr.bin/truncate/truncate.1 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2021 +.Dd August 19, 2021 .Dt TRUNCATE 1 .Os .Sh NAME @@ -158,9 +158,10 @@ Kilobytes, Megabytes, Gigabytes or Terabytes respectively. .Pp Exactly one of the -.Fl r -and +.Fl r , .Fl s +and +.Fl d options must be specified. .Pp If a file is made smaller, its extra data is lost. From owner-dev-commits-src-all@freebsd.org Thu Aug 19 11:22:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 228E36636AC; Thu, 19 Aug 2021 11:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr2SH0PYmz4f60; Thu, 19 Aug 2021 11:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAA7124B8B; Thu, 19 Aug 2021 11:22:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JBMsGB037001; Thu, 19 Aug 2021 11:22:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JBMsMK037000; Thu, 19 Aug 2021 11:22:54 GMT (envelope-from git) Date: Thu, 19 Aug 2021 11:22:54 GMT Message-Id: <202108191122.17JBMsMK037000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bbba66e3b65f - stable/13 - pipe_paircreate(): do not leak pipepair memory on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbba66e3b65fa2db53aa2274ef1e797ab69229ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 11:22:55 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bbba66e3b65fa2db53aa2274ef1e797ab69229ce commit bbba66e3b65fa2db53aa2274ef1e797ab69229ce Author: Konstantin Belousov AuthorDate: 2021-08-16 09:24:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-19 11:21:56 +0000 pipe_paircreate(): do not leak pipepair memory on error (cherry picked from commit 81b895a95bdab28897bf948f5265fad1f51f8aa2) --- sys/kern/sys_pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index ec0fb3860eda..b19fe8dbc0c0 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -391,6 +391,7 @@ fail: #ifdef MAC mac_pipe_destroy(pp); #endif + uma_zfree(pipe_zone, pp); return (error); } From owner-dev-commits-src-all@freebsd.org Thu Aug 19 11:22:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AB2C663372; Thu, 19 Aug 2021 11:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr2SJ1xzGz4f8Z; Thu, 19 Aug 2021 11:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 241FA24B8C; Thu, 19 Aug 2021 11:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JBMuA4037025; Thu, 19 Aug 2021 11:22:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JBMuqp037024; Thu, 19 Aug 2021 11:22:56 GMT (envelope-from git) Date: Thu, 19 Aug 2021 11:22:56 GMT Message-Id: <202108191122.17JBMuqp037024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f37afa877a5a - stable/13 - Style: wrap the long line, definition of ufs_checkpath() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f37afa877a5a718463eb1f4e9e8386d2bba72361 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 11:22:56 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f37afa877a5a718463eb1f4e9e8386d2bba72361 commit f37afa877a5a718463eb1f4e9e8386d2bba72361 Author: Konstantin Belousov AuthorDate: 2021-08-01 17:56:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-19 11:21:56 +0000 Style: wrap the long line, definition of ufs_checkpath() (cherry picked from commit 2e2212b4f55f307ed814cbe1ea633c32faea4a9c) --- sys/ufs/ufs/ufs_lookup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index b7bf4eb6c86c..ac3a8ee641a0 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1439,7 +1439,8 @@ ufs_dir_dd_ino(struct vnode *vp, struct ucred *cred, ino_t *dd_ino, * Check if source directory is in the path of the target directory. */ int -ufs_checkpath(ino_t source_ino, ino_t parent_ino, struct inode *target, struct ucred *cred, ino_t *wait_ino) +ufs_checkpath(ino_t source_ino, ino_t parent_ino, struct inode *target, + struct ucred *cred, ino_t *wait_ino) { struct mount *mp; struct vnode *tvp, *vp, *vp1; From owner-dev-commits-src-all@freebsd.org Thu Aug 19 11:22:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98642663B33; Thu, 19 Aug 2021 11:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr2SK3W3Hz4fKt; Thu, 19 Aug 2021 11:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5ACB2248D3; Thu, 19 Aug 2021 11:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JBMvwp037049; Thu, 19 Aug 2021 11:22:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JBMvUK037048; Thu, 19 Aug 2021 11:22:57 GMT (envelope-from git) Date: Thu, 19 Aug 2021 11:22:57 GMT Message-Id: <202108191122.17JBMvUK037048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b46bcc26809c - stable/13 - ufs rename: ensure that the result of ufs_checkpath() is stable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b46bcc26809c9e1e96c86656cbc63ba517b3fff9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 11:22:57 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b46bcc26809c9e1e96c86656cbc63ba517b3fff9 commit b46bcc26809c9e1e96c86656cbc63ba517b3fff9 Author: Konstantin Belousov AuthorDate: 2021-08-06 01:03:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-19 11:21:56 +0000 ufs rename: ensure that the result of ufs_checkpath() is stable (cherry picked from commit 8df4bc48c89a1302078282f22139a8368dc06971) --- sys/ufs/ffs/ffs_vfsops.c | 5 ++++- sys/ufs/ufs/ufs_lookup.c | 2 ++ sys/ufs/ufs/ufs_vnops.c | 12 ++++++++++-- sys/ufs/ufs/ufsmount.h | 5 +++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 85c7929550fb..047c6f58a8a9 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1179,6 +1179,7 @@ ffs_mountfs(odevvp, mp, td) else ump->um_check_blkno = NULL; mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF); + sx_init(&ump->um_checkpath_lock, "uchpth"); ffs_oldfscompat_read(fs, ump, fs->fs_sblockloc); fs->fs_ronly = ronly; fs->fs_active = NULL; @@ -1349,8 +1350,9 @@ out: g_vfs_close(cp); g_topology_unlock(); } - if (ump) { + if (ump != NULL) { mtx_destroy(UFS_MTX(ump)); + sx_destroy(&ump->um_checkpath_lock); if (mp->mnt_gjprovider != NULL) { free(mp->mnt_gjprovider, M_UFSMNT); mp->mnt_gjprovider = NULL; @@ -1576,6 +1578,7 @@ ffs_unmount(mp, mntflags) vrele(ump->um_odevvp); dev_rel(ump->um_dev); mtx_destroy(UFS_MTX(ump)); + sx_destroy(&ump->um_checkpath_lock); if (mp->mnt_gjprovider != NULL) { free(mp->mnt_gjprovider, M_UFSMNT); mp->mnt_gjprovider = NULL; diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index ac3a8ee641a0..fc78c017e2c6 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1450,6 +1450,8 @@ ufs_checkpath(ino_t source_ino, ino_t parent_ino, struct inode *target, vp = tvp = ITOV(target); mp = vp->v_mount; *wait_ino = 0; + sx_assert(&VFSTOUFS(mp)->um_checkpath_lock, SA_XLOCKED); + if (target->i_number == source_ino) return (EEXIST); if (target->i_number == parent_ino) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 2dfc2e24f772..00ec8f41f432 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1249,9 +1249,9 @@ ufs_rename(ap) struct mount *mp; ino_t ino; seqc_t fdvp_s, fvp_s, tdvp_s, tvp_s; - bool want_seqc_end; + bool checkpath_locked, want_seqc_end; - want_seqc_end = false; + checkpath_locked = want_seqc_end = false; #ifdef INVARIANTS if ((tcnp->cn_flags & HASBUF) == 0 || @@ -1453,6 +1453,9 @@ relock: error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread); if (error) goto unlockout; + + sx_xlock(&VFSTOUFS(mp)->um_checkpath_lock); + checkpath_locked = true; error = ufs_checkpath(ino, fdp->i_number, tdp, tcnp->cn_cred, &ino); /* @@ -1460,6 +1463,8 @@ relock: * everything else and VGET before restarting. */ if (ino) { + sx_xunlock(&VFSTOUFS(mp)->um_checkpath_lock); + checkpath_locked = false; VOP_UNLOCK(fdvp); VOP_UNLOCK(fvp); VOP_UNLOCK(tdvp); @@ -1690,6 +1695,9 @@ unlockout: vn_seqc_write_end(fdvp); } + if (checkpath_locked) + sx_xunlock(&VFSTOUFS(mp)->um_checkpath_lock); + vput(fdvp); vput(fvp); diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h index e5f9c93da373..0b90cae95ff5 100644 --- a/sys/ufs/ufs/ufsmount.h +++ b/sys/ufs/ufs/ufsmount.h @@ -45,6 +45,9 @@ struct ufs_args { #ifdef _KERNEL +#include +#include +#include #include #ifdef MALLOC_DECLARE @@ -100,6 +103,8 @@ struct ufsmount { uint64_t um_maxsymlinklen; /* (c) max size of short symlink */ struct mtx um_lock; /* (c) Protects ufsmount & fs */ + struct sx um_checkpath_lock; /* (c) Protects ufs_checkpath() + result */ pid_t um_fsckpid; /* (u) PID can do fsck sysctl */ struct mount_softdeps *um_softdep; /* (c) softdep mgmt structure */ struct vnode *um_quotas[MAXQUOTAS]; /* (q) pointer to quota files */ From owner-dev-commits-src-all@freebsd.org Thu Aug 19 11:22:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B624663998; Thu, 19 Aug 2021 11:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr2SL4xsgz4fRc; Thu, 19 Aug 2021 11:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CD89249C7; Thu, 19 Aug 2021 11:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JBMwSX037073; Thu, 19 Aug 2021 11:22:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JBMwu7037072; Thu, 19 Aug 2021 11:22:58 GMT (envelope-from git) Date: Thu, 19 Aug 2021 11:22:58 GMT Message-Id: <202108191122.17JBMwu7037072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2c5f0480c211 - stable/13 - fstatat(2): handle non-vnode file descriptors for AT_EMPTY_PATH MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c5f0480c211ef1373a0e01aa4ce1b64d8e2e10e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 11:22:59 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2c5f0480c211ef1373a0e01aa4ce1b64d8e2e10e commit 2c5f0480c211ef1373a0e01aa4ce1b64d8e2e10e Author: Konstantin Belousov AuthorDate: 2021-08-13 17:40:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-19 11:21:57 +0000 fstatat(2): handle non-vnode file descriptors for AT_EMPTY_PATH (cherry picked from commit 9446d9e88fd7b203fa50c015f29b636db5b1d52b) --- sys/kern/vfs_lookup.c | 2 +- sys/kern/vfs_syscalls.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index e0b98c9f5661..a827c87538b8 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -489,6 +489,7 @@ namei_emptypath(struct nameidata *ndp) MPASS((cnp->cn_flags & EMPTYPATH) != 0); MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0); + ndp->ni_resflags |= NIRES_EMPTYPATH; error = namei_setup(ndp, &dp, &pwd); if (error != 0) { namei_cleanup_cnp(cnp); @@ -501,7 +502,6 @@ namei_emptypath(struct nameidata *ndp) ndp->ni_vp = dp; namei_cleanup_cnp(cnp); pwd_drop(pwd); - ndp->ni_resflags |= NIRES_EMPTYPATH; NDVALIDATE(ndp); if ((cnp->cn_flags & LOCKLEAF) != 0) { VOP_LOCK(dp, (cnp->cn_flags & LOCKSHARED) != 0 ? diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 855943adecef..8fae55c2862d 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2426,8 +2426,12 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td); - if ((error = namei(&nd)) != 0) + if ((error = namei(&nd)) != 0) { + if (error == ENOTDIR && + (nd.ni_resflags & NIRES_EMPTYPATH) != 0) + error = kern_fstat(td, fd, sbp); return (error); + } error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED, td); if (error == 0) { if (__predict_false(hook != NULL)) From owner-dev-commits-src-all@freebsd.org Thu Aug 19 11:22:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0C11663B3D; Thu, 19 Aug 2021 11:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr2SM4qX8z4fRd; Thu, 19 Aug 2021 11:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CCE12465C; Thu, 19 Aug 2021 11:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JBMxIt037097; Thu, 19 Aug 2021 11:22:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JBMxOx037096; Thu, 19 Aug 2021 11:22:59 GMT (envelope-from git) Date: Thu, 19 Aug 2021 11:22:59 GMT Message-Id: <202108191122.17JBMxOx037096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 21edf70b8c87 - stable/13 - Add test for fstatat(pipefd, AT_EMPTY_PATH) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 21edf70b8c879cfdac21f8ad43f23eb468b5e7de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 11:22:59 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21edf70b8c879cfdac21f8ad43f23eb468b5e7de commit 21edf70b8c879cfdac21f8ad43f23eb468b5e7de Author: Konstantin Belousov AuthorDate: 2021-08-14 10:33:18 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-19 11:21:57 +0000 Add test for fstatat(pipefd, AT_EMPTY_PATH) (cherry picked from commit b42df9dafb8038169e23f9225f3f1588ded8d27e) --- tests/sys/file/path_test.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index e1f5240374c4..50a77f16736c 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -63,6 +63,25 @@ #define CHECKED_CLOSE(fd) \ ATF_REQUIRE_MSG(close(fd) == 0, FMT_ERR("close")) +/* + * Verify fstatat(AT_EMPTY_PATH) on non-regular dirfd. + * Verify that fstatat(AT_EMPTY_PATH) on NULL path returns EFAULT. + */ +ATF_TC_WITHOUT_HEAD(path_pipe_fstatat); +ATF_TC_BODY(path_pipe_fstatat, tc) +{ + struct stat sb; + int fd[2]; + + ATF_REQUIRE_MSG(pipe(fd) == 0, FMT_ERR("pipe")); + ATF_REQUIRE_MSG(fstatat(fd[0], "", &sb, AT_EMPTY_PATH) == 0, + FMT_ERR("fstatat pipe")); + ATF_REQUIRE_ERRNO(EFAULT, fstatat(fd[0], NULL, &sb, + AT_EMPTY_PATH) == -1); + CHECKED_CLOSE(fd[0]); + CHECKED_CLOSE(fd[1]); +} + /* Create a temporary regular file containing some data. */ static void mktfile(char path[PATH_MAX], const char *template) @@ -873,6 +892,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, path_lock); ATF_TP_ADD_TC(tp, path_rights); ATF_TP_ADD_TC(tp, path_unix); + ATF_TP_ADD_TC(tp, path_pipe_fstatat); return (atf_no_error()); } From owner-dev-commits-src-all@freebsd.org Thu Aug 19 12:32:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAAB7664C23; Thu, 19 Aug 2021 12:32:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr40T4WcXz4j8N; Thu, 19 Aug 2021 12:32:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83F5D25A80; Thu, 19 Aug 2021 12:32:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JCWPVS029662; Thu, 19 Aug 2021 12:32:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JCWPQ6029661; Thu, 19 Aug 2021 12:32:25 GMT (envelope-from git) Date: Thu, 19 Aug 2021 12:32:25 GMT Message-Id: <202108191232.17JCWPQ6029661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: af89e052b9c2 - stable/13 - Fix a typo that was introduced while fixing a typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af89e052b9c229dec8e365fe560fdc22432c66a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 12:32:25 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=af89e052b9c229dec8e365fe560fdc22432c66a7 commit af89e052b9c229dec8e365fe560fdc22432c66a7 Author: Gordon Bergling AuthorDate: 2021-08-14 12:30:59 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 12:32:05 +0000 Fix a typo that was introduced while fixing a typo - s/enrtry/entry/ (cherry picked from commit 646f3a36c8df0e54e71332038ede594965daac6e) --- sys/dev/bxe/bxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index 9145f11e5bf1..bf6904b26b55 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -17179,7 +17179,7 @@ bxe_init_hw_common(struct bxe_softc *sc) * stay set) * f. If this is VNIC 3 of a port then also init * first_timers_ilt_entry to zero and last_timers_ilt_entry - * to the last enrtry in the ILT. + * to the last entry in the ILT. * * Notes: * Currently the PF error in the PGLC is non recoverable. From owner-dev-commits-src-all@freebsd.org Thu Aug 19 12:33:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3933E664BA8; Thu, 19 Aug 2021 12:33:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr42D1970z4hy4; Thu, 19 Aug 2021 12:33:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10C6D257B1; Thu, 19 Aug 2021 12:33:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JCXt0l029915; Thu, 19 Aug 2021 12:33:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JCXtRK029914; Thu, 19 Aug 2021 12:33:55 GMT (envelope-from git) Date: Thu, 19 Aug 2021 12:33:55 GMT Message-Id: <202108191233.17JCXtRK029914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: a98dd5c1e792 - stable/12 - Fix a typo that was introduced while fixing a typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a98dd5c1e79240dfd82bdf04741e9a4c269a5bf8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 12:33:56 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a98dd5c1e79240dfd82bdf04741e9a4c269a5bf8 commit a98dd5c1e79240dfd82bdf04741e9a4c269a5bf8 Author: Gordon Bergling AuthorDate: 2021-08-14 12:30:59 +0000 Commit: Gordon Bergling CommitDate: 2021-08-19 12:33:33 +0000 Fix a typo that was introduced while fixing a typo - s/enrtry/entry/ (cherry picked from commit 646f3a36c8df0e54e71332038ede594965daac6e) --- sys/dev/bxe/bxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index 70f070389de9..18082b779306 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -17275,7 +17275,7 @@ bxe_init_hw_common(struct bxe_softc *sc) * stay set) * f. If this is VNIC 3 of a port then also init * first_timers_ilt_entry to zero and last_timers_ilt_entry - * to the last enrtry in the ILT. + * to the last entry in the ILT. * * Notes: * Currently the PF error in the PGLC is non recoverable. From owner-dev-commits-src-all@freebsd.org Thu Aug 19 12:43:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 167F1664DC5; Thu, 19 Aug 2021 12:43:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr4F30348z4jk4; Thu, 19 Aug 2021 12:43:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDB5C25C13; Thu, 19 Aug 2021 12:43:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JChIua043165; Thu, 19 Aug 2021 12:43:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JChI7F043164; Thu, 19 Aug 2021 12:43:18 GMT (envelope-from git) Date: Thu, 19 Aug 2021 12:43:18 GMT Message-Id: <202108191243.17JChI7F043164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 1a4d7030bbfe - main - rtsold: make it work on if_vlan interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a4d7030bbfec0f830e87bf7c2810f049f8ca8ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 12:43:19 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1a4d7030bbfec0f830e87bf7c2810f049f8ca8ac commit 1a4d7030bbfec0f830e87bf7c2810f049f8ca8ac Author: Luiz Otavio O Souza AuthorDate: 2021-08-19 09:48:04 +0000 Commit: Kristof Provost CommitDate: 2021-08-19 12:31:13 +0000 rtsold: make it work on if_vlan interfaces Reviewed by: kp Obtained from: pfsense MFC after: 1 week --- usr.sbin/rtsold/if.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c index b2f2c640b175..0f7f2ce7cba5 100644 --- a/usr.sbin/rtsold/if.c +++ b/usr.sbin/rtsold/if.c @@ -262,6 +262,7 @@ lladdropt_length(struct sockaddr_dl *sdl) { switch (sdl->sdl_type) { case IFT_ETHER: + case IFT_L2VLAN: return (ROUNDUP8(ETHER_ADDR_LEN + 2)); default: return (0); @@ -277,6 +278,7 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_hdr *ndopt) switch (sdl->sdl_type) { case IFT_ETHER: + case IFT_L2VLAN: ndopt->nd_opt_len = (ROUNDUP8(ETHER_ADDR_LEN + 2)) >> 3; addr = (char *)(ndopt + 1); memcpy(addr, LLADDR(sdl), ETHER_ADDR_LEN); From owner-dev-commits-src-all@freebsd.org Thu Aug 19 13:06:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 995416650F1; Thu, 19 Aug 2021 13:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr4mM3d65z4kcL; Thu, 19 Aug 2021 13:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63F7D2577E; Thu, 19 Aug 2021 13:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JD6xU7070729; Thu, 19 Aug 2021 13:06:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JD6xkR070728; Thu, 19 Aug 2021 13:06:59 GMT (envelope-from git) Date: Thu, 19 Aug 2021 13:06:59 GMT Message-Id: <202108191306.17JD6xkR070728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 416194c9af84 - stable/13 - loader: cstyle cleanup of userboot/devicename.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 416194c9af849c6fb4026fea30dbd45e0c06a859 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 13:06:59 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=416194c9af849c6fb4026fea30dbd45e0c06a859 commit 416194c9af849c6fb4026fea30dbd45e0c06a859 Author: Toomas Soome AuthorDate: 2021-08-11 07:07:28 +0000 Commit: Toomas Soome CommitDate: 2021-08-19 13:05:26 +0000 loader: cstyle cleanup of userboot/devicename.c No functional changes intended. (cherry picked from commit 5d5a6216645a6aefa8665c79bb761b754d74c067) --- stand/userboot/userboot/devicename.c | 260 ++++++++++++++++++----------------- 1 file changed, 132 insertions(+), 128 deletions(-) diff --git a/stand/userboot/userboot/devicename.c b/stand/userboot/userboot/devicename.c index 5c50b84384d2..8819af5ef127 100644 --- a/stand/userboot/userboot/devicename.c +++ b/stand/userboot/userboot/devicename.c @@ -38,9 +38,10 @@ __FBSDID("$FreeBSD$"); #include "libzfs.h" #endif -static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path); +static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, + const char **path); -/* +/* * Point (dev) at an allocated device specifier for the device matching the * path in (devspec). If it contains an explicit device specification, * use that. If not, use the default device. @@ -48,27 +49,27 @@ static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, con int userboot_getdev(void **vdev, const char *devspec, const char **path) { - struct disk_devdesc **dev = (struct disk_devdesc **)vdev; - int rv; - - /* - * If it looks like this is just a path and no - * device, go with the current device. - */ - if ((devspec == NULL) || - (devspec[0] == '/') || - (strchr(devspec, ':') == NULL)) { - - if (((rv = userboot_parsedev(dev, getenv("currdev"), NULL)) == 0) && - (path != NULL)) - *path = devspec; - return(rv); - } - - /* - * Try to parse the device name off the beginning of the devspec - */ - return(userboot_parsedev(dev, devspec, path)); + struct disk_devdesc **dev = (struct disk_devdesc **)vdev; + int rv; + + /* + * If it looks like this is just a path and no + * device, go with the current device. + */ + if ((devspec == NULL) || + (devspec[0] == '/') || + (strchr(devspec, ':') == NULL)) { + + rv = userboot_parsedev(dev, getenv("currdev"), NULL); + if (rv == 0 && path != NULL) + *path = devspec; + return (rv); + } + + /* + * Try to parse the device name off the beginning of the devspec + */ + return (userboot_parsedev(dev, devspec, path)); } /* @@ -83,126 +84,129 @@ userboot_getdev(void **vdev, const char *devspec, const char **path) * For disk-type devices, the syntax is: * * disk[s][]: - * + * */ static int -userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path) +userboot_parsedev(struct disk_devdesc **dev, const char *devspec, + const char **path) { - struct disk_devdesc *idev; - struct devsw *dv; - int i, unit, err; - const char *cp; - const char *np; - - /* minimum length check */ - if (strlen(devspec) < 2) - return(EINVAL); - - /* look for a device that matches */ - for (i = 0, dv = NULL; devsw[i] != NULL; i++) { - if (!strncmp(devspec, devsw[i]->dv_name, strlen(devsw[i]->dv_name))) { - dv = devsw[i]; - break; - } - } - if (dv == NULL) - return(ENOENT); - idev = malloc(sizeof(struct disk_devdesc)); - err = 0; - np = (devspec + strlen(dv->dv_name)); - - switch(dv->dv_type) { - case DEVT_NONE: /* XXX what to do here? Do we care? */ - break; - - case DEVT_DISK: - err = disk_parsedev(idev, np, path); - if (err != 0) - goto fail; - break; - - case DEVT_CD: - case DEVT_NET: - unit = 0; - - if (*np && (*np != ':')) { - unit = strtol(np, (char **)&cp, 0); /* get unit number if present */ - if (cp == np) { - err = EUNIT; - goto fail; - } - } else { - cp = np; - } - if (*cp && (*cp != ':')) { - err = EINVAL; - goto fail; + struct disk_devdesc *idev; + struct devsw *dv; + int i, unit, err; + const char *cp; + const char *np; + + /* minimum length check */ + if (strlen(devspec) < 2) + return (EINVAL); + + /* look for a device that matches */ + for (i = 0, dv = NULL; devsw[i] != NULL; i++) { + if (strncmp(devspec, devsw[i]->dv_name, + strlen(devsw[i]->dv_name)) == 0) { + dv = devsw[i]; + break; + } } - - idev->dd.d_unit = unit; - if (path != NULL) - *path = (*cp == 0) ? cp : cp + 1; - break; - - case DEVT_ZFS: + if (dv == NULL) + return (ENOENT); + idev = malloc(sizeof(struct disk_devdesc)); + err = 0; + np = (devspec + strlen(dv->dv_name)); + + switch (dv->dv_type) { + case DEVT_NONE: /* XXX what to do here? Do we care? */ + break; + + case DEVT_DISK: + err = disk_parsedev(idev, np, path); + if (err != 0) + goto fail; + break; + + case DEVT_CD: + case DEVT_NET: + unit = 0; + + if (*np && (*np != ':')) { + /* get unit number if present */ + unit = strtol(np, (char **)&cp, 0); + if (cp == np) { + err = EUNIT; + goto fail; + } + } else { + cp = np; + } + if (*cp && (*cp != ':')) { + err = EINVAL; + goto fail; + } + + idev->dd.d_unit = unit; + if (path != NULL) + *path = (*cp == 0) ? cp : cp + 1; + break; + + case DEVT_ZFS: #if defined(USERBOOT_ZFS_SUPPORT) - err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); - if (err != 0) - goto fail; - break; + err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); + if (err != 0) + goto fail; + break; #else - /* FALLTHROUGH */ + /* FALLTHROUGH */ #endif - default: - err = EINVAL; - goto fail; - } - idev->dd.d_dev = dv; - if (dev == NULL) { + default: + err = EINVAL; + goto fail; + } + idev->dd.d_dev = dv; + if (dev == NULL) { + free(idev); + } else { + *dev = idev; + } + return (0); + +fail: free(idev); - } else { - *dev = idev; - } - return(0); - - fail: - free(idev); - return(err); + return (err); } char * userboot_fmtdev(void *vdev) { - struct devdesc *dev = (struct devdesc *)vdev; - static char buf[128]; /* XXX device length constant? */ + struct devdesc *dev = (struct devdesc *)vdev; + static char buf[128]; /* XXX device length constant? */ - switch(dev->d_dev->dv_type) { - case DEVT_NONE: - strcpy(buf, "(no device)"); - break; + switch(dev->d_dev->dv_type) { + case DEVT_NONE: + strcpy(buf, "(no device)"); + break; - case DEVT_CD: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); - break; + case DEVT_CD: + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + break; - case DEVT_DISK: - return (disk_fmtdev(vdev)); + case DEVT_DISK: + return (disk_fmtdev(vdev)); - case DEVT_NET: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); - break; + case DEVT_NET: + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + break; - case DEVT_ZFS: + case DEVT_ZFS: #if defined(USERBOOT_ZFS_SUPPORT) - return (zfs_fmtdev(vdev)); + return (zfs_fmtdev(vdev)); #else - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); #endif - break; - } - return(buf); + break; + } + return (buf); } @@ -212,12 +216,12 @@ userboot_fmtdev(void *vdev) int userboot_setcurrdev(struct env_var *ev, int flags, const void *value) { - struct disk_devdesc *ncurr; - int rv; - - if ((rv = userboot_parsedev(&ncurr, value, NULL)) != 0) - return(rv); - free(ncurr); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return(0); + struct disk_devdesc *ncurr; + int rv; + + if ((rv = userboot_parsedev(&ncurr, value, NULL)) != 0) + return (rv); + free(ncurr); + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + return (0); } From owner-dev-commits-src-all@freebsd.org Thu Aug 19 13:13:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF49E66570A; Thu, 19 Aug 2021 13:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr4vv4S3Dz4l7y; Thu, 19 Aug 2021 13:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80F1226051; Thu, 19 Aug 2021 13:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JDDV62083566; Thu, 19 Aug 2021 13:13:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JDDVsB083565; Thu, 19 Aug 2021 13:13:31 GMT (envelope-from git) Date: Thu, 19 Aug 2021 13:13:31 GMT Message-Id: <202108191313.17JDDVsB083565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5851803f4bca - main - dhclient: remove patching of static values in BPF programs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5851803f4bcab48bddfe1600bda3906c4f83fad5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 13:13:31 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5851803f4bcab48bddfe1600bda3906c4f83fad5 commit 5851803f4bcab48bddfe1600bda3906c4f83fad5 Author: Franco Fichtner AuthorDate: 2021-08-19 13:08:59 +0000 Commit: Mark Johnston CommitDate: 2021-08-19 13:10:42 +0000 dhclient: remove patching of static values in BPF programs Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31502 --- sbin/dhclient/bpf.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c index a50abca62fd3..41eb4f402e66 100644 --- a/sbin/dhclient/bpf.c +++ b/sbin/dhclient/bpf.c @@ -105,7 +105,7 @@ if_register_bpf(struct interface_info *info, int flags) * Packet write filter program: * 'ip and udp and src port bootps and dst port (bootps or bootpc)' */ -static struct bpf_insn dhcp_bpf_wfilter[] = { +static const struct bpf_insn dhcp_bpf_wfilter[] = { BPF_STMT(BPF_LD + BPF_B + BPF_IND, 14), BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, (IPVERSION << 4) + 5, 0, 12), @@ -119,18 +119,18 @@ static struct bpf_insn dhcp_bpf_wfilter[] = { /* Make sure this isn't a fragment... */ BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 20), - BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 6, 0), /* patched */ + BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, IP_MF|IP_OFFMASK, 6, 0), /* Get the IP header length... */ BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 14), /* Make sure it's from the right port... */ BPF_STMT(BPF_LD + BPF_H + BPF_IND, 14), - BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 68, 0, 3), + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, LOCAL_PORT, 0, 3), /* Make sure it is to the right ports ... */ BPF_STMT(BPF_LD + BPF_H + BPF_IND, 16), - BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1), + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, REMOTE_PORT, 0, 1), /* If we passed all the tests, ask for the whole packet. */ BPF_STMT(BPF_RET+BPF_K, (u_int)-1), @@ -139,8 +139,6 @@ static struct bpf_insn dhcp_bpf_wfilter[] = { BPF_STMT(BPF_RET+BPF_K, 0), }; -static int dhcp_bpf_wfilter_len = nitems(dhcp_bpf_wfilter); - void if_register_send(struct interface_info *info) { @@ -161,11 +159,8 @@ if_register_send(struct interface_info *info) error("Kernel BPF version out of range - recompile dhcpd!"); /* Set up the bpf write filter program structure. */ - p.bf_len = dhcp_bpf_wfilter_len; - p.bf_insns = dhcp_bpf_wfilter; - - if (dhcp_bpf_wfilter[7].k == 0x1fff) - dhcp_bpf_wfilter[7].k = htons(IP_MF|IP_OFFMASK); + p.bf_insns = __DECONST(struct bpf_insn *, dhcp_bpf_wfilter); + p.bf_len = nitems(dhcp_bpf_wfilter); if (ioctl(info->wfdesc, BIOCSETWF, &p) < 0) error("Can't install write filter program: %m"); @@ -190,11 +185,8 @@ if_register_send(struct interface_info *info) /* * Packet filter program... - * - * XXX: Changes to the filter program may require changes to the - * constant offsets used in if_register_send to patch the BPF program! */ -static struct bpf_insn dhcp_bpf_filter[] = { +static const struct bpf_insn dhcp_bpf_filter[] = { /* Make sure this is an IP packet... */ BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 12), BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_IP, 0, 8), @@ -205,14 +197,14 @@ static struct bpf_insn dhcp_bpf_filter[] = { /* Make sure this isn't a fragment... */ BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 20), - BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 4, 0), + BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, IP_MF|IP_OFFMASK, 4, 0), /* Get the IP header length... */ BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 14), /* Make sure it's to the right port... */ BPF_STMT(BPF_LD + BPF_H + BPF_IND, 16), - BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1), /* patch */ + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, LOCAL_PORT, 0, 1), /* If we passed all the tests, ask for the whole packet. */ BPF_STMT(BPF_RET+BPF_K, (u_int)-1), @@ -221,8 +213,6 @@ static struct bpf_insn dhcp_bpf_filter[] = { BPF_STMT(BPF_RET+BPF_K, 0), }; -static int dhcp_bpf_filter_len = nitems(dhcp_bpf_filter); - void if_register_receive(struct interface_info *info) { @@ -263,15 +253,8 @@ if_register_receive(struct interface_info *info) info->rbuf_len = 0; /* Set up the bpf filter program structure. */ - p.bf_len = dhcp_bpf_filter_len; - p.bf_insns = dhcp_bpf_filter; - - /* Patch the server port into the BPF program... - * - * XXX: changes to filter program may require changes to the - * insn number(s) used below! - */ - dhcp_bpf_filter[8].k = LOCAL_PORT; + p.bf_insns = __DECONST(struct bpf_insn *, dhcp_bpf_filter); + p.bf_len = nitems(dhcp_bpf_filter); if (ioctl(info->rfdesc, BIOCSETF, &p) < 0) error("Can't install packet filter program: %m"); From owner-dev-commits-src-all@freebsd.org Thu Aug 19 13:13:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1228B66570B; Thu, 19 Aug 2021 13:13:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr4vw6SgSz4l5K; Thu, 19 Aug 2021 13:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0AC726149; Thu, 19 Aug 2021 13:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JDDWbR083590; Thu, 19 Aug 2021 13:13:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JDDWCW083589; Thu, 19 Aug 2021 13:13:32 GMT (envelope-from git) Date: Thu, 19 Aug 2021 13:13:32 GMT Message-Id: <202108191313.17JDDWCW083589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a313b5240a47 - main - dhclient: skip_to_semi() consumes semicolon already MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a313b5240a477e0d04294ffd170408d954181daa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 13:13:33 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a313b5240a477e0d04294ffd170408d954181daa commit a313b5240a477e0d04294ffd170408d954181daa Author: Franco Fichtner AuthorDate: 2021-08-19 13:11:38 +0000 Commit: Mark Johnston CommitDate: 2021-08-19 13:11:38 +0000 dhclient: skip_to_semi() consumes semicolon already When invalid statement is found the next statement is skipped even if it is valid. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31527 --- sbin/dhclient/clparse.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index 58ece525f8d1..c7b02a073aa3 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -199,7 +199,6 @@ void parse_client_statement(FILE *cfile, struct interface_info *ip, struct client_config *config) { - int token; char *val; struct option *option; time_t tmp; @@ -290,15 +289,11 @@ parse_client_statement(FILE *cfile, struct interface_info *ip, parse_reject_statement(cfile, config); return; default: - parse_warn("expecting a statement."); - skip_to_semi(cfile); break; } - token = next_token(&val, cfile); - if (token != SEMI) { - parse_warn("semicolon expected."); - skip_to_semi(cfile); - } + + parse_warn("expecting a statement."); + skip_to_semi(cfile); } unsigned @@ -637,7 +632,7 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease, if (token != STRING) { parse_warn("expecting interface name (in quotes)."); skip_to_semi(cfile); - break; + return; } ip = interface_or_dummy(val); *ipp = ip; @@ -674,7 +669,7 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease, default: parse_warn("expecting lease declaration."); skip_to_semi(cfile); - break; + return; } token = next_token(&val, cfile); if (token != SEMI) { From owner-dev-commits-src-all@freebsd.org Thu Aug 19 14:36:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 664426663FA; Thu, 19 Aug 2021 14:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr6m52P1Rz4pvR; Thu, 19 Aug 2021 14:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3560C270CC; Thu, 19 Aug 2021 14:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JEarR3089775; Thu, 19 Aug 2021 14:36:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JEar7l089774; Thu, 19 Aug 2021 14:36:53 GMT (envelope-from git) Date: Thu, 19 Aug 2021 14:36:53 GMT Message-Id: <202108191436.17JEar7l089774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 3ec0714d6db0 - main - libsa: cstyle cleanup of dosfs.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ec0714d6db0060113f6cadac6f4e44640603e8f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 14:36:53 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=3ec0714d6db0060113f6cadac6f4e44640603e8f commit 3ec0714d6db0060113f6cadac6f4e44640603e8f Author: Toomas Soome AuthorDate: 2021-08-19 14:33:24 +0000 Commit: Toomas Soome CommitDate: 2021-08-19 14:36:25 +0000 libsa: cstyle cleanup of dosfs.c No functional changes intended. MFC after: 1 week --- stand/libsa/dosfs.c | 1175 ++++++++++++++++++++++++++------------------------- 1 file changed, 595 insertions(+), 580 deletions(-) diff --git a/stand/libsa/dosfs.c b/stand/libsa/dosfs.c index 2d6029be837e..656af3642c88 100644 --- a/stand/libsa/dosfs.c +++ b/stand/libsa/dosfs.c @@ -69,40 +69,40 @@ struct fs_ops dosfs_fsops = { /* DOS "BIOS Parameter Block" */ typedef struct { - u_char secsiz[2]; /* sector size */ - u_char spc; /* sectors per cluster */ - u_char ressec[2]; /* reserved sectors */ - u_char fats; /* FATs */ - u_char dirents[2]; /* root directory entries */ - u_char secs[2]; /* total sectors */ - u_char media; /* media descriptor */ - u_char spf[2]; /* sectors per FAT */ - u_char spt[2]; /* sectors per track */ - u_char heads[2]; /* drive heads */ - u_char hidsec[4]; /* hidden sectors */ - u_char lsecs[4]; /* huge sectors */ - u_char lspf[4]; /* huge sectors per FAT */ - u_char xflg[2]; /* flags */ - u_char vers[2]; /* filesystem version */ - u_char rdcl[4]; /* root directory start cluster */ - u_char infs[2]; /* filesystem info sector */ - u_char bkbs[2]; /* backup boot sector */ + u_char secsiz[2]; /* sector size */ + u_char spc; /* sectors per cluster */ + u_char ressec[2]; /* reserved sectors */ + u_char fats; /* FATs */ + u_char dirents[2]; /* root directory entries */ + u_char secs[2]; /* total sectors */ + u_char media; /* media descriptor */ + u_char spf[2]; /* sectors per FAT */ + u_char spt[2]; /* sectors per track */ + u_char heads[2]; /* drive heads */ + u_char hidsec[4]; /* hidden sectors */ + u_char lsecs[4]; /* huge sectors */ + u_char lspf[4]; /* huge sectors per FAT */ + u_char xflg[2]; /* flags */ + u_char vers[2]; /* filesystem version */ + u_char rdcl[4]; /* root directory start cluster */ + u_char infs[2]; /* filesystem info sector */ + u_char bkbs[2]; /* backup boot sector */ } DOS_BPB; /* Initial portion of DOS boot sector */ typedef struct { - u_char jmp[3]; /* usually 80x86 'jmp' opcode */ - u_char oem[8]; /* OEM name and version */ - DOS_BPB bpb; /* BPB */ + u_char jmp[3]; /* usually 80x86 'jmp' opcode */ + u_char oem[8]; /* OEM name and version */ + DOS_BPB bpb; /* BPB */ } DOS_BS; /* Supply missing "." and ".." root directory entries */ static const char *const dotstr[2] = {".", ".."}; static DOS_DE dot[2] = { - {". ", " ", FA_DIR, {0, 0, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, - {0, 0}, {0x21, 0}, {0, 0}, {0, 0, 0, 0}}, - {".. ", " ", FA_DIR, {0, 0, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, - {0, 0}, {0x21, 0}, {0, 0}, {0, 0, 0, 0}} + {". ", " ", FA_DIR, {0, 0, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, + {0, 0}, {0x21, 0}, {0, 0}, {0, 0, 0, 0}}, + {".. ", " ", FA_DIR, {0, 0, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, + {0, 0}, {0x21, 0}, {0, 0}, {0, 0, 0, 0}} }; /* The usual conversion macros to avoid multiplication and division */ @@ -148,31 +148,31 @@ static int ioget(struct open_file *, daddr_t, void *, size_t); static int dos_read_fatblk(DOS_FS *fs, struct open_file *fd, u_int blknum) { - int err; - size_t io_size; - daddr_t offset_in_fat, max_offset_in_fat; - - offset_in_fat = ((daddr_t)blknum) * FATBLKSZ; - max_offset_in_fat = secbyt(fs->spf); - io_size = FATBLKSZ; - if (offset_in_fat > max_offset_in_fat) - offset_in_fat = max_offset_in_fat; - if (offset_in_fat + io_size > max_offset_in_fat) - io_size = ((size_t)(max_offset_in_fat - offset_in_fat)); - - if (io_size != 0) { - err = ioget(fd, fs->lsnfat + bytsec(offset_in_fat), - fs->fatbuf, io_size); - if (err != 0) { - fs->fatbuf_blknum = ((u_int)(-1)); - return (err); - } - } - if (io_size < FATBLKSZ) - memset(fs->fatbuf + io_size, 0, FATBLKSZ - io_size); - - fs->fatbuf_blknum = blknum; - return (0); + int err; + size_t io_size; + daddr_t offset_in_fat, max_offset_in_fat; + + offset_in_fat = ((daddr_t)blknum) * FATBLKSZ; + max_offset_in_fat = secbyt(fs->spf); + io_size = FATBLKSZ; + if (offset_in_fat > max_offset_in_fat) + offset_in_fat = max_offset_in_fat; + if (offset_in_fat + io_size > max_offset_in_fat) + io_size = ((size_t)(max_offset_in_fat - offset_in_fat)); + + if (io_size != 0) { + err = ioget(fd, fs->lsnfat + bytsec(offset_in_fat), + fs->fatbuf, io_size); + if (err != 0) { + fs->fatbuf_blknum = ((u_int)(-1)); + return (err); + } + } + if (io_size < FATBLKSZ) + memset(fs->fatbuf + io_size, 0, FATBLKSZ - io_size); + + fs->fatbuf_blknum = blknum; + return (0); } /* @@ -181,38 +181,38 @@ dos_read_fatblk(DOS_FS *fs, struct open_file *fd, u_int blknum) static int dos_mount(DOS_FS *fs, struct open_file *fd) { - int err; - u_char *buf; - - bzero(fs, sizeof(DOS_FS)); - fs->fd = fd; - - if ((buf = malloc(secbyt(1))) == NULL) - return (errno); - if ((err = ioget(fs->fd, 0, buf, secbyt(1))) || - (err = parsebs(fs, (DOS_BS *)buf))) { - free(buf); - return (err); - } - free(buf); - - if ((fs->fatbuf = malloc(FATBLKSZ)) == NULL) - return (errno); - err = dos_read_fatblk(fs, fd, 0); - if (err != 0) { - free(fs->fatbuf); - return (err); - } - - fs->root = dot[0]; - fs->root.name[0] = ' '; - if (fs->fatsz == 32) { - fs->root.clus[0] = fs->rdcl & 0xff; - fs->root.clus[1] = (fs->rdcl >> 8) & 0xff; - fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff; - fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff; - } - return (0); + int err; + u_char *buf; + + bzero(fs, sizeof(DOS_FS)); + fs->fd = fd; + + if ((buf = malloc(secbyt(1))) == NULL) + return (errno); + if ((err = ioget(fs->fd, 0, buf, secbyt(1))) || + (err = parsebs(fs, (DOS_BS *)buf))) { + free(buf); + return (err); + } + free(buf); + + if ((fs->fatbuf = malloc(FATBLKSZ)) == NULL) + return (errno); + err = dos_read_fatblk(fs, fd, 0); + if (err != 0) { + free(fs->fatbuf); + return (err); + } + + fs->root = dot[0]; + fs->root.name[0] = ' '; + if (fs->fatsz == 32) { + fs->root.clus[0] = fs->rdcl & 0xff; + fs->root.clus[1] = (fs->rdcl >> 8) & 0xff; + fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff; + fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff; + } + return (0); } /* @@ -221,11 +221,11 @@ dos_mount(DOS_FS *fs, struct open_file *fd) static int dos_unmount(DOS_FS *fs) { - if (fs->links) - return (EBUSY); - free(fs->fatbuf); - free(fs); - return (0); + if (fs->links) + return (EBUSY); + free(fs->fatbuf); + free(fs); + return (0); } /* @@ -234,45 +234,45 @@ dos_unmount(DOS_FS *fs) static int dos_open(const char *path, struct open_file *fd) { - DOS_DE *de; - DOS_FILE *f; - DOS_FS *fs; - u_int size, clus; - int err; - - /* Allocate mount structure, associate with open */ - if ((fs = malloc(sizeof(DOS_FS))) == NULL) - return (errno); - if ((err = dos_mount(fs, fd))) { - free(fs); - return (err); - } - - if ((err = namede(fs, path, &de))) { - dos_unmount(fs); - return (err); - } - - clus = stclus(fs->fatsz, de); - size = cv4(de->size); - - if ((!(de->attr & FA_DIR) && (!clus != !size)) || - ((de->attr & FA_DIR) && size) || - (clus && !okclus(fs, clus))) { - dos_unmount(fs); - return (EINVAL); - } - if ((f = malloc(sizeof(DOS_FILE))) == NULL) { - err = errno; - dos_unmount(fs); - return (err); - } - bzero(f, sizeof(DOS_FILE)); - f->fs = fs; - fs->links++; - f->de = *de; - fd->f_fsdata = (void *)f; - return (0); + DOS_DE *de; + DOS_FILE *f; + DOS_FS *fs; + u_int size, clus; + int err; + + /* Allocate mount structure, associate with open */ + if ((fs = malloc(sizeof(DOS_FS))) == NULL) + return (errno); + if ((err = dos_mount(fs, fd))) { + free(fs); + return (err); + } + + if ((err = namede(fs, path, &de))) { + dos_unmount(fs); + return (err); + } + + clus = stclus(fs->fatsz, de); + size = cv4(de->size); + + if ((!(de->attr & FA_DIR) && (!clus != !size)) || + ((de->attr & FA_DIR) && size) || + (clus && !okclus(fs, clus))) { + dos_unmount(fs); + return (EINVAL); + } + if ((f = malloc(sizeof(DOS_FILE))) == NULL) { + err = errno; + dos_unmount(fs); + return (err); + } + bzero(f, sizeof(DOS_FILE)); + f->fs = fs; + fs->links++; + f->de = *de; + fd->f_fsdata = (void *)f; + return (0); } /* @@ -281,57 +281,58 @@ dos_open(const char *path, struct open_file *fd) static int dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid) { - off_t size; - u_int nb, off, clus, c, cnt, n; - DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; - int err = 0; - - /* - * as ioget() can be called *a lot*, use twiddle here. - * also 4 seems to be good value not to slow loading down too much: - * with 270MB file (~540k ioget() calls, twiddle can easily waste 4-5sec. - */ - twiddle(4); - nb = (u_int)nbyte; - if ((size = fsize(f->fs, &f->de)) == -1) - return (EINVAL); - if (nb > (n = size - f->offset)) - nb = n; - off = f->offset; - if ((clus = stclus(f->fs->fatsz, &f->de))) - off &= f->fs->bsize - 1; - c = f->c; - cnt = nb; - while (cnt) { - n = 0; - if (!c) { - if ((c = clus)) - n = bytblk(f->fs, f->offset); - } else if (!off) - n++; - while (n--) { - if ((err = fatget(f->fs, &c))) - goto out; - if (!okclus(f->fs, c)) { - err = EINVAL; - goto out; - } + off_t size; + u_int nb, off, clus, c, cnt, n; + DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; + int err = 0; + + /* + * as ioget() can be called *a lot*, use twiddle here. + * also 4 seems to be good value not to slow loading down too much: + * with 270MB file (~540k ioget() calls, twiddle can easily waste + * 4-5 sec. + */ + twiddle(4); + nb = (u_int)nbyte; + if ((size = fsize(f->fs, &f->de)) == -1) + return (EINVAL); + if (nb > (n = size - f->offset)) + nb = n; + off = f->offset; + if ((clus = stclus(f->fs->fatsz, &f->de))) + off &= f->fs->bsize - 1; + c = f->c; + cnt = nb; + while (cnt) { + n = 0; + if (!c) { + if ((c = clus)) + n = bytblk(f->fs, f->offset); + } else if (!off) + n++; + while (n--) { + if ((err = fatget(f->fs, &c))) + goto out; + if (!okclus(f->fs, c)) { + err = EINVAL; + goto out; + } + } + if (!clus || (n = f->fs->bsize - off) > cnt) + n = cnt; + if ((err = ioread(f->fs, (c ? blkoff(f->fs, c) : + secbyt(f->fs->lsndir)) + off, buf, n))) + goto out; + f->offset += n; + f->c = c; + off = 0; + buf = (char *)buf + n; + cnt -= n; } - if (!clus || (n = f->fs->bsize - off) > cnt) - n = cnt; - if ((err = ioread(f->fs, (c ? blkoff(f->fs, c) : - secbyt(f->fs->lsndir)) + off, buf, n))) - goto out; - f->offset += n; - f->c = c; - off = 0; - buf = (char *)buf + n; - cnt -= n; - } - out: - if (resid) - *resid = nbyte - nb + cnt; - return (err); +out: + if (resid) + *resid = nbyte - nb + cnt; + return (err); } /* @@ -340,33 +341,33 @@ dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid) static off_t dos_seek(struct open_file *fd, off_t offset, int whence) { - off_t off; - u_int size; - DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; - - size = cv4(f->de.size); - switch (whence) { - case SEEK_SET: - off = 0; - break; - case SEEK_CUR: - off = f->offset; - break; - case SEEK_END: - off = size; - break; - default: - errno = EINVAL; - return (-1); - } - off += offset; - if (off < 0 || off > size) { - errno = EINVAL; - return (-1); - } - f->offset = (u_int)off; - f->c = 0; - return (off); + off_t off; + u_int size; + DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; + + size = cv4(f->de.size); + switch (whence) { + case SEEK_SET: + off = 0; + break; + case SEEK_CUR: + off = f->offset; + break; + case SEEK_END: + off = size; + break; + default: + errno = EINVAL; + return (-1); + } + off += offset; + if (off < 0 || off > size) { + errno = EINVAL; + return (-1); + } + f->offset = (u_int)off; + f->c = 0; + return (off); } /* @@ -375,13 +376,13 @@ dos_seek(struct open_file *fd, off_t offset, int whence) static int dos_close(struct open_file *fd) { - DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; - DOS_FS *fs = f->fs; + DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; + DOS_FS *fs = f->fs; - f->fs->links--; - free(f); - dos_unmount(fs); - return (0); + f->fs->links--; + free(f); + dos_unmount(fs); + return (0); } /* @@ -390,105 +391,106 @@ dos_close(struct open_file *fd) static int dos_stat(struct open_file *fd, struct stat *sb) { - DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; - - /* only important stuff */ - sb->st_mode = f->de.attr & FA_DIR ? S_IFDIR | 0555 : S_IFREG | 0444; - sb->st_nlink = 1; - sb->st_uid = 0; - sb->st_gid = 0; - if ((sb->st_size = fsize(f->fs, &f->de)) == -1) - return (EINVAL); - return (0); + DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; + + /* only important stuff */ + sb->st_mode = f->de.attr & FA_DIR ? S_IFDIR | 0555 : S_IFREG | 0444; + sb->st_nlink = 1; + sb->st_uid = 0; + sb->st_gid = 0; + if ((sb->st_size = fsize(f->fs, &f->de)) == -1) + return (EINVAL); + return (0); } static int dos_checksum(unsigned char *name, unsigned char *ext) { - int x, i; - char buf[11]; - - bcopy(name, buf, 8); - bcopy(ext, buf+8, 3); - x = 0; - for (i = 0; i < 11; i++) { - x = ((x & 1) << 7) | (x >> 1); - x += buf[i]; - x &= 0xff; - } - return (x); + int x, i; + char buf[11]; + + bcopy(name, buf, 8); + bcopy(ext, buf+8, 3); + x = 0; + for (i = 0; i < 11; i++) { + x = ((x & 1) << 7) | (x >> 1); + x += buf[i]; + x &= 0xff; + } + return (x); } static int dos_readdir(struct open_file *fd, struct dirent *d) { - /* DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; */ - u_char fn[261]; - DOS_DIR dd; - size_t res; - u_int chk, x, xdn; - int err; - - x = chk = 0; - while (1) { - xdn = x; - x = 0; - err = dos_read(fd, &dd, sizeof(dd), &res); - if (err) - return (err); - if (res == sizeof(dd)) - return (ENOENT); - if (dd.de.name[0] == 0) - return (ENOENT); - - /* Skip deleted entries */ - if (dd.de.name[0] == 0xe5) - continue; - - /* Check if directory entry is volume label */ - if (dd.de.attr & FA_LABEL) { - /* - * If volume label set, check if the current entry is - * extended entry (FA_XDE) for long file names. - */ - if ((dd.de.attr & FA_MASK) == FA_XDE) { - /* - * Read through all following extended entries - * to get the long file name. 0x40 marks the - * last entry containing part of long file name. - */ - if (dd.xde.seq & 0x40) - chk = dd.xde.chk; - else if (dd.xde.seq != xdn - 1 || dd.xde.chk != chk) - continue; - x = dd.xde.seq & ~0x40; - if (x < 1 || x > 20) { - x = 0; - continue; + /* DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; */ + u_char fn[261]; + DOS_DIR dd; + size_t res; + u_int chk, x, xdn; + int err; + + x = chk = 0; + for (;;) { + xdn = x; + x = 0; + err = dos_read(fd, &dd, sizeof(dd), &res); + if (err) + return (err); + if (res == sizeof(dd)) + return (ENOENT); + if (dd.de.name[0] == 0) + return (ENOENT); + + /* Skip deleted entries */ + if (dd.de.name[0] == 0xe5) + continue; + + /* Check if directory entry is volume label */ + if (dd.de.attr & FA_LABEL) { + /* + * If volume label set, check if the current entry is + * extended entry (FA_XDE) for long file names. + */ + if ((dd.de.attr & FA_MASK) == FA_XDE) { + /* + * Read through all following extended entries + * to get the long file name. 0x40 marks the + * last entry containing part of long file name. + */ + if (dd.xde.seq & 0x40) + chk = dd.xde.chk; + else if (dd.xde.seq != xdn - 1 || + dd.xde.chk != chk) + continue; + x = dd.xde.seq & ~0x40; + if (x < 1 || x > 20) { + x = 0; + continue; + } + cp_xdnm(fn, &dd.xde); + } else { + /* skip only volume label entries */ + continue; + } + } else { + if (xdn == 1) { + x = dos_checksum(dd.de.name, dd.de.ext); + if (x == chk) + break; + } else { + cp_sfn(fn, &dd.de); + break; + } + x = 0; } - cp_xdnm(fn, &dd.xde); - } else { - /* skip only volume label entries */ - continue; - } - } else { - if (xdn == 1) { - x = dos_checksum(dd.de.name, dd.de.ext); - if (x == chk) - break; - } else { - cp_sfn(fn, &dd.de); - break; - } - x = 0; } - } - d->d_fileno = (dd.de.clus[1] << 8) + dd.de.clus[0]; - d->d_reclen = sizeof(*d); - d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG; - memcpy(d->d_name, fn, sizeof(d->d_name)); - return (0); + d->d_fileno = (dd.de.clus[1] << 8) + dd.de.clus[0]; + d->d_reclen = sizeof(*d); + d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG; + memcpy(d->d_name, fn, sizeof(d->d_name)); + return (0); } /* @@ -497,47 +499,47 @@ dos_readdir(struct open_file *fd, struct dirent *d) static int parsebs(DOS_FS *fs, DOS_BS *bs) { - u_int sc; - - if ((bs->jmp[0] != 0x69 && - bs->jmp[0] != 0xe9 && - (bs->jmp[0] != 0xeb || bs->jmp[2] != 0x90)) || - bs->bpb.media < 0xf0) - return (EINVAL); - if (cv2(bs->bpb.secsiz) != SECSIZ) - return (EINVAL); - if (!(fs->spc = bs->bpb.spc) || fs->spc & (fs->spc - 1)) - return (EINVAL); - fs->bsize = secbyt(fs->spc); - fs->bshift = ffs(fs->bsize) - 1; - if ((fs->spf = cv2(bs->bpb.spf))) { - if (bs->bpb.fats != 2) - return (EINVAL); - if (!(fs->dirents = cv2(bs->bpb.dirents))) - return (EINVAL); - } else { - if (!(fs->spf = cv4(bs->bpb.lspf))) - return (EINVAL); - if (!bs->bpb.fats || bs->bpb.fats > 16) - return (EINVAL); - if ((fs->rdcl = cv4(bs->bpb.rdcl)) < LOCLUS) - return (EINVAL); - } - if (!(fs->lsnfat = cv2(bs->bpb.ressec))) - return (EINVAL); - fs->lsndir = fs->lsnfat + fs->spf * bs->bpb.fats; - fs->lsndta = fs->lsndir + entsec(fs->dirents); - if (!(sc = cv2(bs->bpb.secs)) && !(sc = cv4(bs->bpb.lsecs))) - return (EINVAL); - if (fs->lsndta > sc) - return (EINVAL); - if ((fs->xclus = secblk(fs, sc - fs->lsndta) + 1) < LOCLUS) - return (EINVAL); - fs->fatsz = fs->dirents ? fs->xclus < 0xff6 ? 12 : 16 : 32; - sc = (secbyt(fs->spf) << 1) / (fs->fatsz >> 2) - 1; - if (fs->xclus > sc) - fs->xclus = sc; - return (0); + u_int sc; + + if ((bs->jmp[0] != 0x69 && + bs->jmp[0] != 0xe9 && + (bs->jmp[0] != 0xeb || bs->jmp[2] != 0x90)) || + bs->bpb.media < 0xf0) + return (EINVAL); + if (cv2(bs->bpb.secsiz) != SECSIZ) + return (EINVAL); + if (!(fs->spc = bs->bpb.spc) || fs->spc & (fs->spc - 1)) + return (EINVAL); + fs->bsize = secbyt(fs->spc); + fs->bshift = ffs(fs->bsize) - 1; + if ((fs->spf = cv2(bs->bpb.spf))) { + if (bs->bpb.fats != 2) + return (EINVAL); + if (!(fs->dirents = cv2(bs->bpb.dirents))) + return (EINVAL); + } else { + if (!(fs->spf = cv4(bs->bpb.lspf))) + return (EINVAL); + if (!bs->bpb.fats || bs->bpb.fats > 16) + return (EINVAL); + if ((fs->rdcl = cv4(bs->bpb.rdcl)) < LOCLUS) + return (EINVAL); + } + if (!(fs->lsnfat = cv2(bs->bpb.ressec))) + return (EINVAL); + fs->lsndir = fs->lsnfat + fs->spf * bs->bpb.fats; + fs->lsndta = fs->lsndir + entsec(fs->dirents); + if (!(sc = cv2(bs->bpb.secs)) && !(sc = cv4(bs->bpb.lsecs))) + return (EINVAL); + if (fs->lsndta > sc) + return (EINVAL); + if ((fs->xclus = secblk(fs, sc - fs->lsndta) + 1) < LOCLUS) + return (EINVAL); + fs->fatsz = fs->dirents ? fs->xclus < 0xff6 ? 12 : 16 : 32; + sc = (secbyt(fs->spf) << 1) / (fs->fatsz >> 2) - 1; + if (fs->xclus > sc) + fs->xclus = sc; + return (0); } /* @@ -546,33 +548,33 @@ parsebs(DOS_FS *fs, DOS_BS *bs) static int namede(DOS_FS *fs, const char *path, DOS_DE **dep) { - char name[256]; - DOS_DE *de; - char *s; - size_t n; - int err; - - err = 0; - de = &fs->root; - while (*path) { - while (*path == '/') - path++; - if (*path == '\0') - break; - if (!(s = strchr(path, '/'))) - s = strchr(path, 0); - if ((n = s - path) > 255) - return (ENAMETOOLONG); - memcpy(name, path, n); - name[n] = 0; - path = s; - if (!(de->attr & FA_DIR)) - return (ENOTDIR); - if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de))) - return (err); - } - *dep = de; - return (0); + char name[256]; + DOS_DE *de; + char *s; + size_t n; + int err; + + err = 0; + de = &fs->root; + while (*path) { + while (*path == '/') + path++; + if (*path == '\0') + break; + if (!(s = strchr(path, '/'))) + s = strchr(path, 0); + if ((n = s - path) > 255) + return (ENAMETOOLONG); + memcpy(name, path, n); + name[n] = 0; + path = s; + if (!(de->attr & FA_DIR)) + return (ENOTDIR); + if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de))) + return (err); + } + *dep = de; + return (0); } /* @@ -581,78 +583,85 @@ namede(DOS_FS *fs, const char *path, DOS_DE **dep) static int lookup(DOS_FS *fs, u_int clus, const char *name, DOS_DE **dep) { - static DOS_DIR dir[DEPSEC]; - u_char lfn[261]; - u_char sfn[13]; - u_int nsec, lsec, xdn, chk, sec, ent, x; - int err, ok; - - if (!clus) - for (ent = 0; ent < 2; ent++) - if (!strcasecmp(name, dotstr[ent])) { - *dep = dot + ent; - return (0); - } - if (!clus && fs->fatsz == 32) - clus = fs->rdcl; - nsec = !clus ? entsec(fs->dirents) : fs->spc; - lsec = 0; - xdn = chk = 0; - for (;;) { - if (!clus && !lsec) - lsec = fs->lsndir; - else if (okclus(fs, clus)) - lsec = blklsn(fs, clus); - else - return (EINVAL); - for (sec = 0; sec < nsec; sec++) { - if ((err = ioget(fs->fd, lsec + sec, dir, secbyt(1)))) - return (err); - for (ent = 0; ent < DEPSEC; ent++) { - if (!*dir[ent].de.name) - return (ENOENT); - if (*dir[ent].de.name != 0xe5) { - if ((dir[ent].de.attr & FA_MASK) == FA_XDE) { - x = dir[ent].xde.seq; - if (x & 0x40 || (x + 1 == xdn && - dir[ent].xde.chk == chk)) { - if (x & 0x40) { - chk = dir[ent].xde.chk; - x &= ~0x40; - } - if (x >= 1 && x <= 20) { - cp_xdnm(lfn, &dir[ent].xde); - xdn = x; - continue; - } - } - } else if (!(dir[ent].de.attr & FA_LABEL)) { - if ((ok = xdn == 1)) { - x = dos_checksum(dir[ent].de.name, dir[ent].de.ext); - ok = chk == x && - !strcasecmp(name, (const char *)lfn); - } - if (!ok) { - cp_sfn(sfn, &dir[ent].de); - ok = !strcasecmp(name, (const char *)sfn); - } - if (ok) { - *dep = &dir[ent].de; - return (0); - } - } + static DOS_DIR dir[DEPSEC]; + u_char lfn[261]; + u_char sfn[13]; + u_int nsec, lsec, xdn, chk, sec, ent, x; + int err, ok; + + if (!clus) + for (ent = 0; ent < 2; ent++) + if (!strcasecmp(name, dotstr[ent])) { + *dep = dot + ent; + return (0); } - xdn = 0; - } - } - if (!clus) - break; - if ((err = fatget(fs, &clus))) - return (err); - if (fatend(fs->fatsz, clus)) - break; - } - return (ENOENT); + if (!clus && fs->fatsz == 32) + clus = fs->rdcl; + nsec = !clus ? entsec(fs->dirents) : fs->spc; + lsec = 0; + xdn = chk = 0; + for (;;) { + if (!clus && !lsec) + lsec = fs->lsndir; + else if (okclus(fs, clus)) + lsec = blklsn(fs, clus); + else + return (EINVAL); + for (sec = 0; sec < nsec; sec++) { + if ((err = ioget(fs->fd, lsec + sec, dir, secbyt(1)))) + return (err); + for (ent = 0; ent < DEPSEC; ent++) { + if (!*dir[ent].de.name) + return (ENOENT); + if (*dir[ent].de.name != 0xe5) { + if ((dir[ent].de.attr & FA_MASK) == + FA_XDE) { + x = dir[ent].xde.seq; + if (x & 0x40 || (x + 1 == xdn && + dir[ent].xde.chk == chk)) { + if (x & 0x40) { + chk = dir[ent].xde.chk; + x &= ~0x40; + } + if (x >= 1 && x <= 20) { + cp_xdnm(lfn, &dir[ent].xde); + xdn = x; + continue; + } + } + } else if (!(dir[ent].de.attr & + FA_LABEL)) { + if ((ok = xdn == 1)) { + x = dos_checksum( + dir[ent].de.name, + dir[ent].de.ext); + ok = chk == x && + !strcasecmp(name, + (const char *)lfn); + } + if (!ok) { + cp_sfn(sfn, + &dir[ent].de); + ok = !strcasecmp(name, *** 375 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Aug 19 15:00:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE25D66696E; Thu, 19 Aug 2021 15:00:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gr7HV4GJ9z4r0B; Thu, 19 Aug 2021 15:00:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79D7D2745F; Thu, 19 Aug 2021 15:00:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JF0cr8026227; Thu, 19 Aug 2021 15:00:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JF0c3s026226; Thu, 19 Aug 2021 15:00:38 GMT (envelope-from git) Date: Thu, 19 Aug 2021 15:00:38 GMT Message-Id: <202108191500.17JF0c3s026226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: fc7682b17f37 - main - e1000: Update intel shared code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc7682b17f3738573099b8b03f5628dcc8148adb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 15:00:38 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fc7682b17f3738573099b8b03f5628dcc8148adb commit fc7682b17f3738573099b8b03f5628dcc8148adb Author: Kevin Bowling AuthorDate: 2021-08-19 14:59:34 +0000 Commit: Kevin Bowling CommitDate: 2021-08-19 14:59:36 +0000 e1000: Update intel shared code Sync the e1000 shared code with DPDK shared code "cid-gigabit.2020.06.05.tar.gz released by ND" Primary focus was on client platforms (ich8lan). More work remains here but we need an Intel contact for client networking. Reviewed by: grehan, Intel Networking (erj, earlier rev) Obtained from: DPDK MFC after: 1 week Sponsored by: me Differential Revision: https://reviews.freebsd.org/D31547 --- sys/dev/e1000/e1000_80003es2lan.c | 36 ++--- sys/dev/e1000/e1000_80003es2lan.h | 38 ++--- sys/dev/e1000/e1000_82540.c | 40 ++--- sys/dev/e1000/e1000_82541.c | 40 ++--- sys/dev/e1000/e1000_82541.h | 40 ++--- sys/dev/e1000/e1000_82542.c | 40 ++--- sys/dev/e1000/e1000_82543.c | 40 ++--- sys/dev/e1000/e1000_82543.h | 40 ++--- sys/dev/e1000/e1000_82571.c | 42 ++--- sys/dev/e1000/e1000_82571.h | 40 ++--- sys/dev/e1000/e1000_82575.c | 40 ++--- sys/dev/e1000/e1000_82575.h | 40 ++--- sys/dev/e1000/e1000_api.c | 56 ++++--- sys/dev/e1000/e1000_api.h | 41 ++--- sys/dev/e1000/e1000_defines.h | 73 ++++++--- sys/dev/e1000/e1000_hw.h | 42 ++--- sys/dev/e1000/e1000_i210.c | 140 ++++++++++++++--- sys/dev/e1000/e1000_i210.h | 42 ++--- sys/dev/e1000/e1000_ich8lan.c | 316 ++++++++++++++++++++++++++++++-------- sys/dev/e1000/e1000_ich8lan.h | 47 +++--- sys/dev/e1000/e1000_mac.c | 40 ++--- sys/dev/e1000/e1000_mac.h | 40 ++--- sys/dev/e1000/e1000_manage.c | 40 ++--- sys/dev/e1000/e1000_manage.h | 40 ++--- sys/dev/e1000/e1000_mbx.c | 40 ++--- sys/dev/e1000/e1000_mbx.h | 40 ++--- sys/dev/e1000/e1000_nvm.c | 199 +++++++++++++++++++++--- sys/dev/e1000/e1000_nvm.h | 42 +++-- sys/dev/e1000/e1000_osdep.c | 40 ++--- sys/dev/e1000/e1000_osdep.h | 40 ++--- sys/dev/e1000/e1000_phy.c | 62 ++++---- sys/dev/e1000/e1000_phy.h | 49 +++--- sys/dev/e1000/e1000_regs.h | 55 ++++--- sys/dev/e1000/e1000_vf.c | 43 +++--- sys/dev/e1000/e1000_vf.h | 40 ++--- sys/dev/e1000/if_em.c | 10 +- 36 files changed, 1298 insertions(+), 755 deletions(-) diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index 5c0220adfc6f..c1aa47a73ac8 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its + + 3. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_80003es2lan.h b/sys/dev/e1000/e1000_80003es2lan.h index cbf0eafa9407..501cfc958819 100644 --- a/sys/dev/e1000/e1000_80003es2lan.h +++ b/sys/dev/e1000/e1000_80003es2lan.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index adc944a8ebb4..720798260f8a 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c index ead974cb1358..aaa3de7f02ce 100644 --- a/sys/dev/e1000/e1000_82541.c +++ b/sys/dev/e1000/e1000_82541.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82541.h b/sys/dev/e1000/e1000_82541.h index ce29548a4d85..d31065d9a182 100644 --- a/sys/dev/e1000/e1000_82541.h +++ b/sys/dev/e1000/e1000_82541.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82542.c b/sys/dev/e1000/e1000_82542.c index 09906699ab10..2fdf7066865b 100644 --- a/sys/dev/e1000/e1000_82542.c +++ b/sys/dev/e1000/e1000_82542.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index e247b01f6cda..42c4726fa8c7 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82543.h b/sys/dev/e1000/e1000_82543.h index 98289524f6d8..27f8507fb63c 100644 --- a/sys/dev/e1000/e1000_82543.h +++ b/sys/dev/e1000/e1000_82543.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index 348a3daa3c05..8db1fcb921a9 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -515,7 +515,7 @@ e1000_get_hw_semaphore_82574(struct e1000_hw *hw) u32 extcnf_ctrl; s32 i = 0; /* XXX assert that mutex is held */ - DEBUGFUNC("e1000_get_hw_semaphore_82573"); + DEBUGFUNC("e1000_get_hw_semaphore_82574"); ASSERT_CTX_LOCK_HELD(hw); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); diff --git a/sys/dev/e1000/e1000_82571.h b/sys/dev/e1000/e1000_82571.h index a39f63c53e2d..77303adb162f 100644 --- a/sys/dev/e1000/e1000_82571.h +++ b/sys/dev/e1000/e1000_82571.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 81bd419fcf0d..d588539ca8e8 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h index 36045556661b..22c2f8c4a2f5 100644 --- a/sys/dev/e1000/e1000_82575.h +++ b/sys/dev/e1000/e1000_82575.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index b1d5ef74c24f..b28ab77f3794 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -383,6 +383,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) break; case E1000_DEV_ID_I210_COPPER_FLASHLESS: case E1000_DEV_ID_I210_SERDES_FLASHLESS: + case E1000_DEV_ID_I210_SGMII_FLASHLESS: case E1000_DEV_ID_I210_COPPER: case E1000_DEV_ID_I210_COPPER_OEM1: case E1000_DEV_ID_I210_COPPER_IT: @@ -1268,6 +1269,21 @@ s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size) return e1000_read_pba_length_generic(hw, pba_num_size); } +/** + * e1000_read_pba_num - Read device part number + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + * Currently no func pointer exists and all implementations are handled in the + * generic version of this function. + **/ +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) +{ + return e1000_read_pba_num_generic(hw, pba_num); +} + /** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index bf5f637cb3dd..b558b1cf5f23 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -100,6 +100,7 @@ void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); void e1000_reload_nvm(struct e1000_hw *hw); s32 e1000_update_nvm_checksum(struct e1000_hw *hw); s32 e1000_validate_nvm_checksum(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 262b01dd5b64..6c1138ed9335 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -1070,11 +1070,44 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 +#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 +#define NVM_ETRACK_WORD 0x0042 +#define NVM_ETRACK_HIWORD 0x0043 +#define NVM_COMB_VER_OFF 0x0083 +#define NVM_COMB_VER_PTR 0x003D + +/* NVM version defines */ +#define NVM_MAJOR_MASK 0xF000 +#define NVM_MINOR_MASK 0x0FF0 +#define NVM_IMAGE_ID_MASK 0x000F +#define NVM_COMB_VER_MASK 0x00FF +#define NVM_MAJOR_SHIFT 12 +#define NVM_MINOR_SHIFT 4 +#define NVM_COMB_VER_SHFT 8 +#define NVM_VER_INVALID 0xFFFF +#define NVM_ETRACK_SHIFT 16 +#define NVM_ETRACK_VALID 0x8000 *** 2216 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Aug 19 17:17:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E67E6689E9; Thu, 19 Aug 2021 17:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrBK16Ydfz3H4g; Thu, 19 Aug 2021 17:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA28D15BB; Thu, 19 Aug 2021 17:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JHH93v003804; Thu, 19 Aug 2021 17:17:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JHH94b003803; Thu, 19 Aug 2021 17:17:09 GMT (envelope-from git) Date: Thu, 19 Aug 2021 17:17:09 GMT Message-Id: <202108191717.17JHH94b003803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c81ea895b563 - main - Disable the accelerated arm64 sha25 in static libraries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c81ea895b563c4d1e39468a8525284b7474fe850 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 17:17:10 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c81ea895b563c4d1e39468a8525284b7474fe850 commit c81ea895b563c4d1e39468a8525284b7474fe850 Author: Andrew Turner AuthorDate: 2021-08-19 16:48:30 +0000 Commit: Andrew Turner CommitDate: 2021-08-19 16:48:30 +0000 Disable the accelerated arm64 sha25 in static libraries We don't have ifunc support in static arm64 binaries. Until we do disable the accelerated sha256 code in a static libmd as it uses an ifunc. Reported by: brd Sponsored by: The FreeBSD Foundation --- lib/libmd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile index 480796ae5029..ee92b7cb71ab 100644 --- a/lib/libmd/Makefile +++ b/lib/libmd/Makefile @@ -131,7 +131,7 @@ ACFLAGS+= -DELF -Wa,--noexecstack .endif .if ${MACHINE_CPUARCH} == "aarch64" SRCS+= sha256c_arm64.c -CFLAGS+= -DARM64_SHA2 +SHARED_CFLAGS+= -DARM64_SHA2 CFLAGS.sha256c_arm64.c+= -march=armv8-a+crypto .endif .endif # ${USE_ASM_SOURCES} != 0 From owner-dev-commits-src-all@freebsd.org Thu Aug 19 17:38:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BE66668E26; Thu, 19 Aug 2021 17:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrBp11rzlz3JcM; Thu, 19 Aug 2021 17:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2787C1B9E; Thu, 19 Aug 2021 17:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JHcnCQ030498; Thu, 19 Aug 2021 17:38:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JHcn3A030497; Thu, 19 Aug 2021 17:38:49 GMT (envelope-from git) Date: Thu, 19 Aug 2021 17:38:49 GMT Message-Id: <202108191738.17JHcn3A030497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 298ee47e1988 - main - localedef: unbreak WITHOUT_LOCALES MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 298ee47e1988a120249b24470c2c7c45f8c4359f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 17:38:49 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=298ee47e1988a120249b24470c2c7c45f8c4359f commit 298ee47e1988a120249b24470c2c7c45f8c4359f Author: Bjoern A. Zeeb AuthorDate: 2021-08-19 17:27:04 +0000 Commit: Kyle Evans CommitDate: 2021-08-19 17:38:17 +0000 localedef: unbreak WITHOUT_LOCALES After 0fa5403d493b ("pkgbase: move locales into their own package") we need usr.bin/localedef as a bootstrap tool independent on where WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8. At the same time LOCALES= in the local Makefile is empty but C.UTF-8 with WITHOUT_LOCALES. C.UTF-8 is excluded from FILES, and thus after the replacement FILES= is set to only .LC_CTYPE which results in a build failure not knowing how to build that. Tweak the substitution to replace only non-empty words so that FILES remains harmlessly empty. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31589 --- Makefile.inc1 | 3 +-- share/ctypedef/Makefile | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index eb69d660cede..5bb2412e4042 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2353,10 +2353,9 @@ ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal .endif -.if ${MK_LOCALES} != "no" +# C.UTF-8 is always built in share/ctypes and we need localedef for that. _localedef= usr.bin/localedef ${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend} -.endif .if ${MK_ICONV} != "no" _mkesdb= usr.bin/mkesdb diff --git a/share/ctypedef/Makefile b/share/ctypedef/Makefile index 798576f7ad08..d8b00bfb8acc 100644 --- a/share/ctypedef/Makefile +++ b/share/ctypedef/Makefile @@ -218,7 +218,7 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) # C.UTF-8 is the default locale, so it should always been installed. ALWAYS= C.UTF-8.LC_CTYPE -FILES= ${LOCALES:NC.UTF-8:S/$/.LC_CTYPE/} +FILES= ${LOCALES:NC.UTF-8:C/.+$/&.LC_CTYPE/} CLEANFILES= ${FILES} .for f t in ${SAME} From owner-dev-commits-src-all@freebsd.org Thu Aug 19 17:48:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C77D2668FD3; Thu, 19 Aug 2021 17:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrC1L4vxbz3JnW; Thu, 19 Aug 2021 17:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 908CF1D0B; Thu, 19 Aug 2021 17:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JHmc4W043746; Thu, 19 Aug 2021 17:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JHmcCO043745; Thu, 19 Aug 2021 17:48:38 GMT (envelope-from git) Date: Thu, 19 Aug 2021 17:48:38 GMT Message-Id: <202108191748.17JHmcCO043745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: db7f7446b5bc - main - crunchgen: sprinkle some const-poisoning around MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db7f7446b5bcb26c7aaf13c8151b4ae8051c5732 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 17:48:38 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=db7f7446b5bcb26c7aaf13c8151b4ae8051c5732 commit db7f7446b5bcb26c7aaf13c8151b4ae8051c5732 Author: Kyle Evans AuthorDate: 2021-08-19 06:13:13 +0000 Commit: Kyle Evans CommitDate: 2021-08-19 17:47:08 +0000 crunchgen: sprinkle some const-poisoning around Reviewed by: arichardson, imp Differential Revision: https://reviews.freebsd.org/D31607 --- usr.sbin/crunch/crunchgen/crunchgen.c | 10 +++++----- usr.sbin/crunch/crunchgen/mkskel.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index 95ed5ca6636a..c6cf2a08cc7b 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -96,8 +96,8 @@ char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN], execfname[MAXPATHLEN]; char tempfname[MAXPATHLEN], cachename[MAXPATHLEN], curfilename[MAXPATHLEN]; bool tempfname_initialized = false; char outhdrname[MAXPATHLEN] ; /* user-supplied header for *.mk */ -char *objprefix; /* where are the objects ? */ -char *path_make; +const char *objprefix; /* where are the objects ? */ +const char *path_make; int linenum = -1; int goterror = 0; @@ -123,7 +123,7 @@ void usage(void); void parse_conf_file(void); void gen_outputs(void); -extern char *crunched_skel[]; +extern const char *crunched_skel[]; int @@ -721,7 +721,7 @@ fillin_program_objs(prog_t *p, char *path) char *obj, *cp; int fd, rc; FILE *f; - char *objvar="OBJS"; + const char *objvar="OBJS"; strlst_t *s; char line[MAXLINELEN]; @@ -912,7 +912,7 @@ gen_output_makefile(void) void gen_output_cfile(void) { - char **cp; + const char **cp; FILE *outcf; prog_t *p; strlst_t *s; diff --git a/usr.sbin/crunch/crunchgen/mkskel.sh b/usr.sbin/crunch/crunchgen/mkskel.sh index fd53d78bbbac..274bb7274cbd 100644 --- a/usr.sbin/crunch/crunchgen/mkskel.sh +++ b/usr.sbin/crunch/crunchgen/mkskel.sh @@ -4,7 +4,7 @@ cat < Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3789668C33; Thu, 19 Aug 2021 17:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrC1M689yz3Jbl; Thu, 19 Aug 2021 17:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBAAF1D0C; Thu, 19 Aug 2021 17:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JHmdNI043770; Thu, 19 Aug 2021 17:48:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JHmdai043769; Thu, 19 Aug 2021 17:48:39 GMT (envelope-from git) Date: Thu, 19 Aug 2021 17:48:39 GMT Message-Id: <202108191748.17JHmdai043769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: dd7c7ff192d0 - main - crunchide: address complaints from WARNS=6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd7c7ff192d07912fb7f5874868649c3aa05944a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 17:48:40 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=dd7c7ff192d07912fb7f5874868649c3aa05944a commit dd7c7ff192d07912fb7f5874868649c3aa05944a Author: Kyle Evans AuthorDate: 2021-08-19 06:17:36 +0000 Commit: Kyle Evans CommitDate: 2021-08-19 17:47:18 +0000 crunchide: address complaints from WARNS=6 - One (1) constify - One (1) argument is unused - One (1) local shadows a global - Various globals that should be static Reviewed by: arichardson, imp Differential Revision: https://reviews.freebsd.org/D31608 --- usr.sbin/crunch/crunchide/crunchide.c | 8 ++++---- usr.sbin/crunch/crunchide/exec_elf32.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/usr.sbin/crunch/crunchide/crunchide.c b/usr.sbin/crunch/crunchide/crunchide.c index b7eba3995173..324402501491 100644 --- a/usr.sbin/crunch/crunchide/crunchide.c +++ b/usr.sbin/crunch/crunchide/crunchide.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -char *pname = "crunchide"; +static const char *pname = "crunchide"; void usage(void); @@ -85,7 +85,7 @@ void add_file_to_keep_list(char *filename); int hide_syms(const char *filename); -int verbose; +static int verbose; int main(int, char *[]); @@ -137,7 +137,7 @@ usage(void) /* ---------------------------- */ -struct keep { +static struct keep { struct keep *next; char *sym; } *keep_list; @@ -206,7 +206,7 @@ add_file_to_keep_list(char *filename) /* ---------------------------- */ -struct { +static struct { const char *name; int (*check)(int, const char *); /* 1 if match, zero if not */ int (*hide)(int, const char *); /* non-zero if error */ diff --git a/usr.sbin/crunch/crunchide/exec_elf32.c b/usr.sbin/crunch/crunchide/exec_elf32.c index 28641107cc5c..f7b8601911fe 100644 --- a/usr.sbin/crunch/crunchide/exec_elf32.c +++ b/usr.sbin/crunch/crunchide/exec_elf32.c @@ -155,7 +155,7 @@ xrealloc(void *ptr, size_t size, const char *fn, const char *use) } int -ELFNAMEEND(check)(int fd, const char *fn) +ELFNAMEEND(check)(int fd, const char *fn __unused) { Elf_Ehdr eh; struct stat sb; @@ -435,12 +435,12 @@ ELFNAMEEND(hide)(int fd, const char *fn) * update section header table in ascending order of offset */ for (i = strtabidx + 1; i < shnum; i++) { - Elf_Off off, align; - off = xewtoh(layoutp[i - 1].shdr->sh_offset) + + Elf_Off soff, align; + soff = xewtoh(layoutp[i - 1].shdr->sh_offset) + xewtoh(layoutp[i - 1].shdr->sh_size); align = xewtoh(layoutp[i].shdr->sh_addralign); - off = (off + (align - 1)) & ~(align - 1); - layoutp[i].shdr->sh_offset = htoxew(off); + soff = (soff + (align - 1)) & ~(align - 1); + layoutp[i].shdr->sh_offset = htoxew(soff); } /* From owner-dev-commits-src-all@freebsd.org Thu Aug 19 17:48:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3BD36691D7; Thu, 19 Aug 2021 17:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrC1Q0wRpz3Jvj; Thu, 19 Aug 2021 17:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03F571E3B; Thu, 19 Aug 2021 17:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JHmfCH043829; Thu, 19 Aug 2021 17:48:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JHmfLs043828; Thu, 19 Aug 2021 17:48:41 GMT (envelope-from git) Date: Thu, 19 Aug 2021 17:48:41 GMT Message-Id: <202108191748.17JHmfLs043828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: bfd70233c3e2 - main - crunchgen: fix remaining issues under WARNS=6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bfd70233c3e2bc5c29db6f96fb90b58439908d29 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 17:48:42 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bfd70233c3e2bc5c29db6f96fb90b58439908d29 commit bfd70233c3e2bc5c29db6f96fb90b58439908d29 Author: Kyle Evans AuthorDate: 2021-08-19 06:22:16 +0000 Commit: Kyle Evans CommitDate: 2021-08-19 17:47:48 +0000 crunchgen: fix remaining issues under WARNS=6 Entirely variables that should be static, save for one 'no previous declaration' in mkskel.sh. Reviewed by: arichardson, imp Differential Revision: https://reviews.freebsd.org/D31610 --- usr.sbin/crunch/crunchgen/crunchgen.c | 43 ++++++++++++++++++----------------- usr.sbin/crunch/crunchgen/mkskel.sh | 1 + 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index c6cf2a08cc7b..94792c5ec50b 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -85,27 +85,28 @@ typedef struct prog { /* global state */ -strlst_t *buildopts = NULL; -strlst_t *srcdirs = NULL; -strlst_t *libs = NULL; -strlst_t *libs_so = NULL; -prog_t *progs = NULL; - -char confname[MAXPATHLEN], infilename[MAXPATHLEN]; -char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN], execfname[MAXPATHLEN]; -char tempfname[MAXPATHLEN], cachename[MAXPATHLEN], curfilename[MAXPATHLEN]; -bool tempfname_initialized = false; -char outhdrname[MAXPATHLEN] ; /* user-supplied header for *.mk */ -const char *objprefix; /* where are the objects ? */ -const char *path_make; -int linenum = -1; -int goterror = 0; - -int verbose, readcache; /* options */ -int reading_cache; -int makeobj = 0; /* add 'make obj' rules to the makefile */ - -int list_mode; +static strlst_t *buildopts = NULL; +static strlst_t *srcdirs = NULL; +static strlst_t *libs = NULL; +static strlst_t *libs_so = NULL; +static prog_t *progs = NULL; + +static char confname[MAXPATHLEN], infilename[MAXPATHLEN]; +static char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN], execfname[MAXPATHLEN]; +static char tempfname[MAXPATHLEN], cachename[MAXPATHLEN]; +static char curfilename[MAXPATHLEN]; +static bool tempfname_initialized = false; +static char outhdrname[MAXPATHLEN] ; /* user-supplied header for *.mk */ +static const char *objprefix; /* where are the objects ? */ +static const char *path_make; +static int linenum = -1; +static int goterror = 0; + +static int verbose, readcache; /* options */ +static int reading_cache; +static int makeobj = 0; /* add 'make obj' rules to the makefile */ + +static int list_mode; /* general library routines */ diff --git a/usr.sbin/crunch/crunchgen/mkskel.sh b/usr.sbin/crunch/crunchgen/mkskel.sh index 274bb7274cbd..3e5a1618e4ad 100644 --- a/usr.sbin/crunch/crunchgen/mkskel.sh +++ b/usr.sbin/crunch/crunchgen/mkskel.sh @@ -4,6 +4,7 @@ cat < Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 329E3668FD6; Thu, 19 Aug 2021 17:48:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrC1N6wXBz3Jbt; Thu, 19 Aug 2021 17:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2B031D0D; Thu, 19 Aug 2021 17:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JHmeGd043802; Thu, 19 Aug 2021 17:48:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JHmep3043801; Thu, 19 Aug 2021 17:48:40 GMT (envelope-from git) Date: Thu, 19 Aug 2021 17:48:40 GMT Message-Id: <202108191748.17JHmep3043801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 7ff87026d65c - main - crunchide: static'ify remaining non-exported functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ff87026d65c77f90391ead3f2fc752223d16e01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 17:48:41 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7ff87026d65c77f90391ead3f2fc752223d16e01 commit 7ff87026d65c77f90391ead3f2fc752223d16e01 Author: Kyle Evans AuthorDate: 2021-08-19 06:29:02 +0000 Commit: Kyle Evans CommitDate: 2021-08-19 17:47:32 +0000 crunchide: static'ify remaining non-exported functions Reviewed by: arichardson, imp Differential Revision: https://reviews.freebsd.org/D31609 --- usr.sbin/crunch/crunchide/crunchide.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/crunch/crunchide/crunchide.c b/usr.sbin/crunch/crunchide/crunchide.c index 324402501491..1f2f98893bac 100644 --- a/usr.sbin/crunch/crunchide/crunchide.c +++ b/usr.sbin/crunch/crunchide/crunchide.c @@ -78,12 +78,12 @@ __FBSDID("$FreeBSD$"); static const char *pname = "crunchide"; -void usage(void); +static void usage(void); -void add_to_keep_list(char *symbol); -void add_file_to_keep_list(char *filename); +static void add_to_keep_list(char *symbol); +static void add_file_to_keep_list(char *filename); -int hide_syms(const char *filename); +static int hide_syms(const char *filename); static int verbose; @@ -126,7 +126,7 @@ main(int argc, char **argv) return errors; } -void +static void usage(void) { fprintf(stderr, @@ -142,7 +142,7 @@ static struct keep { char *sym; } *keep_list; -void +static void add_to_keep_list(char *symbol) { struct keep *newp, *prevp, *curp; @@ -182,7 +182,7 @@ in_keep_list(const char *symbol) return curp && cmp == 0; } -void +static void add_file_to_keep_list(char *filename) { FILE *keepf; @@ -219,7 +219,7 @@ static struct { #endif }; -int +static int hide_syms(const char *filename) { int fd, i, n, rv; From owner-dev-commits-src-all@freebsd.org Thu Aug 19 17:48:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DAB66692F8; Thu, 19 Aug 2021 17:48:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrC1R1kXRz3Jrn; Thu, 19 Aug 2021 17:48:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24C9D1B68; Thu, 19 Aug 2021 17:48:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JHmhkr043853; Thu, 19 Aug 2021 17:48:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JHmhZ0043852; Thu, 19 Aug 2021 17:48:43 GMT (envelope-from git) Date: Thu, 19 Aug 2021 17:48:43 GMT Message-Id: <202108191748.17JHmhZ0043852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: d59c5e023d55 - main - crunch: drop WARNS override MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d59c5e023d558161e4f519b88d5209d8bab18bc7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 17:48:43 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d59c5e023d558161e4f519b88d5209d8bab18bc7 commit d59c5e023d558161e4f519b88d5209d8bab18bc7 Author: Kyle Evans AuthorDate: 2021-08-19 06:33:13 +0000 Commit: Kyle Evans CommitDate: 2021-08-19 17:48:00 +0000 crunch: drop WARNS override crunchide and crunchgen now build fine with default WARNS --- usr.sbin/crunch/Makefile.inc | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.sbin/crunch/Makefile.inc b/usr.sbin/crunch/Makefile.inc index 36175b7e5258..f8ffe675db6e 100644 --- a/usr.sbin/crunch/Makefile.inc +++ b/usr.sbin/crunch/Makefile.inc @@ -2,5 +2,3 @@ # modify to taste BINDIR?= /usr/bin - -WARNS?= 2 From owner-dev-commits-src-all@freebsd.org Thu Aug 19 19:24:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FC4166A8B8; Thu, 19 Aug 2021 19:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrF7V39X2z3jwy; Thu, 19 Aug 2021 19:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5633F3317; Thu, 19 Aug 2021 19:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17JJO6cW078700; Thu, 19 Aug 2021 19:24:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17JJO6WD078699; Thu, 19 Aug 2021 19:24:06 GMT (envelope-from git) Date: Thu, 19 Aug 2021 19:24:06 GMT Message-Id: <202108191924.17JJO6WD078699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: ced2dcadccfc - main - ls: prevent no-color build from complaining when COLORTERM is non-empty MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ced2dcadccfcff8f7991b3cb5f6f70d6710eadfb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 19:24:06 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=ced2dcadccfcff8f7991b3cb5f6f70d6710eadfb commit ced2dcadccfcff8f7991b3cb5f6f70d6710eadfb Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-18 20:47:37 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-08-19 19:22:16 +0000 ls: prevent no-color build from complaining when COLORTERM is non-empty As 257886 reports, if ls(1) is built with WITHOUT_LS_COLORS="YES", it issues a warning whenever COLORTERM is non-empty. The warning is not useful, so I thought to remove it, but as Ed pointed out, we may want to have a way to determine whether a particular copy of ls has been compiled with color support or not. Therefore move the warnx() call to the getopt loop in a WITHOUT_LS_COLORS build to fire when the user asks for colored output. PR: 257886 Reported by: Marko Turk Reviewed by: kevans --- bin/ls/ls.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 338b3d1d2a26..92575711251d 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -105,9 +105,7 @@ static void traverse(int, char **, int); static const struct option long_opts[] = { -#ifdef COLORLS {"color", optional_argument, NULL, COLOR_OPT}, -#endif {NULL, no_argument, NULL, 0} }; @@ -448,8 +446,8 @@ main(int argc, char *argv[]) case 'y': f_samesort = 1; break; -#ifdef COLORLS case COLOR_OPT: +#ifdef COLORLS if (optarg == NULL || do_color_always(optarg)) colorflag = COLORFLAG_ALWAYS; else if (do_color_auto(optarg)) @@ -460,6 +458,8 @@ main(int argc, char *argv[]) errx(2, "unsupported --color value '%s' (must be always, auto, or never)", optarg); break; +#else + warnx("color support not compiled in"); #endif default: case '?': @@ -503,8 +503,6 @@ main(int argc, char *argv[]) f_color = 1; explicitansi = true; } -#else - warnx("color support not compiled in"); #endif /*COLORLS*/ } From owner-dev-commits-src-all@freebsd.org Fri Aug 20 07:55:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76D7965B030; Fri, 20 Aug 2021 07:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrYpx2wDyz4wtq; Fri, 20 Aug 2021 07:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47C4F15790; Fri, 20 Aug 2021 07:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17K7trXa074998; Fri, 20 Aug 2021 07:55:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17K7trx6074997; Fri, 20 Aug 2021 07:55:53 GMT (envelope-from git) Date: Fri, 20 Aug 2021 07:55:53 GMT Message-Id: <202108200755.17K7trx6074997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: bcb195d91717 - main - Partial revert of f83f5d58394db57576bbed6dc7531997cabeb102 for uftdi(4). Apparently devices with bcdDevice less than 0x0600, have problems receiving ZLPs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcb195d91717bf182d27b9ce8cf0e43595c6e763 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 07:55:53 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=bcb195d91717bf182d27b9ce8cf0e43595c6e763 commit bcb195d91717bf182d27b9ce8cf0e43595c6e763 Author: Hans Petter Selasky AuthorDate: 2021-08-20 07:52:32 +0000 Commit: Hans Petter Selasky CommitDate: 2021-08-20 07:54:34 +0000 Partial revert of f83f5d58394db57576bbed6dc7531997cabeb102 for uftdi(4). Apparently devices with bcdDevice less than 0x0600, have problems receiving ZLPs. Reported by: kevlo@ MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/serial/uftdi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c index eaf4a9e78086..7fd531b3e381 100644 --- a/sys/dev/usb/serial/uftdi.c +++ b/sys/dev/usb/serial/uftdi.c @@ -1117,7 +1117,7 @@ uftdi_attach(device_t dev) } /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UFTDI_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UFTDI_BULK_DT_WR]); mtx_unlock(&sc->sc_mtx); /* set a valid "lcr" value */ @@ -1215,9 +1215,6 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - /* * If output packets don't require headers (the common case) we * can just load the buffer up with payload bytes all at once. From owner-dev-commits-src-all@freebsd.org Fri Aug 20 07:59:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A57F365B49C; Fri, 20 Aug 2021 07:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrYvT4MPNz4x7t; Fri, 20 Aug 2021 07:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DF361562D; Fri, 20 Aug 2021 07:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17K7xn36075670; Fri, 20 Aug 2021 07:59:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17K7xnNX075669; Fri, 20 Aug 2021 07:59:49 GMT (envelope-from git) Date: Fri, 20 Aug 2021 07:59:49 GMT Message-Id: <202108200759.17K7xnNX075669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 464a166c27bb - main - ufs_dirhash: Correct a typo in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 464a166c27bb8947d5de1f617170ef6813587cc3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 07:59:49 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=464a166c27bb8947d5de1f617170ef6813587cc3 commit 464a166c27bb8947d5de1f617170ef6813587cc3 Author: Gordon Bergling AuthorDate: 2021-08-20 07:59:18 +0000 Commit: Gordon Bergling CommitDate: 2021-08-20 07:59:18 +0000 ufs_dirhash: Correct a typo in a comment - s/memry/memory/ MFC after: 3 days --- sys/ufs/ufs/dirhash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ufs/dirhash.h b/sys/ufs/ufs/dirhash.h index d38c1112ff5c..1f9097e58af3 100644 --- a/sys/ufs/ufs/dirhash.h +++ b/sys/ufs/ufs/dirhash.h @@ -66,7 +66,7 @@ * placed at the most-recently-used end of the list. This helps a lot * in the worst-case case scenario where every directory access is * to a directory that is not hashed (i.e. the working set of hash - * candidates is much larger than the configured memry limit). In this + * candidates is much larger than the configured memory limit). In this * case it limits the number of hash builds to 1/DH_SCOREINIT of the * number of accesses. */ From owner-dev-commits-src-all@freebsd.org Fri Aug 20 09:32:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5F6265D0EE; Fri, 20 Aug 2021 09:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrbyS67Drz57g7; Fri, 20 Aug 2021 09:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA92B16752; Fri, 20 Aug 2021 09:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17K9WWRu010285; Fri, 20 Aug 2021 09:32:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17K9WWai010284; Fri, 20 Aug 2021 09:32:32 GMT (envelope-from git) Date: Fri, 20 Aug 2021 09:32:32 GMT Message-Id: <202108200932.17K9WWai010284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a90bcfbadd88 - stable/13 - rtld: style nits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a90bcfbadd88c0f6b6935b75c1a7821d9bd5883f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 09:32:33 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a90bcfbadd88c0f6b6935b75c1a7821d9bd5883f commit a90bcfbadd88c0f6b6935b75c1a7821d9bd5883f Author: Mariusz Zaborski AuthorDate: 2021-03-24 21:05:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-20 09:31:46 +0000 rtld: style nits (cherry picked from commit 852a88a1d92500028f1364a4afc58955190db7a5) --- libexec/rtld-elf/rtld.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 42abd8391386..ccf6c76773ba 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2485,30 +2485,31 @@ load_needed_objects(Obj_Entry *first, int flags) static int load_preload_objects(void) { - char *p = ld_preload; - Obj_Entry *obj; - static const char delim[] = " \t:;"; - - if (p == NULL) - return 0; + char *p = ld_preload; + Obj_Entry *obj; + static const char delim[] = " \t:;"; - p += strspn(p, delim); - while (*p != '\0') { - size_t len = strcspn(p, delim); - char savech; + if (p == NULL) + return (0); - savech = p[len]; - p[len] = '\0'; - obj = load_object(p, -1, NULL, 0); - if (obj == NULL) - return -1; /* XXX - cleanup */ - obj->z_interpose = true; - p[len] = savech; - p += len; p += strspn(p, delim); - } - LD_UTRACE(UTRACE_PRELOAD_FINISHED, NULL, NULL, 0, 0, NULL); - return 0; + while (*p != '\0') { + size_t len = strcspn(p, delim); + char savech; + + savech = p[len]; + p[len] = '\0'; + obj = load_object(p, -1, NULL, 0); + if (obj == NULL) + return (-1); /* XXX - cleanup */ + obj->z_interpose = true; + p[len] = savech; + p += len; + p += strspn(p, delim); + } + LD_UTRACE(UTRACE_PRELOAD_FINISHED, NULL, NULL, 0, 0, NULL); + + return (0); } static const char * From owner-dev-commits-src-all@freebsd.org Fri Aug 20 09:32:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 116CB65CBF3; Fri, 20 Aug 2021 09:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrbyT6tkyz57rG; Fri, 20 Aug 2021 09:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5EDF16B9D; Fri, 20 Aug 2021 09:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17K9WXLW010309; Fri, 20 Aug 2021 09:32:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17K9WXM7010308; Fri, 20 Aug 2021 09:32:33 GMT (envelope-from git) Date: Fri, 20 Aug 2021 09:32:33 GMT Message-Id: <202108200932.17K9WXM7010308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7b845dc144e4 - stable/13 - rtld: introduce PRELOAD_FDS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7b845dc144e47c629f78dcede957f497bcc71536 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 09:32:34 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7b845dc144e47c629f78dcede957f497bcc71536 commit 7b845dc144e47c629f78dcede957f497bcc71536 Author: Mariusz Zaborski AuthorDate: 2021-03-24 21:10:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-20 09:31:46 +0000 rtld: introduce PRELOAD_FDS (cherry picked from commit f90218886fc82e7b1fdb9e241adc5d713dadabe3) --- libexec/rtld-elf/rtld.1 | 10 ++- libexec/rtld-elf/rtld.c | 33 +++++++-- libexec/rtld-elf/tests/Makefile | 7 ++ libexec/rtld-elf/tests/common.c | 81 +++++++++++++++++++++ libexec/rtld-elf/tests/common.h | 43 +++++++++++ libexec/rtld-elf/tests/ld_library_pathfds.c | 56 +-------------- libexec/rtld-elf/tests/ld_preload_fds.c | 108 ++++++++++++++++++++++++++++ 7 files changed, 277 insertions(+), 61 deletions(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 41b010a2376c..118671624446 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2021 +.Dd March 24, 2021 .Dt RTLD 1 .Os .Sh NAME @@ -190,6 +190,14 @@ to be linked in before any other shared libraries. If the directory is not specified then the directories specified by +.It Ev LD_PRELOAD_PATH_FDS +A colon separated list of file descriptor numbers for libraries. +This is intended for preloading libraries in which we already have a file +descriptor. +This may optimize the process of loading libraries because we do not have to +look for them in directories. +It may also be useful in a capability base system where we do not have access to +global namespaces such as the filesystem. .Ev LD_LIBRARY_PATH will be searched first followed by the set of built-in standard directories. diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index ccf6c76773ba..f60872f12c52 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -123,7 +123,7 @@ static void linkmap_delete(Obj_Entry *); static void load_filtees(Obj_Entry *, int flags, RtldLockState *); static void unload_filtees(Obj_Entry *, RtldLockState *); static int load_needed_objects(Obj_Entry *, int); -static int load_preload_objects(void); +static int load_preload_objects(char *, bool); static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); static int obj_disable_relro(Obj_Entry *); @@ -213,6 +213,8 @@ static char *ld_library_path; /* Environment variable for search path */ static char *ld_library_dirs; /* Environment variable for library descriptors */ static char *ld_preload; /* Environment variable for libraries to load first */ +static char *ld_preload_fds; /* Environment variable for libraries represented by + descriptors */ static const char *ld_elf_hints_path; /* Environment variable for alternative hints path */ static const char *ld_tracing; /* Called from ldd to print libs */ static char *ld_utrace; /* Use utrace() to log events. */ @@ -569,7 +571,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) ld_bind_now = getenv(_LD("BIND_NOW")); - /* + /* * If the process is tainted, then we un-set the dangerous environment * variables. The process will be marked as tainted until setuid(2) * is called. If any child process calls setuid(2) we do not want any @@ -580,7 +582,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) unsetenv(_LD("LIBRARY_PATH")) || unsetenv(_LD("LIBRARY_PATH_FDS")) || unsetenv(_LD("LIBMAP_DISABLE")) || unsetenv(_LD("BIND_NOT")) || unsetenv(_LD("DEBUG")) || unsetenv(_LD("ELF_HINTS_PATH")) || - unsetenv(_LD("LOADFLTR")) || unsetenv(_LD("LIBRARY_PATH_RPATH"))) { + unsetenv(_LD("LOADFLTR")) || unsetenv(_LD("LIBRARY_PATH_RPATH")) || + unsetenv(_LD("PRELOAD_FDS"))) { _rtld_error("environment corrupt; aborting"); rtld_die(); } @@ -593,6 +596,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) ld_library_path = getenv(_LD("LIBRARY_PATH")); ld_library_dirs = getenv(_LD("LIBRARY_PATH_FDS")); ld_preload = getenv(_LD("PRELOAD")); + ld_preload_fds = getenv(_LD("PRELOAD_FDS")); ld_elf_hints_path = getenv(_LD("ELF_HINTS_PATH")); ld_loadfltr = getenv(_LD("LOADFLTR")) != NULL; library_path_rpath = getenv(_LD("LIBRARY_PATH_RPATH")); @@ -707,8 +711,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) if (!libmap_disable) libmap_disable = (bool)lm_init(libmap_override); + dbg("loading LD_PRELOAD_FDS libraries"); + if (load_preload_objects(ld_preload_fds, true) == -1) + rtld_die(); + dbg("loading LD_PRELOAD libraries"); - if (load_preload_objects() == -1) + if (load_preload_objects(ld_preload, false) == -1) rtld_die(); preload_tail = globallist_curr(TAILQ_LAST(&obj_list, obj_entry_q)); @@ -2483,9 +2491,8 @@ load_needed_objects(Obj_Entry *first, int flags) } static int -load_preload_objects(void) +load_preload_objects(char *p, bool isfd) { - char *p = ld_preload; Obj_Entry *obj; static const char delim[] = " \t:;"; @@ -2494,12 +2501,24 @@ load_preload_objects(void) p += strspn(p, delim); while (*p != '\0') { + const char *name; size_t len = strcspn(p, delim); char savech; + int fd; savech = p[len]; p[len] = '\0'; - obj = load_object(p, -1, NULL, 0); + if (isfd) { + name = NULL; + fd = parse_integer(p); + if (fd == -1) + return (-1); + } else { + name = p; + fd = -1; + } + + obj = load_object(name, fd, NULL, 0); if (obj == NULL) return (-1); /* XXX - cleanup */ obj->z_interpose = true; diff --git a/libexec/rtld-elf/tests/Makefile b/libexec/rtld-elf/tests/Makefile index 4ab69c1ab0ab..6b8b4e80333b 100644 --- a/libexec/rtld-elf/tests/Makefile +++ b/libexec/rtld-elf/tests/Makefile @@ -3,7 +3,14 @@ SUBDIR+= libpythagoras target SUBDIR_DEPEND_target= libpythagoras + ATF_TESTS_C= ld_library_pathfds +ATF_TESTS_C+= ld_preload_fds + +.for t in ${ATF_TESTS_C} +SRCS.$t= $t.c common.c +.endfor + WARNS?= 3 .include diff --git a/libexec/rtld-elf/tests/common.c b/libexec/rtld-elf/tests/common.c new file mode 100644 index 000000000000..6eb3edfbc14c --- /dev/null +++ b/libexec/rtld-elf/tests/common.c @@ -0,0 +1,81 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * Copyright 2014 Jonathan Anderson. + * Copyright 2021 Mariusz Zaborski + * + * 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 ``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. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include "common.h" + +void +expect_success(int binary, char *senv) +{ + char * const env[] = { senv, NULL }; + + try_to_run(binary, 0, env, "the hypotenuse of 3 and 4 is 5\n", ""); +} + +void +expect_missing_library(int binary, char *senv) +{ + char * const env[] = { senv, NULL }; + + try_to_run(binary, 1, env, "", + "ld-elf.so.1: Shared object \"libpythagoras.so.0\" not found," + " required by \"target\"\n"); +} + +void +try_to_run(int binary, int exit_status, char * const *env, + const char *expected_out, const char *expected_err) +{ + pid_t child = atf_utils_fork(); + + if (child == 0) { + char * const args[] = { "target", NULL }; + + fexecve(binary, args, env); + atf_tc_fail("fexecve() failed"); + } + + atf_utils_wait(child, exit_status, expected_out, expected_err); +} + +int +opendir(const char *name) +{ + + return open(name, O_RDONLY | O_DIRECTORY); +} + +int +opendirat(int parent, const char *name) +{ + + return openat(parent, name, O_RDONLY | O_DIRECTORY); +} diff --git a/libexec/rtld-elf/tests/common.h b/libexec/rtld-elf/tests/common.h new file mode 100644 index 000000000000..d5bf2050dcfd --- /dev/null +++ b/libexec/rtld-elf/tests/common.h @@ -0,0 +1,43 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * Copyright 2014 Jonathan Anderson. + * Copyright 2021 Mariusz Zaborski + * + * 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 ``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. + * + * $FreeBSD$ + */ + +#ifndef _LD_COMMON_H_ +#define _LD_COMMON_H_ + +#define TARGET_ELF_NAME "target" +#define TARGET_LIBRARY "libpythagoras.so.0" + +void expect_success(int binary, char *senv); +void expect_missing_library(int binary, char *senv); + +void try_to_run(int binary, int expected_exit_status, char * const *env, + const char *expected_out, const char *expected_err); +int opendir(const char *name); +int opendirat(int parent, const char *name); + +#endif /* _LD_COMMON_H_ */ diff --git a/libexec/rtld-elf/tests/ld_library_pathfds.c b/libexec/rtld-elf/tests/ld_library_pathfds.c index 5c6c2dabbcdb..bc0627d4c3d5 100644 --- a/libexec/rtld-elf/tests/ld_library_pathfds.c +++ b/libexec/rtld-elf/tests/ld_library_pathfds.c @@ -29,6 +29,7 @@ #include #include +#include "common.h" struct descriptors { int binary; @@ -38,14 +39,8 @@ struct descriptors { int usr; }; -static void setup(struct descriptors *, const atf_tc_t *); -static void expect_success(int binary, char *pathfds); -static void expect_missing_library(int binary, char *pathfds); -static void try_to_run(int binary, int expected_exit_status, - char * const *env, const char *expected_out, const char *expected_err); -static int opendir(const char *name); -static int opendirat(int parent, const char *name); +static void setup(struct descriptors *, const atf_tc_t *); ATF_TC_WITHOUT_HEAD(missing_library); @@ -167,55 +162,10 @@ setup(struct descriptors *dp, const atf_tc_t *tc) dp->testdir = opendir(atf_tc_get_config_var(tc, "srcdir")); ATF_REQUIRE(dp->testdir >= 0); ATF_REQUIRE( - (dp->binary = openat(dp->testdir, "target", O_RDONLY)) >= 0); + (dp->binary = openat(dp->testdir, TARGET_ELF_NAME, O_RDONLY)) >= 0); ATF_REQUIRE((dp->root = opendir("/")) >= 0); ATF_REQUIRE((dp->etc = opendirat(dp->root, "etc")) >= 0); ATF_REQUIRE((dp->usr = opendirat(dp->root, "usr")) >= 0); } -static void -expect_success(int binary, char *pathfds) -{ - char * const env[] = { pathfds, NULL }; - try_to_run(binary, 0, env, "the hypotenuse of 3 and 4 is 5\n", ""); -} - -static void -expect_missing_library(int binary, char *pathfds) -{ - char * const env[] = { pathfds, NULL }; - try_to_run(binary, 1, env, "", - "ld-elf.so.1: Shared object \"libpythagoras.so.0\" not found," - " required by \"target\"\n"); -} - - -static void -try_to_run(int binary, int exit_status, char * const *env, - const char *expected_out, const char *expected_err) -{ - pid_t child = atf_utils_fork(); - - if (child == 0) { - char * const args[] = { "target", NULL }; - - fexecve(binary, args, env); - atf_tc_fail("fexecve() failed"); - } - - atf_utils_wait(child, exit_status, expected_out, expected_err); -} - - -static int -opendir(const char *name) -{ - return open(name, O_RDONLY | O_DIRECTORY); -} - -static int -opendirat(int parent, const char *name) -{ - return openat(parent, name, O_RDONLY | O_DIRECTORY); -} diff --git a/libexec/rtld-elf/tests/ld_preload_fds.c b/libexec/rtld-elf/tests/ld_preload_fds.c new file mode 100644 index 000000000000..3a220b009bb6 --- /dev/null +++ b/libexec/rtld-elf/tests/ld_preload_fds.c @@ -0,0 +1,108 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * Copyright 2021 Mariusz Zaborski + * + * 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 ``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. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include "common.h" + +int binaryfd; +int libraryfd; + +static void +setup(const atf_tc_t *tc) +{ + int testdir; + + testdir = opendir(atf_tc_get_config_var(tc, "srcdir")); + ATF_REQUIRE(testdir >= 0); + + binaryfd = openat(testdir, TARGET_ELF_NAME, O_RDONLY); + ATF_REQUIRE(binaryfd >= 0); + libraryfd = openat(testdir, TARGET_LIBRARY, O_RDONLY); + ATF_REQUIRE(libraryfd >= 0); + + close(testdir); +} + +ATF_TC_WITHOUT_HEAD(missing_library); +ATF_TC_BODY(missing_library, tc) +{ + + setup(tc); + expect_missing_library(binaryfd, NULL); +} + +ATF_TC_WITHOUT_HEAD(bad_librarys); +ATF_TC_BODY(bad_librarys, tc) +{ + char *senv; + + ATF_REQUIRE(asprintf(&senv, "LD_PRELOAD_FDS=::") > 0); + + setup(tc); + expect_missing_library(binaryfd, senv); +} + +ATF_TC_WITHOUT_HEAD(single_library); +ATF_TC_BODY(single_library, tc) +{ + char *senv; + + setup(tc); + + ATF_REQUIRE( + asprintf(&senv, "LD_PRELOAD_FDS=%d", libraryfd) > 0); + + expect_success(binaryfd, senv); +} + +ATF_TC_WITHOUT_HEAD(two_librarys); +ATF_TC_BODY(two_librarys, tc) +{ + char *senv; + + setup(tc); + + ATF_REQUIRE( + asprintf(&senv, "LD_PRELOAD_FDS=%d:%d", libraryfd, libraryfd) > 0); + + expect_success(binaryfd, senv); +} + +/* Register test cases with ATF. */ +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, missing_library); + ATF_TP_ADD_TC(tp, bad_librarys); + ATF_TP_ADD_TC(tp, single_library); + ATF_TP_ADD_TC(tp, two_librarys); + + return atf_no_error(); +} From owner-dev-commits-src-all@freebsd.org Fri Aug 20 09:32:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3DA865CD55; Fri, 20 Aug 2021 09:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrbyW0k8Bz57tT; Fri, 20 Aug 2021 09:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0177616B9E; Fri, 20 Aug 2021 09:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17K9WYgH010340; Fri, 20 Aug 2021 09:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17K9WYYl010339; Fri, 20 Aug 2021 09:32:34 GMT (envelope-from git) Date: Fri, 20 Aug 2021 09:32:34 GMT Message-Id: <202108200932.17K9WYYl010339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 98ef339d4498 - stable/13 - rtld: fix the man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 98ef339d44989db316e196e37ebc90e9a9d6f8de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 09:32:35 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=98ef339d44989db316e196e37ebc90e9a9d6f8de commit 98ef339d44989db316e196e37ebc90e9a9d6f8de Author: Mariusz Zaborski AuthorDate: 2021-03-24 23:49:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-20 09:31:46 +0000 rtld: fix the man page (cherry picked from commit e086aff91c242a2decdf7dd1ceb5a0b3e723a53f) --- libexec/rtld-elf/rtld.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 118671624446..b6572caac811 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -190,7 +190,7 @@ to be linked in before any other shared libraries. If the directory is not specified then the directories specified by -.It Ev LD_PRELOAD_PATH_FDS +.It Ev LD_PRELOAD_FDS A colon separated list of file descriptor numbers for libraries. This is intended for preloading libraries in which we already have a file descriptor. From owner-dev-commits-src-all@freebsd.org Fri Aug 20 09:32:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6038D65D018; Fri, 20 Aug 2021 09:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrbyX1v2Jz57tX; Fri, 20 Aug 2021 09:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2597116866; Fri, 20 Aug 2021 09:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17K9WaAw010364; Fri, 20 Aug 2021 09:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17K9WarF010363; Fri, 20 Aug 2021 09:32:36 GMT (envelope-from git) Date: Fri, 20 Aug 2021 09:32:36 GMT Message-Id: <202108200932.17K9WarF010363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 02e46073bd8a - stable/13 - rtld: Round down relro_size MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 02e46073bd8a98a8c3adc96b1885b5e47ebb3d4f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 09:32:36 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=02e46073bd8a98a8c3adc96b1885b5e47ebb3d4f commit 02e46073bd8a98a8c3adc96b1885b5e47ebb3d4f Author: Konstantin Belousov AuthorDate: 2021-08-12 02:45:15 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-20 09:31:46 +0000 rtld: Round down relro_size (cherry picked from commit c9f833abf1d76ea194b82caafa06a0627790ad97) --- libexec/rtld-elf/map_object.c | 3 ++- libexec/rtld-elf/rtld.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 273e477fbda5..b725fe93b8f6 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -325,7 +325,8 @@ map_object(int fd, const char *path, const struct stat *sb) } obj->stack_flags = stack_flags; obj->relro_page = obj->relocbase + trunc_page(relro_page); - obj->relro_size = round_page(relro_size); + obj->relro_size = trunc_page(relro_page + relro_size) - + trunc_page(relro_page); if (note_start < note_end) digest_notes(obj, note_start, note_end); if (note_map != NULL) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index f60872f12c52..eaad89339d07 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1557,7 +1557,8 @@ digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t entry, const char *path) case PT_GNU_RELRO: obj->relro_page = obj->relocbase + trunc_page(ph->p_vaddr); - obj->relro_size = round_page(ph->p_memsz); + obj->relro_size = trunc_page(ph->p_vaddr + ph->p_memsz) - + trunc_page(ph->p_vaddr); break; case PT_NOTE: From owner-dev-commits-src-all@freebsd.org Fri Aug 20 12:01:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DDFE65F7AB; Fri, 20 Aug 2021 12:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrgGJ2k6nz3Prl; Fri, 20 Aug 2021 12:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45530188BC; Fri, 20 Aug 2021 12:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KC1SQ5006700; Fri, 20 Aug 2021 12:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KC1SmP006699; Fri, 20 Aug 2021 12:01:28 GMT (envelope-from git) Date: Fri, 20 Aug 2021 12:01:28 GMT Message-Id: <202108201201.17KC1SmP006699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: ce110ea12fce - main - Microsoft Azure Network Adapter(MANA) VF support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce110ea12fcea71ae437d0a1d0549d3d32055b0e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 12:01:28 -0000 The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=ce110ea12fcea71ae437d0a1d0549d3d32055b0e commit ce110ea12fcea71ae437d0a1d0549d3d32055b0e Author: Wei Hu AuthorDate: 2021-08-20 08:43:10 +0000 Commit: Wei Hu CommitDate: 2021-08-20 10:44:57 +0000 Microsoft Azure Network Adapter(MANA) VF support MANA is the new network adapter from Microsoft which will be available in Azure public cloud. It provides SRIOV NIC as virtual function to guest OS running on Hyper-V. The code can be divided into two major parts. Gdma_main.c is the one to bring up the hardware board and drives all underlying hardware queue infrastructure. Mana_en.c contains all main ethernet driver code. It has only tested and supported on amd64 architecture. PR: 256336 Reviewed by: decui@microsoft.com Tested by: whu MFC after: 2 week Relnotes: yes Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D31150 --- sys/conf/files.x86 | 6 + sys/dev/mana/gdma.h | 744 ++++++++++++ sys/dev/mana/gdma_main.c | 1961 ++++++++++++++++++++++++++++++++ sys/dev/mana/gdma_util.c | 96 ++ sys/dev/mana/gdma_util.h | 206 ++++ sys/dev/mana/hw_channel.c | 950 ++++++++++++++++ sys/dev/mana/hw_channel.h | 222 ++++ sys/dev/mana/mana.h | 689 +++++++++++ sys/dev/mana/mana_en.c | 2699 ++++++++++++++++++++++++++++++++++++++++++++ sys/dev/mana/mana_sysctl.c | 219 ++++ sys/dev/mana/mana_sysctl.h | 48 + sys/dev/mana/shm_channel.c | 337 ++++++ sys/dev/mana/shm_channel.h | 52 + sys/modules/Makefile | 2 + sys/modules/mana/Makefile | 12 + 15 files changed, 8243 insertions(+) diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index d0cda2da8580..925a3c5fe889 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -264,6 +264,12 @@ dev/isci/scil/scif_sas_task_request_states.c optional isci dev/isci/scil/scif_sas_timer.c optional isci dev/itwd/itwd.c optional itwd dev/kvm_clock/kvm_clock.c optional kvm_clock +dev/mana/gdma_main.c optional mana +dev/mana/mana_en.c optional mana +dev/mana/mana_sysctl.c optional mana +dev/mana/shm_channel.c optional mana +dev/mana/hw_channel.c optional mana +dev/mana/gdma_util.c optional mana dev/qat/qat.c optional qat dev/qat/qat_ae.c optional qat dev/qat/qat_c2xxx.c optional qat diff --git a/sys/dev/mana/gdma.h b/sys/dev/mana/gdma.h new file mode 100644 index 000000000000..097b2b65e545 --- /dev/null +++ b/sys/dev/mana/gdma.h @@ -0,0 +1,744 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Microsoft Corp. + * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _GDMA_H +#define _GDMA_H + +#include +#include +#include +#include +#include + +#include "gdma_util.h" +#include "shm_channel.h" + +/* Structures labeled with "HW DATA" are exchanged with the hardware. All of + * them are naturally aligned and hence don't need __packed. + */ + +#define GDMA_BAR0 0 + +#define GDMA_IRQNAME_SZ 40 + +struct gdma_bus { + bus_space_handle_t bar0_h; + bus_space_tag_t bar0_t; +}; + +struct gdma_msix_entry { + int entry; + int vector; +}; + +enum gdma_request_type { + GDMA_VERIFY_VF_DRIVER_VERSION = 1, + GDMA_QUERY_MAX_RESOURCES = 2, + GDMA_LIST_DEVICES = 3, + GDMA_REGISTER_DEVICE = 4, + GDMA_DEREGISTER_DEVICE = 5, + GDMA_GENERATE_TEST_EQE = 10, + GDMA_CREATE_QUEUE = 12, + GDMA_DISABLE_QUEUE = 13, + GDMA_CREATE_DMA_REGION = 25, + GDMA_DMA_REGION_ADD_PAGES = 26, + GDMA_DESTROY_DMA_REGION = 27, +}; + +enum gdma_queue_type { + GDMA_INVALID_QUEUE, + GDMA_SQ, + GDMA_RQ, + GDMA_CQ, + GDMA_EQ, +}; + +enum gdma_work_request_flags { + GDMA_WR_NONE = 0, + GDMA_WR_OOB_IN_SGL = BIT(0), + GDMA_WR_PAD_BY_SGE0 = BIT(1), +}; + +enum gdma_eqe_type { + GDMA_EQE_COMPLETION = 3, + GDMA_EQE_TEST_EVENT = 64, + GDMA_EQE_HWC_INIT_EQ_ID_DB = 129, + GDMA_EQE_HWC_INIT_DATA = 130, + GDMA_EQE_HWC_INIT_DONE = 131, +}; + +enum { + GDMA_DEVICE_NONE = 0, + GDMA_DEVICE_HWC = 1, + GDMA_DEVICE_MANA = 2, +}; + + +struct gdma_resource { + /* Protect the bitmap */ + struct mtx lock_spin; + + /* The bitmap size in bits. */ + uint32_t size; + + /* The bitmap tracks the resources. */ + unsigned long *map; +}; + +union gdma_doorbell_entry { + uint64_t as_uint64; + + struct { + uint64_t id : 24; + uint64_t reserved : 8; + uint64_t tail_ptr : 31; + uint64_t arm : 1; + } cq; + + struct { + uint64_t id : 24; + uint64_t wqe_cnt : 8; + uint64_t tail_ptr : 32; + } rq; + + struct { + uint64_t id : 24; + uint64_t reserved : 8; + uint64_t tail_ptr : 32; + } sq; + + struct { + uint64_t id : 16; + uint64_t reserved : 16; + uint64_t tail_ptr : 31; + uint64_t arm : 1; + } eq; +}; /* HW DATA */ + +struct gdma_msg_hdr { + uint32_t hdr_type; + uint32_t msg_type; + uint16_t msg_version; + uint16_t hwc_msg_id; + uint32_t msg_size; +}; /* HW DATA */ + +struct gdma_dev_id { + union { + struct { + uint16_t type; + uint16_t instance; + }; + + uint32_t as_uint32; + }; +}; /* HW DATA */ + +struct gdma_req_hdr { + struct gdma_msg_hdr req; + struct gdma_msg_hdr resp; /* The expected response */ + struct gdma_dev_id dev_id; + uint32_t activity_id; +}; /* HW DATA */ + +struct gdma_resp_hdr { + struct gdma_msg_hdr response; + struct gdma_dev_id dev_id; + uint32_t activity_id; + uint32_t status; + uint32_t reserved; +}; /* HW DATA */ + +struct gdma_general_req { + struct gdma_req_hdr hdr; +}; /* HW DATA */ + +#define GDMA_MESSAGE_V1 1 + +struct gdma_general_resp { + struct gdma_resp_hdr hdr; +}; /* HW DATA */ + +#define GDMA_STANDARD_HEADER_TYPE 0 + +static inline void +mana_gd_init_req_hdr(struct gdma_req_hdr *hdr, uint32_t code, + uint32_t req_size, uint32_t resp_size) +{ + hdr->req.hdr_type = GDMA_STANDARD_HEADER_TYPE; + hdr->req.msg_type = code; + hdr->req.msg_version = GDMA_MESSAGE_V1; + hdr->req.msg_size = req_size; + + hdr->resp.hdr_type = GDMA_STANDARD_HEADER_TYPE; + hdr->resp.msg_type = code; + hdr->resp.msg_version = GDMA_MESSAGE_V1; + hdr->resp.msg_size = resp_size; +} + +/* The 16-byte struct is part of the GDMA work queue entry (WQE). */ +struct gdma_sge { + uint64_t address; + uint32_t mem_key; + uint32_t size; +}; /* HW DATA */ + +struct gdma_wqe_request { + struct gdma_sge *sgl; + uint32_t num_sge; + + uint32_t inline_oob_size; + const void *inline_oob_data; + + uint32_t flags; + uint32_t client_data_unit; +}; + +enum gdma_page_type { + GDMA_PAGE_TYPE_4K, +}; + +#define GDMA_INVALID_DMA_REGION 0 + +struct gdma_mem_info { + device_t dev; + + bus_dma_tag_t dma_tag; + bus_dmamap_t dma_map; + bus_addr_t dma_handle; /* Physical address */ + void *virt_addr; /* Virtual address */ + uint64_t length; + + /* Allocated by the PF driver */ + uint64_t gdma_region; +}; + +#define REGISTER_ATB_MST_MKEY_LOWER_SIZE 8 + +struct gdma_dev { + struct gdma_context *gdma_context; + + struct gdma_dev_id dev_id; + + uint32_t pdid; + uint32_t doorbell; + uint32_t gpa_mkey; + + /* GDMA driver specific pointer */ + void *driver_data; +}; + +#define MINIMUM_SUPPORTED_PAGE_SIZE PAGE_SIZE + +#define GDMA_CQE_SIZE 64 +#define GDMA_EQE_SIZE 16 +#define GDMA_MAX_SQE_SIZE 512 +#define GDMA_MAX_RQE_SIZE 256 + +#define GDMA_COMP_DATA_SIZE 0x3C + +#define GDMA_EVENT_DATA_SIZE 0xC + +/* The WQE size must be a multiple of the Basic Unit, which is 32 bytes. */ +#define GDMA_WQE_BU_SIZE 32 + +#define INVALID_PDID UINT_MAX +#define INVALID_DOORBELL UINT_MAX +#define INVALID_MEM_KEY UINT_MAX +#define INVALID_QUEUE_ID UINT_MAX +#define INVALID_PCI_MSIX_INDEX UINT_MAX + +struct gdma_comp { + uint32_t cqe_data[GDMA_COMP_DATA_SIZE / 4]; + uint32_t wq_num; + bool is_sq; +}; + +struct gdma_event { + uint32_t details[GDMA_EVENT_DATA_SIZE / 4]; + uint8_t type; +}; + +struct gdma_queue; + +#define CQE_POLLING_BUFFER 512 + +typedef void gdma_eq_callback(void *context, struct gdma_queue *q, + struct gdma_event *e); + +typedef void gdma_cq_callback(void *context, struct gdma_queue *q); + +/* The 'head' is the producer index. For SQ/RQ, when the driver posts a WQE + * (Note: the WQE size must be a multiple of the 32-byte Basic Unit), the + * driver increases the 'head' in BUs rather than in bytes, and notifies + * the HW of the updated head. For EQ/CQ, the driver uses the 'head' to track + * the HW head, and increases the 'head' by 1 for every processed EQE/CQE. + * + * The 'tail' is the consumer index for SQ/RQ. After the CQE of the SQ/RQ is + * processed, the driver increases the 'tail' to indicate that WQEs have + * been consumed by the HW, so the driver can post new WQEs into the SQ/RQ. + * + * The driver doesn't use the 'tail' for EQ/CQ, because the driver ensures + * that the EQ/CQ is big enough so they can't overflow, and the driver uses + * the owner bits mechanism to detect if the queue has become empty. + */ +struct gdma_queue { + struct gdma_dev *gdma_dev; + + enum gdma_queue_type type; + uint32_t id; + + struct gdma_mem_info mem_info; + + void *queue_mem_ptr; + uint32_t queue_size; + + bool monitor_avl_buf; + + uint32_t head; + uint32_t tail; + + /* Extra fields specific to EQ/CQ. */ + union { + struct { + bool disable_needed; + + gdma_eq_callback *callback; + void *context; + + unsigned int msix_index; + + uint32_t log2_throttle_limit; + + struct task cleanup_task; + struct taskqueue *cleanup_tq; + int cpu; + bool do_not_ring_db; + + int work_done; + int budget; + } eq; + + struct { + gdma_cq_callback *callback; + void *context; + + /* For CQ/EQ relationship */ + struct gdma_queue *parent; + } cq; + }; +}; + +struct gdma_queue_spec { + enum gdma_queue_type type; + bool monitor_avl_buf; + unsigned int queue_size; + + /* Extra fields specific to EQ/CQ. */ + union { + struct { + gdma_eq_callback *callback; + void *context; + + unsigned long log2_throttle_limit; + + /* Only used by the MANA device. */ + struct ifnet *ndev; + } eq; + + struct { + gdma_cq_callback *callback; + void *context; + + struct gdma_queue *parent_eq; + + } cq; + }; +}; + +struct mana_eq { + struct gdma_queue *eq; + struct gdma_comp cqe_poll[CQE_POLLING_BUFFER]; +}; + +struct gdma_irq_context { + struct gdma_msix_entry msix_e; + struct resource *res; + driver_intr_t *handler; + void *arg; + void *cookie; + bool requested; + int cpu; + char name[GDMA_IRQNAME_SZ]; +}; + +struct gdma_context { + device_t dev; + + struct gdma_bus gd_bus; + + /* Per-vPort max number of queues */ + unsigned int max_num_queues; + unsigned int max_num_msix; + unsigned int num_msix_usable; + struct gdma_resource msix_resource; + struct gdma_irq_context *irq_contexts; + + /* This maps a CQ index to the queue structure. */ + unsigned int max_num_cqs; + struct gdma_queue **cq_table; + + /* Protect eq_test_event and test_event_eq_id */ + struct sx eq_test_event_sx; + struct completion eq_test_event; + uint32_t test_event_eq_id; + + struct resource *bar0; + struct resource *msix; + int msix_rid; + void __iomem *shm_base; + void __iomem *db_page_base; + uint32_t db_page_size; + + /* Shared memory chanenl (used to bootstrap HWC) */ + struct shm_channel shm_channel; + + /* Hardware communication channel (HWC) */ + struct gdma_dev hwc; + + /* Azure network adapter */ + struct gdma_dev mana; +}; + +#define MAX_NUM_GDMA_DEVICES 4 + +static inline bool mana_gd_is_mana(struct gdma_dev *gd) +{ + return gd->dev_id.type == GDMA_DEVICE_MANA; +} + +static inline bool mana_gd_is_hwc(struct gdma_dev *gd) +{ + return gd->dev_id.type == GDMA_DEVICE_HWC; +} + +uint8_t *mana_gd_get_wqe_ptr(const struct gdma_queue *wq, uint32_t wqe_offset); +uint32_t mana_gd_wq_avail_space(struct gdma_queue *wq); + +int mana_gd_test_eq(struct gdma_context *gc, struct gdma_queue *eq); + +int mana_gd_create_hwc_queue(struct gdma_dev *gd, + const struct gdma_queue_spec *spec, + struct gdma_queue **queue_ptr); + +int mana_gd_create_mana_eq(struct gdma_dev *gd, + const struct gdma_queue_spec *spec, + struct gdma_queue **queue_ptr); + +int mana_gd_create_mana_wq_cq(struct gdma_dev *gd, + const struct gdma_queue_spec *spec, + struct gdma_queue **queue_ptr); + +void mana_gd_destroy_queue(struct gdma_context *gc, struct gdma_queue *queue); + +int mana_gd_poll_cq(struct gdma_queue *cq, struct gdma_comp *comp, int num_cqe); + +void mana_gd_arm_cq(struct gdma_queue *cq); + +struct gdma_wqe { + uint32_t reserved :24; + uint32_t last_vbytes :8; + + union { + uint32_t flags; + + struct { + uint32_t num_sge :8; + uint32_t inline_oob_size_div4 :3; + uint32_t client_oob_in_sgl :1; + uint32_t reserved1 :4; + uint32_t client_data_unit :14; + uint32_t reserved2 :2; + }; + }; +}; /* HW DATA */ + +#define INLINE_OOB_SMALL_SIZE 8 +#define INLINE_OOB_LARGE_SIZE 24 + +#define MAX_TX_WQE_SIZE 512 +#define MAX_RX_WQE_SIZE 256 + +struct gdma_cqe { + uint32_t cqe_data[GDMA_COMP_DATA_SIZE / 4]; + + union { + uint32_t as_uint32; + + struct { + uint32_t wq_num :24; + uint32_t is_sq :1; + uint32_t reserved :4; + uint32_t owner_bits :3; + }; + } cqe_info; +}; /* HW DATA */ + +#define GDMA_CQE_OWNER_BITS 3 + +#define GDMA_CQE_OWNER_MASK ((1 << GDMA_CQE_OWNER_BITS) - 1) + +#define SET_ARM_BIT 1 + +#define GDMA_EQE_OWNER_BITS 3 + +union gdma_eqe_info { + uint32_t as_uint32; + + struct { + uint32_t type : 8; + uint32_t reserved1 : 8; + uint32_t client_id : 2; + uint32_t reserved2 : 11; + uint32_t owner_bits : 3; + }; +}; /* HW DATA */ + +#define GDMA_EQE_OWNER_MASK ((1 << GDMA_EQE_OWNER_BITS) - 1) +#define INITIALIZED_OWNER_BIT(log2_num_entries) (1UL << (log2_num_entries)) + +struct gdma_eqe { + uint32_t details[GDMA_EVENT_DATA_SIZE / 4]; + uint32_t eqe_info; +}; /* HW DATA */ + +#define GDMA_REG_DB_PAGE_OFFSET 8 +#define GDMA_REG_DB_PAGE_SIZE 0x10 +#define GDMA_REG_SHM_OFFSET 0x18 + +struct gdma_posted_wqe_info { + uint32_t wqe_size_in_bu; +}; + +/* GDMA_GENERATE_TEST_EQE */ +struct gdma_generate_test_event_req { + struct gdma_req_hdr hdr; + uint32_t queue_index; +}; /* HW DATA */ + +/* GDMA_VERIFY_VF_DRIVER_VERSION */ +enum { + GDMA_PROTOCOL_V1 = 1, + GDMA_PROTOCOL_FIRST = GDMA_PROTOCOL_V1, + GDMA_PROTOCOL_LAST = GDMA_PROTOCOL_V1, +}; + +struct gdma_verify_ver_req { + struct gdma_req_hdr hdr; + + /* Mandatory fields required for protocol establishment */ + uint64_t protocol_ver_min; + uint64_t protocol_ver_max; + uint64_t drv_cap_flags1; + uint64_t drv_cap_flags2; + uint64_t drv_cap_flags3; + uint64_t drv_cap_flags4; + + /* Advisory fields */ + uint64_t drv_ver; + uint32_t os_type; /* Linux = 0x10; Windows = 0x20; Other = 0x30 */ + uint32_t reserved; + uint32_t os_ver_major; + uint32_t os_ver_minor; + uint32_t os_ver_build; + uint32_t os_ver_platform; + uint64_t reserved_2; + uint8_t os_ver_str1[128]; + uint8_t os_ver_str2[128]; + uint8_t os_ver_str3[128]; + uint8_t os_ver_str4[128]; +}; /* HW DATA */ + +struct gdma_verify_ver_resp { + struct gdma_resp_hdr hdr; + uint64_t gdma_protocol_ver; + uint64_t pf_cap_flags1; + uint64_t pf_cap_flags2; + uint64_t pf_cap_flags3; + uint64_t pf_cap_flags4; +}; /* HW DATA */ + +/* GDMA_QUERY_MAX_RESOURCES */ +struct gdma_query_max_resources_resp { + struct gdma_resp_hdr hdr; + uint32_t status; + uint32_t max_sq; + uint32_t max_rq; + uint32_t max_cq; + uint32_t max_eq; + uint32_t max_db; + uint32_t max_mst; + uint32_t max_cq_mod_ctx; + uint32_t max_mod_cq; + uint32_t max_msix; +}; /* HW DATA */ + +/* GDMA_LIST_DEVICES */ +struct gdma_list_devices_resp { + struct gdma_resp_hdr hdr; + uint32_t num_of_devs; + uint32_t reserved; + struct gdma_dev_id devs[64]; +}; /* HW DATA */ + +/* GDMA_REGISTER_DEVICE */ +struct gdma_register_device_resp { + struct gdma_resp_hdr hdr; + uint32_t pdid; + uint32_t gpa_mkey; + uint32_t db_id; +}; /* HW DATA */ + +/* GDMA_CREATE_QUEUE */ +struct gdma_create_queue_req { + struct gdma_req_hdr hdr; + uint32_t type; + uint32_t reserved1; + uint32_t pdid; + uint32_t doolbell_id; + uint64_t gdma_region; + uint32_t reserved2; + uint32_t queue_size; + uint32_t log2_throttle_limit; + uint32_t eq_pci_msix_index; + uint32_t cq_mod_ctx_id; + uint32_t cq_parent_eq_id; + uint8_t rq_drop_on_overrun; + uint8_t rq_err_on_wqe_overflow; + uint8_t rq_chain_rec_wqes; + uint8_t sq_hw_db; + uint32_t reserved3; +}; /* HW DATA */ + +struct gdma_create_queue_resp { + struct gdma_resp_hdr hdr; + uint32_t queue_index; +}; /* HW DATA */ + +/* GDMA_DISABLE_QUEUE */ +struct gdma_disable_queue_req { + struct gdma_req_hdr hdr; + uint32_t type; + uint32_t queue_index; + uint32_t alloc_res_id_on_creation; +}; /* HW DATA */ + +/* GDMA_CREATE_DMA_REGION */ +struct gdma_create_dma_region_req { + struct gdma_req_hdr hdr; + + /* The total size of the DMA region */ + uint64_t length; + + /* The offset in the first page */ + uint32_t offset_in_page; + + /* enum gdma_page_type */ + uint32_t gdma_page_type; + + /* The total number of pages */ + uint32_t page_count; + + /* If page_addr_list_len is smaller than page_count, + * the remaining page addresses will be added via the + * message GDMA_DMA_REGION_ADD_PAGES. + */ + uint32_t page_addr_list_len; + uint64_t page_addr_list[]; +}; /* HW DATA */ + +struct gdma_create_dma_region_resp { + struct gdma_resp_hdr hdr; + uint64_t gdma_region; +}; /* HW DATA */ + +/* GDMA_DMA_REGION_ADD_PAGES */ +struct gdma_dma_region_add_pages_req { + struct gdma_req_hdr hdr; + + uint64_t gdma_region; + + uint32_t page_addr_list_len; + uint32_t reserved3; + + uint64_t page_addr_list[]; +}; /* HW DATA */ + +/* GDMA_DESTROY_DMA_REGION */ +struct gdma_destroy_dma_region_req { + struct gdma_req_hdr hdr; + + uint64_t gdma_region; +}; /* HW DATA */ + +int mana_gd_verify_vf_version(device_t dev); + +int mana_gd_register_device(struct gdma_dev *gd); +int mana_gd_deregister_device(struct gdma_dev *gd); + +int mana_gd_post_work_request(struct gdma_queue *wq, + const struct gdma_wqe_request *wqe_req, + struct gdma_posted_wqe_info *wqe_info); + +int mana_gd_post_and_ring(struct gdma_queue *queue, + const struct gdma_wqe_request *wqe, + struct gdma_posted_wqe_info *wqe_info); + +int mana_gd_alloc_res_map(uint32_t res_avil, struct gdma_resource *r, + const char *lock_name); +void mana_gd_free_res_map(struct gdma_resource *r); + +void mana_gd_wq_ring_doorbell(struct gdma_context *gc, + struct gdma_queue *queue); + +int mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length, + struct gdma_mem_info *gmi); + +void mana_gd_free_memory(struct gdma_mem_info *gmi); + +void mana_gd_dma_map_paddr(void *arg, bus_dma_segment_t *segs, + int nseg, int error); + +int mana_gd_send_request(struct gdma_context *gc, uint32_t req_len, + const void *req, uint32_t resp_len, void *resp); +#endif /* _GDMA_H */ diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c new file mode 100644 index 000000000000..910992ce17a4 --- /dev/null +++ b/sys/dev/mana/gdma_main.c @@ -0,0 +1,1961 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Microsoft Corp. + * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include "gdma_util.h" +#include "mana.h" + + +static mana_vendor_id_t mana_id_table[] = { + { PCI_VENDOR_ID_MICROSOFT, PCI_DEV_ID_MANA_VF}, + /* Last entry */ + { 0, 0} +}; + +static inline uint32_t +mana_gd_r32(struct gdma_context *g, uint64_t offset) +{ + uint32_t v = bus_space_read_4(g->gd_bus.bar0_t, + g->gd_bus.bar0_h, offset); + rmb(); + return (v); +} + +#if defined(__amd64__) +static inline uint64_t +mana_gd_r64(struct gdma_context *g, uint64_t offset) +{ + uint64_t v = bus_space_read_8(g->gd_bus.bar0_t, + g->gd_bus.bar0_h, offset); + rmb(); + return (v); +} +#else +static inline uint64_t +mana_gd_r64(struct gdma_context *g, uint64_t offset) +{ + uint64_t v; + uint32_t *vp = (uint32_t *)&v; + + *vp = mana_gd_r32(g, offset); + *(vp + 1) = mana_gd_r32(g, offset + 4); + rmb(); + return (v); +} +#endif + +static int +mana_gd_query_max_resources(device_t dev) +{ + struct gdma_context *gc = device_get_softc(dev); + struct gdma_query_max_resources_resp resp = {}; + struct gdma_general_req req = {}; + int err; + + mana_gd_init_req_hdr(&req.hdr, GDMA_QUERY_MAX_RESOURCES, + sizeof(req), sizeof(resp)); + + err = mana_gd_send_request(gc, sizeof(req), &req, sizeof(resp), &resp); + if (err || resp.hdr.status) { + device_printf(gc->dev, + "Failed to query resource info: %d, 0x%x\n", + err, resp.hdr.status); + return err ? err : EPROTO; + } + + mana_dbg(NULL, "max_msix %u, max_eq %u, max_cq %u, " + "max_sq %u, max_rq %u\n", + resp.max_msix, resp.max_eq, resp.max_cq, + resp.max_sq, resp.max_rq); + + if (gc->num_msix_usable > resp.max_msix) + gc->num_msix_usable = resp.max_msix; + + if (gc->num_msix_usable <= 1) + return ENOSPC; + + gc->max_num_queues = mp_ncpus; + if (gc->max_num_queues > MANA_MAX_NUM_QUEUES) + gc->max_num_queues = MANA_MAX_NUM_QUEUES; + + if (gc->max_num_queues > resp.max_eq) + gc->max_num_queues = resp.max_eq; + + if (gc->max_num_queues > resp.max_cq) + gc->max_num_queues = resp.max_cq; + + if (gc->max_num_queues > resp.max_sq) + gc->max_num_queues = resp.max_sq; + + if (gc->max_num_queues > resp.max_rq) + gc->max_num_queues = resp.max_rq; + + return 0; +} + +static int +mana_gd_detect_devices(device_t dev) +{ + struct gdma_context *gc = device_get_softc(dev); + struct gdma_list_devices_resp resp = {}; + struct gdma_general_req req = {}; + struct gdma_dev_id gd_dev; + uint32_t i, max_num_devs; + uint16_t dev_type; + int err; + + mana_gd_init_req_hdr(&req.hdr, GDMA_LIST_DEVICES, sizeof(req), + sizeof(resp)); + + err = mana_gd_send_request(gc, sizeof(req), &req, sizeof(resp), &resp); + if (err || resp.hdr.status) { + device_printf(gc->dev, + "Failed to detect devices: %d, 0x%x\n", err, + resp.hdr.status); *** 7409 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Aug 20 12:11:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FE0965FBA6; Fri, 20 Aug 2021 12:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrgV41lXVz3gyH; Fri, 20 Aug 2021 12:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24B3C187D5; Fri, 20 Aug 2021 12:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KCBeFt021550; Fri, 20 Aug 2021 12:11:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KCBeNX021549; Fri, 20 Aug 2021 12:11:40 GMT (envelope-from git) Date: Fri, 20 Aug 2021 12:11:40 GMT Message-Id: <202108201211.17KCBeNX021549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: a3665770d7d8 - main - sctp: improve handling of illegal parameters of INIT-ACK chunks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3665770d7d85e990f7703170a27f8e2d3e455b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 12:11:40 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a3665770d7d85e990f7703170a27f8e2d3e455b5 commit a3665770d7d85e990f7703170a27f8e2d3e455b5 Author: Michael Tuexen AuthorDate: 2021-08-20 12:03:49 +0000 Commit: Michael Tuexen CommitDate: 2021-08-20 12:06:41 +0000 sctp: improve handling of illegal parameters of INIT-ACK chunks MFC after: 3 days --- sys/netinet/sctp_input.c | 69 ++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 66ec2d6a577a..f579d10333fb 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1244,26 +1244,23 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, "sctp_handle_init_ack: TCB is null\n"); return (-1); } - init_ack = &cp->init; - /* Validate parameters. */ - if ((ntohl(init_ack->initiate_tag) == 0) || - (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) || - (ntohs(init_ack->num_inbound_streams) == 0) || - (ntohs(init_ack->num_outbound_streams) == 0)) { - /* protocol error... send an abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } - /* process according to association state... */ - switch (SCTP_GET_STATE(stcb)) { - case SCTP_STATE_COOKIE_WAIT: - /* this is the expected state for this chunk */ - /* process the INIT-ACK parameters */ + /* Only process the INIT-ACK chunk in COOKIE WAIT state. */ + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) { + init_ack = &cp->init; + /* Validate parameters. */ + if ((ntohl(init_ack->initiate_tag) == 0) || + (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) || + (ntohs(init_ack->num_inbound_streams) == 0) || + (ntohs(init_ack->num_outbound_streams) == 0)) { + /* One of the mandatory parameters is illegal. */ + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); + *abort_no_unlock = 1; + return (-1); + } if (stcb->asoc.primary_destination->dest_state & SCTP_ADDR_UNCONFIRMED) { /* @@ -1284,11 +1281,11 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, /* error in parsing parameters */ return (-1); } - /* update our state */ + /* Update our state. */ SCTPDBG(SCTP_DEBUG_INPUT2, "moving to COOKIE-ECHOED state\n"); SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_ECHOED); - /* reset the RTO calc */ + /* Reset the RTO calculation. */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, stcb->asoc.overall_error_count, @@ -1299,34 +1296,20 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, stcb->asoc.overall_error_count = 0; (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); /* - * collapse the init timer back in case of a exponential - * backoff + * Collapse the init timer back in case of a exponential + * backoff. */ sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, stcb->sctp_ep, stcb, net); /* - * the send at the end of the inbound data processing will - * cause the cookie to be sent + * The output routine at the end of the inbound data + * processing will cause the cookie to be sent. */ - break; - case SCTP_STATE_SHUTDOWN_SENT: - /* incorrect state... discard */ - break; - case SCTP_STATE_COOKIE_ECHOED: - /* incorrect state... discard */ - break; - case SCTP_STATE_OPEN: - /* incorrect state... discard */ - break; - case SCTP_STATE_EMPTY: - case SCTP_STATE_INUSE: - default: - /* incorrect state... discard */ + SCTPDBG(SCTP_DEBUG_INPUT1, "Leaving handle-init-ack end\n"); + return (0); + } else { return (-1); - break; } - SCTPDBG(SCTP_DEBUG_INPUT1, "Leaving handle-init-ack end\n"); - return (0); } static struct sctp_tcb * From owner-dev-commits-src-all@freebsd.org Fri Aug 20 12:42:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 062676602A6; Fri, 20 Aug 2021 12:42:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrhB46Qnpz3lJ2; Fri, 20 Aug 2021 12:42:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C50F719174; Fri, 20 Aug 2021 12:42:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KCgqr8063903; Fri, 20 Aug 2021 12:42:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KCgq2R063902; Fri, 20 Aug 2021 12:42:52 GMT (envelope-from git) Date: Fri, 20 Aug 2021 12:42:52 GMT Message-Id: <202108201242.17KCgq2R063902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8ad5619ec3b8 - stable/13 - ng_bridge: Use M_NOWAIT when allocating memory in the newhook routine MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ad5619ec3b848844cb278582e9a4a32ed0f863d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 12:42:53 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8ad5619ec3b848844cb278582e9a4a32ed0f863d commit 8ad5619ec3b848844cb278582e9a4a32ed0f863d Author: Mark Johnston AuthorDate: 2021-08-13 13:49:43 +0000 Commit: Mark Johnston CommitDate: 2021-08-20 12:42:43 +0000 ng_bridge: Use M_NOWAIT when allocating memory in the newhook routine newhook can be invoked by ngthread, which runs in a network epoch section and is thus not permitted to perform M_WAITOK allocations. Reported by: Jenkins Reviewed by: donner, afedorov Sponsored by: The FreeBSD Foundation (cherry picked from commit e0e3ded78a5d0859f3520c541726b815897ba7b0) --- sys/netgraph/ng_bridge.c | 84 ++++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 3f3d8b3c406e..9bcc7aac271b 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -154,6 +154,7 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ +static void ng_bridge_free_link(link_p link); static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); @@ -395,28 +396,36 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if(NG_PEER_NODE(hook) == node) return (ELOOP); - link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_WAITOK | M_ZERO); - - link->stats.recvOctets = counter_u64_alloc(M_WAITOK); - link->stats.recvPackets = counter_u64_alloc(M_WAITOK); - link->stats.recvMulticasts = counter_u64_alloc(M_WAITOK); - link->stats.recvBroadcasts = counter_u64_alloc(M_WAITOK); - link->stats.recvUnknown = counter_u64_alloc(M_WAITOK); - link->stats.recvRunts = counter_u64_alloc(M_WAITOK); - link->stats.recvInvalid = counter_u64_alloc(M_WAITOK); - link->stats.xmitOctets = counter_u64_alloc(M_WAITOK); - link->stats.xmitPackets = counter_u64_alloc(M_WAITOK); - link->stats.xmitMulticasts = counter_u64_alloc(M_WAITOK); - link->stats.xmitBroadcasts = counter_u64_alloc(M_WAITOK); - link->stats.loopDrops = counter_u64_alloc(M_WAITOK); - link->stats.memoryFailures = counter_u64_alloc(M_WAITOK); + link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO); + if (link == NULL) + return (ENOMEM); + +#define NG_BRIDGE_COUNTER_ALLOC(f) do { \ + link->stats.f = counter_u64_alloc(M_NOWAIT); \ + if (link->stats.f == NULL) \ + goto nomem; \ +} while (0) + NG_BRIDGE_COUNTER_ALLOC(recvOctets); + NG_BRIDGE_COUNTER_ALLOC(recvPackets); + NG_BRIDGE_COUNTER_ALLOC(recvMulticasts); + NG_BRIDGE_COUNTER_ALLOC(recvBroadcasts); + NG_BRIDGE_COUNTER_ALLOC(recvUnknown); + NG_BRIDGE_COUNTER_ALLOC(recvRunts); + NG_BRIDGE_COUNTER_ALLOC(recvInvalid); + NG_BRIDGE_COUNTER_ALLOC(xmitOctets); + NG_BRIDGE_COUNTER_ALLOC(xmitPackets); + NG_BRIDGE_COUNTER_ALLOC(xmitMulticasts); + NG_BRIDGE_COUNTER_ALLOC(xmitBroadcasts); + NG_BRIDGE_COUNTER_ALLOC(loopDrops); + NG_BRIDGE_COUNTER_ALLOC(memoryFailures); +#undef NG_BRIDGE_COUNTER_ALLOC link->hook = hook; if (isUplink) { link->learnMac = 0; link->sendUnknown = 1; if (priv->numLinks == 0) /* if the first link is an uplink */ - priv->sendUnknown = 0; /* switch to restrictive mode */ + priv->sendUnknown = 0; /* switch to restrictive mode */ } else { link->learnMac = 1; link->sendUnknown = priv->sendUnknown; @@ -425,12 +434,17 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) NG_HOOK_SET_PRIVATE(hook, link); priv->numLinks++; return (0); + +nomem: + ng_bridge_free_link(link); + return (ENOMEM); } /* * Receive a control message */ -static void ng_bridge_clear_link_stats(struct ng_bridge_link_kernel_stats * p) +static void +ng_bridge_clear_link_stats(struct ng_bridge_link_kernel_stats *p) { counter_u64_zero(p->recvOctets); counter_u64_zero(p->recvPackets); @@ -446,7 +460,26 @@ static void ng_bridge_clear_link_stats(struct ng_bridge_link_kernel_stats * p) counter_u64_zero(p->loopDrops); p->loopDetects = 0; counter_u64_zero(p->memoryFailures); -}; +} + +static void +ng_bridge_free_link(link_p link) +{ + counter_u64_free(link->stats.recvOctets); + counter_u64_free(link->stats.recvPackets); + counter_u64_free(link->stats.recvMulticasts); + counter_u64_free(link->stats.recvBroadcasts); + counter_u64_free(link->stats.recvUnknown); + counter_u64_free(link->stats.recvRunts); + counter_u64_free(link->stats.recvInvalid); + counter_u64_free(link->stats.xmitOctets); + counter_u64_free(link->stats.xmitPackets); + counter_u64_free(link->stats.xmitMulticasts); + counter_u64_free(link->stats.xmitBroadcasts); + counter_u64_free(link->stats.loopDrops); + counter_u64_free(link->stats.memoryFailures); + free(link, M_NETGRAPH_BRIDGE); +} static int ng_bridge_reset_link(hook_p hook, void *arg __unused) @@ -984,20 +1017,7 @@ ng_bridge_disconnect(hook_p hook) ng_bridge_remove_hosts(priv, link); /* Free associated link information */ - counter_u64_free(link->stats.recvOctets); - counter_u64_free(link->stats.recvPackets); - counter_u64_free(link->stats.recvMulticasts); - counter_u64_free(link->stats.recvBroadcasts); - counter_u64_free(link->stats.recvUnknown); - counter_u64_free(link->stats.recvRunts); - counter_u64_free(link->stats.recvInvalid); - counter_u64_free(link->stats.xmitOctets); - counter_u64_free(link->stats.xmitPackets); - counter_u64_free(link->stats.xmitMulticasts); - counter_u64_free(link->stats.xmitBroadcasts); - counter_u64_free(link->stats.loopDrops); - counter_u64_free(link->stats.memoryFailures); - free(link, M_NETGRAPH_BRIDGE); + ng_bridge_free_link(link); priv->numLinks--; /* If no more hooks, go away */ From owner-dev-commits-src-all@freebsd.org Fri Aug 20 13:58:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BCD166112A; Fri, 20 Aug 2021 13:58:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrjsW3zdxz3s5P; Fri, 20 Aug 2021 13:58:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 718FF1A254; Fri, 20 Aug 2021 13:58:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KDwdH4057293; Fri, 20 Aug 2021 13:58:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KDwdoN057292; Fri, 20 Aug 2021 13:58:39 GMT (envelope-from git) Date: Fri, 20 Aug 2021 13:58:39 GMT Message-Id: <202108201358.17KDwdoN057292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 719b5397c288 - main - libpfctl: Fix endianness issues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 719b5397c2887bc0619bb6ffb38f67f37bbf13c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 13:58:39 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=719b5397c2887bc0619bb6ffb38f67f37bbf13c6 commit 719b5397c2887bc0619bb6ffb38f67f37bbf13c6 Author: Kristof Provost AuthorDate: 2021-08-20 11:43:15 +0000 Commit: Kristof Provost CommitDate: 2021-08-20 11:53:48 +0000 libpfctl: Fix endianness issues Several fields are supplied in big-endian format, so we need to convert them before we display them. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index ced130820d7d..7f1e72513018 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -671,11 +671,11 @@ pf_state_export_to_state(struct pfctl_state *ps, const struct pf_state_export *s pf_state_peer_export_to_state_peer(&ps->src, &s->src); pf_state_peer_export_to_state_peer(&ps->dst, &s->dst); bcopy(&s->rt_addr, &ps->rt_addr, sizeof(ps->rt_addr)); - ps->rule = s->rule; - ps->anchor = s->anchor; - ps->nat_rule = s->nat_rule; - ps->creation = s->creation; - ps->expire = s->expire; + ps->rule = ntohl(s->rule); + ps->anchor = ntohl(s->anchor); + ps->nat_rule = ntohl(s->nat_rule); + ps->creation = ntohl(s->creation); + ps->expire = ntohl(s->expire); ps->packets[0] = s->packets[0]; ps->packets[1] = s->packets[1]; ps->bytes[0] = s->bytes[0]; From owner-dev-commits-src-all@freebsd.org Fri Aug 20 14:03:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 618BC6610E5; Fri, 20 Aug 2021 14:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrjzF2C9kz3sTS; Fri, 20 Aug 2021 14:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 340E31A615; Fri, 20 Aug 2021 14:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KE3bMs071445; Fri, 20 Aug 2021 14:03:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KE3brs071444; Fri, 20 Aug 2021 14:03:37 GMT (envelope-from git) Date: Fri, 20 Aug 2021 14:03:37 GMT Message-Id: <202108201403.17KE3brs071444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: e3c5965c259f - main - mpr(4): Handle mprsas_alloc_tm() errors on device removal. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3c5965c259f7029afe01612b248c3acf9f5b3e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 14:03:37 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e3c5965c259f7029afe01612b248c3acf9f5b3e0 commit e3c5965c259f7029afe01612b248c3acf9f5b3e0 Author: Alexander Motin AuthorDate: 2021-08-20 13:46:51 +0000 Commit: Alexander Motin CommitDate: 2021-08-20 14:03:32 +0000 mpr(4): Handle mprsas_alloc_tm() errors on device removal. SAS9305-16e with firmware 16.00.01.00 report HighPriorityCredit of only 8, while for comparison some other combinations I have report 100 or even 128. In case of large JBOD detach requirement to send target reset command to each target same time overflows the limit, and without adequate handling makes devices stuck in half-detached state, preventing later re-attach. To handle that in case of allocation error mark the target with new MPRSAS_TARGET_TOREMOVE flag, and retry the removal attempt next time something else free high priority command. With this patch I can successfully detach/attach 102 disk JBOD from/to the SAS9305-16e. MFC after: 2 weeks Sponsored by: iXsystems, Inc. --- sys/dev/mpr/mpr_sas.c | 36 ++++++++++++++++++++++++++++++++---- sys/dev/mpr/mpr_sas.h | 4 ++-- sys/dev/mpr/mpr_sas_lsi.c | 1 + sys/dev/mpr/mprvar.h | 5 +++++ 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index f529fdf23d52..e1739028dd8f 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -412,6 +412,34 @@ mprsas_remove_volume(struct mpr_softc *sc, struct mpr_command *tm) mprsas_free_tm(sc, tm); } +/* + * Retry mprsas_prepare_remove() if some previous attempt failed to allocate + * high priority command due to limit reached. + */ +void +mprsas_prepare_remove_retry(struct mprsas_softc *sassc) +{ + struct mprsas_target *target; + int i; + + if ((sassc->flags & MPRSAS_TOREMOVE) == 0) + return; + + for (i = 0; i < sassc->maxtargets; i++) { + target = &sassc->targets[i]; + if ((target->flags & MPRSAS_TARGET_TOREMOVE) == 0) + continue; + if (TAILQ_EMPTY(&sassc->sc->high_priority_req_list)) + return; + target->flags &= ~MPRSAS_TARGET_TOREMOVE; + if (target->flags & MPR_TARGET_FLAGS_VOLUME) + mprsas_prepare_volume_remove(sassc, target->handle); + else + mprsas_prepare_remove(sassc, target->handle); + } + sassc->flags &= ~MPRSAS_TOREMOVE; +} + /* * No Need to call "MPI2_SAS_OP_REMOVE_DEVICE" For Volume removal. * Otherwise Volume Delete is same as Bare Drive Removal. @@ -440,8 +468,8 @@ mprsas_prepare_volume_remove(struct mprsas_softc *sassc, uint16_t handle) cm = mprsas_alloc_tm(sc); if (cm == NULL) { - mpr_dprint(sc, MPR_ERROR, - "%s: command alloc failure\n", __func__); + targ->flags |= MPRSAS_TARGET_TOREMOVE; + sassc->flags |= MPRSAS_TOREMOVE; return; } @@ -506,8 +534,8 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint16_t handle) tm = mprsas_alloc_tm(sc); if (tm == NULL) { - mpr_dprint(sc, MPR_ERROR, "%s: command alloc failure\n", - __func__); + targ->flags |= MPRSAS_TARGET_TOREMOVE; + sassc->flags |= MPRSAS_TOREMOVE; return; } diff --git a/sys/dev/mpr/mpr_sas.h b/sys/dev/mpr/mpr_sas.h index ea427ca8f821..4ec6be15613c 100644 --- a/sys/dev/mpr/mpr_sas.h +++ b/sys/dev/mpr/mpr_sas.h @@ -57,8 +57,7 @@ struct mprsas_target { #define MPR_TARGET_FLAGS_RAID_COMPONENT (1 << 4) #define MPR_TARGET_FLAGS_VOLUME (1 << 5) #define MPR_TARGET_IS_SATA_SSD (1 << 6) -#define MPRSAS_TARGET_INRECOVERY (MPRSAS_TARGET_INABORT | \ - MPRSAS_TARGET_INRESET | MPRSAS_TARGET_INCHIPRESET) +#define MPRSAS_TARGET_TOREMOVE (1 << 7) uint16_t tid; SLIST_HEAD(, mprsas_lun) luns; @@ -95,6 +94,7 @@ struct mprsas_softc { #define MPRSAS_DISCOVERY_TIMEOUT_PENDING (1 << 2) #define MPRSAS_QUEUE_FROZEN (1 << 3) #define MPRSAS_SHUTDOWN (1 << 4) +#define MPRSAS_TOREMOVE (1 << 5) u_int maxtargets; struct mprsas_target *targets; struct cam_devq *devq; diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c index 0800fd0385a7..025395f6eedd 100644 --- a/sys/dev/mpr/mpr_sas_lsi.c +++ b/sys/dev/mpr/mpr_sas_lsi.c @@ -1428,6 +1428,7 @@ mprsas_volume_add(struct mpr_softc *sc, u16 handle) targ->tid = id; targ->handle = handle; targ->devname = wwid; + targ->flags = MPR_TARGET_FLAGS_VOLUME; TAILQ_INIT(&targ->commands); TAILQ_INIT(&targ->timedout_commands); while (!SLIST_EMPTY(&targ->luns)) { diff --git a/sys/dev/mpr/mprvar.h b/sys/dev/mpr/mprvar.h index 524c93861b70..93386f1f58d0 100644 --- a/sys/dev/mpr/mprvar.h +++ b/sys/dev/mpr/mprvar.h @@ -668,6 +668,8 @@ mpr_alloc_command(struct mpr_softc *sc) return (cm); } +void mprsas_prepare_remove_retry(struct mprsas_softc *sassc); + static __inline void mpr_free_high_priority_command(struct mpr_softc *sc, struct mpr_command *cm) { @@ -691,6 +693,9 @@ mpr_free_high_priority_command(struct mpr_softc *sc, struct mpr_command *cm) mpr_free_chain(sc, chain); } TAILQ_INSERT_TAIL(&sc->high_priority_req_list, cm, cm_link); + + if (sc->sassc) + mprsas_prepare_remove_retry(sc->sassc); } static __inline struct mpr_command * From owner-dev-commits-src-all@freebsd.org Fri Aug 20 15:25:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9978766238F; Fri, 20 Aug 2021 15:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrlnX3k7bz4WyG; Fri, 20 Aug 2021 15:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67B831AEFC; Fri, 20 Aug 2021 15:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KFPKQf081544; Fri, 20 Aug 2021 15:25:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KFPKws081543; Fri, 20 Aug 2021 15:25:20 GMT (envelope-from git) Date: Fri, 20 Aug 2021 15:25:20 GMT Message-Id: <202108201525.17KFPKws081543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 13f32ff71eeb - stable/13 - wpa: Restructure wpa build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13f32ff71eeb7213bb9f34bdfa88c7ccecf451bc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 15:25:20 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=13f32ff71eeb7213bb9f34bdfa88c7ccecf451bc commit 13f32ff71eeb7213bb9f34bdfa88c7ccecf451bc Author: Cy Schubert AuthorDate: 2021-05-20 21:28:17 +0000 Commit: Cy Schubert CommitDate: 2021-08-20 15:24:54 +0000 wpa: Restructure wpa build The current WPA build assumes a flat namespace. However the latest sources from w1.fi now have a duplicate config.c, in two separate subdirectories. The flat namespace will overwrite config.o with the output from the most recently modified config.c, of which there are two of them. This commit resolves this problem by building each component in wpa's src subdirectory tree into its own .a archive, just as the w1.fi upstream build as used by the port does. The advantages of this approach are: 1. Duplicate source file names, i.e. config.c in the wpa_supplicant direcory and another config.c in src/utils in the next wpa will result in both compiles writing to the same .o file. 2. This restructure simplifies maintanence. A develper needs only to add new files as identified by git status in the vendor branch to the appropriate Makefile within the usr.sbin/wpa tree. This also reduces time required to prepare a new import and should reduce error. 3. The new wpa build structure more closely represents the build as performed by the upstream tarball. This is in preparation for the next wpa update from w1.fi. Reviewed by: philip Tested by: philip Differential Revision: https://reviews.freebsd.org/D30372 (cherry picked from commit 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3) --- share/mk/src.libnames.mk | 62 +++++++++++++- usr.sbin/wpa/Makefile | 10 ++- usr.sbin/wpa/Makefile.crypto | 104 ------------------------ usr.sbin/wpa/Makefile.inc | 92 +++++++++++++++++---- usr.sbin/wpa/hostapd/Makefile | 153 ++--------------------------------- usr.sbin/wpa/hostapd_cli/Makefile | 10 +-- usr.sbin/wpa/src/Makefile | 19 +++++ usr.sbin/wpa/src/ap/Makefile | 59 ++++++++++++++ usr.sbin/wpa/src/common/Makefile | 27 +++++++ usr.sbin/wpa/src/crypto/Makefile | 63 +++++++++++++++ usr.sbin/wpa/src/drivers/Makefile | 21 +++++ usr.sbin/wpa/src/eap_common/Makefile | 25 ++++++ usr.sbin/wpa/src/eap_peer/Makefile | 33 ++++++++ usr.sbin/wpa/src/eap_server/Makefile | 34 ++++++++ usr.sbin/wpa/src/eapol_auth/Makefile | 18 +++++ usr.sbin/wpa/src/eapol_supp/Makefile | 19 +++++ usr.sbin/wpa/src/l2_packet/Makefile | 19 +++++ usr.sbin/wpa/src/radius/Makefile | 24 ++++++ usr.sbin/wpa/src/rsn_supp/Makefile | 26 ++++++ usr.sbin/wpa/src/tls/Makefile | 38 +++++++++ usr.sbin/wpa/src/utils/Makefile | 32 ++++++++ usr.sbin/wpa/src/wps/Makefile | 39 +++++++++ usr.sbin/wpa/wpa_cli/Makefile | 33 ++++---- usr.sbin/wpa/wpa_passphrase/Makefile | 7 +- usr.sbin/wpa/wpa_priv/Makefile | 9 +-- usr.sbin/wpa/wpa_supplicant/Makefile | 93 ++++++--------------- 26 files changed, 700 insertions(+), 369 deletions(-) diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 93ae9caf1a2d..c4d7ad8e2fcc 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -58,7 +58,22 @@ _INTERNALLIBS= \ smdb \ smutil \ telnet \ - vers + vers \ + wpaap \ + wpacommon \ + wpacrypto \ + wpadrivers \ + wpaeap_common \ + wpaeap_peer \ + wpaeap_server \ + wpaeapol_auth \ + wpaeapol_supp \ + wpal2_packet \ + wparadius \ + wparsn_supp \ + wpatls \ + wpautils \ + wpawps _LIBRARIES= \ ${_PRIVATELIBS} \ @@ -560,6 +575,51 @@ LIBBE?= ${LIBBEDIR}/libbe${PIE_SUFFIX}.a LIBPMCSTATDIR= ${_LIB_OBJTOP}/lib/libpmcstat LIBPMCSTAT?= ${LIBPMCSTATDIR}/libpmcstat${PIE_SUFFIX}.a +LIBWPAAPDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/ap +LIBWPAAP?= ${LIBWPAAPDIR}/libwpaap${PIE_SUFFIX}.a + +LIBWPACOMMONDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/common +LIBWPACOMMON?= ${LIBWPACOMMONDIR}/libwpacommon${PIE_SUFFIX}.a + +LIBWPACRYPTODIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/crypto +LIBWPACRYPTO?= ${LIBWPACRYPTODIR}/libwpacrypto${PIE_SUFFIX}.a + +LIBWPADRIVERSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/drivers +LIBWPADRIVERS?= ${LIBWPADRIVERSDIR}/libwpadrivers${PIE_SUFFIX}.a + +LIBWPAEAP_COMMONDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_common +LIBWPAEAP_COMMON?= ${LIBWPAEAP_COMMONDIR}/libwpaeap_common${PIE_SUFFIX}.a + +LIBWPAEAP_PEERDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_peer +LIBWPAEAP_PEER?= ${LIBWPAEAP_PEERDIR}/libwpaeap_peer${PIE_SUFFIX}.a + +LIBWPAEAP_SERVERDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_server +LIBWPAEAP_SERVER?= ${LIBWPAEAP_SERVERDIR}/libwpaeap_server${PIE_SUFFIX}.a + +LIBWPAEAPOL_AUTHDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eapol_auth +LIBWPAEAPOL_AUTH?= ${LIBWPAEAPOL_AUTHDIR}/libwpaeapol_auth${PIE_SUFFIX}.a + +LIBWPAEAPOL_SUPPDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eapol_supp +LIBWPAEAPOL_SUPP?= ${LIBWPAEAPOL_SUPPDIR}/libwpaeapol_supp${PIE_SUFFIX}.a + +LIBWPAL2_PACKETDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/l2_packet +LIBWPAL2_PACKET?= ${LIBWPAL2_PACKETDIR}/libwpal2_packet${PIE_SUFFIX}.a + +LIBWPARADIUSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/radius +LIBWPARADIUS?= ${LIBWPARADIUSDIR}/libwparadius${PIE_SUFFIX}.a + +LIBWPARSN_SUPPDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/rsn_supp +LIBWPARSN_SUPP?= ${LIBWPARSN_SUPPDIR}/libwparsn_supp${PIE_SUFFIX}.a + +LIBWPATLSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/tls +LIBWPATLS?= ${LIBWPATLSDIR}/libwpatls${PIE_SUFFIX}.a + +LIBWPAUTILSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/utils +LIBWPAUTILS?= ${LIBWPAUTILSDIR}/libwpautils${PIE_SUFFIX}.a + +LIBWPAWPSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/wps +LIBWPAWPS?= ${LIBWPAWPSDIR}/libwpawps${PIE_SUFFIX}.a + LIBC_NOSSP_PICDIR= ${_LIB_OBJTOP}/lib/libc LIBC_NOSSP_PIC?= ${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a diff --git a/usr.sbin/wpa/Makefile b/usr.sbin/wpa/Makefile index ae07ec04f001..fe8fb60b1dc2 100644 --- a/usr.sbin/wpa/Makefile +++ b/usr.sbin/wpa/Makefile @@ -1,8 +1,12 @@ # $FreeBSD$ -SUBDIR= wpa_supplicant wpa_cli wpa_passphrase -SUBDIR+= hostapd hostapd_cli -SUBDIR+= ndis_events +SUBDIR= src .WAIT \ + wpa_supplicant \ + wpa_cli \ + wpa_passphrase \ + hostapd \ + hostapd_cli \ + SUBDIR_PARALLEL= .include diff --git a/usr.sbin/wpa/Makefile.crypto b/usr.sbin/wpa/Makefile.crypto index bed452bf8592..a7ddb917ac6d 100644 --- a/usr.sbin/wpa/Makefile.crypto +++ b/usr.sbin/wpa/Makefile.crypto @@ -1,13 +1,10 @@ # $FreeBSD$ .if ${MK_OPENSSL} != "no" -SRCS+= crypto_openssl.c random.c sha1-prf.c sha256-prf.c sha256-tlsprf.c \ - sha512.c LIBADD+= ssl crypto CFLAGS+= -DCONFIG_SHA256 .else CFLAGS+=-DCONFIG_CRYPTO_INTERNAL -SRCS+= crypto_internal.c random.c CONFIG_INTERNAL_AES=y CONFIG_INTERNAL_DES=y CONFIG_INTERNAL_MD4=y @@ -33,129 +30,28 @@ NEED_TLS_PRF=y .if defined(CONFIG_INTERNAL_TLS) CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \ -DCONFIG_TLS_INTERNAL_CLIENT -SRCS+= asn1.c \ - bignum.c \ - crypto_internal-cipher.c \ - crypto_internal-modexp.c \ - crypto_internal-rsa.c \ - pkcs1.c \ - pkcs5.c \ - pkcs8.c \ - rsa.c \ - tls_internal.c \ - tlsv1_common.c \ - tlsv1_record.c \ - tlsv1_cred.c \ - tlsv1_client.c \ - tlsv1_client_write.c \ - tlsv1_client_read.c \ - tlsv1_client_ocsp.c \ - x509v3.c NEED_DES=y NEED_MD4=y NEED_RC4=y .else CFLAGS+=-DEAP_TLS_OPENSSL -SRCS+= tls_openssl.c tls_openssl_ocsp.c .endif .endif -.if defined(CONFIG_INTERNAL_AES) -SRCS+= aes-unwrap.c aes-wrap.c \ - aes-internal.c \ - aes-internal-dec.c \ - aes-internal-enc.c -.endif - -.if defined(NEED_AES_CBC) -SRCS+= aes-cbc.c -.endif - .if defined(NEED_AES_EAX) -SRCS+= aes-eax.c NEED_AES_CTR=y .endif -.if defined(NEED_AES_CTR) -SRCS+= aes-ctr.c -.endif - -.if defined(NEED_AES_ENCBLOCK) -SRCS+= aes-encblock.c -.endif - -.if defined(NEED_AES_OMAC1) -SRCS+= aes-omac1.c -.endif - -.if defined(NEED_DES) -.if defined(CONFIG_INTERNAL_DES) -SRCS+= des-internal.c -.endif -.endif - -.if defined(NEED_MD4) -.if defined(CONFIG_INTERNAL_MD4) -SRCS+= md4-internal.c -.endif -.endif - -.if defined(CONFIG_INTERNAL_MD5) -SRCS+= md5.c md5-internal.c -.endif - -.if defined(NEED_FIPS186_2_PRF) -.if defined(CONFIG_INTERNAL_SHA1) -SRCS+= fips_prf_internal.c -.else -SRCS+= fips_prf_openssl.c -.endif -.endif - -.if defined(CONFIG_INTERNAL_RC4) -SRCS+= rc4.c -.endif - -.if defined(CONFIG_INTERNAL_SHA1) -SRCS+= sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c -.endif - .if defined(NEED_SHA256) CFLAGS+=-DCONFIG_SHA256 -SRCS+= sha256.c -.if defined(CONFIG_INTERNAL_SHA256) -SRCS+= sha256-internal.c sha256-prf.c -.endif .endif .if defined(NEED_SHA384) CFLAGS+=-DCONFIG_SHA384 -SRCS+= sha384.c -.if defined(CONFIG_INTERNAL_SHA384) -SRCS+= sha384-internal.c sha384-prf.c -.endif .endif .if defined(NEED_SHA512) CFLAGS+=-DCONFIG_SHA512 -SRCS+= sha512.c -.if defined(CONFIG_INTERNAL_SHA512) -SRCS+= sha512-internal.c sha512-prf.c -.endif -.endif - -.if defined(NEED_TLS_PRF) -SRCS+= sha1-tlsprf.c -.endif - -.if defined(CONFIG_INTERNAL_DH5) -.if defined(NEED_DH_GROUPS) -SRCS+= dh_group5.c -.endif -.endif - -.if defined(NEED_DH_GROUPS) -SRCS+= dh_groups.c .endif .if defined(NEED_DH_GROUPS_ALL) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 0a69ca08166b..87a1d6c23bbc 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + BINDIR?= /usr/sbin WARNS?= 0 @@ -8,18 +10,7 @@ WPA_DISTDIR?= ${SRCTOP}/contrib/wpa/ WPA_SUPPLICANT_DISTDIR?=${WPA_DISTDIR}/wpa_supplicant HOSTAPD_DISTDIR?= ${WPA_DISTDIR}/hostapd -.PATH.c:${.CURDIR:H} \ - ${WPA_DISTDIR}/src/common \ - ${WPA_DISTDIR}/src/crypto \ - ${WPA_DISTDIR}/src/eapol_auth \ - ${WPA_DISTDIR}/src/eap_common \ - ${WPA_DISTDIR}/src/eapol_supp \ - ${WPA_DISTDIR}/src/l2_packet \ - ${WPA_DISTDIR}/src/radius \ - ${WPA_DISTDIR}/src/rsn_supp \ - ${WPA_DISTDIR}/src/tls \ - ${WPA_DISTDIR}/src/utils \ - ${WPA_DISTDIR}/src/wps +.PATH.c:${.CURDIR:H} CFLAGS+=-I${.CURDIR} CFLAGS+=-I${HOSTAPD_DISTDIR} @@ -31,9 +22,78 @@ CFLAGS+=-I${WPA_DISTDIR}/src/l2_packet CFLAGS+=-I${WPA_DISTDIR}/src/utils CFLAGS+=-I${WPA_DISTDIR}/src/wps -CFLAGS+= -DCONFIG_CTRL_IFACE -CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX -CFLAGS+= -DNEED_AP_MLME -CFLAGS+= -DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" +CFLAGS+=-DCONFIG_DRIVER_BSD +CFLAGS+=-DCONFIG_DRIVER_WIRED +CFLAGS+=-DCONFIG_DRIVER_RADIUS_ACL +CFLAGS+=-DCONFIG_CTRL_IFACE +CFLAGS+=-DCONFIG_CTRL_IFACE_UNIX +CFLAGS+=-DCONFIG_IEEE80211AC +CFLAGS+=-DCONFIG_IEEE80211N +CFLAGS+=-DCONFIG_IEEE80211R +CFLAGS+=-DCONFIG_IEEE80211W +CFLAGS+=-DCONFIG_IEEE80211AX +CFLAGS+=-DNEED_AP_MLME +CFLAGS+=-DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" +CFLAGS+=-DCONFIG_DEBUG_SYSLOG +CFLAGS+=-DCONFIG_WPS +CFLAGS+=-DCONFIG_WPS2 +CFLAGS+=-DCONFIG_WPS_UPNP +CFLAGS+=-DCONFIG_WPS_OOB +CFLAGS+=-DCONFIG_INTERWORKING +CFLAGS+=-DPKCS12_FUNCS +CFLAGS+=-DCONFIG_GAS +CFLAGS+=-DCONFIG_PEERKEY +CFLAGS+=-DCONFIG_PRIVSEP +CFLAGS+=-DCONFIG_SMARTCARD +CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF +CFLAGS+=-DCONFIG_TLS=openssl +CFLAGS+=-DCONFIG_MATCH_IFACE +CFLAGS+=-DEAP_SERVER +CFLAGS+=-DEAP_SERVER_GTC +CFLAGS+=-DEAP_SERVER_IDENTITY +CFLAGS+=-DEAP_SERVER_MD5 +CFLAGS+=-DEAP_SERVER_MSCHAPV2 +CFLAGS+=-DEAP_SERVER_PEAP +CFLAGS+=-DEAP_SERVER_TLS +CFLAGS+=-DEAP_SERVER_TTLS +CFLAGS+=-DEAP_SERVER_WSC +CFLAGS+=-DEAP_TLS_FUNCS + +.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" +CFLAGS+=-DCONFIG_HS20 \ + -DEAP_GTC \ + -DEAP_LEAP \ + -DEAP_MD5 \ + -DEAP_MSCHAPv2 \ + -DEAP_OTP \ + -DEAP_PEAP \ + -DEAP_PSK \ + -DEAP_TLS \ + -DEAP_TTLS \ + -DEAP_WSC \ + -DIEEE8021X_EAPOL +NEED_AES_EAX=y +NEED_AES_ENCBLOCK=y +NEED_AES_OMAC1=y +.endif + +.if !empty(CFLAGS:M*-DEAP_AKA) +NEED_SIM_COMMON=y +NEED_AES_CBC=y +.endif + +.if !empty(CFLAGS:M*-DEAP_SIM) +NEED_SIM_COMMON=y +NEED_AES_CBC=y +.endif + +.if defined(NEED_SIM_COMMON) +NEED_FIPS186_2_PRF=y +.endif + +.if !empty(CFLAGS:M*-DEAP_GPSK) +CFLAGS+=-DEAP_GPSK_SHA256 +NEED_AES_OMAC1=y +.endif .include diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile index 579694046989..6e026babae1a 100644 --- a/usr.sbin/wpa/hostapd/Makefile +++ b/usr.sbin/wpa/hostapd/Makefile @@ -3,96 +3,14 @@ .include .include "../Makefile.inc" -.PATH.c:${HOSTAPD_DISTDIR} \ - ${WPA_DISTDIR}/src/ap \ - ${WPA_DISTDIR}/src/eap_server \ - ${WPA_DISTDIR}/src/eap_peer \ - ${WPA_DISTDIR}/src/drivers \ - ${WPA_DISTDIR}/wpa_supplicant +.PATH.c:${HOSTAPD_DISTDIR} PACKAGE= hostapd PROG= hostapd -SRCS= accounting.c \ - ap_config.c \ - ap_drv_ops.c \ - ap_list.c \ - ap_mlme.c \ - authsrv.c \ - base64.c \ - beacon.c \ - bss_load.c \ - chap.c \ - common.c \ - config_file.c \ +SRCS= config_file.c \ ctrl_iface.c \ - ctrl_iface_ap.c \ - ctrl_iface_common.c \ - dfs.c \ - driver_bsd.c \ - driver_common.c \ - drivers.c \ - drv_callbacks.c \ - eloop.c \ - gas.c \ - gas_serv.c \ - http_client.c \ - http_server.c \ - httpread.c \ - hostapd.c \ - hs20.c \ - hw_features.c \ - hw_features_common.c \ - ieee802_11.c \ - ieee802_11_auth.c \ - ieee802_11_common.c \ - ieee802_11_he.c \ - ieee802_11_ht.c \ - ieee802_11_shared.c \ - ieee802_11_vht.c \ - ieee802_1x.c \ - ip_addr.c \ - l2_packet_freebsd.c \ - main.c \ - mbo_ap.c \ - ms_funcs.c \ - neighbor_db.c \ - os_unix.c \ - pmksa_cache_auth.c \ - preauth_auth.c \ - radius.c \ - radius_client.c \ - radius_das.c \ - rrm.c \ - sta_info.c \ - tkip_countermeasures.c \ - upnp_xml.c \ - utils.c \ - uuid.c \ - vlan.c \ - vlan_ifconfig.c \ - vlan_init.c \ - wmm.c \ - wpa_auth.c \ - wpa_auth_glue.c \ - wpa_auth_ie.c \ - wpa_common.c \ - wpa_ctrl.c \ - wpa_debug.c \ - wpabuf.c \ - wps.c \ - wps_attr_build.c \ - wps_attr_process.c \ - wps_attr_parse.c \ - wps_common.c \ - wps_dev_attr.c \ - wps_enrollee.c \ - wps_hostapd.c \ - wps_registrar.c \ - wps_upnp.c \ - wps_upnp_ap.c \ - wps_upnp_event.c \ - wps_upnp_ssdp.c \ - wps_upnp_web.c + eap_register.c \ + main.c MAN= hostapd.8 hostapd.conf.5 @@ -104,26 +22,17 @@ FILES= hostapd.conf hostapd.eap_user hostapd.wpa_psk CFLAGS+=-I${.CURDIR:H}/wpa_supplicant \ -I${WPA_DISTDIR}/src/eap_peer \ - -DCONFIG_DRIVER_BSD \ - -DCONFIG_DRIVER_RADIUS_ACL \ - -DCONFIG_HS20 \ -DCONFIG_MBO \ - -DCONFIG_IEEE80211N \ - -DCONFIG_IEEE80211W \ - -DCONFIG_IEEE80211AC \ - -DCONFIG_IEEE80211AX \ - -DCONFIG_INTERWORKING \ - -DCONFIG_PEERKEY \ -DCONFIG_RSN_PREAUTH \ - -DCONFIG_WPS \ - -DCONFIG_WPS2 \ - -DCONFIG_WPS_UPNP \ -DHOSTAPD .if ${MK_INET6} != "no" CFLAGS+= -DCONFIG_IPV6 .endif #CFLAGS+= -g -LIBADD+= pcap util +LIBADD+= pcap util wpaap wpacommon wpacrypto \ + wpadrivers wpal2_packet wpaeap_common wpaeap_server \ + wpaeapol_auth \ + wparadius wpatls wpautils wpawps # User customizations for wpa_supplicant/hostapd build environment CFLAGS+=${HOSTAPD_CFLAGS} @@ -131,36 +40,6 @@ CFLAGS+=${HOSTAPD_CFLAGS} LDADD+=${HOSTAPD_LDADD} #LDFLAGS+=${HOSTAPD_LDFLAGS} -CFLAGS+=-DDPKCS12_FUNCS \ - -DEAP_SERVER \ - -DEAP_SERVER_GTC \ - -DEAP_SERVER_IDENTITY \ - -DEAP_SERVER_MD5 \ - -DEAP_SERVER_MSCHAPV2 \ - -DEAP_SERVER_PEAP \ - -DEAP_SERVER_TLS \ - -DEAP_SERVER_TTLS \ - -DEAP_SERVER_WSC \ - -DEAP_TLS_FUNCS - -SRCS+= eap_server_gtc.c \ - eap_common.c \ - eap_peap_common.c \ - eap_register.c \ - eap_server.c \ - eap_server_identity.c \ - eap_server_md5.c \ - eap_server_methods.c \ - eap_server_mschapv2.c \ - eap_server_peap.c \ - eap_server_tls.c \ - eap_server_tls_common.c \ - eap_server_ttls.c \ - eap_server_wsc.c \ - eap_user_db.c \ - eap_wsc_common.c \ - eapol_auth_dump.c \ - eapol_auth_sm.c TLS_FUNCS=y # For WPS, EAP modes, etc @@ -172,38 +51,22 @@ NEED_SIM_COMMON=y .endif .if !empty(CFLAGS:M*-DEAP_SERVER_AKA) -SRCS+= eap_server_aka.c NEED_SIM_COMMON=y .endif .if !empty(CFLAGS:M*-DEAP_SERVER_SIM) -SRCS+= eap_server_sim.c NEED_SIM_COMMON=y .endif .if defined(NEED_SIM_COMMON) -SRCS+= eap_sim_common.c \ - eap_sim_db.c NEED_FIPS186_2_PRF=y .endif .if !empty(CFLAGS:M*-DEAP_SERVER_GPSK) CFLAGS+=-DEAP_GPSK_SHA256 -SRCS+= eap_server_gpsk.c \ - eap_gpsk_common.c NEED_AES_OMAC1=y .endif -.if !empty(CFLAGS:M*-DEAP_SERVER_PAX) -SRCS+= eap_server_pax.c \ - eap_pax_common.c -.endif - -.if !empty(CFLAGS:M*-DEAP_SERVER_SAKE) -SRCS+= eap_server_sake.c \ - eap_sake_common.c -.endif - .include "../Makefile.crypto" .include diff --git a/usr.sbin/wpa/hostapd_cli/Makefile b/usr.sbin/wpa/hostapd_cli/Makefile index eda50e222d2e..276e25058298 100644 --- a/usr.sbin/wpa/hostapd_cli/Makefile +++ b/usr.sbin/wpa/hostapd_cli/Makefile @@ -6,14 +6,12 @@ PACKAGE= hostapd PROG= hostapd_cli -SRCS= cli.c common.c edit.c eloop.c hostapd_cli.c os_unix.c \ - wpa_ctrl.c wpa_debug.c +SRCS= hostapd_cli.c -CFLAGS+= -DCONFIG_CTRL_IFACE -CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX - -LIBADD+= util +LIBADD+= util wpacommon wpautils MAN= hostapd_cli.8 +.include "../Makefile.crypto" + .include diff --git a/usr.sbin/wpa/src/Makefile b/usr.sbin/wpa/src/Makefile new file mode 100644 index 000000000000..f21856ad23a2 --- /dev/null +++ b/usr.sbin/wpa/src/Makefile @@ -0,0 +1,19 @@ +SUBDIR= ap \ + common \ + crypto \ + drivers \ + eap_common \ + eap_peer \ + eap_server \ + eapol_auth \ + eapol_supp \ + l2_packet \ + radius \ + rsn_supp \ + tls \ + utils \ + wps + +SUBDIR_PARALLEL= + +.include diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile new file mode 100644 index 000000000000..edb2f1e9d089 --- /dev/null +++ b/usr.sbin/wpa/src/ap/Makefile @@ -0,0 +1,59 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpaap +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/ap + +SRCS= accounting.c \ + ap_config.c \ + ap_drv_ops.c \ + ap_list.c \ + ap_mlme.c \ + authsrv.c \ + beacon.c \ + bss_load.c \ + ctrl_iface_ap.c \ + dfs.c \ + drv_callbacks.c \ + eap_user_db.c \ + gas_serv.c \ + hostapd.c \ + hs20.c \ + hw_features.c \ + ieee802_11.c \ + ieee802_11_auth.c \ + ieee802_11_he.c \ + ieee802_11_ht.c \ + ieee802_11_shared.c \ + ieee802_11_vht.c \ + ieee802_1x.c \ + mbo_ap.c \ + neighbor_db.c \ + pmksa_cache_auth.c \ + preauth_auth.c \ + rrm.c \ + sta_info.c \ + tkip_countermeasures.c \ + utils.c \ + vlan.c \ + vlan_ifconfig.c \ + vlan_init.c \ + wmm.c \ + wpa_auth.c \ + wpa_auth_glue.c \ + wpa_auth_ie.c \ + wps_hostapd.c + +CFLAGS+=-DCONFIG_MBO \ + -DCONFIG_RSN_PREAUTH \ + -DHOSTAPD + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/common/Makefile b/usr.sbin/wpa/src/common/Makefile new file mode 100644 index 000000000000..28c16ff9d31a --- /dev/null +++ b/usr.sbin/wpa/src/common/Makefile @@ -0,0 +1,27 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpacommon +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/common + +SRCS= cli.c \ + ctrl_iface_common.c \ + gas.c \ + hw_features_common.c \ + ieee802_11_common.c \ + wpa_common.c \ + wpa_ctrl.c + +CFLAGS+=-DCONFIG_SAE \ + -DCONFIG_SUITE \ + -DCONFIG_SUITEB + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile new file mode 100644 index 000000000000..d7e1304dc95e --- /dev/null +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -0,0 +1,63 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpacrypto +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/crypto + +SRCS= aes-cbc.c \ + aes-ctr.c \ + aes-eax.c \ + aes-encblock.c \ + aes-internal.c \ + aes-internal-dec.c \ + aes-internal-enc.c \ + aes-omac1.c \ + aes-unwrap.c \ + aes-wrap.c \ + crypto_internal.c \ + crypto_internal-cipher.c \ + crypto_internal-modexp.c \ + crypto_internal-rsa.c \ + des-internal.c \ + dh_group5.c \ + dh_groups.c \ + fips_prf_internal.c \ + md4-internal.c \ + md5.c \ + md5-internal.c \ + ms_funcs.c \ + random.c \ + rc4.c \ + sha1.c \ + sha1-internal.c \ + sha1-pbkdf2.c \ + sha1-prf.c \ + sha1-tlsprf.c \ + sha256.c \ + sha256-prf.c \ + sha256-tlsprf.c \ + sha256-internal.c \ + sha384.c \ + sha384-prf.c \ + sha384-internal.c \ + sha512-internal.c \ + tls_internal.c + +CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ + -DCONFIG_TLS_INTERNAL_CLIENT \ + -DCONFIG_TLS_INTERNAL_SERVER \ + -DCONFIG_SHA256 \ + -DCONFIG_SHA384 \ + -DCONFIG_HMAC_SHA384_KDF \ + -DCONFIG_INTERNAL_SHA384 +#CFLAGS+=-DALL_DH_GROUPS + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/drivers/Makefile b/usr.sbin/wpa/src/drivers/Makefile new file mode 100644 index 000000000000..1800b651885f --- /dev/null +++ b/usr.sbin/wpa/src/drivers/Makefile @@ -0,0 +1,21 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpadrivers +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/drivers + +SRCS= drivers.c \ + driver_bsd.c \ + driver_common.c \ + driver_wired.c \ + driver_wired_common.c + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/eap_common/Makefile b/usr.sbin/wpa/src/eap_common/Makefile new file mode 100644 index 000000000000..4da89b221b36 --- /dev/null +++ b/usr.sbin/wpa/src/eap_common/Makefile @@ -0,0 +1,25 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpaeap_common +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/eap_common + +SRCS= chap.c \ + eap_common.c \ + eap_gpsk_common.c \ + eap_pax_common.c \ + eap_peap_common.c \ + eap_psk_common.c \ + eap_sake_common.c \ + eap_sim_common.c \ + eap_wsc_common.c + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/eap_peer/Makefile b/usr.sbin/wpa/src/eap_peer/Makefile new file mode 100644 index 000000000000..524c7cf6c6f1 --- /dev/null +++ b/usr.sbin/wpa/src/eap_peer/Makefile @@ -0,0 +1,33 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpaeap_peer +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/eap_peer + +SRCS= eap.c \ + eap_gtc.c \ + eap_leap.c \ + eap_md5.c \ + eap_methods.c \ + eap_mschapv2.c \ + eap_otp.c \ + eap_peap.c \ + eap_psk.c \ + eap_tls.c \ + eap_tls_common.c \ + eap_ttls.c \ + eap_wsc.c \ + eap_methods.c \ + mschapv2.c + +CFLAGS+=-DIEEE8021X_EAPOL + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/eap_server/Makefile b/usr.sbin/wpa/src/eap_server/Makefile new file mode 100644 index 000000000000..c5a4566bb444 --- /dev/null +++ b/usr.sbin/wpa/src/eap_server/Makefile @@ -0,0 +1,34 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpaeap_server +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/eap_server + +SRCS= eap_server.c \ + eap_server_aka.c \ + eap_server_gpsk.c \ + eap_server_gtc.c \ + eap_server_identity.c \ + eap_server_md5.c \ + eap_server_methods.c \ + eap_server_mschapv2.c \ + eap_server_pax.c \ + eap_server_peap.c \ + eap_server_pwd.c \ + eap_server_sake.c \ + eap_server_sim.c \ + eap_server_tls.c \ + eap_server_tls_common.c \ *** 506 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Aug 20 15:25:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC6F1661CF0; Fri, 20 Aug 2021 15:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrlnZ5Qlvz4WqB; Fri, 20 Aug 2021 15:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A32BD1B52A; Fri, 20 Aug 2021 15:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KFPM4n081596; Fri, 20 Aug 2021 15:25:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KFPMY4081595; Fri, 20 Aug 2021 15:25:22 GMT (envelope-from git) Date: Fri, 20 Aug 2021 15:25:22 GMT Message-Id: <202108201525.17KFPMY4081595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 6f3564a52cf1 - stable/13 - wpa: Fix GCC 6 build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6f3564a52cf16a8cad7c073de4f875bdd0547ed0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 15:25:22 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6f3564a52cf16a8cad7c073de4f875bdd0547ed0 commit 6f3564a52cf16a8cad7c073de4f875bdd0547ed0 Author: Cy Schubert AuthorDate: 2021-06-04 01:40:55 +0000 Commit: Cy Schubert CommitDate: 2021-08-20 15:24:54 +0000 wpa: Fix GCC 6 build GCC 6 searches serially to resolve external references. (cherry picked from commit 681500889424423403ace51f118b3467e09acc00) --- usr.sbin/wpa/hostapd/Makefile | 8 ++++---- usr.sbin/wpa/wpa_cli/Makefile | 4 ++-- usr.sbin/wpa/wpa_supplicant/Makefile | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile index c0083747782a..c7775c960ddd 100644 --- a/usr.sbin/wpa/hostapd/Makefile +++ b/usr.sbin/wpa/hostapd/Makefile @@ -31,10 +31,10 @@ CFLAGS+=-I${.CURDIR:H}/wpa_supplicant \ CFLAGS+= -DCONFIG_IPV6 .endif #CFLAGS+= -g -LIBADD+= pcap util wpaap wpacommon wpacrypto \ - wpadrivers wpal2_packet wpaeap_common wpaeap_server \ - wpaeapol_auth \ - wparadius wpatls wpautils wpawps +LIBADD+= pcap util \ + wpadrivers wpaap wpal2_packet wpaeap_server \ + wpaeapol_auth wpaeap_common \ + wparadius wpatls wpawps wpacommon wpacrypto wpautils # User customizations for wpa_supplicant/hostapd build environment CFLAGS+=${HOSTAPD_CFLAGS} diff --git a/usr.sbin/wpa/wpa_cli/Makefile b/usr.sbin/wpa/wpa_cli/Makefile index bf2cf6252550..93a24295f4a2 100644 --- a/usr.sbin/wpa/wpa_cli/Makefile +++ b/usr.sbin/wpa/wpa_cli/Makefile @@ -21,16 +21,16 @@ CFLAGS+= -D_DIRENT_HAVE_D_TYPE CFLAGS+= -DCONFIG_WPA_CLI_EDIT=y LIBADD+=wpaap \ wpacommon \ - wpacrypto \ - wpaeap_common \ wpaeap_peer \ wpaeap_server \ wpaeapol_auth \ wpaeapol_supp \ + wpaeap_common \ wpal2_packet \ wparadius \ wparsn_supp \ wpatls \ + wpacrypto \ wpautils LIBADD+= pcap util diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 332f66315346..c86be9497eca 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -41,9 +41,10 @@ FILES= wpa_supplicant.conf CFLAGS+=-DCONFIG_BACKEND_FILE #CFLAGS+= -g -LIBADD+=pcap util wpaap wpacommon wpacrypto wpadrivers wpaeapol_supp \ - wpaeap_common wpaeap_server \ - wpaeap_peer wpal2_packet wparsn_supp wpatls wpautils wpawps +LIBADD+=pcap util wpadrivers wpaap wpaeapol_supp \ + wpaeap_server \ + wpaeap_peer wpaeap_common wpal2_packet wparsn_supp wpatls wpawps \ + wpacommon wpacrypto wpautils # User customizations to the wpa_supplicant build environment CFLAGS+=${WPA_SUPPLICANT_CFLAGS} From owner-dev-commits-src-all@freebsd.org Fri Aug 20 15:25:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE30C66230F; Fri, 20 Aug 2021 15:25:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrlnY4RdRz4Wn1; Fri, 20 Aug 2021 15:25:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 808211B665; Fri, 20 Aug 2021 15:25:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KFPLme081568; Fri, 20 Aug 2021 15:25:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KFPL2B081567; Fri, 20 Aug 2021 15:25:21 GMT (envelope-from git) Date: Fri, 20 Aug 2021 15:25:21 GMT Message-Id: <202108201525.17KFPL2B081567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 0a4379136f80 - stable/13 - wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0a4379136f80e7e3caf6d0f6b4069ca29895e5f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 15:25:21 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0a4379136f80e7e3caf6d0f6b4069ca29895e5f7 commit 0a4379136f80e7e3caf6d0f6b4069ca29895e5f7 Author: Cy Schubert AuthorDate: 2021-06-02 19:46:02 +0000 Commit: Cy Schubert CommitDate: 2021-08-20 15:24:54 +0000 wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload Incorrectly linked built-in wpa functions resulted in overwriting sm->ctx->set_rekey_offload with garbage. It was initialized correctly however it changed after wpa_supplicant became a daemon. No SIGBUS violations reported by dhw@ were experienced during testing of the original commit by msyelf or philip@. Reported by: dhw Tested by: dhw X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 (cherry picked from commit 9a0f82285322a338548d13fcda07e1d574301190) --- usr.sbin/wpa/Makefile.crypto | 1 + usr.sbin/wpa/hostapd/Makefile | 6 +- usr.sbin/wpa/hostapd_cli/Makefile | 4 +- usr.sbin/wpa/src/ap/Makefile | 4 +- usr.sbin/wpa/src/common/Makefile | 4 +- usr.sbin/wpa/src/crypto/Makefile | 175 ++++++++++++++++++++++++++++------- usr.sbin/wpa/src/drivers/Makefile | 4 +- usr.sbin/wpa/src/eap_common/Makefile | 4 +- usr.sbin/wpa/src/eap_peer/Makefile | 4 +- usr.sbin/wpa/src/eap_server/Makefile | 4 +- usr.sbin/wpa/src/eapol_auth/Makefile | 4 +- usr.sbin/wpa/src/eapol_supp/Makefile | 4 +- usr.sbin/wpa/src/l2_packet/Makefile | 4 +- usr.sbin/wpa/src/radius/Makefile | 4 +- usr.sbin/wpa/src/rsn_supp/Makefile | 4 +- usr.sbin/wpa/src/tls/Makefile | 15 ++- usr.sbin/wpa/src/utils/Makefile | 4 +- usr.sbin/wpa/src/wps/Makefile | 4 +- usr.sbin/wpa/wpa_cli/Makefile | 6 +- usr.sbin/wpa/wpa_passphrase/Makefile | 4 +- usr.sbin/wpa/wpa_priv/Makefile | 6 +- usr.sbin/wpa/wpa_supplicant/Makefile | 7 +- 22 files changed, 191 insertions(+), 85 deletions(-) diff --git a/usr.sbin/wpa/Makefile.crypto b/usr.sbin/wpa/Makefile.crypto index a7ddb917ac6d..a65ee29e0ebe 100644 --- a/usr.sbin/wpa/Makefile.crypto +++ b/usr.sbin/wpa/Makefile.crypto @@ -24,6 +24,7 @@ NEED_AES_ENC=true NEED_AES_CBC=true .endif NEED_AES_OMAC1=true +TLS_FUNCS=y .if defined(TLS_FUNCS) NEED_TLS_PRF=y diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile index 6e026babae1a..c0083747782a 100644 --- a/usr.sbin/wpa/hostapd/Makefile +++ b/usr.sbin/wpa/hostapd/Makefile @@ -3,6 +3,8 @@ .include .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${HOSTAPD_DISTDIR} PACKAGE= hostapd @@ -40,8 +42,6 @@ CFLAGS+=${HOSTAPD_CFLAGS} LDADD+=${HOSTAPD_LDADD} #LDFLAGS+=${HOSTAPD_LDFLAGS} -TLS_FUNCS=y - # For WPS, EAP modes, etc NEED_DH_GROUPS=y NEED_DH_GROUPS_ALL=y @@ -67,6 +67,4 @@ CFLAGS+=-DEAP_GPSK_SHA256 NEED_AES_OMAC1=y .endif -.include "../Makefile.crypto" - .include diff --git a/usr.sbin/wpa/hostapd_cli/Makefile b/usr.sbin/wpa/hostapd_cli/Makefile index 276e25058298..fef18dab7b32 100644 --- a/usr.sbin/wpa/hostapd_cli/Makefile +++ b/usr.sbin/wpa/hostapd_cli/Makefile @@ -2,6 +2,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${HOSTAPD_DISTDIR} PACKAGE= hostapd @@ -12,6 +14,4 @@ LIBADD+= util wpacommon wpautils MAN= hostapd_cli.8 -.include "../Makefile.crypto" - .include diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile index edb2f1e9d089..77caf1ed8efe 100644 --- a/usr.sbin/wpa/src/ap/Makefile +++ b/usr.sbin/wpa/src/ap/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaap INTERNALLIB= @@ -51,8 +53,6 @@ CFLAGS+=-DCONFIG_MBO \ -DCONFIG_RSN_PREAUTH \ -DHOSTAPD -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/common/Makefile b/usr.sbin/wpa/src/common/Makefile index 28c16ff9d31a..b415b926c207 100644 --- a/usr.sbin/wpa/src/common/Makefile +++ b/usr.sbin/wpa/src/common/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpacommon INTERNALLIB= @@ -19,8 +21,6 @@ CFLAGS+=-DCONFIG_SAE \ -DCONFIG_SUITE \ -DCONFIG_SUITEB -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile index d7e1304dc95e..b25489072425 100644 --- a/usr.sbin/wpa/src/crypto/Makefile +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -2,49 +2,156 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpacrypto INTERNALLIB= .PATH: ${WPA_DISTDIR}/src/crypto -SRCS= aes-cbc.c \ - aes-ctr.c \ - aes-eax.c \ - aes-encblock.c \ - aes-internal.c \ - aes-internal-dec.c \ - aes-internal-enc.c \ - aes-omac1.c \ - aes-unwrap.c \ - aes-wrap.c \ - crypto_internal.c \ - crypto_internal-cipher.c \ - crypto_internal-modexp.c \ - crypto_internal-rsa.c \ - des-internal.c \ - dh_group5.c \ - dh_groups.c \ - fips_prf_internal.c \ - md4-internal.c \ - md5.c \ - md5-internal.c \ - ms_funcs.c \ +.if ${MK_OPENSSL} != "no" +SRCS= crypto_openssl.c \ random.c \ - rc4.c \ - sha1.c \ - sha1-internal.c \ - sha1-pbkdf2.c \ sha1-prf.c \ - sha1-tlsprf.c \ - sha256.c \ sha256-prf.c \ sha256-tlsprf.c \ - sha256-internal.c \ - sha384.c \ - sha384-prf.c \ - sha384-internal.c \ - sha512-internal.c \ + sha512.c +.else +SRCS= crypto_internal.c \ + random.c +.endif + +.if defined(TLS_FUNCS) +.if defined(CONFIG_INTERNAL_TLS) +SRCS+= crypto_internal-cipher.c \ + crypto_internal-modexp.c \ + crypto_internal-rsa.c \ tls_internal.c +.else +SRCS+= tls_openssl.c \ + tls_openssl_ocsp.c +.endif +.endif + +.if defined(CONFIG_INTERNAL_AES) +SRCS+= aes-unwrap.c aes-wrap.c \ + aes-internal.c \ + aes-internal-dec.c \ + aes-internal-enc.c +.else +.endif + +.if defined(NEED_AES_CBC) +SRCS+= aes-cbc.c +.endif + +.if defined(NEED_AES_EAX) +SRCS+= aes-eax.c +.endif + +.if defined(NEED_AES_CTR) +SRCS+= aes-ctr.c +.endif + +.if defined(NEED_AES_ENCBLOCK) +SRCS+= aes-encblock.c +.endif + +.if defined(NEED_AES_OMAC1) +SRCS+= aes-omac1.c +.endif + +.if defined(NEED_DES) +.if defined(CONFIG_INTERNAL_DES) +SRCS+= des-internal.c +.endif +.endif + +.if defined(NEED_MD4) +.if defined(CONFIG_INTERNAL_MD4) +SRCS+= md4-internal.c +.endif +.endif + +.if defined(CONFIG_INTERNAL_MD5) +SRCS+= md5.c \ + md5-internal.c +.endif + +.if defined(NEED_FIPS186_2_PRF) +.if defined(CONFIG_INTERNAL_SHA1) +SRCS+= fips_prf_internal.c +.else +SRCS+= fips_prf_openssl.c +.endif +.endif + +.if defined(CONFIG_INTERNAL_RC4) +SRCS+= rc4.c +.endif + +.if defined(CONFIG_INTERNAL_SHA1) +SRCS+= sha1-internal.c \ + sha1-pbkdf2.c \ + sha1.c \ + sha1-prf.c +.endif + +.if defined(NEED_SHA256) +SRCS+= sha256.c +.if defined(CONFIG_INTERNAL_SHA256) +SRCS+= sha256-internal.c \ + sha256-prf.c +.endif +.endif + +.if defined(NEED_SHA384) +SRCS+= sha384.c +.if defined(CONFIG_INTERNAL_SHA384) +SRCS+= sha384-internal.c \ + sha384-prf.c +.endif +.endif + +.if defined(NEED_SHA512) +SRCS+= sha512.c +.if defined(CONFIG_INTERNAL_SHA512) +SRCS+= sha512-internal.c \ + sha512-prf.c +.endif +.endif + +.if defined(NEED_TLS_PRF) +SRCS+= sha1-tlsprf.c +.endif + +.if defined(CONFIG_INTERNAL_DH5) +.if defined(NEED_DH_GROUPS) +SRCS+= dh_group5.c +.endif +.endif + +.if defined(NEED_DH_GROUPS) +SRCS+= dh_groups.c +.endif + +.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" +CFLAGS+=-DCONFIG_WPS \ + -DCONFIG_HS20 \ + -DCONFIG_INTERWORKING \ + -DEAP_GTC \ + -DEAP_LEAP \ + -DEAP_MD5 \ + -DEAP_MSCHAPv2 \ + -DEAP_OTP \ + -DEAP_PEAP \ + -DEAP_PSK \ + -DEAP_TLS \ + -DEAP_TTLS \ + -DEAP_WSC \ + -DIEEE8021X_EAPOL +SRCS+= ms_funcs.c +.endif CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_TLS_INTERNAL_CLIENT \ @@ -55,8 +162,6 @@ CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_INTERNAL_SHA384 #CFLAGS+=-DALL_DH_GROUPS -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/drivers/Makefile b/usr.sbin/wpa/src/drivers/Makefile index 1800b651885f..0f901bdcf2fd 100644 --- a/usr.sbin/wpa/src/drivers/Makefile +++ b/usr.sbin/wpa/src/drivers/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpadrivers INTERNALLIB= @@ -13,8 +15,6 @@ SRCS= drivers.c \ driver_wired.c \ driver_wired_common.c -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eap_common/Makefile b/usr.sbin/wpa/src/eap_common/Makefile index 4da89b221b36..7ec416c74102 100644 --- a/usr.sbin/wpa/src/eap_common/Makefile +++ b/usr.sbin/wpa/src/eap_common/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeap_common INTERNALLIB= @@ -17,8 +19,6 @@ SRCS= chap.c \ eap_sim_common.c \ eap_wsc_common.c -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eap_peer/Makefile b/usr.sbin/wpa/src/eap_peer/Makefile index 524c7cf6c6f1..bab1b690f6d9 100644 --- a/usr.sbin/wpa/src/eap_peer/Makefile +++ b/usr.sbin/wpa/src/eap_peer/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeap_peer INTERNALLIB= @@ -25,8 +27,6 @@ SRCS= eap.c \ CFLAGS+=-DIEEE8021X_EAPOL -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eap_server/Makefile b/usr.sbin/wpa/src/eap_server/Makefile index c5a4566bb444..795d2a9c68a0 100644 --- a/usr.sbin/wpa/src/eap_server/Makefile +++ b/usr.sbin/wpa/src/eap_server/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeap_server INTERNALLIB= @@ -26,8 +28,6 @@ SRCS= eap_server.c \ eap_server_wsc.c \ eap_sim_db.c -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eapol_auth/Makefile b/usr.sbin/wpa/src/eapol_auth/Makefile index 7f05367edfb0..984b96df5c6f 100644 --- a/usr.sbin/wpa/src/eapol_auth/Makefile +++ b/usr.sbin/wpa/src/eapol_auth/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeapol_auth INTERNALLIB= @@ -10,8 +12,6 @@ INTERNALLIB= SRCS= eapol_auth_sm.c \ eapol_auth_dump.c -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eapol_supp/Makefile b/usr.sbin/wpa/src/eapol_supp/Makefile index 2b3cc0179109..a4588fc23de1 100644 --- a/usr.sbin/wpa/src/eapol_supp/Makefile +++ b/usr.sbin/wpa/src/eapol_supp/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeapol_supp INTERNALLIB= @@ -11,8 +13,6 @@ SRCS= eapol_supp_sm.c CFLAGS+=-DIEEE8021X_EAPOL -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/l2_packet/Makefile b/usr.sbin/wpa/src/l2_packet/Makefile index 89ce771b0343..f53dc81fdf52 100644 --- a/usr.sbin/wpa/src/l2_packet/Makefile +++ b/usr.sbin/wpa/src/l2_packet/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpal2_packet INTERNALLIB= @@ -11,8 +13,6 @@ SRCS= l2_packet_freebsd.c CFLAGS+=-DIEEE8021X_EAPOL -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/radius/Makefile b/usr.sbin/wpa/src/radius/Makefile index 1ef986a799ae..a37d60be6f7d 100644 --- a/usr.sbin/wpa/src/radius/Makefile +++ b/usr.sbin/wpa/src/radius/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wparadius INTERNALLIB= @@ -16,8 +18,6 @@ SRCS= radius.c \ CFLAGS+= -DCONFIG_IPV6 .endif -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/rsn_supp/Makefile b/usr.sbin/wpa/src/rsn_supp/Makefile index 1b50689e6960..4d952c2204c4 100644 --- a/usr.sbin/wpa/src/rsn_supp/Makefile +++ b/usr.sbin/wpa/src/rsn_supp/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wparsn_supp INTERNALLIB= @@ -18,8 +20,6 @@ CFLAGS+=-DCONFIG_TDLS \ -DCONFIG_WNM \ -DIEEE8021X_EAPOL -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/tls/Makefile b/usr.sbin/wpa/src/tls/Makefile index defe9b0faf6e..e5fdf96444d6 100644 --- a/usr.sbin/wpa/src/tls/Makefile +++ b/usr.sbin/wpa/src/tls/Makefile @@ -2,36 +2,41 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpatls INTERNALLIB= .PATH: ${WPA_DISTDIR}/src/tls -SRCS= asn1.c \ +SRCS= tlsv1_server.c + +.if defined(TLS_FUNCS) +.if defined(CONFIG_INTERNAL_TLS) +SRCS+= asn1.c \ bignum.c \ pkcs1.c \ pkcs5.c \ pkcs8.c \ rsa.c \ tlsv1_client.c \ + tlsv1_client_ocsp.c \ tlsv1_client_read.c \ tlsv1_client_write.c \ - tlsv1_client_ocsp.c \ tlsv1_common.c \ tlsv1_cred.c \ tlsv1_record.c \ - tlsv1_server.c \ tlsv1_server_read.c \ tlsv1_server_write.c \ x509v3.c +.endif +.endif CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \ -DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_TLSV11 \ -DCONFIG_TLSV12 -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/utils/Makefile b/usr.sbin/wpa/src/utils/Makefile index f08a2d78fced..22ec732a2b3b 100644 --- a/usr.sbin/wpa/src/utils/Makefile +++ b/usr.sbin/wpa/src/utils/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpautils INTERNALLIB= @@ -24,8 +26,6 @@ CFLAGS+=-DCONFIG_DEBUG_FILE CFLAGS+= -DCONFIG_IPV6 .endif -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/wps/Makefile b/usr.sbin/wpa/src/wps/Makefile index ddb40b682c27..5f5485d69bce 100644 --- a/usr.sbin/wpa/src/wps/Makefile +++ b/usr.sbin/wpa/src/wps/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpawps INTERNALLIB= @@ -31,8 +33,6 @@ CFLAGS+=-DCONFIG_P2P CFLAGS+= -DCONFIG_IPV6 .endif -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/wpa_cli/Makefile b/usr.sbin/wpa/wpa_cli/Makefile index 7568154a7e45..bf2cf6252550 100644 --- a/usr.sbin/wpa/wpa_cli/Makefile +++ b/usr.sbin/wpa/wpa_cli/Makefile @@ -4,6 +4,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${WPA_SUPPLICANT_DISTDIR} PACKAGE= wpa @@ -32,8 +34,4 @@ LIBADD+=wpaap \ wpautils LIBADD+= pcap util -TLS_FUNCS=y - -.include "../Makefile.crypto" - .include diff --git a/usr.sbin/wpa/wpa_passphrase/Makefile b/usr.sbin/wpa/wpa_passphrase/Makefile index 0dcb3e69da98..4cd540696d67 100644 --- a/usr.sbin/wpa/wpa_passphrase/Makefile +++ b/usr.sbin/wpa/wpa_passphrase/Makefile @@ -2,6 +2,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${WPA_SUPPLICANT_DISTDIR} PACKAGE= wpa @@ -14,6 +16,4 @@ LIBADD+= util wpacrypto wpautils MAN= wpa_passphrase.8 -.include "../Makefile.crypto" - .include diff --git a/usr.sbin/wpa/wpa_priv/Makefile b/usr.sbin/wpa/wpa_priv/Makefile index fd316402c1cf..d3b693341276 100644 --- a/usr.sbin/wpa/wpa_priv/Makefile +++ b/usr.sbin/wpa/wpa_priv/Makefile @@ -2,6 +2,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${WPA_SUPPLICANT_DISTDIR} PACKAGE= wpa @@ -9,8 +11,6 @@ PROG= wpa_priv SRCS= os_unix.c eloop.c common.c wpa_debug.c wpabuf.c wpa_priv.c \ l2_packet_freebsd.c -LIBADD= pcap wpadrivers - -.include "../Makefile.crypto" +LIBADD+=pcap wpadrivers .include diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 482c06d68e40..332f66315346 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -4,6 +4,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${WPA_SUPPLICANT_DISTDIR} \ ${WPA_DISTDIR}/src/drivers @@ -39,7 +41,7 @@ FILES= wpa_supplicant.conf CFLAGS+=-DCONFIG_BACKEND_FILE #CFLAGS+= -g -LIBADD= pcap util wpaap wpacommon wpacrypto wpadrivers wpaeapol_supp \ +LIBADD+=pcap util wpaap wpacommon wpacrypto wpadrivers wpaeapol_supp \ wpaeap_common wpaeap_server \ wpaeap_peer wpal2_packet wparsn_supp wpatls wpautils wpawps @@ -68,7 +70,6 @@ NEED_AES_EAX=y NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif -TLS_FUNCS=y .if !empty(CFLAGS:M*-DEAP_AKA) SRCS+= eap_aka.c @@ -116,6 +117,4 @@ SRCS+= eap_sake.c \ eap_sake_common.c .endif -.include "../Makefile.crypto" - .include From owner-dev-commits-src-all@freebsd.org Fri Aug 20 15:25:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 460B3662544; Fri, 20 Aug 2021 15:25:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grlnd0wTfz4WjP; Fri, 20 Aug 2021 15:25:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F19D91B455; Fri, 20 Aug 2021 15:25:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KFPO65081647; Fri, 20 Aug 2021 15:25:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KFPOGg081646; Fri, 20 Aug 2021 15:25:24 GMT (envelope-from git) Date: Fri, 20 Aug 2021 15:25:24 GMT Message-Id: <202108201525.17KFPOGg081646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: a3e54ad094ae - stable/13 - wpa: Add wpa_cli action file event MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3e54ad094ae3b42156cc5fdbcbab0ac44c71925 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 15:25:25 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=a3e54ad094ae3b42156cc5fdbcbab0ac44c71925 commit a3e54ad094ae3b42156cc5fdbcbab0ac44c71925 Author: Cy Schubert AuthorDate: 2021-08-12 13:38:21 +0000 Commit: Cy Schubert CommitDate: 2021-08-20 15:24:55 +0000 wpa: Add wpa_cli action file event Yang Zhong at FreeBSD Foundation is working on a wireless network configuratior for an experimental FreeBSD installer. The new installer requires an event to detect when connecting to a network fails due to a bad password. When this happens a WPA-EVENT-TEMP-DISABLED event is triggered. This patch passes the event to an action file provided by the new experimental installer. Submitted by: Yang Zhong Reviewed by: assumed to be reviewed by emaste (and cy) (cherry picked from commit ce92f5a91b161c85e0a7e37cc754e3c28074281a) --- contrib/wpa/wpa_supplicant/wpa_cli.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/wpa/wpa_supplicant/wpa_cli.c b/contrib/wpa/wpa_supplicant/wpa_cli.c index 43ac427203ec..9ad2e3ef2144 100644 --- a/contrib/wpa/wpa_supplicant/wpa_cli.c +++ b/contrib/wpa/wpa_supplicant/wpa_cli.c @@ -3977,6 +3977,8 @@ static void wpa_cli_action_process(const char *msg) wpa_cli_connected = 0; wpa_cli_exec(action_file, ifname, "DISCONNECTED"); } + } else if (str_starts(pos, WPA_EVENT_TEMP_DISABLED)) { + wpa_cli_exec(action_file, ifname, pos); } else if (str_starts(pos, WPA_EVENT_CHANNEL_SWITCH_STARTED)) { wpa_cli_exec(action_file, ctrl_ifname, pos); } else if (str_starts(pos, AP_EVENT_ENABLED)) { From owner-dev-commits-src-all@freebsd.org Fri Aug 20 15:25:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 197B166236D; Fri, 20 Aug 2021 15:25:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grlnb6vlsz4Wlw; Fri, 20 Aug 2021 15:25:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF0551B52B; Fri, 20 Aug 2021 15:25:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KFPNiV081623; Fri, 20 Aug 2021 15:25:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KFPNai081622; Fri, 20 Aug 2021 15:25:23 GMT (envelope-from git) Date: Fri, 20 Aug 2021 15:25:23 GMT Message-Id: <202108201525.17KFPNai081622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 3003edd28aa0 - stable/13 - wpa: The ap library is not needed by wpa_supplicant or wpa_cli MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3003edd28aa0fdf97adac8334cecc4a15ddde6ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 15:25:24 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=3003edd28aa0fdf97adac8334cecc4a15ddde6ca commit 3003edd28aa0fdf97adac8334cecc4a15ddde6ca Author: Cy Schubert AuthorDate: 2021-06-12 23:51:51 +0000 Commit: Cy Schubert CommitDate: 2021-08-20 15:24:55 +0000 wpa: The ap library is not needed by wpa_supplicant or wpa_cli The ap library is not needed by wpa_supplicant or wpa_cli. It is only used by hostapd. (cherry picked from commit dc9d54b5c1e058b4f1bb9ab9372b171ac87a0d72) --- usr.sbin/wpa/wpa_cli/Makefile | 3 +-- usr.sbin/wpa/wpa_supplicant/Makefile | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/wpa/wpa_cli/Makefile b/usr.sbin/wpa/wpa_cli/Makefile index 93a24295f4a2..2aad727a6785 100644 --- a/usr.sbin/wpa/wpa_cli/Makefile +++ b/usr.sbin/wpa/wpa_cli/Makefile @@ -19,8 +19,7 @@ CFLAGS+= -DCONFIG_TLS=openssl CFLAGS+= -D_DIRENT_HAVE_D_TYPE CFLAGS+= -DCONFIG_WPA_CLI_EDIT=y -LIBADD+=wpaap \ - wpacommon \ +LIBADD+=wpacommon \ wpaeap_peer \ wpaeap_server \ wpaeapol_auth \ diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index c86be9497eca..9b31bea2a63c 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -41,7 +41,7 @@ FILES= wpa_supplicant.conf CFLAGS+=-DCONFIG_BACKEND_FILE #CFLAGS+= -g -LIBADD+=pcap util wpadrivers wpaap wpaeapol_supp \ +LIBADD+=pcap util wpadrivers wpaeapol_supp \ wpaeap_server \ wpaeap_peer wpaeap_common wpal2_packet wparsn_supp wpatls wpawps \ wpacommon wpacrypto wpautils From owner-dev-commits-src-all@freebsd.org Fri Aug 20 16:01:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAB3266309C; Fri, 20 Aug 2021 16:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrmbD4RgYz4ZqK; Fri, 20 Aug 2021 16:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81BFE1BC30; Fri, 20 Aug 2021 16:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KG1Sdp031289; Fri, 20 Aug 2021 16:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KG1S0j031288; Fri, 20 Aug 2021 16:01:28 GMT (envelope-from git) Date: Fri, 20 Aug 2021 16:01:28 GMT Message-Id: <202108201601.17KG1S0j031288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: ec97e9ca1fa5 - main - Fully revert f83f5d58394db57576bbed6dc7531997cabeb102 for the sys/dev/usb/serial folder, only keeping the zero length packet API introduced in sys/dev/usb after more reports of USB serial devices not supporting ZLPs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec97e9ca1fa543a4a803e84706564d41cd492065 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 16:01:28 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ec97e9ca1fa543a4a803e84706564d41cd492065 commit ec97e9ca1fa543a4a803e84706564d41cd492065 Author: Hans Petter Selasky AuthorDate: 2021-08-20 15:59:29 +0000 Commit: Hans Petter Selasky CommitDate: 2021-08-20 16:00:42 +0000 Fully revert f83f5d58394db57576bbed6dc7531997cabeb102 for the sys/dev/usb/serial folder, only keeping the zero length packet API introduced in sys/dev/usb after more reports of USB serial devices not supporting ZLPs. Reported by: mav@ MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/serial/u3g.c | 6 ++---- sys/dev/usb/serial/uark.c | 10 ++++------ sys/dev/usb/serial/ubsa.c | 10 ++++------ sys/dev/usb/serial/ubser.c | 10 ++++------ sys/dev/usb/serial/uchcom.c | 6 ++---- sys/dev/usb/serial/ufoma.c | 10 ++++------ sys/dev/usb/serial/uftdi.c | 1 + sys/dev/usb/serial/ugensa.c | 11 +++++------ sys/dev/usb/serial/uipaq.c | 10 ++++------ sys/dev/usb/serial/ulpt.c | 9 +++++---- sys/dev/usb/serial/umcs.c | 10 ++++------ sys/dev/usb/serial/umodem.c | 18 +++++++++--------- sys/dev/usb/serial/umoscom.c | 10 ++++------ sys/dev/usb/serial/uplcom.c | 21 ++++++++++----------- sys/dev/usb/serial/uslcom.c | 10 ++++------ sys/dev/usb/serial/uvscom.c | 10 ++++------ 16 files changed, 70 insertions(+), 92 deletions(-) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index d7d8fd80b42a..22e4e8f6b2bb 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -978,7 +978,8 @@ u3g_attach(device_t dev) /* set stall by default */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[nports][U3G_BULK_WR]); + usbd_xfer_set_stall(sc->sc_xfer[nports][U3G_BULK_WR]); + usbd_xfer_set_stall(sc->sc_xfer[nports][U3G_BULK_RD]); mtx_unlock(&sc->sc_mtx); nports++; /* found one port */ @@ -1099,9 +1100,6 @@ u3g_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_TRANSFERRED: case USB_ST_SETUP: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - for (frame = 0; frame != U3G_TXFRAMES; frame++) { usbd_xfer_set_frame_offset(xfer, frame * U3G_TXSIZE, frame); diff --git a/sys/dev/usb/serial/uark.c b/sys/dev/usb/serial/uark.c index 072edf6389cd..904977e1ec14 100644 --- a/sys/dev/usb/serial/uark.c +++ b/sys/dev/usb/serial/uark.c @@ -219,7 +219,8 @@ uark_attach(device_t dev) } /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UARK_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UARK_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UARK_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -280,16 +281,13 @@ uark_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, UARK_BUF_SIZE, &actlen)) { usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -297,7 +295,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/ubsa.c b/sys/dev/usb/serial/ubsa.c index 3286df7331b4..10b37984db2f 100644 --- a/sys/dev/usb/serial/ubsa.c +++ b/sys/dev/usb/serial/ubsa.c @@ -320,7 +320,8 @@ ubsa_attach(device_t dev) } /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UBSA_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UBSA_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UBSA_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -582,16 +583,13 @@ ubsa_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, UBSA_BSIZE, &actlen)) { usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -599,7 +597,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/ubser.c b/sys/dev/usb/serial/ubser.c index 61b9c6c433fb..2a35756b0a7e 100644 --- a/sys/dev/usb/serial/ubser.c +++ b/sys/dev/usb/serial/ubser.c @@ -293,7 +293,8 @@ ubser_attach(device_t dev) ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UBSER_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UBSER_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UBSER_BULK_DT_RD]); usbd_transfer_start(sc->sc_xfer[UBSER_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); @@ -409,9 +410,6 @@ ubser_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); do { if (ucom_get_data(sc->sc_ucom + sc->sc_curr_tx_unit, @@ -432,7 +430,7 @@ tr_setup: } while (sc->sc_curr_tx_unit != first_unit); - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -440,7 +438,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c index aef1515d3586..6b17141c6ece 100644 --- a/sys/dev/usb/serial/uchcom.c +++ b/sys/dev/usb/serial/uchcom.c @@ -350,7 +350,8 @@ uchcom_attach(device_t dev) /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UCHCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UCHCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UCHCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -827,9 +828,6 @@ uchcom_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, usbd_xfer_max_len(xfer), &actlen)) { diff --git a/sys/dev/usb/serial/ufoma.c b/sys/dev/usb/serial/ufoma.c index ca52752accad..bc3f00a7b473 100644 --- a/sys/dev/usb/serial/ufoma.c +++ b/sys/dev/usb/serial/ufoma.c @@ -438,7 +438,8 @@ ufoma_attach(device_t dev) /* clear stall at first run, if any */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE]); + usbd_xfer_set_stall(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE]); + usbd_xfer_set_stall(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ]); mtx_unlock(&sc->sc_mtx); error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -790,16 +791,13 @@ ufoma_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, UFOMA_BULK_BUF_SIZE, &actlen)) { usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -807,7 +805,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c index 7fd531b3e381..a630fcbac5b5 100644 --- a/sys/dev/usb/serial/uftdi.c +++ b/sys/dev/usb/serial/uftdi.c @@ -1118,6 +1118,7 @@ uftdi_attach(device_t dev) /* clear stall at first run */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UFTDI_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UFTDI_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); /* set a valid "lcr" value */ diff --git a/sys/dev/usb/serial/ugensa.c b/sys/dev/usb/serial/ugensa.c index 1d2f1e57ef58..ba694e4805bd 100644 --- a/sys/dev/usb/serial/ugensa.c +++ b/sys/dev/usb/serial/ugensa.c @@ -233,8 +233,10 @@ ugensa_attach(device_t dev) break; } + /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(ssc->sc_xfer[UGENSA_BULK_DT_WR]); + usbd_xfer_set_stall(ssc->sc_xfer[UGENSA_BULK_DT_WR]); + usbd_xfer_set_stall(ssc->sc_xfer[UGENSA_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); /* initialize port number */ @@ -311,16 +313,13 @@ ugensa_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(ssc->sc_ucom_ptr, pc, 0, UGENSA_BUF_SIZE, &actlen)) { usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -328,7 +327,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/uipaq.c b/sys/dev/usb/serial/uipaq.c index 0449a5663c71..33f2ae4c0845 100644 --- a/sys/dev/usb/serial/uipaq.c +++ b/sys/dev/usb/serial/uipaq.c @@ -1157,7 +1157,8 @@ uipaq_attach(device_t dev) } /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UIPAQ_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UIPAQ_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UIPAQ_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -1319,16 +1320,13 @@ uipaq_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, UIPAQ_BUF_SIZE, &actlen)) { usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -1336,7 +1334,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/ulpt.c b/sys/dev/usb/serial/ulpt.c index 56f99519d4cd..c566da924374 100644 --- a/sys/dev/usb/serial/ulpt.c +++ b/sys/dev/usb/serial/ulpt.c @@ -218,9 +218,6 @@ ulpt_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_TRANSFERRED: case USB_ST_SETUP: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); max = usbd_xfer_max_len(xfer); if (usb_fifo_get_data(f, pc, 0, max, &actlen, 0)) { @@ -439,6 +436,10 @@ unlpt_open(struct usb_fifo *fifo, int fflags) return (EBUSY); } if (fflags & FREAD) { + /* clear stall first */ + mtx_lock(&sc->sc_mtx); + usbd_xfer_set_stall(sc->sc_xfer[ULPT_BULK_DT_RD]); + mtx_unlock(&sc->sc_mtx); if (usb_fifo_alloc_buffer(fifo, usbd_xfer_max_len(sc->sc_xfer[ULPT_BULK_DT_RD]), ULPT_IFQ_MAXLEN)) { @@ -450,7 +451,7 @@ unlpt_open(struct usb_fifo *fifo, int fflags) if (fflags & FWRITE) { /* clear stall first */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[ULPT_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[ULPT_BULK_DT_WR]); mtx_unlock(&sc->sc_mtx); if (usb_fifo_alloc_buffer(fifo, usbd_xfer_max_len(sc->sc_xfer[ULPT_BULK_DT_WR]), diff --git a/sys/dev/usb/serial/umcs.c b/sys/dev/usb/serial/umcs.c index 76ecd1ffa452..e3c8f1a764fb 100644 --- a/sys/dev/usb/serial/umcs.c +++ b/sys/dev/usb/serial/umcs.c @@ -382,7 +382,8 @@ umcs7840_attach(device_t dev) /* clear stall at first run */ mtx_lock(&sc->sc_mtx); for (subunit = 0; subunit < sc->sc_numports; ++subunit) { - usbd_xfer_set_zlp(sc->sc_ports[sc->sc_ucom[subunit].sc_portno].sc_xfer[UMCS7840_BULK_WR_EP]); + usbd_xfer_set_stall(sc->sc_ports[sc->sc_ucom[subunit].sc_portno].sc_xfer[UMCS7840_BULK_RD_EP]); + usbd_xfer_set_stall(sc->sc_ports[sc->sc_ucom[subunit].sc_portno].sc_xfer[UMCS7840_BULK_WR_EP]); } mtx_unlock(&sc->sc_mtx); @@ -915,16 +916,13 @@ umcs7840_write_callbackN(struct usb_xfer *xfer, usb_error_t error, uint8_t subun case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(ucom, pc, 0, usbd_xfer_max_len(xfer), &actlen)) { DPRINTF("Port %d write, has %d bytes\n", ucom->sc_portno, actlen); usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -932,7 +930,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/umodem.c b/sys/dev/usb/serial/umodem.c index b8b7ae2f005c..573d74cdb526 100644 --- a/sys/dev/usb/serial/umodem.c +++ b/sys/dev/usb/serial/umodem.c @@ -447,10 +447,13 @@ umodem_attach(device_t dev) goto detach; } - /* send a ZLP at first run */ - mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UMODEM_BULK_WR]); - mtx_unlock(&sc->sc_mtx); + /* clear stall at first run, if USB host mode */ + if (uaa->usb_mode == USB_MODE_HOST) { + mtx_lock(&sc->sc_mtx); + usbd_xfer_set_stall(sc->sc_xfer[UMODEM_BULK_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UMODEM_BULK_RD]); + mtx_unlock(&sc->sc_mtx); + } ucom_set_usb_mode(&sc->sc_super_ucom, uaa->usb_mode); @@ -860,16 +863,13 @@ umodem_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, UMODEM_BUF_SIZE, &actlen)) { usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -877,7 +877,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/umoscom.c b/sys/dev/usb/serial/umoscom.c index 536772a7f697..724ab7f94092 100644 --- a/sys/dev/usb/serial/umoscom.c +++ b/sys/dev/usb/serial/umoscom.c @@ -333,7 +333,8 @@ umoscom_attach(device_t dev) } /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UMOSCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UMOSCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UMOSCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -638,16 +639,13 @@ umoscom_write_callback(struct usb_xfer *xfer, usb_error_t error) tr_setup: DPRINTF("\n"); - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, UMOSCOM_BUFSIZE, &actlen)) { usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -656,7 +654,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/uplcom.c b/sys/dev/usb/serial/uplcom.c index 6808ddd64a4b..9efac9ff6b7c 100644 --- a/sys/dev/usb/serial/uplcom.c +++ b/sys/dev/usb/serial/uplcom.c @@ -507,12 +507,14 @@ uplcom_attach(device_t dev) goto detach; } - mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UPLCOM_BULK_DT_WR]); - mtx_unlock(&sc->sc_mtx); - - if (sc->sc_chiptype == TYPE_PL2303HX || - sc->sc_chiptype == TYPE_PL2303HXD) { + if (sc->sc_chiptype == TYPE_PL2303) { + /* HX variants seem to lock up after a clear stall request. */ + mtx_lock(&sc->sc_mtx); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); + mtx_unlock(&sc->sc_mtx); + } else if (sc->sc_chiptype == TYPE_PL2303HX || + sc->sc_chiptype == TYPE_PL2303HXD) { /* reset upstream data pipes */ if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) || @@ -1092,9 +1094,6 @@ uplcom_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, UPLCOM_BULK_BUF_SIZE, &actlen)) { @@ -1103,7 +1102,7 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -1111,7 +1110,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/uslcom.c b/sys/dev/usb/serial/uslcom.c index 8c40a2c2fc3a..fec18d2a5631 100644 --- a/sys/dev/usb/serial/uslcom.c +++ b/sys/dev/usb/serial/uslcom.c @@ -443,7 +443,8 @@ uslcom_attach(device_t dev) } /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[USLCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[USLCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[USLCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); sc->sc_partnum = uslcom_get_partnum(sc); @@ -818,9 +819,6 @@ uslcom_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, USLCOM_BULK_BUF_SIZE, &actlen)) { @@ -829,7 +827,7 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -837,7 +835,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } diff --git a/sys/dev/usb/serial/uvscom.c b/sys/dev/usb/serial/uvscom.c index 81fd5334a243..8bb69e4402cf 100644 --- a/sys/dev/usb/serial/uvscom.c +++ b/sys/dev/usb/serial/uvscom.c @@ -318,7 +318,8 @@ uvscom_attach(device_t dev) /* clear stall at first run */ mtx_lock(&sc->sc_mtx); - usbd_xfer_set_zlp(sc->sc_xfer[UVSCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UVSCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UVSCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -390,16 +391,13 @@ uvscom_write_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: case USB_ST_TRANSFERRED: tr_setup: - if (usbd_xfer_get_and_clr_zlp(xfer)) - break; - pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, UVSCOM_BULK_BUF_SIZE, &actlen)) { usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - break; + return; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -407,7 +405,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - break; + return; } } From owner-dev-commits-src-all@freebsd.org Fri Aug 20 16:09:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 360D5663342; Fri, 20 Aug 2021 16:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrmmZ0hGTz4bf5; Fri, 20 Aug 2021 16:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 015F01BE6F; Fri, 20 Aug 2021 16:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KG9XA4035978; Fri, 20 Aug 2021 16:09:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KG9XqS035977; Fri, 20 Aug 2021 16:09:33 GMT (envelope-from git) Date: Fri, 20 Aug 2021 16:09:33 GMT Message-Id: <202108201609.17KG9XqS035977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: f12b1b8b47bf - main - Remove unused function mana_reset_counters. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f12b1b8b47bfad0a9d151b1e47c23074c141e8fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 16:09:34 -0000 The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=f12b1b8b47bfad0a9d151b1e47c23074c141e8fe commit f12b1b8b47bfad0a9d151b1e47c23074c141e8fe Author: Wei Hu AuthorDate: 2021-08-20 15:00:02 +0000 Commit: Wei Hu CommitDate: 2021-08-20 16:05:40 +0000 Remove unused function mana_reset_counters. This fixes the build warning caused by this function. Reported by: markj Tested by: whu MFC after: 2 weeks Sponsored by: Microsoft --- sys/dev/mana/mana_en.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c index e6cffb852d70..ffeee336f694 100644 --- a/sys/dev/mana/mana_en.c +++ b/sys/dev/mana/mana_en.c @@ -279,15 +279,6 @@ mana_free_counters(counter_u64_t *begin, int size) counter_u64_free(*begin); } -static inline void -mana_reset_counters(counter_u64_t *begin, int size) -{ - counter_u64_t *end = (counter_u64_t *)((char *)begin + size); - - for (; begin < end; ++begin) - counter_u64_zero(*begin); -} - static bool mana_can_tx(struct gdma_queue *wq) { From owner-dev-commits-src-all@freebsd.org Fri Aug 20 16:22:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5ABC663591; Fri, 20 Aug 2021 16:22:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grn396D87z4cX7; Fri, 20 Aug 2021 16:22:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD9C01C314; Fri, 20 Aug 2021 16:22:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KGMDQt061268; Fri, 20 Aug 2021 16:22:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KGMDO1061267; Fri, 20 Aug 2021 16:22:13 GMT (envelope-from git) Date: Fri, 20 Aug 2021 16:22:13 GMT Message-Id: <202108201622.17KGMDO1061267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a949c6a0d6c8 - stable/13 - Apply upstream lldb fix for unhandled Error causing abort MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a949c6a0d6c83994471e33c8ea60f1509e691f6c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 16:22:14 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a949c6a0d6c83994471e33c8ea60f1509e691f6c commit a949c6a0d6c83994471e33c8ea60f1509e691f6c Author: Dimitry Andric AuthorDate: 2021-08-16 16:56:41 +0000 Commit: Dimitry Andric CommitDate: 2021-08-20 16:21:46 +0000 Apply upstream lldb fix for unhandled Error causing abort Merge commit 5033f0793fe6 from llvm git (by Dimitry Andric): [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage When assertions are turned off, the `llvm::Error` value created at the start of this function is overwritten using the move-assignment operator, but the success value is never checked. Whenever a TypeSystem cannot be found or created, this can lead to lldb core dumping with: Program aborted due to an unhandled Error: Error value was Success. (Note: Success values must still be checked prior to being destroyed). Fix this by not creating a `llvm::Error` value in advance, and directly returning the result of `llvm::make_error` instead, whenever an error is encountered. See also: and . Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D108088 Reported by: dmgk, ota@j.email.ne.jp PR: 253881, 257829 (cherry picked from commit c1a540709a83f810aa47380b946552ab20020374) --- .../llvm-project/lldb/source/Symbol/TypeSystem.cpp | 90 +++++++++------------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/contrib/llvm-project/lldb/source/Symbol/TypeSystem.cpp b/contrib/llvm-project/lldb/source/Symbol/TypeSystem.cpp index 2adf36fa8276..83161f32444c 100644 --- a/contrib/llvm-project/lldb/source/Symbol/TypeSystem.cpp +++ b/contrib/llvm-project/lldb/source/Symbol/TypeSystem.cpp @@ -224,62 +224,32 @@ void TypeSystemMap::ForEach(std::function const &callback) { llvm::Expected TypeSystemMap::GetTypeSystemForLanguage( lldb::LanguageType language, llvm::Optional create_callback) { - llvm::Error error = llvm::Error::success(); - assert(!error); // Check the success value when assertions are enabled std::lock_guard guard(m_mutex); - if (m_clear_in_progress) { - error = llvm::make_error( + if (m_clear_in_progress) + return llvm::make_error( "Unable to get TypeSystem because TypeSystemMap is being cleared", llvm::inconvertibleErrorCode()); - } else { - collection::iterator pos = m_map.find(language); - if (pos != m_map.end()) { - auto *type_system = pos->second.get(); - if (type_system) { - llvm::consumeError(std::move(error)); - return *type_system; - } - error = llvm::make_error( - "TypeSystem for language " + - llvm::StringRef(Language::GetNameForLanguageType(language)) + - " doesn't exist", - llvm::inconvertibleErrorCode()); - return std::move(error); - } - for (const auto &pair : m_map) { - if (pair.second && pair.second->SupportsLanguage(language)) { - // Add a new mapping for "language" to point to an already existing - // TypeSystem that supports this language - m_map[language] = pair.second; - if (pair.second.get()) { - llvm::consumeError(std::move(error)); - return *pair.second.get(); - } - error = llvm::make_error( - "TypeSystem for language " + - llvm::StringRef(Language::GetNameForLanguageType(language)) + - " doesn't exist", - llvm::inconvertibleErrorCode()); - return std::move(error); - } - } + collection::iterator pos = m_map.find(language); + if (pos != m_map.end()) { + auto *type_system = pos->second.get(); + if (type_system) + return *type_system; + return llvm::make_error( + "TypeSystem for language " + + llvm::StringRef(Language::GetNameForLanguageType(language)) + + " doesn't exist", + llvm::inconvertibleErrorCode()); + } - if (!create_callback) { - error = llvm::make_error( - "Unable to find type system for language " + - llvm::StringRef(Language::GetNameForLanguageType(language)), - llvm::inconvertibleErrorCode()); - } else { - // Cache even if we get a shared pointer that contains a null type system - // back - TypeSystemSP type_system_sp = (*create_callback)(); - m_map[language] = type_system_sp; - if (type_system_sp.get()) { - llvm::consumeError(std::move(error)); - return *type_system_sp.get(); - } - error = llvm::make_error( + for (const auto &pair : m_map) { + if (pair.second && pair.second->SupportsLanguage(language)) { + // Add a new mapping for "language" to point to an already existing + // TypeSystem that supports this language + m_map[language] = pair.second; + if (pair.second.get()) + return *pair.second.get(); + return llvm::make_error( "TypeSystem for language " + llvm::StringRef(Language::GetNameForLanguageType(language)) + " doesn't exist", @@ -287,7 +257,23 @@ llvm::Expected TypeSystemMap::GetTypeSystemForLanguage( } } - return std::move(error); + if (!create_callback) + return llvm::make_error( + "Unable to find type system for language " + + llvm::StringRef(Language::GetNameForLanguageType(language)), + llvm::inconvertibleErrorCode()); + + // Cache even if we get a shared pointer that contains a null type system + // back + TypeSystemSP type_system_sp = (*create_callback)(); + m_map[language] = type_system_sp; + if (type_system_sp.get()) + return *type_system_sp.get(); + return llvm::make_error( + "TypeSystem for language " + + llvm::StringRef(Language::GetNameForLanguageType(language)) + + " doesn't exist", + llvm::inconvertibleErrorCode()); } llvm::Expected From owner-dev-commits-src-all@freebsd.org Fri Aug 20 16:46:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 979B066378A; Fri, 20 Aug 2021 16:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrnZr3Y6Qz4f9T; Fri, 20 Aug 2021 16:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E8321C6B4; Fri, 20 Aug 2021 16:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KGkCCN088231; Fri, 20 Aug 2021 16:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KGkCeW088230; Fri, 20 Aug 2021 16:46:12 GMT (envelope-from git) Date: Fri, 20 Aug 2021 16:46:12 GMT Message-Id: <202108201646.17KGkCeW088230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Sobolev Subject: git: 2651609fcbd7 - main - Allow rc.d script to provide "status" method, even if it does not define procname or have a PID file. This might be useful for cases, such as mounting local FS, when there is no running daemon still some other persistent state in the system which status can be checked. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sobomax X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2651609fcbd70725cb94902145032dbb7c1e89c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 16:46:12 -0000 The branch main has been updated by sobomax: URL: https://cgit.FreeBSD.org/src/commit/?id=2651609fcbd70725cb94902145032dbb7c1e89c4 commit 2651609fcbd70725cb94902145032dbb7c1e89c4 Author: Maxim Sobolev AuthorDate: 2021-08-20 16:43:04 +0000 Commit: Maxim Sobolev CommitDate: 2021-08-20 16:43:46 +0000 Allow rc.d script to provide "status" method, even if it does not define procname or have a PID file. This might be useful for cases, such as mounting local FS, when there is no running daemon still some other persistent state in the system which status can be checked. It is still possible to have a status method before this by having extra_commands="status", but it's not obvious and might give an script writer some extra legwork to figure out how and why the straight method is not working. Reviewed by: cy MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D31614 --- libexec/rc/rc.subr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index b027fa5facf4..7144c3cbfce9 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -958,6 +958,11 @@ run_rc_command() _pidcmd='rc_pid=$(check_process '"$_procname $command_interpreter"')' fi _keywords="${_keywords} status poll" + else + if [ ! -z "${status_cmd}" ] + then + _keywords="${_keywords} status" + fi fi if [ -z "$rc_arg" ]; then From owner-dev-commits-src-all@freebsd.org Fri Aug 20 17:52:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DFAF664736; Fri, 20 Aug 2021 17:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grq3M0Klyz4kGC; Fri, 20 Aug 2021 17:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E65D01D54D; Fri, 20 Aug 2021 17:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KHqUaP084606; Fri, 20 Aug 2021 17:52:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KHqUVc084605; Fri, 20 Aug 2021 17:52:30 GMT (envelope-from git) Date: Fri, 20 Aug 2021 17:52:30 GMT Message-Id: <202108201752.17KHqUVc084605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: dbc689cdef0c - main - vfs: use vn_lock_pair to avoid establishing an ordering on mount MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbc689cdef0cc8ff11171642cdcf107dfbc3fb41 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 17:52:31 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=dbc689cdef0cc8ff11171642cdcf107dfbc3fb41 commit dbc689cdef0cc8ff11171642cdcf107dfbc3fb41 Author: Mateusz Guzik AuthorDate: 2021-08-18 21:14:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-20 17:52:24 +0000 vfs: use vn_lock_pair to avoid establishing an ordering on mount This fixes some of the LORs seen on mount/unmount. Complete fix will require taking care of unmount as well. Reviewed by: kib Tested by: pho (previous version) Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31611 --- sys/kern/vfs_mount.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 3c546392b213..92e70e45d46e 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1191,19 +1191,28 @@ vfs_domount_first( mp->mnt_kern_flag &= ~MNTK_ASYNC; MNT_IUNLOCK(mp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - cache_purge(vp); VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; + cache_purge(vp); vn_irflag_set_locked(vp, VIRF_MOUNTPOINT); vp->v_mountedhere = mp; VI_UNLOCK(vp); + + /* + * We need to lock both vnodes. + * + * Use vn_lock_pair to avoid establishing an ordering between vnodes + * from different filesystems. + */ + vn_lock_pair(vp, false, newdp, false); + + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); /* Place the new filesystem at the end of the mount list. */ mtx_lock(&mountlist_mtx); TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); mtx_unlock(&mountlist_mtx); vfs_event_signal(NULL, VQ_MOUNT, 0); - vn_lock(newdp, LK_EXCLUSIVE | LK_RETRY); VOP_UNLOCK(vp); EVENTHANDLER_DIRECT_INVOKE(vfs_mounted, mp, newdp, td); VOP_UNLOCK(newdp); From owner-dev-commits-src-all@freebsd.org Fri Aug 20 17:52:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CBFB664443; Fri, 20 Aug 2021 17:52:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grq3N1wQgz4k2r; Fri, 20 Aug 2021 17:52:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C78D1D54F; Fri, 20 Aug 2021 17:52:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KHqViJ084630; Fri, 20 Aug 2021 17:52:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KHqVoA084629; Fri, 20 Aug 2021 17:52:31 GMT (envelope-from git) Date: Fri, 20 Aug 2021 17:52:31 GMT Message-Id: <202108201752.17KHqVoA084629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 5d75ffdd0c67 - main - vfs: remove an unused variable from nameicap_tracker_add MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d75ffdd0c6751e220fdadcf216124013139f1ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 17:52:32 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5d75ffdd0c6751e220fdadcf216124013139f1ac commit 5d75ffdd0c6751e220fdadcf216124013139f1ac Author: Mateusz Guzik AuthorDate: 2021-08-20 17:49:00 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-20 17:52:24 +0000 vfs: remove an unused variable from nameicap_tracker_add Reported by cc --analyze Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/vfs_lookup.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index a827c87538b8..a83cc6bb8b74 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -178,11 +178,9 @@ static void nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) { struct nameicap_tracker *nt; - struct componentname *cnp; if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; - cnp = &ndp->ni_cnd; nt = TAILQ_LAST(&ndp->ni_cap_tracker, nameicap_tracker_head); if (nt != NULL && nt->dp == dp) return; From owner-dev-commits-src-all@freebsd.org Fri Aug 20 18:51:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75FD8665003; Fri, 20 Aug 2021 18:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrrMG2yqvz4pK6; Fri, 20 Aug 2021 18:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DC6F1E295; Fri, 20 Aug 2021 18:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KIpMe8063755; Fri, 20 Aug 2021 18:51:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KIpMhf063754; Fri, 20 Aug 2021 18:51:22 GMT (envelope-from git) Date: Fri, 20 Aug 2021 18:51:22 GMT Message-Id: <202108201851.17KIpMhf063754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 9781c28c6d63 - main - mpr(4): Fix unmatched devq release. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9781c28c6d63cfa8438d1aa31f512a6b217a6b2b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 18:51:22 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=9781c28c6d63cfa8438d1aa31f512a6b217a6b2b commit 9781c28c6d63cfa8438d1aa31f512a6b217a6b2b Author: Alexander Motin AuthorDate: 2021-08-20 18:37:55 +0000 Commit: Alexander Motin CommitDate: 2021-08-20 18:51:12 +0000 mpr(4): Fix unmatched devq release. Before this change devq was frozen only if some command was sent to the target after reset started, but release was called always. This change freezes the devq immediately, leaving mprsas_action_scsiio() check only to cover race condition due to different lock devq use. This should also avoid unnecessary requeue of the commands, creating additional log noise and confusing some broken apps. MFC after: 2 weeks Sponsored by: iXsystems, Inc. --- sys/dev/mpr/mpr_sas.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index e1739028dd8f..a8bb7c90b5c4 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -237,7 +237,6 @@ mprsas_alloc_tm(struct mpr_softc *sc) void mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm) { - int target_id = 0xFFFFFFFF; MPR_FUNCTRACE(sc); if (tm == NULL) @@ -248,13 +247,10 @@ mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm) * free the resources used for freezing the devq. Must clear the * INRESET flag as well or scsi I/O will not work. */ - if (tm->cm_targ != NULL) { - tm->cm_targ->flags &= ~MPRSAS_TARGET_INRESET; - target_id = tm->cm_targ->tid; - } if (tm->cm_ccb) { - mpr_dprint(sc, MPR_INFO, "Unfreezing devq for target ID %d\n", - target_id); + mpr_dprint(sc, MPR_XINFO, "Unfreezing devq for target ID %d\n", + tm->cm_targ->tid); + tm->cm_targ->flags &= ~MPRSAS_TARGET_INRESET; xpt_release_devq(tm->cm_ccb->ccb_h.path, 1, TRUE); xpt_free_path(tm->cm_ccb->ccb_h.path); xpt_free_ccb(tm->cm_ccb); @@ -1923,13 +1919,11 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb) } /* - * If target has a reset in progress, freeze the devq and return. The - * devq will be released when the TM reset is finished. + * If target has a reset in progress, the devq should be frozen. + * Geting here we likely hit a race, so just requeue. */ if (targ->flags & MPRSAS_TARGET_INRESET) { - ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN; - mpr_dprint(sc, MPR_INFO, "%s: Freezing devq for target ID %d\n", - __func__, targ->tid); + ccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_DEV_QFRZN; xpt_freeze_devq(ccb->ccb_h.path, 1); xpt_done(ccb); return; @@ -3426,10 +3420,9 @@ mprsas_async(void *callback_arg, uint32_t code, struct cam_path *path, } /* - * Set the INRESET flag for this target so that no I/O will be sent to - * the target until the reset has completed. If an I/O request does - * happen, the devq will be frozen. The CCB holds the path which is - * used to release the devq. The devq is released and the CCB is freed + * Freeze the devq and set the INRESET flag so that no I/O will be sent to + * the target until the reset has completed. The CCB holds the path which + * is used to release the devq. The devq is released and the CCB is freed * when the TM completes. */ void @@ -3446,6 +3439,10 @@ mprsas_prepare_for_tm(struct mpr_softc *sc, struct mpr_command *tm, target->tid, lun_id) != CAM_REQ_CMP) { xpt_free_ccb(ccb); } else { + mpr_dprint(sc, MPR_XINFO, + "%s: Freezing devq for target ID %d\n", + __func__, target->tid); + xpt_freeze_devq(ccb->ccb_h.path, 1); tm->cm_ccb = ccb; tm->cm_targ = target; target->flags |= MPRSAS_TARGET_INRESET; From owner-dev-commits-src-all@freebsd.org Fri Aug 20 20:18:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E8D466634D; Fri, 20 Aug 2021 20:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrtHt2r6Bz3Byw; Fri, 20 Aug 2021 20:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45AB41EF5F; Fri, 20 Aug 2021 20:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KKIYcj075250; Fri, 20 Aug 2021 20:18:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KKIYhJ075249; Fri, 20 Aug 2021 20:18:34 GMT (envelope-from git) Date: Fri, 20 Aug 2021 20:18:34 GMT Message-Id: <202108202018.17KKIYhJ075249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: a8c732f4e52e - main - VFS: add retry limit and delay for failed recursive unmounts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8c732f4e52ec4d64e963035f87d79c270953cbc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 20:18:34 -0000 The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=a8c732f4e52ec4d64e963035f87d79c270953cbc commit a8c732f4e52ec4d64e963035f87d79c270953cbc Author: Jason A. Harmening AuthorDate: 2021-08-08 05:29:46 +0000 Commit: Jason A. Harmening CommitDate: 2021-08-20 20:20:50 +0000 VFS: add retry limit and delay for failed recursive unmounts A forcible unmount attempt may fail due to a transient condition, but it may also fail due to some issue in the filesystem implementation that will indefinitely prevent successful unmount. In such a case, the retry logic in the recursive unmount facility will cause the deferred unmount taskqueue to execute constantly. Avoid this scenario by imposing a retry limit, with a default value of 10, beyond which the recursive unmount facility will emit a log message and give up. Additionally, introduce a grace period, with a default value of 1s, between successive unmount retries on the same mount. Create a new sysctl node, vfs.deferred_unmount, to export the total number of failed recursive unmount attempts since boot, and to allow the retry limit and retry grace period to be tuned. Reviewed by: kib (earlier revision), mkusick Differential Revision: https://reviews.freebsd.org/D31450 --- sys/kern/vfs_mount.c | 77 ++++++++++++++++++++++++++++++++++++++++++---------- sys/sys/mount.h | 1 + 2 files changed, 64 insertions(+), 14 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 92e70e45d46e..0fb5694ebed5 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -95,6 +95,24 @@ SYSCTL_BOOL(_vfs, OID_AUTO, recursive_forced_unmount, CTLFLAG_RW, &recursive_forced_unmount, 0, "Recursively unmount stacked upper mounts" " when a file system is forcibly unmounted"); +static SYSCTL_NODE(_vfs, OID_AUTO, deferred_unmount, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "deferred unmount controls"); + +static unsigned int deferred_unmount_retry_limit = 10; +SYSCTL_UINT(_vfs_deferred_unmount, OID_AUTO, retry_limit, CTLFLAG_RW, + &deferred_unmount_retry_limit, 0, + "Maximum number of retries for deferred unmount failure"); + +static int deferred_unmount_retry_delay_hz; +SYSCTL_INT(_vfs_deferred_unmount, OID_AUTO, retry_delay_hz, CTLFLAG_RW, + &deferred_unmount_retry_delay_hz, 0, + "Delay in units of [1/kern.hz]s when retrying a failed deferred unmount"); + +static int deferred_unmount_total_retries = 0; +SYSCTL_INT(_vfs_deferred_unmount, OID_AUTO, total_retries, CTLFLAG_RD, + &deferred_unmount_total_retries, 0, + "Total number of retried deferred unmounts"); + MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure"); MALLOC_DEFINE(M_STATFS, "statfs", "statfs structure"); static uma_zone_t mount_zone; @@ -110,8 +128,7 @@ EVENTHANDLER_LIST_DEFINE(vfs_mounted); EVENTHANDLER_LIST_DEFINE(vfs_unmounted); static void vfs_deferred_unmount(void *arg, int pending); -static struct task deferred_unmount_task = - TASK_INITIALIZER(0, vfs_deferred_unmount, NULL);; +static struct timeout_task deferred_unmount_task; static struct mtx deferred_unmount_lock; MTX_SYSINIT(deferred_unmount, &deferred_unmount_lock, "deferred_unmount", MTX_DEF); @@ -166,7 +183,9 @@ mount_fini(void *mem, int size) static void vfs_mount_init(void *dummy __unused) { - + TIMEOUT_TASK_INIT(taskqueue_deferred_unmount, &deferred_unmount_task, + 0, vfs_deferred_unmount, NULL); + deferred_unmount_retry_delay_hz = hz; mount_zone = uma_zcreate("Mountpoints", sizeof(struct mount), NULL, NULL, mount_init, mount_fini, UMA_ALIGN_CACHE, UMA_ZONE_NOFREE); } @@ -688,6 +707,7 @@ vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp, const char *fspath, TAILQ_INIT(&mp->mnt_uppers); TAILQ_INIT(&mp->mnt_notify); mp->mnt_taskqueue_flags = 0; + mp->mnt_unmount_retries = 0; return (mp); } @@ -1895,7 +1915,8 @@ vfs_mount_fetch_counter(struct mount *mp, enum mount_counter which) } static bool -deferred_unmount_enqueue(struct mount *mp, uint64_t flags, bool requeue) +deferred_unmount_enqueue(struct mount *mp, uint64_t flags, bool requeue, + int timeout_ticks) { bool enqueued; @@ -1910,8 +1931,8 @@ deferred_unmount_enqueue(struct mount *mp, uint64_t flags, bool requeue) mtx_unlock(&deferred_unmount_lock); if (enqueued) { - taskqueue_enqueue(taskqueue_deferred_unmount, - &deferred_unmount_task); + taskqueue_enqueue_timeout(taskqueue_deferred_unmount, + &deferred_unmount_task, timeout_ticks); } return (enqueued); @@ -1926,6 +1947,8 @@ vfs_deferred_unmount(void *argi __unused, int pending __unused) STAILQ_HEAD(, mount) local_unmounts; uint64_t flags; struct mount *mp, *tmp; + int error; + unsigned int retries; bool unmounted; STAILQ_INIT(&local_unmounts); @@ -1937,14 +1960,30 @@ vfs_deferred_unmount(void *argi __unused, int pending __unused) flags = mp->mnt_taskqueue_flags; KASSERT((flags & MNT_DEFERRED) != 0, ("taskqueue unmount without MNT_DEFERRED")); - if (dounmount(mp, flags, curthread) != 0) { + error = dounmount(mp, flags, curthread); + if (error != 0) { MNT_ILOCK(mp); unmounted = ((mp->mnt_kern_flag & MNTK_REFEXPIRE) != 0); MNT_IUNLOCK(mp); - if (!unmounted) - deferred_unmount_enqueue(mp, flags, true); - else + + /* + * The deferred unmount thread is the only thread that + * modifies the retry counts, so locking/atomics aren't + * needed here. + */ + retries = (mp->mnt_unmount_retries)++; + deferred_unmount_total_retries++; + if (!unmounted && retries < deferred_unmount_retry_limit) { + deferred_unmount_enqueue(mp, flags, true, + -deferred_unmount_retry_delay_hz); + } else { + if (retries >= deferred_unmount_retry_limit) { + printf("giving up on deferred unmount " + "of %s after %d retries, error %d\n", + mp->mnt_stat.f_mntonname, retries, error); + } vfs_rel(mp); + } } } } @@ -1960,6 +1999,7 @@ dounmount(struct mount *mp, uint64_t flags, struct thread *td) int error; uint64_t async_flag; int mnt_gen_r; + unsigned int retries; KASSERT((flags & MNT_DEFERRED) == 0 || (flags & (MNT_RECURSE | MNT_FORCE)) == (MNT_RECURSE | MNT_FORCE), @@ -1976,7 +2016,7 @@ dounmount(struct mount *mp, uint64_t flags, struct thread *td) */ if ((flags & MNT_DEFERRED) != 0 && taskqueue_member(taskqueue_deferred_unmount, curthread) == 0) { - if (!deferred_unmount_enqueue(mp, flags, false)) + if (!deferred_unmount_enqueue(mp, flags, false, 0)) vfs_rel(mp); return (EINPROGRESS); } @@ -2017,9 +2057,16 @@ dounmount(struct mount *mp, uint64_t flags, struct thread *td) mp->mnt_kern_flag |= MNTK_RECURSE; mp->mnt_upper_pending++; TAILQ_FOREACH(upper, &mp->mnt_uppers, mnt_upper_link) { + retries = upper->mp->mnt_unmount_retries; + if (retries > deferred_unmount_retry_limit) { + error = EBUSY; + continue; + } MNT_IUNLOCK(mp); + vfs_ref(upper->mp); - if (!deferred_unmount_enqueue(upper->mp, flags, false)) + if (!deferred_unmount_enqueue(upper->mp, flags, + false, 0)) vfs_rel(upper->mp); MNT_ILOCK(mp); } @@ -2029,6 +2076,7 @@ dounmount(struct mount *mp, uint64_t flags, struct thread *td) mp->mnt_kern_flag &= ~MNTK_UPPER_WAITER; wakeup(&mp->mnt_uppers); } + /* * If we're not on the taskqueue, wait until the uppers list * is drained before proceeding with unmount. Otherwise, if @@ -2043,8 +2091,9 @@ dounmount(struct mount *mp, uint64_t flags, struct thread *td) } } else if (!TAILQ_EMPTY(&mp->mnt_uppers)) { MNT_IUNLOCK(mp); - deferred_unmount_enqueue(mp, flags, true); - return (0); + if (error == 0) + deferred_unmount_enqueue(mp, flags, true, 0); + return (error); } MNT_IUNLOCK(mp); KASSERT(TAILQ_EMPTY(&mp->mnt_uppers), ("mnt_uppers not empty")); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index f4b5945d3ad0..8368595b685b 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -261,6 +261,7 @@ struct mount { TAILQ_HEAD(, mount_upper_node) mnt_notify; /* (i) upper mounts for notification */ STAILQ_ENTRY(mount) mnt_taskqueue_link; /* (d) our place in deferred unmount list */ uint64_t mnt_taskqueue_flags; /* (d) unmount flags passed from taskqueue */ + unsigned int mnt_unmount_retries; /* (d) # of failed deferred unmount attempts */ }; #endif /* _WANT_MOUNT || _KERNEL */ From owner-dev-commits-src-all@freebsd.org Fri Aug 20 20:18:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 870E766634E; Fri, 20 Aug 2021 20:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrtHv3FKcz3C02; Fri, 20 Aug 2021 20:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5699D1F54A; Fri, 20 Aug 2021 20:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KKIZbZ075274; Fri, 20 Aug 2021 20:18:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KKIZPW075273; Fri, 20 Aug 2021 20:18:35 GMT (envelope-from git) Date: Fri, 20 Aug 2021 20:18:35 GMT Message-Id: <202108202018.17KKIZPW075273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: e81e71b0e9cb - main - Use interruptible wait for blocking recursive unmounts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e81e71b0e9cbb5515ffb31bf80088fd7b20e7994 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 20:18:35 -0000 The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=e81e71b0e9cbb5515ffb31bf80088fd7b20e7994 commit e81e71b0e9cbb5515ffb31bf80088fd7b20e7994 Author: Jason A. Harmening AuthorDate: 2021-08-08 05:31:02 +0000 Commit: Jason A. Harmening CommitDate: 2021-08-20 20:21:56 +0000 Use interruptible wait for blocking recursive unmounts Now that we allow recursive unmount attempts to be abandoned upon exceeding the retry limit, we should avoid leaving an unkillable thread when a synchronous unmount request was issued against the base filesystem. Reviewed by: kib (earlier revision), mkusick Differential Revision: https://reviews.freebsd.org/D31450 --- sys/kern/vfs_mount.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 0fb5694ebed5..166d7336eaf1 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -2084,10 +2084,15 @@ dounmount(struct mount *mp, uint64_t flags, struct thread *td) * just re-enqueue on the end of the taskqueue. */ if ((flags & MNT_DEFERRED) == 0) { - while (!TAILQ_EMPTY(&mp->mnt_uppers)) { + while (error == 0 && !TAILQ_EMPTY(&mp->mnt_uppers)) { mp->mnt_kern_flag |= MNTK_TASKQUEUE_WAITER; - msleep(&mp->mnt_taskqueue_link, MNT_MTX(mp), 0, - "umntqw", 0); + error = msleep(&mp->mnt_taskqueue_link, + MNT_MTX(mp), PCATCH, "umntqw", 0); + } + if (error != 0) { + MNT_REL(mp); + MNT_IUNLOCK(mp); + return (error); } } else if (!TAILQ_EMPTY(&mp->mnt_uppers)) { MNT_IUNLOCK(mp); From owner-dev-commits-src-all@freebsd.org Fri Aug 20 21:18:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F3936671E2; Fri, 20 Aug 2021 21:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grvct3t1Gz3Flh; Fri, 20 Aug 2021 21:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CFA02028F; Fri, 20 Aug 2021 21:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KLIMV4055749; Fri, 20 Aug 2021 21:18:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KLIMlx055748; Fri, 20 Aug 2021 21:18:22 GMT (envelope-from git) Date: Fri, 20 Aug 2021 21:18:22 GMT Message-Id: <202108202118.17KLIMlx055748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Sobolev Subject: git: 0d13f5343faf - main - Only trigger read-ahead if two adjacent blocks have been requested. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sobomax X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d13f5343fafbf3067ffc33a507ffca0375c4417 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 21:18:22 -0000 The branch main has been updated by sobomax: URL: https://cgit.FreeBSD.org/src/commit/?id=0d13f5343fafbf3067ffc33a507ffca0375c4417 commit 0d13f5343fafbf3067ffc33a507ffca0375c4417 Author: Maxim Sobolev AuthorDate: 2021-08-20 19:33:51 +0000 Commit: Maxim Sobolev CommitDate: 2021-08-20 21:08:01 +0000 Only trigger read-ahead if two adjacent blocks have been requested. The change makes block caching algorithm to work better for remote media on low-BW/high-delay links. This cuts boot time over IP KVMs noticeably, since the initialization stage reads bunch of small 4th (and now lua) files that are not in the same cache stripe (usually), thus wasting lot of bandwidth and increasing latency even further. The original regression came in 2017 with revision 87ed2b7f5. We've seen increase of time it takes for the loader to get to the kernel loading from under a minute to 10-15 minutes in many cases. Reviewed by: tsoome MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D31623 --- stand/common/bcache.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/stand/common/bcache.c b/stand/common/bcache.c index a020f3c3c53c..526f9fe3fa5c 100644 --- a/stand/common/bcache.c +++ b/stand/common/bcache.c @@ -66,6 +66,7 @@ struct bcache { caddr_t bcache_data; size_t bcache_nblks; size_t ra; + daddr_t bcache_nextblkno; }; static u_int bcache_total_nblks; /* set by bcache_init */ @@ -163,6 +164,7 @@ bcache_allocate(void) } bcache_units++; bc->ra = BCACHE_READAHEAD; /* optimistic read ahead */ + bc->bcache_nextblkno = -1; return (bc); } @@ -291,6 +293,14 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size, else ra = bc->bcache_nblks - BHASH(bc, p_blk + p_size); + /* + * Only trigger read-ahead if we detect two blocks being read + * sequentially. + */ + if ((bc->bcache_nextblkno != blk) && ra != 0) { + ra = 0; + } + if (ra != 0 && ra != bc->bcache_nblks) { /* do we have RA space? */ ra = MIN(bc->ra, ra - 1); ra = rounddown(ra, 16); /* multiple of 16 blocks */ @@ -342,8 +352,11 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size, } done: - if ((result == 0) && (rsize != NULL)) - *rsize = size; + if (result == 0) { + if (rsize != NULL) + *rsize = size; + bc->bcache_nextblkno = blk + (size / DEV_BSIZE); + } return(result); } From owner-dev-commits-src-all@freebsd.org Fri Aug 20 21:26:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C571667987; Fri, 20 Aug 2021 21:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grvng6zVbz3Gdb; Fri, 20 Aug 2021 21:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D803820421; Fri, 20 Aug 2021 21:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KLPxx2068917; Fri, 20 Aug 2021 21:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KLPxNN068915; Fri, 20 Aug 2021 21:25:59 GMT (envelope-from git) Date: Fri, 20 Aug 2021 21:25:59 GMT Message-Id: <202108202125.17KLPxNN068915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 0e5811a2a9a1 - main - intel ethernet: Use ether_gen_addr(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e5811a2a9a1b4a7e0c79b73e3b9b9d15d481577 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 21:26:00 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0e5811a2a9a1b4a7e0c79b73e3b9b9d15d481577 commit 0e5811a2a9a1b4a7e0c79b73e3b9b9d15d481577 Author: Kevin Bowling AuthorDate: 2021-08-20 14:45:30 +0000 Commit: Kevin Bowling CommitDate: 2021-08-20 21:21:48 +0000 intel ethernet: Use ether_gen_addr(9) Use ether_gen_addr(9) for VF MAC generation Reviewed by: Intel Networking (erj), kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31616 --- sys/dev/e1000/if_em.c | 7 ++----- sys/dev/ixgbe/if_ixv.c | 10 ++++------ sys/dev/ixl/if_iavf.c | 10 +++------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 5c958806d824..6e3a8f73190f 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1076,11 +1076,8 @@ em_if_attach_pre(if_ctx_t ctx) if (!em_is_valid_ether_addr(hw->mac.addr)) { if (adapter->vf_ifp) { - u8 addr[ETHER_ADDR_LEN]; - arc4rand(&addr, sizeof(addr), 0); - addr[0] &= 0xFE; - addr[0] |= 0x02; - bcopy(addr, hw->mac.addr, sizeof(addr)); + ether_gen_addr(iflib_get_ifp(ctx), + (struct ether_addr *)hw->mac.addr); } else { device_printf(dev, "Invalid MAC address\n"); error = EIO; diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 9744a3347cec..301d3c0368ae 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -465,12 +465,10 @@ ixv_if_attach_pre(if_ctx_t ctx) /* If no mac address was assigned, make a random one */ if (!ixv_check_ether_addr(hw->mac.addr)) { - u8 addr[ETHER_ADDR_LEN]; - arc4rand(&addr, sizeof(addr), 0); - addr[0] &= 0xFE; - addr[0] |= 0x02; - bcopy(addr, hw->mac.addr, sizeof(addr)); - bcopy(addr, hw->mac.perm_addr, sizeof(addr)); + ether_gen_addr(iflib_get_ifp(ctx), + (struct ether_addr *)hw->mac.addr); + bcopy(hw->mac.addr, hw->mac.perm_addr, + sizeof(hw->mac.perm_addr)); } /* Most of the iflib initialization... */ diff --git a/sys/dev/ixl/if_iavf.c b/sys/dev/ixl/if_iavf.c index f6eb91c2a855..123db2e2461d 100644 --- a/sys/dev/ixl/if_iavf.c +++ b/sys/dev/ixl/if_iavf.c @@ -433,13 +433,9 @@ iavf_if_attach_pre(if_ctx_t ctx) iavf_dbg_init(sc, "Resource Acquisition complete\n"); /* If no mac address was assigned just make a random one */ - if (!iavf_check_ether_addr(hw->mac.addr)) { - u8 addr[ETHER_ADDR_LEN]; - arc4rand(&addr, sizeof(addr), 0); - addr[0] &= 0xFE; - addr[0] |= 0x02; - bcopy(addr, hw->mac.addr, sizeof(addr)); - } + if (!iavf_check_ether_addr(hw->mac.addr)) + ether_gen_addr(iflib_get_ifp(ctx), + (struct ether_addr *)hw->mac.addr); bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); iflib_set_mac(ctx, hw->mac.addr); From owner-dev-commits-src-all@freebsd.org Fri Aug 20 21:32:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB5DA667B5C; Fri, 20 Aug 2021 21:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrvxS4CLPz3Hh1; Fri, 20 Aug 2021 21:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 788D82026A; Fri, 20 Aug 2021 21:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KLWi9N081902; Fri, 20 Aug 2021 21:32:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KLWiGR081901; Fri, 20 Aug 2021 21:32:44 GMT (envelope-from git) Date: Fri, 20 Aug 2021 21:32:44 GMT Message-Id: <202108202132.17KLWiGR081901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 32294ca07393 - stable/13 - man: document ether_gen_addr(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 32294ca07393dee40cb85a872a6dce9532f360ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 21:32:44 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=32294ca07393dee40cb85a872a6dce9532f360ce commit 32294ca07393dee40cb85a872a6dce9532f360ce Author: Kyle Evans AuthorDate: 2021-04-16 01:08:27 +0000 Commit: Kevin Bowling CommitDate: 2021-08-20 21:32:23 +0000 man: document ether_gen_addr(9) This KPI is used to assign a MAC address to an interface that doesn't already have one assigned. Reviewed by: bcr, gnn, imp, kbowling, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29787 (cherry picked from commit e58a65ccdac352712e19a60fffa57a86afabbde9) --- share/man/man9/Makefile | 1 + share/man/man9/ether_gen_addr.9 | 79 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 0c874e77cf0a..43bf82426a73 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -137,6 +137,7 @@ MAN= accept_filter.9 \ DRIVER_MODULE.9 \ efirt.9 \ epoch.9 \ + ether_gen_addr.9 \ EVENTHANDLER.9 \ eventtimers.9 \ extattr.9 \ diff --git a/share/man/man9/ether_gen_addr.9 b/share/man/man9/ether_gen_addr.9 new file mode 100644 index 000000000000..1b98a841736d --- /dev/null +++ b/share/man/man9/ether_gen_addr.9 @@ -0,0 +1,79 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (C) 2021 Kyle Evans +.\" +.\" 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(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), 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 COPYRIGHT HOLDER(S) ``AS IS'' AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) 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 June 1, 2021 +.Dt ETHER_GEN_ADDR 9 +.Os +.Sh NAME +.Nm ether_gen_addr +.Nd "generate an arbitrary MAC address for use" +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.In net/if.h +.In net/if_var.h +.In net/ethernet.h +.Ft void +.Fn ether_gen_addr "struct ifnet *ifp" "struct ether_addr *hwaddr" +.Sh DESCRIPTION +The +.Fn ether_gen_addr +function generates an arbitrary MAC address for use by an ethernet interface +that does not have an assigned address. +.Pp +By default, +.Nm +attempts to generate a stable MAC address using the hostid of the jail that +the +.Ar ifp +is being added to. +During early boot, the hostid may not be set on machines that haven't yet +populated +.Pa /etc/hostid , +or on machines that do not use +.Xr loader 8 . +.Pp +.Nm +can fail to derive a MAC address due to memory allocation failure. +In this case, a locally-administered unicast MAC address will be randomly +generated and returned via the +.Ar hwaddr +parameter. +.Pp +If +.Nm +succeeds, then it will return a MAC address in the FreeBSD Foundation OUI, +.Dq 58:9c:fc , +via the +.Ar hwaddr +parameter. +.Sh AUTHORS +This manual page was written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-dev-commits-src-all@freebsd.org Fri Aug 20 21:32:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8D4A667B8F; Fri, 20 Aug 2021 21:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrvxT545Gz3Hkp; Fri, 20 Aug 2021 21:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 952D02026B; Fri, 20 Aug 2021 21:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KLWjP2081926; Fri, 20 Aug 2021 21:32:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KLWjcE081925; Fri, 20 Aug 2021 21:32:45 GMT (envelope-from git) Date: Fri, 20 Aug 2021 21:32:45 GMT Message-Id: <202108202132.17KLWjcE081925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 8a206a22654f - stable/13 - kern: ether_gen_addr: randomize on default hostuuid, too MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a206a22654f8947927764a9a4024c2119fcc470 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 21:32:45 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8a206a22654f8947927764a9a4024c2119fcc470 commit 8a206a22654f8947927764a9a4024c2119fcc470 Author: Kyle Evans AuthorDate: 2021-04-16 01:11:35 +0000 Commit: Kevin Bowling CommitDate: 2021-08-20 21:32:31 +0000 kern: ether_gen_addr: randomize on default hostuuid, too Currently, this will still hash the default (all zero) hostuuid and potentially arrive at a MAC address that has a high chance of collision if another interface of the same name appears in the same broadcast domain on another host without a hostuuid, e.g., some virtual machine setups. Instead of using the default hostuuid, just treat it as a failure and generate a random LA unicast MAC address. Reviewed by: bz, gbe, imp, kbowling, kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29788 (cherry picked from commit 2d741f33bd07bf94a59635db3c7b9e070a8a6e55) --- share/man/man9/ether_gen_addr.9 | 5 +++-- sys/kern/kern_jail.c | 1 - sys/net/if_ethersubr.c | 17 ++++++++++++++--- sys/sys/jail.h | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/share/man/man9/ether_gen_addr.9 b/share/man/man9/ether_gen_addr.9 index 1b98a841736d..f69cb199e2c3 100644 --- a/share/man/man9/ether_gen_addr.9 +++ b/share/man/man9/ether_gen_addr.9 @@ -61,8 +61,9 @@ or on machines that do not use .Xr loader 8 . .Pp .Nm -can fail to derive a MAC address due to memory allocation failure. -In this case, a locally-administered unicast MAC address will be randomly +can fail to derive a MAC address due to memory allocation failure, or because +the hostid has not been populated. +In these cases, a locally-administered unicast MAC address will be randomly generated and returned via the .Ar hwaddr parameter. diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 303e31490eb1..9784f3bfc23b 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include -#define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" #define PRISON0_HOSTUUID_MODULE "hostuuid" MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 01c2d2f7b3e8..7eb46df8281a 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1443,6 +1443,11 @@ ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr) char jailname[MAXHOSTNAMELEN]; getcredhostuuid(curthread->td_ucred, uuid, sizeof(uuid)); + if (strncmp(uuid, DEFAULT_HOSTUUID, sizeof(uuid)) == 0) { + /* Fall back to a random mac address. */ + goto rando; + } + /* If each (vnet) jail would also have a unique hostuuid this would not * be necessary. */ getjailname(curthread->td_ucred, jailname, sizeof(jailname)); @@ -1450,9 +1455,7 @@ ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr) jailname); if (sz < 0) { /* Fall back to a random mac address. */ - arc4rand(hwaddr, sizeof(*hwaddr), 0); - hwaddr->octet[0] = 0x02; - return; + goto rando; } SHA1Init(&ctx); @@ -1467,6 +1470,14 @@ ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr) hwaddr->octet[i] = addr >> ((ETHER_ADDR_LEN - i - 1) * 8) & 0xFF; } + + return; +rando: + arc4rand(hwaddr, sizeof(*hwaddr), 0); + /* Unicast */ + hwaddr->octet[0] &= 0xFE; + /* Locally administered. */ + hwaddr->octet[0] |= 0x02; } DECLARE_MODULE(ether, ether_mod, SI_SUB_INIT_IF, SI_ORDER_ANY); diff --git a/sys/sys/jail.h b/sys/sys/jail.h index f863a523b917..b0183d404352 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -140,6 +140,7 @@ MALLOC_DECLARE(M_PRISON); #include #define HOSTUUIDLEN 64 +#define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" #define OSRELEASELEN 32 struct racct; From owner-dev-commits-src-all@freebsd.org Fri Aug 20 21:36:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2698A667E9A; Fri, 20 Aug 2021 21:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grw1f0Yzmz3HQL; Fri, 20 Aug 2021 21:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFCFA205B3; Fri, 20 Aug 2021 21:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KLaLsM082351; Fri, 20 Aug 2021 21:36:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KLaLFT082350; Fri, 20 Aug 2021 21:36:21 GMT (envelope-from git) Date: Fri, 20 Aug 2021 21:36:21 GMT Message-Id: <202108202136.17KLaLFT082350@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 778488b9254b - stable/12 - man: document ether_gen_addr(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 778488b9254ba53e1a86e139f25df90fabe0784a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 21:36:22 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=778488b9254ba53e1a86e139f25df90fabe0784a commit 778488b9254ba53e1a86e139f25df90fabe0784a Author: Kyle Evans AuthorDate: 2021-04-16 01:08:27 +0000 Commit: Kevin Bowling CommitDate: 2021-08-20 21:35:34 +0000 man: document ether_gen_addr(9) This KPI is used to assign a MAC address to an interface that doesn't already have one assigned. Reviewed by: bcr, gnn, imp, kbowling, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29787 (cherry picked from commit e58a65ccdac352712e19a60fffa57a86afabbde9) --- share/man/man9/Makefile | 1 + share/man/man9/ether_gen_addr.9 | 79 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 7a4fc64f5f88..ef9c1cc9c674 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -127,6 +127,7 @@ MAN= accept_filter.9 \ DRIVER_MODULE.9 \ efirt.9 \ epoch.9 \ + ether_gen_addr.9 \ EVENTHANDLER.9 \ eventtimers.9 \ extattr.9 \ diff --git a/share/man/man9/ether_gen_addr.9 b/share/man/man9/ether_gen_addr.9 new file mode 100644 index 000000000000..1b98a841736d --- /dev/null +++ b/share/man/man9/ether_gen_addr.9 @@ -0,0 +1,79 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (C) 2021 Kyle Evans +.\" +.\" 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(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), 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 COPYRIGHT HOLDER(S) ``AS IS'' AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) 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 June 1, 2021 +.Dt ETHER_GEN_ADDR 9 +.Os +.Sh NAME +.Nm ether_gen_addr +.Nd "generate an arbitrary MAC address for use" +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.In net/if.h +.In net/if_var.h +.In net/ethernet.h +.Ft void +.Fn ether_gen_addr "struct ifnet *ifp" "struct ether_addr *hwaddr" +.Sh DESCRIPTION +The +.Fn ether_gen_addr +function generates an arbitrary MAC address for use by an ethernet interface +that does not have an assigned address. +.Pp +By default, +.Nm +attempts to generate a stable MAC address using the hostid of the jail that +the +.Ar ifp +is being added to. +During early boot, the hostid may not be set on machines that haven't yet +populated +.Pa /etc/hostid , +or on machines that do not use +.Xr loader 8 . +.Pp +.Nm +can fail to derive a MAC address due to memory allocation failure. +In this case, a locally-administered unicast MAC address will be randomly +generated and returned via the +.Ar hwaddr +parameter. +.Pp +If +.Nm +succeeds, then it will return a MAC address in the FreeBSD Foundation OUI, +.Dq 58:9c:fc , +via the +.Ar hwaddr +parameter. +.Sh AUTHORS +This manual page was written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-dev-commits-src-all@freebsd.org Fri Aug 20 21:36:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FE55667F82; Fri, 20 Aug 2021 21:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Grw1g1fR9z3HWC; Fri, 20 Aug 2021 21:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE9A2026E; Fri, 20 Aug 2021 21:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KLaNvp082375; Fri, 20 Aug 2021 21:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KLaN6l082374; Fri, 20 Aug 2021 21:36:23 GMT (envelope-from git) Date: Fri, 20 Aug 2021 21:36:23 GMT Message-Id: <202108202136.17KLaN6l082374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0a7dbddfb0ca - stable/12 - kern: ether_gen_addr: randomize on default hostuuid, too MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0a7dbddfb0ca789acca9858c980e58ab8f1bc6de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 21:36:23 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0a7dbddfb0ca789acca9858c980e58ab8f1bc6de commit 0a7dbddfb0ca789acca9858c980e58ab8f1bc6de Author: Kyle Evans AuthorDate: 2021-04-16 01:11:35 +0000 Commit: Kevin Bowling CommitDate: 2021-08-20 21:35:49 +0000 kern: ether_gen_addr: randomize on default hostuuid, too Currently, this will still hash the default (all zero) hostuuid and potentially arrive at a MAC address that has a high chance of collision if another interface of the same name appears in the same broadcast domain on another host without a hostuuid, e.g., some virtual machine setups. Instead of using the default hostuuid, just treat it as a failure and generate a random LA unicast MAC address. Reviewed by: bz, gbe, imp, kbowling, kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29788 (cherry picked from commit 2d741f33bd07bf94a59635db3c7b9e070a8a6e55) --- share/man/man9/ether_gen_addr.9 | 5 +++-- sys/kern/kern_jail.c | 1 - sys/net/if_ethersubr.c | 17 ++++++++++++++--- sys/sys/jail.h | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/share/man/man9/ether_gen_addr.9 b/share/man/man9/ether_gen_addr.9 index 1b98a841736d..f69cb199e2c3 100644 --- a/share/man/man9/ether_gen_addr.9 +++ b/share/man/man9/ether_gen_addr.9 @@ -61,8 +61,9 @@ or on machines that do not use .Xr loader 8 . .Pp .Nm -can fail to derive a MAC address due to memory allocation failure. -In this case, a locally-administered unicast MAC address will be randomly +can fail to derive a MAC address due to memory allocation failure, or because +the hostid has not been populated. +In these cases, a locally-administered unicast MAC address will be randomly generated and returned via the .Ar hwaddr parameter. diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 46b43fa7bbc2..e95a0c60bd1e 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include -#define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" #define PRISON0_HOSTUUID_MODULE "hostuuid" MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 5e255f862221..ddc92535be60 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1396,6 +1396,11 @@ ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr) char jailname[MAXHOSTNAMELEN]; getcredhostuuid(curthread->td_ucred, uuid, sizeof(uuid)); + if (strncmp(uuid, DEFAULT_HOSTUUID, sizeof(uuid)) == 0) { + /* Fall back to a random mac address. */ + goto rando; + } + /* If each (vnet) jail would also have a unique hostuuid this would not * be necessary. */ getjailname(curthread->td_ucred, jailname, sizeof(jailname)); @@ -1403,9 +1408,7 @@ ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr) jailname); if (sz < 0) { /* Fall back to a random mac address. */ - arc4rand(hwaddr, sizeof(*hwaddr), 0); - hwaddr->octet[0] = 0x02; - return; + goto rando; } SHA1Init(&ctx); @@ -1420,6 +1423,14 @@ ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr) hwaddr->octet[i] = addr >> ((ETHER_ADDR_LEN - i - 1) * 8) & 0xFF; } + + return; +rando: + arc4rand(hwaddr, sizeof(*hwaddr), 0); + /* Unicast */ + hwaddr->octet[0] &= 0xFE; + /* Locally administered. */ + hwaddr->octet[0] |= 0x02; } DECLARE_MODULE(ether, ether_mod, SI_SUB_INIT_IF, SI_ORDER_ANY); diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 590fb4488262..66ffa60e67ef 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -138,6 +138,7 @@ MALLOC_DECLARE(M_PRISON); #include #define HOSTUUIDLEN 64 +#define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" #define OSRELEASELEN 32 struct racct; From owner-dev-commits-src-all@freebsd.org Fri Aug 20 21:45:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5921E66819D; Fri, 20 Aug 2021 21:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrwDZ1kk1z3J1L; Fri, 20 Aug 2021 21:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2392420957; Fri, 20 Aug 2021 21:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17KLjoYF096045; Fri, 20 Aug 2021 21:45:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17KLjoai096044; Fri, 20 Aug 2021 21:45:50 GMT (envelope-from git) Date: Fri, 20 Aug 2021 21:45:50 GMT Message-Id: <202108202145.17KLjoai096044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: c4622b01d2f1 - main - ixl(4): Fix reporting of unqualified transceivers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4622b01d2f12b889b57ff7d0b03a38dfcb00fd8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2021 21:45:50 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=c4622b01d2f12b889b57ff7d0b03a38dfcb00fd8 commit c4622b01d2f12b889b57ff7d0b03a38dfcb00fd8 Author: Krzysztof Galazka AuthorDate: 2021-08-20 21:12:28 +0000 Commit: Eric Joyner CommitDate: 2021-08-20 21:44:32 +0000 ixl(4): Fix reporting of unqualified transceivers When link_active_on_if_down flag is disabled and link is brought down with ifconfig, FW reports a false positive link event about an unqualified transceiver. The condition used in the driver to filter out those false positive events was incorrect and caused that unqualified module event to also not be reported when the event was valid. Change the condition to rely on IFF_UP flag instead of link_active_on_if_down and bump driver version to 2.3.1-k. Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Reviewed by: stallamr@netapp.com, erj@ Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D30733 --- sys/dev/ixl/if_ixl.c | 2 +- sys/dev/ixl/ixl_pf_iflib.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 3b49da5d76b9..f620771e93b1 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -49,7 +49,7 @@ *********************************************************************/ #define IXL_DRIVER_VERSION_MAJOR 2 #define IXL_DRIVER_VERSION_MINOR 3 -#define IXL_DRIVER_VERSION_BUILD 0 +#define IXL_DRIVER_VERSION_BUILD 1 #define IXL_DRIVER_VERSION_STRING \ __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 68a174889c41..6ea20389c547 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -403,20 +403,23 @@ ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) { struct i40e_hw *hw = &pf->hw; device_t dev = iflib_get_dev(pf->vsi.ctx); - struct i40e_aqc_get_link_status *status = - (struct i40e_aqc_get_link_status *)&e->desc.params.raw; - - /* Request link status from adapter */ + struct i40e_link_status *link_info = &hw->phy.link_info; + + /* Driver needs to re-enable delivering of link status events + * by FW after each event reception. Call i40e_get_link_status + * to do that. To not lose information about link state changes, + * which happened between receiving an event and the call, + * do not rely on status from event but use most recent + * status information retrieved by the call. */ hw->phy.get_link_info = TRUE; i40e_get_link_status(hw, &pf->link_up); /* Print out message if an unqualified module is found */ - if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && + if ((link_info->link_info & I40E_AQ_MEDIA_AVAILABLE) && (pf->advertised_speed) && - (atomic_load_32(&pf->state) & - IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0 && - (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && - (!(status->link_info & I40E_AQ_LINK_UP))) + (if_getflags(pf->vsi.ifp) & IFF_UP) && + (!(link_info->an_info & I40E_AQ_QUALIFIED_MODULE)) && + (!(link_info->link_info & I40E_AQ_LINK_UP))) device_printf(dev, "Link failed because " "an unqualified module was detected!\n"); From owner-dev-commits-src-all@freebsd.org Sat Aug 21 09:04:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E12E566F15A; Sat, 21 Aug 2021 09:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsCHf5jZ6z3LSf; Sat, 21 Aug 2021 09:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABF642523; Sat, 21 Aug 2021 09:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17L94UxM001154; Sat, 21 Aug 2021 09:04:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17L94UIB001153; Sat, 21 Aug 2021 09:04:30 GMT (envelope-from git) Date: Sat, 21 Aug 2021 09:04:30 GMT Message-Id: <202108210904.17L94UIB001153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: ce71a0fa99cc - main - truncate(1): Update tests' golden output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce71a0fa99ccfbd4720b4f3d7254f53c2ac97fc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 09:04:30 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=ce71a0fa99ccfbd4720b4f3d7254f53c2ac97fc1 commit ce71a0fa99ccfbd4720b4f3d7254f53c2ac97fc1 Author: Ka Ho Ng AuthorDate: 2021-08-21 09:03:14 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-21 09:04:21 +0000 truncate(1): Update tests' golden output After commit 5ee2c35751ef truncate(1)'s usage output was extended. Update the golden output in test cases to match the changes made. Sponsored by: The FreeBSD Foundation Reviewed by: lwhsu Differential Revision: https://reviews.freebsd.org/D31628 --- usr.bin/truncate/tests/truncate_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/truncate/tests/truncate_test.sh b/usr.bin/truncate/tests/truncate_test.sh index 267df3131b3e..dcf0dbfe4892 100644 --- a/usr.bin/truncate/tests/truncate_test.sh +++ b/usr.bin/truncate/tests/truncate_test.sh @@ -59,6 +59,7 @@ create_stderr_usage_file() _custom_create_file print \ "usage: truncate [-c] -s [+|-|%|/]size[K|k|M|m|G|g|T|t] file ..." _custom_create_file print " truncate [-c] -r rfile file ..." + _custom_create_file print " truncate [-c] -d [-o offset[K|k|M|m|G|g|T|t]] -l length[K|k|M|m|G|g|T|t] file ..." } atf_test_case illegal_option From owner-dev-commits-src-all@freebsd.org Sat Aug 21 13:58:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E98D5672668; Sat, 21 Aug 2021 13:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsKpV6Hhzz3rfM; Sat, 21 Aug 2021 13:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C00D86609; Sat, 21 Aug 2021 13:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LDwAkJ086259; Sat, 21 Aug 2021 13:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LDwA00086258; Sat, 21 Aug 2021 13:58:10 GMT (envelope-from git) Date: Sat, 21 Aug 2021 13:58:10 GMT Message-Id: <202108211358.17LDwA00086258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 84d5b6bd68ce - main - cam(4): Fix quick unplug/replug for SCSI. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84d5b6bd68ce6496592adb8fdcd8cf0c246ed935 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 13:58:11 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=84d5b6bd68ce6496592adb8fdcd8cf0c246ed935 commit 84d5b6bd68ce6496592adb8fdcd8cf0c246ed935 Author: Alexander Motin AuthorDate: 2021-08-21 13:31:41 +0000 Commit: Alexander Motin CommitDate: 2021-08-21 13:58:05 +0000 cam(4): Fix quick unplug/replug for SCSI. If some device is plugged back in after unplug before the probe periph destroyed, it will just restart the probe process. But I've found that PROBE_INQUIRY_CKSUM flag not cleared between the iterations may cause AC_FOUND_DEVICE not reported on the second iteration, and because of AC_LOST_DEVICE reported during the first iteration, the device end up configured, but without any periphs attached. We've found that enabled serial console and 102-disk JBOD cause enough probe delays to easily trigger the issue for half of the disks. This change fixes it reliably on my tests. MFC after: 2 weeks Sponsored by: iXsystems, Inc. --- sys/cam/scsi/scsi_xpt.c | 61 ++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 46cc4c1699f1..c4c43ee87101 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -178,7 +178,6 @@ do { \ typedef enum { PROBE_INQUIRY_CKSUM = 0x01, - PROBE_SERIAL_CKSUM = 0x02, PROBE_NO_ANNOUNCE = 0x04, PROBE_EXTLUN = 0x08 } probe_flags; @@ -775,8 +774,6 @@ again: } case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: - case PROBE_INQUIRY_BASIC_DV1: - case PROBE_INQUIRY_BASIC_DV2: { u_int inquiry_len; struct scsi_inquiry_data *inq_buf; @@ -791,19 +788,19 @@ again: * serial number check finish, we attempt to figure out * whether we still have the same device. */ - if (((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) - && ((softc->flags & PROBE_INQUIRY_CKSUM) == 0)) { + if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { + softc->flags &= ~PROBE_INQUIRY_CKSUM; + } else if ((softc->flags & PROBE_INQUIRY_CKSUM) == 0) { MD5Init(&softc->context); MD5Update(&softc->context, (unsigned char *)inq_buf, sizeof(struct scsi_inquiry_data)); - softc->flags |= PROBE_INQUIRY_CKSUM; if (periph->path->device->serial_num_len > 0) { MD5Update(&softc->context, periph->path->device->serial_num, periph->path->device->serial_num_len); - softc->flags |= PROBE_SERIAL_CKSUM; } MD5Final(softc->digest, &softc->context); + softc->flags |= PROBE_INQUIRY_CKSUM; } if (softc->action == PROBE_INQUIRY) @@ -819,22 +816,6 @@ again: */ inquiry_len = roundup2(inquiry_len, 2); - if (softc->action == PROBE_INQUIRY_BASIC_DV1 - || softc->action == PROBE_INQUIRY_BASIC_DV2) { - inq_buf = malloc(inquiry_len, M_CAMXPT, M_NOWAIT); - } - if (inq_buf == NULL) { - xpt_print(periph->path, "malloc failure- skipping Basic" - "Domain Validation\n"); - PROBE_SET_ACTION(softc, PROBE_DV_EXIT); - scsi_test_unit_ready(csio, - /*retries*/4, - probedone, - MSG_SIMPLE_Q_TAG, - SSD_FULL_SIZE, - /*timeout*/60000); - break; - } scsi_inquiry(csio, /*retries*/4, probedone, @@ -1019,6 +1000,40 @@ done: } goto done; } + case PROBE_INQUIRY_BASIC_DV1: + case PROBE_INQUIRY_BASIC_DV2: + { + u_int inquiry_len; + struct scsi_inquiry_data *inq_buf; + + inq_buf = &periph->path->device->inq_data; + inquiry_len = roundup2(SID_ADDITIONAL_LENGTH(inq_buf), 2); + inq_buf = malloc(inquiry_len, M_CAMXPT, M_NOWAIT); + if (inq_buf == NULL) { + xpt_print(periph->path, "malloc failure- skipping Basic" + "Domain Validation\n"); + PROBE_SET_ACTION(softc, PROBE_DV_EXIT); + scsi_test_unit_ready(csio, + /*retries*/4, + probedone, + MSG_SIMPLE_Q_TAG, + SSD_FULL_SIZE, + /*timeout*/60000); + break; + } + + scsi_inquiry(csio, + /*retries*/4, + probedone, + MSG_SIMPLE_Q_TAG, + (u_int8_t *)inq_buf, + inquiry_len, + /*evpd*/FALSE, + /*page_code*/0, + SSD_MIN_SIZE, + /*timeout*/60 * 1000); + break; + } default: panic("probestart: invalid action state 0x%x\n", softc->action); } From owner-dev-commits-src-all@freebsd.org Sat Aug 21 15:14:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4144D673AEA; Sat, 21 Aug 2021 15:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsMVp4cBJz4hTN; Sat, 21 Aug 2021 15:14:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E0027338; Sat, 21 Aug 2021 15:14:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LFEgrC094002; Sat, 21 Aug 2021 15:14:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LFEgJL094001; Sat, 21 Aug 2021 15:14:42 GMT (envelope-from git) Date: Sat, 21 Aug 2021 15:14:42 GMT Message-Id: <202108211514.17LFEgJL094001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: b65d87e5d7b5 - stable/12 - Apply upstream clang fix for assertion failure compiling devel/capnproto MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b65d87e5d7b58fd06cf4a3061b564d62f1033999 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 15:14:43 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b65d87e5d7b58fd06cf4a3061b564d62f1033999 commit b65d87e5d7b58fd06cf4a3061b564d62f1033999 Author: Dimitry Andric AuthorDate: 2021-08-21 14:26:51 +0000 Commit: Dimitry Andric CommitDate: 2021-08-21 15:13:37 +0000 Apply upstream clang fix for assertion failure compiling devel/capnproto Merge commit 48c70c1664aa from llvm git (by Richard Smith): Extend memset-to-zero optimization to C++11 aggregate functional casts Aggr{...}. We previously missed these cases due to not stepping over the additional AST nodes representing their syntactic form. Direct commit to stable/12, as both main and stable/13 already have this fix as part of clang 12.0.1. Reported by: fernape PR: 257961 --- contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp index 53dbfecfc538..658f0778796b 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp @@ -1732,7 +1732,9 @@ void AggExprEmitter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) /// non-zero bytes that will be stored when outputting the initializer for the /// specified initializer expression. static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) { - E = E->IgnoreParens(); + if (auto *MTE = dyn_cast(E)) + E = MTE->getSubExpr(); + E = E->IgnoreParenNoopCasts(CGF.getContext()); // 0 and 0.0 won't require any non-zero stores! if (isSimpleZero(E, CGF)) return CharUnits::Zero(); @@ -1781,7 +1783,7 @@ static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) { } } - + // FIXME: This overestimates the number of non-zero bytes for bit-fields. CharUnits NumNonZeroBytes = CharUnits::Zero(); for (unsigned i = 0, e = ILE->getNumInits(); i != e; ++i) NumNonZeroBytes += GetNumNonZeroBytesInInit(ILE->getInit(i), CGF); From owner-dev-commits-src-all@freebsd.org Sat Aug 21 15:15:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1249D67412B; Sat, 21 Aug 2021 15:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsMWH02wHz4hqY; Sat, 21 Aug 2021 15:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDC3B7049; Sat, 21 Aug 2021 15:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LFF6QC094174; Sat, 21 Aug 2021 15:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LFF65Z094173; Sat, 21 Aug 2021 15:15:06 GMT (envelope-from git) Date: Sat, 21 Aug 2021 15:15:06 GMT Message-Id: <202108211515.17LFF65Z094173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: d5c7f929b50d - stable/11 - Apply upstream clang fix for assertion failure compiling devel/capnproto MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: d5c7f929b50dbd5965c500ab42c93d0a2736ef99 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 15:15:07 -0000 The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d5c7f929b50dbd5965c500ab42c93d0a2736ef99 commit d5c7f929b50dbd5965c500ab42c93d0a2736ef99 Author: Dimitry Andric AuthorDate: 2021-08-21 15:13:10 +0000 Commit: Dimitry Andric CommitDate: 2021-08-21 15:14:00 +0000 Apply upstream clang fix for assertion failure compiling devel/capnproto Merge commit 48c70c1664aa from llvm git (by Richard Smith): Extend memset-to-zero optimization to C++11 aggregate functional casts Aggr{...}. We previously missed these cases due to not stepping over the additional AST nodes representing their syntactic form. Direct commit to stable/11, as both main and stable/13 already have this fix as part of clang 12.0.1. Reported by: fernape PR: 257961 --- contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp index 53dbfecfc538..658f0778796b 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp @@ -1732,7 +1732,9 @@ void AggExprEmitter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) /// non-zero bytes that will be stored when outputting the initializer for the /// specified initializer expression. static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) { - E = E->IgnoreParens(); + if (auto *MTE = dyn_cast(E)) + E = MTE->getSubExpr(); + E = E->IgnoreParenNoopCasts(CGF.getContext()); // 0 and 0.0 won't require any non-zero stores! if (isSimpleZero(E, CGF)) return CharUnits::Zero(); @@ -1781,7 +1783,7 @@ static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) { } } - + // FIXME: This overestimates the number of non-zero bytes for bit-fields. CharUnits NumNonZeroBytes = CharUnits::Zero(); for (unsigned i = 0, e = ILE->getNumInits(); i != e; ++i) NumNonZeroBytes += GetNumNonZeroBytesInInit(ILE->getInit(i), CGF); From owner-dev-commits-src-all@freebsd.org Sat Aug 21 15:22:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D6E06743EA; Sat, 21 Aug 2021 15:22:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsMgb0D27z4khg; Sat, 21 Aug 2021 15:22:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3CC371EA; Sat, 21 Aug 2021 15:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LFMI94004893; Sat, 21 Aug 2021 15:22:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LFMIPr004892; Sat, 21 Aug 2021 15:22:18 GMT (envelope-from git) Date: Sat, 21 Aug 2021 15:22:18 GMT Message-Id: <202108211522.17LFMIPr004892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: f3dcedd3de27 - main - targ(4): Remove D_NEEDGIANT. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3dcedd3de27b1a8f493c8256103e8a7fb93f5a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 15:22:19 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=f3dcedd3de27b1a8f493c8256103e8a7fb93f5a4 commit f3dcedd3de27b1a8f493c8256103e8a7fb93f5a4 Author: Alexander Motin AuthorDate: 2021-08-21 15:20:54 +0000 Commit: Alexander Motin CommitDate: 2021-08-21 15:20:54 +0000 targ(4): Remove D_NEEDGIANT. I don't believe this code needs Giant, if ever needed. MFC after: 1 month --- sys/cam/scsi/scsi_target.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index b3d0461c1d24..b743fa2fe9ca 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -115,7 +115,6 @@ static struct filterops targread_filtops = { static struct cdevsw targ_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = targopen, .d_read = targread, .d_write = targwrite, From owner-dev-commits-src-all@freebsd.org Sat Aug 21 16:18:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80A11674DCF; Sat, 21 Aug 2021 16:18:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsNw03DfLz3HBV; Sat, 21 Aug 2021 16:18:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56D051038E; Sat, 21 Aug 2021 16:18:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LGI8Yx075748; Sat, 21 Aug 2021 16:18:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LGI8w1075747; Sat, 21 Aug 2021 16:18:08 GMT (envelope-from git) Date: Sat, 21 Aug 2021 16:18:08 GMT Message-Id: <202108211618.17LGI8w1075747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: e5a50b03297f - main - loader: FB console does leave garbage on screen while scrolling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5a50b03297fa09652b3cf319bc6e863392554e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 16:18:08 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=e5a50b03297fa09652b3cf319bc6e863392554e0 commit e5a50b03297fa09652b3cf319bc6e863392554e0 Author: Toomas Soome AuthorDate: 2021-08-21 11:25:36 +0000 Commit: Toomas Soome CommitDate: 2021-08-21 16:17:25 +0000 loader: FB console does leave garbage on screen while scrolling Scrolling screen will leave "trail" of chars from first column. Apparently caused by cursor location mismanagement. Make sure we do not [attempt to] set cursor out of the screen. MFC after: 1 week --- stand/common/gfx_fb.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 522c70327425..45d0072bd858 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -976,20 +976,26 @@ gfx_fb_fill(void *arg, const teken_rect_t *r, teken_char_t c, } static void -gfx_fb_cursor_draw(teken_gfx_t *state, const teken_pos_t *p, bool on) +gfx_fb_cursor_draw(teken_gfx_t *state, const teken_pos_t *pos, bool on) { unsigned x, y, width, height; const uint8_t *glyph; + teken_pos_t p; int idx; - idx = p->tp_col + p->tp_row * state->tg_tp.tp_col; + p = *pos; + if (p.tp_col >= state->tg_tp.tp_col) + p.tp_col = state->tg_tp.tp_col - 1; + if (p.tp_row >= state->tg_tp.tp_row) + p.tp_row = state->tg_tp.tp_row - 1; + idx = p.tp_col + p.tp_row * state->tg_tp.tp_col; if (idx >= state->tg_tp.tp_col * state->tg_tp.tp_row) return; width = state->tg_font.vf_width; height = state->tg_font.vf_height; - x = state->tg_origin.tp_col + p->tp_col * width; - y = state->tg_origin.tp_row + p->tp_row * height; + x = state->tg_origin.tp_col + p.tp_col * width; + y = state->tg_origin.tp_row + p.tp_row * height; /* * Save original display content to preserve image data. @@ -1017,7 +1023,7 @@ gfx_fb_cursor_draw(teken_gfx_t *state, const teken_pos_t *p, bool on) if (state->tg_cursor_image != NULL && gfxfb_blt(state->tg_cursor_image, GfxFbBltBufferToVideo, 0, 0, x, y, width, height, 0) == 0) { - state->tg_cursor = *p; + state->tg_cursor = p; return; } } @@ -1025,9 +1031,9 @@ gfx_fb_cursor_draw(teken_gfx_t *state, const teken_pos_t *p, bool on) glyph = font_lookup(&state->tg_font, screen_buffer[idx].c, &screen_buffer[idx].a); gfx_bitblt_bitmap(state, glyph, &screen_buffer[idx].a, 0xff, on); - gfx_fb_printchar(state, p); + gfx_fb_printchar(state, &p); - state->tg_cursor = *p; + state->tg_cursor = p; } void From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:35:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 688206759F4; Sat, 21 Aug 2021 17:35:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsQch2Snsz3v4j; Sat, 21 Aug 2021 17:35:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CBD811666; Sat, 21 Aug 2021 17:35:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHZ0g5081503; Sat, 21 Aug 2021 17:35:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHZ0WI081502; Sat, 21 Aug 2021 17:35:00 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:35:00 GMT Message-Id: <202108211735.17LHZ0WI081502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: c541bd368f86 - main - lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c541bd368f863bbf5c08dd5c1ecce0166ad47389 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:35:00 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c541bd368f863bbf5c08dd5c1ecce0166ad47389 commit c541bd368f863bbf5c08dd5c1ecce0166ad47389 Author: Alexander V. Chernikov AuthorDate: 2021-08-21 14:13:32 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-21 17:34:35 +0000 lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries. Currently we use pre-calculated headers inside LLE entries as prepend data for `if_output` functions. Using these headers allows saving some CPU cycles/memory accesses on the fast path. However, this approach makes adding L2 header for IPv4 traffic with IPv6 nexthops more complex, as it is not possible to store multiple pre-calculated headers inside lle. Additionally, the solution space is limited by the fact that PCB caching saves LLEs in addition to the nexthop. Thus, add support for creating special "child" LLEs for the purpose of holding custom family encaps and store mbufs pending resolution. To simplify handling of those LLEs, store them in a linked-list inside a "parent" (e.g. normal) LLE. Such LLEs are not visible when iterating LLE table. Their lifecycle is bound to the "parent" LLE - it is not possible to delete "child" when parent is alive. Furthermore, "child" LLEs are static (RTF_STATIC), avoding complex state machine used by the standard LLEs. nd6_lookup() and nd6_resolve() now accepts an additional argument, family, allowing to return such child LLEs. This change uses `LLE_SF()` macro which packs family and flags in a single int field. This is done to simplify merging back to stable/. Once this code lands, most of the cases will be converted to use a dedicated `family` parameter. Differential Revision: https://reviews.freebsd.org/D31379 MFC after: 2 weeks --- sys/net/if_ethersubr.c | 4 +- sys/net/if_fwsubr.c | 4 +- sys/net/if_infiniband.c | 3 +- sys/net/if_llatbl.c | 70 +++++++++++- sys/net/if_llatbl.h | 12 +- sys/netinet/toecore.c | 2 +- sys/netinet6/icmp6.c | 2 +- sys/netinet6/in6.c | 5 + sys/netinet6/nd6.c | 176 +++++++++++++++++++++++------ sys/netinet6/nd6.h | 1 + sys/netinet6/nd6_nbr.c | 6 +- sys/ofed/drivers/infiniband/core/ib_addr.c | 5 +- 12 files changed, 241 insertions(+), 49 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index bdb5b07635b7..6d8b79d4dd12 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -237,8 +237,8 @@ ether_resolve_addr(struct ifnet *ifp, struct mbuf *m, #ifdef INET6 case AF_INET6: if ((m->m_flags & M_MCAST) == 0) - error = nd6_resolve(ifp, 0, m, dst, phdr, &lleflags, - plle); + error = nd6_resolve(ifp, LLE_SF(AF_INET6, 0), m, dst, phdr, + &lleflags, plle); else { const struct in6_addr *a6; a6 = &(((const struct sockaddr_in6 *)dst)->sin6_addr); diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c index 29ca2f713e8e..a6c43d4d05a4 100644 --- a/sys/net/if_fwsubr.c +++ b/sys/net/if_fwsubr.c @@ -176,8 +176,8 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, #ifdef INET6 case AF_INET6: if (unicast) { - error = nd6_resolve(fc->fc_ifp, is_gw, m, dst, - (u_char *) destfw, NULL, NULL); + error = nd6_resolve(fc->fc_ifp, LLE_SF(AF_INET6, is_gw), + m, dst, (u_char *) destfw, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); } diff --git a/sys/net/if_infiniband.c b/sys/net/if_infiniband.c index 528f20b7c98d..244b2a5ba117 100644 --- a/sys/net/if_infiniband.c +++ b/sys/net/if_infiniband.c @@ -253,7 +253,8 @@ infiniband_resolve_addr(struct ifnet *ifp, struct mbuf *m, #ifdef INET6 case AF_INET6: if ((m->m_flags & M_MCAST) == 0) { - error = nd6_resolve(ifp, 0, m, dst, phdr, &lleflags, plle); + error = nd6_resolve(ifp, LLE_SF(AF_INET6, 0), m, dst, + phdr, &lleflags, plle); } else { infiniband_ipv6_multicast_map( &((const struct sockaddr_in6 *)dst)->sin6_addr, diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c index c656974c80ee..e4dfc45705a8 100644 --- a/sys/net/if_llatbl.c +++ b/sys/net/if_llatbl.c @@ -398,6 +398,26 @@ lltable_calc_llheader(struct ifnet *ifp, int family, char *lladdr, return (error); } +/* + * Searches for the child entry matching @family inside @lle. + * Returns the entry or NULL. + */ +struct llentry * +llentry_lookup_family(struct llentry *lle, int family) +{ + struct llentry *child_lle; + + if (lle == NULL) + return (NULL); + + CK_SLIST_FOREACH(child_lle, &lle->lle_children, lle_child_next) { + if (child_lle->r_family == family) + return (child_lle); + } + + return (NULL); +} + /* * Requests feedback from the datapath. * First packet using @lle should result in @@ -407,9 +427,17 @@ lltable_calc_llheader(struct ifnet *ifp, int family, char *lladdr, void llentry_request_feedback(struct llentry *lle) { + struct llentry *child_lle; + LLE_REQ_LOCK(lle); lle->r_skip_req = 1; LLE_REQ_UNLOCK(lle); + + CK_SLIST_FOREACH(child_lle, &lle->lle_children, lle_child_next) { + LLE_REQ_LOCK(child_lle); + child_lle->r_skip_req = 1; + LLE_REQ_UNLOCK(child_lle); + } } /* @@ -431,8 +459,8 @@ llentry_mark_used(struct llentry *lle) * Return 0 if the entry was not used, relevant time_uptime * otherwise. */ -time_t -llentry_get_hittime(struct llentry *lle) +static time_t +llentry_get_hittime_raw(struct llentry *lle) { time_t lle_hittime = 0; @@ -444,6 +472,23 @@ llentry_get_hittime(struct llentry *lle) return (lle_hittime); } +time_t +llentry_get_hittime(struct llentry *lle) +{ + time_t lle_hittime = 0; + struct llentry *child_lle; + + lle_hittime = llentry_get_hittime_raw(lle); + + CK_SLIST_FOREACH(child_lle, &lle->lle_children, lle_child_next) { + time_t hittime = llentry_get_hittime_raw(child_lle); + if (hittime > lle_hittime) + lle_hittime = hittime; + } + + return (lle_hittime); +} + /* * Update link-layer header for given @lle after * interface lladdr was changed. @@ -585,7 +630,7 @@ lltable_delete_addr(struct lltable *llt, u_int flags, ifp = llt->llt_ifp; IF_AFDATA_WLOCK(ifp); - lle = lla_lookup(llt, LLE_EXCLUSIVE, l3addr); + lle = lla_lookup(llt, LLE_SF(l3addr->sa_family, LLE_EXCLUSIVE), l3addr); if (lle == NULL) { IF_AFDATA_WUNLOCK(ifp); @@ -700,6 +745,25 @@ lltable_link_entry(struct lltable *llt, struct llentry *lle) return (llt->llt_link_entry(llt, lle)); } +void +lltable_link_child_entry(struct llentry *lle, struct llentry *child_lle) +{ + child_lle->lle_parent = lle; + child_lle->lle_tbl = lle->lle_tbl; + child_lle->la_flags |= LLE_LINKED; + CK_SLIST_INSERT_HEAD(&lle->lle_children, child_lle, lle_child_next); +} + +void +lltable_unlink_child_entry(struct llentry *child_lle) +{ + struct llentry *lle = child_lle->lle_parent; + + child_lle->la_flags &= ~LLE_LINKED; + child_lle->lle_parent = NULL; + CK_SLIST_REMOVE(&lle->lle_children, child_lle, llentry, lle_child_next); +} + int lltable_unlink_entry(struct lltable *llt, struct llentry *lle) { diff --git a/sys/net/if_llatbl.h b/sys/net/if_llatbl.h index ffbaa7a946bb..7ad9d59a1a0e 100644 --- a/sys/net/if_llatbl.h +++ b/sys/net/if_llatbl.h @@ -58,7 +58,8 @@ struct llentry { } r_l3addr; char r_linkdata[LLE_MAX_LINKHDR]; /* L2 data */ uint8_t r_hdrlen; /* length for LL header */ - uint8_t spare0[3]; + uint8_t r_family; /* Upper layer proto family */ + uint8_t spare0[2]; uint16_t r_flags; /* LLE runtime flags */ uint16_t r_skip_req; /* feedback from fast path */ @@ -78,6 +79,9 @@ struct llentry { time_t lle_hittime; /* Time when r_skip_req was unset */ int lle_refcnt; char *ll_addr; /* link-layer address */ + CK_SLIST_HEAD(llentry_children_head,llentry) lle_children; /* child encaps */ + CK_SLIST_ENTRY(llentry) lle_child_next; /* child encaps */ + struct llentry *lle_parent; /* parent for a child */ CK_LIST_ENTRY(llentry) lle_chain; /* chain of deleted items */ struct callout lle_timer; @@ -104,6 +108,8 @@ struct llentry { #define LLE_IS_VALID(lle) (((lle) != NULL) && ((lle) != (void *)-1)) +#define LLE_SF(_fam, _flags) (((_flags) & 0xFFFF) | ((_fam) << 16)) + #define LLE_ADDREF(lle) do { \ LLE_WLOCK_ASSERT(lle); \ KASSERT((lle)->lle_refcnt >= 0, \ @@ -195,6 +201,7 @@ MALLOC_DECLARE(M_LLTABLE); #define LLE_REDIRECT 0x0010 /* installed by redirect; has host rtentry */ #define LLE_PUB 0x0020 /* publish entry ??? */ #define LLE_LINKED 0x0040 /* linked to lookup structure */ +#define LLE_CHILD 0x0080 /* Child LLE storing different AF encap */ /* LLE request flags */ #define LLE_EXCLUSIVE 0x2000 /* return lle xlocked */ #define LLE_UNLOCKED 0x4000 /* return lle unlocked */ @@ -234,6 +241,8 @@ int lltable_delete_addr(struct lltable *llt, u_int flags, const struct sockaddr *l3addr); int lltable_link_entry(struct lltable *llt, struct llentry *lle); int lltable_unlink_entry(struct lltable *llt, struct llentry *lle); +void lltable_link_child_entry(struct llentry *parent_lle, struct llentry *child_lle); +void lltable_unlink_child_entry(struct llentry *child_lle); void lltable_fill_sa_entry(const struct llentry *lle, struct sockaddr *sa); struct ifnet *lltable_get_ifp(const struct lltable *llt); int lltable_get_af(const struct lltable *llt); @@ -267,6 +276,7 @@ llentry_provide_feedback(struct llentry *lle) return; llentry_mark_used(lle); } +struct llentry *llentry_lookup_family(struct llentry *lle, int family); int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *); diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c index 8eddb73d333c..1c0be6011253 100644 --- a/sys/netinet/toecore.c +++ b/sys/netinet/toecore.c @@ -483,7 +483,7 @@ toe_l2_resolve(struct toedev *tod, struct ifnet *ifp, struct sockaddr *sa, #endif #ifdef INET6 case AF_INET6: - rc = nd6_resolve(ifp, 0, NULL, sa, lladdr, NULL, NULL); + rc = nd6_resolve(ifp, LLE_SF(AF_INET6, 0), NULL, sa, lladdr, NULL, NULL); break; #endif default: diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 6b8f0f7be5bb..f4a5574084fd 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2546,7 +2546,7 @@ icmp6_redirect_output(struct mbuf *m0, struct nhop_object *nh) struct nd_opt_hdr *nd_opt; char *lladdr; - ln = nd6_lookup(router_ll6, 0, ifp); + ln = nd6_lookup(router_ll6, LLE_SF(AF_INET6, 0), ifp); if (ln == NULL) goto nolladdropt; diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index d5b3452c0b06..142a05ded2b6 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2335,6 +2335,11 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); if (lle == NULL) return (NULL); + + int family = flags >> 16; + if (__predict_false(family != AF_INET6)) + lle = llentry_lookup_family(lle, family); + if (flags & LLE_UNLOCKED) return (lle); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 38f03916531f..14312f0a30a3 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -139,7 +139,7 @@ static void nd6_free_redirect(const struct llentry *); static void nd6_llinfo_timer(void *); static void nd6_llinfo_settimer_locked(struct llentry *, long); static void clear_llinfo_pqueue(struct llentry *); -static int nd6_resolve_slow(struct ifnet *, int, struct mbuf *, +static int nd6_resolve_slow(struct ifnet *, int, int, struct mbuf *, const struct sockaddr_in6 *, u_char *, uint32_t *, struct llentry **); static int nd6_need_cache(struct ifnet *); @@ -530,6 +530,10 @@ nd6_llinfo_settimer_locked(struct llentry *ln, long tick) LLE_WLOCK_ASSERT(ln); + /* Do not schedule timers for child LLEs. */ + if (ln->la_flags & LLE_CHILD) + return; + if (tick < 0) { ln->la_expire = 0; ln->ln_ntick = 0; @@ -1375,40 +1379,76 @@ nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp) * Even if the address matches none of our addresses, it might be * in the neighbor cache. */ - if ((lle = nd6_lookup(&addr->sin6_addr, 0, ifp)) != NULL) { + if ((lle = nd6_lookup(&addr->sin6_addr, LLE_SF(AF_INET6, 0), ifp)) != NULL) { LLE_RUNLOCK(lle); rc = 1; } return (rc); } +static __noinline void +nd6_free_children(struct llentry *lle) +{ + struct llentry *child_lle; + + NET_EPOCH_ASSERT(); + LLE_WLOCK_ASSERT(lle); + + while ((child_lle = CK_SLIST_FIRST(&lle->lle_children)) != NULL) { + LLE_WLOCK(child_lle); + lltable_unlink_child_entry(child_lle); + llentry_free(child_lle); + } +} + /* * Tries to update @lle address/prepend data with new @lladdr. * * Returns true on success. * In any case, @lle is returned wlocked. */ -bool -nd6_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, char *lladdr) +static __noinline bool +nd6_try_set_entry_addr_locked(struct ifnet *ifp, struct llentry *lle, char *lladdr) { - u_char linkhdr[LLE_MAX_LINKHDR]; - size_t linkhdrsize; - int lladdr_off; - - LLE_WLOCK_ASSERT(lle); + u_char buf[LLE_MAX_LINKHDR]; + int fam, off; + size_t sz; - linkhdrsize = sizeof(linkhdr); - if (lltable_calc_llheader(ifp, AF_INET6, lladdr, - linkhdr, &linkhdrsize, &lladdr_off) != 0) { + sz = sizeof(buf); + if (lltable_calc_llheader(ifp, AF_INET6, lladdr, buf, &sz, &off) != 0) return (false); + + /* Update data */ + lltable_set_entry_addr(ifp, lle, buf, sz, off); + + struct llentry *child_lle; + CK_SLIST_FOREACH(child_lle, &lle->lle_children, lle_child_next) { + LLE_WLOCK(child_lle); + fam = child_lle->r_family; + sz = sizeof(buf); + if (lltable_calc_llheader(ifp, fam, lladdr, buf, &sz, &off) == 0) { + /* success */ + lltable_set_entry_addr(ifp, child_lle, buf, sz, off); + child_lle->ln_state = ND6_LLINFO_REACHABLE; + } + LLE_WUNLOCK(child_lle); } + return (true); +} + +bool +nd6_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, char *lladdr) +{ + NET_EPOCH_ASSERT(); + LLE_WLOCK_ASSERT(lle); + if (!lltable_acquire_wlock(ifp, lle)) return (false); - lltable_set_entry_addr(ifp, lle, linkhdr, linkhdrsize, lladdr_off); + bool ret = nd6_try_set_entry_addr_locked(ifp, lle, lladdr); IF_AFDATA_WUNLOCK(ifp); - return (true); + return (ret); } /* @@ -1432,6 +1472,8 @@ nd6_free(struct llentry **lnp, int gc) LLE_WLOCK_ASSERT(ln); ND6_RLOCK_ASSERT(); + KASSERT((ln->la_flags & LLE_CHILD) == 0, ("child lle")); + ifp = lltable_get_ifp(ln->lle_tbl); if ((ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) != 0) dr = defrouter_lookup_locked(&ln->r_l3addr.addr6, ifp); @@ -1553,6 +1595,8 @@ nd6_free(struct llentry **lnp, int gc) } IF_AFDATA_UNLOCK(ifp); + nd6_free_children(ln); + llentry_free(ln); if (dr != NULL) defrouter_rele(dr); @@ -1827,7 +1871,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) return (error); NET_EPOCH_ENTER(et); - ln = nd6_lookup(&nb_addr, 0, ifp); + ln = nd6_lookup(&nb_addr, LLE_SF(AF_INET6, 0), ifp); NET_EPOCH_EXIT(et); if (ln == NULL) { @@ -1977,7 +2021,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, * description on it in NS section (RFC 2461 7.2.3). */ flags = lladdr ? LLE_EXCLUSIVE : 0; - ln = nd6_lookup(from, flags, ifp); + ln = nd6_lookup(from, LLE_SF(AF_INET6, flags), ifp); is_newentry = 0; if (ln == NULL) { flags |= LLE_EXCLUSIVE; @@ -2001,7 +2045,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, IF_AFDATA_WLOCK(ifp); LLE_WLOCK(ln); /* Prefer any existing lle over newly-created one */ - ln_tmp = nd6_lookup(from, LLE_EXCLUSIVE, ifp); + ln_tmp = nd6_lookup(from, LLE_SF(AF_INET6, LLE_EXCLUSIVE), ifp); if (ln_tmp == NULL) lltable_link_entry(LLTABLE6(ifp), ln); IF_AFDATA_WUNLOCK(ifp); @@ -2086,6 +2130,8 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, if (chain != NULL) nd6_flush_holdchain(ifp, ln, chain); + if (do_update) + nd6_flush_children_holdchain(ifp, ln); /* * When the link-layer address of a router changes, select the @@ -2227,7 +2273,7 @@ nd6_output_ifp(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m, * - other errors (alloc failure, etc) */ int -nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf *m, +nd6_resolve(struct ifnet *ifp, int gw_flags, struct mbuf *m, const struct sockaddr *sa_dst, u_char *desten, uint32_t *pflags, struct llentry **plle) { @@ -2261,8 +2307,9 @@ nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf *m, } } - ln = nd6_lookup(&dst6->sin6_addr, plle ? LLE_EXCLUSIVE : LLE_UNLOCKED, - ifp); + int family = gw_flags >> 16; + int lookup_flags = plle ? LLE_EXCLUSIVE : LLE_UNLOCKED; + ln = nd6_lookup(&dst6->sin6_addr, LLE_SF(family, lookup_flags), ifp); if (ln != NULL && (ln->r_flags & RLLE_VALID) != 0) { /* Entry found, let's copy lle info */ bcopy(ln->r_linkdata, desten, ln->r_hdrlen); @@ -2278,19 +2325,39 @@ nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf *m, } else if (plle && ln) LLE_WUNLOCK(ln); - return (nd6_resolve_slow(ifp, 0, m, dst6, desten, pflags, plle)); + return (nd6_resolve_slow(ifp, family, 0, m, dst6, desten, pflags, plle)); } /* - * Finds or creates a new llentry for @addr. + * Finds or creates a new llentry for @addr and @family. * Returns wlocked llentry or NULL. + * + * + * Child LLEs. + * + * Do not have their own state machine (gets marked as static) + * settimer bails out for child LLEs just in case. + * + * Locking order: parent lle gets locked first, chen goes the child. */ static __noinline struct llentry * -nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr) +nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr, int family) { + struct llentry *child_lle = NULL; struct llentry *lle, *lle_tmp; lle = nd6_alloc(addr, 0, ifp); + if (lle != NULL && family != AF_INET6) { + child_lle = nd6_alloc(addr, 0, ifp); + if (child_lle == NULL) { + lltable_free_entry(LLTABLE6(ifp), lle); + return (NULL); + } + child_lle->r_family = family; + child_lle->la_flags |= LLE_CHILD | LLE_STATIC; + child_lle->ln_state = ND6_LLINFO_INCOMPLETE; + } + if (lle == NULL) { char ip6buf[INET6_ADDRSTRLEN]; log(LOG_DEBUG, @@ -2303,15 +2370,30 @@ nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr) IF_AFDATA_WLOCK(ifp); LLE_WLOCK(lle); /* Prefer any existing entry over newly-created one */ - lle_tmp = nd6_lookup(addr, LLE_EXCLUSIVE, ifp); + lle_tmp = nd6_lookup(addr, LLE_SF(AF_INET6, LLE_EXCLUSIVE), ifp); if (lle_tmp == NULL) lltable_link_entry(LLTABLE6(ifp), lle); - IF_AFDATA_WUNLOCK(ifp); - if (lle_tmp != NULL) { + else { lltable_free_entry(LLTABLE6(ifp), lle); - return (lle_tmp); - } else - return (lle); + lle = lle_tmp; + } + if (child_lle != NULL) { + /* Check if child lle for the same family exists */ + lle_tmp = llentry_lookup_family(lle, child_lle->r_family); + LLE_WLOCK(child_lle); + if (lle_tmp == NULL) { + /* Attach */ + lltable_link_child_entry(lle, child_lle); + } else { + /* child lle already exists, free newly-created one */ + lltable_free_entry(LLTABLE6(ifp), child_lle); + child_lle = lle_tmp; + } + LLE_WUNLOCK(lle); + lle = child_lle; + } + IF_AFDATA_WUNLOCK(ifp); + return (lle); } /* @@ -2326,7 +2408,7 @@ nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr) * Set noinline to be dtrace-friendly */ static __noinline int -nd6_resolve_slow(struct ifnet *ifp, int flags, struct mbuf *m, +nd6_resolve_slow(struct ifnet *ifp, int family, int flags, struct mbuf *m, const struct sockaddr_in6 *dst, u_char *desten, uint32_t *pflags, struct llentry **plle) { @@ -2343,14 +2425,14 @@ nd6_resolve_slow(struct ifnet *ifp, int flags, struct mbuf *m, * At this point, the destination of the packet must be a unicast * or an anycast address(i.e. not a multicast). */ - lle = nd6_lookup(&dst->sin6_addr, LLE_EXCLUSIVE, ifp); + lle = nd6_lookup(&dst->sin6_addr, LLE_SF(family, LLE_EXCLUSIVE), ifp); if ((lle == NULL) && nd6_is_addr_neighbor(dst, ifp)) { /* * Since nd6_is_addr_neighbor() internally calls nd6_lookup(), * the condition below is not very efficient. But we believe * it is tolerable, because this should be a rare case. */ - lle = nd6_get_llentry(ifp, &dst->sin6_addr); + lle = nd6_get_llentry(ifp, &dst->sin6_addr, family); } if (lle == NULL) { @@ -2367,7 +2449,7 @@ nd6_resolve_slow(struct ifnet *ifp, int flags, struct mbuf *m, * neighbor unreachability detection on expiration. * (RFC 2461 7.3.3) */ - if (lle->ln_state == ND6_LLINFO_STALE) + if ((!(lle->la_flags & LLE_CHILD)) && (lle->ln_state == ND6_LLINFO_STALE)) nd6_llinfo_setstate(lle, ND6_LLINFO_DELAY); /* @@ -2432,6 +2514,14 @@ nd6_resolve_slow(struct ifnet *ifp, int flags, struct mbuf *m, */ psrc = NULL; send_ns = 0; + + /* If we have child lle, switch to the parent to send NS */ + if (lle->la_flags & LLE_CHILD) { + struct llentry *lle_parent = lle->lle_parent; + LLE_WUNLOCK(lle); + lle = lle_parent; + LLE_WLOCK(lle); + } if (lle->la_asked == 0) { lle->la_asked++; send_ns = 1; @@ -2463,7 +2553,7 @@ nd6_resolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst, int error; flags |= LLE_ADDRONLY; - error = nd6_resolve_slow(ifp, flags, NULL, + error = nd6_resolve_slow(ifp, AF_INET6, flags, NULL, (const struct sockaddr_in6 *)dst, desten, pflags, NULL); return (error); } @@ -2499,6 +2589,22 @@ nd6_flush_holdchain(struct ifnet *ifp, struct llentry *lle, struct mbuf *chain) return (error); } +__noinline void +nd6_flush_children_holdchain(struct ifnet *ifp, struct llentry *lle) +{ + struct llentry *child_lle; + struct mbuf *chain; + + NET_EPOCH_ASSERT(); + + CK_SLIST_FOREACH(child_lle, &lle->lle_children, lle_child_next) { + LLE_WLOCK(child_lle); + chain = nd6_grab_holdchain(child_lle); + LLE_WUNLOCK(child_lle); + nd6_flush_holdchain(ifp, child_lle, chain); + } +} + static int nd6_need_cache(struct ifnet *ifp) { @@ -2552,7 +2658,7 @@ nd6_add_ifa_lle(struct in6_ifaddr *ia) IF_AFDATA_WLOCK(ifp); LLE_WLOCK(ln); /* Unlink any entry if exists */ - ln_tmp = lla_lookup(LLTABLE6(ifp), LLE_EXCLUSIVE, dst); + ln_tmp = lla_lookup(LLTABLE6(ifp), LLE_SF(AF_INET6, LLE_EXCLUSIVE), dst); if (ln_tmp != NULL) lltable_unlink_entry(LLTABLE6(ifp), ln_tmp); lltable_link_entry(LLTABLE6(ifp), ln); diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index fe0f2b22cc48..3f9f8219b018 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -379,6 +379,7 @@ void nd6_cache_lladdr(struct ifnet *, struct in6_addr *, bool nd6_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, char *lladdr); struct mbuf *nd6_grab_holdchain(struct llentry *); int nd6_flush_holdchain(struct ifnet *, struct llentry *, struct mbuf *); +void nd6_flush_children_holdchain(struct ifnet *, struct llentry *); int nd6_add_ifa_lle(struct in6_ifaddr *); void nd6_rem_ifa_lle(struct in6_ifaddr *, int); int nd6_output_ifp(struct ifnet *, struct ifnet *, struct mbuf *, diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 974c454e93a5..30d73f9d71a9 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -630,6 +630,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) size_t linkhdrsize; int flags, is_override, is_router, is_solicited; int lladdr_off, lladdrlen, checklink; + bool flush_holdchain = false; NET_EPOCH_ASSERT(); @@ -747,7 +748,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) * If no neighbor cache entry is found, NA SHOULD silently be * discarded. */ - ln = nd6_lookup(&taddr6, LLE_EXCLUSIVE, ifp); + ln = nd6_lookup(&taddr6, LLE_SF(AF_INET6, LLE_EXCLUSIVE), ifp); if (ln == NULL) { goto freeit; } @@ -773,6 +774,7 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) if (!nd6_try_set_entry_addr(ifp, ln, lladdr)) goto freeit; + flush_holdchain = true; EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); if (is_solicited) nd6_llinfo_setstate(ln, ND6_LLINFO_REACHABLE); @@ -899,6 +901,8 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) if (chain != NULL) nd6_flush_holdchain(ifp, ln, chain); + if (flush_holdchain) + nd6_flush_children_holdchain(ifp, ln); if (checklink) pfxlist_onlink_check(); diff --git a/sys/ofed/drivers/infiniband/core/ib_addr.c b/sys/ofed/drivers/infiniband/core/ib_addr.c index a8e951721b8d..297469bd4d87 100644 --- a/sys/ofed/drivers/infiniband/core/ib_addr.c +++ b/sys/ofed/drivers/infiniband/core/ib_addr.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -584,8 +585,8 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, } else { bool is_gw = (nh->nh_flags & NHF_GATEWAY) != 0; memset(edst, 0, MAX_ADDR_LEN); - error = nd6_resolve(ifp, is_gw, NULL, is_gw ? - &nh->gw_sa : (const struct sockaddr *)&dst_tmp, + error = nd6_resolve(ifp, LLE_SF(AF_INET6, is_gw), NULL, + is_gw ? &nh->gw_sa : (const struct sockaddr *)&dst_tmp, edst, NULL, NULL); if (error != 0) goto error_put_ifp; From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:42:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF3656761C7; Sat, 21 Aug 2021 17:42:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsQnt5CChz4Qq3; Sat, 21 Aug 2021 17:42:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B57811734; Sat, 21 Aug 2021 17:42:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHgwuf094310; Sat, 21 Aug 2021 17:42:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHgwBB094309; Sat, 21 Aug 2021 17:42:58 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:42:58 GMT Message-Id: <202108211742.17LHgwBB094309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 2cdff9918e79 - main - byhve: add option to specify IP address for gdb MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cdff9918e79dcd9bfcaa919b8364afa41cd1e02 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:42:58 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=2cdff9918e79dcd9bfcaa919b8364afa41cd1e02 commit 2cdff9918e79dcd9bfcaa919b8364afa41cd1e02 Author: Mariusz Zaborski AuthorDate: 2021-08-19 17:52:12 +0000 Commit: Mariusz Zaborski CommitDate: 2021-08-21 17:43:17 +0000 byhve: add option to specify IP address for gdb Allow user to specify the IP address available for gdb debugger. Reviewed by: jhb, grehan, rgrimes, bcr (man pages) Differential Revision: https://reviews.freebsd.org/D29607 --- usr.sbin/bhyve/bhyve.8 | 16 ++++++++++----- usr.sbin/bhyve/bhyverun.c | 35 ++++++++++++++++++++++++--------- usr.sbin/bhyve/gdb.c | 50 +++++++++++++++++++++++++++++++++++++---------- usr.sbin/bhyve/gdb.h | 2 +- 4 files changed, 78 insertions(+), 25 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index fcf47ec65513..8ebb8aea6210 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2021 +.Dd August 19, 2021 .Dt BHYVE 8 .Os .Sh NAME @@ -137,16 +137,22 @@ Force .Nm to exit when a guest issues an access to an I/O port that is not emulated. This is intended for debug purposes. -.It Fl G Ar port +.It Fl G Xo +.Sm off +.Oo Ar w Oc +.Oo Ar bind_address: Oc +.Ar port +.Sm on +.Xc Start a debug server that uses the GDB protocol to export guest state to a debugger. An IPv4 TCP socket will be bound to the supplied +.Ar bind_address +and .Ar port to listen for debugger connections. Only a single debugger may be attached to the debug server at a time. -If -.Ar port -begins with +If the option begins with .Sq w , .Nm will pause execution at the first instruction waiting for a debugger to attach. diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index acf0df6cc9bf..a5645f645289 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1193,6 +1193,30 @@ parse_simple_config_file(const char *path) fclose(fp); } +static void +parse_gdb_options(char *optarg) +{ + const char *sport; + char *colon; + + if (optarg[0] == 'w') { + set_config_bool("gdb.wait", true); + optarg++; + } + + colon = strrchr(optarg, ':'); + if (colon == NULL) { + sport = optarg; + } else { + *colon = '\0'; + colon++; + sport = colon; + set_config_value("gdb.address", optarg); + } + + set_config_value("gdb.port", sport); +} + static void set_defaults(void) { @@ -1256,11 +1280,7 @@ main(int argc, char *argv[]) set_config_bool("memory.guest_in_core", true); break; case 'G': - if (optarg[0] == 'w') { - set_config_bool("gdb.wait", true); - optarg++; - } - set_config_value("gdb.port", optarg); + parse_gdb_options(optarg); break; case 'k': parse_simple_config_file(optarg); @@ -1447,10 +1467,7 @@ main(int argc, char *argv[]) if (get_config_bool("acpi_tables")) vmgenc_init(ctx); - value = get_config_value("gdb.port"); - if (value != NULL) - init_gdb(ctx, atoi(value), get_config_bool_default("gdb.wait", - false)); + init_gdb(ctx); if (lpc_bootrom()) { if (vm_set_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, 1)) { diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 219d192b7c9a..3e12c50f64cb 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include "bhyverun.h" +#include "config.h" #include "gdb.h" #include "mem.h" #include "mevent.h" @@ -1818,12 +1820,35 @@ limit_gdb_socket(int s) #endif void -init_gdb(struct vmctx *_ctx, int sport, bool wait) +init_gdb(struct vmctx *_ctx) { - struct sockaddr_in sin; int error, flags, optval, s; + struct addrinfo hints; + struct addrinfo *gdbaddr; + const char *saddr, *value; + char *sport; + bool wait; + + value = get_config_value("gdb.port"); + if (value == NULL) + return; + sport = strdup(value); + if (sport == NULL) + errx(4, "Failed to allocate memory"); + + wait = get_config_bool_default("gdb.wait", false); + + saddr = get_config_value("gdb.address"); + if (saddr == NULL) { +#if defined(INET) + saddr = "0.0.0.0"; +#elif defined(INET6) + saddr = "[::]"; +#endif + } - debug("==> starting on %d, %swaiting\n", sport, wait ? "" : "not "); + debug("==> starting on %s:%s, %swaiting\n", + saddr, sport, wait ? "" : "not "); error = pthread_mutex_init(&gdb_lock, NULL); if (error != 0) @@ -1832,20 +1857,23 @@ init_gdb(struct vmctx *_ctx, int sport, bool wait) if (error != 0) errc(1, error, "gdb cv init"); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV | AI_PASSIVE; + + if (getaddrinfo(saddr, sport, &hints, &gdbaddr) != 0) + err(1, "gdb address resolve"); + ctx = _ctx; - s = socket(PF_INET, SOCK_STREAM, 0); + s = socket(gdbaddr->ai_family, gdbaddr->ai_socktype, 0); if (s < 0) err(1, "gdb socket create"); optval = 1; (void)setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(INADDR_ANY); - sin.sin_port = htons(sport); - - if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) + if (bind(s, gdbaddr->ai_addr, gdbaddr->ai_addrlen) < 0) err(1, "gdb socket bind"); if (listen(s, 1) < 0) @@ -1874,4 +1902,6 @@ init_gdb(struct vmctx *_ctx, int sport, bool wait) #endif mevent_add(s, EVF_READ, new_connection, NULL); gdb_active = true; + freeaddrinfo(gdbaddr); + free(sport); } diff --git a/usr.sbin/bhyve/gdb.h b/usr.sbin/bhyve/gdb.h index 93396c1c6705..c5fa522c63e0 100644 --- a/usr.sbin/bhyve/gdb.h +++ b/usr.sbin/bhyve/gdb.h @@ -34,6 +34,6 @@ void gdb_cpu_add(int vcpu); void gdb_cpu_breakpoint(int vcpu, struct vm_exit *vmexit); void gdb_cpu_mtrap(int vcpu); void gdb_cpu_suspend(int vcpu); -void init_gdb(struct vmctx *ctx, int sport, bool wait); +void init_gdb(struct vmctx *ctx); #endif /* !__GDB_H__ */ From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:42:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F289A675CC8; Sat, 21 Aug 2021 17:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsQnv6QQpz3wXW; Sat, 21 Aug 2021 17:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE5E411735; Sat, 21 Aug 2021 17:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHgxL9094336; Sat, 21 Aug 2021 17:42:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHgx1U094335; Sat, 21 Aug 2021 17:42:59 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:42:59 GMT Message-Id: <202108211742.17LHgx1U094335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 3a92927bb69f - main - bhyve: change a default address from ANY to localhost MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a92927bb69f2d3fcd3dec4c909aab2191f4b848 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:43:00 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=3a92927bb69f2d3fcd3dec4c909aab2191f4b848 commit 3a92927bb69f2d3fcd3dec4c909aab2191f4b848 Author: Mariusz Zaborski AuthorDate: 2021-08-19 18:00:35 +0000 Commit: Mariusz Zaborski CommitDate: 2021-08-21 17:43:17 +0000 bhyve: change a default address from ANY to localhost Discussed with: grehan, jhb --- usr.sbin/bhyve/gdb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 3e12c50f64cb..0cee1c8f9543 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -1840,11 +1840,7 @@ init_gdb(struct vmctx *_ctx) saddr = get_config_value("gdb.address"); if (saddr == NULL) { -#if defined(INET) - saddr = "0.0.0.0"; -#elif defined(INET6) - saddr = "[::]"; -#endif + saddr = "localhost"; } debug("==> starting on %s:%s, %swaiting\n", @@ -1860,7 +1856,7 @@ init_gdb(struct vmctx *_ctx) memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV | AI_PASSIVE; + hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE; if (getaddrinfo(saddr, sport, &hints, &gdbaddr) != 0) err(1, "gdb address resolve"); From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:59:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C94D86762CD; Sat, 21 Aug 2021 17:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsR8X4zCFz4Vjw; Sat, 21 Aug 2021 17:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91F6E11A3E; Sat, 21 Aug 2021 17:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHx8Ms008004; Sat, 21 Aug 2021 17:59:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHx8Lg008003; Sat, 21 Aug 2021 17:59:08 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:59:08 GMT Message-Id: <202108211759.17LHx8Lg008003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: acabc20906ed - stable/13 - kevent: Prohibit negative change and event list lengths MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: acabc20906ed93a9e556b0d452a45e103f2e6eb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:59:08 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=acabc20906ed93a9e556b0d452a45e103f2e6eb6 commit acabc20906ed93a9e556b0d452a45e103f2e6eb6 Author: Mark Johnston AuthorDate: 2021-05-27 19:49:32 +0000 Commit: Mark Johnston CommitDate: 2021-08-21 16:08:58 +0000 kevent: Prohibit negative change and event list lengths Previously, a negative change list length would be treated the same as an empty change list. A negative event list length would result in bogus copyouts. Make kevent(2) return EINVAL for both cases so that application bugs are more easily found, and to be more robust against future changes to kevent internals. Reviewed by: imp, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit e00bae5c181ac8282caf41cd33a076da03cf8ac9) --- lib/libc/sys/kqueue.2 | 4 +++- sys/kern/kern_event.c | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index b83d85d90d42..9be380bb5d99 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2020 +.Dd May 26, 2021 .Dt KQUEUE 2 .Os .Sh NAME @@ -762,6 +762,8 @@ events were placed on the kqueue for return. A cancellation request was delivered to the thread, but not yet handled. .It Bq Er EINVAL The specified time limit or filter is invalid. +.It Bq Er EINVAL +The specified length of the event or change lists is negative. .It Bq Er ENOENT The event could not be found to be modified or deleted. .It Bq Er ENOMEM diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index c277ac085d62..bf04dae2ee5c 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1301,6 +1301,9 @@ kqueue_kevent(struct kqueue *kq, struct thread *td, int nchanges, int nevents, struct kevent *kevp, *changes; int i, n, nerrors, error; + if (nchanges < 0) + return (EINVAL); + nerrors = 0; while (nchanges > 0) { n = nchanges > KQ_NEVENTS ? KQ_NEVENTS : nchanges; @@ -1885,6 +1888,10 @@ kqueue_scan(struct kqueue *kq, int maxevents, struct kevent_copyops *k_ops, if (maxevents == 0) goto done_nl; + if (maxevents < 0) { + error = EINVAL; + goto done_nl; + } rsbt = 0; if (tsp != NULL) { From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:59:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F08F7676221; Sat, 21 Aug 2021 17:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsR8Y5xCJz4W0V; Sat, 21 Aug 2021 17:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3E4B119AB; Sat, 21 Aug 2021 17:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHx9GK008034; Sat, 21 Aug 2021 17:59:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHx9BE008033; Sat, 21 Aug 2021 17:59:09 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:59:09 GMT Message-Id: <202108211759.17LHx9BE008033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 66f390ffaf0c - stable/13 - rtsold: auto-probe point to point interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66f390ffaf0cd12b6860a4139f81f4aed9a05414 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:59:10 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=66f390ffaf0cd12b6860a4139f81f4aed9a05414 commit 66f390ffaf0cd12b6860a4139f81f4aed9a05414 Author: Franco Fitchner AuthorDate: 2021-08-14 15:08:07 +0000 Commit: Mark Johnston CommitDate: 2021-08-21 16:10:14 +0000 rtsold: auto-probe point to point interfaces rtsold works fine for point to point interfaces in manual mode but will not auto-probe them. Reviewed by: markj (cherry picked from commit bfa812f5407bddac2bcced290a09bd3e686e354a) --- usr.sbin/rtsold/rtsold.8 | 4 ++-- usr.sbin/rtsold/rtsold.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rtsold/rtsold.8 b/usr.sbin/rtsold/rtsold.8 index e30a07f3a3fe..273a2b4f0dd8 100644 --- a/usr.sbin/rtsold/rtsold.8 +++ b/usr.sbin/rtsold/rtsold.8 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2020 +.Dd August 14, 2021 .Dt RTSOLD 8 .Os .\" @@ -167,7 +167,7 @@ The options are as follows: .It Fl a Autoprobe outgoing interfaces. .Nm -will try to find any non-loopback, non-point-to-point, IPv6-capable interfaces +will try to find any non-loopback, IPv6-capable interfaces and send router solicitation messages on all of them. .It Fl d Enable debugging. diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 5e5298bfdadc..f58574cec731 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -846,8 +846,6 @@ autoifprobe(void) for (ifa = ifap; ifa; ifa = ifa->ifa_next) { if ((ifa->ifa_flags & IFF_UP) == 0) continue; - if ((ifa->ifa_flags & IFF_POINTOPOINT) != 0) - continue; if ((ifa->ifa_flags & IFF_LOOPBACK) != 0) continue; if ((ifa->ifa_flags & IFF_MULTICAST) == 0) From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:59:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91E37676061; Sat, 21 Aug 2021 17:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsR8c2pYRz4Vgd; Sat, 21 Aug 2021 17:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3ECC11851; Sat, 21 Aug 2021 17:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHxBLC008083; Sat, 21 Aug 2021 17:59:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHxBIi008082; Sat, 21 Aug 2021 17:59:11 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:59:11 GMT Message-Id: <202108211759.17LHxBIi008082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 20a8c236d102 - stable/13 - rpc: Make function tables const MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 20a8c236d1025f560c8418be92f72e0105003216 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:59:12 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20a8c236d1025f560c8418be92f72e0105003216 commit 20a8c236d1025f560c8418be92f72e0105003216 Author: Mark Johnston AuthorDate: 2021-07-09 14:56:13 +0000 Commit: Mark Johnston CommitDate: 2021-08-21 16:10:31 +0000 rpc: Make function tables const No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit 20d728b559178577869e50c7e3c1bf0ad24a750c) --- sys/rpc/auth.h | 2 +- sys/rpc/auth_none.c | 2 +- sys/rpc/auth_unix.c | 2 +- sys/rpc/clnt.h | 2 +- sys/rpc/clnt_bck.c | 2 +- sys/rpc/clnt_dg.c | 2 +- sys/rpc/clnt_rc.c | 2 +- sys/rpc/clnt_vc.c | 2 +- sys/rpc/rpcsec_gss/rpcsec_gss.c | 2 +- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 8 ++++---- sys/rpc/rpcsec_tls/auth_tls.c | 2 +- sys/rpc/svc.h | 2 +- sys/rpc/svc_auth.c | 10 +++++----- sys/rpc/svc_dg.c | 2 +- sys/rpc/svc_vc.c | 6 +++--- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sys/rpc/auth.h b/sys/rpc/auth.h index fd56b33da52e..5444f6180c5e 100644 --- a/sys/rpc/auth.h +++ b/sys/rpc/auth.h @@ -189,7 +189,7 @@ typedef struct __auth { struct opaque_auth ah_cred; struct opaque_auth ah_verf; union des_block ah_key; - struct auth_ops { + const struct auth_ops { void (*ah_nextverf) (struct __auth *); /* nextverf & serialize */ int (*ah_marshal) (struct __auth *, uint32_t, XDR *, diff --git a/sys/rpc/auth_none.c b/sys/rpc/auth_none.c index 236b4aa166ae..91597114c069 100644 --- a/sys/rpc/auth_none.c +++ b/sys/rpc/auth_none.c @@ -70,7 +70,7 @@ static bool_t authnone_validate (AUTH *, uint32_t, struct opaque_auth *, static bool_t authnone_refresh (AUTH *, void *); static void authnone_destroy (AUTH *); -static struct auth_ops authnone_ops = { +static const struct auth_ops authnone_ops = { .ah_nextverf = authnone_verf, .ah_marshal = authnone_marshal, .ah_validate = authnone_validate, diff --git a/sys/rpc/auth_unix.c b/sys/rpc/auth_unix.c index 4a3df5f70e3a..be0a241baa36 100644 --- a/sys/rpc/auth_unix.c +++ b/sys/rpc/auth_unix.c @@ -76,7 +76,7 @@ static bool_t authunix_refresh (AUTH *, void *); static void authunix_destroy (AUTH *); static void marshal_new_auth (AUTH *); -static struct auth_ops authunix_ops = { +static const struct auth_ops authunix_ops = { .ah_nextverf = authunix_nextverf, .ah_marshal = authunix_marshal, .ah_validate = authunix_validate, diff --git a/sys/rpc/clnt.h b/sys/rpc/clnt.h index 6f8f898ca918..a968c8f930fc 100644 --- a/sys/rpc/clnt.h +++ b/sys/rpc/clnt.h @@ -132,7 +132,7 @@ typedef struct __rpc_client { #ifdef _KERNEL volatile u_int cl_refs; /* reference count */ AUTH *cl_auth; /* authenticator */ - struct clnt_ops { + const struct clnt_ops { /* call remote procedure */ enum clnt_stat (*cl_call)(struct __rpc_client *, struct rpc_callextra *, rpcproc_t, diff --git a/sys/rpc/clnt_bck.c b/sys/rpc/clnt_bck.c index 2414171bad37..514905bf1cc2 100644 --- a/sys/rpc/clnt_bck.c +++ b/sys/rpc/clnt_bck.c @@ -101,7 +101,7 @@ static bool_t clnt_bck_control(CLIENT *, u_int, void *); static void clnt_bck_close(CLIENT *); static void clnt_bck_destroy(CLIENT *); -static struct clnt_ops clnt_bck_ops = { +static const struct clnt_ops clnt_bck_ops = { .cl_abort = clnt_bck_abort, .cl_geterr = clnt_bck_geterr, .cl_freeres = clnt_bck_freeres, diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c index 3a3662a02a39..63a26cc0b9ac 100644 --- a/sys/rpc/clnt_dg.c +++ b/sys/rpc/clnt_dg.c @@ -84,7 +84,7 @@ static void clnt_dg_close(CLIENT *); static void clnt_dg_destroy(CLIENT *); static int clnt_dg_soupcall(struct socket *so, void *arg, int waitflag); -static struct clnt_ops clnt_dg_ops = { +static const struct clnt_ops clnt_dg_ops = { .cl_call = clnt_dg_call, .cl_abort = clnt_dg_abort, .cl_geterr = clnt_dg_geterr, diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c index ae3b2985a891..aa69356b8cd2 100644 --- a/sys/rpc/clnt_rc.c +++ b/sys/rpc/clnt_rc.c @@ -59,7 +59,7 @@ static bool_t clnt_reconnect_control(CLIENT *, u_int, void *); static void clnt_reconnect_close(CLIENT *); static void clnt_reconnect_destroy(CLIENT *); -static struct clnt_ops clnt_reconnect_ops = { +static const struct clnt_ops clnt_reconnect_ops = { .cl_call = clnt_reconnect_call, .cl_abort = clnt_reconnect_abort, .cl_geterr = clnt_reconnect_geterr, diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 92c216e227d1..7d22c670b017 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -104,7 +104,7 @@ static bool_t time_not_ok(struct timeval *); static int clnt_vc_soupcall(struct socket *so, void *arg, int waitflag); static void clnt_vc_dotlsupcall(void *data); -static struct clnt_ops clnt_vc_ops = { +static const struct clnt_ops clnt_vc_ops = { .cl_call = clnt_vc_call, .cl_abort = clnt_vc_abort, .cl_geterr = clnt_vc_geterr, diff --git a/sys/rpc/rpcsec_gss/rpcsec_gss.c b/sys/rpc/rpcsec_gss/rpcsec_gss.c index b384a8347ef5..32121be21091 100644 --- a/sys/rpc/rpcsec_gss/rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/rpcsec_gss.c @@ -97,7 +97,7 @@ static bool_t rpc_gss_validate(AUTH *, uint32_t, struct opaque_auth *, static void rpc_gss_destroy(AUTH *); static void rpc_gss_destroy_context(AUTH *, bool_t); -static struct auth_ops rpc_gss_ops = { +static const struct auth_ops rpc_gss_ops = { .ah_nextverf = rpc_gss_nextverf, .ah_marshal = rpc_gss_marshal, .ah_validate = rpc_gss_validate, diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c index 36ab8c5bcf87..c9a09438d907 100644 --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -90,10 +90,10 @@ static void svc_rpc_gss_release(SVCAUTH *); static enum auth_stat svc_rpc_gss(struct svc_req *, struct rpc_msg *); static int rpc_gss_svc_getcred(struct svc_req *, struct ucred **, int *); -static struct svc_auth_ops svc_auth_gss_ops = { - svc_rpc_gss_wrap, - svc_rpc_gss_unwrap, - svc_rpc_gss_release, +static const struct svc_auth_ops svc_auth_gss_ops = { + .svc_ah_wrap = svc_rpc_gss_wrap, + .svc_ah_unwrap = svc_rpc_gss_unwrap, + .svc_ah_release = svc_rpc_gss_release, }; struct sx svc_rpc_gss_lock; diff --git a/sys/rpc/rpcsec_tls/auth_tls.c b/sys/rpc/rpcsec_tls/auth_tls.c index bd23784f5ebf..9afde553283e 100644 --- a/sys/rpc/rpcsec_tls/auth_tls.c +++ b/sys/rpc/rpcsec_tls/auth_tls.c @@ -70,7 +70,7 @@ static bool_t authtls_validate (AUTH *, uint32_t, struct opaque_auth *, static bool_t authtls_refresh (AUTH *, void *); static void authtls_destroy (AUTH *); -static struct auth_ops authtls_ops = { +static const struct auth_ops authtls_ops = { .ah_nextverf = authtls_verf, .ah_marshal = authtls_marshal, .ah_validate = authtls_validate, diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h index 8a94d7058972..d92fa6953891 100644 --- a/sys/rpc/svc.h +++ b/sys/rpc/svc.h @@ -212,7 +212,7 @@ typedef struct __rpc_svcxprt { * Interface to server-side authentication flavors. */ typedef struct __rpc_svcauth { - struct svc_auth_ops { + const struct svc_auth_ops { #ifdef _KERNEL int (*svc_ah_wrap)(struct __rpc_svcauth *, struct mbuf **); int (*svc_ah_unwrap)(struct __rpc_svcauth *, struct mbuf **); diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c index 0c5a68688d48..75d1f21d3484 100644 --- a/sys/rpc/svc_auth.c +++ b/sys/rpc/svc_auth.c @@ -60,7 +60,7 @@ static enum auth_stat (*_svcauth_rpcsec_gss)(struct svc_req *, static int (*_svcauth_rpcsec_gss_getcred)(struct svc_req *, struct ucred **, int *); -static struct svc_auth_ops svc_auth_null_ops; +static const struct svc_auth_ops svc_auth_null_ops; /* * The call rpc message, msg has been obtained from the wire. The msg contains @@ -145,10 +145,10 @@ svcauth_null_release(SVCAUTH *auth) } -static struct svc_auth_ops svc_auth_null_ops = { - svcauth_null_wrap, - svcauth_null_unwrap, - svcauth_null_release, +static const struct svc_auth_ops svc_auth_null_ops = { + .svc_ah_wrap = svcauth_null_wrap, + .svc_ah_unwrap = svcauth_null_unwrap, + .svc_ah_release = svcauth_null_release, }; /*ARGSUSED*/ diff --git a/sys/rpc/svc_dg.c b/sys/rpc/svc_dg.c index 2bdd0700c044..db1928655618 100644 --- a/sys/rpc/svc_dg.c +++ b/sys/rpc/svc_dg.c @@ -73,7 +73,7 @@ static void svc_dg_destroy(SVCXPRT *); static bool_t svc_dg_control(SVCXPRT *, const u_int, void *); static int svc_dg_soupcall(struct socket *so, void *arg, int waitflag); -static struct xp_ops svc_dg_ops = { +static const struct xp_ops svc_dg_ops = { .xp_recv = svc_dg_recv, .xp_stat = svc_dg_stat, .xp_reply = svc_dg_reply, diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index 234feba5c8bd..d81c0b01d84d 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -105,7 +105,7 @@ static int svc_vc_accept(struct socket *head, struct socket **sop); static int svc_vc_soupcall(struct socket *so, void *arg, int waitflag); static int svc_vc_rendezvous_soupcall(struct socket *, void *, int); -static struct xp_ops svc_vc_rendezvous_ops = { +static const struct xp_ops svc_vc_rendezvous_ops = { .xp_recv = svc_vc_rendezvous_recv, .xp_stat = svc_vc_rendezvous_stat, .xp_reply = (bool_t (*)(SVCXPRT *, struct rpc_msg *, @@ -114,7 +114,7 @@ static struct xp_ops svc_vc_rendezvous_ops = { .xp_control = svc_vc_rendezvous_control }; -static struct xp_ops svc_vc_ops = { +static const struct xp_ops svc_vc_ops = { .xp_recv = svc_vc_recv, .xp_stat = svc_vc_stat, .xp_ack = svc_vc_ack, @@ -123,7 +123,7 @@ static struct xp_ops svc_vc_ops = { .xp_control = svc_vc_control }; -static struct xp_ops svc_vc_backchannel_ops = { +static const struct xp_ops svc_vc_backchannel_ops = { .xp_recv = svc_vc_backchannel_recv, .xp_stat = svc_vc_backchannel_stat, .xp_reply = svc_vc_backchannel_reply, From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:59:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 694796762D8; Sat, 21 Aug 2021 17:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsR8d2Nz7z4Vk7; Sat, 21 Aug 2021 17:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32DA7114F4; Sat, 21 Aug 2021 17:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHxDgm008107; Sat, 21 Aug 2021 17:59:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHxDBw008106; Sat, 21 Aug 2021 17:59:13 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:59:13 GMT Message-Id: <202108211759.17LHxDBw008106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9bfe19ff8253 - stable/13 - tail: Fix -f with stdin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9bfe19ff8253d08482cbbbf59cca435c4de87ac5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:59:13 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9bfe19ff8253d08482cbbbf59cca435c4de87ac5 commit 9bfe19ff8253d08482cbbbf59cca435c4de87ac5 Author: Mark Johnston AuthorDate: 2021-07-08 21:40:59 +0000 Commit: Mark Johnston CommitDate: 2021-08-21 16:18:17 +0000 tail: Fix -f with stdin Based on a patch from swills@. (cherry picked from commit 7e11889959a6c92f05e1c1949deb73295ce60bac) --- usr.bin/tail/extern.h | 2 +- usr.bin/tail/tail.c | 43 ++++++++++++++++++++----------------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/usr.bin/tail/extern.h b/usr.bin/tail/extern.h index 65ddb519dc61..3d8c12629682 100644 --- a/usr.bin/tail/extern.h +++ b/usr.bin/tail/extern.h @@ -56,7 +56,7 @@ struct mapinfo { struct file_info { FILE *fp; - char *file_name; + const char *file_name; struct stat st; }; diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c index b52043c5e580..874557f105ec 100644 --- a/usr.bin/tail/tail.c +++ b/usr.bin/tail/tail.c @@ -67,8 +67,6 @@ static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley) 6/6/93"; int Fflag, fflag, qflag, rflag, rval, no_files; fileargs_t *fa; -static file_info_t *files; - static void obsolete(char **); static void usage(void); @@ -88,8 +86,8 @@ main(int argc, char *argv[]) FILE *fp; off_t off; enum STYLE style; - int i, ch, first; - file_info_t *file; + int ch, first; + file_info_t file, *filep, *files; char *p; cap_rights_t rights; @@ -206,30 +204,24 @@ main(int argc, char *argv[]) } if (*argv && fflag) { - files = (struct file_info *) malloc(no_files * - sizeof(struct file_info)); - if (!files) + files = malloc(no_files * sizeof(struct file_info)); + if (files == NULL) err(1, "Couldn't malloc space for file descriptors."); - for (file = files; (fn = *argv++); file++) { - file->file_name = strdup(fn); - if (! file->file_name) - errx(1, "Couldn't malloc space for file name."); - file->fp = fileargs_fopen(fa, file->file_name, "r"); - if (file->fp == NULL || - fstat(fileno(file->fp), &file->st)) { - if (file->fp != NULL) { - fclose(file->fp); - file->fp = NULL; + for (filep = files; (fn = *argv++); filep++) { + filep->file_name = fn; + filep->fp = fileargs_fopen(fa, filep->file_name, "r"); + if (filep->fp == NULL || + fstat(fileno(filep->fp), &filep->st)) { + if (filep->fp != NULL) { + fclose(filep->fp); + filep->fp = NULL; } if (!Fflag || errno != ENOENT) - ierr(file->file_name); + ierr(filep->file_name); } } follow(files, style, off); - for (i = 0, file = files; i < no_files; i++, file++) { - free(file->file_name); - } free(files); } else if (*argv) { for (first = 1; (fn = *argv++);) { @@ -266,10 +258,15 @@ main(int argc, char *argv[]) fflag = 0; /* POSIX.2 requires this. */ } - if (rflag) + if (rflag) { reverse(stdin, fn, style, off, &sb); - else + } else if (fflag) { + file.file_name = fn; + file.fp = stdin; + follow(&file, style, off); + } else { forward(stdin, fn, style, off, &sb); + } } fileargs_free(fa); exit(rval); From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:59:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A5F467605E; Sat, 21 Aug 2021 17:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsR8b0w0Xz4Vk1; Sat, 21 Aug 2021 17:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF398114F3; Sat, 21 Aug 2021 17:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHxArM008059; Sat, 21 Aug 2021 17:59:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHxAmX008058; Sat, 21 Aug 2021 17:59:10 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:59:10 GMT Message-Id: <202108211759.17LHxAmX008058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2544cb334d5f - stable/13 - rtsold: pass sending router address to other and managed script MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2544cb334d5f99c78b172d8eae65074eaaadef45 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:59:11 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2544cb334d5f99c78b172d8eae65074eaaadef45 commit 2544cb334d5f99c78b172d8eae65074eaaadef45 Author: Franco Fitchner AuthorDate: 2021-08-14 15:10:21 +0000 Commit: Mark Johnston CommitDate: 2021-08-21 16:10:22 +0000 rtsold: pass sending router address to other and managed script Reviewed by: markj (cherry picked from commit 02508a3d4e178b431fe5dda354a56d883f976c02) --- usr.sbin/rtsold/rtsol.c | 8 ++++++-- usr.sbin/rtsold/rtsold.8 | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 76756bfd8393..646dd092cb0c 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -79,8 +79,8 @@ static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *, struct script_msg_head_t *, struct script_msg_head_t *); static char *make_rsid(const char *, const char *, struct rainfo *); -#define _ARGS_MANAGED managedconf_script, ifi->ifname -#define _ARGS_OTHER otherconf_script, ifi->ifname +#define _ARGS_MANAGED managedconf_script, ifi->ifname, rasender +#define _ARGS_OTHER otherconf_script, ifi->ifname, rasender #define _ARGS_RESADD resolvconf_script, "-a", rsid #define _ARGS_RESDEL resolvconf_script, "-d", rsid @@ -301,6 +301,8 @@ rtsol_input(int sock) */ if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_MANAGED) && !ifi->managedconfig) { + const char *rasender = inet_ntop(AF_INET6, &from.sin6_addr, + ntopbuf, sizeof(ntopbuf)); warnmsg(LOG_DEBUG, __func__, "ManagedConfigFlag on %s is turned on", ifi->ifname); ifi->managedconfig = 1; @@ -317,6 +319,8 @@ rtsol_input(int sock) */ if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_OTHER) && !ifi->otherconfig) { + const char *rasender = inet_ntop(AF_INET6, &from.sin6_addr, + ntopbuf, sizeof(ntopbuf)); warnmsg(LOG_DEBUG, __func__, "OtherConfigFlag on %s is turned on", ifi->ifname); ifi->otherconfig = 1; diff --git a/usr.sbin/rtsold/rtsold.8 b/usr.sbin/rtsold/rtsold.8 index 273a2b4f0dd8..84e4d3013ef4 100644 --- a/usr.sbin/rtsold/rtsold.8 +++ b/usr.sbin/rtsold/rtsold.8 @@ -219,7 +219,8 @@ When the flag changes from FALSE to TRUE, .Nm will invoke .Ar script-name -with a single argument of the receiving interface name, +with a first argument of the receiving interface name +and a second argument of the sending router address, expecting the script will then start a protocol for the managed configuration. .Ar script-name @@ -233,7 +234,8 @@ When the flag changes from FALSE to TRUE, .Nm will invoke .Ar script-name -with a single argument of the receiving interface name, +with a first argument of the receiving interface name +and a second argument of the sending router address, expecting the script will then start a protocol for the other configuration. The script will not be run if the Managed Configuration flag in the From owner-dev-commits-src-all@freebsd.org Sat Aug 21 17:59:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89E156762DD; Sat, 21 Aug 2021 17:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsR8f3D2Cz4Vsw; Sat, 21 Aug 2021 17:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 474DF11852; Sat, 21 Aug 2021 17:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LHxEXm008131; Sat, 21 Aug 2021 17:59:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LHxECd008130; Sat, 21 Aug 2021 17:59:14 GMT (envelope-from git) Date: Sat, 21 Aug 2021 17:59:14 GMT Message-Id: <202108211759.17LHxECd008130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4c6246b76ed9 - stable/13 - tail: Add regression tests for -f and -F MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c6246b76ed951680d6b9491fbb9497160a4ca16 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 17:59:14 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4c6246b76ed951680d6b9491fbb9497160a4ca16 commit 4c6246b76ed951680d6b9491fbb9497160a4ca16 Author: Mark Johnston AuthorDate: 2021-07-05 15:01:41 +0000 Commit: Mark Johnston CommitDate: 2021-08-21 16:18:21 +0000 tail: Add regression tests for -f and -F Sponsored by: The FreeBSD Foundation (cherry picked from commit 58b1a126b98f9d64f30246c90d6c049fd78dda6b) --- usr.bin/tail/tests/tail_test.sh | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/usr.bin/tail/tests/tail_test.sh b/usr.bin/tail/tests/tail_test.sh index 9eecf460d1e5..66d435f2cd02 100755 --- a/usr.bin/tail/tests/tail_test.sh +++ b/usr.bin/tail/tests/tail_test.sh @@ -272,6 +272,85 @@ broken_pipe_body() -x '(tail -n 856 ints; echo exit code: $? >&2) | sleep 2' } +atf_test_case stdin +stdin_head() +{ + atf_set "descr" "Check basic operations on standard input" +} +stdin_body() +{ + seq 1 5 > infile + seq 1 5 > expectfile + seq 5 1 > expectfile_r + + tail < infile > outfile + tail -r < infile > outfile_r + + atf_check cmp expectfile outfile + atf_check cmp expectfile_r outfile_r +} + +atf_test_case follow +follow_head() +{ + atf_set "descr" "Basic regression test for -f" +} +follow_body() +{ + local pid + + seq 1 5 > expectfile + seq 1 3 > infile + tail -f infile > outfile & + pid=$! + sleep 0.1 + seq 4 5 >> infile + sleep 0.1 + atf_check cmp expectfile outfile + atf_check kill $pid +} + +atf_test_case follow_stdin +follow_stdin_head() +{ + atf_set "descr" "Verify that -f works with files piped to standard input" +} +follow_stdin_body() +{ + local pid + + seq 1 5 > expectfile + seq 1 3 > infile + tail -f < infile > outfile & + pid=$! + sleep 0.1 + seq 4 5 >> infile + sleep 0.1 + atf_check cmp expectfile outfile + atf_check kill $pid +} + +atf_test_case follow_rename +follow_rename_head() +{ + atf_set "descr" "Verify that -F works" +} +follow_rename_body() +{ + local pid + + seq 1 5 > expectfile + seq 1 3 > infile + tail -F infile > outfile & + pid=$! + seq 4 5 > infile_new + atf_check mv infile infile_old + atf_check mv infile_new infile + # tail -F polls for a new file every 1s. + sleep 2 + atf_check cmp expectfile outfile + atf_check kill $pid +} atf_init_test_cases() { @@ -289,4 +368,8 @@ atf_init_test_cases() atf_add_test_case longfile_rc145782_longlines atf_add_test_case longfile_rn2500 atf_add_test_case broken_pipe + atf_add_test_case stdin + atf_add_test_case follow + atf_add_test_case follow_stdin + atf_add_test_case follow_rename } From owner-dev-commits-src-all@freebsd.org Sat Aug 21 18:29:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AC0867665D; Sat, 21 Aug 2021 18:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsRqj1nTBz4fMr; Sat, 21 Aug 2021 18:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FACA119F3; Sat, 21 Aug 2021 18:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LITaxT048542; Sat, 21 Aug 2021 18:29:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LITajS048541; Sat, 21 Aug 2021 18:29:36 GMT (envelope-from git) Date: Sat, 21 Aug 2021 18:29:36 GMT Message-Id: <202108211829.17LITajS048541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 7b0d05d56dfa - main - loader: loader_lua can run command_more twice MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b0d05d56dfaad4e1d5a19727e34252072913d17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 18:29:37 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=7b0d05d56dfaad4e1d5a19727e34252072913d17 commit 7b0d05d56dfaad4e1d5a19727e34252072913d17 Author: Toomas Soome AuthorDate: 2021-08-21 18:17:18 +0000 Commit: Toomas Soome CommitDate: 2021-08-21 18:28:54 +0000 loader: loader_lua can run command_more twice When we quit pager, the return value 1 is returned and command_more() interprets it as error. when lua loader gets error from command, it will try to interpret it once more, so we get the same file shown once more. There is no reason why we should return error from command_more(). MFC after: 1 week --- stand/common/commands.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stand/common/commands.c b/stand/common/commands.c index 4c1c9b2b6a86..9f7252014d87 100644 --- a/stand/common/commands.c +++ b/stand/common/commands.c @@ -484,10 +484,7 @@ command_more(int argc, char *argv[]) } pager_close(); - if (res == 0) - return (CMD_OK); - else - return (CMD_ERROR); + return (CMD_OK); } static int From owner-dev-commits-src-all@freebsd.org Sat Aug 21 21:04:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BB0E6783A9; Sat, 21 Aug 2021 21:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsWG213gPz3qLV; Sat, 21 Aug 2021 21:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C3281419A; Sat, 21 Aug 2021 21:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LL4903063483; Sat, 21 Aug 2021 21:04:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LL49cQ063482; Sat, 21 Aug 2021 21:04:09 GMT (envelope-from git) Date: Sat, 21 Aug 2021 21:04:09 GMT Message-Id: <202108212104.17LL49cQ063482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: efa485d5c390 - main - Apply clang fix for assertion failure compiling multimedia/minitube MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efa485d5c390b745f53761da9159721243c48b7b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 21:04:10 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=efa485d5c390b745f53761da9159721243c48b7b commit efa485d5c390b745f53761da9159721243c48b7b Author: Dimitry Andric AuthorDate: 2021-08-21 21:03:37 +0000 Commit: Dimitry Andric CommitDate: 2021-08-21 21:03:50 +0000 Apply clang fix for assertion failure compiling multimedia/minitube Merge commit 79f9cfbc21e0 from llvm git (by Yaxun (Sam) Liu): Do not merge LocalInstantiationScope for template specialization A lambda in a function template may be recursively instantiated. The recursive lambda will cause a lambda function instantiated multiple times, one inside another. The inner LocalInstantiationScope should not be marked as MergeWithParentScope since it already has references to locals properly substituted, otherwise it causes assertion due to the check for duplicate locals in merged LocalInstantiationScope. Reviewed by: Richard Smith Differential Revision: https://reviews.llvm.org/D98068 Reported by: yuri PR: 257978 MFC after: 3 days --- .../llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index dc1e0ef60cac..216a64e02380 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -4841,10 +4841,13 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, // Introduce a new scope where local variable instantiations will be // recorded, unless we're actually a member function within a local // class, in which case we need to merge our results with the parent - // scope (of the enclosing function). + // scope (of the enclosing function). The exception is instantiating + // a function template specialization, since the template to be + // instantiated already has references to locals properly substituted. bool MergeWithParentScope = false; if (CXXRecordDecl *Rec = dyn_cast(Function->getDeclContext())) - MergeWithParentScope = Rec->isLocalClass(); + MergeWithParentScope = + Rec->isLocalClass() && !Function->isFunctionTemplateSpecialization(); LocalInstantiationScope Scope(*this, MergeWithParentScope); From owner-dev-commits-src-all@freebsd.org Sat Aug 21 21:26:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06724678917 for ; Sat, 21 Aug 2021 21:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsWm46f8Kz4Vfd; Sat, 21 Aug 2021 21:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7571145AE; Sat, 21 Aug 2021 21:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LLQi61093564; Sat, 21 Aug 2021 21:26:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LLQijK093562; Sat, 21 Aug 2021 21:26:44 GMT (envelope-from git) Date: Sat, 21 Aug 2021 21:26:44 GMT Message-Id: <202108212126.17LLQijK093562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: a0902ee48684 - Create tag vendor/llvm-project/llvmorg-13.0.0-rc1-0-gd6974c010878 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-13.0.0-rc1-0-gd6974c010878 X-Git-Reftype: annotated tag X-Git-Commit: a0902ee4868460a5a5428808f4eb0f49350040bc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 21:26:45 -0000 The annotated tag vendor/llvm-project/llvmorg-13.0.0-rc1-0-gd6974c010878 has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-13.0.0-rc1-0-gd6974c010878 tag vendor/llvm-project/llvmorg-13.0.0-rc1-0-gd6974c010878 Tagger: Dimitry Andric TaggerDate: 2021-08-21 21:26:14 +0000 Tag llvm-project branch release/13.x llvmorg-13.0.0-rc1-0-gd6974c010878. commit 9cb5bdb8b26e2207293f0fb56701c4a0ff64a47d Author: Dimitry Andric AuthorDate: 2021-08-21 21:25:07 +0000 Commit: Dimitry Andric CommitDate: 2021-08-21 21:25:07 +0000 Vendor import of llvm-project branch release/13.x llvmorg-13.0.0-rc1-0-gd6974c010878. From owner-dev-commits-src-all@freebsd.org Sat Aug 21 21:26:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 063876782CA for ; Sat, 21 Aug 2021 21:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsWm46MD6z4VX3; Sat, 21 Aug 2021 21:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5A341452F; Sat, 21 Aug 2021 21:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LLQibb093539; Sat, 21 Aug 2021 21:26:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LLQiHY093538; Sat, 21 Aug 2021 21:26:44 GMT (envelope-from git) Date: Sat, 21 Aug 2021 21:26:44 GMT Message-Id: <202108212126.17LLQiHY093538@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: fa40418fea35..9cb5bdb8b26e - vendor/llvm-project/release-13.x - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-13.x X-Git-Reftype: branch X-Git-Commit: 9cb5bdb8b26e2207293f0fb56701c4a0ff64a47d X-Git-Oldrev: fa40418fea35c68de2a358bce3539cdc5cbcd21a X-Git-Newrev: 9cb5bdb8b26e2207293f0fb56701c4a0ff64a47d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 21:26:45 -0000 The branch vendor/llvm-project/release-13.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=fa40418fea35..9cb5bdb8b26e 9cb5bdb8b26e Vendor import of llvm-project branch release/13.x llvmorg-13.0.0-rc1-0-gd6974c010878. From owner-dev-commits-src-all@freebsd.org Sat Aug 21 21:28:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E33DA6787B5 for ; Sat, 21 Aug 2021 21:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsWny68jVz4WBt; Sat, 21 Aug 2021 21:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB342145AF; Sat, 21 Aug 2021 21:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LLSM6p093969; Sat, 21 Aug 2021 21:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LLSM69093968; Sat, 21 Aug 2021 21:28:22 GMT (envelope-from git) Date: Sat, 21 Aug 2021 21:28:22 GMT Message-Id: <202108212128.17LLSM69093968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: a4bcf8a8f802 - Create tag vendor/llvm-project/llvmorg-13.0.0-rc1-97-g23ba3732246a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-13.0.0-rc1-97-g23ba3732246a X-Git-Reftype: annotated tag X-Git-Commit: a4bcf8a8f802c1e6c718bc7fda414b2f23802705 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 21:28:23 -0000 The annotated tag vendor/llvm-project/llvmorg-13.0.0-rc1-97-g23ba3732246a has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-13.0.0-rc1-97-g23ba3732246a tag vendor/llvm-project/llvmorg-13.0.0-rc1-97-g23ba3732246a Tagger: Dimitry Andric TaggerDate: 2021-08-21 21:27:51 +0000 Tag llvm-project branch release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a. commit d545c2ce5ad1891282e8818b47ffe557c76a86b4 Author: Dimitry Andric AuthorDate: 2021-08-21 21:27:36 +0000 Commit: Dimitry Andric CommitDate: 2021-08-21 21:27:36 +0000 Vendor import of llvm-project branch release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a. From owner-dev-commits-src-all@freebsd.org Sat Aug 21 21:28:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DEE71678B8E for ; Sat, 21 Aug 2021 21:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsWny5w7Jz4WLZ; Sat, 21 Aug 2021 21:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8CAC1462C; Sat, 21 Aug 2021 21:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17LLSM82093945; Sat, 21 Aug 2021 21:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17LLSMKj093944; Sat, 21 Aug 2021 21:28:22 GMT (envelope-from git) Date: Sat, 21 Aug 2021 21:28:22 GMT Message-Id: <202108212128.17LLSMKj093944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 9cb5bdb8b26e..d545c2ce5ad1 - vendor/llvm-project/release-13.x - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-13.x X-Git-Reftype: branch X-Git-Commit: d545c2ce5ad1891282e8818b47ffe557c76a86b4 X-Git-Oldrev: 9cb5bdb8b26e2207293f0fb56701c4a0ff64a47d X-Git-Newrev: d545c2ce5ad1891282e8818b47ffe557c76a86b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2021 21:28:22 -0000 The branch vendor/llvm-project/release-13.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=9cb5bdb8b26e..d545c2ce5ad1 d545c2ce5ad1 Vendor import of llvm-project branch release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a. From owner-dev-commits-src-all@freebsd.org Sun Aug 22 00:27:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81A0567AE5A; Sun, 22 Aug 2021 00:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gsbmp1rVrz3nfN; Sun, 22 Aug 2021 00:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23F94168DD; Sun, 22 Aug 2021 00:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17M0RcJ0033506; Sun, 22 Aug 2021 00:27:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17M0RcVd033505; Sun, 22 Aug 2021 00:27:38 GMT (envelope-from git) Date: Sun, 22 Aug 2021 00:27:38 GMT Message-Id: <202108220027.17M0RcVd033505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 66e088e12b9f - stable/13 - kbdmux(4): Make callout handler mpsafe. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66e088e12b9fd3a42e5a92a0de79d75a3d4b5cd3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 00:27:38 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=66e088e12b9fd3a42e5a92a0de79d75a3d4b5cd3 commit 66e088e12b9fd3a42e5a92a0de79d75a3d4b5cd3 Author: Alexander Motin AuthorDate: 2021-08-08 22:19:08 +0000 Commit: Alexander Motin CommitDate: 2021-08-22 00:27:25 +0000 kbdmux(4): Make callout handler mpsafe. Both callout and taskqueue now have drain() routines not requiring external locking. It allows to remove TASK flag and manual drain, so the only thing remaining for lock to protect inside the callout handler is ks_inq_length zero comparison, that can be lockless. MFC after: 2 weeks (cherry picked from commit e5018628e76a27e0f61ca03e2aa2247b3c62a158) --- sys/dev/kbdmux/kbdmux.c | 61 ++++++++----------------------------------------- 1 file changed, 10 insertions(+), 51 deletions(-) diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index 409e52c21716..3bbdc78b7c1a 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -105,12 +105,6 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, "Keyboard multiplexor"); mtx_unlock(&(s)->ks_lock) #define KBDMUX_LOCK_ASSERT(s, w) \ mtx_assert(&(s)->ks_lock, (w)) -#define KBDMUX_SLEEP(s, f, d, t) \ - msleep(&(s)->f, &(s)->ks_lock, PCATCH | (PZERO + 1), (d), (t)) -#define KBDMUX_CALLOUT_INIT(s) \ - callout_init_mtx(&(s)->ks_timo, &(s)->ks_lock, 0) -#define KBDMUX_QUEUE_INTR(s) \ - taskqueue_enqueue(taskqueue_swi_giant, &(s)->ks_task) #else #define KBDMUX_LOCK_DECL_GLOBAL @@ -124,12 +118,6 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, "Keyboard multiplexor"); #define KBDMUX_LOCK_ASSERT(s, w) -#define KBDMUX_SLEEP(s, f, d, t) \ - tsleep(&(s)->f, PCATCH | (PZERO + 1), (d), (t)) -#define KBDMUX_CALLOUT_INIT(s) \ - callout_init(&(s)->ks_timo, 0) -#define KBDMUX_QUEUE_INTR(s) \ - taskqueue_enqueue(taskqueue_swi_giant, &(s)->ks_task) #endif /* not yet */ /* @@ -157,7 +145,6 @@ struct kbdmux_state int ks_flags; /* flags */ #define COMPOSE (1 << 0) /* compose char flag */ -#define TASK (1 << 2) /* interrupt task queued */ int ks_polling; /* poll nesting count */ int ks_mode; /* K_XLATE, K_RAW, K_CODE */ @@ -223,16 +210,8 @@ void kbdmux_kbd_intr(void *xkbd, int pending) { keyboard_t *kbd = (keyboard_t *) xkbd; - kbdmux_state_t *state = (kbdmux_state_t *) kbd->kb_data; kbdd_intr(kbd, NULL); - - KBDMUX_LOCK(state); - - state->ks_flags &= ~TASK; - wakeup(&state->ks_task); - - KBDMUX_UNLOCK(state); } /* @@ -243,23 +222,12 @@ kbdmux_kbd_intr_timo(void *xstate) { kbdmux_state_t *state = (kbdmux_state_t *) xstate; - KBDMUX_LOCK_ASSERT(state, MA_OWNED); - - if (callout_pending(&state->ks_timo)) - return; /* callout was reset */ - - if (!callout_active(&state->ks_timo)) - return; /* callout was stopped */ - - callout_deactivate(&state->ks_timo); - /* queue interrupt task if needed */ - if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && - KBDMUX_QUEUE_INTR(state) == 0) - state->ks_flags |= TASK; + if (state->ks_inq_length > 0) + taskqueue_enqueue(taskqueue_swi_giant, &state->ks_task); /* re-schedule timeout */ - callout_reset(&state->ks_timo, TICKS, kbdmux_kbd_intr_timo, state); + callout_schedule(&state->ks_timo, TICKS); } /* @@ -299,9 +267,8 @@ kbdmux_kbd_event(keyboard_t *kbd, int event, void *arg) } /* queue interrupt task if needed */ - if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && - KBDMUX_QUEUE_INTR(state) == 0) - state->ks_flags |= TASK; + if (state->ks_inq_length > 0) + taskqueue_enqueue(taskqueue_swi_giant, &state->ks_task); KBDMUX_UNLOCK(state); } break; @@ -444,7 +411,7 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) KBDMUX_LOCK_INIT(state); TASK_INIT(&state->ks_task, 0, kbdmux_kbd_intr, (void *) kbd); - KBDMUX_CALLOUT_INIT(state); + callout_init(&state->ks_timo, 1); SLIST_INIT(&state->ks_kbds); } else if (KBD_IS_INITIALIZED(*kbdp) && KBD_IS_CONFIGURED(*kbdp)) { return (0); @@ -521,9 +488,7 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) KBD_CONFIG_DONE(kbd); - KBDMUX_LOCK(state); callout_reset(&state->ks_timo, TICKS, kbdmux_kbd_intr_timo, state); - KBDMUX_UNLOCK(state); } return (0); @@ -555,16 +520,8 @@ kbdmux_term(keyboard_t *kbd) kbdmux_state_t *state = (kbdmux_state_t *) kbd->kb_data; kbdmux_kbd_t *k; - KBDMUX_LOCK(state); - - /* kill callout */ - callout_stop(&state->ks_timo); - - /* wait for interrupt task */ - while (state->ks_flags & TASK) - KBDMUX_SLEEP(state, ks_task, "kbdmuxc", 0); - /* release all keyboards from the mux */ + KBDMUX_LOCK(state); while ((k = SLIST_FIRST(&state->ks_kbds)) != NULL) { kbd_release(k->kbd, &k->kbd); SLIST_REMOVE_HEAD(&state->ks_kbds, next); @@ -573,9 +530,11 @@ kbdmux_term(keyboard_t *kbd) free(k, M_KBDMUX); } - KBDMUX_UNLOCK(state); + callout_drain(&state->ks_timo); + taskqueue_drain(taskqueue_swi_giant, &state->ks_task); + kbd_unregister(kbd); #ifdef EVDEV_SUPPORT From owner-dev-commits-src-all@freebsd.org Sun Aug 22 00:29:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94BF067B181; Sun, 22 Aug 2021 00:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gsbpl2MSMz3p2k; Sun, 22 Aug 2021 00:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B6CD16B1D; Sun, 22 Aug 2021 00:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17M0TIhE033733; Sun, 22 Aug 2021 00:29:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17M0TIQK033732; Sun, 22 Aug 2021 00:29:18 GMT (envelope-from git) Date: Sun, 22 Aug 2021 00:29:18 GMT Message-Id: <202108220029.17M0TIQK033732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 0417804260fd - stable/12 - kbdmux(4): Make callout handler mpsafe. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0417804260fd61ab47424632c26532d6ce2fed14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 00:29:19 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=0417804260fd61ab47424632c26532d6ce2fed14 commit 0417804260fd61ab47424632c26532d6ce2fed14 Author: Alexander Motin AuthorDate: 2021-08-08 22:19:08 +0000 Commit: Alexander Motin CommitDate: 2021-08-22 00:27:58 +0000 kbdmux(4): Make callout handler mpsafe. Both callout and taskqueue now have drain() routines not requiring external locking. It allows to remove TASK flag and manual drain, so the only thing remaining for lock to protect inside the callout handler is ks_inq_length zero comparison, that can be lockless. MFC after: 2 weeks (cherry picked from commit e5018628e76a27e0f61ca03e2aa2247b3c62a158) --- sys/dev/kbdmux/kbdmux.c | 61 ++++++++----------------------------------------- 1 file changed, 10 insertions(+), 51 deletions(-) diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index 5c24db23da55..8fb220b898ce 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -105,12 +105,6 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, "Keyboard multiplexor"); mtx_unlock(&(s)->ks_lock) #define KBDMUX_LOCK_ASSERT(s, w) \ mtx_assert(&(s)->ks_lock, (w)) -#define KBDMUX_SLEEP(s, f, d, t) \ - msleep(&(s)->f, &(s)->ks_lock, PCATCH | (PZERO + 1), (d), (t)) -#define KBDMUX_CALLOUT_INIT(s) \ - callout_init_mtx(&(s)->ks_timo, &(s)->ks_lock, 0) -#define KBDMUX_QUEUE_INTR(s) \ - taskqueue_enqueue(taskqueue_swi_giant, &(s)->ks_task) #else #define KBDMUX_LOCK_DECL_GLOBAL @@ -124,12 +118,6 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, "Keyboard multiplexor"); #define KBDMUX_LOCK_ASSERT(s, w) -#define KBDMUX_SLEEP(s, f, d, t) \ - tsleep(&(s)->f, PCATCH | (PZERO + 1), (d), (t)) -#define KBDMUX_CALLOUT_INIT(s) \ - callout_init(&(s)->ks_timo, 0) -#define KBDMUX_QUEUE_INTR(s) \ - taskqueue_enqueue(taskqueue_swi_giant, &(s)->ks_task) #endif /* not yet */ /* @@ -157,7 +145,6 @@ struct kbdmux_state int ks_flags; /* flags */ #define COMPOSE (1 << 0) /* compose char flag */ -#define TASK (1 << 2) /* interrupt task queued */ int ks_polling; /* poll nesting count */ int ks_mode; /* K_XLATE, K_RAW, K_CODE */ @@ -223,16 +210,8 @@ void kbdmux_kbd_intr(void *xkbd, int pending) { keyboard_t *kbd = (keyboard_t *) xkbd; - kbdmux_state_t *state = (kbdmux_state_t *) kbd->kb_data; kbdd_intr(kbd, NULL); - - KBDMUX_LOCK(state); - - state->ks_flags &= ~TASK; - wakeup(&state->ks_task); - - KBDMUX_UNLOCK(state); } /* @@ -243,23 +222,12 @@ kbdmux_kbd_intr_timo(void *xstate) { kbdmux_state_t *state = (kbdmux_state_t *) xstate; - KBDMUX_LOCK_ASSERT(state, MA_OWNED); - - if (callout_pending(&state->ks_timo)) - return; /* callout was reset */ - - if (!callout_active(&state->ks_timo)) - return; /* callout was stopped */ - - callout_deactivate(&state->ks_timo); - /* queue interrupt task if needed */ - if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && - KBDMUX_QUEUE_INTR(state) == 0) - state->ks_flags |= TASK; + if (state->ks_inq_length > 0) + taskqueue_enqueue(taskqueue_swi_giant, &state->ks_task); /* re-schedule timeout */ - callout_reset(&state->ks_timo, TICKS, kbdmux_kbd_intr_timo, state); + callout_schedule(&state->ks_timo, TICKS); } /* @@ -299,9 +267,8 @@ kbdmux_kbd_event(keyboard_t *kbd, int event, void *arg) } /* queue interrupt task if needed */ - if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && - KBDMUX_QUEUE_INTR(state) == 0) - state->ks_flags |= TASK; + if (state->ks_inq_length > 0) + taskqueue_enqueue(taskqueue_swi_giant, &state->ks_task); KBDMUX_UNLOCK(state); } break; @@ -444,7 +411,7 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) KBDMUX_LOCK_INIT(state); TASK_INIT(&state->ks_task, 0, kbdmux_kbd_intr, (void *) kbd); - KBDMUX_CALLOUT_INIT(state); + callout_init(&state->ks_timo, 1); SLIST_INIT(&state->ks_kbds); } else if (KBD_IS_INITIALIZED(*kbdp) && KBD_IS_CONFIGURED(*kbdp)) { return (0); @@ -521,9 +488,7 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) KBD_CONFIG_DONE(kbd); - KBDMUX_LOCK(state); callout_reset(&state->ks_timo, TICKS, kbdmux_kbd_intr_timo, state); - KBDMUX_UNLOCK(state); } return (0); @@ -555,16 +520,8 @@ kbdmux_term(keyboard_t *kbd) kbdmux_state_t *state = (kbdmux_state_t *) kbd->kb_data; kbdmux_kbd_t *k; - KBDMUX_LOCK(state); - - /* kill callout */ - callout_stop(&state->ks_timo); - - /* wait for interrupt task */ - while (state->ks_flags & TASK) - KBDMUX_SLEEP(state, ks_task, "kbdmuxc", 0); - /* release all keyboards from the mux */ + KBDMUX_LOCK(state); while ((k = SLIST_FIRST(&state->ks_kbds)) != NULL) { kbd_release(k->kbd, &k->kbd); SLIST_REMOVE_HEAD(&state->ks_kbds, next); @@ -573,9 +530,11 @@ kbdmux_term(keyboard_t *kbd) free(k, M_KBDMUX); } - KBDMUX_UNLOCK(state); + callout_drain(&state->ks_timo); + taskqueue_drain(taskqueue_swi_giant, &state->ks_task); + kbd_unregister(kbd); #ifdef EVDEV_SUPPORT From owner-dev-commits-src-all@freebsd.org Sun Aug 22 02:32:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC20167C475; Sun, 22 Aug 2021 02:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsfXg4Gkwz3FTM; Sun, 22 Aug 2021 02:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BFE018E4D; Sun, 22 Aug 2021 02:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17M2WJdD005415; Sun, 22 Aug 2021 02:32:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17M2WJCm005414; Sun, 22 Aug 2021 02:32:19 GMT (envelope-from git) Date: Sun, 22 Aug 2021 02:32:19 GMT Message-Id: <202108220232.17M2WJCm005414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Peter Grehan Subject: git: 28e22482279f - stable/13 - arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 28e22482279f43dda9c78f3fec2189630e9b84cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 02:32:19 -0000 The branch stable/13 has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=28e22482279f43dda9c78f3fec2189630e9b84cd commit 28e22482279f43dda9c78f3fec2189630e9b84cd Author: Peter Grehan AuthorDate: 2021-07-25 09:34:14 +0000 Commit: Peter Grehan CommitDate: 2021-08-22 04:17:46 +0000 arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries. This fixes build/run of golang under COMPAT32 emulation. PR: 256897 Reviewed by: andrew, mmel, manu, jhb, cognet, Robert Clausecker Tested by: brd, andrew, Robert Clausecker Relnotes: yes Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31175 (cherry picked from commit bbe80bff7c3549128bd19862eea7899b3def1d7f) --- sys/arm64/arm64/elf32_machdep.c | 5 + sys/arm64/arm64/identcpu.c | 302 ++++++++++++++++++++++++++++++++++++++++ sys/arm64/include/armreg.h | 131 +++++++++++++++++ sys/arm64/include/elf.h | 29 ++++ sys/arm64/include/md_var.h | 4 + 5 files changed, 471 insertions(+) diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index 48d6dc189e3a..3625a4d124da 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -77,6 +77,9 @@ static boolean_t elf32_arm_abi_supported(struct image_params *, int32_t *, extern void freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); +u_long __read_frequently elf32_hwcap; +u_long __read_frequently elf32_hwcap2; + static struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, @@ -109,6 +112,8 @@ static struct sysentvec elf32_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_hwcap = &elf32_hwcap, + .sv_hwcap2 = &elf32_hwcap2, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, }; diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 6395b3e0f08a..522526b92307 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -50,6 +50,10 @@ __FBSDID("$FreeBSD$"); static void print_cpu_features(u_int cpu); static u_long parse_cpu_features_hwcap(void); static u_long parse_cpu_features_hwcap2(void); +#ifdef COMPAT_FREEBSD32 +static u_long parse_cpu_features_hwcap32(void); +static u_long parse_cpu_features_hwcap32_2(void); +#endif char machine[] = "arm64"; @@ -135,6 +139,11 @@ struct cpu_desc { uint64_t id_aa64pfr0; uint64_t id_aa64pfr1; uint64_t ctr; +#ifdef COMPAT_FREEBSD32 + uint64_t id_isar5; + uint64_t mvfr0; + uint64_t mvfr1; +#endif }; static struct cpu_desc cpu_desc[MAXCPU]; @@ -152,6 +161,11 @@ static u_int cpu_print_regs; #define PRINT_ID_AA64_MMFR2 0x00004000 #define PRINT_ID_AA64_PFR0 0x00010000 #define PRINT_ID_AA64_PFR1 0x00020000 +#ifdef COMPAT_FREEBSD32 +#define PRINT_ID_ISAR5 0x01000000 +#define PRINT_MVFR0 0x02000000 +#define PRINT_MVFR1 0x04000000 +#endif #define PRINT_CTR_EL0 0x10000000 struct cpu_parts { @@ -987,6 +1001,167 @@ static struct mrs_field id_aa64pfr1_fields[] = { MRS_FIELD_END, }; +#ifdef COMPAT_FREEBSD32 +/* ID_ISAR5_EL1 */ +static struct mrs_field_value id_isar5_vcma[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, VCMA, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_rdm[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, RDM, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_crc32[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, CRC32, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_sha2[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SHA2, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_sha1[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SHA1, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_aes[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, AES, NONE, BASE), + MRS_FIELD_VALUE(ID_ISAR5_AES_VMULL, "AES+VMULL"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_sevl[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SEVL, NOP, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field id_isar5_fields[] = { + MRS_FIELD(ID_ISAR5, VCMA, false, MRS_LOWER, id_isar5_vcma), + MRS_FIELD(ID_ISAR5, RDM, false, MRS_LOWER, id_isar5_rdm), + MRS_FIELD(ID_ISAR5, CRC32, false, MRS_LOWER, id_isar5_crc32), + MRS_FIELD(ID_ISAR5, SHA2, false, MRS_LOWER, id_isar5_sha2), + MRS_FIELD(ID_ISAR5, SHA1, false, MRS_LOWER, id_isar5_sha1), + MRS_FIELD(ID_ISAR5, AES, false, MRS_LOWER, id_isar5_aes), + MRS_FIELD(ID_ISAR5, SEVL, false, MRS_LOWER, id_isar5_sevl), + MRS_FIELD_END, +}; + +/* MVFR0 */ +static struct mrs_field_value mvfr0_fpround[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR0, FPRound, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fpsqrt[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR0, FPSqrt, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fpdivide[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR0, FPDivide, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fptrap[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR0, FPTrap, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fpdp[] = { + MRS_FIELD_VALUE(MVFR0_FPDP_NONE, ""), + MRS_FIELD_VALUE(MVFR0_FPDP_VFP_v2, "DP VFPv2"), + MRS_FIELD_VALUE(MVFR0_FPDP_VFP_v3_v4, "DP VFPv3+v4"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fpsp[] = { + MRS_FIELD_VALUE(MVFR0_FPSP_NONE, ""), + MRS_FIELD_VALUE(MVFR0_FPSP_VFP_v2, "SP VFPv2"), + MRS_FIELD_VALUE(MVFR0_FPSP_VFP_v3_v4, "SP VFPv3+v4"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_simdreg[] = { + MRS_FIELD_VALUE(MVFR0_SIMDReg_NONE, ""), + MRS_FIELD_VALUE(MVFR0_SIMDReg_FP, "FP 16x64"), + MRS_FIELD_VALUE(MVFR0_SIMDReg_AdvSIMD, "AdvSIMD"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field mvfr0_fields[] = { + MRS_FIELD(MVFR0, FPRound, false, MRS_LOWER, mvfr0_fpround), + MRS_FIELD(MVFR0, FPSqrt, false, MRS_LOWER, mvfr0_fpsqrt), + MRS_FIELD(MVFR0, FPDivide, false, MRS_LOWER, mvfr0_fpdivide), + MRS_FIELD(MVFR0, FPTrap, false, MRS_LOWER, mvfr0_fptrap), + MRS_FIELD(MVFR0, FPDP, false, MRS_LOWER, mvfr0_fpdp), + MRS_FIELD(MVFR0, FPSP, false, MRS_LOWER, mvfr0_fpsp), + MRS_FIELD(MVFR0, SIMDReg, false, MRS_LOWER, mvfr0_simdreg), + MRS_FIELD_END, +}; + +/* MVFR1 */ +static struct mrs_field_value mvfr1_simdfmac[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, SIMDFMAC, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_fphp[] = { + MRS_FIELD_VALUE(MVFR1_FPHP_NONE, ""), + MRS_FIELD_VALUE(MVFR1_FPHP_CONV_SP, "FPHP SP Conv"), + MRS_FIELD_VALUE(MVFR1_FPHP_CONV_DP, "FPHP DP Conv"), + MRS_FIELD_VALUE(MVFR1_FPHP_ARITH, "FPHP Arith"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_simdhp[] = { + MRS_FIELD_VALUE(MVFR1_SIMDHP_NONE, ""), + MRS_FIELD_VALUE(MVFR1_SIMDHP_CONV_SP, "SIMDHP SP Conv"), + MRS_FIELD_VALUE(MVFR1_SIMDHP_ARITH, "SIMDHP Arith"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_simdsp[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, SIMDSP, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_simdint[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, SIMDInt, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_simdls[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, SIMDLS, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_fpdnan[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, FPDNaN, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_fpftz[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, FPFtZ, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field mvfr1_fields[] = { + MRS_FIELD(MVFR1, SIMDFMAC, false, MRS_LOWER, mvfr1_simdfmac), + MRS_FIELD(MVFR1, FPHP, false, MRS_LOWER, mvfr1_fphp), + MRS_FIELD(MVFR1, SIMDHP, false, MRS_LOWER, mvfr1_simdhp), + MRS_FIELD(MVFR1, SIMDSP, false, MRS_LOWER, mvfr1_simdsp), + MRS_FIELD(MVFR1, SIMDInt, false, MRS_LOWER, mvfr1_simdint), + MRS_FIELD(MVFR1, SIMDLS, false, MRS_LOWER, mvfr1_simdls), + MRS_FIELD(MVFR1, FPDNaN, false, MRS_LOWER, mvfr1_fpdnan), + MRS_FIELD(MVFR1, FPFtZ, false, MRS_LOWER, mvfr1_fpftz), + MRS_FIELD_END, +}; +#endif /* COMPAT_FREEBSD32 */ + struct mrs_user_reg { u_int reg; u_int CRm; @@ -1038,6 +1213,32 @@ static struct mrs_user_reg user_regs[] = { .offset = __offsetof(struct cpu_desc, id_aa64mmfr0), .fields = id_aa64mmfr0_fields, }, +#ifdef COMPAT_FREEBSD32 + { + /* id_isar5_el1 */ + .reg = ID_ISAR5_EL1, + .CRm = 2, + .Op2 = 5, + .offset = __offsetof(struct cpu_desc, id_isar5), + .fields = id_isar5_fields, + }, + { + /* mvfr0 */ + .reg = MVFR0_EL1, + .CRm = 3, + .Op2 = 0, + .offset = __offsetof(struct cpu_desc, mvfr0), + .fields = mvfr0_fields, + }, + { + /* mvfr1 */ + .reg = MVFR1_EL1, + .CRm = 3, + .Op2 = 1, + .offset = __offsetof(struct cpu_desc, mvfr1), + .fields = mvfr1_fields, + }, +#endif /* COMPAT_FREEBSD32 */ }; #define CPU_DESC_FIELD(desc, idx) \ @@ -1272,6 +1473,12 @@ identify_cpu_sysinit(void *dummy __unused) elf_hwcap = parse_cpu_features_hwcap(); elf_hwcap2 = parse_cpu_features_hwcap2(); +#ifdef COMPAT_FREEBSD32 + /* 32-bit ARM versions of AT_HWCAP/HWCAP2 */ + elf32_hwcap = parse_cpu_features_hwcap32(); + elf32_hwcap2 = parse_cpu_features_hwcap32_2(); +#endif + if (dic && idc) { arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range; if (bootverbose) @@ -1483,6 +1690,66 @@ parse_cpu_features_hwcap2(void) return (hwcap2); } +#ifdef COMPAT_FREEBSD32 +static u_long +parse_cpu_features_hwcap32(void) +{ + u_long hwcap = HWCAP32_DEFAULT; + + if (MVFR0_FPDP_VAL(user_cpu_desc.mvfr0) >= + MVFR0_FPDP_VFP_v2) { + hwcap |= HWCAP32_VFP; + + if (MVFR0_FPDP_VAL(user_cpu_desc.mvfr0) == + MVFR0_FPDP_VFP_v3_v4) { + hwcap |= HWCAP32_VFPv3; + + if (MVFR1_SIMDFMAC_VAL(user_cpu_desc.mvfr1) == + MVFR1_SIMDFMAC_IMPL) + hwcap |= HWCAP32_VFPv4; + } + } + + if ((MVFR1_SIMDLS_VAL(user_cpu_desc.mvfr1) == + MVFR1_SIMDLS_IMPL) && + (MVFR1_SIMDInt_VAL(user_cpu_desc.mvfr1) == + MVFR1_SIMDInt_IMPL) && + (MVFR1_SIMDSP_VAL(user_cpu_desc.mvfr1) == + MVFR1_SIMDSP_IMPL)) + hwcap |= HWCAP32_NEON; + + return (hwcap); +} + +static u_long +parse_cpu_features_hwcap32_2(void) +{ + u_long hwcap2 = 0; + + if (ID_ISAR5_AES_VAL(user_cpu_desc.id_isar5) >= + ID_ISAR5_AES_BASE) + hwcap2 |= HWCAP32_2_AES; + + if (ID_ISAR5_AES_VAL(user_cpu_desc.id_isar5) == + ID_ISAR5_AES_VMULL) + hwcap2 |= HWCAP32_2_PMULL; + + if (ID_ISAR5_SHA1_VAL(user_cpu_desc.id_isar5) == + ID_ISAR5_SHA1_IMPL) + hwcap2 |= HWCAP32_2_SHA1; + + if (ID_ISAR5_SHA2_VAL(user_cpu_desc.id_isar5) == + ID_ISAR5_SHA2_IMPL) + hwcap2 |= HWCAP32_2_SHA2; + + if (ID_ISAR5_CRC32_VAL(user_cpu_desc.id_isar5) == + ID_ISAR5_CRC32_IMPL) + hwcap2 |= HWCAP32_2_CRC32; + + return (hwcap2); +} +#endif /* COMPAT_FREEBSD32 */ + static void print_ctr_fields(struct sbuf *sb, uint64_t reg, void *arg) { @@ -1696,6 +1963,23 @@ print_cpu_features(u_int cpu) print_id_register(sb, "Auxiliary Features 1", cpu_desc[cpu].id_aa64afr1, id_aa64afr1_fields); +#ifdef COMPAT_FREEBSD32 + /* AArch32 Instruction Set Attribute Register 5 */ + if (cpu == 0 || (cpu_print_regs & PRINT_ID_ISAR5) != 0) + print_id_register(sb, "AArch32 Instruction Set Attributes 5", + cpu_desc[cpu].id_isar5, id_isar5_fields); + + /* AArch32 Media and VFP Feature Register 0 */ + if (cpu == 0 || (cpu_print_regs & PRINT_MVFR0) != 0) + print_id_register(sb, "AArch32 Media and VFP Features 0", + cpu_desc[cpu].mvfr0, mvfr0_fields); + + /* AArch32 Media and VFP Feature Register 1 */ + if (cpu == 0 || (cpu_print_regs & PRINT_MVFR1) != 0) + print_id_register(sb, "AArch32 Media and VFP Features 1", + cpu_desc[cpu].mvfr1, mvfr1_fields); +#endif + sbuf_delete(sb); sb = NULL; #undef SEP_STR @@ -1795,6 +2079,15 @@ identify_cpu(u_int cpu) cpu_desc[cpu].id_aa64mmfr2 = READ_SPECIALREG(id_aa64mmfr2_el1); cpu_desc[cpu].id_aa64pfr0 = READ_SPECIALREG(id_aa64pfr0_el1); cpu_desc[cpu].id_aa64pfr1 = READ_SPECIALREG(id_aa64pfr1_el1); +#ifdef COMPAT_FREEBSD32 + /* Only read aarch32 SRs if EL0-32 is available */ + if (ID_AA64PFR0_EL0_VAL(cpu_desc[cpu].id_aa64pfr0) == + ID_AA64PFR0_EL0_64_32) { + cpu_desc[cpu].id_isar5 = READ_SPECIALREG(id_isar5_el1); + cpu_desc[cpu].mvfr0 = READ_SPECIALREG(mvfr0_el1); + cpu_desc[cpu].mvfr1 = READ_SPECIALREG(mvfr1_el1); + } +#endif } static void @@ -1859,4 +2152,13 @@ check_cpu_regs(u_int cpu) identify_cache(cpu_desc[cpu].ctr); cpu_print_regs |= PRINT_CTR_EL0; } + +#ifdef COMPAT_FREEBSD32 + if (cpu_desc[cpu].id_isar5 != cpu_desc[0].id_isar5) + cpu_print_regs |= PRINT_ID_ISAR5; + if (cpu_desc[cpu].mvfr0 != cpu_desc[0].mvfr0) + cpu_print_regs |= PRINT_MVFR0; + if (cpu_desc[cpu].mvfr1 != cpu_desc[0].mvfr1) + cpu_print_regs |= PRINT_MVFR1; +#endif } diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 9521b0826064..60389f4171ef 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -771,6 +771,45 @@ #define ID_AA64PFR1_RAS_frac_V1 (UL(0x0) << ID_AA64PFR1_RAS_frac_SHIFT) #define ID_AA64PFR1_RAS_frac_V2 (UL(0x1) << ID_AA64PFR1_RAS_frac_SHIFT) +/* ID_ISAR5_EL1 */ +#define ID_ISAR5_EL1 MRS_REG(3, 0, 0, 2, 5) +#define ID_ISAR5_SEVL_SHIFT 0 +#define ID_ISAR5_SEVL_MASK (UL(0xf) << ID_ISAR5_SEVL_SHIFT) +#define ID_ISAR5_SEVL_VAL(x) ((x) & ID_ISAR5_SEVL_MASK) +#define ID_ISAR5_SEVL_NOP (UL(0x0) << ID_ISAR5_SEVL_SHIFT) +#define ID_ISAR5_SEVL_IMPL (UL(0x1) << ID_ISAR5_SEVL_SHIFT) +#define ID_ISAR5_AES_SHIFT 4 +#define ID_ISAR5_AES_MASK (UL(0xf) << ID_ISAR5_AES_SHIFT) +#define ID_ISAR5_AES_VAL(x) ((x) & ID_ISAR5_AES_MASK) +#define ID_ISAR5_AES_NONE (UL(0x0) << ID_ISAR5_AES_SHIFT) +#define ID_ISAR5_AES_BASE (UL(0x1) << ID_ISAR5_AES_SHIFT) +#define ID_ISAR5_AES_VMULL (UL(0x2) << ID_ISAR5_AES_SHIFT) +#define ID_ISAR5_SHA1_SHIFT 8 +#define ID_ISAR5_SHA1_MASK (UL(0xf) << ID_ISAR5_SHA1_SHIFT) +#define ID_ISAR5_SHA1_VAL(x) ((x) & ID_ISAR5_SHA1_MASK) +#define ID_ISAR5_SHA1_NONE (UL(0x0) << ID_ISAR5_SHA1_SHIFT) +#define ID_ISAR5_SHA1_IMPL (UL(0x1) << ID_ISAR5_SHA1_SHIFT) +#define ID_ISAR5_SHA2_SHIFT 12 +#define ID_ISAR5_SHA2_MASK (UL(0xf) << ID_ISAR5_SHA2_SHIFT) +#define ID_ISAR5_SHA2_VAL(x) ((x) & ID_ISAR5_SHA2_MASK) +#define ID_ISAR5_SHA2_NONE (UL(0x0) << ID_ISAR5_SHA2_SHIFT) +#define ID_ISAR5_SHA2_IMPL (UL(0x1) << ID_ISAR5_SHA2_SHIFT) +#define ID_ISAR5_CRC32_SHIFT 16 +#define ID_ISAR5_CRC32_MASK (UL(0xf) << ID_ISAR5_CRC32_SHIFT) +#define ID_ISAR5_CRC32_VAL(x) ((x) & ID_ISAR5_CRC32_MASK) +#define ID_ISAR5_CRC32_NONE (UL(0x0) << ID_ISAR5_CRC32_SHIFT) +#define ID_ISAR5_CRC32_IMPL (UL(0x1) << ID_ISAR5_CRC32_SHIFT) +#define ID_ISAR5_RDM_SHIFT 24 +#define ID_ISAR5_RDM_MASK (UL(0xf) << ID_ISAR5_RDM_SHIFT) +#define ID_ISAR5_RDM_VAL(x) ((x) & ID_ISAR5_RDM_MASK) +#define ID_ISAR5_RDM_NONE (UL(0x0) << ID_ISAR5_RDM_SHIFT) +#define ID_ISAR5_RDM_IMPL (UL(0x1) << ID_ISAR5_RDM_SHIFT) +#define ID_ISAR5_VCMA_SHIFT 28 +#define ID_ISAR5_VCMA_MASK (UL(0xf) << ID_ISAR5_VCMA_SHIFT) +#define ID_ISAR5_VCMA_VAL(x) ((x) & ID_ISAR5_VCMA_MASK) +#define ID_ISAR5_VCMA_NONE (UL(0x0) << ID_ISAR5_VCMA_SHIFT) +#define ID_ISAR5_VCMA_IMPL (UL(0x1) << ID_ISAR5_VCMA_SHIFT) + /* MAIR_EL1 - Memory Attribute Indirection Register */ #define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) #define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8)) @@ -779,6 +818,98 @@ #define MAIR_NORMAL_WT 0xbb #define MAIR_NORMAL_WB 0xff +/* MVFR0_EL1 */ +#define MVFR0_EL1 MRS_REG(3, 0, 0, 3, 0) +#define MVFR0_SIMDReg_SHIFT 0 +#define MVFR0_SIMDReg_MASK (UL(0xf) << MVFR0_SIMDReg_SHIFT) +#define MVFR0_SIMDReg_VAL(x) ((x) & MVFR0_SIMDReg_MASK) +#define MVFR0_SIMDReg_NONE (UL(0x0) << MVFR0_SIMDReg_SHIFT) +#define MVFR0_SIMDReg_FP (UL(0x1) << MVFR0_SIMDReg_SHIFT) +#define MVFR0_SIMDReg_AdvSIMD (UL(0x2) << MVFR0_SIMDReg_SHIFT) +#define MVFR0_FPSP_SHIFT 4 +#define MVFR0_FPSP_MASK (UL(0xf) << MVFR0_FPSP_SHIFT) +#define MVFR0_FPSP_VAL(x) ((x) & MVFR0_FPSP_MASK) +#define MVFR0_FPSP_NONE (UL(0x0) << MVFR0_FPSP_SHIFT) +#define MVFR0_FPSP_VFP_v2 (UL(0x1) << MVFR0_FPSP_SHIFT) +#define MVFR0_FPSP_VFP_v3_v4 (UL(0x2) << MVFR0_FPSP_SHIFT) +#define MVFR0_FPDP_SHIFT 8 +#define MVFR0_FPDP_MASK (UL(0xf) << MVFR0_FPDP_SHIFT) +#define MVFR0_FPDP_VAL(x) ((x) & MVFR0_FPDP_MASK) +#define MVFR0_FPDP_NONE (UL(0x0) << MVFR0_FPDP_SHIFT) +#define MVFR0_FPDP_VFP_v2 (UL(0x1) << MVFR0_FPDP_SHIFT) +#define MVFR0_FPDP_VFP_v3_v4 (UL(0x2) << MVFR0_FPDP_SHIFT) +#define MVFR0_FPTrap_SHIFT 12 +#define MVFR0_FPTrap_MASK (UL(0xf) << MVFR0_FPTrap_SHIFT) +#define MVFR0_FPTrap_VAL(x) ((x) & MVFR0_FPTrap_MASK) +#define MVFR0_FPTrap_NONE (UL(0x0) << MVFR0_FPTrap_SHIFT) +#define MVFR0_FPTrap_IMPL (UL(0x1) << MVFR0_FPTrap_SHIFT) +#define MVFR0_FPDivide_SHIFT 16 +#define MVFR0_FPDivide_MASK (UL(0xf) << MVFR0_FPDivide_SHIFT) +#define MVFR0_FPDivide_VAL(x) ((x) & MVFR0_FPDivide_MASK) +#define MVFR0_FPDivide_NONE (UL(0x0) << MVFR0_FPDivide_SHIFT) +#define MVFR0_FPDivide_IMPL (UL(0x1) << MVFR0_FPDivide_SHIFT) +#define MVFR0_FPSqrt_SHIFT 20 +#define MVFR0_FPSqrt_MASK (UL(0xf) << MVFR0_FPSqrt_SHIFT) +#define MVFR0_FPSqrt_VAL(x) ((x) & MVFR0_FPSqrt_MASK) +#define MVFR0_FPSqrt_NONE (UL(0x0) << MVFR0_FPSqrt_SHIFT) +#define MVFR0_FPSqrt_IMPL (UL(0x1) << MVFR0_FPSqrt_SHIFT) +#define MVFR0_FPShVec_SHIFT 24 +#define MVFR0_FPShVec_MASK (UL(0xf) << MVFR0_FPShVec_SHIFT) +#define MVFR0_FPShVec_VAL(x) ((x) & MVFR0_FPShVec_MASK) +#define MVFR0_FPShVec_NONE (UL(0x0) << MVFR0_FPShVec_SHIFT) +#define MVFR0_FPShVec_IMPL (UL(0x1) << MVFR0_FPShVec_SHIFT) +#define MVFR0_FPRound_SHIFT 28 +#define MVFR0_FPRound_MASK (UL(0xf) << MVFR0_FPRound_SHIFT) +#define MVFR0_FPRound_VAL(x) ((x) & MVFR0_FPRound_MASK) +#define MVFR0_FPRound_NONE (UL(0x0) << MVFR0_FPRound_SHIFT) +#define MVFR0_FPRound_IMPL (UL(0x1) << MVFR0_FPRound_SHIFT) + +/* MVFR1_EL1 */ +#define MVFR1_EL1 MRS_REG(3, 0, 0, 3, 1) +#define MVFR1_FPFtZ_SHIFT 0 +#define MVFR1_FPFtZ_MASK (UL(0xf) << MVFR1_FPFtZ_SHIFT) +#define MVFR1_FPFtZ_VAL(x) ((x) & MVFR1_FPFtZ_MASK) +#define MVFR1_FPFtZ_NONE (UL(0x0) << MVFR1_FPFtZ_SHIFT) +#define MVFR1_FPFtZ_IMPL (UL(0x1) << MVFR1_FPFtZ_SHIFT) +#define MVFR1_FPDNaN_SHIFT 4 +#define MVFR1_FPDNaN_MASK (UL(0xf) << MVFR1_FPDNaN_SHIFT) +#define MVFR1_FPDNaN_VAL(x) ((x) & MVFR1_FPDNaN_MASK) +#define MVFR1_FPDNaN_NONE (UL(0x0) << MVFR1_FPDNaN_SHIFT) +#define MVFR1_FPDNaN_IMPL (UL(0x1) << MVFR1_FPDNaN_SHIFT) +#define MVFR1_SIMDLS_SHIFT 8 +#define MVFR1_SIMDLS_MASK (UL(0xf) << MVFR1_SIMDLS_SHIFT) +#define MVFR1_SIMDLS_VAL(x) ((x) & MVFR1_SIMDLS_MASK) +#define MVFR1_SIMDLS_NONE (UL(0x0) << MVFR1_SIMDLS_SHIFT) +#define MVFR1_SIMDLS_IMPL (UL(0x1) << MVFR1_SIMDLS_SHIFT) +#define MVFR1_SIMDInt_SHIFT 12 +#define MVFR1_SIMDInt_MASK (UL(0xf) << MVFR1_SIMDInt_SHIFT) +#define MVFR1_SIMDInt_VAL(x) ((x) & MVFR1_SIMDInt_MASK) +#define MVFR1_SIMDInt_NONE (UL(0x0) << MVFR1_SIMDInt_SHIFT) +#define MVFR1_SIMDInt_IMPL (UL(0x1) << MVFR1_SIMDInt_SHIFT) +#define MVFR1_SIMDSP_SHIFT 16 +#define MVFR1_SIMDSP_MASK (UL(0xf) << MVFR1_SIMDSP_SHIFT) +#define MVFR1_SIMDSP_VAL(x) ((x) & MVFR1_SIMDSP_MASK) +#define MVFR1_SIMDSP_NONE (UL(0x0) << MVFR1_SIMDSP_SHIFT) +#define MVFR1_SIMDSP_IMPL (UL(0x1) << MVFR1_SIMDSP_SHIFT) +#define MVFR1_SIMDHP_SHIFT 20 +#define MVFR1_SIMDHP_MASK (UL(0xf) << MVFR1_SIMDHP_SHIFT) +#define MVFR1_SIMDHP_VAL(x) ((x) & MVFR1_SIMDHP_MASK) +#define MVFR1_SIMDHP_NONE (UL(0x0) << MVFR1_SIMDHP_SHIFT) +#define MVFR1_SIMDHP_CONV_SP (UL(0x1) << MVFR1_SIMDHP_SHIFT) +#define MVFR1_SIMDHP_ARITH (UL(0x2) << MVFR1_SIMDHP_SHIFT) +#define MVFR1_FPHP_SHIFT 24 +#define MVFR1_FPHP_MASK (UL(0xf) << MVFR1_FPHP_SHIFT) +#define MVFR1_FPHP_VAL(x) ((x) & MVFR1_FPHP_MASK) +#define MVFR1_FPHP_NONE (UL(0x0) << MVFR1_FPHP_SHIFT) +#define MVFR1_FPHP_CONV_SP (UL(0x1) << MVFR1_FPHP_SHIFT) +#define MVFR1_FPHP_CONV_DP (UL(0x2) << MVFR1_FPHP_SHIFT) +#define MVFR1_FPHP_ARITH (UL(0x3) << MVFR1_FPHP_SHIFT) +#define MVFR1_SIMDFMAC_SHIFT 28 +#define MVFR1_SIMDFMAC_MASK (UL(0xf) << MVFR1_SIMDFMAC_SHIFT) +#define MVFR1_SIMDFMAC_VAL(x) ((x) & MVFR1_SIMDFMAC_MASK) +#define MVFR1_SIMDFMAC_NONE (UL(0x0) << MVFR1_SIMDFMAC_SHIFT) +#define MVFR1_SIMDFMAC_IMPL (UL(0x1) << MVFR1_SIMDFMAC_SHIFT) + /* PAR_EL1 - Physical Address Register */ #define PAR_F_SHIFT 0 #define PAR_F (0x1 << PAR_F_SHIFT) diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h index bed84e6c755a..3f7c3964d428 100644 --- a/sys/arm64/include/elf.h +++ b/sys/arm64/include/elf.h @@ -150,4 +150,33 @@ __ElfType(Auxinfo); #define HWCAP2_RNG 0x00010000 #define HWCAP2_BTI 0x00020000 +#ifdef COMPAT_FREEBSD32 +/* ARM HWCAP */ +#define HWCAP32_HALF 0x00000002 /* Always set. */ +#define HWCAP32_THUMB 0x00000004 /* Always set. */ +#define HWCAP32_FAST_MULT 0x00000010 /* Always set. */ +#define HWCAP32_VFP 0x00000040 +#define HWCAP32_EDSP 0x00000080 /* Always set. */ +#define HWCAP32_NEON 0x00001000 +#define HWCAP32_VFPv3 0x00002000 +#define HWCAP32_TLS 0x00008000 /* Always set. */ +#define HWCAP32_VFPv4 0x00010000 +#define HWCAP32_IDIVA 0x00020000 /* Always set. */ +#define HWCAP32_IDIVT 0x00040000 /* Always set. */ +#define HWCAP32_VFPD32 0x00080000 /* Always set. */ +#define HWCAP32_LPAE 0x00100000 /* Always set. */ + +#define HWCAP32_DEFAULT \ + (HWCAP32_HALF | HWCAP32_THUMB | HWCAP32_FAST_MULT | HWCAP32_EDSP |\ + HWCAP32_TLS | HWCAP32_IDIVA | HWCAP32_IDIVT | HWCAP32_VFPD32 | \ + HWCAP32_LPAE) + +/* ARM HWCAP2 */ +#define HWCAP32_2_AES 0x00000001 +#define HWCAP32_2_PMULL 0x00000002 +#define HWCAP32_2_SHA1 0x00000004 +#define HWCAP32_2_SHA2 0x00000008 +#define HWCAP32_2_CRC32 0x00000010 +#endif + #endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index 73cf642148b5..beaea0f8e719 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -38,6 +38,10 @@ extern char sigcode[]; extern int szsigcode; extern u_long elf_hwcap; extern u_long elf_hwcap2; +#ifdef COMPAT_FREEBSD32 +extern u_long elf32_hwcap; +extern u_long elf32_hwcap2; +#endif struct dumperinfo; From owner-dev-commits-src-all@freebsd.org Sun Aug 22 05:58:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F224F67ED4A; Sun, 22 Aug 2021 05:58:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gsl6F55jLz4t8X; Sun, 22 Aug 2021 05:58:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id HQWpms2h7FRDpHgUnmCs1q; Sun, 22 Aug 2021 05:58:13 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id HgUlmmWShB9dPHgUmmKIIh; Sun, 22 Aug 2021 05:58:13 +0000 X-Authority-Analysis: v=2.4 cv=Ac10o1bG c=1 sm=1 tr=0 ts=6121e775 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=MhDmnRu9jo8A:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=_4LdrX-sCBZswC-hWvYA:9 a=WcX1nqYDLv0r7bjD:21 a=vqf2npe_uwhkvVT2:21 a=0wDwsOqeTLLA_pT6:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id B284213D; Sat, 21 Aug 2021 22:58:10 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 17M5wAuq003114; Sat, 21 Aug 2021 22:58:10 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202108220558.17M5wAuq003114@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Alexander V. Chernikov" cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c541bd368f86 - main - lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries. In-reply-to: <202108211735.17LHZ0WI081502@gitrepo.freebsd.org> References: <202108211735.17LHZ0WI081502@gitrepo.freebsd.org> Comments: In-reply-to "Alexander V. Chernikov" message dated "Sat, 21 Aug 2021 17:35:00 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 21 Aug 2021 22:58:10 -0700 X-CMAE-Envelope: MS4xfPJdHvbUQRPnlpIQQgrVEr9o12cFQDU0yZtWyUN4HHXE2hgpMrXRA1n6YrLNmtmctdiDrO9nbrzfI21Zdi6MLvvY3+kWSrC4ohkO6iW+wIQKxhNUpi9Y YhojGI6+X5+r22ITODbXM+6uSKx7GteL9/Osoz/oN4UeM6kMxeAa8qWhhc7HmrwWI2iUCfV5bwJcJzs3ptlVeNju2CRX78+u3yiZ7wSVU90Sxga4jp8D/Noc wQol1zmEBY18RmYJ+w7lWokD4g99TZVH1XnXrwLCo9H2V+Ro+hvcZgIGdKxpSWM1JVxp0PQB7d4Y1mXNueav0kiP7wh4puT2lu1DSJPs5HI= X-Rspamd-Queue-Id: 4Gsl6F55jLz4t8X X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 05:58:14 -0000 In message <202108211735.17LHZ0WI081502@gitrepo.freebsd.org>, "Alexander V. Che rnikov" writes: > The branch main has been updated by melifaro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c541bd368f863bbf5c08dd5c1ecce016 > 6ad47389 > > commit c541bd368f863bbf5c08dd5c1ecce0166ad47389 > Author: Alexander V. Chernikov > AuthorDate: 2021-08-21 14:13:32 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2021-08-21 17:34:35 +0000 > > lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries > . > > Currently we use pre-calculated headers inside LLE entries as prepend dat > a > for `if_output` functions. Using these headers allows saving some > CPU cycles/memory accesses on the fast path. > > However, this approach makes adding L2 header for IPv4 traffic with IPv6 > nexthops more complex, as it is not possible to store multiple > pre-calculated headers inside lle. Additionally, the solution space is > limited by the fact that PCB caching saves LLEs in addition to the nexth > op. > > Thus, add support for creating special "child" LLEs for the purpose of ho > lding > custom family encaps and store mbufs pending resolution. To simplify han > dling > of those LLEs, store them in a linked-list inside a "parent" (e.g. norma > l) LLE. > Such LLEs are not visible when iterating LLE table. Their lifecycle is b > ound > to the "parent" LLE - it is not possible to delete "child" when parent i > s alive. > Furthermore, "child" LLEs are static (RTF_STATIC), avoding complex state > machine used by the standard LLEs. > > nd6_lookup() and nd6_resolve() now accepts an additional argument, family > , > allowing to return such child LLEs. This change uses `LLE_SF()` macro wh > ich > packs family and flags in a single int field. This is done to simplify m > erging > back to stable/. Once this code lands, most of the cases will be convert > ed to > use a dedicated `family` parameter. > > Differential Revision: https://reviews.freebsd.org/D31379 > MFC after: 2 weeks > --- > sys/net/if_ethersubr.c | 4 +- > sys/net/if_fwsubr.c | 4 +- > sys/net/if_infiniband.c | 3 +- > sys/net/if_llatbl.c | 70 +++++++++++- > sys/net/if_llatbl.h | 12 +- > sys/netinet/toecore.c | 2 +- > sys/netinet6/icmp6.c | 2 +- > sys/netinet6/in6.c | 5 + > sys/netinet6/nd6.c | 176 +++++++++++++++++++++++---- > -- > sys/netinet6/nd6.h | 1 + > sys/netinet6/nd6_nbr.c | 6 +- > sys/ofed/drivers/infiniband/core/ib_addr.c | 5 +- > 12 files changed, 241 insertions(+), 49 deletions(-) This commit causes two of my machines a bit of gas. Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x128 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff806cb53d stack pointer = 0x28:0xfffffe008da1a210 frame pointer = 0x28:0xfffffe008da1a210 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (bge0 taskq) trap number = 12 panic: page fault cpuid = 0 time = 1629610416 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe008da19eb0 vpanic() at vpanic+0x187/frame 0xfffffe008da19f10 panic() at panic+0x43/frame 0xfffffe008da19f70 trap_fatal() at trap_fatal+0x387/frame 0xfffffe008da19fd0 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe008da1a030 trap() at trap+0x26a/frame 0xfffffe008da1a140 calltrap() at calltrap+0x8/frame 0xfffffe008da1a140 --- trap 0xc, rip = 0xffffffff806cb53d, rsp = 0xfffffe008da1a210, rbp = 0xfffffe008da1a210 --- __rw_rlock_int() at __rw_rlock_int+0xd/frame 0xfffffe008da1a210 in6_lltable_lookup() at in6_lltable_lookup+0xa7/frame 0xfffffe008da1a240 nd6_lookup() at nd6_lookup+0x4e/frame 0xfffffe008da1a270 pfxlist_onlink_check() at pfxlist_onlink_check+0xfb/frame 0xfffffe008da1a310 nd6_ra_input() at nd6_ra_input+0x147f/frame 0xfffffe008da1a5d0 icmp6_input() at icmp6_input+0x685/frame 0xfffffe008da1a7b0 ip6_input() at ip6_input+0xa9a/frame 0xfffffe008da1a890 netisr_dispatch_src() at netisr_dispatch_src+0xca/frame 0xfffffe008da1a8e0 ether_demux() at ether_demux+0x138/frame 0xfffffe008da1a910 ether_nh_input() at ether_nh_input+0x34e/frame 0xfffffe008da1a970 netisr_dispatch_src() at netisr_dispatch_src+0xca/frame 0xfffffe008da1a9c0 ether_input() at ether_input+0x69/frame 0xfffffe008da1aa20 if_input() at if_input+0xa/frame 0xfffffe008da1aa30 bge_rxeof() at bge_rxeof+0x4dc/frame 0xfffffe008da1aab0 bge_intr_task() at bge_intr_task+0x1a7/frame 0xfffffe008da1ab00 taskqueue_run_locked() at taskqueue_run_locked+0x191/frame 0xfffffe008da1ab80 taskqueue_thread_loop() at taskqueue_thread_loop+0xc3/frame 0xfffffe008da1abb0 fork_exit() at fork_exit+0x8a/frame 0xfffffe008da1abf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe008da1abf0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 1m18s Dumping 511 out of 7972 MB:..4%..13%..22%..32%..41%..51%..63%..72%..82%..91% ---<>--- Copyright (c) 1992-2021 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 14.0-CURRENT #85 komquats-n248853-efa24221b032: Sat Aug 21 20:41:37 PDT 2021 root@cwsys:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 FreeBSD clang version 12.0.1 (git@github.com:llvm/llvm-project.git llvmorg-12.0.1-0-gfed41342a82f) VT(vga): text 80x25 module_register: cannot register tmpfs from kernel; already loaded from tmpfs.ko Module tmpfs failed to register: 17 CPU: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (2294.83-MHz K8-class CPU) Origin="GenuineIntel" Id=0x206a7 Family=0x6 Model=0x2a Stepping=7 Features=0xbfebfbff Features2=0x1dbae3bf AMD Features=0x28100800 AMD Features2=0x1 XSAVE Features=0x1 VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID TSC: P-state invariant, performance statistics real memory = 8589934592 (8192 MB) avail memory = 8082354176 (7707 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 hardware threads random: unblocking device. ioapic0 irqs 0-23 Launching APs: 1 3 2 Timecounter "TSC-low" frequency 1147416650 Hz quality 1000 random: entropy device external interface kbd1 at kbdmux0 vtvga0: aesni0: No AES or SHA support. acpi0: acpi0: Power Button (fixed) cpu0: on acpi0 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 Event timer "HPET" frequency 14318180 Hz quality 550 Event timer "HPET1" frequency 14318180 Hz quality 440 Event timer "HPET2" frequency 14318180 Hz quality 440 Event timer "HPET3" frequency 14318180 Hz quality 440 Event timer "HPET4" frequency 14318180 Hz quality 440 atrtc0: port 0x70-0x77 irq 8 on acpi0 atrtc0: Warning: Couldn't map I/O. atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 attimer0: port 0x40-0x43,0x50-0x53 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 acpi_ec0: port 0x62,0x66 on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 vgapci0: port 0x2000-0x203f mem 0xf0000000-0xf03fffff,0xe0000000-0xefffffff irq 16 at device 2.0 on pci0 vgapci0: Boot video device pci0: at device 22.0 (no driver attached) ehci0: mem 0xf060a000-0xf060a3ff irq 16 at device 26.0 on pci0 usbus0: EHCI version 1.0 usbus0 on ehci0 usbus0: 480Mbps High Speed USB v2.0 hdac0: mem 0xf0600000-0xf0603fff irq 22 at device 27.0 on pci0 pcib1: irq 16 at device 28.0 on pci0 pci1: on pcib1 pcib2: irq 17 at device 28.1 on pci0 pci2: on pcib2 iwn0: mem 0xf0500000-0xf0501fff irq 17 at device 0.0 on pci2 pcib3: irq 19 at device 28.3 on pci0 pci3: on pcib3 bge0: mem 0xf0400000-0xf040ffff,0xf0410000-0xf041ffff irq 19 at device 0.0 on pci3 bge0: CHIP ID 0x57785100; ASIC REV 0x57785; CHIP REV 0x577851; PCI-E miibus0: on bge0 brgphy0: PHY 1 on miibus0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow <6>bge0: Using defaults for TSO: 65518/35/2048 <6>bge0: Ethernet address: 20:6a:8a:72:03:17 sdhci_pci0: mem 0xf0420000-0xf042ffff irq 16 at device 0.1 on pci3 sdhci_pci0: 1 slot(s) allocated ehci1: mem 0xf0609000-0xf06093ff irq 23 at device 29.0 on pci0 usbus1: EHCI version 1.0 usbus1 on ehci1 usbus1: 480Mbps High Speed USB v2.0 isab0: at device 31.0 on pci0 isa0: on isab0 ahci0: port 0x2088-0x208f,0x2094-0x2097,0x2080-0x2087,0x2090-0x2093,0x2060-0x207f mem 0xf0608000-0xf06087ff irq 19 at device 31.2 on pci0 ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported ahcich0: at channel 0 on ahci0 ahcich1: at channel 1 on ahci0 ahcich5: at channel 5 on ahci0 ahciem0: on ahci0 ichsmb0: port 0xefa0-0xefbf mem 0xf0604000-0xf06040ff irq 18 at device 31.3 on pci0 acpi_lid0: on acpi0 acpi_button0: on acpi0 acpi_tz0: on acpi0 acpi_tz1: on acpi0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] WARNING: Device "psm" is Giant locked and may be deleted before FreeBSD 14.0. psm0: model Synaptics Touchpad, device ID 0 acpi_acad0: on acpi0 battery0: on acpi0 vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff pnpid PNP0900 on isa0 ata0: at port 0x1f0-0x1f7,0x3f6 irq 14 on isa0 ata1: at port 0x170-0x177,0x376 irq 15 on isa0 acpi_perf0: on cpu0 acpi_throttle0: on cpu0 coretemp0: on cpu0 acpi_throttle1: failed to attach P_CNT device_attach: acpi_throttle1 attach returned 6 acpi_throttle2: failed to attach P_CNT device_attach: acpi_throttle2 attach returned 6 acpi_throttle3: failed to attach P_CNT device_attach: acpi_throttle3 attach returned 6 module_register_init: MOD_LOAD (tmpfs, 0xffffffff807a2760, 0xffffffff80c88540) error 17 Timecounters tick every 10.000 msec ZFS filesystem version: 5 ZFS storage pool version: features support (5000) IP Filter: v5.1.2 initialized. Default = pass all, Logging = enabled hdacc0: at cad 0 on hdac0 hdaa0: at nid 1 on hdacc0 pcm0: at nid 20,33 and 27 on hdaa0 pcm1: at nid 24 on hdaa0 hdacc1: at cad 3 on hdac0 hdaa1: at nid 1 on hdacc1 pcm2: at nid 5 on hdaa1 smbus0: on ichsmb0 smb0: on smbus0 sysctl_unregister_oid: failed(22) to unregister sysctl(tmpfs) ugen1.1: at usbus1 ugen0.1: at usbus0 uhub0 on usbus1 Trying to mount root from ufs:/dev/ufs/Sroot [rw]... Root mount waiting for: usbus0 usbus1 CAM uhub1 on usbus0 uhub1: on usbus0 uhub0: on usbus1 ses0 at ahciem0 bus 0 scbus3 target 0 lun 0 ses0: SEMB S-E-S 2.00 device ses0: SEMB SES Device ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA8-ACS SATA 3.x device ada0: Serial Number JR1000D33969RE ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 953869MB (1953525168 512 byte sectors) ses0: pass0,ada0 in 'Slot 00', SATA Slot: scbus0 target 0 ses0: pass1,cd0 in 'Slot 01', SATA Slot: scbus1 target 0 cd0 at ahcich1 bus 0 scbus1 target 0 lun 0 cd0: Removable CD-ROM SCSI device cd0: Serial Number SBB5103801 cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes) cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed uhub1: 2 ports with 2 removable, self powered uhub0: 2 ports with 2 removable, self powered Root mount waiting for: usbus0 usbus1 ugen0.2: at usbus0 uhub2 on uhub1 uhub2: on usbus0 ugen1.2: at usbus1 uhub3 on uhub0 uhub3: on usbus1 Root mount waiting for: usbus0 usbus1 uhub3: 6 ports with 6 removable, self powered uhub2: 6 ports with 6 removable, self powered ugen1.3: at usbus1 uhub4 on uhub3 uhub4: on usbus1 ugen0.3: at usbus0 uhub5 on uhub2 uhub5: on usbus0 Root mount waiting for: usbus0 usbus1 uhub4: 4 ports with 4 removable, self powered uhub5: 4 ports with 4 removable, self powered ugen1.4: at usbus1 ukbd0 on uhub4 ukbd0: on usbus1 kbd2 at ukbd0 ums0 on uhub4 ums0: on usbus1 ums0: 16 buttons and [XYZT] coordinates ID=2 ugen0.4: at usbus0 uhub6 on uhub5 uhub6: on usbus0 Root mount waiting for: usbus0 usbus1 ugen1.5: at usbus1 ukbd1 on uhub4 ukbd1: on usbus1 kbd3 at ukbd1 uhub6: 4 ports with 4 removable, self powered ugen0.5: at usbus0 umass0 on uhub6 umass0: on usbus0 umass0: SCSI over Bulk-Only; quirks = 0x4100 umass0:6:0: Attached to scbus6 Root mount waiting for: usbus0 CAM da0 at umass-sim0 bus 0 scbus6 target 0 lun 0 da0: Fixed Direct Access SCSI device da0: 40.000MB/s transfers da0: 76351MB (156368016 512 byte sectors) da0: quirks=0x2 ugen0.6: at usbus0 umass1 on uhub6 umass1: on usbus0 umass1: SCSI over Bulk-Only; quirks = 0x408c umass1:7:1: Attached to scbus7 da1 at umass-sim1 bus 1 scbus7 target 0 lun 0 da1: Fixed Direct Access SCSI device da1: 40.000MB/s transfers da1: 76319MB (156301488 512 byte sectors) da1: quirks=0x2 ugen0.7: at usbus0 umass2 on uhub5 umass2: on usbus0 umass2: SCSI over Bulk-Only; quirks = 0x4101 umass2:8:2: Attached to scbus8 da2 at umass-sim2 bus 2 scbus8 target 0 lun 0 da2: < Flash Disk 8.07> Removable Direct Access SCSI-2 device da2: Serial Number 029B4D84 da2: 40.000MB/s transfers da2: 246MB (504320 512 byte sectors) da2: quirks=0x2 Root mount waiting for: usbus0 ugen0.8: at usbus0 mountroot: waiting for device /dev/ufs/Sroot... WARNING: / was not properly dismounted WARNING: /: mount pending error: blocks 24 files 0 <118>Setting hostuuid: 34f5ed40-8938-11da-b265-efe316da850d. <118>Setting hostid: 0x7f5a03b9. <118>Starting file system checks: <118>** SU+J Recovering /dev/ufs/Sroot <118>** Reading 16777216 byte journal from inode 4. <118>** Building recovery table. <118>** Resolving unreferenced inode list. <118>** Processing journal entries. <118>** 7 journal records in 1536 bytes for 14.58% utilization <118>** Freed 1 inodes (0 dirs) 0 blocks, and 3 frags. <118> <118>***** FILE SYSTEM MARKED CLEAN ***** <118>** SU+J Recovering /dev/ufs/Svar <118>** Reading 16777216 byte journal from inode 4. <118>** Building recovery table. <118>** Resolving unreferenced inode list. <118>** Processing journal entries. <118>** SU+J Recovering /dev/ufs/Susr <118>** Reading 25165824 byte journal from inode 4. <118>** 40 journal records in 4096 bytes for 31.25% utilization <118>** Freed 0 inodes (0 dirs) 0 blocks, and 0 frags. <118> <118>***** FILE SYSTEM MARKED CLEAN ***** <118>** Building recovery table. <118>** Resolving unreferenced inode list. <118>** Processing journal entries. <118> <118>***** FILE SYSTEM MARKED CLEAN ***** <118>/dev/ada0s3a: 7535 files, 131352 used, 376431 free (1135 frags, 46912 blocks, 0.2% fragmentation) <118>/dev/ada0s3e: 24573 files, 319053 used, 442234 free (1082 frags, 55144 blocks, 0.1% fragmentation) <118>/dev/ada0s3d: 22537 files, 105401 used, 402382 free (270 frags, 50264 blocks, 0.1% fragmentation) <118>/dev/ada0s3f: 18331 files, 109447 used, 398336 free (576 frags, 49720 blocks, 0.1% fragmentation) <118>/dev/ada0s3h: 22924 files, 188609 used, 572677 free (685 frags, 71499 blocks, 0.1% fragmentation) <118>/dev/ada0s3g: 5348 files, 49444 used, 458339 free (275 frags, 57258 blocks, 0.1% fragmentation) <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk3p1 <118>** Reading 33554432 byte journal from inode 4. <118>** Building recovery table. <118>** Resolving unreferenced inode list. <118>** Processing journal entries. <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1a <118>** Reading 16777216 byte journal from inode 827. <118> <118>***** FILE SYSTEM MARKED CLEAN ***** <118>** Building recovery table. <118>** Resolving unreferenced inode list. <118>** Processing journal entries. <118> <118>***** FILE SYSTEM MARKED CLEAN ***** <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1d <118>** Reading 16777216 byte journal from inode 117. <118>** Building recovery table. <118>** Resolving unreferenced inode list. <118>** Processing journal entries. <118> <118>***** FILE SYSTEM MARKED CLEAN ***** <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1e <118>** Reading 33554432 byte journal from inode 16. <118>** Building recovery table. <118>** Resolving unreferenced inode list. <118>** Processing journal entries. <118> <118>***** FILE SYSTEM MARKED CLEAN ***** <118>/dev/msdosfs/SHARED: 435 files, 6.2 GiB free (203709 clusters) <118>FIXED <118>/dev/msdosfs/SHARED: MARKING FILE SYSTEM CLEAN <118>/dev/zvol/tank/VMs/current/i386/disk0s1a: 114555 files, 255948 used, 251835 free (403 frags, 31429 blocks, 0.1% fragmentation) <118>/dev/zvol/tank/VMs/current/i386/disk0s1d: 22759 files, 126960 used, 380823 free (143 frags, 47585 blocks, 0.0% fragmentation) <118>/dev/zvol/tank/VMs/current/i386/disk0s1e: 28564 files, 549004 used, 973507 free (1603 frags, 121488 blocks, 0.1% fragmentation) <118>Mounting local filesystems:. <118>Mounting ZFS filesystems: (193/193) <118>Local package initialization:error: ed0: No such device exists (BIOCSETIF failed: Device not configured) <118>Unable to read the configuration file: No such file or directory at /usr/local/lib/perl5/site_perl/Jail.pm line 50. <118>Compilation failed in require at /usr/local/sbin/jailadmin line 13. <118>BEGIN failed--compilation aborted at /usr/local/sbin/jailadmin line 13. <118> Jails. <118>Autoloading module: acpi_wmi acpi_wmi0: on acpi0 acpi_wmi0: Embedded MOF found ACPI: \_SB.AMWA.WQEE: 1 arguments were passed to a non-method ACPI object (Buffer) (20210730/nsarguments-361) acpi_wmi1: on acpi0 acpi_wmi1: Embedded MOF found ACPI: \_SB.AMW0.WQDD: 1 arguments were passed to a non-method ACPI object (Buffer) (20210730/nsarguments-361) <118>Updating CPU Microcode... CPU: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (2294.83-MHz K8-class CPU) Origin="GenuineIntel" Id=0x206a7 Family=0x6 Model=0x2a Stepping=7 Features=0xbfebfbff Features2=0x1dbae3bf AMD Features=0x28100800 AMD Features2=0x1 Structured Extended Features3=0x9c000400 XSAVE Features=0x1 VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID TSC: P-state invariant, performance statistics <118>Done. <118>ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/krb5/lib /usr/local/kde4/lib /usr/local/dt/lib /usr/local/lib/compat/pkg /usr/local/lib/dovecot /usr/local/lib/e2fsprogs /usr/local/lib/expect5.45.4 /usr/local/lib/freeradius-3.0.23 /usr/local/lib/gcc10 /usr/local/lib/gcc11 /usr/local/lib/gcc12 /usr/local/lib/gcc8 /usr/local/lib/gcc9 /usr/local/lib/graphviz /usr/local/lib/httrack /usr/local/lib/itcl3.4 /usr/local/lib/mysql /usr/local/lib/mysql/plugin /usr/local/lib/opencollada /usr/local/lib/perl5/5.30/mach/CORE /usr/local/lib/perl5/5.32/mach/CORE /usr/local/lib/perl5/5.34/mach/CORE /usr/local/lib/pidgin /usr/local/lib/pth /usr/local/lib/qt5 /usr/local/lib/samba4 /usr/local/lib/xrdp /usr/local/libexec/openldap /usr/local/llvm-devel/lib /usr/local/llvm10/lib /usr/local/llvm11/lib /usr/local/llvm12/lib /usr/local/llvm70/lib /usr/local/llvm80/lib /usr/local/llvm90/lib /usr/local/share/chromium <118>32-bit compatibility ldconfig path: /usr/lib32 /alt/i386/root/usr/local/lib <118>Setting hostname: slippy. <118>Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER ],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED <118>Feeding entropy: . <118>Starting ippool. <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already present in pool <118>Additional TCP/IP options: rfc1323 extensions=NO. <118>Enabling ipfilter. <118>Installing NAT rules. <118>0 entries flushed from NAT table <118>0 entries flushed from NAT list <118>Starting ipmon. <6>wlan0: Ethernet address: 20:6a:8a:72:03:17 <118>Created wlan(4) interfaces: wlan0. <6>bridge0: Ethernet address: 58:9c:fc:10:ff:c8 <118>Created clone interfaces: lagg0 bridge0. <6>lo0: link state changed to UP <6>bge0: link state changed to DOWN iwn0: iwn_read_firmware: ucode rev=0x12a80601 <118>Starting wpa_supplicant. <6>lagg0: link state changed to DOWN <6>lagg0: IPv6 addresses on wlan0 have been removed before adding it as a member to prevent IPv6 address scope violation. iwn0: iwn_read_firmware: ucode rev=0x12a80601 <6>wlan0: link state changed to UP <6>lagg0: link state changed to UP <6>bge0: link state changed to UP Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x128 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff806cb53d stack pointer = 0x28:0xfffffe00831a3210 frame pointer = 0x28:0xfffffe00831a3210 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (bge0 taskq) trap number = 12 panic: page fault cpuid = 0 time = 1629610531 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00831a2eb0 vpanic() at vpanic+0x187/frame 0xfffffe00831a2f10 panic() at panic+0x43/frame 0xfffffe00831a2f70 trap_fatal() at trap_fatal+0x387/frame 0xfffffe00831a2fd0 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00831a3030 trap() at trap+0x26a/frame 0xfffffe00831a3140 calltrap() at calltrap+0x8/frame 0xfffffe00831a3140 --- trap 0xc, rip = 0xffffffff806cb53d, rsp = 0xfffffe00831a3210, rbp = 0xfffffe00831a3210 --- __rw_rlock_int() at __rw_rlock_int+0xd/frame 0xfffffe00831a3210 in6_lltable_lookup() at in6_lltable_lookup+0xa7/frame 0xfffffe00831a3240 nd6_lookup() at nd6_lookup+0x4e/frame 0xfffffe00831a3270 pfxlist_onlink_check() at pfxlist_onlink_check+0xfb/frame 0xfffffe00831a3310 nd6_ra_input() at nd6_ra_input+0x147f/frame 0xfffffe00831a35d0 icmp6_input() at icmp6_input+0x685/frame 0xfffffe00831a37b0 ip6_input() at ip6_input+0xa9a/frame 0xfffffe00831a3890 netisr_dispatch_src() at netisr_dispatch_src+0xca/frame 0xfffffe00831a38e0 ether_demux() at ether_demux+0x138/frame 0xfffffe00831a3910 ether_nh_input() at ether_nh_input+0x34e/frame 0xfffffe00831a3970 netisr_dispatch_src() at netisr_dispatch_src+0xca/frame 0xfffffe00831a39c0 ether_input() at ether_input+0x69/frame 0xfffffe00831a3a20 if_input() at if_input+0xa/frame 0xfffffe00831a3a30 bge_rxeof() at bge_rxeof+0x4dc/frame 0xfffffe00831a3ab0 bge_intr_task() at bge_intr_task+0x1a7/frame 0xfffffe00831a3b00 taskqueue_run_locked() at taskqueue_run_locked+0x191/frame 0xfffffe00831a3b80 taskqueue_thread_loop() at taskqueue_thread_loop+0xc3/frame 0xfffffe00831a3bb0 fork_exit() at fork_exit+0x8a/frame 0xfffffe00831a3bf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00831a3bf0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 1m28s Dumping 512 out of 7972 MB:..4%..13%..22%..32%..41%..54%..63%..72%..82%..91% __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:55 55 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu, (kgdb) bt #0 __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:55 #1 doadump (textdump=textdump@entry=1) at /opt/src/git-src/sys/kern/kern_sh utdown.c:399 #2 0xffffffff806cf9ab in kern_reboot (howto=260) at /opt/src/git-src/sys/kern/kern_shutdown.c:486 #3 0xffffffff806cfe26 in vpanic (fmt=0xffffffff80a94e2f "%s", ap=) at /opt/src/git-src/sys/kern/kern_shutdown.c:919 #4 0xffffffff806cfc23 in panic (fmt=) at /opt/src/git-src/sys/kern/kern_shutdown.c:843 #5 0xffffffff80a342c7 in trap_fatal (frame=0xfffffe00831a3150, eva=296) at /opt/src/git-src/sys/amd64/amd64/trap.c:946 #6 0xffffffff80a3431f in trap_pfault (frame=frame@entry=0xfffffe00831a3150, usermode=false, signo=, signo@entry=0x0, ucode=, ucode@entry=0x0) at /opt/src/git-src/sys/amd64/amd64/trap.c:765 #7 0xffffffff80a3399a in trap (frame=0xfffffe00831a3150) at /opt/src/git-src/sys/amd64/amd64/trap.c:443 #8 #9 __rw_rlock_int (rw=0x110) at /opt/src/git-src/sys/kern/kern_rwlock.c:679 #10 0xffffffff8087cd07 in in6_lltable_lookup (llt=, flags=, l3addr=) at /opt/src/git-src/sys/netin et6/in6.c:2349 #11 0xffffffff80897dae in lla_lookup (llt=0x110, flags=2374593664, flags@entry=0, l3addr=0xfffffe00831a3250) at /opt/src/git-src/sys/net/if_lla tbl.h:261 #12 nd6_lookup (addr6=, flags=-1920373632, flags@entry=0, ifp=) at /opt/src/git-src/sys/netinet6/nd6.c:1204 #13 0xffffffff8089ff7b in find_pfxlist_reachable_router (pr=0xfffff8002b64f100) at /opt/src/git-src/sys/netinet6/nd6_rtr.c:1817 #14 pfxlist_onlink_check () at /opt/src/git-src/sys/netinet6/nd6_rtr.c:1861 #15 0xffffffff8089fc5f in nd6_ra_input (m=, m@entry=0xfffff8003a3e1d00, off=, icmp6len=, icmp6len@entry=48) at /opt/src/git-src/sys/netinet6/nd6_rtr.c:597 #16 0xffffffff80874aa5 in icmp6_input (mp=0xfffffe00831a37f8, offp=0xfffffe00831a37f0, proto=) at /opt/src/git-src/sys/netinet6/icmp6.c:780 #17 0xffffffff8088beca in ip6_input (m=0xfffff8003a3e1d00) at /opt/src/git-src/sys/netinet6/ip6_input.c:929 #18 0xffffffff80806d6a in netisr_dispatch_src (proto=6, source=, source@entry=0, m=0x0) at /opt/src/git-src/sys/net/netisr.c:1143 #19 0xffffffff8080704f in netisr_dispatch (proto=272, m=0x10) at /opt/src/git-src/sys/net/netisr.c:1234 #20 0xffffffff807f3d58 in ether_demux (ifp=ifp@entry=0xfffff8003a30e800, m=0xfffffe008d896c80) at /opt/src/git-src/sys/net/if_ethersubr.c:925 #21 0xffffffff807f50fe in ether_input_internal (ifp=0xfffff8003a30e800, m=0xfffffe008d896c80) at /opt/src/git-src/sys/net/if_ethersubr.c:711 #22 ether_nh_input (m=) at /opt/src/git-src/sys/net/if_ethers ubr.c:741 #23 0xffffffff80806d6a in netisr_dispatch_src (proto=proto@entry=5, source=, source@entry=0, m=0x0, m@entry=0xfffff8003a3e1d00) at /opt/src/git-src/sys/net/netisr.c:1143 #24 0xffffffff8080704f in netisr_dispatch (proto=272, proto@entry=5, m=0x10, m@entry=0xfffff8003a3e1d00) at /opt/src/git-src/sys/net/netisr.c:123 4 #25 0xffffffff807f41a9 in ether_input (ifp=, m=0xfffff8003a3e1d00) at /opt/src/git-src/sys/net/if_ethersubr.c:832 #26 0xffffffff807f042a in if_input (ifp=0x110, ifp@entry=0xfffff8000516b800, sendmp=0xfffffe008d896c80, sendmp@entry=0xfffff8003a3e1d00) at /opt/src/git-src/sys/net/if.c:4444 #27 0xffffffff818eaabc in bge_rxeof (sc=, sc@entry=0xfffffe00107d0000, rx_prod=rx_prod@entry=2, holdlck=holdlck@entry=0) at /opt/src/git-src/sys/dev/bge/if_bge.c:4436 #28 0xffffffff818e7d57 in bge_intr_task (arg=0xfffffe00107d0000, pending=) at /opt/src/git-src/sys/dev/bge/if_bge.c:4666 #29 0xffffffff80731d81 in taskqueue_run_locked (queue=queue@entry=0xfffff800 03890600) at /opt/src/git-src/sys/kern/subr_taskqueue.c:476 #30 0xffffffff80733073 in taskqueue_thread_loop (arg=, arg@entry=0xfffffe00107d7568) at /opt/src/git-src/sys/kern/subr_taskqueue.c: 793 #31 0xffffffff8068b80a in fork_exit (callout=0xffffffff80732fb0 , arg=0xfffffe00107d7568, frame=0xfffffe00831a3c00) at /opt/src/git-src/sys/kern/kern_fork.c:1087 #32 (kgdb) frame 9 #9 __rw_rlock_int (rw=0x110) at /opt/src/git-src/sys/kern/kern_rwlock.c:679 679 v = RW_READ_VALUE(rw); (kgdb) l 674 KASSERT(rw_wowner(rw) != td, 675 ("rw_rlock: wlock already held for %s @ %s:%d", 676 rw->lock_object.lo_name, file, line)); 677 WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL); 678 679 v = RW_READ_VALUE(rw); 680 if (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__acquire) || 681 !__rw_rlock_try(rw, td, &v, true LOCK_FILE_LINE_ARG))) 682 __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG); 683 else (kgdb) p rw $1 = (struct rwlock *) 0x110 (kgdb) frame 10 #10 0xffffffff8087cd07 in in6_lltable_lookup (llt=, flags=, l3addr=) at /opt/src/git-src/sys/netin et6/in6.c:2349 2349 LLE_RLOCK(lle); (kgdb) l 2344 return (lle); 2345 2346 if (flags & LLE_EXCLUSIVE) 2347 LLE_WLOCK(lle); 2348 else 2349 LLE_RLOCK(lle); 2350 2351 /* 2352 * If the afdata lock is not held, the LLE may have been unlinked while 2353 * we were blocked on the LLE lock. Check for this case. (kgdb) p lle $2 = (struct llentry *) 0x0 (kgdb) -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Sun Aug 22 06:01:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1BCF67EF07; Sun, 22 Aug 2021 06:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gsl9w4jCfz4vF3; Sun, 22 Aug 2021 06:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89C621B9EB; Sun, 22 Aug 2021 06:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17M61OGt085777; Sun, 22 Aug 2021 06:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17M61OW4085776; Sun, 22 Aug 2021 06:01:24 GMT (envelope-from git) Date: Sun, 22 Aug 2021 06:01:24 GMT Message-Id: <202108220601.17M61OW4085776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 47f880ebeb30 - main - ext2fs(5): Correct a typo in an error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47f880ebeb3092b1b7bbc6d75e82532e43bbf010 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 06:01:24 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=47f880ebeb3092b1b7bbc6d75e82532e43bbf010 commit 47f880ebeb3092b1b7bbc6d75e82532e43bbf010 Author: Gordon Bergling AuthorDate: 2021-08-22 05:58:22 +0000 Commit: Gordon Bergling CommitDate: 2021-08-22 05:58:22 +0000 ext2fs(5): Correct a typo in an error message - s/talbes/tables/ MFC after: 1 week --- sys/fs/ext2fs/ext2_vfsops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index d15fed3d2913..b39d04649d17 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -434,7 +434,7 @@ ext2_cg_validate(struct m_ext2fs *fs) } if (i_tables <= last_cg_block) { SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, - "inode talbes overlaps gds", i); + "inode tables overlaps gds", i); return (EINVAL); } if (i_tables < first_block || From owner-dev-commits-src-all@freebsd.org Sun Aug 22 06:17:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E13F667ECD2; Sun, 22 Aug 2021 06:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GslXj5lZHz3G4H; Sun, 22 Aug 2021 06:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADB7E1BC41; Sun, 22 Aug 2021 06:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17M6HfH2000177; Sun, 22 Aug 2021 06:17:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17M6HfPH000176; Sun, 22 Aug 2021 06:17:41 GMT (envelope-from git) Date: Sun, 22 Aug 2021 06:17:41 GMT Message-Id: <202108220617.17M6HfPH000176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 0d55bc8eb2ab - main - rpc(3): Correct a few common typos in source code comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d55bc8eb2ab9508c43e135616ca887ed719ea9a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 06:17:41 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0d55bc8eb2ab9508c43e135616ca887ed719ea9a commit 0d55bc8eb2ab9508c43e135616ca887ed719ea9a Author: Gordon Bergling AuthorDate: 2021-08-22 06:16:09 +0000 Commit: Gordon Bergling CommitDate: 2021-08-22 06:16:09 +0000 rpc(3): Correct a few common typos in source code comments - s/therfore/therefor/ - s/activte/active/ Obtained from: NetBSD MFC after: 3 days --- lib/libc/rpc/clnt_dg.c | 4 ++-- lib/libc/rpc/clnt_vc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c index a1cd7502e2ad..26bf34633623 100644 --- a/lib/libc/rpc/clnt_dg.c +++ b/lib/libc/rpc/clnt_dg.c @@ -92,9 +92,9 @@ static void clnt_dg_destroy(CLIENT *); * This machinery implements per-fd locks for MT-safety. It is not * sufficient to do per-CLIENT handle locks for MT-safety because a * user may create more than one CLIENT handle with the same fd behind - * it. Therfore, we allocate an array of flags (dg_fd_locks), protected + * it. Therefore, we allocate an array of flags (dg_fd_locks), protected * by the clnt_fd_lock mutex, and an array (dg_cv) of condition variables - * similarly protected. Dg_fd_lock[fd] == 1 => a call is activte on some + * similarly protected. Dg_fd_lock[fd] == 1 => a call is active on some * CLIENT handle created for that fd. * The current implementation holds locks across the entire RPC and reply, * including retransmissions. Yes, this is silly, and as soon as this diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c index dec1791dcc95..ebd4e303916f 100644 --- a/lib/libc/rpc/clnt_vc.c +++ b/lib/libc/rpc/clnt_vc.c @@ -123,9 +123,9 @@ struct ct_data { * This machinery implements per-fd locks for MT-safety. It is not * sufficient to do per-CLIENT handle locks for MT-safety because a * user may create more than one CLIENT handle with the same fd behind - * it. Therfore, we allocate an array of flags (vc_fd_locks), protected + * it. Therefore, we allocate an array of flags (vc_fd_locks), protected * by the clnt_fd_lock mutex, and an array (vc_cv) of condition variables - * similarly protected. Vc_fd_lock[fd] == 1 => a call is activte on some + * similarly protected. Vc_fd_lock[fd] == 1 => a call is active on some * CLIENT handle created for that fd. * The current implementation holds locks across the entire RPC and reply. * Yes, this is silly, and as soon as this code is proven to work, this From owner-dev-commits-src-all@freebsd.org Sun Aug 22 08:49:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0BDE650EAE; Sun, 22 Aug 2021 08:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gspvp4TTHz4fgR; Sun, 22 Aug 2021 08:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76D851DDC3; Sun, 22 Aug 2021 08:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17M8nQOi000105; Sun, 22 Aug 2021 08:49:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17M8nQGH000104; Sun, 22 Aug 2021 08:49:26 GMT (envelope-from git) Date: Sun, 22 Aug 2021 08:49:26 GMT Message-Id: <202108220849.17M8nQGH000104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f8c1b1a92966 - main - lltable: fix crash introduced in c541bd368f86. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8c1b1a9296696f70ac209612a00ae0722d07ed9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 08:49:26 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f8c1b1a9296696f70ac209612a00ae0722d07ed9 commit f8c1b1a9296696f70ac209612a00ae0722d07ed9 Author: Alexander V. Chernikov AuthorDate: 2021-08-22 08:47:49 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-22 08:49:18 +0000 lltable: fix crash introduced in c541bd368f86. Reported by: cy MFC after: 2 weeks --- sys/netinet6/in6.c | 7 ++++--- sys/netinet6/nd6_rtr.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 142a05ded2b6..d54aba58edb6 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2323,6 +2323,7 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) { const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)l3addr; + int family = flags >> 16; struct llentry *lle; IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); @@ -2333,13 +2334,13 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, ("wrong lle request flags: %#x", flags)); lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); - if (lle == NULL) - return (NULL); - int family = flags >> 16; if (__predict_false(family != AF_INET6)) lle = llentry_lookup_family(lle, family); + if (lle == NULL) + return (NULL); + if (flags & LLE_UNLOCKED) return (lle); diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 2960b6cad951..cec9fccd63c4 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -972,7 +972,7 @@ defrouter_select_fib(int fibnum) TAILQ_FOREACH(dr, &V_nd6_defrouter, dr_entry) { NET_EPOCH_ENTER(et); if (selected_dr == NULL && dr->ifp->if_fib == fibnum && - (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && + (ln = nd6_lookup(&dr->rtaddr, LLE_SF(AF_INET6, 0), dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln)) { selected_dr = dr; defrouter_ref(selected_dr); @@ -1814,7 +1814,8 @@ find_pfxlist_reachable_router(struct nd_prefix *pr) NET_EPOCH_ENTER(et); LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) { - ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); + ln = nd6_lookup(&pfxrtr->router->rtaddr, LLE_SF(AF_INET6, 0), + pfxrtr->router->ifp); if (ln == NULL) continue; canreach = ND6_IS_LLINFO_PROBREACH(ln); From owner-dev-commits-src-all@freebsd.org Sun Aug 22 08:50:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3750B651185; Sun, 22 Aug 2021 08:50:59 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GspxX3Wh6z4gbJ; Sun, 22 Aug 2021 08:50:55 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from iva3-22c7ad945a2f.qloud-c.yandex.net (iva3-22c7ad945a2f.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:4918:0:640:22c7:ad94]) by forward100p.mail.yandex.net (Yandex) with ESMTP id F200059822C4; Sun, 22 Aug 2021 11:50:44 +0300 (MSK) Received: from iva7-f62245f79210.qloud-c.yandex.net (iva7-f62245f79210.qloud-c.yandex.net [2a02:6b8:c0c:2e83:0:640:f622:45f7]) by iva3-22c7ad945a2f.qloud-c.yandex.net (mxback/Yandex) with ESMTP id orPLkDuuds-oiIaMvE7; Sun, 22 Aug 2021 11:50:44 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1629622244; bh=qX2aw3UHHKbHX744AHHdG/xTJnP7WYC5qqhPpD6ZAhA=; h=To:In-Reply-To:References:Date:Subject:Cc:Message-Id:From; b=YdRzU95igCsoOj5THexRLMTFjzBbop83VhyZfkRBnfR3KXRqJMBoO07TackGE6Lnt TqbDB8J4yyqVnoueogxgSxk22YRiBGCiFIuByJeNWohtdiMqmG3kLRK+7iHa0iO7fb SJTfRZDlzbw4eLMNmxVgwJZ+VC+7/4CcSbsDqCe4= Received: by iva7-f62245f79210.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id dcacoXlRL7-og08gfn4; Sun, 22 Aug 2021 11:50:43 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: "Alexander V. Chernikov" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: c541bd368f86 - main - lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries. Date: Sun, 22 Aug 2021 09:50:41 +0100 In-Reply-To: <202108220558.17M5wAuq003114@slippy.cwsent.com> Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: Cy Schubert References: <202108211735.17LHZ0WI081502@gitrepo.freebsd.org> <202108220558.17M5wAuq003114@slippy.cwsent.com> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4GspxX3Wh6z4gbJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=YdRzU95i; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 2a02:6b8:0:1472:2741:0:8b7:100 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-3.10 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FREEFALL_USER(0.00)[melifaro]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0:1000::/52]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[ipfw.ru]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ipfw.ru:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_IN_DNSWL_LOW(-0.10)[2a02:6b8:0:1472:2741:0:8b7:100:from] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 08:50:59 -0000 > On 22 Aug 2021, at 06:58, Cy Schubert = wrote: >=20 > In message <202108211735.17LHZ0WI081502@gitrepo.freebsd.org = >, "Alexander V.=20= > Che > rnikov" writes: >> The branch main has been updated by melifaro: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc541bd368f863bbf5c08dd5c1ecce016= >> 6ad47389 >>=20 >> commit c541bd368f863bbf5c08dd5c1ecce0166ad47389 >> Author: Alexander V. Chernikov >> AuthorDate: 2021-08-21 14:13:32 +0000 >> Commit: Alexander V. Chernikov >> CommitDate: 2021-08-21 17:34:35 +0000 >>=20 >> lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 = entries >> . >>=20 >> Currently we use pre-calculated headers inside LLE entries as = prepend dat >> a >> for `if_output` functions. Using these headers allows saving some >> CPU cycles/memory accesses on the fast path. >>=20 >> However, this approach makes adding L2 header for IPv4 traffic = with IPv6 >> nexthops more complex, as it is not possible to store multiple >> pre-calculated headers inside lle. Additionally, the solution = space is >> limited by the fact that PCB caching saves LLEs in addition to = the nexth >> op. >>=20 >> Thus, add support for creating special "child" LLEs for the = purpose of ho >> lding >> custom family encaps and store mbufs pending resolution. To = simplify han >> dling >> of those LLEs, store them in a linked-list inside a "parent" = (e.g. norma >> l) LLE. >> Such LLEs are not visible when iterating LLE table. Their = lifecycle is b >> ound >> to the "parent" LLE - it is not possible to delete "child" when = parent i >> s alive. >> Furthermore, "child" LLEs are static (RTF_STATIC), avoding = complex state >> machine used by the standard LLEs. >>=20 >> nd6_lookup() and nd6_resolve() now accepts an additional argument, = family >> , >> allowing to return such child LLEs. This change uses `LLE_SF()` = macro wh >> ich >> packs family and flags in a single int field. This is done to = simplify m >> erging >> back to stable/. Once this code lands, most of the cases will be = convert >> ed to >> use a dedicated `family` parameter. >>=20 >> Differential Revision: https://reviews.freebsd.org/D31379 >> MFC after: 2 weeks >> --- >> sys/net/if_ethersubr.c | 4 +- >> sys/net/if_fwsubr.c | 4 +- >> sys/net/if_infiniband.c | 3 +- >> sys/net/if_llatbl.c | 70 +++++++++++- >> sys/net/if_llatbl.h | 12 +- >> sys/netinet/toecore.c | 2 +- >> sys/netinet6/icmp6.c | 2 +- >> sys/netinet6/in6.c | 5 + >> sys/netinet6/nd6.c | 176 = +++++++++++++++++++++++---- >> -- >> sys/netinet6/nd6.h | 1 + >> sys/netinet6/nd6_nbr.c | 6 +- >> sys/ofed/drivers/infiniband/core/ib_addr.c | 5 +- >> 12 files changed, 241 insertions(+), 49 deletions(-) >=20 > This commit causes two of my machines a bit of gas. Sorry for the breakage, should be fixed by = f8c1b1a9296696f70ac209612a00ae0722d07ed9. >=20 > Fatal trap 12: page fault while in kernel mode > cpuid =3D 0; apic id =3D 00 > fault virtual address =3D 0x128 > fault code =3D supervisor read data, page not present > instruction pointer =3D 0x20:0xffffffff806cb53d > stack pointer =3D 0x28:0xfffffe008da1a210 > frame pointer =3D 0x28:0xfffffe008da1a210 > code segment =3D base 0x0, limit 0xfffff, type 0x1b > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > current process =3D 0 (bge0 taskq) > trap number =3D 12 > panic: page fault > cpuid =3D 0 > time =3D 1629610416 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame=20 > 0xfffffe008da19eb0 > vpanic() at vpanic+0x187/frame 0xfffffe008da19f10 > panic() at panic+0x43/frame 0xfffffe008da19f70 > trap_fatal() at trap_fatal+0x387/frame 0xfffffe008da19fd0 > trap_pfault() at trap_pfault+0x4f/frame 0xfffffe008da1a030 > trap() at trap+0x26a/frame 0xfffffe008da1a140 > calltrap() at calltrap+0x8/frame 0xfffffe008da1a140 > --- trap 0xc, rip =3D 0xffffffff806cb53d, rsp =3D 0xfffffe008da1a210, = rbp =3D=20 > 0xfffffe008da1a210 --- > __rw_rlock_int() at __rw_rlock_int+0xd/frame 0xfffffe008da1a210 > in6_lltable_lookup() at in6_lltable_lookup+0xa7/frame = 0xfffffe008da1a240 > nd6_lookup() at nd6_lookup+0x4e/frame 0xfffffe008da1a270 > pfxlist_onlink_check() at pfxlist_onlink_check+0xfb/frame = 0xfffffe008da1a310 > nd6_ra_input() at nd6_ra_input+0x147f/frame 0xfffffe008da1a5d0 > icmp6_input() at icmp6_input+0x685/frame 0xfffffe008da1a7b0 > ip6_input() at ip6_input+0xa9a/frame 0xfffffe008da1a890 > netisr_dispatch_src() at netisr_dispatch_src+0xca/frame = 0xfffffe008da1a8e0 > ether_demux() at ether_demux+0x138/frame 0xfffffe008da1a910 > ether_nh_input() at ether_nh_input+0x34e/frame 0xfffffe008da1a970 > netisr_dispatch_src() at netisr_dispatch_src+0xca/frame = 0xfffffe008da1a9c0 > ether_input() at ether_input+0x69/frame 0xfffffe008da1aa20 > if_input() at if_input+0xa/frame 0xfffffe008da1aa30 > bge_rxeof() at bge_rxeof+0x4dc/frame 0xfffffe008da1aab0 > bge_intr_task() at bge_intr_task+0x1a7/frame 0xfffffe008da1ab00 > taskqueue_run_locked() at taskqueue_run_locked+0x191/frame=20 > 0xfffffe008da1ab80 > taskqueue_thread_loop() at taskqueue_thread_loop+0xc3/frame=20 > 0xfffffe008da1abb0 > fork_exit() at fork_exit+0x8a/frame 0xfffffe008da1abf0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe008da1abf0 > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > Uptime: 1m18s > Dumping 511 out of 7972 = MB:..4%..13%..22%..32%..41%..51%..63%..72%..82%..91% > ---<>--- > Copyright (c) 1992-2021 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, = 1994 > The Regents of the University of California. All rights = reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 14.0-CURRENT #85 komquats-n248853-efa24221b032: Sat Aug 21 = 20:41:37=20 > PDT 2021 > root@cwsys:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 > FreeBSD clang version 12.0.1 (git@github.com = :llvm/llvm-project.git=20 > llvmorg-12.0.1-0-gfed41342a82f) > VT(vga): text 80x25 > module_register: cannot register tmpfs from kernel; already loaded = from=20 > tmpfs.ko > Module tmpfs failed to register: 17 > CPU: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (2294.83-MHz K8-class = CPU) > Origin=3D"GenuineIntel" Id=3D0x206a7 Family=3D0x6 Model=3D0x2a = Stepping=3D7 > = Features=3D0xbfebfbff CA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > = Features2=3D0x1dbae3bf = 16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,XSAVE,OSXSAVE,AVX> > AMD Features=3D0x28100800 > AMD Features2=3D0x1 > XSAVE Features=3D0x1 > VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID > TSC: P-state invariant, performance statistics > real memory =3D 8589934592 (8192 MB) > avail memory =3D 8082354176 (7707 MB) > Event timer "LAPIC" quality 600 > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 hardware threads > random: unblocking device. > ioapic0 irqs 0-23 > Launching APs: 1 3 2 > Timecounter "TSC-low" frequency 1147416650 Hz quality 1000 > random: entropy device external interface > kbd1 at kbdmux0 > vtvga0: > aesni0: No AES or SHA support. > acpi0: > acpi0: Power Button (fixed) > cpu0: on acpi0 > hpet0: iomem 0xfed00000-0xfed003ff on = acpi0 > Timecounter "HPET" frequency 14318180 Hz quality 950 > Event timer "HPET" frequency 14318180 Hz quality 550 > Event timer "HPET1" frequency 14318180 Hz quality 440 > Event timer "HPET2" frequency 14318180 Hz quality 440 > Event timer "HPET3" frequency 14318180 Hz quality 440 > Event timer "HPET4" frequency 14318180 Hz quality 440 > atrtc0: port 0x70-0x77 irq 8 on acpi0 > atrtc0: Warning: Couldn't map I/O. > atrtc0: registered as a time-of-day clock, resolution 1.000000s > Event timer "RTC" frequency 32768 Hz quality 0 > attimer0: port 0x40-0x43,0x50-0x53 irq 0 on acpi0 > Timecounter "i8254" frequency 1193182 Hz quality 0 > Event timer "i8254" frequency 1193182 Hz quality 100 > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 > acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 > acpi_ec0: port 0x62,0x66 on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > vgapci0: port 0x2000-0x203f mem=20 > 0xf0000000-0xf03fffff,0xe0000000-0xefffffff irq 16 at device 2.0 on = pci0 > vgapci0: Boot video device > pci0: at device 22.0 (no driver attached) > ehci0: mem = 0xf060a000-0xf060a3ff=20 > irq 16 at device 26.0 on pci0 > usbus0: EHCI version 1.0 > usbus0 on ehci0 > usbus0: 480Mbps High Speed USB v2.0 > hdac0: mem 0xf0600000-0xf0603fff = irq 22=20 > at device 27.0 on pci0 > pcib1: irq 16 at device 28.0 on pci0 > pci1: on pcib1 > pcib2: irq 17 at device 28.1 on pci0 > pci2: on pcib2 > iwn0: mem 0xf0500000-0xf0501fff irq = 17 at=20 > device 0.0 on pci2 > pcib3: irq 19 at device 28.3 on pci0 > pci3: on pcib3 > bge0: mem=20 > 0xf0400000-0xf040ffff,0xf0410000-0xf041ffff irq 19 at device 0.0 on = pci3 > bge0: CHIP ID 0x57785100; ASIC REV 0x57785; CHIP REV 0x577851; PCI-E > miibus0: on bge0 > brgphy0: PHY 1 on miibus0 > brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,=20= > 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow > <6>bge0: Using defaults for TSO: 65518/35/2048 > <6>bge0: Ethernet address: 20:6a:8a:72:03:17 > sdhci_pci0: mem=20 > 0xf0420000-0xf042ffff irq 16 at device 0.1 on pci3 > sdhci_pci0: 1 slot(s) allocated > ehci1: mem = 0xf0609000-0xf06093ff=20 > irq 23 at device 29.0 on pci0 > usbus1: EHCI version 1.0 > usbus1 on ehci1 > usbus1: 480Mbps High Speed USB v2.0 > isab0: at device 31.0 on pci0 > isa0: on isab0 > ahci0: port=20 > 0x2088-0x208f,0x2094-0x2097,0x2080-0x2087,0x2090-0x2093,0x2060-0x207f = mem=20 > 0xf0608000-0xf06087ff irq 19 at device 31.2 on pci0 > ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported > ahcich0: at channel 0 on ahci0 > ahcich1: at channel 1 on ahci0 > ahcich5: at channel 5 on ahci0 > ahciem0: on ahci0 > ichsmb0: port 0xefa0-0xefbf mem=20= > 0xf0604000-0xf06040ff irq 18 at device 31.3 on pci0 > acpi_lid0: on acpi0 > acpi_button0: on acpi0 > acpi_tz0: on acpi0 > acpi_tz1: on acpi0 > atkbdc0: port 0x60,0x64 irq 1 on acpi0 > atkbd0: irq 1 on atkbdc0 > kbd0 at atkbd0 > atkbd0: [GIANT-LOCKED] > psm0: irq 12 on atkbdc0 > psm0: [GIANT-LOCKED] > WARNING: Device "psm" is Giant locked and may be deleted before = FreeBSD=20 > 14.0. > psm0: model Synaptics Touchpad, device ID 0 > acpi_acad0: on acpi0 > battery0: on acpi0 > vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff = pnpid=20 > PNP0900 on isa0 > ata0: at port 0x1f0-0x1f7,0x3f6 irq 14 on isa0 > ata1: at port 0x170-0x177,0x376 irq 15 on isa0 > acpi_perf0: on cpu0 > acpi_throttle0: on cpu0 > coretemp0: on cpu0 > acpi_throttle1: failed to attach P_CNT > device_attach: acpi_throttle1 attach returned 6 > acpi_throttle2: failed to attach P_CNT > device_attach: acpi_throttle2 attach returned 6 > acpi_throttle3: failed to attach P_CNT > device_attach: acpi_throttle3 attach returned 6 > module_register_init: MOD_LOAD (tmpfs, 0xffffffff807a2760,=20 > 0xffffffff80c88540) error 17 > Timecounters tick every 10.000 msec > ZFS filesystem version: 5 > ZFS storage pool version: features support (5000) > IP Filter: v5.1.2 initialized. Default =3D pass all, Logging =3D = enabled > hdacc0: at cad 0 on hdac0 > hdaa0: at nid 1 on hdacc0 > pcm0: at nid 20,33 and 27 on = hdaa0 > pcm1: at nid 24 on hdaa0 > hdacc1: at cad 3 on hdac0 > hdaa1: at nid 1 on hdacc1 > pcm2: at nid 5 on hdaa1 > smbus0: on ichsmb0 > smb0: on smbus0 > sysctl_unregister_oid: failed(22) to unregister sysctl(tmpfs) > ugen1.1: at usbus1 > ugen0.1: at usbus0 > uhub0 on usbus1 > Trying to mount root from ufs:/dev/ufs/Sroot [rw]... > Root mount waiting for: usbus0 usbus1 CAM > uhub1 on usbus0 > uhub1: on = usbus0 > uhub0: on = usbus1 > ses0 at ahciem0 bus 0 scbus3 target 0 lun 0 > ses0: SEMB S-E-S 2.00 device > ses0: SEMB SES Device > ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 > ada0: ATA8-ACS SATA 3.x device > ada0: Serial Number JR1000D33969RE > ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) > ada0: Command Queueing enabled > ada0: 953869MB (1953525168 512 byte sectors) > ses0: pass0,ada0 in 'Slot 00', SATA Slot: scbus0 target 0 > ses0: pass1,cd0 in 'Slot 01', SATA Slot: scbus1 target 0 > cd0 at ahcich1 bus 0 scbus1 target 0 lun 0 > cd0: Removable CD-ROM SCSI device > cd0: Serial Number SBB5103801 > cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO = 8192bytes) > cd0: Attempt to query device size failed: NOT READY, Medium not = present -=20 > tray closed > uhub1: 2 ports with 2 removable, self powered > uhub0: 2 ports with 2 removable, self powered > Root mount waiting for: usbus0 usbus1 > ugen0.2: at usbus0 > uhub2 on uhub1 > uhub2: on=20 > usbus0 > ugen1.2: at usbus1 > uhub3 on uhub0 > uhub3: on=20 > usbus1 > Root mount waiting for: usbus0 usbus1 > uhub3: 6 ports with 6 removable, self powered > uhub2: 6 ports with 6 removable, self powered > ugen1.3: at usbus1 > uhub4 on uhub3 > uhub4: on = usbus1 > ugen0.3: at usbus0 > uhub5 on uhub2 > uhub5: on=20= > usbus0 > Root mount waiting for: usbus0 usbus1 > uhub4: 4 ports with 4 removable, self powered > uhub5: 4 ports with 4 removable, self powered > ugen1.4: at usbus1 > ukbd0 on uhub4 > ukbd0: on = usbus1 > kbd2 at ukbd0 > ums0 on uhub4 > ums0: on = usbus1 > ums0: 16 buttons and [XYZT] coordinates ID=3D2 > ugen0.4: at usbus0 > uhub6 on uhub5 > uhub6: on=20= > usbus0 > Root mount waiting for: usbus0 usbus1 > ugen1.5: at usbus1 > ukbd1 on uhub4 > ukbd1: on=20= > usbus1 > kbd3 at ukbd1 > uhub6: 4 ports with 4 removable, self powered > ugen0.5: at usbus0 > umass0 on uhub6 > umass0: on = usbus0 > umass0: SCSI over Bulk-Only; quirks =3D 0x4100 > umass0:6:0: Attached to scbus6 > Root mount waiting for: usbus0 CAM > da0 at umass-sim0 bus 0 scbus6 target 0 lun 0 > da0: Fixed Direct Access SCSI device > da0: 40.000MB/s transfers > da0: 76351MB (156368016 512 byte sectors) > da0: quirks=3D0x2 > ugen0.6: at usbus0 > umass1 on uhub6 > umass1: = on=20 > usbus0 > umass1: SCSI over Bulk-Only; quirks =3D 0x408c > umass1:7:1: Attached to scbus7 > da1 at umass-sim1 bus 1 scbus7 target 0 lun 0 > da1: Fixed Direct Access SCSI device > da1: 40.000MB/s transfers > da1: 76319MB (156301488 512 byte sectors) > da1: quirks=3D0x2 > ugen0.7: at usbus0 > umass2 on uhub5 > umass2: = on=20 > usbus0 > umass2: SCSI over Bulk-Only; quirks =3D 0x4101 > umass2:8:2: Attached to scbus8 > da2 at umass-sim2 bus 2 scbus8 target 0 lun 0 > da2: < Flash Disk 8.07> Removable Direct Access SCSI-2 device > da2: Serial Number 029B4D84 > da2: 40.000MB/s transfers > da2: 246MB (504320 512 byte sectors) > da2: quirks=3D0x2 > Root mount waiting for: usbus0 > ugen0.8: at usbus0 > mountroot: waiting for device /dev/ufs/Sroot... > WARNING: / was not properly dismounted > WARNING: /: mount pending error: blocks 24 files 0 > <118>Setting hostuuid: 34f5ed40-8938-11da-b265-efe316da850d. > <118>Setting hostid: 0x7f5a03b9. > <118>Starting file system checks: > <118>** SU+J Recovering /dev/ufs/Sroot > <118>** Reading 16777216 byte journal from inode 4. > <118>** Building recovery table. > <118>** Resolving unreferenced inode list. > <118>** Processing journal entries. > <118>** 7 journal records in 1536 bytes for 14.58% utilization > <118>** Freed 1 inodes (0 dirs) 0 blocks, and 3 frags. > <118> > <118>***** FILE SYSTEM MARKED CLEAN ***** > <118>** SU+J Recovering /dev/ufs/Svar > <118>** Reading 16777216 byte journal from inode 4. > <118>** Building recovery table. > <118>** Resolving unreferenced inode list. > <118>** Processing journal entries. > <118>** SU+J Recovering /dev/ufs/Susr > <118>** Reading 25165824 byte journal from inode 4. > <118>** 40 journal records in 4096 bytes for 31.25% utilization > <118>** Freed 0 inodes (0 dirs) 0 blocks, and 0 frags. > <118> > <118>***** FILE SYSTEM MARKED CLEAN ***** > <118>** Building recovery table. > <118>** Resolving unreferenced inode list. > <118>** Processing journal entries. > <118> > <118>***** FILE SYSTEM MARKED CLEAN ***** > <118>/dev/ada0s3a: 7535 files, 131352 used, 376431 free (1135 frags, = 46912=20 > blocks, 0.2% fragmentation) > <118>/dev/ada0s3e: 24573 files, 319053 used, 442234 free (1082 frags, = 55144=20 > blocks, 0.1% fragmentation) > <118>/dev/ada0s3d: 22537 files, 105401 used, 402382 free (270 frags, = 50264=20 > blocks, 0.1% fragmentation) > <118>/dev/ada0s3f: 18331 files, 109447 used, 398336 free (576 frags, = 49720=20 > blocks, 0.1% fragmentation) > <118>/dev/ada0s3h: 22924 files, 188609 used, 572677 free (685 frags, = 71499=20 > blocks, 0.1% fragmentation) > <118>/dev/ada0s3g: 5348 files, 49444 used, 458339 free (275 frags, = 57258=20 > blocks, 0.1% fragmentation) > <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk3p1 > <118>** Reading 33554432 byte journal from inode 4. > <118>** Building recovery table. > <118>** Resolving unreferenced inode list. > <118>** Processing journal entries. > <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1a > <118>** Reading 16777216 byte journal from inode 827. > <118> > <118>***** FILE SYSTEM MARKED CLEAN ***** > <118>** Building recovery table. > <118>** Resolving unreferenced inode list. > <118>** Processing journal entries. > <118> > <118>***** FILE SYSTEM MARKED CLEAN ***** > <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1d > <118>** Reading 16777216 byte journal from inode 117. > <118>** Building recovery table. > <118>** Resolving unreferenced inode list. > <118>** Processing journal entries. > <118> > <118>***** FILE SYSTEM MARKED CLEAN ***** > <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1e > <118>** Reading 33554432 byte journal from inode 16. > <118>** Building recovery table. > <118>** Resolving unreferenced inode list. > <118>** Processing journal entries. > <118> > <118>***** FILE SYSTEM MARKED CLEAN ***** > <118>/dev/msdosfs/SHARED: 435 files, 6.2 GiB free (203709 clusters) > <118>FIXED > <118>/dev/msdosfs/SHARED: MARKING FILE SYSTEM CLEAN > <118>/dev/zvol/tank/VMs/current/i386/disk0s1a: 114555 files, 255948 = used,=20 > 251835 free (403 frags, 31429 blocks, 0.1% fragmentation) > <118>/dev/zvol/tank/VMs/current/i386/disk0s1d: 22759 files, 126960 = used,=20 > 380823 free (143 frags, 47585 blocks, 0.0% fragmentation) > <118>/dev/zvol/tank/VMs/current/i386/disk0s1e: 28564 files, 549004 = used,=20 > 973507 free (1603 frags, 121488 blocks, 0.1% fragmentation) > <118>Mounting local filesystems:. > <118>Mounting ZFS filesystems: (193/193) > <118>Local package initialization:error: ed0: No such device exists=20 > (BIOCSETIF failed: Device not configured) > <118>Unable to read the configuration file: No such file or directory = at=20 > /usr/local/lib/perl5/site_perl/Jail.pm line 50. > <118>Compilation failed in require at /usr/local/sbin/jailadmin line = 13. > <118>BEGIN failed--compilation aborted at /usr/local/sbin/jailadmin = line 13. > <118> Jails. > <118>Autoloading module: acpi_wmi > acpi_wmi0: on acpi0 > acpi_wmi0: Embedded MOF found > ACPI: \_SB.AMWA.WQEE: 1 arguments were passed to a non-method ACPI = object=20 > (Buffer) (20210730/nsarguments-361) > acpi_wmi1: on acpi0 > acpi_wmi1: Embedded MOF found > ACPI: \_SB.AMW0.WQDD: 1 arguments were passed to a non-method ACPI = object=20 > (Buffer) (20210730/nsarguments-361) > <118>Updating CPU Microcode... > CPU: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (2294.83-MHz K8-class = CPU) > Origin=3D"GenuineIntel" Id=3D0x206a7 Family=3D0x6 Model=3D0x2a = Stepping=3D7 > = Features=3D0xbfebfbff CA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > = Features2=3D0x1dbae3bf = 16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,XSAVE,OSXSAVE,AVX> > AMD Features=3D0x28100800 > AMD Features2=3D0x1 > Structured Extended = Features3=3D0x9c000400 > XSAVE Features=3D0x1 > VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID > TSC: P-state invariant, performance statistics > <118>Done. > <118>ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib=20= > /usr/local/lib/compat/pkg /usr/local/krb5/lib /usr/local/kde4/lib=20 > /usr/local/dt/lib /usr/local/lib/compat/pkg /usr/local/lib/dovecot=20 > /usr/local/lib/e2fsprogs /usr/local/lib/expect5.45.4=20 > /usr/local/lib/freeradius-3.0.23 /usr/local/lib/gcc10 = /usr/local/lib/gcc11=20 > /usr/local/lib/gcc12 /usr/local/lib/gcc8 /usr/local/lib/gcc9=20 > /usr/local/lib/graphviz /usr/local/lib/httrack /usr/local/lib/itcl3.4=20= > /usr/local/lib/mysql /usr/local/lib/mysql/plugin = /usr/local/lib/opencollada=20 > /usr/local/lib/perl5/5.30/mach/CORE = /usr/local/lib/perl5/5.32/mach/CORE=20 > /usr/local/lib/perl5/5.34/mach/CORE /usr/local/lib/pidgin=20 > /usr/local/lib/pth /usr/local/lib/qt5 /usr/local/lib/samba4=20 > /usr/local/lib/xrdp /usr/local/libexec/openldap = /usr/local/llvm-devel/lib=20 > /usr/local/llvm10/lib /usr/local/llvm11/lib /usr/local/llvm12/lib=20 > /usr/local/llvm70/lib /usr/local/llvm80/lib /usr/local/llvm90/lib=20 > /usr/local/share/chromium > <118>32-bit compatibility ldconfig path: /usr/lib32=20 > /alt/i386/root/usr/local/lib > <118>Setting hostname: slippy. > <118>Setting up harvesting: = [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER > ],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED > <118>Feeding entropy: . > <118>Starting ippool. > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > present in pool > <118>Additional TCP/IP options: rfc1323 extensions=3DNO. > <118>Enabling ipfilter. > <118>Installing NAT rules. > <118>0 entries flushed from NAT table > <118>0 entries flushed from NAT list > <118>Starting ipmon. > <6>wlan0: Ethernet address: 20:6a:8a:72:03:17 > <118>Created wlan(4) interfaces: wlan0. > <6>bridge0: Ethernet address: 58:9c:fc:10:ff:c8 > <118>Created clone interfaces: lagg0 bridge0. > <6>lo0: link state changed to UP > <6>bge0: link state changed to DOWN > iwn0: iwn_read_firmware: ucode rev=3D0x12a80601 > <118>Starting wpa_supplicant. > <6>lagg0: link state changed to DOWN > <6>lagg0: IPv6 addresses on wlan0 have been removed before adding it = as a=20 > member to prevent IPv6 address scope violation. > iwn0: iwn_read_firmware: ucode rev=3D0x12a80601 > <6>wlan0: link state changed to UP > <6>lagg0: link state changed to UP > <6>bge0: link state changed to UP >=20 >=20 > Fatal trap 12: page fault while in kernel mode > cpuid =3D 0; apic id =3D 00 > fault virtual address =3D 0x128 > fault code =3D supervisor read data, page not present > instruction pointer =3D 0x20:0xffffffff806cb53d > stack pointer =3D 0x28:0xfffffe00831a3210 > frame pointer =3D 0x28:0xfffffe00831a3210 > code segment =3D base 0x0, limit 0xfffff, type 0x1b > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > current process =3D 0 (bge0 taskq) > trap number =3D 12 > panic: page fault > cpuid =3D 0 > time =3D 1629610531 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame=20 > 0xfffffe00831a2eb0 > vpanic() at vpanic+0x187/frame 0xfffffe00831a2f10 > panic() at panic+0x43/frame 0xfffffe00831a2f70 > trap_fatal() at trap_fatal+0x387/frame 0xfffffe00831a2fd0 > trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00831a3030 > trap() at trap+0x26a/frame 0xfffffe00831a3140 > calltrap() at calltrap+0x8/frame 0xfffffe00831a3140 > --- trap 0xc, rip =3D 0xffffffff806cb53d, rsp =3D 0xfffffe00831a3210, = rbp =3D=20 > 0xfffffe00831a3210 --- > __rw_rlock_int() at __rw_rlock_int+0xd/frame 0xfffffe00831a3210 > in6_lltable_lookup() at in6_lltable_lookup+0xa7/frame = 0xfffffe00831a3240 > nd6_lookup() at nd6_lookup+0x4e/frame 0xfffffe00831a3270 > pfxlist_onlink_check() at pfxlist_onlink_check+0xfb/frame = 0xfffffe00831a3310 > nd6_ra_input() at nd6_ra_input+0x147f/frame 0xfffffe00831a35d0 > icmp6_input() at icmp6_input+0x685/frame 0xfffffe00831a37b0 > ip6_input() at ip6_input+0xa9a/frame 0xfffffe00831a3890 > netisr_dispatch_src() at netisr_dispatch_src+0xca/frame = 0xfffffe00831a38e0 > ether_demux() at ether_demux+0x138/frame 0xfffffe00831a3910 > ether_nh_input() at ether_nh_input+0x34e/frame 0xfffffe00831a3970 > netisr_dispatch_src() at netisr_dispatch_src+0xca/frame = 0xfffffe00831a39c0 > ether_input() at ether_input+0x69/frame 0xfffffe00831a3a20 > if_input() at if_input+0xa/frame 0xfffffe00831a3a30 > bge_rxeof() at bge_rxeof+0x4dc/frame 0xfffffe00831a3ab0 > bge_intr_task() at bge_intr_task+0x1a7/frame 0xfffffe00831a3b00 > taskqueue_run_locked() at taskqueue_run_locked+0x191/frame=20 > 0xfffffe00831a3b80 > taskqueue_thread_loop() at taskqueue_thread_loop+0xc3/frame=20 > 0xfffffe00831a3bb0 > fork_exit() at fork_exit+0x8a/frame 0xfffffe00831a3bf0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00831a3bf0 > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > Uptime: 1m28s > Dumping 512 out of 7972 = MB:..4%..13%..22%..32%..41%..54%..63%..72%..82%..91% >=20 > __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:55 > 55 __asm("movq %%gs:%P1,%0" : "=3Dr" (td) : "n" = (offsetof(struct pcpu, > (kgdb) bt > #0 __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:55 > #1 doadump (textdump=3Dtextdump@entry=3D1) at = /opt/src/git-src/sys/kern/kern_sh > utdown.c:399 > #2 0xffffffff806cf9ab in kern_reboot (howto=3D260) at=20 > /opt/src/git-src/sys/kern/kern_shutdown.c:486 > #3 0xffffffff806cfe26 in vpanic (fmt=3D0xffffffff80a94e2f "%s",=20 > ap=3D) at /opt/src/git-src/sys/kern/kern_shutdown.c:919 > #4 0xffffffff806cfc23 in panic (fmt=3D) at=20 > /opt/src/git-src/sys/kern/kern_shutdown.c:843 > #5 0xffffffff80a342c7 in trap_fatal (frame=3D0xfffffe00831a3150, = eva=3D296) at=20 > /opt/src/git-src/sys/amd64/amd64/trap.c:946 > #6 0xffffffff80a3431f in trap_pfault = (frame=3Dframe@entry=3D0xfffffe00831a3150, > usermode=3Dfalse, signo=3D, signo@entry=3D0x0, = ucode=3D out>, ucode@entry=3D0x0) at = /opt/src/git-src/sys/amd64/amd64/trap.c:765 > #7 0xffffffff80a3399a in trap (frame=3D0xfffffe00831a3150) at=20 > /opt/src/git-src/sys/amd64/amd64/trap.c:443 > #8 > #9 __rw_rlock_int (rw=3D0x110) at = /opt/src/git-src/sys/kern/kern_rwlock.c:679 > #10 0xffffffff8087cd07 in in6_lltable_lookup (llt=3D,=20= > flags=3D, l3addr=3D) at = /opt/src/git-src/sys/netin > et6/in6.c:2349 > #11 0xffffffff80897dae in lla_lookup (llt=3D0x110, flags=3D2374593664,=20= > flags@entry=3D0, l3addr=3D0xfffffe00831a3250) at = /opt/src/git-src/sys/net/if_lla > tbl.h:261 > #12 nd6_lookup (addr6=3D, flags=3D-1920373632, = flags@entry=3D0,=20 > ifp=3D) at /opt/src/git-src/sys/netinet6/nd6.c:1204 > #13 0xffffffff8089ff7b in find_pfxlist_reachable_router=20 > (pr=3D0xfffff8002b64f100) at = /opt/src/git-src/sys/netinet6/nd6_rtr.c:1817 > #14 pfxlist_onlink_check () at = /opt/src/git-src/sys/netinet6/nd6_rtr.c:1861 > #15 0xffffffff8089fc5f in nd6_ra_input (m=3D,=20 > m@entry=3D0xfffff8003a3e1d00, off=3D, = icmp6len=3D,=20 > icmp6len@entry=3D48) at /opt/src/git-src/sys/netinet6/nd6_rtr.c:597 > #16 0xffffffff80874aa5 in icmp6_input (mp=3D0xfffffe00831a37f8,=20 > offp=3D0xfffffe00831a37f0, proto=3D) at=20 > /opt/src/git-src/sys/netinet6/icmp6.c:780 > #17 0xffffffff8088beca in ip6_input (m=3D0xfffff8003a3e1d00) at=20 > /opt/src/git-src/sys/netinet6/ip6_input.c:929 > #18 0xffffffff80806d6a in netisr_dispatch_src (proto=3D6, = source=3D out>, source@entry=3D0, m=3D0x0) at = /opt/src/git-src/sys/net/netisr.c:1143 > #19 0xffffffff8080704f in netisr_dispatch (proto=3D272, m=3D0x10) at=20= > /opt/src/git-src/sys/net/netisr.c:1234 > #20 0xffffffff807f3d58 in ether_demux = (ifp=3Difp@entry=3D0xfffff8003a30e800,=20 > m=3D0xfffffe008d896c80) at /opt/src/git-src/sys/net/if_ethersubr.c:925 > #21 0xffffffff807f50fe in ether_input_internal = (ifp=3D0xfffff8003a30e800,=20 > m=3D0xfffffe008d896c80) at /opt/src/git-src/sys/net/if_ethersubr.c:711 > #22 ether_nh_input (m=3D) at = /opt/src/git-src/sys/net/if_ethers > ubr.c:741 > #23 0xffffffff80806d6a in netisr_dispatch_src (proto=3Dproto@entry=3D5,=20= > source=3D, source@entry=3D0, m=3D0x0, = m@entry=3D0xfffff8003a3e1d00)=20 > at /opt/src/git-src/sys/net/netisr.c:1143 > #24 0xffffffff8080704f in netisr_dispatch (proto=3D272, proto@entry=3D5,= =20 > m=3D0x10, m@entry=3D0xfffff8003a3e1d00) at = /opt/src/git-src/sys/net/netisr.c:123 > 4 > #25 0xffffffff807f41a9 in ether_input (ifp=3D,=20 > m=3D0xfffff8003a3e1d00) at /opt/src/git-src/sys/net/if_ethersubr.c:832 > #26 0xffffffff807f042a in if_input (ifp=3D0x110, = ifp@entry=3D0xfffff8000516b800, > sendmp=3D0xfffffe008d896c80, sendmp@entry=3D0xfffff8003a3e1d00) at=20 > /opt/src/git-src/sys/net/if.c:4444 > #27 0xffffffff818eaabc in bge_rxeof (sc=3D,=20 > sc@entry=3D0xfffffe00107d0000, rx_prod=3Drx_prod@entry=3D2,=20 > holdlck=3Dholdlck@entry=3D0) at = /opt/src/git-src/sys/dev/bge/if_bge.c:4436 > #28 0xffffffff818e7d57 in bge_intr_task (arg=3D0xfffffe00107d0000,=20 > pending=3D) at = /opt/src/git-src/sys/dev/bge/if_bge.c:4666 > #29 0xffffffff80731d81 in taskqueue_run_locked = (queue=3Dqueue@entry=3D0xfffff800 > 03890600) at /opt/src/git-src/sys/kern/subr_taskqueue.c:476 > #30 0xffffffff80733073 in taskqueue_thread_loop (arg=3D,=20 > arg@entry=3D0xfffffe00107d7568) at = /opt/src/git-src/sys/kern/subr_taskqueue.c: > 793 > #31 0xffffffff8068b80a in fork_exit (callout=3D0xffffffff80732fb0=20 > , arg=3D0xfffffe00107d7568, = frame=3D0xfffffe00831a3c00)=20 > at /opt/src/git-src/sys/kern/kern_fork.c:1087 > #32 > (kgdb) frame 9 > #9 __rw_rlock_int (rw=3D0x110) at = /opt/src/git-src/sys/kern/kern_rwlock.c:679 > 679 v =3D RW_READ_VALUE(rw); > (kgdb) l > 674 KASSERT(rw_wowner(rw) !=3D td, > 675 ("rw_rlock: wlock already held for %s @ %s:%d", > 676 rw->lock_object.lo_name, file, line)); > 677 WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, = line, NULL); > 678=09 > 679 v =3D RW_READ_VALUE(rw); > 680 if = (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__acquire) || > 681 !__rw_rlock_try(rw, td, &v, true = LOCK_FILE_LINE_ARG))) > 682 __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG); > 683 else > (kgdb) p rw > $1 =3D (struct rwlock *) 0x110 > (kgdb) frame 10 > #10 0xffffffff8087cd07 in in6_lltable_lookup (llt=3D,=20= > flags=3D, l3addr=3D) at = /opt/src/git-src/sys/netin > et6/in6.c:2349 > 2349 LLE_RLOCK(lle); > (kgdb) l > 2344 return (lle); > 2345=09 > 2346 if (flags & LLE_EXCLUSIVE) > 2347 LLE_WLOCK(lle); > 2348 else > 2349 LLE_RLOCK(lle); > 2350=09 > 2351 /* > 2352 * If the afdata lock is not held, the LLE may have been = unlinked=20 > while > 2353 * we were blocked on the LLE lock. Check for this = case. > (kgdb) p lle > $2 =3D (struct llentry *) 0x0 > (kgdb)=20 >=20 >=20 >=20 > --=20 > Cheers, > Cy Schubert > > FreeBSD UNIX: > Web: = https://FreeBSD.org > NTP: > Web: = https://nwtime.org >=20 > The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Sun Aug 22 09:39:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4954E6515E0; Sun, 22 Aug 2021 09:39:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gsr211Nc0z4sVN; Sun, 22 Aug 2021 09:39:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 178DD1E894; Sun, 22 Aug 2021 09:39:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17M9dqSc066800; Sun, 22 Aug 2021 09:39:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17M9dqfp066799; Sun, 22 Aug 2021 09:39:52 GMT (envelope-from git) Date: Sun, 22 Aug 2021 09:39:52 GMT Message-Id: <202108220939.17M9dqfp066799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vincenzo Maffione Subject: git: 98399ab06f6c - main - netmap: import changes from upstream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98399ab06f6c6adbd795266bc8a45e3f804ac6f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 09:39:53 -0000 The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=98399ab06f6c6adbd795266bc8a45e3f804ac6f8 commit 98399ab06f6c6adbd795266bc8a45e3f804ac6f8 Author: Vincenzo Maffione AuthorDate: 2021-08-22 09:31:05 +0000 Commit: Vincenzo Maffione CommitDate: 2021-08-22 09:31:05 +0000 netmap: import changes from upstream - make sure rings are disabled during resets - introduce netmap_update_hostrings_mode(), with support for multiple host rings - always initialize ni_bufs_head in netmap_if ni_bufs_head was not properly initialized when no external buffers were requestedx and contained the ni_bufs_head from the last request. This was causing spurious buffer frees when alternating between apps that used external buffers and apps that did not use them. - check na validitity under lock on detach - netmap_mem: fix leak on error path - nm_dispatch: fix compilation on Raspberry Pi MFC after: 2 weeks --- sys/dev/netmap/netmap.c | 36 +++++++++++++++++++++++++++++++----- sys/dev/netmap/netmap_kern.h | 10 ---------- sys/dev/netmap/netmap_mem2.c | 7 ++++--- sys/net/netmap_user.h | 2 +- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 9f1edb246cae..ed3154a524db 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -1002,6 +1002,22 @@ netmap_mem_drop(struct netmap_adapter *na) } } +static void +netmap_update_hostrings_mode(struct netmap_adapter *na) +{ + enum txrx t; + struct netmap_kring *kring; + int i; + + for_rx_tx(t) { + for (i = nma_get_nrings(na, t); + i < netmap_real_rings(na, t); i++) { + kring = NMR(na, t)[i]; + kring->nr_mode = kring->nr_pending_mode; + } + } +} + /* * Undo everything that was done in netmap_do_regif(). In particular, * call nm_register(ifp,0) to stop netmap mode on the interface and @@ -1032,7 +1048,9 @@ netmap_do_unregif(struct netmap_priv_d *priv) #endif if (na->active_fds <= 0 || nm_kring_pending(priv)) { + netmap_set_all_rings(na, NM_KR_LOCKED); na->nm_register(na, 0); + netmap_set_all_rings(na, 0); } /* delete rings and buffers that are no longer needed */ @@ -2630,7 +2648,9 @@ netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, if (nm_kring_pending(priv)) { /* Some kring is switching mode, tell the adapter to * react on this. */ + netmap_set_all_rings(na, NM_KR_LOCKED); error = na->nm_register(na, 1); + netmap_set_all_rings(na, 0); if (error) goto err_del_if; } @@ -2858,6 +2878,8 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data, &nifp->ni_bufs_head, req->nr_extra_bufs); if (netmap_verbose) nm_prinf("got %d extra buffers", req->nr_extra_bufs); + } else { + nifp->ni_bufs_head = 0; } req->nr_offset = netmap_mem_if_offset(na->nm_mem, nifp); @@ -4178,12 +4200,16 @@ netmap_hw_krings_create(struct netmap_adapter *na) void netmap_detach(struct ifnet *ifp) { - struct netmap_adapter *na = NA(ifp); + struct netmap_adapter *na; - if (!na) + NMG_LOCK(); + + if (!NM_NA_VALID(ifp)) { + NMG_UNLOCK(); return; + } - NMG_LOCK(); + na = NA(ifp); netmap_set_all_rings(na, NM_KR_LOCKED); /* * if the netmap adapter is not native, somebody @@ -4491,7 +4517,7 @@ nm_set_native_flags(struct netmap_adapter *na) na->na_flags |= NAF_NETMAP_ON; nm_os_onenter(ifp); - nm_update_hostrings_mode(na); + netmap_update_hostrings_mode(na); } void @@ -4505,7 +4531,7 @@ nm_clear_native_flags(struct netmap_adapter *na) return; } - nm_update_hostrings_mode(na); + netmap_update_hostrings_mode(na); nm_os_onexit(ifp); na->na_flags &= ~NAF_NETMAP_ON; diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index cc452657d8d5..5d8957241c21 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -1435,16 +1435,6 @@ nm_iszombie(struct netmap_adapter *na) return na == NULL || (na->na_flags & NAF_ZOMBIE); } -static inline void -nm_update_hostrings_mode(struct netmap_adapter *na) -{ - /* Process nr_mode and nr_pending_mode for host rings. */ - na->tx_rings[na->num_tx_rings]->nr_mode = - na->tx_rings[na->num_tx_rings]->nr_pending_mode; - na->rx_rings[na->num_rx_rings]->nr_mode = - na->rx_rings[na->num_rx_rings]->nr_pending_mode; -} - void nm_set_native_flags(struct netmap_adapter *); void nm_clear_native_flags(struct netmap_adapter *); diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c index e6c83efe9ea9..a6be490e5b09 100644 --- a/sys/dev/netmap/netmap_mem2.c +++ b/sys/dev/netmap/netmap_mem2.c @@ -1706,7 +1706,7 @@ _netmap_mem_private_new(size_t size, struct netmap_obj_params *p, int grp_id, if (memtotal < poolsz) { nm_prerr("%s: request too large", d->pools[i].name); err = ENOMEM; - goto error; + goto error_rel_id; } memtotal -= poolsz; } @@ -1731,14 +1731,15 @@ _netmap_mem_private_new(size_t size, struct netmap_obj_params *p, int grp_id, err = netmap_mem_config(d); if (err) - goto error_rel_id; + goto error_destroy_lock; d->flags &= ~NETMAP_MEM_FINALIZED; return d; -error_rel_id: +error_destroy_lock: NMA_LOCK_DESTROY(d); +error_rel_id: nm_mem_release_id(d); error_free: nm_os_free(d); diff --git a/sys/net/netmap_user.h b/sys/net/netmap_user.h index 06b159d9bfe7..e17d2dcbe357 100644 --- a/sys/net/netmap_user.h +++ b/sys/net/netmap_user.h @@ -1131,7 +1131,7 @@ nm_dispatch(struct nm_desc *d, int cnt, nm_cb_t cb, u_char *arg) slot = &ring->slot[i]; d->hdr.len += slot->len; nbuf = (u_char *)NETMAP_BUF(ring, slot->buf_idx); - if (oldbuf != NULL && nbuf - oldbuf == ring->nr_buf_size && + if (oldbuf != NULL && (uint32_t)(nbuf - oldbuf) == ring->nr_buf_size && oldlen == ring->nr_buf_size) { d->hdr.caplen += slot->len; oldbuf = nbuf; From owner-dev-commits-src-all@freebsd.org Sun Aug 22 11:04:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50BD7652CFC; Sun, 22 Aug 2021 11:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gssw21F9Bz3m5k; Sun, 22 Aug 2021 11:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CC1F1F7FD; Sun, 22 Aug 2021 11:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MB4ndF086660; Sun, 22 Aug 2021 11:04:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MB4n5W086658; Sun, 22 Aug 2021 11:04:49 GMT (envelope-from git) Date: Sun, 22 Aug 2021 11:04:49 GMT Message-Id: <202108221104.17MB4n5W086658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Thomas Munro Subject: git: f30a1ae8d529 - main - lio_listio(2): Allow LIO_READV and LIO_WRITEV. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tmunro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f30a1ae8d5290a52e898279bafc38556bf16bed8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 11:04:50 -0000 The branch main has been updated by tmunro: URL: https://cgit.FreeBSD.org/src/commit/?id=f30a1ae8d5290a52e898279bafc38556bf16bed8 commit f30a1ae8d5290a52e898279bafc38556bf16bed8 Author: Thomas Munro AuthorDate: 2021-08-22 09:48:59 +0000 Commit: Thomas Munro CommitDate: 2021-08-22 11:00:42 +0000 lio_listio(2): Allow LIO_READV and LIO_WRITEV. Allow multiple vector IOs to be started with one system call. aio_readv() and aio_writev() already used these opcodes under the covers. This commit makes them available to user space. Being non-standard extensions, they're only visible if __BSD_VISIBLE is defined, like the functions. Reviewed by: asomers, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31627 --- lib/libc/sys/lio_listio.2 | 16 ++++++- sys/kern/vfs_aio.c | 4 ++ sys/sys/aio.h | 4 +- tests/sys/aio/lio_test.c | 109 ++++++++++++++++++++++++++++++++++++---------- usr.bin/truss/syscalls.c | 2 +- 5 files changed, 110 insertions(+), 25 deletions(-) diff --git a/lib/libc/sys/lio_listio.2 b/lib/libc/sys/lio_listio.2 index 0e04e7c88338..ef1b1add3376 100644 --- a/lib/libc/sys/lio_listio.2 +++ b/lib/libc/sys/lio_listio.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2019 +.Dd August 22, 2021 .Dt LIO_LISTIO 2 .Os .Sh NAME @@ -66,11 +66,17 @@ The following operations are supported: .It Dv LIO_READ Read data as if by a call to .Xr aio_read 2 . +.It Dv LIO_READV +Read data as if by a call to +.Xr aio_readv 2 . .It Dv LIO_NOP No operation. .It Dv LIO_WRITE Write data as if by a call to .Xr aio_write 2 . +.It Dv LIO_WRITEV +Write data as if by a call to +.Xr aio_writev 2 . .El .Pp If the @@ -205,7 +211,9 @@ structure individually by calling .Sh SEE ALSO .Xr aio_error 2 , .Xr aio_read 2 , +.Xr aio_readv 2 , .Xr aio_write 2 , +.Xr aio_writev 2 , .Xr read 2 , .Xr write 2 , .Xr sigevent 3 , @@ -216,6 +224,12 @@ The .Fn lio_listio function is expected to conform to .St -p1003.1-2001 . +The +.Dv LIO_READV +and +.Dv LIO_WRITEV +operations are +.Fx extensions, and should not be used in portable code. .Sh HISTORY The .Fn lio_listio diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 7d4d9ac3e94b..602c91b542de 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1419,6 +1419,8 @@ aiocb_copyin(struct aiocb *ujob, struct kaiocb *kjob, int type) error = copyin(ujob, kcb, sizeof(struct aiocb)); if (error) return (error); + if (type == LIO_NOP) + type = kcb->aio_lio_opcode; if (type & LIO_VECTORED) { /* malloc a uio and copy in the iovec */ error = copyinuio(__DEVOLATILE(struct iovec*, kcb->aio_iov), @@ -1557,8 +1559,10 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, if (type == LIO_NOP) { switch (job->uaiocb.aio_lio_opcode) { case LIO_WRITE: + case LIO_WRITEV: case LIO_NOP: case LIO_READ: + case LIO_READV: opcode = job->uaiocb.aio_lio_opcode; break; default: diff --git a/sys/sys/aio.h b/sys/sys/aio.h index d3e03efa310e..7b931d04febc 100644 --- a/sys/sys/aio.h +++ b/sys/sys/aio.h @@ -43,10 +43,12 @@ #define LIO_NOP 0x0 #define LIO_WRITE 0x1 #define LIO_READ 0x2 -#if defined(_KERNEL) || defined(_WANT_ALL_LIO_OPCODES) +#if __BSD_VISIBLE #define LIO_VECTORED 0x4 #define LIO_WRITEV (LIO_WRITE | LIO_VECTORED) #define LIO_READV (LIO_READ | LIO_VECTORED) +#endif +#if defined(_KERNEL) || defined(_WANT_ALL_LIO_OPCODES) #define LIO_SYNC 0x8 #define LIO_DSYNC (0x10 | LIO_SYNC) #define LIO_MLOCK 0x20 diff --git a/tests/sys/aio/lio_test.c b/tests/sys/aio/lio_test.c index a4f5a6a38632..720fcc1fa94f 100644 --- a/tests/sys/aio/lio_test.c +++ b/tests/sys/aio/lio_test.c @@ -210,15 +210,96 @@ ATF_TC_BODY(lio_listio_empty_nowait_thread, tc) ATF_REQUIRE_EQ(0, sem_destroy(&completions)); } +/* + * A simple check that the allowed operations work. + */ +ATF_TC_WITHOUT_HEAD(lio_listio_opcodes); +ATF_TC_BODY(lio_listio_opcodes, tc) +{ + struct aiocb write_cb, read_cb, writev_cb, readv_cb; + struct aiocb *list[] = {&write_cb, &read_cb, &writev_cb, &readv_cb}; + struct iovec writev_iov[2]; + struct iovec readv_iov[2]; + char buffer[6]; + int fd; + + fd = open("testfile", O_CREAT | O_RDWR); + ATF_REQUIRE_MSG(fd >= 0, "open: %s", strerror(errno)); + + /* We start with numbers in a file and letters in memory... */ + ATF_CHECK_EQ(6, write(fd, "123456", 6)); + memcpy(buffer, "abcdef", 6); + + /* a -> 1 */ + bzero(&write_cb, sizeof(write_cb)); + write_cb.aio_sigevent.sigev_notify = SIGEV_NONE; + write_cb.aio_fildes = fd; + write_cb.aio_lio_opcode = LIO_WRITE; + write_cb.aio_buf = &buffer[0]; + write_cb.aio_nbytes = 1; + write_cb.aio_offset = 0; + + /* b <- 2 */ + bzero(&read_cb, sizeof(read_cb)); + read_cb.aio_sigevent.sigev_notify = SIGEV_NONE; + read_cb.aio_fildes = fd; + read_cb.aio_lio_opcode = LIO_READ; + read_cb.aio_buf = &buffer[1]; + read_cb.aio_nbytes = 1; + read_cb.aio_offset = 1; + + /* d -> 3, c -> 4 */ + writev_iov[0].iov_base = &buffer[3]; + writev_iov[0].iov_len = 1; + writev_iov[1].iov_base = &buffer[2]; + writev_iov[1].iov_len = 1; + bzero(&writev_cb, sizeof(writev_cb)); + writev_cb.aio_sigevent.sigev_notify = SIGEV_NONE; + writev_cb.aio_fildes = fd; + writev_cb.aio_lio_opcode = LIO_WRITEV; + writev_cb.aio_iov = &writev_iov; + writev_cb.aio_iovcnt = 2; + writev_cb.aio_offset = 2; + + /* f <- 5, e <- 6 */ + readv_iov[0].iov_base = &buffer[5]; + readv_iov[0].iov_len = 1; + readv_iov[1].iov_base = &buffer[4]; + readv_iov[1].iov_len = 1; + bzero(&readv_cb, sizeof(readv_cb)); + readv_cb.aio_sigevent.sigev_notify = SIGEV_NONE; + readv_cb.aio_fildes = fd; + readv_cb.aio_lio_opcode = LIO_READV; + readv_cb.aio_iov = &readv_iov; + readv_cb.aio_iovcnt = 2; + readv_cb.aio_offset = 4; + + ATF_CHECK_EQ(0, lio_listio(LIO_WAIT, list, nitems(list), NULL)); + ATF_CHECK_EQ(0, aio_error(&write_cb)); + ATF_CHECK_EQ(1, aio_return(&write_cb)); + ATF_CHECK_EQ(0, aio_error(&read_cb)); + ATF_CHECK_EQ(1, aio_return(&read_cb)); + ATF_CHECK_EQ(0, aio_error(&writev_cb)); + ATF_CHECK_EQ(2, aio_return(&writev_cb)); + ATF_CHECK_EQ(0, aio_error(&readv_cb)); + ATF_CHECK_EQ(2, aio_return(&readv_cb)); + + ATF_CHECK_EQ(0, memcmp(buffer, "a2cd65", 6)); + ATF_CHECK_EQ(6, pread(fd, buffer, 6, 0)); + ATF_CHECK_EQ(0, memcmp(buffer, "a2dc56", 6)); + + close(fd); +} + + /* * Only select opcodes are allowed with lio_listio */ ATF_TC_WITHOUT_HEAD(lio_listio_invalid_opcode); ATF_TC_BODY(lio_listio_invalid_opcode, tc) { - struct aiocb sync_cb, mlock_cb, writev_cb, readv_cb; - struct aiocb *list[] = {&sync_cb, &mlock_cb, &writev_cb, &readv_cb}; - struct iovec iov; + struct aiocb sync_cb, mlock_cb; + struct aiocb *list[] = {&sync_cb, &mlock_cb}; int fd; fd = open("testfile", O_CREAT | O_RDWR); @@ -231,30 +312,13 @@ ATF_TC_BODY(lio_listio_invalid_opcode, tc) bzero(&mlock_cb, sizeof(mlock_cb)); mlock_cb.aio_lio_opcode = LIO_MLOCK; - iov.iov_base = NULL; - iov.iov_len = 0; - - bzero(&readv_cb, sizeof(readv_cb)); - readv_cb.aio_fildes = fd; - readv_cb.aio_lio_opcode = LIO_READV; - readv_cb.aio_iov = &iov; - readv_cb.aio_iovcnt = 1; - - bzero(&writev_cb, sizeof(writev_cb)); - writev_cb.aio_fildes = fd; - writev_cb.aio_lio_opcode = LIO_WRITEV; - writev_cb.aio_iov = &iov; - writev_cb.aio_iovcnt = 1; - ATF_CHECK_ERRNO(EIO, lio_listio(LIO_WAIT, list, nitems(list), NULL)); ATF_CHECK_EQ(EINVAL, aio_error(&sync_cb)); ATF_CHECK_ERRNO(EINVAL, aio_return(&sync_cb) < 0); ATF_CHECK_EQ(EINVAL, aio_error(&mlock_cb)); ATF_CHECK_ERRNO(EINVAL, aio_return(&mlock_cb) < 0); - ATF_CHECK_EQ(EINVAL, aio_error(&readv_cb)); - ATF_CHECK_ERRNO(EINVAL, aio_return(&readv_cb) < 0); - ATF_CHECK_EQ(EINVAL, aio_error(&writev_cb)); - ATF_CHECK_ERRNO(EINVAL, aio_return(&writev_cb) < 0); + + close(fd); } @@ -267,6 +331,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, lio_listio_empty_nowait_signal); ATF_TP_ADD_TC(tp, lio_listio_empty_nowait_thread); ATF_TP_ADD_TC(tp, lio_listio_empty_wait); + ATF_TP_ADD_TC(tp, lio_listio_opcodes); ATF_TP_ADD_TC(tp, lio_listio_invalid_opcode); return (atf_no_error()); diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 8c3e833adaec..055235f052bc 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -754,7 +754,7 @@ static struct xlat lio_modes[] = { }; static struct xlat lio_opcodes[] = { - X(LIO_WRITE) X(LIO_READ) X(LIO_NOP) + X(LIO_WRITE) X(LIO_READ) X(LIO_READV) X(LIO_WRITEV) X(LIO_NOP) XEND }; From owner-dev-commits-src-all@freebsd.org Sun Aug 22 12:16:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5ADBF65461D; Sun, 22 Aug 2021 12:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsvVN1w39z4b6Y; Sun, 22 Aug 2021 12:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29B5C20828; Sun, 22 Aug 2021 12:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MCGC2S079645; Sun, 22 Aug 2021 12:16:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MCGCC6079644; Sun, 22 Aug 2021 12:16:12 GMT (envelope-from git) Date: Sun, 22 Aug 2021 12:16:12 GMT Message-Id: <202108221216.17MCGCC6079644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Thomas Munro Subject: git: 3904e7966eb3 - main - Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tmunro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3904e7966eb353c636c6aa638a6fdf1489ee514c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 12:16:12 -0000 The branch main has been updated by tmunro: URL: https://cgit.FreeBSD.org/src/commit/?id=3904e7966eb353c636c6aa638a6fdf1489ee514c commit 3904e7966eb353c636c6aa638a6fdf1489ee514c Author: Thomas Munro AuthorDate: 2021-08-22 11:34:07 +0000 Commit: Thomas Munro CommitDate: 2021-08-22 11:49:23 +0000 Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. Add missing wrapper code to librt for these new functions so that SIGEV_THREAD works. Without machinery to convert it to SIGEV_THREAD_ID, you got EINVAL. Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31618 --- lib/libc/sys/Symbol.map | 2 ++ lib/librt/Symbol.map | 5 +++++ lib/librt/aio.c | 18 ++++++++++++++++++ tests/sys/aio/aio_test.c | 7 +++++++ 4 files changed, 32 insertions(+) diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index 93fbc947a7e1..764d712958be 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -495,10 +495,12 @@ FBSDprivate_1.0 { __sys_aio_error; __sys_aio_fsync; __sys_aio_read; + __sys_aio_readv; __sys_aio_return; __sys_aio_suspend; __sys_aio_waitcomplete; __sys_aio_write; + __sys_aio_writev; _audit; __sys_audit; _auditctl; diff --git a/lib/librt/Symbol.map b/lib/librt/Symbol.map index c11b88397afd..b8fde3dd33b8 100644 --- a/lib/librt/Symbol.map +++ b/lib/librt/Symbol.map @@ -31,6 +31,11 @@ FBSD_1.5 { timer_oshandle_np; }; +FBSD_1.6 { + aio_readv; + aio_writev; +}; + FBSDprivate_1.0 { _mq_open; _mq_close; diff --git a/lib/librt/aio.c b/lib/librt/aio.c index 9c35644ecf3d..8e819a002613 100644 --- a/lib/librt/aio.c +++ b/lib/librt/aio.c @@ -42,7 +42,9 @@ #include "un-namespace.h" __weak_reference(__aio_read, aio_read); +__weak_reference(__aio_readv, aio_readv); __weak_reference(__aio_write, aio_write); +__weak_reference(__aio_writev, aio_writev); __weak_reference(__aio_return, aio_return); __weak_reference(__aio_waitcomplete, aio_waitcomplete); __weak_reference(__aio_fsync, aio_fsync); @@ -51,7 +53,9 @@ __weak_reference(__lio_listio, lio_listio); typedef void (*aio_func)(union sigval val, struct aiocb *iocb); extern int __sys_aio_read(struct aiocb *iocb); +extern int __sys_aio_readv(struct aiocb *iocb); extern int __sys_aio_write(struct aiocb *iocb); +extern int __sys_aio_writev(struct aiocb *iocb); extern ssize_t __sys_aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout); extern ssize_t __sys_aio_return(struct aiocb *iocb); extern int __sys_aio_error(struct aiocb *iocb); @@ -130,6 +134,13 @@ __aio_read(struct aiocb *iocb) return aio_io(iocb, &__sys_aio_read); } +int +__aio_readv(struct aiocb *iocb) +{ + + return aio_io(iocb, &__sys_aio_readv); +} + int __aio_write(struct aiocb *iocb) { @@ -137,6 +148,13 @@ __aio_write(struct aiocb *iocb) return aio_io(iocb, &__sys_aio_write); } +int +__aio_writev(struct aiocb *iocb) +{ + + return aio_io(iocb, &__sys_aio_writev); +} + ssize_t __aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout) { diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c index 35bd5dc1264b..1c694ad0c18b 100644 --- a/tests/sys/aio/aio_test.c +++ b/tests/sys/aio/aio_test.c @@ -1627,6 +1627,12 @@ ATF_TC_BODY(vectored_file_poll, tc) aio_file_test(poll, NULL, true); } +ATF_TC_WITHOUT_HEAD(vectored_thread); +ATF_TC_BODY(vectored_thread, tc) +{ + aio_file_test(poll_signaled, setup_thread(), true); +} + ATF_TC_WITH_CLEANUP(vectored_md_poll); ATF_TC_HEAD(vectored_md_poll, tc) { @@ -1814,6 +1820,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, vectored_zvol_poll); ATF_TP_ADD_TC(tp, vectored_unaligned); ATF_TP_ADD_TC(tp, vectored_socket_poll); + ATF_TP_ADD_TC(tp, vectored_thread); return (atf_no_error()); } From owner-dev-commits-src-all@freebsd.org Sun Aug 22 14:15:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 298D8655D81; Sun, 22 Aug 2021 14:15:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gsy815tF8z3M5n; Sun, 22 Aug 2021 14:15:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 17MEFDQK061734 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 22 Aug 2021 17:15:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 17MEFDQK061734 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 17MEFDRa061732; Sun, 22 Aug 2021 17:15:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Aug 2021 17:15:13 +0300 From: Konstantin Belousov To: Thomas Munro Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3904e7966eb3 - main - Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. Message-ID: References: <202108221216.17MCGCC6079644@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202108221216.17MCGCC6079644@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4Gsy815tF8z3M5n X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 14:15:30 -0000 On Sun, Aug 22, 2021 at 12:16:12PM +0000, Thomas Munro wrote: > The branch main has been updated by tmunro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3904e7966eb353c636c6aa638a6fdf1489ee514c > > commit 3904e7966eb353c636c6aa638a6fdf1489ee514c > Author: Thomas Munro > AuthorDate: 2021-08-22 11:34:07 +0000 > Commit: Thomas Munro > CommitDate: 2021-08-22 11:49:23 +0000 > > Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. > > Add missing wrapper code to librt for these new functions so that > SIGEV_THREAD works. Without machinery to convert it to SIGEV_THREAD_ID, > you got EINVAL. > > Reviewed by: asomers > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D31618 > --- > lib/libc/sys/Symbol.map | 2 ++ > lib/librt/Symbol.map | 5 +++++ > lib/librt/aio.c | 18 ++++++++++++++++++ > tests/sys/aio/aio_test.c | 7 +++++++ > 4 files changed, 32 insertions(+) > > diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map > index 93fbc947a7e1..764d712958be 100644 > --- a/lib/libc/sys/Symbol.map > +++ b/lib/libc/sys/Symbol.map > @@ -495,10 +495,12 @@ FBSDprivate_1.0 { > __sys_aio_error; > __sys_aio_fsync; > __sys_aio_read; > + __sys_aio_readv; > __sys_aio_return; > __sys_aio_suspend; > __sys_aio_waitcomplete; > __sys_aio_write; > + __sys_aio_writev; > _audit; > __sys_audit; > _auditctl; > diff --git a/lib/librt/Symbol.map b/lib/librt/Symbol.map > index c11b88397afd..b8fde3dd33b8 100644 > --- a/lib/librt/Symbol.map > +++ b/lib/librt/Symbol.map > @@ -31,6 +31,11 @@ FBSD_1.5 { > timer_oshandle_np; > }; > > +FBSD_1.6 { > + aio_readv; > + aio_writev; > +}; This must be FBSD_1.7. > + > FBSDprivate_1.0 { > _mq_open; > _mq_close; > diff --git a/lib/librt/aio.c b/lib/librt/aio.c > index 9c35644ecf3d..8e819a002613 100644 > --- a/lib/librt/aio.c > +++ b/lib/librt/aio.c > @@ -42,7 +42,9 @@ > #include "un-namespace.h" > > __weak_reference(__aio_read, aio_read); > +__weak_reference(__aio_readv, aio_readv); > __weak_reference(__aio_write, aio_write); > +__weak_reference(__aio_writev, aio_writev); > __weak_reference(__aio_return, aio_return); > __weak_reference(__aio_waitcomplete, aio_waitcomplete); > __weak_reference(__aio_fsync, aio_fsync); > @@ -51,7 +53,9 @@ __weak_reference(__lio_listio, lio_listio); > typedef void (*aio_func)(union sigval val, struct aiocb *iocb); > > extern int __sys_aio_read(struct aiocb *iocb); > +extern int __sys_aio_readv(struct aiocb *iocb); > extern int __sys_aio_write(struct aiocb *iocb); > +extern int __sys_aio_writev(struct aiocb *iocb); > extern ssize_t __sys_aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout); > extern ssize_t __sys_aio_return(struct aiocb *iocb); > extern int __sys_aio_error(struct aiocb *iocb); > @@ -130,6 +134,13 @@ __aio_read(struct aiocb *iocb) > return aio_io(iocb, &__sys_aio_read); > } > > +int > +__aio_readv(struct aiocb *iocb) > +{ > + > + return aio_io(iocb, &__sys_aio_readv); > +} > + > int > __aio_write(struct aiocb *iocb) > { > @@ -137,6 +148,13 @@ __aio_write(struct aiocb *iocb) > return aio_io(iocb, &__sys_aio_write); > } > > +int > +__aio_writev(struct aiocb *iocb) > +{ > + > + return aio_io(iocb, &__sys_aio_writev); > +} > + > ssize_t > __aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout) > { > diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c > index 35bd5dc1264b..1c694ad0c18b 100644 > --- a/tests/sys/aio/aio_test.c > +++ b/tests/sys/aio/aio_test.c > @@ -1627,6 +1627,12 @@ ATF_TC_BODY(vectored_file_poll, tc) > aio_file_test(poll, NULL, true); > } > > +ATF_TC_WITHOUT_HEAD(vectored_thread); > +ATF_TC_BODY(vectored_thread, tc) > +{ > + aio_file_test(poll_signaled, setup_thread(), true); > +} > + > ATF_TC_WITH_CLEANUP(vectored_md_poll); > ATF_TC_HEAD(vectored_md_poll, tc) > { > @@ -1814,6 +1820,7 @@ ATF_TP_ADD_TCS(tp) > ATF_TP_ADD_TC(tp, vectored_zvol_poll); > ATF_TP_ADD_TC(tp, vectored_unaligned); > ATF_TP_ADD_TC(tp, vectored_socket_poll); > + ATF_TP_ADD_TC(tp, vectored_thread); > > return (atf_no_error()); > } From owner-dev-commits-src-all@freebsd.org Sun Aug 22 14:18:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE3BB655E52; Sun, 22 Aug 2021 14:18:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GsyCy6dcvz3NMk; Sun, 22 Aug 2021 14:18:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 17MEIigW062337 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 22 Aug 2021 17:18:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 17MEIigW062337 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 17MEIi0J062336; Sun, 22 Aug 2021 17:18:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Aug 2021 17:18:44 +0300 From: Konstantin Belousov To: Thomas Munro Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3904e7966eb3 - main - Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. Message-ID: References: <202108221216.17MCGCC6079644@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4GsyCy6dcvz3NMk X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [1.22 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-0.46)[-0.456]; TO_DN_SOME(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(0.98)[0.976]; NEURAL_SPAM_SHORT(0.70)[0.702]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 14:18:55 -0000 On Sun, Aug 22, 2021 at 05:15:22PM +0300, Konstantin Belousov wrote: > On Sun, Aug 22, 2021 at 12:16:12PM +0000, Thomas Munro wrote: > > The branch main has been updated by tmunro: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3904e7966eb353c636c6aa638a6fdf1489ee514c > > > > commit 3904e7966eb353c636c6aa638a6fdf1489ee514c > > Author: Thomas Munro > > AuthorDate: 2021-08-22 11:34:07 +0000 > > Commit: Thomas Munro > > CommitDate: 2021-08-22 11:49:23 +0000 > > > > Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. > > > > Add missing wrapper code to librt for these new functions so that > > SIGEV_THREAD works. Without machinery to convert it to SIGEV_THREAD_ID, > > you got EINVAL. > > > > Reviewed by: asomers > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D31618 > > --- > > lib/libc/sys/Symbol.map | 2 ++ > > lib/librt/Symbol.map | 5 +++++ > > lib/librt/aio.c | 18 ++++++++++++++++++ > > tests/sys/aio/aio_test.c | 7 +++++++ > > 4 files changed, 32 insertions(+) > > > > diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map > > index 93fbc947a7e1..764d712958be 100644 > > --- a/lib/libc/sys/Symbol.map > > +++ b/lib/libc/sys/Symbol.map > > @@ -495,10 +495,12 @@ FBSDprivate_1.0 { > > __sys_aio_error; > > __sys_aio_fsync; > > __sys_aio_read; > > + __sys_aio_readv; > > __sys_aio_return; > > __sys_aio_suspend; > > __sys_aio_waitcomplete; > > __sys_aio_write; > > + __sys_aio_writev; > > _audit; > > __sys_audit; > > _auditctl; > > diff --git a/lib/librt/Symbol.map b/lib/librt/Symbol.map > > index c11b88397afd..b8fde3dd33b8 100644 > > --- a/lib/librt/Symbol.map > > +++ b/lib/librt/Symbol.map > > @@ -31,6 +31,11 @@ FBSD_1.5 { > > timer_oshandle_np; > > }; > > > > +FBSD_1.6 { > > + aio_readv; > > + aio_writev; > > +}; > This must be FBSD_1.7. No, I was wrong and the commit as is is right, assuming that the intent is to interpose libc symbols with librt functionality. Of course this is very fragile and would not work if e.g. librt is loaded after libc is linked in and symbols resolved. I fixed this (mostly) for libthr, but librt is not. > > > + > > FBSDprivate_1.0 { > > _mq_open; > > _mq_close; > > diff --git a/lib/librt/aio.c b/lib/librt/aio.c > > index 9c35644ecf3d..8e819a002613 100644 > > --- a/lib/librt/aio.c > > +++ b/lib/librt/aio.c > > @@ -42,7 +42,9 @@ > > #include "un-namespace.h" > > > > __weak_reference(__aio_read, aio_read); > > +__weak_reference(__aio_readv, aio_readv); > > __weak_reference(__aio_write, aio_write); > > +__weak_reference(__aio_writev, aio_writev); > > __weak_reference(__aio_return, aio_return); > > __weak_reference(__aio_waitcomplete, aio_waitcomplete); > > __weak_reference(__aio_fsync, aio_fsync); > > @@ -51,7 +53,9 @@ __weak_reference(__lio_listio, lio_listio); > > typedef void (*aio_func)(union sigval val, struct aiocb *iocb); > > > > extern int __sys_aio_read(struct aiocb *iocb); > > +extern int __sys_aio_readv(struct aiocb *iocb); > > extern int __sys_aio_write(struct aiocb *iocb); > > +extern int __sys_aio_writev(struct aiocb *iocb); > > extern ssize_t __sys_aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout); > > extern ssize_t __sys_aio_return(struct aiocb *iocb); > > extern int __sys_aio_error(struct aiocb *iocb); > > @@ -130,6 +134,13 @@ __aio_read(struct aiocb *iocb) > > return aio_io(iocb, &__sys_aio_read); > > } > > > > +int > > +__aio_readv(struct aiocb *iocb) > > +{ > > + > > + return aio_io(iocb, &__sys_aio_readv); > > +} > > + > > int > > __aio_write(struct aiocb *iocb) > > { > > @@ -137,6 +148,13 @@ __aio_write(struct aiocb *iocb) > > return aio_io(iocb, &__sys_aio_write); > > } > > > > +int > > +__aio_writev(struct aiocb *iocb) > > +{ > > + > > + return aio_io(iocb, &__sys_aio_writev); > > +} > > + > > ssize_t > > __aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout) > > { > > diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c > > index 35bd5dc1264b..1c694ad0c18b 100644 > > --- a/tests/sys/aio/aio_test.c > > +++ b/tests/sys/aio/aio_test.c > > @@ -1627,6 +1627,12 @@ ATF_TC_BODY(vectored_file_poll, tc) > > aio_file_test(poll, NULL, true); > > } > > > > +ATF_TC_WITHOUT_HEAD(vectored_thread); > > +ATF_TC_BODY(vectored_thread, tc) > > +{ > > + aio_file_test(poll_signaled, setup_thread(), true); > > +} > > + > > ATF_TC_WITH_CLEANUP(vectored_md_poll); > > ATF_TC_HEAD(vectored_md_poll, tc) > > { > > @@ -1814,6 +1820,7 @@ ATF_TP_ADD_TCS(tp) > > ATF_TP_ADD_TC(tp, vectored_zvol_poll); > > ATF_TP_ADD_TC(tp, vectored_unaligned); > > ATF_TP_ADD_TC(tp, vectored_socket_poll); > > + ATF_TP_ADD_TC(tp, vectored_thread); > > > > return (atf_no_error()); > > } From owner-dev-commits-src-all@freebsd.org Sun Aug 22 14:54:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1D416567C4; Sun, 22 Aug 2021 14:54:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gsz0r4TkSz3mF6; Sun, 22 Aug 2021 14:54:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 818EA22A7E; Sun, 22 Aug 2021 14:54:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MEsKEN090854; Sun, 22 Aug 2021 14:54:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MEsK9m090853; Sun, 22 Aug 2021 14:54:20 GMT (envelope-from git) Date: Sun, 22 Aug 2021 14:54:20 GMT Message-Id: <202108221454.17MEsK9m090853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: e81b2348d210 - stable/13 - Add zfskeys rc.d script for auto-loading encryption keys MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e81b2348d2101f33043e4a4ab3e24f4d69bac073 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 14:54:20 -0000 The branch stable/13 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=e81b2348d2101f33043e4a4ab3e24f4d69bac073 commit e81b2348d2101f33043e4a4ab3e24f4d69bac073 Author: Eirik Øverby AuthorDate: 2021-07-28 16:11:35 +0000 Commit: Allan Jude CommitDate: 2021-08-22 14:53:21 +0000 Add zfskeys rc.d script for auto-loading encryption keys ZFS in 13 supports encryption, but for the use case where keys are available in plaintext on disk there is no mechanism for automatically loading keys on startup. This script will, by default, look for any dataset with encryption and keylocation prefixed with file://. It will attempt to unlock, timing out after 10 seconds for each dataset found. User can optionally specify explicitly which datasets to attempt to unlock. Also supports (optionally by force) unmounting filesystems and unloading associated keys. Sponsored by: Modirum Differential Revision: https://reviews.freebsd.org/D30015 (cherry picked from commit 33ff39796ffe469a764e485ac49c31700a51fd6f) --- libexec/rc/rc.d/zfskeys | 119 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/libexec/rc/rc.d/zfskeys b/libexec/rc/rc.d/zfskeys new file mode 100755 index 000000000000..c558eb3af5d7 --- /dev/null +++ b/libexec/rc/rc.d/zfskeys @@ -0,0 +1,119 @@ +#!/bin/sh + +# PROVIDE: zfskeys +# REQUIRE: zpool +# BEFORE: zfs zvol + +. /etc/rc.subr + +name="zfskeys" +desc="Load dataset keys" +rcvar="zfskeys_enable" +extra_commands="status" +start_cmd="load_zfs_keys" +stop_cmd="unload_zfs_keys" +status_cmd="status_zfs_keys" +required_modules="zfs" + +# Note that zfskeys_datasets must have any character found in IFS escaped. +# Forcibly unmounting/unloading only applies to filesystems; ignored for zvols. +: ${zfskeys_datasets:=''} +: ${zfskeys_timeout:=10} +: ${zfskeys_unload_force:='NO'} + +encode_args() +{ + shift && [ $# -gt 0 ] && printf "%s\0" "$@" | b64encode -r - +} + +list_datasets() +{ + if [ "$zfskeys_args" ]; then + echo "$zfskeys_args" | b64decode -r | + xargs -0 zfs get -H -s local -o value,name keylocation + elif [ ! "$zfskeys_datasets" ]; then + zfs get -H -t filesystem,volume -s local -o value,name keylocation + else + echo "$zfskeys_datasets" | xargs -n 1 zfs get -H -s local \ + -o value,name keylocation + fi +} + +unlock_fs() +{ + local fs="$1" + local kl="$2" + local k="${kl##file://}" + + if [ "$k" ] && [ -f "$k" ] && [ -s "$k" ] && [ -r "$k" ]; then + if [ "$(zfs get -Ho value keystatus "$fs")" = 'available' ]; then + echo "Key already loaded for $fs." + elif keytest=$(zfs load-key -n -L "$kl" "$fs" 2>&1); then + echo "Loading key for $fs from $kl.." + if ! keyload=$(timeout $zfskeys_timeout zfs load-key -L "$kl" "$fs" 2>&1) ; then + if [ $? -eq 124 ]; then + echo "Timed out loading key from $kl for $fs" + else + echo "Failed to load key from $kl for $fs:" + echo "$keyload" + fi + fi + else + echo "Could not verify key from $kl for $fs:" + echo "$keytest" + fi + else + echo "Key file $k not found, empty or unreadable. Skipping $fs.." + fi +} + +lock_fs() +{ + local fs=$1 + + if [ "$(zfs get -Ho value mounted "$fs")" = 'yes' ]; then + if checkyesno zfskeys_unload_force ; then + zfs unmount -f "$fs" && echo "Forcibly unmounted $fs." + else + zfs unmount "$fs" && echo "Unmounted $fs." + fi + fi + if [ "$?" -ne 0 ]; then + echo "Unmount failed for $fs" + elif [ "$(zfs get -Ho value keystatus "$fs")" = 'available' ]; then + zfs unload-key "$fs" && echo "Unloaded key for $fs." + else + echo "No key loaded for $fs." + fi +} + +status_zfs_keys() +{ + local IFS=$(printf "\t") + + list_datasets | while read kl fs ; do + echo "$fs: $(zfs get -Ho value keystatus "$fs")" + done +} + +load_zfs_keys() +{ + local IFS=$(printf "\t") + + list_datasets | while read kl fs ; do + unlock_fs "$fs" "$kl" + done +} + +unload_zfs_keys() +{ + local IFS=$(printf "\t") + + list_datasets | while read kl fs ; do + lock_fs "$fs" + done +} + +zfskeys_args=$(encode_args "$@") +load_rc_config $name +run_rc_command "$1" From owner-dev-commits-src-all@freebsd.org Sun Aug 22 15:24:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FFFF657136; Sun, 22 Aug 2021 15:24:10 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GszgF6Sp5z3txQ; Sun, 22 Aug 2021 15:24:09 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id HlK2msjTpFRDpHpKTmDPSu; Sun, 22 Aug 2021 15:24:09 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id HpKRmpPZPB9dPHpKSmLILJ; Sun, 22 Aug 2021 15:24:09 +0000 X-Authority-Analysis: v=2.4 cv=Ac10o1bG c=1 sm=1 tr=0 ts=61226c19 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=MhDmnRu9jo8A:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=sVRy8H1vAAAA:8 a=NEAV23lmAAAA:8 a=yIXMFWWi4zmPt0PzZbgA:9 a=_5RweO4AWL2MXcZC:21 a=xL1mDByAUm-bXbnJ:21 a=0wDwsOqeTLLA_pT6:21 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=mL5YggztzNiiHV2pp1Gt:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id D8C27A5; Sun, 22 Aug 2021 08:24:07 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 17MFO3IE002937; Sun, 22 Aug 2021 08:24:06 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202108221524.17MFO3IE002937@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Alexander V. Chernikov" cc: Cy Schubert , "Alexander V. Chernikov" , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c541bd368f86 - main - lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries. In-reply-to: References: <202108211735.17LHZ0WI081502@gitrepo.freebsd.org> <202108220558.17M5wAuq003114@slippy.cwsent.com> Comments: In-reply-to "Alexander V. Chernikov" message dated "Sun, 22 Aug 2021 09:50:41 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 22 Aug 2021 08:24:03 -0700 X-CMAE-Envelope: MS4xfEWz0+rEebsuvrklaHGCX0RwiSyRbUCuvG3Rh+i3e+kyc8AQOI7WiPEdlCA+dUSpn4NYlDbhFIk0VcNrRpdAILbh6P2fvqgwc7Yy9m0gIjWoodSGihE3 kSQQAYgeMHgjVjdYxZ8mjTCrVWUPzW9DJZca2EkE4Sh/O8+7kaW9v8wu11kmi9od649JcJA0pOpO3rwdV5wKhe4MUot4Lq0BZWJtN+8aCaSkZxvZJVJPccRq x7xM2FeuDmYjYa5QfnmaR8Xi5GNdbFWLscAGLUbQj2E3wqmSCs4HyoiaZfRwruBWAhV7YJDwdYi4y+bg02TnHU2Lfiv5qhhSSGrt1uUVACs+tap79/juB4M7 XNBJqXaH X-Rspamd-Queue-Id: 4GszgF6Sp5z3txQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 15:24:10 -0000 Thank you. This fixes it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. In message , "Alexander V. Cherni kov" writes: > > > > On 22 Aug 2021, at 06:58, Cy Schubert = > wrote: > >=20 > > In message <202108211735.17LHZ0WI081502@gitrepo.freebsd.org = > >, "Alexander V.=20= > > > Che > > rnikov" writes: > >> The branch main has been updated by melifaro: > >>=20 > >> URL: = > https://cgit.FreeBSD.org/src/commit/?id=3Dc541bd368f863bbf5c08dd5c1ecce016= > > >> 6ad47389 > >>=20 > >> commit c541bd368f863bbf5c08dd5c1ecce0166ad47389 > >> Author: Alexander V. Chernikov > >> AuthorDate: 2021-08-21 14:13:32 +0000 > >> Commit: Alexander V. Chernikov > >> CommitDate: 2021-08-21 17:34:35 +0000 > >>=20 > >> lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 = > entries > >> . > >>=20 > >> Currently we use pre-calculated headers inside LLE entries as = > prepend dat > >> a > >> for `if_output` functions. Using these headers allows saving some > >> CPU cycles/memory accesses on the fast path. > >>=20 > >> However, this approach makes adding L2 header for IPv4 traffic = > with IPv6 > >> nexthops more complex, as it is not possible to store multiple > >> pre-calculated headers inside lle. Additionally, the solution = > space is > >> limited by the fact that PCB caching saves LLEs in addition to = > the nexth > >> op. > >>=20 > >> Thus, add support for creating special "child" LLEs for the = > purpose of ho > >> lding > >> custom family encaps and store mbufs pending resolution. To = > simplify han > >> dling > >> of those LLEs, store them in a linked-list inside a "parent" = > (e.g. norma > >> l) LLE. > >> Such LLEs are not visible when iterating LLE table. Their = > lifecycle is b > >> ound > >> to the "parent" LLE - it is not possible to delete "child" when = > parent i > >> s alive. > >> Furthermore, "child" LLEs are static (RTF_STATIC), avoding = > complex state > >> machine used by the standard LLEs. > >>=20 > >> nd6_lookup() and nd6_resolve() now accepts an additional argument, = > family > >> , > >> allowing to return such child LLEs. This change uses `LLE_SF()` = > macro wh > >> ich > >> packs family and flags in a single int field. This is done to = > simplify m > >> erging > >> back to stable/. Once this code lands, most of the cases will be = > convert > >> ed to > >> use a dedicated `family` parameter. > >>=20 > >> Differential Revision: https://reviews.freebsd.org/D31379 > >> MFC after: 2 weeks > >> --- > >> sys/net/if_ethersubr.c | 4 +- > >> sys/net/if_fwsubr.c | 4 +- > >> sys/net/if_infiniband.c | 3 +- > >> sys/net/if_llatbl.c | 70 +++++++++++- > >> sys/net/if_llatbl.h | 12 +- > >> sys/netinet/toecore.c | 2 +- > >> sys/netinet6/icmp6.c | 2 +- > >> sys/netinet6/in6.c | 5 + > >> sys/netinet6/nd6.c | 176 = > +++++++++++++++++++++++---- > >> -- > >> sys/netinet6/nd6.h | 1 + > >> sys/netinet6/nd6_nbr.c | 6 +- > >> sys/ofed/drivers/infiniband/core/ib_addr.c | 5 +- > >> 12 files changed, 241 insertions(+), 49 deletions(-) > >=20 > > This commit causes two of my machines a bit of gas. > Sorry for the breakage, should be fixed by = > f8c1b1a9296696f70ac209612a00ae0722d07ed9. > > >=20 > > Fatal trap 12: page fault while in kernel mode > > cpuid =3D 0; apic id =3D 00 > > fault virtual address =3D 0x128 > > fault code =3D supervisor read data, page not present > > instruction pointer =3D 0x20:0xffffffff806cb53d > > stack pointer =3D 0x28:0xfffffe008da1a210 > > frame pointer =3D 0x28:0xfffffe008da1a210 > > code segment =3D base 0x0, limit 0xfffff, type 0x1b > > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > > current process =3D 0 (bge0 taskq) > > trap number =3D 12 > > panic: page fault > > cpuid =3D 0 > > time =3D 1629610416 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame=20 > > 0xfffffe008da19eb0 > > vpanic() at vpanic+0x187/frame 0xfffffe008da19f10 > > panic() at panic+0x43/frame 0xfffffe008da19f70 > > trap_fatal() at trap_fatal+0x387/frame 0xfffffe008da19fd0 > > trap_pfault() at trap_pfault+0x4f/frame 0xfffffe008da1a030 > > trap() at trap+0x26a/frame 0xfffffe008da1a140 > > calltrap() at calltrap+0x8/frame 0xfffffe008da1a140 > > --- trap 0xc, rip =3D 0xffffffff806cb53d, rsp =3D 0xfffffe008da1a210, = > rbp =3D=20 > > 0xfffffe008da1a210 --- > > __rw_rlock_int() at __rw_rlock_int+0xd/frame 0xfffffe008da1a210 > > in6_lltable_lookup() at in6_lltable_lookup+0xa7/frame = > 0xfffffe008da1a240 > > nd6_lookup() at nd6_lookup+0x4e/frame 0xfffffe008da1a270 > > pfxlist_onlink_check() at pfxlist_onlink_check+0xfb/frame = > 0xfffffe008da1a310 > > nd6_ra_input() at nd6_ra_input+0x147f/frame 0xfffffe008da1a5d0 > > icmp6_input() at icmp6_input+0x685/frame 0xfffffe008da1a7b0 > > ip6_input() at ip6_input+0xa9a/frame 0xfffffe008da1a890 > > netisr_dispatch_src() at netisr_dispatch_src+0xca/frame = > 0xfffffe008da1a8e0 > > ether_demux() at ether_demux+0x138/frame 0xfffffe008da1a910 > > ether_nh_input() at ether_nh_input+0x34e/frame 0xfffffe008da1a970 > > netisr_dispatch_src() at netisr_dispatch_src+0xca/frame = > 0xfffffe008da1a9c0 > > ether_input() at ether_input+0x69/frame 0xfffffe008da1aa20 > > if_input() at if_input+0xa/frame 0xfffffe008da1aa30 > > bge_rxeof() at bge_rxeof+0x4dc/frame 0xfffffe008da1aab0 > > bge_intr_task() at bge_intr_task+0x1a7/frame 0xfffffe008da1ab00 > > taskqueue_run_locked() at taskqueue_run_locked+0x191/frame=20 > > 0xfffffe008da1ab80 > > taskqueue_thread_loop() at taskqueue_thread_loop+0xc3/frame=20 > > 0xfffffe008da1abb0 > > fork_exit() at fork_exit+0x8a/frame 0xfffffe008da1abf0 > > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe008da1abf0 > > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > > Uptime: 1m18s > > Dumping 511 out of 7972 = > MB:..4%..13%..22%..32%..41%..51%..63%..72%..82%..91% > > ---<>--- > > Copyright (c) 1992-2021 The FreeBSD Project. > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, = > 1994 > > The Regents of the University of California. All rights = > reserved. > > FreeBSD is a registered trademark of The FreeBSD Foundation. > > FreeBSD 14.0-CURRENT #85 komquats-n248853-efa24221b032: Sat Aug 21 = > 20:41:37=20 > > PDT 2021 > > root@cwsys:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 > > FreeBSD clang version 12.0.1 (git@github.com = > :llvm/llvm-project.git=20 > > llvmorg-12.0.1-0-gfed41342a82f) > > VT(vga): text 80x25 > > module_register: cannot register tmpfs from kernel; already loaded = > from=20 > > tmpfs.ko > > Module tmpfs failed to register: 17 > > CPU: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (2294.83-MHz K8-class = > CPU) > > Origin=3D"GenuineIntel" Id=3D0x206a7 Family=3D0x6 Model=3D0x2a = > Stepping=3D7 > > = > Features=3D0xbfebfbff ,M > > CA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > > = > Features2=3D0x1dbae3bf CX > > = > 16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,XSAVE,OSXSAVE,AVX> > > AMD Features=3D0x28100800 > > AMD Features2=3D0x1 > > XSAVE Features=3D0x1 > > VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID > > TSC: P-state invariant, performance statistics > > real memory =3D 8589934592 (8192 MB) > > avail memory =3D 8082354176 (7707 MB) > > Event timer "LAPIC" quality 600 > > ACPI APIC Table: > > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > > FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 hardware threads > > random: unblocking device. > > ioapic0 irqs 0-23 > > Launching APs: 1 3 2 > > Timecounter "TSC-low" frequency 1147416650 Hz quality 1000 > > random: entropy device external interface > > kbd1 at kbdmux0 > > vtvga0: > > aesni0: No AES or SHA support. > > acpi0: > > acpi0: Power Button (fixed) > > cpu0: on acpi0 > > hpet0: iomem 0xfed00000-0xfed003ff on = > acpi0 > > Timecounter "HPET" frequency 14318180 Hz quality 950 > > Event timer "HPET" frequency 14318180 Hz quality 550 > > Event timer "HPET1" frequency 14318180 Hz quality 440 > > Event timer "HPET2" frequency 14318180 Hz quality 440 > > Event timer "HPET3" frequency 14318180 Hz quality 440 > > Event timer "HPET4" frequency 14318180 Hz quality 440 > > atrtc0: port 0x70-0x77 irq 8 on acpi0 > > atrtc0: Warning: Couldn't map I/O. > > atrtc0: registered as a time-of-day clock, resolution 1.000000s > > Event timer "RTC" frequency 32768 Hz quality 0 > > attimer0: port 0x40-0x43,0x50-0x53 irq 0 on acpi0 > > Timecounter "i8254" frequency 1193182 Hz quality 0 > > Event timer "i8254" frequency 1193182 Hz quality 100 > > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 > > acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 > > acpi_ec0: port 0x62,0x66 on acpi0 > > pcib0: port 0xcf8-0xcff on acpi0 > > pci0: on pcib0 > > vgapci0: port 0x2000-0x203f mem=20 > > 0xf0000000-0xf03fffff,0xe0000000-0xefffffff irq 16 at device 2.0 on = > pci0 > > vgapci0: Boot video device > > pci0: at device 22.0 (no driver attached) > > ehci0: mem = > 0xf060a000-0xf060a3ff=20 > > irq 16 at device 26.0 on pci0 > > usbus0: EHCI version 1.0 > > usbus0 on ehci0 > > usbus0: 480Mbps High Speed USB v2.0 > > hdac0: mem 0xf0600000-0xf0603fff = > irq 22=20 > > at device 27.0 on pci0 > > pcib1: irq 16 at device 28.0 on pci0 > > pci1: on pcib1 > > pcib2: irq 17 at device 28.1 on pci0 > > pci2: on pcib2 > > iwn0: mem 0xf0500000-0xf0501fff irq = > 17 at=20 > > device 0.0 on pci2 > > pcib3: irq 19 at device 28.3 on pci0 > > pci3: on pcib3 > > bge0: mem=20 > > 0xf0400000-0xf040ffff,0xf0410000-0xf041ffff irq 19 at device 0.0 on = > pci3 > > bge0: CHIP ID 0x57785100; ASIC REV 0x57785; CHIP REV 0x577851; PCI-E > > miibus0: on bge0 > > brgphy0: PHY 1 on miibus0 > > brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,=20= > > > 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow > > <6>bge0: Using defaults for TSO: 65518/35/2048 > > <6>bge0: Ethernet address: 20:6a:8a:72:03:17 > > sdhci_pci0: mem=20 > > 0xf0420000-0xf042ffff irq 16 at device 0.1 on pci3 > > sdhci_pci0: 1 slot(s) allocated > > ehci1: mem = > 0xf0609000-0xf06093ff=20 > > irq 23 at device 29.0 on pci0 > > usbus1: EHCI version 1.0 > > usbus1 on ehci1 > > usbus1: 480Mbps High Speed USB v2.0 > > isab0: at device 31.0 on pci0 > > isa0: on isab0 > > ahci0: port=20 > > 0x2088-0x208f,0x2094-0x2097,0x2080-0x2087,0x2090-0x2093,0x2060-0x207f = > mem=20 > > 0xf0608000-0xf06087ff irq 19 at device 31.2 on pci0 > > ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported > > ahcich0: at channel 0 on ahci0 > > ahcich1: at channel 1 on ahci0 > > ahcich5: at channel 5 on ahci0 > > ahciem0: on ahci0 > > ichsmb0: port 0xefa0-0xefbf mem=20= > > > 0xf0604000-0xf06040ff irq 18 at device 31.3 on pci0 > > acpi_lid0: on acpi0 > > acpi_button0: on acpi0 > > acpi_tz0: on acpi0 > > acpi_tz1: on acpi0 > > atkbdc0: port 0x60,0x64 irq 1 on acpi0 > > atkbd0: irq 1 on atkbdc0 > > kbd0 at atkbd0 > > atkbd0: [GIANT-LOCKED] > > psm0: irq 12 on atkbdc0 > > psm0: [GIANT-LOCKED] > > WARNING: Device "psm" is Giant locked and may be deleted before = > FreeBSD=20 > > 14.0. > > psm0: model Synaptics Touchpad, device ID 0 > > acpi_acad0: on acpi0 > > battery0: on acpi0 > > vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff = > pnpid=20 > > PNP0900 on isa0 > > ata0: at port 0x1f0-0x1f7,0x3f6 irq 14 on isa0 > > ata1: at port 0x170-0x177,0x376 irq 15 on isa0 > > acpi_perf0: on cpu0 > > acpi_throttle0: on cpu0 > > coretemp0: on cpu0 > > acpi_throttle1: failed to attach P_CNT > > device_attach: acpi_throttle1 attach returned 6 > > acpi_throttle2: failed to attach P_CNT > > device_attach: acpi_throttle2 attach returned 6 > > acpi_throttle3: failed to attach P_CNT > > device_attach: acpi_throttle3 attach returned 6 > > module_register_init: MOD_LOAD (tmpfs, 0xffffffff807a2760,=20 > > 0xffffffff80c88540) error 17 > > Timecounters tick every 10.000 msec > > ZFS filesystem version: 5 > > ZFS storage pool version: features support (5000) > > IP Filter: v5.1.2 initialized. Default =3D pass all, Logging =3D = > enabled > > hdacc0: at cad 0 on hdac0 > > hdaa0: at nid 1 on hdacc0 > > pcm0: at nid 20,33 and 27 on = > hdaa0 > > pcm1: at nid 24 on hdaa0 > > hdacc1: at cad 3 on hdac0 > > hdaa1: at nid 1 on hdacc1 > > pcm2: at nid 5 on hdaa1 > > smbus0: on ichsmb0 > > smb0: on smbus0 > > sysctl_unregister_oid: failed(22) to unregister sysctl(tmpfs) > > ugen1.1: at usbus1 > > ugen0.1: at usbus0 > > uhub0 on usbus1 > > Trying to mount root from ufs:/dev/ufs/Sroot [rw]... > > Root mount waiting for: usbus0 usbus1 CAM > > uhub1 on usbus0 > > uhub1: on = > usbus0 > > uhub0: on = > usbus1 > > ses0 at ahciem0 bus 0 scbus3 target 0 lun 0 > > ses0: SEMB S-E-S 2.00 device > > ses0: SEMB SES Device > > ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 > > ada0: ATA8-ACS SATA 3.x device > > ada0: Serial Number JR1000D33969RE > > ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) > > ada0: Command Queueing enabled > > ada0: 953869MB (1953525168 512 byte sectors) > > ses0: pass0,ada0 in 'Slot 00', SATA Slot: scbus0 target 0 > > ses0: pass1,cd0 in 'Slot 01', SATA Slot: scbus1 target 0 > > cd0 at ahcich1 bus 0 scbus1 target 0 lun 0 > > cd0: Removable CD-ROM SCSI device > > cd0: Serial Number SBB5103801 > > cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO = > 8192bytes) > > cd0: Attempt to query device size failed: NOT READY, Medium not = > present -=20 > > tray closed > > uhub1: 2 ports with 2 removable, self powered > > uhub0: 2 ports with 2 removable, self powered > > Root mount waiting for: usbus0 usbus1 > > ugen0.2: at usbus0 > > uhub2 on uhub1 > > uhub2: 2> on=20 > > usbus0 > > ugen1.2: at usbus1 > > uhub3 on uhub0 > > uhub3: 2> on=20 > > usbus1 > > Root mount waiting for: usbus0 usbus1 > > uhub3: 6 ports with 6 removable, self powered > > uhub2: 6 ports with 6 removable, self powered > > ugen1.3: at usbus1 > > uhub4 on uhub3 > > uhub4: on = > usbus1 > > ugen0.3: at usbus0 > > uhub5 on uhub2 > > uhub5: on=20= > > > usbus0 > > Root mount waiting for: usbus0 usbus1 > > uhub4: 4 ports with 4 removable, self powered > > uhub5: 4 ports with 4 removable, self powered > > ugen1.4: at usbus1 > > ukbd0 on uhub4 > > ukbd0: on = > usbus1 > > kbd2 at ukbd0 > > ums0 on uhub4 > > ums0: on = > usbus1 > > ums0: 16 buttons and [XYZT] coordinates ID=3D2 > > ugen0.4: at usbus0 > > uhub6 on uhub5 > > uhub6: on=20= > > > usbus0 > > Root mount waiting for: usbus0 usbus1 > > ugen1.5: at usbus1 > > ukbd1 on uhub4 > > ukbd1: on=20= > > > usbus1 > > kbd3 at ukbd1 > > uhub6: 4 ports with 4 removable, self powered > > ugen0.5: at usbus0 > > umass0 on uhub6 > > umass0: on = > usbus0 > > umass0: SCSI over Bulk-Only; quirks =3D 0x4100 > > umass0:6:0: Attached to scbus6 > > Root mount waiting for: usbus0 CAM > > da0 at umass-sim0 bus 0 scbus6 target 0 lun 0 > > da0: Fixed Direct Access SCSI device > > da0: 40.000MB/s transfers > > da0: 76351MB (156368016 512 byte sectors) > > da0: quirks=3D0x2 > > ugen0.6: at usbus0 > > umass1 on uhub6 > > umass1: = > on=20 > > usbus0 > > umass1: SCSI over Bulk-Only; quirks =3D 0x408c > > umass1:7:1: Attached to scbus7 > > da1 at umass-sim1 bus 1 scbus7 target 0 lun 0 > > da1: Fixed Direct Access SCSI device > > da1: 40.000MB/s transfers > > da1: 76319MB (156301488 512 byte sectors) > > da1: quirks=3D0x2 > > ugen0.7: at usbus0 > > umass2 on uhub5 > > umass2: = > on=20 > > usbus0 > > umass2: SCSI over Bulk-Only; quirks =3D 0x4101 > > umass2:8:2: Attached to scbus8 > > da2 at umass-sim2 bus 2 scbus8 target 0 lun 0 > > da2: < Flash Disk 8.07> Removable Direct Access SCSI-2 device > > da2: Serial Number 029B4D84 > > da2: 40.000MB/s transfers > > da2: 246MB (504320 512 byte sectors) > > da2: quirks=3D0x2 > > Root mount waiting for: usbus0 > > ugen0.8: at usbus0 > > mountroot: waiting for device /dev/ufs/Sroot... > > WARNING: / was not properly dismounted > > WARNING: /: mount pending error: blocks 24 files 0 > > <118>Setting hostuuid: 34f5ed40-8938-11da-b265-efe316da850d. > > <118>Setting hostid: 0x7f5a03b9. > > <118>Starting file system checks: > > <118>** SU+J Recovering /dev/ufs/Sroot > > <118>** Reading 16777216 byte journal from inode 4. > > <118>** Building recovery table. > > <118>** Resolving unreferenced inode list. > > <118>** Processing journal entries. > > <118>** 7 journal records in 1536 bytes for 14.58% utilization > > <118>** Freed 1 inodes (0 dirs) 0 blocks, and 3 frags. > > <118> > > <118>***** FILE SYSTEM MARKED CLEAN ***** > > <118>** SU+J Recovering /dev/ufs/Svar > > <118>** Reading 16777216 byte journal from inode 4. > > <118>** Building recovery table. > > <118>** Resolving unreferenced inode list. > > <118>** Processing journal entries. > > <118>** SU+J Recovering /dev/ufs/Susr > > <118>** Reading 25165824 byte journal from inode 4. > > <118>** 40 journal records in 4096 bytes for 31.25% utilization > > <118>** Freed 0 inodes (0 dirs) 0 blocks, and 0 frags. > > <118> > > <118>***** FILE SYSTEM MARKED CLEAN ***** > > <118>** Building recovery table. > > <118>** Resolving unreferenced inode list. > > <118>** Processing journal entries. > > <118> > > <118>***** FILE SYSTEM MARKED CLEAN ***** > > <118>/dev/ada0s3a: 7535 files, 131352 used, 376431 free (1135 frags, = > 46912=20 > > blocks, 0.2% fragmentation) > > <118>/dev/ada0s3e: 24573 files, 319053 used, 442234 free (1082 frags, = > 55144=20 > > blocks, 0.1% fragmentation) > > <118>/dev/ada0s3d: 22537 files, 105401 used, 402382 free (270 frags, = > 50264=20 > > blocks, 0.1% fragmentation) > > <118>/dev/ada0s3f: 18331 files, 109447 used, 398336 free (576 frags, = > 49720=20 > > blocks, 0.1% fragmentation) > > <118>/dev/ada0s3h: 22924 files, 188609 used, 572677 free (685 frags, = > 71499=20 > > blocks, 0.1% fragmentation) > > <118>/dev/ada0s3g: 5348 files, 49444 used, 458339 free (275 frags, = > 57258=20 > > blocks, 0.1% fragmentation) > > <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk3p1 > > <118>** Reading 33554432 byte journal from inode 4. > > <118>** Building recovery table. > > <118>** Resolving unreferenced inode list. > > <118>** Processing journal entries. > > <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1a > > <118>** Reading 16777216 byte journal from inode 827. > > <118> > > <118>***** FILE SYSTEM MARKED CLEAN ***** > > <118>** Building recovery table. > > <118>** Resolving unreferenced inode list. > > <118>** Processing journal entries. > > <118> > > <118>***** FILE SYSTEM MARKED CLEAN ***** > > <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1d > > <118>** Reading 16777216 byte journal from inode 117. > > <118>** Building recovery table. > > <118>** Resolving unreferenced inode list. > > <118>** Processing journal entries. > > <118> > > <118>***** FILE SYSTEM MARKED CLEAN ***** > > <118>** SU+J Recovering /dev/zvol/tank/VMs/current/amd64/disk0s1e > > <118>** Reading 33554432 byte journal from inode 16. > > <118>** Building recovery table. > > <118>** Resolving unreferenced inode list. > > <118>** Processing journal entries. > > <118> > > <118>***** FILE SYSTEM MARKED CLEAN ***** > > <118>/dev/msdosfs/SHARED: 435 files, 6.2 GiB free (203709 clusters) > > <118>FIXED > > <118>/dev/msdosfs/SHARED: MARKING FILE SYSTEM CLEAN > > <118>/dev/zvol/tank/VMs/current/i386/disk0s1a: 114555 files, 255948 = > used,=20 > > 251835 free (403 frags, 31429 blocks, 0.1% fragmentation) > > <118>/dev/zvol/tank/VMs/current/i386/disk0s1d: 22759 files, 126960 = > used,=20 > > 380823 free (143 frags, 47585 blocks, 0.0% fragmentation) > > <118>/dev/zvol/tank/VMs/current/i386/disk0s1e: 28564 files, 549004 = > used,=20 > > 973507 free (1603 frags, 121488 blocks, 0.1% fragmentation) > > <118>Mounting local filesystems:. > > <118>Mounting ZFS filesystems: (193/193) > > <118>Local package initialization:error: ed0: No such device exists=20 > > (BIOCSETIF failed: Device not configured) > > <118>Unable to read the configuration file: No such file or directory = > at=20 > > /usr/local/lib/perl5/site_perl/Jail.pm line 50. > > <118>Compilation failed in require at /usr/local/sbin/jailadmin line = > 13. > > <118>BEGIN failed--compilation aborted at /usr/local/sbin/jailadmin = > line 13. > > <118> Jails. > > <118>Autoloading module: acpi_wmi > > acpi_wmi0: on acpi0 > > acpi_wmi0: Embedded MOF found > > ACPI: \_SB.AMWA.WQEE: 1 arguments were passed to a non-method ACPI = > object=20 > > (Buffer) (20210730/nsarguments-361) > > acpi_wmi1: on acpi0 > > acpi_wmi1: Embedded MOF found > > ACPI: \_SB.AMW0.WQDD: 1 arguments were passed to a non-method ACPI = > object=20 > > (Buffer) (20210730/nsarguments-361) > > <118>Updating CPU Microcode... > > CPU: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (2294.83-MHz K8-class = > CPU) > > Origin=3D"GenuineIntel" Id=3D0x206a7 Family=3D0x6 Model=3D0x2a = > Stepping=3D7 > > = > Features=3D0xbfebfbff ,M > > CA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > > = > Features2=3D0x1dbae3bf CX > > = > 16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,XSAVE,OSXSAVE,AVX> > > AMD Features=3D0x28100800 > > AMD Features2=3D0x1 > > Structured Extended = > Features3=3D0x9c000400 > > XSAVE Features=3D0x1 > > VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID > > TSC: P-state invariant, performance statistics > > <118>Done. > > <118>ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib=20= > > > /usr/local/lib/compat/pkg /usr/local/krb5/lib /usr/local/kde4/lib=20 > > /usr/local/dt/lib /usr/local/lib/compat/pkg /usr/local/lib/dovecot=20 > > /usr/local/lib/e2fsprogs /usr/local/lib/expect5.45.4=20 > > /usr/local/lib/freeradius-3.0.23 /usr/local/lib/gcc10 = > /usr/local/lib/gcc11=20 > > /usr/local/lib/gcc12 /usr/local/lib/gcc8 /usr/local/lib/gcc9=20 > > /usr/local/lib/graphviz /usr/local/lib/httrack /usr/local/lib/itcl3.4=20= > > > /usr/local/lib/mysql /usr/local/lib/mysql/plugin = > /usr/local/lib/opencollada=20 > > /usr/local/lib/perl5/5.30/mach/CORE = > /usr/local/lib/perl5/5.32/mach/CORE=20 > > /usr/local/lib/perl5/5.34/mach/CORE /usr/local/lib/pidgin=20 > > /usr/local/lib/pth /usr/local/lib/qt5 /usr/local/lib/samba4=20 > > /usr/local/lib/xrdp /usr/local/libexec/openldap = > /usr/local/llvm-devel/lib=20 > > /usr/local/llvm10/lib /usr/local/llvm11/lib /usr/local/llvm12/lib=20 > > /usr/local/llvm70/lib /usr/local/llvm80/lib /usr/local/llvm90/lib=20 > > /usr/local/share/chromium > > <118>32-bit compatibility ldconfig path: /usr/lib32=20 > > /alt/i386/root/usr/local/lib > > <118>Setting hostname: slippy. > > <118>Setting up harvesting: = > [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER > > ],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED > > <118>Feeding entropy: . > > <118>Starting ippool. > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>70018:add pool node(252.0.0.1/255.255.255.255: node entry already=20= > > > present in pool > > <118>Additional TCP/IP options: rfc1323 extensions=3DNO. > > <118>Enabling ipfilter. > > <118>Installing NAT rules. > > <118>0 entries flushed from NAT table > > <118>0 entries flushed from NAT list > > <118>Starting ipmon. > > <6>wlan0: Ethernet address: 20:6a:8a:72:03:17 > > <118>Created wlan(4) interfaces: wlan0. > > <6>bridge0: Ethernet address: 58:9c:fc:10:ff:c8 > > <118>Created clone interfaces: lagg0 bridge0. > > <6>lo0: link state changed to UP > > <6>bge0: link state changed to DOWN > > iwn0: iwn_read_firmware: ucode rev=3D0x12a80601 > > <118>Starting wpa_supplicant. > > <6>lagg0: link state changed to DOWN > > <6>lagg0: IPv6 addresses on wlan0 have been removed before adding it = > as a=20 > > member to prevent IPv6 address scope violation. > > iwn0: iwn_read_firmware: ucode rev=3D0x12a80601 > > <6>wlan0: link state changed to UP > > <6>lagg0: link state changed to UP > > <6>bge0: link state changed to UP > >=20 > >=20 > > Fatal trap 12: page fault while in kernel mode > > cpuid =3D 0; apic id =3D 00 > > fault virtual address =3D 0x128 > > fault code =3D supervisor read data, page not present > > instruction pointer =3D 0x20:0xffffffff806cb53d > > stack pointer =3D 0x28:0xfffffe00831a3210 > > frame pointer =3D 0x28:0xfffffe00831a3210 > > code segment =3D base 0x0, limit 0xfffff, type 0x1b > > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > > current process =3D 0 (bge0 taskq) > > trap number =3D 12 > > panic: page fault > > cpuid =3D 0 > > time =3D 1629610531 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame=20 > > 0xfffffe00831a2eb0 > > vpanic() at vpanic+0x187/frame 0xfffffe00831a2f10 > > panic() at panic+0x43/frame 0xfffffe00831a2f70 > > trap_fatal() at trap_fatal+0x387/frame 0xfffffe00831a2fd0 > > trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00831a3030 > > trap() at trap+0x26a/frame 0xfffffe00831a3140 > > calltrap() at calltrap+0x8/frame 0xfffffe00831a3140 > > --- trap 0xc, rip =3D 0xffffffff806cb53d, rsp =3D 0xfffffe00831a3210, = > rbp =3D=20 > > 0xfffffe00831a3210 --- > > __rw_rlock_int() at __rw_rlock_int+0xd/frame 0xfffffe00831a3210 > > in6_lltable_lookup() at in6_lltable_lookup+0xa7/frame = > 0xfffffe00831a3240 > > nd6_lookup() at nd6_lookup+0x4e/frame 0xfffffe00831a3270 > > pfxlist_onlink_check() at pfxlist_onlink_check+0xfb/frame = > 0xfffffe00831a3310 > > nd6_ra_input() at nd6_ra_input+0x147f/frame 0xfffffe00831a35d0 > > icmp6_input() at icmp6_input+0x685/frame 0xfffffe00831a37b0 > > ip6_input() at ip6_input+0xa9a/frame 0xfffffe00831a3890 > > netisr_dispatch_src() at netisr_dispatch_src+0xca/frame = > 0xfffffe00831a38e0 > > ether_demux() at ether_demux+0x138/frame 0xfffffe00831a3910 > > ether_nh_input() at ether_nh_input+0x34e/frame 0xfffffe00831a3970 > > netisr_dispatch_src() at netisr_dispatch_src+0xca/frame = > 0xfffffe00831a39c0 > > ether_input() at ether_input+0x69/frame 0xfffffe00831a3a20 > > if_input() at if_input+0xa/frame 0xfffffe00831a3a30 > > bge_rxeof() at bge_rxeof+0x4dc/frame 0xfffffe00831a3ab0 > > bge_intr_task() at bge_intr_task+0x1a7/frame 0xfffffe00831a3b00 > > taskqueue_run_locked() at taskqueue_run_locked+0x191/frame=20 > > 0xfffffe00831a3b80 > > taskqueue_thread_loop() at taskqueue_thread_loop+0xc3/frame=20 > > 0xfffffe00831a3bb0 > > fork_exit() at fork_exit+0x8a/frame 0xfffffe00831a3bf0 > > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00831a3bf0 > > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > > Uptime: 1m28s > > Dumping 512 out of 7972 = > MB:..4%..13%..22%..32%..41%..54%..63%..72%..82%..91% > >=20 > > __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:55 > > 55 __asm("movq %%gs:%P1,%0" : "=3Dr" (td) : "n" = > (offsetof(struct pcpu, > > (kgdb) bt > > #0 __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:55 > > #1 doadump (textdump=3Dtextdump@entry=3D1) at = > /opt/src/git-src/sys/kern/kern_sh > > utdown.c:399 > > #2 0xffffffff806cf9ab in kern_reboot (howto=3D260) at=20 > > /opt/src/git-src/sys/kern/kern_shutdown.c:486 > > #3 0xffffffff806cfe26 in vpanic (fmt=3D0xffffffff80a94e2f "%s",=20 > > ap=3D) at /opt/src/git-src/sys/kern/kern_shutdown.c:919 > > #4 0xffffffff806cfc23 in panic (fmt=3D) at=20 > > /opt/src/git-src/sys/kern/kern_shutdown.c:843 > > #5 0xffffffff80a342c7 in trap_fatal (frame=3D0xfffffe00831a3150, = > eva=3D296) at=20 > > /opt/src/git-src/sys/amd64/amd64/trap.c:946 > > #6 0xffffffff80a3431f in trap_pfault = > (frame=3Dframe@entry=3D0xfffffe00831a3150, > > usermode=3Dfalse, signo=3D, signo@entry=3D0x0, = > ucode=3D > out>, ucode@entry=3D0x0) at = > /opt/src/git-src/sys/amd64/amd64/trap.c:765 > > #7 0xffffffff80a3399a in trap (frame=3D0xfffffe00831a3150) at=20 > > /opt/src/git-src/sys/amd64/amd64/trap.c:443 > > #8 > > #9 __rw_rlock_int (rw=3D0x110) at = > /opt/src/git-src/sys/kern/kern_rwlock.c:679 > > #10 0xffffffff8087cd07 in in6_lltable_lookup (llt=3D,=20= > > > flags=3D, l3addr=3D) at = > /opt/src/git-src/sys/netin > > et6/in6.c:2349 > > #11 0xffffffff80897dae in lla_lookup (llt=3D0x110, flags=3D2374593664,=20= > > > flags@entry=3D0, l3addr=3D0xfffffe00831a3250) at = > /opt/src/git-src/sys/net/if_lla > > tbl.h:261 > > #12 nd6_lookup (addr6=3D, flags=3D-1920373632, = > flags@entry=3D0,=20 > > ifp=3D) at /opt/src/git-src/sys/netinet6/nd6.c:1204 > > #13 0xffffffff8089ff7b in find_pfxlist_reachable_router=20 > > (pr=3D0xfffff8002b64f100) at = > /opt/src/git-src/sys/netinet6/nd6_rtr.c:1817 > > #14 pfxlist_onlink_check () at = > /opt/src/git-src/sys/netinet6/nd6_rtr.c:1861 > > #15 0xffffffff8089fc5f in nd6_ra_input (m=3D,=20 > > m@entry=3D0xfffff8003a3e1d00, off=3D, = > icmp6len=3D,=20 > > icmp6len@entry=3D48) at /opt/src/git-src/sys/netinet6/nd6_rtr.c:597 > > #16 0xffffffff80874aa5 in icmp6_input (mp=3D0xfffffe00831a37f8,=20 > > offp=3D0xfffffe00831a37f0, proto=3D) at=20 > > /opt/src/git-src/sys/netinet6/icmp6.c:780 > > #17 0xffffffff8088beca in ip6_input (m=3D0xfffff8003a3e1d00) at=20 > > /opt/src/git-src/sys/netinet6/ip6_input.c:929 > > #18 0xffffffff80806d6a in netisr_dispatch_src (proto=3D6, = > source=3D > out>, source@entry=3D0, m=3D0x0) at = > /opt/src/git-src/sys/net/netisr.c:1143 > > #19 0xffffffff8080704f in netisr_dispatch (proto=3D272, m=3D0x10) at=20= > > > /opt/src/git-src/sys/net/netisr.c:1234 > > #20 0xffffffff807f3d58 in ether_demux = > (ifp=3Difp@entry=3D0xfffff8003a30e800,=20 > > m=3D0xfffffe008d896c80) at /opt/src/git-src/sys/net/if_ethersubr.c:925 > > #21 0xffffffff807f50fe in ether_input_internal = > (ifp=3D0xfffff8003a30e800,=20 > > m=3D0xfffffe008d896c80) at /opt/src/git-src/sys/net/if_ethersubr.c:711 > > #22 ether_nh_input (m=3D) at = > /opt/src/git-src/sys/net/if_ethers > > ubr.c:741 > > #23 0xffffffff80806d6a in netisr_dispatch_src (proto=3Dproto@entry=3D5,=20= > > > source=3D, source@entry=3D0, m=3D0x0, = > m@entry=3D0xfffff8003a3e1d00)=20 > > at /opt/src/git-src/sys/net/netisr.c:1143 > > #24 0xffffffff8080704f in netisr_dispatch (proto=3D272, proto@entry=3D5,= > =20 > > m=3D0x10, m@entry=3D0xfffff8003a3e1d00) at = > /opt/src/git-src/sys/net/netisr.c:123 > > 4 > > #25 0xffffffff807f41a9 in ether_input (ifp=3D,=20 > > m=3D0xfffff8003a3e1d00) at /opt/src/git-src/sys/net/if_ethersubr.c:832 > > #26 0xffffffff807f042a in if_input (ifp=3D0x110, = > ifp@entry=3D0xfffff8000516b800, > > sendmp=3D0xfffffe008d896c80, sendmp@entry=3D0xfffff8003a3e1d00) at=20 > > /opt/src/git-src/sys/net/if.c:4444 > > #27 0xffffffff818eaabc in bge_rxeof (sc=3D,=20 > > sc@entry=3D0xfffffe00107d0000, rx_prod=3Drx_prod@entry=3D2,=20 > > holdlck=3Dholdlck@entry=3D0) at = > /opt/src/git-src/sys/dev/bge/if_bge.c:4436 > > #28 0xffffffff818e7d57 in bge_intr_task (arg=3D0xfffffe00107d0000,=20 > > pending=3D) at = > /opt/src/git-src/sys/dev/bge/if_bge.c:4666 > > #29 0xffffffff80731d81 in taskqueue_run_locked = > (queue=3Dqueue@entry=3D0xfffff800 > > 03890600) at /opt/src/git-src/sys/kern/subr_taskqueue.c:476 > > #30 0xffffffff80733073 in taskqueue_thread_loop (arg=3D out>,=20 > > arg@entry=3D0xfffffe00107d7568) at = > /opt/src/git-src/sys/kern/subr_taskqueue.c: > > 793 > > #31 0xffffffff8068b80a in fork_exit (callout=3D0xffffffff80732fb0=20 > > , arg=3D0xfffffe00107d7568, = > frame=3D0xfffffe00831a3c00)=20 > > at /opt/src/git-src/sys/kern/kern_fork.c:1087 > > #32 > > (kgdb) frame 9 > > #9 __rw_rlock_int (rw=3D0x110) at = > /opt/src/git-src/sys/kern/kern_rwlock.c:679 > > 679 v =3D RW_READ_VALUE(rw); > > (kgdb) l > > 674 KASSERT(rw_wowner(rw) !=3D td, > > 675 ("rw_rlock: wlock already held for %s @ %s:%d", > > 676 rw->lock_object.lo_name, file, line)); > > 677 WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, = > line, NULL); > > 678=09 > > 679 v =3D RW_READ_VALUE(rw); > > 680 if = > (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__acquire) || > > 681 !__rw_rlock_try(rw, td, &v, true = > LOCK_FILE_LINE_ARG))) > > 682 __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG); > > 683 else > > (kgdb) p rw > > $1 =3D (struct rwlock *) 0x110 > > (kgdb) frame 10 > > #10 0xffffffff8087cd07 in in6_lltable_lookup (llt=3D,=20= > > > flags=3D, l3addr=3D) at = > /opt/src/git-src/sys/netin > > et6/in6.c:2349 > > 2349 LLE_RLOCK(lle); > > (kgdb) l > > 2344 return (lle); > > 2345=09 > > 2346 if (flags & LLE_EXCLUSIVE) > > 2347 LLE_WLOCK(lle); > > 2348 else > > 2349 LLE_RLOCK(lle); > > 2350=09 > > 2351 /* > > 2352 * If the afdata lock is not held, the LLE may have bee > n = > unlinked=20 > > while > > 2353 * we were blocked on the LLE lock. Check for this = > case. > > (kgdb) p lle > > $2 =3D (struct llentry *) 0x0 > > (kgdb)=20 > >=20 > >=20 > >=20 > > --=20 > > Cheers, > > Cy Schubert > > > FreeBSD UNIX: > Web: = > https://FreeBSD.org > > NTP: > Web: = > https://nwtime.org > >=20 > > The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Sun Aug 22 16:20:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7A16657B31; Sun, 22 Aug 2021 16:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt0wj5zsBz4hM8; Sun, 22 Aug 2021 16:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5C8A23E2B; Sun, 22 Aug 2021 16:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MGKr9d007087; Sun, 22 Aug 2021 16:20:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MGKrfp007086; Sun, 22 Aug 2021 16:20:53 GMT (envelope-from git) Date: Sun, 22 Aug 2021 16:20:53 GMT Message-Id: <202108221620.17MGKrfp007086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 614faa32691b - main - vfs: fix cache-relatecd LOR introduced in the previous change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 614faa32691bf9ccd2690624ad37470e08fd14d3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 16:20:54 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=614faa32691bf9ccd2690624ad37470e08fd14d3 commit 614faa32691bf9ccd2690624ad37470e08fd14d3 Author: Mateusz Guzik AuthorDate: 2021-08-22 16:17:42 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-22 16:20:07 +0000 vfs: fix cache-relatecd LOR introduced in the previous change Reported by: kib Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/vfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 166d7336eaf1..6804f6eb68bf 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1212,10 +1212,10 @@ vfs_domount_first( MNT_IUNLOCK(mp); VI_LOCK(vp); - cache_purge(vp); vn_irflag_set_locked(vp, VIRF_MOUNTPOINT); vp->v_mountedhere = mp; VI_UNLOCK(vp); + cache_purge(vp); /* * We need to lock both vnodes. From owner-dev-commits-src-all@freebsd.org Sun Aug 22 17:44:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86EA1659D7C; Sun, 22 Aug 2021 17:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt2nM35yLz3Ky5; Sun, 22 Aug 2021 17:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 535AA24E23; Sun, 22 Aug 2021 17:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MHidfv017896; Sun, 22 Aug 2021 17:44:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MHidtW017895; Sun, 22 Aug 2021 17:44:39 GMT (envelope-from git) Date: Sun, 22 Aug 2021 17:44:39 GMT Message-Id: <202108221744.17MHidtW017895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eccb516db8b7 - main - vm: use __func__ for the correct function name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eccb516db8b7fec957b139c3a9a2e16175551067 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 17:44:39 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eccb516db8b7fec957b139c3a9a2e16175551067 commit eccb516db8b7fec957b139c3a9a2e16175551067 Author: Bjoern A. Zeeb AuthorDate: 2021-08-22 17:21:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-08-22 17:43:12 +0000 vm: use __func__ for the correct function name In fee2a2fa39834d8d5eaa981298fce9d2ed31546d the KASSERTs in vm_page_unwire_noq() changed from "vm_page_unwire" to "vm_page_unref". While the former no longer was part of that function the latter does not exist as a function and is highly confusing when hit when using tools to lookup the functions and not doing a full-text search. Use %s __func__ for printing the function name, as that will do the right thing as code moves around and functions get renamed. Hit: while debugging a wired page leak with linuxkpi/iwlwifi Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31635 --- sys/vm/vm_page.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index d435b871b7cb..4ecea30e9219 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -4050,9 +4050,9 @@ vm_page_unwire_noq(vm_page_t m) old = vm_page_drop(m, 1); KASSERT(VPRC_WIRE_COUNT(old) != 0, - ("vm_page_unref: counter underflow for page %p", m)); + ("%s: counter underflow for page %p", __func__, m)); KASSERT((m->flags & PG_FICTITIOUS) == 0 || VPRC_WIRE_COUNT(old) > 1, - ("vm_page_unref: missing ref on fictitious page %p", m)); + ("%s: missing ref on fictitious page %p", __func__, m)); if (VPRC_WIRE_COUNT(old) > 1) return (false); From owner-dev-commits-src-all@freebsd.org Sun Aug 22 19:44:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3085F65C203; Sun, 22 Aug 2021 19:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt5RG0bJfz4dWB; Sun, 22 Aug 2021 19:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F04FB26B84; Sun, 22 Aug 2021 19:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MJi9Mt077346; Sun, 22 Aug 2021 19:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MJi9PW077345; Sun, 22 Aug 2021 19:44:09 GMT (envelope-from git) Date: Sun, 22 Aug 2021 19:44:09 GMT Message-Id: <202108221944.17MJi9PW077345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 108633bb1556 - stable/13 - diff: Use unprivileged_user with report_identical test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 108633bb1556f1e107b05a68fa0c323ac4d2c712 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 19:44:10 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=108633bb1556f1e107b05a68fa0c323ac4d2c712 commit 108633bb1556f1e107b05a68fa0c323ac4d2c712 Author: Olivier Cochard AuthorDate: 2021-02-03 16:18:59 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-08-22 16:48:55 +0000 diff: Use unprivileged_user with report_identical test Approved by: bapt Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28466 (cherry picked from commit b67df8d7c203a139b5afbe72e1947fbb8c32dc73) --- usr.bin/diff/tests/diff_test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 60b56f0d9067..b9d1698d982e 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -228,13 +228,18 @@ label_body() -s exit:1 diff --label hello --label world `which diff` `which ls` } +report_identical_head() +{ + atf_set "require.config" unprivileged_user +} report_identical_body() { + UNPRIVILEGED_USER=$(atf_config_get unprivileged_user) printf "\tA\n" > A printf "\tB\n" > B chmod -r B atf_check -s exit:2 -e inline:"diff: B: Permission denied\n" \ - -o empty diff -s A B + -o empty su -m "$UNPRIVILEGED_USER" -c 'diff -s A B' } non_regular_file_body() From owner-dev-commits-src-all@freebsd.org Sun Aug 22 21:22:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DA1465D3FC; Sun, 22 Aug 2021 21:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt7dG32lcz3hfD; Sun, 22 Aug 2021 21:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50866A8; Sun, 22 Aug 2021 21:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MLMwdG010466; Sun, 22 Aug 2021 21:22:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MLMw62010465; Sun, 22 Aug 2021 21:22:58 GMT (envelope-from git) Date: Sun, 22 Aug 2021 21:22:58 GMT Message-Id: <202108222122.17MLMw62010465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: e7d99efb3638 - stable/13 - Escape any '.' characters in sysctl node names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e7d99efb3638b71756da8033ef8cef74213c42fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 21:22:58 -0000 The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=e7d99efb3638b71756da8033ef8cef74213c42fd commit e7d99efb3638b71756da8033ef8cef74213c42fd Author: Alan Somers AuthorDate: 2021-07-21 21:11:00 +0000 Commit: Alan Somers CommitDate: 2021-08-22 21:11:00 +0000 Escape any '.' characters in sysctl node names ZFS creates some sysctl nodes that include a pool name, and '.' is an allowed character in pool names. But it's the separator in the sysctl tree, so it can't be included in a sysctl name. Replace it with "%25". Handily, "%" is illegal in ZFS pool names, so there's no ambiguity there. PR: 257316 Sponsored by: Axcient Reviewed by: freqlabs Differential Revision: https://reviews.freebsd.org/D31265 (cherry picked from commit 6c9506559080da2914749bf611225d7c0a153609) --- sys/kern/kern_sysctl.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 4bfe7073e5a3..f1e249ace89a 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -122,6 +122,7 @@ static int sysctl_root(SYSCTL_HANDLER_ARGS); /* Root list */ struct sysctl_oid_list sysctl__children = SLIST_HEAD_INITIALIZER(&sysctl__children); +static char* sysctl_escape_name(const char*); static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse); static int sysctl_old_kernel(struct sysctl_req *, const void *, size_t); @@ -747,6 +748,46 @@ sysctl_remove_name(struct sysctl_oid *parent, const char *name, return (error); } +/* + * Duplicate the provided string, escaping any illegal characters. The result + * must be freed when no longer in use. + * + * The list of illegal characters is ".". + */ +static char* +sysctl_escape_name(const char* orig) +{ + int i, s = 0, d = 0, nillegals = 0; + char *new; + + /* First count the number of illegal characters */ + for (i = 0; orig[i] != '\0'; i++) { + if (orig[i] == '.') + nillegals++; + } + + /* Allocate storage for new string */ + new = malloc(i + 2 * nillegals + 1, M_SYSCTLOID, M_WAITOK); + + /* Copy the name, escaping characters as we go */ + while (orig[s] != '\0') { + if (orig[s] == '.') { + /* %25 is the hexadecimal representation of '.' */ + new[d++] = '%'; + new[d++] = '2'; + new[d++] = '5'; + s++; + } else { + new[d++] = orig[s++]; + } + } + + /* Finally, nul-terminate */ + new[d] = '\0'; + + return (new); +} + static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse) { @@ -828,14 +869,17 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, const char *label) { struct sysctl_oid *oidp; + char *escaped; /* You have to hook up somewhere.. */ if (parent == NULL) return(NULL); + escaped = sysctl_escape_name(name); /* Check if the node already exists, otherwise create it */ SYSCTL_WLOCK(); - oidp = sysctl_find_oidname(name, parent); + oidp = sysctl_find_oidname(escaped, parent); if (oidp != NULL) { + free(escaped, M_SYSCTLOID); if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) { oidp->oid_refcnt++; /* Update the context */ @@ -854,7 +898,7 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, SLIST_INIT(&oidp->oid_children); oidp->oid_number = number; oidp->oid_refcnt = 1; - oidp->oid_name = strdup(name, M_SYSCTLOID); + oidp->oid_name = escaped; oidp->oid_handler = handler; oidp->oid_kind = CTLFLAG_DYN | kind; oidp->oid_arg1 = arg1; From owner-dev-commits-src-all@freebsd.org Sun Aug 22 21:23:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C565965D5FB; Sun, 22 Aug 2021 21:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt7fF59Rfz3hxV; Sun, 22 Aug 2021 21:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A3DF27EB3; Sun, 22 Aug 2021 21:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MLNnFF010640; Sun, 22 Aug 2021 21:23:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MLNnvl010639; Sun, 22 Aug 2021 21:23:49 GMT (envelope-from git) Date: Sun, 22 Aug 2021 21:23:49 GMT Message-Id: <202108222123.17MLNnvl010639@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: f61939970fae - stable/13 - iostat: fix rounding errors in iostat -x MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f61939970fae21a118bffa8794d8dcc65aed5372 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 21:23:49 -0000 The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f61939970fae21a118bffa8794d8dcc65aed5372 commit f61939970fae21a118bffa8794d8dcc65aed5372 Author: Alan Somers AuthorDate: 2021-07-08 16:16:32 +0000 Commit: Alan Somers CommitDate: 2021-08-22 21:23:23 +0000 iostat: fix rounding errors in iostat -x Better to round numbers instead of flooring them. Sponsored by: Axcient (cherry picked from commit 61631b24a1347a23cafe0657fba894622b1606e2) --- usr.sbin/iostat/iostat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index 4cbfcfcbcbd5..9140bf10ef07 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -888,17 +888,17 @@ devstats(int perf_select, long double etime, int havelast) mb_per_second_write > ((long double).0005)/1024 || busy_pct > 0.5) { if (Iflag == 0) - printf("%-8.8s %7d %7d %8.1Lf " - "%8.1Lf %5d %5d %5d %5d " - "%4" PRIu64 " %3.0Lf ", + printf("%-8.8s %7.0Lf %7.0Lf %8.1Lf " + "%8.1Lf %5.0Lf %5.0Lf %5.0Lf %5.0Lf" + " %4" PRIu64 " %3.0Lf ", devicename, - (int)transfers_per_second_read, - (int)transfers_per_second_write, + transfers_per_second_read, + transfers_per_second_write, mb_per_second_read * 1024, mb_per_second_write * 1024, - (int)ms_per_read, (int)ms_per_write, - (int)ms_per_other, - (int)ms_per_transaction, + ms_per_read, ms_per_write, + ms_per_other, + ms_per_transaction, queue_len, busy_pct); else printf("%-8.8s %11.1Lf %11.1Lf " From owner-dev-commits-src-all@freebsd.org Sun Aug 22 21:25:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7BE265D766; Sun, 22 Aug 2021 21:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt7hM4tYyz3k82; Sun, 22 Aug 2021 21:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85CF9109; Sun, 22 Aug 2021 21:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MLPdTd010875; Sun, 22 Aug 2021 21:25:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MLPdXQ010874; Sun, 22 Aug 2021 21:25:39 GMT (envelope-from git) Date: Sun, 22 Aug 2021 21:25:39 GMT Message-Id: <202108222125.17MLPdXQ010874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 2e6862b12b20 - stable/13 - ftpd: delete dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2e6862b12b20ca62b53faf3899e39744c89a9a43 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 21:25:39 -0000 The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=2e6862b12b20ca62b53faf3899e39744c89a9a43 commit 2e6862b12b20ca62b53faf3899e39744c89a9a43 Author: Alan Somers AuthorDate: 2021-07-27 18:14:00 +0000 Commit: Alan Somers CommitDate: 2021-08-22 21:25:29 +0000 ftpd: delete dead code Delete code killed by SVN r13139 in 1996. Little chance that it would still compile today. PR: 257317 Reported by: Alan Shearer Sponsored by: Axcient (cherry picked from commit 674400eb20b65369a88b1cb778d729bc297832c9) --- libexec/ftpd/extern.h | 3 --- libexec/ftpd/ftpd.c | 49 ------------------------------------------------- 2 files changed, 52 deletions(-) diff --git a/libexec/ftpd/extern.h b/libexec/ftpd/extern.h index 80d24b46d2e4..aa48ea67e320 100644 --- a/libexec/ftpd/extern.h +++ b/libexec/ftpd/extern.h @@ -59,9 +59,6 @@ char *renamefrom(char *); void reply(int, const char *, ...) __printflike(2, 3); void retrieve(char *, char *); void send_file_list(char *); -#ifdef OLD_SETPROCTITLE -void setproctitle(const char *, ...); -#endif void statcmd(void); void statfilecmd(char *); void store(char *, char *, int); diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 25ae3fba956b..e23c06aaf143 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -205,10 +205,6 @@ int swaitmax = SWAITMAX; int swaitint = SWAITINT; #ifdef SETPROCTITLE -#ifdef OLD_SETPROCTITLE -char **Argv = NULL; /* pointer to argument vector */ -char *LastArgv = NULL; /* end of argv */ -#endif /* OLD_SETPROCTITLE */ char proctitle[LINE_MAX]; /* initial part of title */ #endif /* SETPROCTITLE */ @@ -280,16 +276,6 @@ main(int argc, char *argv[], char **envp) sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART; -#ifdef OLD_SETPROCTITLE - /* - * Save start and extent of argv for setproctitle. - */ - Argv = argv; - while (*envp) - envp++; - LastArgv = envp[-1] + strlen(envp[-1]); -#endif /* OLD_SETPROCTITLE */ - /* * Prevent diagnostic messages from appearing on stderr. * We run as a daemon or from inetd; in both cases, there's @@ -3329,41 +3315,6 @@ reapchild(int signo) while (waitpid(-1, NULL, WNOHANG) > 0); } -#ifdef OLD_SETPROCTITLE -/* - * Clobber argv so ps will show what we're doing. (Stolen from sendmail.) - * Warning, since this is usually started from inetd.conf, it often doesn't - * have much of an environment or arglist to overwrite. - */ -void -setproctitle(const char *fmt, ...) -{ - int i; - va_list ap; - char *p, *bp, ch; - char buf[LINE_MAX]; - - va_start(ap, fmt); - (void)vsnprintf(buf, sizeof(buf), fmt, ap); - - /* make ps print our process name */ - p = Argv[0]; - *p++ = '-'; - - i = strlen(buf); - if (i > LastArgv - p - 2) { - i = LastArgv - p - 2; - buf[i] = '\0'; - } - bp = buf; - while (ch = *bp++) - if (ch != '\n' && ch != '\r') - *p++ = ch; - while (p < LastArgv) - *p++ = ' '; -} -#endif /* OLD_SETPROCTITLE */ - static void appendf(char **strp, char *fmt, ...) { From owner-dev-commits-src-all@freebsd.org Sun Aug 22 22:58:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8E8665F1B4; Sun, 22 Aug 2021 22:58:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt9lj4FRhz4g6D; Sun, 22 Aug 2021 22:58:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B08E11F2; Sun, 22 Aug 2021 22:58:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MMwfED030420; Sun, 22 Aug 2021 22:58:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MMwfdM030419; Sun, 22 Aug 2021 22:58:41 GMT (envelope-from git) Date: Sun, 22 Aug 2021 22:58:41 GMT Message-Id: <202108222258.17MMwfdM030419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 62e1a437f328 - main - routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62e1a437f3285e785d9b35a476d36a469a90028d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 22:58:41 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=62e1a437f3285e785d9b35a476d36a469a90028d commit 62e1a437f3285e785d9b35a476d36a469a90028d Author: Zhenlei Huang AuthorDate: 2021-08-22 22:28:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-22 22:56:08 +0000 routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549). Implement kernel support for RFC 5549/8950. * Relax control plane restrictions and allow specifying IPv6 gateways for IPv4 routes. This behavior is controlled by the net.route.rib_route_ipv6_nexthop sysctl (on by default). * Always pass final destination in ro->ro_dst in ip_forward(). * Use ro->ro_dst to exract packet family inside if_output() routines. Consistently use RO_GET_FAMILY() macro to handle ro=NULL case. * Pass extracted family to nd6_resolve() to get the LLE with proper encap. It leverages recent lltable changes committed in c541bd368f86. Presence of the functionality can be checked using ipv4_rfc5549_support feature(3). Example usage: route add -net 192.0.0.0/24 -inet6 fe80::5054:ff:fe14:e319%vtnet0 Differential Revision: https://reviews.freebsd.org/D30398 MFC after: 2 weeks --- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 33 +++++++++-------- sys/dev/cxgbe/tom/t4_listen.c | 5 ++- sys/dev/iicbus/if_ic.c | 2 +- sys/net/debugnet.c | 1 + sys/net/if_disc.c | 2 +- sys/net/if_ethersubr.c | 11 +++--- sys/net/if_fwsubr.c | 28 +++++++++++--- sys/net/if_gif.c | 2 +- sys/net/if_gre.c | 2 +- sys/net/if_infiniband.c | 7 ++-- sys/net/if_loop.c | 2 +- sys/net/if_me.c | 4 +- sys/net/if_spppsubr.c | 11 +++--- sys/net/if_tuntap.c | 2 +- sys/net/route.h | 4 ++ sys/net/route/route_ctl.c | 30 ++++++++++++++- sys/netgraph/netflow/netflow.c | 4 ++ sys/netgraph/ng_iface.c | 2 +- sys/netinet/ip_fastfwd.c | 29 +++++++++------ sys/netinet/ip_input.c | 11 ++++-- sys/netinet/ip_output.c | 53 ++++++++++++--------------- sys/netinet/toecore.c | 3 +- sys/ofed/drivers/infiniband/core/ib_addr.c | 14 +++++-- 23 files changed, 168 insertions(+), 94 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 072ab8bcd4e5..7e0ac4bc2927 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -689,7 +689,9 @@ ipf_fastroute(m0, mpp, fin, fdp) register struct mbuf *m = *mpp; int len, off, error = 0, hlen, code; struct ifnet *ifp, *sifp; - struct sockaddr_in dst; + struct route ro; + struct sockaddr_in *dst; + const struct sockaddr *gw; struct nhop_object *nh; u_long fibnum = 0; u_short ip_off; @@ -739,10 +741,12 @@ ipf_fastroute(m0, mpp, fin, fdp) /* * Route packet. */ - bzero(&dst, sizeof (dst)); - dst.sin_family = AF_INET; - dst.sin_addr = ip->ip_dst; - dst.sin_len = sizeof(dst); + bzero(&ro, sizeof (ro)); + dst = (struct sockaddr_in *)&ro.ro_dst; + dst->sin_family = AF_INET; + dst->sin_addr = ip->ip_dst; + dst->sin_len = sizeof(dst); + gw = (const struct sockaddr *)dst; fr = fin->fin_fr; if ((fr != NULL) && !(fr->fr_flags & FR_KEEPSTATE) && (fdp != NULL) && @@ -762,11 +766,11 @@ ipf_fastroute(m0, mpp, fin, fdp) } if ((fdp != NULL) && (fdp->fd_ip.s_addr != 0)) - dst.sin_addr = fdp->fd_ip; + dst->sin_addr = fdp->fd_ip; fibnum = M_GETFIB(m0); NET_EPOCH_ASSERT(); - nh = fib4_lookup(fibnum, dst.sin_addr, 0, NHR_NONE, 0); + nh = fib4_lookup(fibnum, dst->sin_addr, 0, NHR_NONE, 0); if (nh == NULL) { if (in_localaddr(ip->ip_dst)) error = EHOSTUNREACH; @@ -777,8 +781,10 @@ ipf_fastroute(m0, mpp, fin, fdp) if (ifp == NULL) ifp = nh->nh_ifp; - if (nh->nh_flags & NHF_GATEWAY) - dst.sin_addr = nh->gw4_sa.sin_addr; + if (nh->nh_flags & NHF_GATEWAY) { + gw = &nh->gw_sa; + ro.ro_flags |= RT_HAS_GW; + } /* * For input packets which are being "fastrouted", they won't @@ -822,9 +828,7 @@ ipf_fastroute(m0, mpp, fin, fdp) if (ntohs(ip->ip_len) <= ifp->if_mtu) { if (!ip->ip_sum) ip->ip_sum = in_cksum(m, hlen); - error = (*ifp->if_output)(ifp, m, (struct sockaddr *)&dst, - NULL - ); + error = (*ifp->if_output)(ifp, m, gw, &ro); goto done; } /* @@ -904,10 +908,7 @@ sendorfree: m0 = m->m_act; m->m_act = 0; if (error == 0) - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)&dst, - NULL - ); + error = (*ifp->if_output)(ifp, m, gw, &ro); else FREE_MB_T(m); } diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index 8623079fe429..4d98597409d6 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -1113,7 +1113,10 @@ get_l2te_for_nexthop(struct port_info *pi, struct ifnet *ifp, if (nh->nh_ifp != ifp) return (NULL); if (nh->nh_flags & NHF_GATEWAY) - ((struct sockaddr_in *)dst)->sin_addr = nh->gw4_sa.sin_addr; + if (nh->gw_sa.sa_family == AF_INET) + ((struct sockaddr_in *)dst)->sin_addr = nh->gw4_sa.sin_addr; + else + *((struct sockaddr_in6 *)dst) = nh->gw6_sa; else ((struct sockaddr_in *)dst)->sin_addr = inc->inc_faddr; } diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c index 4dac86141230..603265a52b13 100644 --- a/sys/dev/iicbus/if_ic.c +++ b/sys/dev/iicbus/if_ic.c @@ -372,7 +372,7 @@ icoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &hdr, sizeof(hdr)); else - hdr = dst->sa_family; + hdr = RO_GET_FAMILY(ro, dst); mtx_lock(&sc->ic_lock); ifp->if_drv_flags |= IFF_DRV_RUNNING; diff --git a/sys/net/debugnet.c b/sys/net/debugnet.c index bb59ff33a93f..8652597c55db 100644 --- a/sys/net/debugnet.c +++ b/sys/net/debugnet.c @@ -673,6 +673,7 @@ debugnet_connect(const struct debugnet_conn_params *dcp, goto cleanup; } + /* TODO support AF_INET6 */ if (nh->gw_sa.sa_family == AF_INET) gw_sin = &nh->gw4_sa; else { diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c index ac0028c42f70..14d544dfd86a 100644 --- a/sys/net/if_disc.c +++ b/sys/net/if_disc.c @@ -185,7 +185,7 @@ discoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); if (bpf_peers_present(ifp->if_bpf)) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 6d8b79d4dd12..3209e8a82978 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -236,10 +236,11 @@ ether_resolve_addr(struct ifnet *ifp, struct mbuf *m, #endif #ifdef INET6 case AF_INET6: - if ((m->m_flags & M_MCAST) == 0) - error = nd6_resolve(ifp, LLE_SF(AF_INET6, 0), m, dst, phdr, + if ((m->m_flags & M_MCAST) == 0) { + int af = RO_GET_FAMILY(ro, dst); + error = nd6_resolve(ifp, LLE_SF(af, 0), m, dst, phdr, &lleflags, plle); - else { + } else { const struct in6_addr *a6; a6 = &(((const struct sockaddr_in6 *)dst)->sin6_addr); ETHER_MAP_IPV6_MULTICAST(a6, eh->ether_dhost); @@ -353,7 +354,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, if ((pflags & RT_L2_ME) != 0) { update_mbuf_csumflags(m, m); - return (if_simloop(ifp, m, dst->sa_family, 0)); + return (if_simloop(ifp, m, RO_GET_FAMILY(ro, dst), 0)); } loop_copy = (pflags & RT_MAY_LOOP) != 0; @@ -400,7 +401,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, */ if ((n = m_dup(m, M_NOWAIT)) != NULL) { update_mbuf_csumflags(m, n); - (void)if_simloop(ifp, n, dst->sa_family, hlen); + (void)if_simloop(ifp, n, RO_GET_FAMILY(ro, dst), hlen); } else if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); } diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c index a6c43d4d05a4..321721737d36 100644 --- a/sys/net/if_fwsubr.c +++ b/sys/net/if_fwsubr.c @@ -94,6 +94,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, #if defined(INET) || defined(INET6) int is_gw = 0; #endif + int af = RO_GET_FAMILY(ro, dst); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); @@ -137,6 +138,26 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, destfw = NULL; } + switch (af) { +#ifdef INET + case AF_INET: + type = ETHERTYPE_IP; + break; + case AF_ARP: + type = ETHERTYPE_ARP; + break; +#endif +#ifdef INET6 + case AF_INET6: + type = ETHERTYPE_IPV6; + break; +#endif + default: + if_printf(ifp, "can't handle af%d\n", af); + error = EAFNOSUPPORT; + goto bad; + } + switch (dst->sa_family) { #ifdef INET case AF_INET: @@ -151,7 +172,6 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (error) return (error == EWOULDBLOCK ? 0 : error); } - type = ETHERTYPE_IP; break; case AF_ARP: @@ -159,7 +179,6 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct arphdr *ah; ah = mtod(m, struct arphdr *); ah->ar_hrd = htons(ARPHRD_IEEE1394); - type = ETHERTYPE_ARP; if (unicast) *destfw = *(struct fw_hwaddr *) ar_tha(ah); @@ -176,12 +195,11 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, #ifdef INET6 case AF_INET6: if (unicast) { - error = nd6_resolve(fc->fc_ifp, LLE_SF(AF_INET6, is_gw), - m, dst, (u_char *) destfw, NULL, NULL); + error = nd6_resolve(fc->fc_ifp, LLE_SF(af, is_gw), m, + dst, (u_char *) destfw, NULL, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); } - type = ETHERTYPE_IPV6; break; #endif diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 113bcb5c916e..796f427e356b 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -409,7 +409,7 @@ gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); /* * Now save the af in the inbound pkt csum data, this is a cheat since * we are using the inbound csum_data field to carry the af over to diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 19014f9fd3de..5ad452ac38e0 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -613,7 +613,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); /* * Now save the af in the inbound pkt csum data, this is a cheat since * we are using the inbound csum_data field to carry the af over to diff --git a/sys/net/if_infiniband.c b/sys/net/if_infiniband.c index 244b2a5ba117..4dfbd5272d15 100644 --- a/sys/net/if_infiniband.c +++ b/sys/net/if_infiniband.c @@ -253,8 +253,9 @@ infiniband_resolve_addr(struct ifnet *ifp, struct mbuf *m, #ifdef INET6 case AF_INET6: if ((m->m_flags & M_MCAST) == 0) { - error = nd6_resolve(ifp, LLE_SF(AF_INET6, 0), m, dst, - phdr, &lleflags, plle); + int af = RO_GET_FAMILY(ro, dst); + error = nd6_resolve(ifp, LLE_SF(af, 0), m, dst, phdr, + &lleflags, plle); } else { infiniband_ipv6_multicast_map( &((const struct sockaddr_in6 *)dst)->sin6_addr, @@ -371,7 +372,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, if ((pflags & RT_L2_ME) != 0) { update_mbuf_csumflags(m, m); - return (if_simloop(ifp, m, dst->sa_family, 0)); + return (if_simloop(ifp, m, RO_GET_FAMILY(ro, dst), 0)); } /* diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index cbff8200806a..643ef2240fe1 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -235,7 +235,7 @@ looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) bcopy(dst->sa_data, &af, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); #if 1 /* XXX */ switch (af) { diff --git a/sys/net/if_me.c b/sys/net/if_me.c index aafc07c2b203..067ab22cd84d 100644 --- a/sys/net/if_me.c +++ b/sys/net/if_me.c @@ -533,14 +533,14 @@ drop: static int me_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, - struct route *ro __unused) + struct route *ro) { uint32_t af; if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); m->m_pkthdr.csum_data = af; return (ifp->if_transmit(ifp, m)); } diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index fbf7b0ea8f4c..804367025532 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -780,6 +780,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, int ipproto = PPP_IP; #endif int debug = ifp->if_flags & IFF_DEBUG; + int af = RO_GET_FAMILY(ro, dst); SPPP_LOCK(sp); @@ -805,7 +806,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, * dialout event in case IPv6 has been * administratively disabled on that interface. */ - if (dst->sa_family == AF_INET6 && + if (af == AF_INET6 && !(sp->confflags & CONF_ENABLE_IPV6)) goto drop; #endif @@ -818,7 +819,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, } #ifdef INET - if (dst->sa_family == AF_INET) { + if (af == AF_INET) { /* XXX Check mbuf length here? */ struct ip *ip = mtod (m, struct ip*); struct tcphdr *tcp = (struct tcphdr*) ((long*)ip + ip->ip_hl); @@ -888,14 +889,14 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, #endif #ifdef INET6 - if (dst->sa_family == AF_INET6) { + if (af == AF_INET6) { /* XXX do something tricky here? */ } #endif if (sp->pp_mode == PP_FR) { /* Add frame relay header. */ - m = sppp_fr_header (sp, m, dst->sa_family); + m = sppp_fr_header (sp, m, af); if (! m) goto nobufs; goto out; @@ -926,7 +927,7 @@ nobufs: if (debug) h->control = PPP_UI; /* Unnumbered Info */ } - switch (dst->sa_family) { + switch (af) { #ifdef INET case AF_INET: /* Internet Protocol */ if (sp->pp_mode == IFF_CISCO) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index b4b1b77ddc7c..bd9fc811d19f 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1402,7 +1402,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst, if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); if (bpf_peers_present(ifp->if_bpf)) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0); diff --git a/sys/net/route.h b/sys/net/route.h index 67217f237e0b..ec77d39b9649 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -394,6 +394,10 @@ struct rt_addrinfo { } \ } while (0) +#define RO_GET_FAMILY(ro, dst) ((ro) != NULL && \ + (ro)->ro_flags & RT_HAS_GW \ + ? (ro)->ro_dst.sa_family : (dst)->sa_family) + /* * Validate a cached route based on a supplied cookie. If there is an * out-of-date cache, simply free it. Update the generation number diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index a686d1623053..6db088102cd3 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -106,6 +106,14 @@ SYSCTL_UINT(_net_route, OID_AUTO, multipath, _MP_FLAGS | CTLFLAG_VNET, &VNET_NAME(rib_route_multipath), 0, "Enable route multipath"); #undef _MP_FLAGS +#if defined(INET) && defined(INET6) +FEATURE(ipv4_rfc5549_support, "Route IPv4 packets via IPv6 nexthops"); +#define V_rib_route_ipv6_nexthop VNET(rib_route_ipv6_nexthop) +VNET_DEFINE(u_int, rib_route_ipv6_nexthop) = 1; +SYSCTL_UINT(_net_route, OID_AUTO, ipv6_nexthop, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(rib_route_ipv6_nexthop), 0, "Enable IPv4 route via IPv6 Next Hop address"); +#endif + /* Routing table UMA zone */ VNET_DEFINE_STATIC(uma_zone_t, rtzone); #define V_rtzone VNET(rtzone) @@ -197,6 +205,20 @@ get_rnh(uint32_t fibnum, const struct rt_addrinfo *info) return (rnh); } +#if defined(INET) && defined(INET6) +static bool +rib_can_ipv6_nexthop_address(struct rib_head *rh) +{ + int result; + + CURVNET_SET(rh->rib_vnet); + result = !!V_rib_route_ipv6_nexthop; + CURVNET_RESTORE(); + + return (result); +} +#endif + #ifdef ROUTE_MPATH static bool rib_can_multipath(struct rib_head *rh) @@ -582,7 +604,13 @@ check_gateway(struct rib_head *rnh, struct sockaddr *dst, return (true); else if (gateway->sa_family == AF_LINK) return (true); - return (false); +#if defined(INET) && defined(INET6) + else if (dst->sa_family == AF_INET && gateway->sa_family == AF_INET6 && + rib_can_ipv6_nexthop_address(rnh)) + return (true); +#endif + else + return (false); } /* diff --git a/sys/netgraph/netflow/netflow.c b/sys/netgraph/netflow/netflow.c index 7d4108ee59a7..5c0358d9b67a 100644 --- a/sys/netgraph/netflow/netflow.c +++ b/sys/netgraph/netflow/netflow.c @@ -364,6 +364,10 @@ hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r, fle->f.fle_o_ifx = nh->nh_ifp->if_index; if (nh->gw_sa.sa_family == AF_INET) fle->f.next_hop = nh->gw4_sa.sin_addr; + /* + * XXX we're leaving an empty gateway here for + * IPv6 nexthops. + */ fle->f.dst_mask = plen; } } diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 1e586d687244..e6871435fa88 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -371,7 +371,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); /* Berkeley packet filter */ ng_iface_bpftap(ifp, m, af); diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 44da6b73e41c..facf876f18cc 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -199,7 +199,9 @@ ip_tryforward(struct mbuf *m) struct ip *ip; struct mbuf *m0 = NULL; struct nhop_object *nh = NULL; - struct sockaddr_in dst; + struct route ro; + struct sockaddr_in *dst; + const struct sockaddr *gw; struct in_addr dest, odest, rtdest; uint16_t ip_len, ip_off; int error = 0; @@ -421,19 +423,23 @@ passout: ip_len = ntohs(ip->ip_len); ip_off = ntohs(ip->ip_off); - bzero(&dst, sizeof(dst)); - dst.sin_family = AF_INET; - dst.sin_len = sizeof(dst); - if (nh->nh_flags & NHF_GATEWAY) - dst.sin_addr = nh->gw4_sa.sin_addr; - else - dst.sin_addr = dest; + bzero(&ro, sizeof(ro)); + dst = (struct sockaddr_in *)&ro.ro_dst; + dst->sin_family = AF_INET; + dst->sin_len = sizeof(*dst); + dst->sin_addr = dest; + if (nh->nh_flags & NHF_GATEWAY) { + gw = &nh->gw_sa; + ro.ro_flags |= RT_HAS_GW; + } else + gw = (const struct sockaddr *)dst; /* * Handle redirect case. */ redest.s_addr = 0; - if (V_ipsendredirects && (nh->nh_ifp == m->m_pkthdr.rcvif)) + if (V_ipsendredirects && (nh->nh_ifp == m->m_pkthdr.rcvif) && + gw->sa_family == AF_INET) mcopy = ip_redir_alloc(m, nh, ip, &redest.s_addr); /* @@ -448,8 +454,7 @@ passout: * Send off the packet via outgoing interface */ IP_PROBE(send, NULL, NULL, ip, nh->nh_ifp, ip, NULL); - error = (*nh->nh_ifp->if_output)(nh->nh_ifp, m, - (struct sockaddr *)&dst, NULL); + error = (*nh->nh_ifp->if_output)(nh->nh_ifp, m, gw, &ro); } else { /* * Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery @@ -484,7 +489,7 @@ passout: mtod(m, struct ip *), nh->nh_ifp, mtod(m, struct ip *), NULL); error = (*nh->nh_ifp->if_output)(nh->nh_ifp, m, - (struct sockaddr *)&dst, NULL); + gw, &ro); if (error) break; } while ((m = m0) != NULL); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 733cc2901879..465c00e4dac7 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1065,13 +1065,16 @@ ip_forward(struct mbuf *m, int srcrt) if (nh_ia != NULL && (src & nh_ia->ia_subnetmask) == nh_ia->ia_subnet) { - if (nh->nh_flags & NHF_GATEWAY) - dest.s_addr = nh->gw4_sa.sin_addr.s_addr; - else - dest.s_addr = ip->ip_dst.s_addr; /* Router requirements says to only send host redirects */ type = ICMP_REDIRECT; code = ICMP_REDIRECT_HOST; + if (nh->nh_flags & NHF_GATEWAY) { + if (nh->gw_sa.sa_family == AF_INET) + dest.s_addr = nh->gw4_sa.sin_addr.s_addr; + else /* Do not redirect in case gw is AF_INET6 */ + type = 0; + } else + dest.s_addr = ip->ip_dst.s_addr; } } } diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 3041232b7223..ad41c9df0b8c 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -212,7 +212,7 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, int flags, static int ip_output_send(struct inpcb *inp, struct ifnet *ifp, struct mbuf *m, - const struct sockaddr_in *gw, struct route *ro, bool stamp_tag) + const struct sockaddr *gw, struct route *ro, bool stamp_tag) { #ifdef KERN_TLS struct ktls_session *tls = NULL; @@ -273,7 +273,7 @@ ip_output_send(struct inpcb *inp, struct ifnet *ifp, struct mbuf *m, m->m_pkthdr.csum_flags |= CSUM_SND_TAG; } - error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); + error = (*ifp->if_output)(ifp, m, gw, ro); done: /* Check for route change invalidating send tags. */ @@ -329,12 +329,13 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, int mtu = 0; int error = 0; int vlan_pcp = -1; - struct sockaddr_in *dst, sin; - const struct sockaddr_in *gw; + struct sockaddr_in *dst; + const struct sockaddr *gw; struct in_ifaddr *ia = NULL; struct in_addr src; int isbroadcast; uint16_t ip_len, ip_off; + struct route iproute; uint32_t fibnum; #if defined(IPSEC) || defined(IPSEC_SUPPORT) int no_route_but_check_spd = 0; @@ -386,23 +387,23 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, * therefore we need restore gw if we're redoing lookup. */ fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); - if (ro != NULL) - dst = (struct sockaddr_in *)&ro->ro_dst; - else - dst = &sin; - if (ro == NULL || ro->ro_nh == NULL) { - bzero(dst, sizeof(*dst)); + if (ro == NULL) { + ro = &iproute; + bzero(ro, sizeof (*ro)); + } + dst = (struct sockaddr_in *)&ro->ro_dst; + if (ro->ro_nh == NULL) { dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = ip->ip_dst; } - gw = dst; + gw = (const struct sockaddr *)dst; again: /* * Validate route against routing table additions; * a better/more specific route might have been added. */ - if (inp != NULL && ro != NULL && ro->ro_nh != NULL) + if (inp != NULL && ro->ro_nh != NULL) NH_VALIDATE(ro, &inp->inp_rt_cookie, fibnum); /* * If there is a cached route, @@ -412,7 +413,7 @@ again: * cache with IPv6. * Also check whether routing cache needs invalidation. */ - if (ro != NULL && ro->ro_nh != NULL && + if (ro->ro_nh != NULL && ((!NH_IS_VALID(ro->ro_nh)) || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) RO_INVALIDATE_CACHE(ro); @@ -469,7 +470,7 @@ again: src = IA_SIN(ia)->sin_addr; else src.s_addr = INADDR_ANY; - } else if (ro != NULL) { + } else if (ro != &iproute) { if (ro->ro_nh == NULL) { /* * We want to do any cloning requested by the link @@ -502,11 +503,11 @@ again: counter_u64_add(nh->nh_pksent, 1); rt_update_ro_flags(ro, nh); if (nh->nh_flags & NHF_GATEWAY) - gw = &nh->gw4_sa; + gw = &nh->gw_sa; if (nh->nh_flags & NHF_HOST) isbroadcast = (nh->nh_flags & NHF_BROADCAST); - else if (ifp->if_flags & IFF_BROADCAST) - isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); + else if ((ifp->if_flags & IFF_BROADCAST) && (gw->sa_family == AF_INET)) + isbroadcast = in_ifaddr_broadcast(((const struct sockaddr_in *)gw)->sin_addr, ia); else isbroadcast = 0; mtu = nh->nh_mtu; @@ -531,22 +532,16 @@ again: } ifp = nh->nh_ifp; mtu = nh->nh_mtu; - /* - * We are rewriting here dst to be gw actually, contradicting - * comment at the beginning of the function. However, in this - * case we are always dealing with on stack dst. - * In case if pfil(9) sends us back to beginning of the - * function, the dst would be rewritten by ip_output_pfil(). - */ - MPASS(dst == &sin); + rt_update_ro_flags(ro, nh); if (nh->nh_flags & NHF_GATEWAY) - dst->sin_addr = nh->gw4_sa.sin_addr; + gw = &nh->gw_sa; ia = ifatoia(nh->nh_ifa); src = IA_SIN(ia)->sin_addr; isbroadcast = (((nh->nh_flags & (NHF_HOST | NHF_BROADCAST)) == (NHF_HOST | NHF_BROADCAST)) || ((ifp->if_flags & IFF_BROADCAST) && - in_ifaddr_broadcast(dst->sin_addr, ia))); + (gw->sa_family == AF_INET) && + in_ifaddr_broadcast(((const struct sockaddr_in *)gw)->sin_addr, ia))); } /* Catch a possible divide by zero later. */ @@ -561,7 +556,7 @@ again: * still points to the address in "ro". (It may have been * changed to point to a gateway address, above.) */ - gw = dst; + gw = (const struct sockaddr *)dst; /* * See if the caller provided any multicast options */ @@ -721,7 +716,7 @@ sendit: RO_NHFREE(ro); ro->ro_prepend = NULL; } - gw = dst; + gw = (const struct sockaddr *)dst; ip = mtod(m, struct ip *); goto again; } diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c index 1c0be6011253..0bf55958c618 100644 --- a/sys/netinet/toecore.c +++ b/sys/netinet/toecore.c @@ -483,7 +483,8 @@ toe_l2_resolve(struct toedev *tod, struct ifnet *ifp, struct sockaddr *sa, #endif #ifdef INET6 case AF_INET6: - rc = nd6_resolve(ifp, LLE_SF(AF_INET6, 0), NULL, sa, lladdr, NULL, NULL); + rc = nd6_resolve(ifp, LLE_SF(AF_INET6, 0), NULL, sa, lladdr, + NULL, NULL); break; #endif default: diff --git a/sys/ofed/drivers/infiniband/core/ib_addr.c b/sys/ofed/drivers/infiniband/core/ib_addr.c index 297469bd4d87..2ac79ca64664 100644 --- a/sys/ofed/drivers/infiniband/core/ib_addr.c +++ b/sys/ofed/drivers/infiniband/core/ib_addr.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -397,9 +398,16 @@ static int addr4_resolve(struct sockaddr_in *src_in, } else { bool is_gw = (nh->nh_flags & NHF_GATEWAY) != 0; memset(edst, 0, MAX_ADDR_LEN); - error = arpresolve(ifp, is_gw, NULL, is_gw ? - &nh->gw_sa : (const struct sockaddr *)&dst_tmp, - edst, NULL, NULL); +#ifdef INET6 + if (is_gw && nh->gw_sa.sa_family == AF_INET6) + error = nd6_resolve(ifp, LLE_SF(AF_INET, is_gw), NULL, + &nh->gw_sa, edst, NULL, NULL); + else +#endif + error = arpresolve(ifp, is_gw, NULL, is_gw ? + &nh->gw_sa : (const struct sockaddr *)&dst_tmp, + edst, NULL, NULL); + if (error != 0) goto error_put_ifp; else if (is_gw) From owner-dev-commits-src-all@freebsd.org Sun Aug 22 23:03:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 415E165F498; Sun, 22 Aug 2021 23:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt9sD1JF2z4gtG; Sun, 22 Aug 2021 23:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15DF2126E; Sun, 22 Aug 2021 23:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MN3SJS043931; Sun, 22 Aug 2021 23:03:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MN3Sj0043930; Sun, 22 Aug 2021 23:03:28 GMT (envelope-from git) Date: Sun, 22 Aug 2021 23:03:28 GMT Message-Id: <202108222303.17MN3Sj0043930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 98c467192082 - stable/12 - Escape any '.' characters in sysctl node names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 98c467192082b3d4a6c91eeaa80868bb5231534c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 23:03:28 -0000 The branch stable/12 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=98c467192082b3d4a6c91eeaa80868bb5231534c commit 98c467192082b3d4a6c91eeaa80868bb5231534c Author: Alan Somers AuthorDate: 2021-07-21 21:11:00 +0000 Commit: Alan Somers CommitDate: 2021-08-22 22:43:50 +0000 Escape any '.' characters in sysctl node names ZFS creates some sysctl nodes that include a pool name, and '.' is an allowed character in pool names. But it's the separator in the sysctl tree, so it can't be included in a sysctl name. Replace it with "%25". Handily, "%" is illegal in ZFS pool names, so there's no ambiguity there. PR: 257316 Sponsored by: Axcient Reviewed by: freqlabs Differential Revision: https://reviews.freebsd.org/D31265 (cherry picked from commit 6c9506559080da2914749bf611225d7c0a153609) --- sys/kern/kern_sysctl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index fa0398896ad0..d40eec348ae3 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -109,6 +109,7 @@ static int sysctl_root(SYSCTL_HANDLER_ARGS); /* Root list */ struct sysctl_oid_list sysctl__children = SLIST_HEAD_INITIALIZER(&sysctl__children); +static char* sysctl_escape_name(const char*); static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse); static int sysctl_old_kernel(struct sysctl_req *, const void *, size_t); @@ -734,6 +735,45 @@ sysctl_remove_name(struct sysctl_oid *parent, const char *name, return (error); } +/* + * Duplicate the provided string, escaping any illegal characters. The result + * must be freed when no longer in use. + * + * The list of illegal characters is ".". + */ +static char* +sysctl_escape_name(const char* orig) +{ + int i, s = 0, d = 0, nillegals = 0; + char *new; + + /* First count the number of illegal characters */ + for (i = 0; orig[i] != '\0'; i++) { + if (orig[i] == '.') + nillegals++; + } + + /* Allocate storage for new string */ + new = malloc(i + 2 * nillegals + 1, M_SYSCTLOID, M_WAITOK); + + /* Copy the name, escaping characters as we go */ + while (orig[s] != '\0') { + if (orig[s] == '.') { + /* %25 is the hexadecimal representation of '.' */ + new[d++] = '%'; + new[d++] = '2'; + new[d++] = '5'; + s++; + } else { + new[d++] = orig[s++]; + } + } + + /* Finally, nul-terminate */ + new[d] = '\0'; + + return (new); +} static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse) @@ -816,14 +856,17 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, const char *label) { struct sysctl_oid *oidp; + char *escaped; /* You have to hook up somewhere.. */ if (parent == NULL) return(NULL); + escaped = sysctl_escape_name(name); /* Check if the node already exists, otherwise create it */ SYSCTL_WLOCK(); - oidp = sysctl_find_oidname(name, parent); + oidp = sysctl_find_oidname(escaped, parent); if (oidp != NULL) { + free(escaped, M_SYSCTLOID); if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) { oidp->oid_refcnt++; /* Update the context */ @@ -842,7 +885,7 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, SLIST_INIT(&oidp->oid_children); oidp->oid_number = number; oidp->oid_refcnt = 1; - oidp->oid_name = strdup(name, M_SYSCTLOID); + oidp->oid_name = escaped; oidp->oid_handler = handler; oidp->oid_kind = CTLFLAG_DYN | kind; oidp->oid_arg1 = arg1; From owner-dev-commits-src-all@freebsd.org Sun Aug 22 23:04:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF8D265F735; Sun, 22 Aug 2021 23:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt9tM5389z4hSd; Sun, 22 Aug 2021 23:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 958D91379; Sun, 22 Aug 2021 23:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MN4ReD044113; Sun, 22 Aug 2021 23:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MN4Rta044112; Sun, 22 Aug 2021 23:04:27 GMT (envelope-from git) Date: Sun, 22 Aug 2021 23:04:27 GMT Message-Id: <202108222304.17MN4Rta044112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 5f468877862c - stable/12 - iostat: fix rounding errors in iostat -x MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5f468877862c4ee4e2d94146b924fa0463f926cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 23:04:27 -0000 The branch stable/12 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=5f468877862c4ee4e2d94146b924fa0463f926cb commit 5f468877862c4ee4e2d94146b924fa0463f926cb Author: Alan Somers AuthorDate: 2021-07-08 16:16:32 +0000 Commit: Alan Somers CommitDate: 2021-08-22 23:04:09 +0000 iostat: fix rounding errors in iostat -x Better to round numbers instead of flooring them. Sponsored by: Axcient (cherry picked from commit 61631b24a1347a23cafe0657fba894622b1606e2) --- usr.sbin/iostat/iostat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index e5f746c15284..d1c35063c72f 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -888,17 +888,17 @@ devstats(int perf_select, long double etime, int havelast) mb_per_second_write > ((long double).0005)/1024 || busy_pct > 0.5) { if (Iflag == 0) - printf("%-8.8s %7d %7d %8.1Lf " - "%8.1Lf %5d %5d %5d %5d " - "%4" PRIu64 " %3.0Lf ", + printf("%-8.8s %7.0Lf %7.0Lf %8.1Lf " + "%8.1Lf %5.0Lf %5.0Lf %5.0Lf %5.0Lf" + " %4" PRIu64 " %3.0Lf ", devicename, - (int)transfers_per_second_read, - (int)transfers_per_second_write, + transfers_per_second_read, + transfers_per_second_write, mb_per_second_read * 1024, mb_per_second_write * 1024, - (int)ms_per_read, (int)ms_per_write, - (int)ms_per_other, - (int)ms_per_transaction, + ms_per_read, ms_per_write, + ms_per_other, + ms_per_transaction, queue_len, busy_pct); else printf("%-8.8s %11.1Lf %11.1Lf " From owner-dev-commits-src-all@freebsd.org Sun Aug 22 23:05:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45CA665F747; Sun, 22 Aug 2021 23:05:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt9vm1WmZz4j68; Sun, 22 Aug 2021 23:05:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DA5B12DA; Sun, 22 Aug 2021 23:05:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MN5evP044309; Sun, 22 Aug 2021 23:05:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MN5eGU044308; Sun, 22 Aug 2021 23:05:40 GMT (envelope-from git) Date: Sun, 22 Aug 2021 23:05:40 GMT Message-Id: <202108222305.17MN5eGU044308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 457516c6ab75 - stable/12 - ftpd: delete dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 457516c6ab758abf47d22fcf520d82bf1be96a26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 23:05:40 -0000 The branch stable/12 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=457516c6ab758abf47d22fcf520d82bf1be96a26 commit 457516c6ab758abf47d22fcf520d82bf1be96a26 Author: Alan Somers AuthorDate: 2021-07-27 18:14:00 +0000 Commit: Alan Somers CommitDate: 2021-08-22 23:05:32 +0000 ftpd: delete dead code Delete code killed by SVN r13139 in 1996. Little chance that it would still compile today. PR: 257317 Reported by: Alan Shearer Sponsored by: Axcient (cherry picked from commit 674400eb20b65369a88b1cb778d729bc297832c9) --- libexec/ftpd/extern.h | 3 --- libexec/ftpd/ftpd.c | 49 ------------------------------------------------- 2 files changed, 52 deletions(-) diff --git a/libexec/ftpd/extern.h b/libexec/ftpd/extern.h index 80d24b46d2e4..aa48ea67e320 100644 --- a/libexec/ftpd/extern.h +++ b/libexec/ftpd/extern.h @@ -59,9 +59,6 @@ char *renamefrom(char *); void reply(int, const char *, ...) __printflike(2, 3); void retrieve(char *, char *); void send_file_list(char *); -#ifdef OLD_SETPROCTITLE -void setproctitle(const char *, ...); -#endif void statcmd(void); void statfilecmd(char *); void store(char *, char *, int); diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 25ae3fba956b..e23c06aaf143 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -205,10 +205,6 @@ int swaitmax = SWAITMAX; int swaitint = SWAITINT; #ifdef SETPROCTITLE -#ifdef OLD_SETPROCTITLE -char **Argv = NULL; /* pointer to argument vector */ -char *LastArgv = NULL; /* end of argv */ -#endif /* OLD_SETPROCTITLE */ char proctitle[LINE_MAX]; /* initial part of title */ #endif /* SETPROCTITLE */ @@ -280,16 +276,6 @@ main(int argc, char *argv[], char **envp) sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART; -#ifdef OLD_SETPROCTITLE - /* - * Save start and extent of argv for setproctitle. - */ - Argv = argv; - while (*envp) - envp++; - LastArgv = envp[-1] + strlen(envp[-1]); -#endif /* OLD_SETPROCTITLE */ - /* * Prevent diagnostic messages from appearing on stderr. * We run as a daemon or from inetd; in both cases, there's @@ -3329,41 +3315,6 @@ reapchild(int signo) while (waitpid(-1, NULL, WNOHANG) > 0); } -#ifdef OLD_SETPROCTITLE -/* - * Clobber argv so ps will show what we're doing. (Stolen from sendmail.) - * Warning, since this is usually started from inetd.conf, it often doesn't - * have much of an environment or arglist to overwrite. - */ -void -setproctitle(const char *fmt, ...) -{ - int i; - va_list ap; - char *p, *bp, ch; - char buf[LINE_MAX]; - - va_start(ap, fmt); - (void)vsnprintf(buf, sizeof(buf), fmt, ap); - - /* make ps print our process name */ - p = Argv[0]; - *p++ = '-'; - - i = strlen(buf); - if (i > LastArgv - p - 2) { - i = LastArgv - p - 2; - buf[i] = '\0'; - } - bp = buf; - while (ch = *bp++) - if (ch != '\n' && ch != '\r') - *p++ = ch; - while (p < LastArgv) - *p++ = ' '; -} -#endif /* OLD_SETPROCTITLE */ - static void appendf(char **strp, char *fmt, ...) { From owner-dev-commits-src-all@freebsd.org Sun Aug 22 23:22:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0002D65F519; Sun, 22 Aug 2021 23:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GtBGq6QTYz4msX; Sun, 22 Aug 2021 23:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC58C1665; Sun, 22 Aug 2021 23:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17MNMBvY070043; Sun, 22 Aug 2021 23:22:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17MNMBOY070042; Sun, 22 Aug 2021 23:22:11 GMT (envelope-from git) Date: Sun, 22 Aug 2021 23:22:11 GMT Message-Id: <202108222322.17MNMBOY070042@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 60d0fd063d34 - stable/11 - ftpd: delete dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 60d0fd063d3497d94f4015fc407f86b13a74b2ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 23:22:12 -0000 The branch stable/11 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=60d0fd063d3497d94f4015fc407f86b13a74b2ff commit 60d0fd063d3497d94f4015fc407f86b13a74b2ff Author: Alan Somers AuthorDate: 2021-07-27 18:14:00 +0000 Commit: Alan Somers CommitDate: 2021-08-22 23:22:00 +0000 ftpd: delete dead code Delete code killed by SVN r13139 in 1996. Little chance that it would still compile today. PR: 257317 Reported by: Alan Shearer Sponsored by: Axcient (cherry picked from commit 674400eb20b65369a88b1cb778d729bc297832c9) --- libexec/ftpd/extern.h | 3 --- libexec/ftpd/ftpd.c | 49 ------------------------------------------------- 2 files changed, 52 deletions(-) diff --git a/libexec/ftpd/extern.h b/libexec/ftpd/extern.h index 9d56cb235b4c..022c97f6b6a9 100644 --- a/libexec/ftpd/extern.h +++ b/libexec/ftpd/extern.h @@ -57,9 +57,6 @@ char *renamefrom(char *); void reply(int, const char *, ...) __printflike(2, 3); void retrieve(char *, char *); void send_file_list(char *); -#ifdef OLD_SETPROCTITLE -void setproctitle(const char *, ...); -#endif void statcmd(void); void statfilecmd(char *); void store(char *, char *, int); diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index c057fdc7b500..67181f641494 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -203,10 +203,6 @@ int swaitmax = SWAITMAX; int swaitint = SWAITINT; #ifdef SETPROCTITLE -#ifdef OLD_SETPROCTITLE -char **Argv = NULL; /* pointer to argument vector */ -char *LastArgv = NULL; /* end of argv */ -#endif /* OLD_SETPROCTITLE */ char proctitle[LINE_MAX]; /* initial part of title */ #endif /* SETPROCTITLE */ @@ -278,16 +274,6 @@ main(int argc, char *argv[], char **envp) sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART; -#ifdef OLD_SETPROCTITLE - /* - * Save start and extent of argv for setproctitle. - */ - Argv = argv; - while (*envp) - envp++; - LastArgv = envp[-1] + strlen(envp[-1]); -#endif /* OLD_SETPROCTITLE */ - /* * Prevent diagnostic messages from appearing on stderr. * We run as a daemon or from inetd; in both cases, there's @@ -3326,41 +3312,6 @@ reapchild(int signo) while (waitpid(-1, NULL, WNOHANG) > 0); } -#ifdef OLD_SETPROCTITLE -/* - * Clobber argv so ps will show what we're doing. (Stolen from sendmail.) - * Warning, since this is usually started from inetd.conf, it often doesn't - * have much of an environment or arglist to overwrite. - */ -void -setproctitle(const char *fmt, ...) -{ - int i; - va_list ap; - char *p, *bp, ch; - char buf[LINE_MAX]; - - va_start(ap, fmt); - (void)vsnprintf(buf, sizeof(buf), fmt, ap); - - /* make ps print our process name */ - p = Argv[0]; - *p++ = '-'; - - i = strlen(buf); - if (i > LastArgv - p - 2) { - i = LastArgv - p - 2; - buf[i] = '\0'; - } - bp = buf; - while (ch = *bp++) - if (ch != '\n' && ch != '\r') - *p++ = ch; - while (p < LastArgv) - *p++ = ' '; -} -#endif /* OLD_SETPROCTITLE */ - static void appendf(char **strp, char *fmt, ...) { From owner-dev-commits-src-all@freebsd.org Sun Aug 22 17:33:10 2021 Return-Path: Delivered-To: dev-commits-src-all+unsubscribe@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25F00659798 for ; Sun, 22 Aug 2021 17:33:10 +0000 (UTC) (envelope-from mustafejen@gmail.com) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gt2X51MZTz3HLr for ; Sun, 22 Aug 2021 17:33:06 +0000 (UTC) (envelope-from mustafejen@gmail.com) Received: by mail-lf1-x130.google.com with SMTP id r9so32820871lfn.3 for ; Sun, 22 Aug 2021 10:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=nbSZPvTjcO8IibTlTW/MjsKwWsCYYaVLT94/xzEizfDLqc+tjYzLfPmQQtVPviBwp6 F/OBGBiPtjXqCjHovZ1ceCp9mUr66qEmM5U5EYejQfJS0X1QbxU/dyKcmFV7Ivf7NDCN 0CT00aPY2vwVdbyt2M4j9EdxPkhy+wFivudDo+1ITs7MkHCbAUyhC+AHCeny5gwgHnjV bs+YHMgr7E3XiTQIne0JqYUgayFLfyfbNiFOo0GNHgatr1rULPKDSYbr5jTSEmeFY9dm xvRhhEzeBjdZYXAeq1MoNSgVGo2LfZRHRPQi39CbQHiRc9Eq7JRW8Uy0WShTLN8r2QhJ il4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=dYnRWJ6IaR0JdxEuOa6R0Wcfc5GAsEDF5MQEy9CvTvofHHKz6CPYKPUFEnI0wBrmFY OqEKfXebXcRSPAQoKX8ZR/hDZhorHFM9uzZz7wNrlzDOYhaRY7vx3WUJ7XcLbtCkWSZw yVwhPbaItzFl2bIZLsXOx0AeRvO4MoHcmZKoPbSsEhltnpKVo25EO3ii5jOPwNTv8Tis 8WSn8F/qAtpd3DXbxEOkHAmLDJPcqffXXs+0B+4/Kx81bi0t9TtmmrlpgxH2538R9dIo ptWEYUQcVyhAY6EwsaHMiOseQrmBD1g8Rzyp8FCLy8L861BV0Dv8W9Fe790BnW7jYbm3 ufoA== X-Gm-Message-State: AOAM532tU3Vru0GWCMLPh0KPy2kkoaNVjHNcedV/8Wn2yZ/15h6yEnlT 3fdrGJhoKEQBy2Q5yBruzn1f7alKv8gw7w== X-Google-Smtp-Source: ABdhPJykdgdX+Rvz793r6cmMEcGr2KnOwOG8SH1SeW+UXWib80bvfr10Nzp5OB8f1wlJzbzv6wR3bw== X-Received: by 2002:ac2:58c5:: with SMTP id u5mr21389155lfo.603.1629653579201; Sun, 22 Aug 2021 10:32:59 -0700 (PDT) Received: from [10.0.0.176] (h-109-228-177-224.A258.priv.bahnhof.se. [109.228.177.224]) by smtp.gmail.com with ESMTPSA id e20sm1145723ljn.13.2021.08.22.10.32.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Aug 2021 10:32:58 -0700 (PDT) To: dev-commits-src-all+unsubscribe@freebsd.org From: Per Gunnarsson Subject: unsubscribe Message-ID: <923fdbea-8c46-7c5a-4a6c-af5a107e886c@gmail.com> Date: Sun, 22 Aug 2021 19:32:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4Gt2X51MZTz3HLr X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=nbSZPvTj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mustafejen@gmail.com designates 2a00:1450:4864:20::130 as permitted sender) smtp.mailfrom=mustafejen@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.995]; TAGGED_RCPT(0.00)[unsubscribe]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::130:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all] X-Mailman-Approved-At: Mon, 23 Aug 2021 09:19:01 +0000 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 17:33:10 -0000