From owner-svn-src-stable-11@freebsd.org Sun Nov 24 00:53:48 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33EE71C42D1; Sun, 24 Nov 2019 00:53:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LBW0053yz4dTV; Sun, 24 Nov 2019 00:53:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA9E71C54D; Sun, 24 Nov 2019 00:53:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAO0rllw039686; Sun, 24 Nov 2019 00:53:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAO0rlpX039685; Sun, 24 Nov 2019 00:53:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911240053.xAO0rlpX039685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 24 Nov 2019 00:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355041 - in stable/11: share/man/man4 sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 355041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Nov 2019 00:53:48 -0000 Author: mav Date: Sun Nov 24 00:53:47 2019 New Revision: 355041 URL: https://svnweb.freebsd.org/changeset/base/355041 Log: MFC r354580: Allow splitting PLX NTB BAR2 into several memory windows. Address Lookup Table (A-LUT) being enabled allows to specify separate translation for each 1/128th or 1/256th of the BAR2. Previously it was used only to limit effective window size by blocking access through some of A-LUT elements. This change allows A-LUT elements to also point different memory locations, providing to upper layers several (up to 128) independent memory windows. A-LUT hardware allows even more flexible configurations than this, but NTB KPI have no way to manage that now. Modified: stable/11/share/man/man4/ntb_hw_plx.4 stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ntb_hw_plx.4 ============================================================================== --- stable/11/share/man/man4/ntb_hw_plx.4 Sun Nov 24 00:53:22 2019 (r355040) +++ stable/11/share/man/man4/ntb_hw_plx.4 Sun Nov 24 00:53:47 2019 (r355041) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2017 Alexander Motin +.\" Copyright (c) 2017-2019 Alexander Motin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2017 +.Dd November 9, 2019 .Dt NTB_HW_PLX 4 .Os .Sh NAME @@ -54,6 +54,9 @@ NTB that it works in NTB-to-NTB (back-to-back) mode, 0 Driver attached to Link Interface (visible from Root Port side) switches to NTB-to-Root Port mode automatically, but one attached to Virtual Interface can't detect what is on the other side and require external knowledge. +.It Va hint.ntb_hw. Ns Ar X Ns Va .split +Being set above zero splits BAR2 into 2^x memory windows using Address +Lookup Table (A-LUT). .El .Sh DESCRIPTION The @@ -70,6 +73,8 @@ subsystem. Each PLX NTB provides up to 2 64-bit or 4 32-bit memory windows to the other system's memory, 6 or 12 scratchpad registers and 16 doorbells to interrupt the other system. +If Address Lookup Table (A-LUT) is enabled, BAR2 can be split into several +(up to 128) memory windows. In NTB-to-NTB mode one of memory windows (or half of it, if bigger then 1MB) is consumed by the driver itself to access scratchpad and doorbell registers of the other side. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Sun Nov 24 00:53:22 2019 (r355040) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Sun Nov 24 00:53:47 2019 (r355041) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Alexander Motin + * Copyright (c) 2017-2019 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #define PLX_NUM_SPAD 8 /* There are 8 scratchpads. */ #define PLX_NUM_SPAD_PATT 4 /* Use test pattern as 4 more. */ #define PLX_NUM_DB 16 /* There are 16 doorbells. */ +#define PLX_MAX_SPLIT 128 /* Allow are at most 128 splits. */ struct ntb_plx_mw_info { int mw_bar; @@ -65,9 +66,11 @@ struct ntb_plx_mw_info { vm_paddr_t mw_pbase; caddr_t mw_vbase; vm_size_t mw_size; - vm_memattr_t mw_map_mode; - bus_addr_t mw_xlat_addr; - size_t mw_xlat_size; + struct { + vm_memattr_t mw_map_mode; + bus_addr_t mw_xlat_addr; + bus_size_t mw_xlat_size; + } splits[PLX_MAX_SPLIT]; }; struct ntb_plx_softc { @@ -81,6 +84,7 @@ struct ntb_plx_softc { u_int link; /* Link v/s Virtual side. */ u_int port; /* Port number within chip. */ u_int alut; /* A-LUT is enabled for NTx */ + u_int split; /* split BAR2 into 2^x parts */ int int_rid; struct resource *int_res; @@ -222,11 +226,8 @@ ntb_plx_init(device_t dev) NTX_WRITE(sc, sc->link ? 0xdbc : 0xd9c, 0xc0218021); /* Set Link to Virtual address translation. */ - for (i = 0; i < sc->mw_count; i++) { - mw = &sc->mw_info[i]; - if (mw->mw_xlat_size != 0) - ntb_plx_mw_set_trans_internal(dev, i); - } + for (i = 0; i < sc->mw_count; i++) + ntb_plx_mw_set_trans_internal(dev, i); pci_enable_busmaster(dev); if (sc->b2b_mw >= 0) @@ -319,7 +320,7 @@ ntb_plx_attach(device_t dev) { struct ntb_plx_softc *sc = device_get_softc(dev); struct ntb_plx_mw_info *mw; - int error = 0, i; + int error = 0, i, j; uint32_t val; char buf[32]; @@ -361,7 +362,8 @@ ntb_plx_attach(device_t dev) mw->mw_pbase = rman_get_start(mw->mw_res); mw->mw_size = rman_get_size(mw->mw_res); mw->mw_vbase = rman_get_virtual(mw->mw_res); - mw->mw_map_mode = VM_MEMATTR_UNCACHEABLE; + for (j = 0; j < PLX_MAX_SPLIT; j++) + mw->splits[j].mw_map_mode = VM_MEMATTR_UNCACHEABLE; sc->mw_count++; /* Skip over adjacent BAR for 64-bit BARs. */ @@ -402,6 +404,26 @@ ntb_plx_attach(device_t dev) sc->b2b_off = 0; } + snprintf(buf, sizeof(buf), "hint.%s.%d.split", device_get_name(dev), + device_get_unit(dev)); + TUNABLE_INT_FETCH(buf, &sc->split); + if (sc->split > 7) { + device_printf(dev, "Split value is too high (%u)\n", sc->split); + sc->split = 0; + } else if (sc->split > 0 && sc->alut == 0) { + device_printf(dev, "Can't split with disabled A-LUT\n"); + sc->split = 0; + } else if (sc->split > 0 && (sc->mw_count == 0 || sc->mw_info[0].mw_bar != 2)) { + device_printf(dev, "Can't split disabled BAR2\n"); + sc->split = 0; + } else if (sc->split > 0 && (sc->b2b_mw == 0 && sc->b2b_off == 0)) { + device_printf(dev, "Can't split BAR2 consumed by B2B\n"); + sc->split = 0; + } else if (sc->split > 0) { + device_printf(dev, "Splitting BAR2 into %d memory windows\n", + 1 << sc->split); + } + /* * Use Physical Layer User Test Pattern as additional scratchpad. * Make sure they are present and enabled by writing to them. @@ -545,12 +567,29 @@ static uint8_t ntb_plx_mw_count(device_t dev) { struct ntb_plx_softc *sc = device_get_softc(dev); + uint8_t res; + res = sc->mw_count; + res += (1 << sc->split) - 1; if (sc->b2b_mw >= 0 && sc->b2b_off == 0) - return (sc->mw_count - 1); /* B2B consumed whole window. */ - return (sc->mw_count); + res--; /* B2B consumed whole window. */ + return (res); } +static unsigned +ntb_plx_user_mw_to_idx(struct ntb_plx_softc *sc, unsigned uidx, unsigned *sp) +{ + unsigned t; + + t = 1 << sc->split; + if (uidx < t) { + *sp = uidx; + return (0); + } + *sp = 0; + return (uidx - (t - 1)); +} + static int ntb_plx_mw_get_range(device_t dev, unsigned mw_idx, vm_paddr_t *base, caddr_t *vbase, size_t *size, size_t *align, size_t *align_size, @@ -558,8 +597,10 @@ ntb_plx_mw_get_range(device_t dev, unsigned mw_idx, vm { struct ntb_plx_softc *sc = device_get_softc(dev); struct ntb_plx_mw_info *mw; - size_t off; + size_t off, ss; + unsigned sp, split; + mw_idx = ntb_plx_user_mw_to_idx(sc, mw_idx, &sp); if (mw_idx >= sc->mw_count) return (EINVAL); off = 0; @@ -569,14 +610,16 @@ ntb_plx_mw_get_range(device_t dev, unsigned mw_idx, vm off = sc->b2b_off; } mw = &sc->mw_info[mw_idx]; + split = (mw->mw_bar == 2) ? sc->split : 0; + ss = (mw->mw_size - off) >> split; /* Local to remote memory window parameters. */ if (base != NULL) - *base = mw->mw_pbase + off; + *base = mw->mw_pbase + off + ss * sp; if (vbase != NULL) - *vbase = mw->mw_vbase + off; + *vbase = mw->mw_vbase + off + ss * sp; if (size != NULL) - *size = mw->mw_size - off; + *size = ss; /* * Remote to local memory window translation address alignment. @@ -623,91 +666,72 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m struct ntb_plx_mw_info *mw; uint64_t addr, eaddr, off, size, bsize, esize, val64; uint32_t val; - int i; + unsigned i, sp, split; mw = &sc->mw_info[mw_idx]; - addr = mw->mw_xlat_addr; - size = mw->mw_xlat_size; - off = 0; - if (mw_idx == sc->b2b_mw) { - off = sc->b2b_off; - KASSERT(off != 0, ("user shouldn't get non-shared b2b mw")); + off = (mw_idx == sc->b2b_mw) ? sc->b2b_off : 0; + split = (mw->mw_bar == 2) ? sc->split : 0; - /* - * While generally we can set any BAR size on link side, - * for B2B shared window we can't go above preconfigured - * size due to BAR address alignment requirements. - */ - if (size > mw->mw_size - off) - return (EINVAL); - } - - if (size > 0) { - /* Round BAR size to next power of 2 or at least 1MB. */ - bsize = size; + /* Get BAR size. In case of split or B2RP we can't change it. */ + if (split || sc->b2b_mw < 0) { + bsize = mw->mw_size - off; + } else { + bsize = mw->splits[0].mw_xlat_size; if (!powerof2(bsize)) bsize = 1LL << flsll(bsize); - if (bsize < 1024 * 1024) + if (bsize > 0 && bsize < 1024 * 1024) bsize = 1024 * 1024; + } - /* A-LUT has 128 or 256 times better granularity. */ - esize = bsize; - if (sc->alut && mw->mw_bar == 2) - esize /= 128 * sc->alut; + /* + * While for B2B we can set any BAR size on a link side, for shared + * window we can't go above preconfigured size due to BAR address + * alignment requirements. + */ + if ((off & (bsize - 1)) != 0) + return (EINVAL); - /* addr should be aligned to BAR or A-LUT element size. */ - if ((addr & (esize - 1)) != 0) - return (EINVAL); - } else - esize = bsize = 0; + /* In B2B mode set Link Interface BAR size/address. */ + if (sc->b2b_mw >= 0 && mw->mw_64bit) { + val64 = 0; + if (bsize > 0) + val64 = (~(bsize - 1) & ~0xfffff); + val64 |= 0xc; + PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4, val64); + PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4 + 4, val64 >> 32); - if (mw->mw_64bit) { - if (sc->b2b_mw >= 0) { - /* Set Link Interface BAR size and enable/disable it. */ - val64 = 0; - if (bsize > 0) - val64 = (~(bsize - 1) & ~0xfffff); - val64 |= 0xc; - PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4, val64); - PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4 + 4, val64 >> 32); + val64 = 0x2000000000000000 * mw->mw_bar + off; + PNTX_WRITE(sc, PCIR_BAR(mw->mw_bar), val64); + PNTX_WRITE(sc, PCIR_BAR(mw->mw_bar) + 4, val64 >> 32); + } else if (sc->b2b_mw >= 0) { + val = 0; + if (bsize > 0) + val = (~(bsize - 1) & ~0xfffff); + PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4, val); - /* Set Link Interface BAR address. */ - val64 = 0x2000000000000000 * mw->mw_bar + off; - PNTX_WRITE(sc, PCIR_BAR(mw->mw_bar), val64); - PNTX_WRITE(sc, PCIR_BAR(mw->mw_bar) + 4, val64 >> 32); - } + val64 = 0x20000000 * mw->mw_bar + off; + PNTX_WRITE(sc, PCIR_BAR(mw->mw_bar), val64); + } - /* Set Virtual Interface BARs address translation */ + /* Set BARs address translation */ + addr = split ? UINT64_MAX : mw->splits[0].mw_xlat_addr; + if (mw->mw_64bit) { PNTX_WRITE(sc, 0xc3c + (mw->mw_bar - 2) * 4, addr); PNTX_WRITE(sc, 0xc3c + (mw->mw_bar - 2) * 4 + 4, addr >> 32); } else { - /* Make sure we fit into 32-bit address space. */ - if ((addr & UINT32_MAX) != addr) - return (ERANGE); - if (((addr + bsize) & UINT32_MAX) != (addr + bsize)) - return (ERANGE); - - if (sc->b2b_mw >= 0) { - /* Set Link Interface BAR size and enable/disable it. */ - val = 0; - if (bsize > 0) - val = (~(bsize - 1) & ~0xfffff); - PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4, val); - - /* Set Link Interface BAR address. */ - val64 = 0x20000000 * mw->mw_bar + off; - PNTX_WRITE(sc, PCIR_BAR(mw->mw_bar), val64); - } - - /* Set Virtual Interface BARs address translation */ PNTX_WRITE(sc, 0xc3c + (mw->mw_bar - 2) * 4, addr); } - /* Configure and enable Link to Virtual A-LUT if we need it. */ - if (sc->alut && mw->mw_bar == 2 && - ((addr & (bsize - 1)) != 0 || size != bsize)) { - eaddr = addr; - for (i = 0; i < 128 * sc->alut; i++) { + /* Configure and enable A-LUT if we need it. */ + size = split ? 0 : mw->splits[0].mw_xlat_size; + if (sc->alut && mw->mw_bar == 2 && (sc->split > 0 || + ((addr & (bsize - 1)) != 0 || size != bsize))) { + esize = bsize / (128 * sc->alut); + for (i = sp = 0; i < 128 * sc->alut; i++) { + if (i % (128 * sc->alut >> sc->split) == 0) { + eaddr = addr = mw->splits[sp].mw_xlat_addr; + size = mw->splits[sp++].mw_xlat_size; + } val = sc->link ? 0 : 1; if (sc->alut == 1) val += 2 * sc->ntx; @@ -731,12 +755,18 @@ ntb_plx_mw_set_trans(device_t dev, unsigned mw_idx, bu { struct ntb_plx_softc *sc = device_get_softc(dev); struct ntb_plx_mw_info *mw; + unsigned sp; + mw_idx = ntb_plx_user_mw_to_idx(sc, mw_idx, &sp); if (mw_idx >= sc->mw_count) return (EINVAL); mw = &sc->mw_info[mw_idx]; - mw->mw_xlat_addr = addr; - mw->mw_xlat_size = size; + if (!mw->mw_64bit && + ((addr & UINT32_MAX) != addr || + ((addr + size) & UINT32_MAX) != (addr + size))) + return (ERANGE); + mw->splits[sp].mw_xlat_addr = addr; + mw->splits[sp].mw_xlat_size = size; return (ntb_plx_mw_set_trans_internal(dev, mw_idx)); } @@ -748,43 +778,49 @@ ntb_plx_mw_clear_trans(device_t dev, unsigned mw_idx) } static int -ntb_plx_mw_get_wc(device_t dev, unsigned idx, vm_memattr_t *mode) +ntb_plx_mw_get_wc(device_t dev, unsigned mw_idx, vm_memattr_t *mode) { struct ntb_plx_softc *sc = device_get_softc(dev); struct ntb_plx_mw_info *mw; + unsigned sp; - if (idx >= sc->mw_count) + mw_idx = ntb_plx_user_mw_to_idx(sc, mw_idx, &sp); + if (mw_idx >= sc->mw_count) return (EINVAL); - mw = &sc->mw_info[idx]; - *mode = mw->mw_map_mode; + mw = &sc->mw_info[mw_idx]; + *mode = mw->splits[sp].mw_map_mode; return (0); } static int -ntb_plx_mw_set_wc(device_t dev, unsigned idx, vm_memattr_t mode) +ntb_plx_mw_set_wc(device_t dev, unsigned mw_idx, vm_memattr_t mode) { struct ntb_plx_softc *sc = device_get_softc(dev); struct ntb_plx_mw_info *mw; - uint64_t off; + uint64_t off, ss; int rc; + unsigned sp, split; - if (idx >= sc->mw_count) + mw_idx = ntb_plx_user_mw_to_idx(sc, mw_idx, &sp); + if (mw_idx >= sc->mw_count) return (EINVAL); - mw = &sc->mw_info[idx]; - if (mw->mw_map_mode == mode) + mw = &sc->mw_info[mw_idx]; + if (mw->splits[sp].mw_map_mode == mode) return (0); off = 0; - if (idx == sc->b2b_mw) { + if (mw_idx == sc->b2b_mw) { KASSERT(sc->b2b_off != 0, ("user shouldn't get non-shared b2b mw")); off = sc->b2b_off; } - rc = pmap_change_attr((vm_offset_t)mw->mw_vbase + off, - mw->mw_size - off, mode); + split = (mw->mw_bar == 2) ? sc->split : 0; + ss = (mw->mw_size - off) >> split; + rc = pmap_change_attr((vm_offset_t)mw->mw_vbase + off + ss * sp, + ss, mode); if (rc == 0) - mw->mw_map_mode = mode; + mw->splits[sp].mw_map_mode = mode; return (rc); } From owner-svn-src-stable-11@freebsd.org Sun Nov 24 02:27:51 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3109D1C7F65; Sun, 24 Nov 2019 02:27:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LDbW0RN1z4jsb; Sun, 24 Nov 2019 02:27:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1E451D641; Sun, 24 Nov 2019 02:27:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAO2RolI093282; Sun, 24 Nov 2019 02:27:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAO2RopB093281; Sun, 24 Nov 2019 02:27:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911240227.xAO2RopB093281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 24 Nov 2019 02:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355044 - in stable: 11/usr.sbin/ntp 12/usr.sbin/ntp X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/usr.sbin/ntp 12/usr.sbin/ntp X-SVN-Commit-Revision: 355044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Nov 2019 02:27:51 -0000 Author: cy Date: Sun Nov 24 02:27:50 2019 New Revision: 355044 URL: https://svnweb.freebsd.org/changeset/base/355044 Log: MFC r354978: Chase r344883. ntp is 4.2.8p13. Modified: stable/11/usr.sbin/ntp/config.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/ntp/config.h Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/ntp/config.h ============================================================================== --- stable/11/usr.sbin/ntp/config.h Sun Nov 24 01:27:04 2019 (r355043) +++ stable/11/usr.sbin/ntp/config.h Sun Nov 24 02:27:50 2019 (r355044) @@ -1474,7 +1474,7 @@ #define PACKAGE_URL "http://www.ntp.org./" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.2.8p12" +#define PACKAGE_VERSION "4.2.8p13" /* data dir */ #define PERLLIBDIR "/usr/share/ntp/lib" From owner-svn-src-stable-11@freebsd.org Sun Nov 24 06:54:17 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E24861CE3C1; Sun, 24 Nov 2019 06:54:17 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LLVx5gktz3Cbn; Sun, 24 Nov 2019 06:54:17 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6105206D9; Sun, 24 Nov 2019 06:54:17 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAO6sHu1052220; Sun, 24 Nov 2019 06:54:17 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAO6sHVq052219; Sun, 24 Nov 2019 06:54:17 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201911240654.xAO6sHVq052219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sun, 24 Nov 2019 06:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355049 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 355049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Nov 2019 06:54:17 -0000 Author: dougm Date: Sun Nov 24 06:54:17 2019 New Revision: 355049 URL: https://svnweb.freebsd.org/changeset/base/355049 Log: MFC r354785 The loop in vm_map_protect that verifies that all transition map entries are stabilized, repeatedly verifies the same entry. Check each entry in turn. Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Sun Nov 24 06:46:49 2019 (r355048) +++ stable/11/sys/vm/vm_map.c Sun Nov 24 06:54:17 2019 (r355049) @@ -2041,17 +2041,16 @@ again: vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } - if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) - in_tran = entry; + if ((current->eflags & MAP_ENTRY_IN_TRANSITION) != 0) + in_tran = current; } /* - * Postpone the operation until all in transition map entries - * are stabilized. In-transition entry might already have its - * pages wired and wired_count incremented, but - * MAP_ENTRY_USER_WIRED flag not yet set, and visible to other - * threads because the map lock is dropped. In this case we - * would miss our call to vm_fault_copy_entry(). + * Postpone the operation until all in-transition map entries have + * stabilized. An in-transition entry might already have its pages + * wired and wired_count incremented, but not yet have its + * MAP_ENTRY_USER_WIRED flag set. In which case, we would fail to call + * vm_fault_copy_entry() in the final loop below. */ if (in_tran != NULL) { in_tran->eflags |= MAP_ENTRY_NEEDS_WAKEUP; From owner-svn-src-stable-11@freebsd.org Sun Nov 24 12:35:17 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9201C1AE659; Sun, 24 Nov 2019 12:35:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LV4P3Nv9z40PX; Sun, 24 Nov 2019 12:35:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5201624470; Sun, 24 Nov 2019 12:35:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOCZHGw053768; Sun, 24 Nov 2019 12:35:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOCZHL7053767; Sun, 24 Nov 2019 12:35:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911241235.xAOCZHL7053767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 24 Nov 2019 12:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355053 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 355053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Nov 2019 12:35:17 -0000 Author: kib Date: Sun Nov 24 12:35:16 2019 New Revision: 355053 URL: https://svnweb.freebsd.org/changeset/base/355053 Log: MFC r354789: kern_exec: p_osrel and p_fctl0 were obliterated by failed execve(2) attempt. Modified: stable/11/sys/kern/kern_exec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Sun Nov 24 12:30:41 2019 (r355052) +++ stable/11/sys/kern/kern_exec.c Sun Nov 24 12:35:16 2019 (r355053) @@ -361,7 +361,6 @@ do_execve(struct thread *td, struct image_args *args, struct ucred *oldcred; struct uidinfo *euip = NULL; register_t *stack_base; - int error, i; struct image_params image_params, *imgp; struct vattr attr; int (*img_first)(struct image_params *); @@ -382,6 +381,7 @@ do_execve(struct thread *td, struct image_args *args, #ifdef HWPMC_HOOKS struct pmckern_procexec pe; #endif + int error, i, orig_osrel; static const char fexecv_proc_title[] = "(fexecv)"; imgp = &image_params; @@ -407,6 +407,7 @@ do_execve(struct thread *td, struct image_args *args, imgp->attr = &attr; imgp->args = args; oldcred = p->p_ucred; + orig_osrel = p->p_osrel; #ifdef MAC error = mac_execve_enter(imgp, mac_p); @@ -892,6 +893,10 @@ interpret: SDT_PROBE1(proc, , , exec__success, args->fname); exec_fail_dealloc: + if (error != 0) { + p->p_osrel = orig_osrel; + } + if (imgp->firstpage != NULL) exec_unmap_first_page(imgp); From owner-svn-src-stable-11@freebsd.org Mon Nov 25 03:39:14 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 943F51C6A4C; Mon, 25 Nov 2019 03:39:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Lt7Q3WT9z3NdC; Mon, 25 Nov 2019 03:39:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C0386ADB; Mon, 25 Nov 2019 03:39:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAP3dERq088926; Mon, 25 Nov 2019 03:39:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAP3dEgt088925; Mon, 25 Nov 2019 03:39:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911250339.xAP3dEgt088925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 25 Nov 2019 03:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355079 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 355079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2019 03:39:14 -0000 Author: mav Date: Mon Nov 25 03:39:13 2019 New Revision: 355079 URL: https://svnweb.freebsd.org/changeset/base/355079 Log: MFC r354999: Fix off-by-one error in HPA/AMA maximum reporting. Before my refactoring the code reported value as maximum number of sectors, adding one to the maximum sector number returned by respective command. While this difference is somewhat confusing, restore previous behavior. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Mon Nov 25 03:38:49 2019 (r355078) +++ stable/11/sbin/camcontrol/camcontrol.c Mon Nov 25 03:39:13 2019 (r355079) @@ -1813,7 +1813,7 @@ atahpa_proc_resp(struct cam_device *device, union ccb if (hpasize != NULL) { if (retval == 2 || retval == 6) return (1); - *hpasize = lba; + *hpasize = lba + 1; } return (0); From owner-svn-src-stable-11@freebsd.org Mon Nov 25 03:49:39 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59AD71C6E81; Mon, 25 Nov 2019 03:49:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LtMR1cjsz3P8l; Mon, 25 Nov 2019 03:49:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AABD6CA2; Mon, 25 Nov 2019 03:49:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAP3nciG094842; Mon, 25 Nov 2019 03:49:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAP3nc2q094841; Mon, 25 Nov 2019 03:49:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911250349.xAP3nc2q094841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 25 Nov 2019 03:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355080 - in stable: 11/lib/libc/secure 12/lib/libc/secure X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/secure 12/lib/libc/secure X-SVN-Commit-Revision: 355080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2019 03:49:39 -0000 Author: kevans Date: Mon Nov 25 03:49:38 2019 New Revision: 355080 URL: https://svnweb.freebsd.org/changeset/base/355080 Log: MFC r354669, r354672, r354689: move __stack_chk_guard constructor r354669: ssp: add a priority to the __stack_chk_guard constructor First, this commit is a NOP on GCC <= 4.x; this decidedly doesn't work cleanly on GCC 4.2, and it will be gone soon anyways so I chose not to dump time into figuring out if there's a way to make it work. xtoolchain-gcc, clocking in as GCC6, can cope with it just fine and later versions are also generally ok with the syntax. I suspect very few users are running GCC4.2 built worlds and also experiencing potential fallout from the status quo. For dynamically linked applications, this change also means very little. rtld will run libc ctors before most others, so the situation is approximately a NOP for these as well. The real cause for this change is statically linked applications doing almost questionable things in their constructors. qemu-user-static, for instance, creates a thread in a global constructor for their async rcu callbacks. In general, this works in other places- - On OpenBSD, __stack_chk_guard is stored in an .openbsd.randomdata section that's initialized by the kernel in the static case, or ld.so in the dynamic case - On Linux, __stack_chk_guard is apparently stored in TLS and such a problem is circumvented there because the value is presumed stable in the new thread. On FreeBSD, the rcu thread creation ctor and __guard_setup are both unmarked priority. qemu-user-static spins up the rcu thread prior to __guard_setup which starts making function calls- some of these are sprinkled with the canary. In the middle of one of these functions, __guard_setup is invoked in the main thread and __stack_chk_guard changes- qemu-user-static is promptly terminated for an SSP violation that didn't actually happen. This is not an all-too-common problem. We circumvent it here by giving the __stack_chk_guard constructor a solid priority. 200 was chosen because that gives static applications ample range (down to 101) for working around it if they really need to. I suspect most applications will "just work" as expected- the default/non-prioritized flavor of __constructor__ functions run last, and the canary is generally not expected to change as of this point at the very least. This took approximately three weeks of spare time debugging to pin down. r354672: ssp: rework the logic to use priority=200 on clang builds The preproc logic was added at the last minute to appease GCC 4.2, and kevans@ did clearly not go back and double-check that the logic worked out for clang builds to use the new variant. It turns out that clang defines __GNUC__ == 4. Flip it around and check __clang__ as well, leaving a note to remove it later. r354689: ssp: further refine the conditional used for constructor priority __has_attribute(__constructor__) is a better test for clang than defined(__clang__). Switch to it instead. While we're already here and touching it, pfg@ nailed down when GCC actually introduced the priority argument -- 4.3. Use that instead of our hammer-guess of GCC >= 5 for the sake of correctness. PR: 241905 Modified: stable/11/lib/libc/secure/stack_protector.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libc/secure/stack_protector.c Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/secure/stack_protector.c ============================================================================== --- stable/11/lib/libc/secure/stack_protector.c Mon Nov 25 03:39:13 2019 (r355079) +++ stable/11/lib/libc/secure/stack_protector.c Mon Nov 25 03:49:38 2019 (r355080) @@ -40,11 +40,29 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" +/* + * We give __guard_setup a defined priority early on so that statically linked + * applications have a defined priority at which __stack_chk_guard will be + * getting initialized. This will not matter to most applications, because + * they're either not usually statically linked or they simply don't do things + * in constructors that would be adversely affected by their positioning with + * respect to this initialization. + * + * This conditional should be removed when GCC 4.2 is removed. + */ +#if __has_attribute(__constructor__) || __GNUC_PREREQ__(4, 3) +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__ (200), __used__)); +#else +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__, __used__)); +#endif + extern int __sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static void __guard_setup(void) __attribute__((__constructor__, __used__)); +static void __guard_setup(void) _GUARD_SETUP_CTOR_ATTR; static void __fail(const char *); void __stack_chk_fail(void); void __chk_fail(void); From owner-svn-src-stable-11@freebsd.org Mon Nov 25 15:45:20 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FBA21B0AA2; Mon, 25 Nov 2019 15:45:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MBFD2DLLz4Yy6; Mon, 25 Nov 2019 15:45:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 311F4EEF6; Mon, 25 Nov 2019 15:45:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPFjKge039512; Mon, 25 Nov 2019 15:45:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPFjKZI039511; Mon, 25 Nov 2019 15:45:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911251545.xAPFjKZI039511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 25 Nov 2019 15:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355091 - stable/11/sys/dev/nvme X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/nvme X-SVN-Commit-Revision: 355091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2019 15:45:20 -0000 Author: mav Date: Mon Nov 25 15:45:19 2019 New Revision: 355091 URL: https://svnweb.freebsd.org/changeset/base/355091 Log: MFC r341710 (by imp): Even though they are reserved, cdw2 and cdw3 can be set via nvme-cli (and soon nvmecontrol). Go ahead and copy them into rsvd2 and rsvd3. Modified: stable/11/sys/dev/nvme/nvme_ctrlr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/11/sys/dev/nvme/nvme_ctrlr.c Mon Nov 25 15:23:35 2019 (r355090) +++ stable/11/sys/dev/nvme/nvme_ctrlr.c Mon Nov 25 15:45:19 2019 (r355091) @@ -1004,6 +1004,8 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr req = nvme_allocate_request_null(nvme_pt_done, pt); req->cmd.opc = pt->cmd.opc; + req->cmd.rsvd2 = pt->cmd.rsvd2; + req->cmd.rsvd3 = pt->cmd.rsvd3; req->cmd.cdw10 = pt->cmd.cdw10; req->cmd.cdw11 = pt->cmd.cdw11; req->cmd.cdw12 = pt->cmd.cdw12; From owner-svn-src-stable-11@freebsd.org Mon Nov 25 15:51:07 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E0BB1B0BF5; Mon, 25 Nov 2019 15:51:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MBMt6XKBz4ZGr; Mon, 25 Nov 2019 15:51:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3838EF3B; Mon, 25 Nov 2019 15:51:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPFp6sR040781; Mon, 25 Nov 2019 15:51:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPFp6jV040778; Mon, 25 Nov 2019 15:51:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911251551.xAPFp6jV040778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 25 Nov 2019 15:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355092 - stable/11/sys/dev/nvme X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/nvme X-SVN-Commit-Revision: 355092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2019 15:51:07 -0000 Author: mav Date: Mon Nov 25 15:51:05 2019 New Revision: 355092 URL: https://svnweb.freebsd.org/changeset/base/355092 Log: MFC r344955 (by imp): Don't print all the I/O we abort on a reset, unless we're out of retries. When resetting the controller, we abort I/O. Prior to this fix, we printed a ton of abort messages for I/O that we're going to retry. This imparts no useful information. Stop printing them unless our retry count is exhausted. Clarify code for when we don't retry, and remove useless arg to a routine that's always called with it as 'true'. All the other debug is still printed (including multiple reset messages if we have multiple timeouts before the taskqueue runs the actual reset) so that we know when we reset. Modified: stable/11/sys/dev/nvme/nvme_ctrlr.c stable/11/sys/dev/nvme/nvme_private.h stable/11/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/11/sys/dev/nvme/nvme_ctrlr.c Mon Nov 25 15:45:19 2019 (r355091) +++ stable/11/sys/dev/nvme/nvme_ctrlr.c Mon Nov 25 15:51:05 2019 (r355092) @@ -235,7 +235,7 @@ nvme_ctrlr_fail_req_task(void *arg, int pending) STAILQ_REMOVE_HEAD(&ctrlr->fail_req, stailq); mtx_unlock(&ctrlr->lock); nvme_qpair_manual_complete_request(req->qpair, req, - NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, TRUE); + NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST); mtx_lock(&ctrlr->lock); } mtx_unlock(&ctrlr->lock); Modified: stable/11/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/11/sys/dev/nvme/nvme_private.h Mon Nov 25 15:45:19 2019 (r355091) +++ stable/11/sys/dev/nvme/nvme_private.h Mon Nov 25 15:51:05 2019 (r355092) @@ -415,8 +415,7 @@ void nvme_qpair_reset(struct nvme_qpair *qpair); void nvme_qpair_fail(struct nvme_qpair *qpair); void nvme_qpair_manual_complete_request(struct nvme_qpair *qpair, struct nvme_request *req, - uint32_t sct, uint32_t sc, - boolean_t print_on_error); + uint32_t sct, uint32_t sc); void nvme_admin_qpair_enable(struct nvme_qpair *qpair); void nvme_admin_qpair_disable(struct nvme_qpair *qpair); Modified: stable/11/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/11/sys/dev/nvme/nvme_qpair.c Mon Nov 25 15:45:19 2019 (r355091) +++ stable/11/sys/dev/nvme/nvme_qpair.c Mon Nov 25 15:51:05 2019 (r355092) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +typedef enum error_print { ERROR_PRINT_NONE, ERROR_PRINT_NO_RETRY, ERROR_PRINT_ALL } error_print_t; +#define DO_NOT_RETRY 1 + static void _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req); static void nvme_qpair_destroy(struct nvme_qpair *qpair); @@ -358,7 +361,7 @@ nvme_completion_is_retry(const struct nvme_completion static void nvme_qpair_complete_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr, - struct nvme_completion *cpl, boolean_t print_on_error) + struct nvme_completion *cpl, error_print_t print_on_error) { struct nvme_request *req; boolean_t retry, error; @@ -368,7 +371,8 @@ nvme_qpair_complete_tracker(struct nvme_qpair *qpair, retry = error && nvme_completion_is_retry(cpl) && req->retries < nvme_retry_count; - if (error && print_on_error) { + if (error && (print_on_error == ERROR_PRINT_ALL || + (!retry && print_on_error == ERROR_PRINT_NO_RETRY))) { nvme_qpair_print_command(qpair, &req->cmd); nvme_qpair_print_completion(qpair, cpl); } @@ -420,7 +424,7 @@ nvme_qpair_complete_tracker(struct nvme_qpair *qpair, static void nvme_qpair_manual_complete_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr, uint32_t sct, uint32_t sc, uint32_t dnr, - boolean_t print_on_error) + error_print_t print_on_error) { struct nvme_completion cpl; @@ -435,8 +439,7 @@ nvme_qpair_manual_complete_tracker(struct nvme_qpair * void nvme_qpair_manual_complete_request(struct nvme_qpair *qpair, - struct nvme_request *req, uint32_t sct, uint32_t sc, - boolean_t print_on_error) + struct nvme_request *req, uint32_t sct, uint32_t sc) { struct nvme_completion cpl; boolean_t error; @@ -448,7 +451,7 @@ nvme_qpair_manual_complete_request(struct nvme_qpair * error = nvme_completion_is_error(&cpl); - if (error && print_on_error) { + if (error) { nvme_qpair_print_command(qpair, &req->cmd); nvme_qpair_print_completion(qpair, &cpl); } @@ -488,7 +491,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai tr = qpair->act_tr[cpl->cid]; if (tr != NULL) { - nvme_qpair_complete_tracker(qpair, tr, cpl, TRUE); + nvme_qpair_complete_tracker(qpair, tr, cpl, ERROR_PRINT_ALL); qpair->sq_head = cpl->sqhd; done++; } else { @@ -713,7 +716,7 @@ nvme_admin_qpair_abort_aers(struct nvme_qpair *qpair) if (tr->req->cmd.opc == NVME_OPC_ASYNC_EVENT_REQUEST) { nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, NVME_SC_ABORTED_SQ_DELETION, 0, - FALSE); + ERROR_PRINT_NONE); tr = TAILQ_FIRST(&qpair->outstanding_tr); } else { tr = TAILQ_NEXT(tr, tailq); @@ -756,7 +759,7 @@ nvme_abort_complete(void *arg, const struct nvme_compl nvme_printf(tr->qpair->ctrlr, "abort command failed, aborting command manually\n"); nvme_qpair_manual_complete_tracker(tr->qpair, tr, - NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, 0, TRUE); + NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, 0, ERROR_PRINT_ALL); } } @@ -973,7 +976,7 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, s */ mtx_unlock(&qpair->lock); nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, - NVME_SC_DATA_TRANSFER_ERROR, 1 /* do not retry */, TRUE); + NVME_SC_DATA_TRANSFER_ERROR, DO_NOT_RETRY, ERROR_PRINT_ALL); mtx_lock(&qpair->lock); } } @@ -1031,7 +1034,7 @@ nvme_admin_qpair_enable(struct nvme_qpair *qpair) nvme_printf(qpair->ctrlr, "aborting outstanding admin command\n"); nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, - NVME_SC_ABORTED_BY_REQUEST, 1 /* do not retry */, TRUE); + NVME_SC_ABORTED_BY_REQUEST, DO_NOT_RETRY, ERROR_PRINT_ALL); } nvme_qpair_enable(qpair); @@ -1053,7 +1056,7 @@ nvme_io_qpair_enable(struct nvme_qpair *qpair) TAILQ_FOREACH_SAFE(tr, &qpair->outstanding_tr, tailq, tr_temp) { nvme_printf(qpair->ctrlr, "aborting outstanding i/o\n"); nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, - NVME_SC_ABORTED_BY_REQUEST, 0, TRUE); + NVME_SC_ABORTED_BY_REQUEST, 0, ERROR_PRINT_NO_RETRY); } mtx_lock(&qpair->lock); @@ -1118,7 +1121,7 @@ nvme_qpair_fail(struct nvme_qpair *qpair) nvme_printf(qpair->ctrlr, "failing queued i/o\n"); mtx_unlock(&qpair->lock); nvme_qpair_manual_complete_request(qpair, req, NVME_SCT_GENERIC, - NVME_SC_ABORTED_BY_REQUEST, TRUE); + NVME_SC_ABORTED_BY_REQUEST); mtx_lock(&qpair->lock); } @@ -1132,7 +1135,7 @@ nvme_qpair_fail(struct nvme_qpair *qpair) nvme_printf(qpair->ctrlr, "failing outstanding i/o\n"); mtx_unlock(&qpair->lock); nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, - NVME_SC_ABORTED_BY_REQUEST, 1 /* do not retry */, TRUE); + NVME_SC_ABORTED_BY_REQUEST, DO_NOT_RETRY, ERROR_PRINT_ALL); mtx_lock(&qpair->lock); } From owner-svn-src-stable-11@freebsd.org Mon Nov 25 16:46:43 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F29411B1F20; Mon, 25 Nov 2019 16:46:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MCc25vfNz4cfk; Mon, 25 Nov 2019 16:46:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADD9FF9E5; Mon, 25 Nov 2019 16:46:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAPGkgW4075631; Mon, 25 Nov 2019 16:46:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAPGkgRZ075628; Mon, 25 Nov 2019 16:46:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911251646.xAPGkgRZ075628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 25 Nov 2019 16:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355094 - in stable/11/sys: dev/hwpmc x86/include x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: dev/hwpmc x86/include x86/x86 X-SVN-Commit-Revision: 355094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2019 16:46:43 -0000 Author: kib Date: Mon Nov 25 16:46:41 2019 New Revision: 355094 URL: https://svnweb.freebsd.org/changeset/base/355094 Log: MFC r354828: Add x86 msr tweak KPI. Modified: stable/11/sys/dev/hwpmc/hwpmc_core.c stable/11/sys/x86/include/x86_var.h stable/11/sys/x86/x86/cpu_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_core.c Mon Nov 25 16:30:38 2019 (r355093) +++ stable/11/sys/dev/hwpmc/hwpmc_core.c Mon Nov 25 16:46:41 2019 (r355094) @@ -218,15 +218,6 @@ iaf_reload_count_to_perfctr_value(pmc_value_t rlc) return (1ULL << core_iaf_width) - rlc; } -static void -tweak_tsx_force_abort(void *arg) -{ - u_int val; - - val = (uintptr_t)arg; - wrmsr(MSR_TSX_FORCE_ABORT, val); -} - static int iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) @@ -263,7 +254,8 @@ iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, if ((cpu_stdext_feature3 & CPUID_STDEXT3_TSXFA) != 0 && !pmc_tsx_force_abort_set) { pmc_tsx_force_abort_set = true; - smp_rendezvous(NULL, tweak_tsx_force_abort, NULL, (void *)1); + x86_msr_op(MSR_TSX_FORCE_ABORT, MSR_OP_RENDEZVOUS | + MSR_OP_WRITE, 1); } flags = a->pm_md.pm_iaf.pm_iaf_flags; @@ -405,7 +397,8 @@ iaf_release_pmc(int cpu, int ri, struct pmc *pmc) MPASS(pmc_alloc_refs > 0); if (pmc_alloc_refs-- == 1 && pmc_tsx_force_abort_set) { pmc_tsx_force_abort_set = false; - smp_rendezvous(NULL, tweak_tsx_force_abort, NULL, (void *)0); + x86_msr_op(MSR_TSX_FORCE_ABORT, MSR_OP_RENDEZVOUS | + MSR_OP_WRITE, 0); } return (0); Modified: stable/11/sys/x86/include/x86_var.h ============================================================================== --- stable/11/sys/x86/include/x86_var.h Mon Nov 25 16:30:38 2019 (r355093) +++ stable/11/sys/x86/include/x86_var.h Mon Nov 25 16:46:41 2019 (r355094) @@ -149,4 +149,12 @@ int user_dbreg_trap(register_t dr6); int minidumpsys(struct dumperinfo *); struct pcb *get_pcb_td(struct thread *td); +#define MSR_OP_ANDNOT 0x00000001 +#define MSR_OP_OR 0x00000002 +#define MSR_OP_WRITE 0x00000003 +#define MSR_OP_LOCAL 0x10000000 +#define MSR_OP_SCHED 0x20000000 +#define MSR_OP_RENDEZVOUS 0x30000000 +void x86_msr_op(u_int msr, u_int op, uint64_t arg1); + #endif Modified: stable/11/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/11/sys/x86/x86/cpu_machdep.c Mon Nov 25 16:30:38 2019 (r355093) +++ stable/11/sys/x86/x86/cpu_machdep.c Mon Nov 25 16:46:41 2019 (r355094) @@ -115,7 +115,80 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif +struct msr_op_arg { + u_int msr; + int op; + uint64_t arg1; +}; +static void +x86_msr_op_one(void *argp) +{ + struct msr_op_arg *a; + uint64_t v; + + a = argp; + switch (a->op) { + case MSR_OP_ANDNOT: + v = rdmsr(a->msr); + v &= ~a->arg1; + wrmsr(a->msr, v); + break; + case MSR_OP_OR: + v = rdmsr(a->msr); + v |= a->arg1; + wrmsr(a->msr, v); + break; + case MSR_OP_WRITE: + wrmsr(a->msr, a->arg1); + break; + } +} + +#define MSR_OP_EXMODE_MASK 0xf0000000 +#define MSR_OP_OP_MASK 0x000000ff + +void +x86_msr_op(u_int msr, u_int op, uint64_t arg1) +{ + struct thread *td; + struct msr_op_arg a; + u_int exmode; + int bound_cpu, i, is_bound; + + a.op = op & MSR_OP_OP_MASK; + MPASS(a.op == MSR_OP_ANDNOT || a.op == MSR_OP_OR || + a.op == MSR_OP_WRITE); + exmode = op & MSR_OP_EXMODE_MASK; + MPASS(exmode == MSR_OP_LOCAL || exmode == MSR_OP_SCHED || + exmode == MSR_OP_RENDEZVOUS); + a.msr = msr; + a.arg1 = arg1; + switch (exmode) { + case MSR_OP_LOCAL: + x86_msr_op_one(&a); + break; + case MSR_OP_SCHED: + td = curthread; + thread_lock(td); + is_bound = sched_is_bound(td); + bound_cpu = td->td_oncpu; + CPU_FOREACH(i) { + sched_bind(td, i); + x86_msr_op_one(&a); + } + if (is_bound) + sched_bind(td, bound_cpu); + else + sched_unbind(td); + thread_unlock(td); + break; + case MSR_OP_RENDEZVOUS: + smp_rendezvous(NULL, x86_msr_op_one, NULL, &a); + break; + } +} + /* * Machine dependent boot() routine * @@ -821,18 +894,10 @@ SYSCTL_INT(_hw, OID_AUTO, ibrs_active, CTLFLAG_RD, &hw void hw_ibrs_recalculate(void) { - uint64_t v; - if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_IBRS_ALL) != 0) { - if (hw_ibrs_disable) { - v = rdmsr(MSR_IA32_SPEC_CTRL); - v &= ~(uint64_t)IA32_SPEC_CTRL_IBRS; - wrmsr(MSR_IA32_SPEC_CTRL, v); - } else { - v = rdmsr(MSR_IA32_SPEC_CTRL); - v |= IA32_SPEC_CTRL_IBRS; - wrmsr(MSR_IA32_SPEC_CTRL, v); - } + x86_msr_op(MSR_IA32_SPEC_CTRL, MSR_OP_LOCAL | + (hw_ibrs_disable ? MSR_OP_ANDNOT : MSR_OP_OR), + IA32_SPEC_CTRL_IBRS); return; } hw_ibrs_active = (cpu_stdext_feature3 & CPUID_STDEXT3_IBPB) != 0 && @@ -864,46 +929,17 @@ SYSCTL_INT(_hw, OID_AUTO, spec_store_bypass_disable_ac "Speculative Store Bypass Disable active"); static void -hw_ssb_set_one(bool enable) -{ - uint64_t v; - - v = rdmsr(MSR_IA32_SPEC_CTRL); - if (enable) - v |= (uint64_t)IA32_SPEC_CTRL_SSBD; - else - v &= ~(uint64_t)IA32_SPEC_CTRL_SSBD; - wrmsr(MSR_IA32_SPEC_CTRL, v); -} - -static void hw_ssb_set(bool enable, bool for_all_cpus) { - struct thread *td; - int bound_cpu, i, is_bound; if ((cpu_stdext_feature3 & CPUID_STDEXT3_SSBD) == 0) { hw_ssb_active = 0; return; } hw_ssb_active = enable; - if (for_all_cpus) { - td = curthread; - thread_lock(td); - is_bound = sched_is_bound(td); - bound_cpu = td->td_oncpu; - CPU_FOREACH(i) { - sched_bind(td, i); - hw_ssb_set_one(enable); - } - if (is_bound) - sched_bind(td, bound_cpu); - else - sched_unbind(td); - thread_unlock(td); - } else { - hw_ssb_set_one(enable); - } + x86_msr_op(MSR_IA32_SPEC_CTRL, + (enable ? MSR_OP_OR : MSR_OP_ANDNOT) | + (for_all_cpus ? MSR_OP_SCHED : MSR_OP_LOCAL), IA32_SPEC_CTRL_SSBD); } void @@ -1164,43 +1200,13 @@ enum { }; static void -taa_set_one(bool enable) -{ - uint64_t v; - - v = rdmsr(MSR_IA32_TSX_CTRL); - if (enable) - v |= (uint64_t)(IA32_TSX_CTRL_RTM_DISABLE | - IA32_TSX_CTRL_TSX_CPUID_CLEAR); - else - v &= ~(uint64_t)(IA32_TSX_CTRL_RTM_DISABLE | - IA32_TSX_CTRL_TSX_CPUID_CLEAR); - - wrmsr(MSR_IA32_TSX_CTRL, v); -} - -static void taa_set(bool enable, bool all) { - struct thread *td; - int bound_cpu, i, is_bound; - if (all) { - td = curthread; - thread_lock(td); - is_bound = sched_is_bound(td); - bound_cpu = td->td_oncpu; - CPU_FOREACH(i) { - sched_bind(td, i); - taa_set_one(enable); - } - if (is_bound) - sched_bind(td, bound_cpu); - else - sched_unbind(td); - thread_unlock(td); - } else - taa_set_one(enable); + x86_msr_op(MSR_IA32_TSX_CTRL, + (enable ? MSR_OP_OR : MSR_OP_ANDNOT) | + (all ? MSR_OP_RENDEZVOUS : MSR_OP_LOCAL), + IA32_TSX_CTRL_RTM_DISABLE | IA32_TSX_CTRL_TSX_CPUID_CLEAR); } void From owner-svn-src-stable-11@freebsd.org Tue Nov 26 15:24:07 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 633AC1B9C6F; Tue, 26 Nov 2019 15:24:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47MnkH1ylVz3xL0; Tue, 26 Nov 2019 15:24:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27BFD2702A; Tue, 26 Nov 2019 15:24:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAQFO7aK078363; Tue, 26 Nov 2019 15:24:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAQFO6Pd078361; Tue, 26 Nov 2019 15:24:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911261524.xAQFO6Pd078361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Nov 2019 15:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355112 - stable/11/sys/dev/ioat X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ioat X-SVN-Commit-Revision: 355112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Nov 2019 15:24:07 -0000 Author: mav Date: Tue Nov 26 15:24:06 2019 New Revision: 355112 URL: https://svnweb.freebsd.org/changeset/base/355112 Log: MFC r354841: Add ioat_get_domain() to ioat(4) KPI. This allows NUMA-aware consumers to reduce inter-domain traffic. Modified: stable/11/sys/dev/ioat/ioat.c stable/11/sys/dev/ioat/ioat.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ioat/ioat.c ============================================================================== --- stable/11/sys/dev/ioat/ioat.c Tue Nov 26 15:23:24 2019 (r355111) +++ stable/11/sys/dev/ioat/ioat.c Tue Nov 26 15:24:06 2019 (r355112) @@ -913,6 +913,15 @@ ioat_get_capabilities(bus_dmaengine_t dmaengine) } int +ioat_get_domain(bus_dmaengine_t dmaengine, int *domain) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + return (bus_get_domain(ioat->device, domain)); +} + +int ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay) { struct ioat_softc *ioat; Modified: stable/11/sys/dev/ioat/ioat.h ============================================================================== --- stable/11/sys/dev/ioat/ioat.h Tue Nov 26 15:23:24 2019 (r355111) +++ stable/11/sys/dev/ioat/ioat.h Tue Nov 26 15:24:06 2019 (r355112) @@ -131,6 +131,7 @@ void ioat_put_dmaengine(bus_dmaengine_t dmaengine); int ioat_get_hwversion(bus_dmaengine_t dmaengine); size_t ioat_get_max_io_size(bus_dmaengine_t dmaengine); uint32_t ioat_get_capabilities(bus_dmaengine_t dmaengine); +int ioat_get_domain(bus_dmaengine_t dmaengine, int *domain); /* * Set interrupt coalescing on a DMA channel. From owner-svn-src-stable-11@freebsd.org Wed Nov 27 13:46:29 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E98581AC96C; Wed, 27 Nov 2019 13:46:29 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47NMW94dltz45mh; Wed, 27 Nov 2019 13:46:29 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65565E476; Wed, 27 Nov 2019 13:46:29 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xARDkThh070484; Wed, 27 Nov 2019 13:46:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xARDkSqs070481; Wed, 27 Nov 2019 13:46:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911271346.xARDkSqs070481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Nov 2019 13:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355131 - in stable/11: . sbin/ipf targets/pseudo/userland X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/11: . sbin/ipf targets/pseudo/userland X-SVN-Commit-Revision: 355131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Nov 2019 13:46:30 -0000 Author: cy Date: Wed Nov 27 13:46:28 2019 New Revision: 355131 URL: https://svnweb.freebsd.org/changeset/base/355131 Log: MFC r315223, r325182: Disconnect ipftest and ipresend from the build until it can be verified that they still work. These utilities have become out of sync with the code in the kernel and need work to bring them back into shape. Most people test on real systems or VMs on real networks. Suggested by: glebius Modified: stable/11/ObsoleteFiles.inc stable/11/sbin/ipf/Makefile stable/11/targets/pseudo/userland/Makefile.depend Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Wed Nov 27 10:26:37 2019 (r355130) +++ stable/11/ObsoleteFiles.inc Wed Nov 27 13:46:28 2019 (r355131) @@ -1136,6 +1136,9 @@ OLD_FILES+=usr/tests/usr.sbin/pw/pw_useradd OLD_FILES+=usr/tests/usr.sbin/pw/pw_userdel OLD_FILES+=usr/tests/usr.sbin/pw/pw_usermod OLD_FILES+=usr/tests/usr.sbin/pw/pw_usernext +# 20170313: sbin/ipftest and ipresend temporarily disconnected. +OLD_FILES+=sbin/ipftest +OLD_FILES+=sbin/ipresend # 20170308: rename some tests OLD_FILES+=usr/tests/bin/pwait/pwait OLD_FILES+=usr/tests/usr.bin/timeout/timeout Modified: stable/11/sbin/ipf/Makefile ============================================================================== --- stable/11/sbin/ipf/Makefile Wed Nov 27 10:26:37 2019 (r355130) +++ stable/11/sbin/ipf/Makefile Wed Nov 27 13:46:28 2019 (r355131) @@ -1,7 +1,9 @@ # $FreeBSD$ SUBDIR= libipf .WAIT -SUBDIR+= ipf ipfs ipfstat ipftest ipmon ipnat ippool ipresend +SUBDIR+= ipf ipfs ipfstat ipmon ipnat ippool +# XXX Temporarily disconnected. +# SUBDIR+= ipftest ipresend SUBDIR_PARALLEL= .include Modified: stable/11/targets/pseudo/userland/Makefile.depend ============================================================================== --- stable/11/targets/pseudo/userland/Makefile.depend Wed Nov 27 10:26:37 2019 (r355130) +++ stable/11/targets/pseudo/userland/Makefile.depend Wed Nov 27 13:46:28 2019 (r355131) @@ -104,11 +104,9 @@ DIRDEPS+= \ sbin/ipf/ipf \ sbin/ipf/ipfs \ sbin/ipf/ipfstat \ - sbin/ipf/ipftest \ sbin/ipf/ipmon \ sbin/ipf/ipnat \ sbin/ipf/ippool \ - sbin/ipf/ipresend \ sbin/ipf/libipf \ sbin/ipfw \ sbin/iscontrol \ From owner-svn-src-stable-11@freebsd.org Thu Nov 28 00:41:43 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F24E1BCFDE; Thu, 28 Nov 2019 00:41:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nf3C3L4Mz3Jny; Thu, 28 Nov 2019 00:41:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 571831DB8E; Thu, 28 Nov 2019 00:41:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS0fhiS060730; Thu, 28 Nov 2019 00:41:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS0fgZk060603; Thu, 28 Nov 2019 00:41:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911280041.xAS0fgZk060603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Nov 2019 00:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355152 - in stable/11/sys/dev/ntb: . ntb_hw X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/dev/ntb: . ntb_hw X-SVN-Commit-Revision: 355152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2019 00:41:43 -0000 Author: mav Date: Thu Nov 28 00:41:42 2019 New Revision: 355152 URL: https://svnweb.freebsd.org/changeset/base/355152 Log: MFC r354702: Make ntb(4) send bus_get_dma_tag() requests to parent buses passing real bus' child pointers instead of grandchilds. DMAR does not like requests from devices not parented directly by PCI. Modified: stable/11/sys/dev/ntb/ntb.c stable/11/sys/dev/ntb/ntb.h stable/11/sys/dev/ntb/ntb_hw/ntb_hw_intel.c stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb.c ============================================================================== --- stable/11/sys/dev/ntb/ntb.c Thu Nov 28 00:40:42 2019 (r355151) +++ stable/11/sys/dev/ntb/ntb.c Thu Nov 28 00:41:42 2019 (r355152) @@ -205,6 +205,13 @@ ntb_print_child(device_t dev, device_t child) return (retval); } +bus_dma_tag_t +ntb_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + void ntb_link_event(device_t dev) { Modified: stable/11/sys/dev/ntb/ntb.h ============================================================================== --- stable/11/sys/dev/ntb/ntb.h Thu Nov 28 00:40:42 2019 (r355151) +++ stable/11/sys/dev/ntb/ntb.h Thu Nov 28 00:41:42 2019 (r355152) @@ -39,6 +39,7 @@ int ntb_unregister_device(device_t ntb); int ntb_child_location_str(device_t dev, device_t child, char *buf, size_t buflen); int ntb_print_child(device_t dev, device_t child); +bus_dma_tag_t ntb_get_dma_tag(device_t bus, device_t child); /* * ntb_link_event() - notify driver context of a change in link status Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Thu Nov 28 00:40:42 2019 (r355151) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Thu Nov 28 00:41:42 2019 (r355152) @@ -3088,6 +3088,7 @@ static device_method_t ntb_intel_methods[] = { /* Bus interface */ DEVMETHOD(bus_child_location_str, ntb_child_location_str), DEVMETHOD(bus_print_child, ntb_print_child), + DEVMETHOD(bus_get_dma_tag, ntb_get_dma_tag), /* NTB interface */ DEVMETHOD(ntb_link_is_up, intel_ntb_link_is_up), DEVMETHOD(ntb_link_enable, intel_ntb_link_enable), Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Nov 28 00:40:42 2019 (r355151) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Thu Nov 28 00:41:42 2019 (r355152) @@ -1009,6 +1009,7 @@ static device_method_t ntb_plx_methods[] = { /* Bus interface */ DEVMETHOD(bus_child_location_str, ntb_child_location_str), DEVMETHOD(bus_print_child, ntb_print_child), + DEVMETHOD(bus_get_dma_tag, ntb_get_dma_tag), /* NTB interface */ DEVMETHOD(ntb_link_is_up, ntb_plx_link_is_up), DEVMETHOD(ntb_link_enable, ntb_plx_link_enable), From owner-svn-src-stable-11@freebsd.org Thu Nov 28 00:42:55 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0E071BD233; Thu, 28 Nov 2019 00:42:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nf4b69ZLz3KC8; Thu, 28 Nov 2019 00:42:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B888F1DCD4; Thu, 28 Nov 2019 00:42:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS0gthq063261; Thu, 28 Nov 2019 00:42:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS0gtLI063260; Thu, 28 Nov 2019 00:42:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911280042.xAS0gtLI063260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Nov 2019 00:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355154 - stable/11/sys/dev/ioat X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ioat X-SVN-Commit-Revision: 355154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2019 00:42:56 -0000 Author: mav Date: Thu Nov 28 00:42:55 2019 New Revision: 355154 URL: https://svnweb.freebsd.org/changeset/base/355154 Log: MFC r354703: Pass more reasonable WAIT flags to bus_dma(9) calls. Modified: stable/11/sys/dev/ioat/ioat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ioat/ioat.c ============================================================================== --- stable/11/sys/dev/ioat/ioat.c Thu Nov 28 00:42:45 2019 (r355153) +++ stable/11/sys/dev/ioat/ioat.c Thu Nov 28 00:42:55 2019 (r355154) @@ -487,13 +487,14 @@ ioat3_attach(device_t device) &ioat->comp_update_tag); error = bus_dmamem_alloc(ioat->comp_update_tag, - (void **)&ioat->comp_update, BUS_DMA_ZERO, &ioat->comp_update_map); + (void **)&ioat->comp_update, BUS_DMA_ZERO | BUS_DMA_WAITOK, + &ioat->comp_update_map); if (ioat->comp_update == NULL) return (ENOMEM); error = bus_dmamap_load(ioat->comp_update_tag, ioat->comp_update_map, ioat->comp_update, sizeof(uint64_t), ioat_comp_update_map, ioat, - 0); + BUS_DMA_NOWAIT); if (error != 0) return (error); @@ -514,7 +515,7 @@ ioat3_attach(device_t device) return (error); error = bus_dmamap_load(ioat->hw_desc_tag, ioat->hw_desc_map, hw_desc, - ringsz, ioat_dmamap_cb, &ioat->hw_desc_bus_addr, BUS_DMA_WAITOK); + ringsz, ioat_dmamap_cb, &ioat->hw_desc_bus_addr, BUS_DMA_NOWAIT); if (error) return (error); From owner-svn-src-stable-11@freebsd.org Thu Nov 28 02:15:46 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 427591C05D9; Thu, 28 Nov 2019 02:15:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Nh7k115Pz3PvP; Thu, 28 Nov 2019 02:15:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0606B1EDAC; Thu, 28 Nov 2019 02:15:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAS2FjSQ017706; Thu, 28 Nov 2019 02:15:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAS2FjQN017705; Thu, 28 Nov 2019 02:15:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911280215.xAS2FjQN017705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 28 Nov 2019 02:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355159 - stable/11/sys/dev/cfi X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/cfi X-SVN-Commit-Revision: 355159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2019 02:15:46 -0000 Author: emaste Date: Thu Nov 28 02:15:45 2019 New Revision: 355159 URL: https://svnweb.freebsd.org/changeset/base/355159 Log: MFC r355101, r355104: cfi: check for inter overflow in cfi_devioctl Reported by: Pietro Oliva Security: Possible OOB read in root-only ioctl Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/cfi/cfi_dev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cfi/cfi_dev.c ============================================================================== --- stable/11/sys/dev/cfi/cfi_dev.c Thu Nov 28 02:12:33 2019 (r355158) +++ stable/11/sys/dev/cfi/cfi_dev.c Thu Nov 28 02:15:45 2019 (r355159) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -278,7 +279,8 @@ cfi_devioctl(struct cdev *dev, u_long cmd, caddr_t dat rq = (struct cfiocqry *)data; if (rq->offset >= sc->sc_size / sc->sc_width) return (ESPIPE); - if (rq->offset + rq->count > sc->sc_size / sc->sc_width) + if (rq->offset > ULONG_MAX - rq->count || + rq->offset + rq->count > sc->sc_size / sc->sc_width) return (ENOSPC); while (!error && rq->count--) { From owner-svn-src-stable-11@freebsd.org Thu Nov 28 20:09:21 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29DA11B5AB5; Thu, 28 Nov 2019 20:09:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47P7yT0PBrz41cW; Thu, 28 Nov 2019 20:09:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E50EA2E55; Thu, 28 Nov 2019 20:09:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xASK9Kww051836; Thu, 28 Nov 2019 20:09:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xASK9KED051835; Thu, 28 Nov 2019 20:09:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201911282009.xASK9KED051835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 28 Nov 2019 20:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355189 - in stable: 11/lib/clang/libclang 11/lib/clang/libllvm 12/lib/clang/libclang 12/lib/clang/libllvm X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/lib/clang/libclang 11/lib/clang/libllvm 12/lib/clang/libclang 12/lib/clang/libllvm X-SVN-Commit-Revision: 355189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2019 20:09:21 -0000 Author: dim Date: Thu Nov 28 20:09:19 2019 New Revision: 355189 URL: https://svnweb.freebsd.org/changeset/base/355189 Log: MFC r354908: Add explanatory comments for the different SRCS_xxx variables used in the Makefiles for libllvm and libclang. While here, cleanup a commented out SRCS entry in libllvmminimal's Makefile. Modified: stable/11/lib/clang/libclang/Makefile stable/11/lib/clang/libllvm/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/clang/libclang/Makefile stable/12/lib/clang/libllvm/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/clang/libclang/Makefile ============================================================================== --- stable/11/lib/clang/libclang/Makefile Thu Nov 28 19:38:57 2019 (r355188) +++ stable/11/lib/clang/libclang/Makefile Thu Nov 28 20:09:19 2019 (r355189) @@ -20,6 +20,12 @@ CXXFLAGS.Module.cpp+= -fpermissive SRCDIR= tools/clang/lib +# Explanation of different SRCS variants below: +# SRCS_MIN: always required, even for bootstrap +# SRCS_EXT: required for MK_CLANG_EXTRAS +# SRCS_FUL: required for MK_CLANG_FULL +# SRCS_LDB: required for MK_LLDB + SRCS_FUL+= ARCMigrate/ARCMT.cpp SRCS_FUL+= ARCMigrate/ARCMTActions.cpp SRCS_FUL+= ARCMigrate/FileRemapper.cpp Modified: stable/11/lib/clang/libllvm/Makefile ============================================================================== --- stable/11/lib/clang/libllvm/Makefile Thu Nov 28 19:38:57 2019 (r355188) +++ stable/11/lib/clang/libllvm/Makefile Thu Nov 28 20:09:19 2019 (r355189) @@ -26,6 +26,17 @@ CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} SRCDIR= lib +# Explanation of different SRCS variants below: +# SRCS_MIN: always required, even for bootstrap +# SRCS_MIW: required for world stage (after cross-tools) +# SRCS_EXT: required for MK_CLANG_EXTRAS +# SRCS_EXL: required for MK_CLANG_EXTRAS and MK_LLD +# SRCS_FUL: required for MK_CLANG_FULL +# SRCS_LLD: required for MK_LLD +# SRCS_XDB: required for MK_CLANG_EXTRAS and MK_LLDB +# SRCS_XDL: required for MK_CLANG_EXTRAS, MK_LLD and MK_LLDB +# SRCS_XDW: required for MK_CLANG_EXTRAS and MK_LLDB in world stage + SRCS_MIN+= Analysis/AliasAnalysis.cpp SRCS_MIN+= Analysis/AliasAnalysisEvaluator.cpp SRCS_MIN+= Analysis/AliasAnalysisSummary.cpp From owner-svn-src-stable-11@freebsd.org Fri Nov 29 00:26:06 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97B061BD38A; Fri, 29 Nov 2019 00:26:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PFfk3K2Mz4GsK; Fri, 29 Nov 2019 00:26:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55BF75FCD; Fri, 29 Nov 2019 00:26:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT0Q6wO005167; Fri, 29 Nov 2019 00:26:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT0Q68h005166; Fri, 29 Nov 2019 00:26:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911290026.xAT0Q68h005166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 29 Nov 2019 00:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355196 - stable/11/sys/dev/ioat X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ioat X-SVN-Commit-Revision: 355196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2019 00:26:06 -0000 Author: mav Date: Fri Nov 29 00:26:05 2019 New Revision: 355196 URL: https://svnweb.freebsd.org/changeset/base/355196 Log: MFC r354753: Initialize *comp_update with valid value. I've noticed that sometimes with enabled DMAR initial write from device to this address is somehow getting delayed, triggering assertion due to zero default being invalid. Modified: stable/11/sys/dev/ioat/ioat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ioat/ioat.c ============================================================================== --- stable/11/sys/dev/ioat/ioat.c Fri Nov 29 00:25:39 2019 (r355195) +++ stable/11/sys/dev/ioat/ioat.c Fri Nov 29 00:26:05 2019 (r355196) @@ -535,10 +535,9 @@ ioat3_attach(device_t device) dma_hw_desc->next = RING_PHYS_ADDR(ioat, i + 1); } - ioat->head = 0; - ioat->tail = 0; - ioat->last_seen = 0; - *ioat->comp_update = 0; + ioat->tail = ioat->head = 0; + *ioat->comp_update = ioat->last_seen = + RING_PHYS_ADDR(ioat, ioat->tail - 1); return (0); } @@ -1581,8 +1580,8 @@ ioat_reset_hw(struct ioat_softc *ioat) * at zero as well. */ ioat->tail = ioat->head = 0; - ioat->last_seen = 0; - *ioat->comp_update = 0; + *ioat->comp_update = ioat->last_seen = + RING_PHYS_ADDR(ioat, ioat->tail - 1); ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); ioat_write_chancmp(ioat, ioat->comp_update_bus_addr); From owner-svn-src-stable-11@freebsd.org Fri Nov 29 00:38:36 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E9911BD7A4; Fri, 29 Nov 2019 00:38:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PFx80wV3z4HN2; Fri, 29 Nov 2019 00:38:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03F956186; Fri, 29 Nov 2019 00:38:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT0cZaO011208; Fri, 29 Nov 2019 00:38:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT0cZ9p011205; Fri, 29 Nov 2019 00:38:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911290038.xAT0cZ9p011205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 29 Nov 2019 00:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355198 - in stable/11: sys/dev/ioat tools/tools/ioat X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11: sys/dev/ioat tools/tools/ioat X-SVN-Commit-Revision: 355198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2019 00:38:36 -0000 Author: mav Date: Fri Nov 29 00:38:34 2019 New Revision: 355198 URL: https://svnweb.freebsd.org/changeset/base/355198 Log: MFC r345812 (by tychon): ioatcontrol(8) could exercise 8k-aligned copy with page-break, crc and crc-copy modes. Modified: stable/11/sys/dev/ioat/ioat_test.c stable/11/sys/dev/ioat/ioat_test.h stable/11/tools/tools/ioat/ioatcontrol.8 stable/11/tools/tools/ioat/ioatcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ioat/ioat_test.c ============================================================================== --- stable/11/sys/dev/ioat/ioat_test.c Fri Nov 29 00:38:16 2019 (r355197) +++ stable/11/sys/dev/ioat/ioat_test.c Fri Nov 29 00:38:34 2019 (r355198) @@ -65,6 +65,7 @@ struct test_transaction { void *buf[IOAT_MAX_BUFS]; uint32_t length; uint32_t depth; + uint32_t crc[IOAT_MAX_BUFS]; struct ioat_test *test; TAILQ_ENTRY(test_transaction) entry; }; @@ -312,6 +313,28 @@ ioat_test_submit_1_tx(struct ioat_test *test, bus_dmae desc = ioat_copy_8k_aligned(dma, dest, dst2, src, src2, cb, tx, flags); + } else if (test->testkind == IOAT_TEST_DMA_8K_PB) { + bus_addr_t src2, dst2; + + src2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE); + dst2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE); + + desc = ioat_copy_8k_aligned(dma, dest, dst2, src, src2, + cb, tx, flags); + } else if (test->testkind == IOAT_TEST_DMA_CRC) { + bus_addr_t crc; + + tx->crc[i] = 0; + crc = vtophys((vm_offset_t)&tx->crc[i]); + desc = ioat_crc(dma, src, tx->length, + NULL, crc, cb, tx, flags | DMA_CRC_STORE); + } else if (test->testkind == IOAT_TEST_DMA_CRC_COPY) { + bus_addr_t crc; + + tx->crc[i] = 0; + crc = vtophys((vm_offset_t)&tx->crc[i]); + desc = ioat_copy_crc(dma, dest, src, tx->length, + NULL, crc, cb, tx, flags | DMA_CRC_STORE); } if (desc == NULL) break; @@ -346,7 +369,8 @@ ioat_dma_test(void *arg) test = arg; memset(__DEVOLATILE(void *, test->status), 0, sizeof(test->status)); - if (test->testkind == IOAT_TEST_DMA_8K && + if ((test->testkind == IOAT_TEST_DMA_8K || + test->testkind == IOAT_TEST_DMA_8K_PB) && test->buffer_size != 2 * PAGE_SIZE) { ioat_test_log(0, "Asked for 8k test and buffer size isn't 8k\n"); test->status[IOAT_TEST_INVALID_INPUT]++; Modified: stable/11/sys/dev/ioat/ioat_test.h ============================================================================== --- stable/11/sys/dev/ioat/ioat_test.h Fri Nov 29 00:38:16 2019 (r355197) +++ stable/11/sys/dev/ioat/ioat_test.h Fri Nov 29 00:38:34 2019 (r355198) @@ -44,6 +44,9 @@ enum ioat_test_kind { IOAT_TEST_RAW_DMA, IOAT_TEST_DMA_8K, IOAT_TEST_MEMCPY, + IOAT_TEST_DMA_8K_PB, + IOAT_TEST_DMA_CRC, + IOAT_TEST_DMA_CRC_COPY, IOAT_NUM_TESTKINDS }; Modified: stable/11/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- stable/11/tools/tools/ioat/ioatcontrol.8 Fri Nov 29 00:38:16 2019 (r355197) +++ stable/11/tools/tools/ioat/ioatcontrol.8 Fri Nov 29 00:38:34 2019 (r355198) @@ -35,9 +35,12 @@ .Nm .Op Fl c Ar period .Op Fl E +.Op Fl e .Op Fl f .Op Fl m .Op Fl V +.Op Fl x +.Op Fl X .Op Fl z .Ar channel_number .Ar num_txns @@ -65,6 +68,8 @@ The arguments are as follows: Configure the channel's interrupt coalescing period, in microseconds (defaults to 0). .It Fl E +Test contiguous 8k copy. +.It Fl e Test non-contiguous 8k copy. .It Fl f Test block fill (by default, @@ -74,6 +79,10 @@ tests copy) Test memcpy instead of DMA. .It Fl V Verify copies/fills for accuracy +.It Fl x +Test DMA CRC. +.It Fl X +Test DMA copy with CRC. .It Fl z Zero device statistics before running test. .El Modified: stable/11/tools/tools/ioat/ioatcontrol.c ============================================================================== --- stable/11/tools/tools/ioat/ioatcontrol.c Fri Nov 29 00:38:16 2019 (r355197) +++ stable/11/tools/tools/ioat/ioatcontrol.c Fri Nov 29 00:38:34 2019 (r355198) @@ -54,13 +54,16 @@ usage(void) printf(" %s -r [-c period] [-vVwz] channel-number address []\n\n", getprogname()); printf(" -c period - Enable interrupt coalescing (us) (default: 0)\n"); - printf(" -E - Test non-contiguous 8k copy.\n"); - printf(" -f - Test block fill (default: DMA copy).\n"); + printf(" -E - Test contiguous 8k copy.\n"); + printf(" -e - Test non-contiguous 8k copy.\n"); + printf(" -f - Test block fill.\n"); printf(" -m - Test memcpy instead of DMA.\n"); printf(" -r - Issue DMA to or from a specific address.\n"); printf(" -V - Enable verification\n"); printf(" -v -
is a kernel virtual address\n"); printf(" -w - Write to the specified address\n"); + printf(" -x - Test DMA CRC.\n"); + printf(" -X - Test DMA CRC copy.\n"); printf(" -z - Zero device stats before test\n"); exit(EX_USAGE); } @@ -107,15 +110,15 @@ main(int argc, char **argv) { struct ioat_test t; int fd, ch; - bool fflag, rflag, Eflag, mflag; + bool fflag, rflag, Eflag, eflag, mflag, xflag, Xflag; unsigned modeflags; memset(&t, 0, sizeof(t)); - fflag = rflag = Eflag = mflag = false; + fflag = rflag = Eflag = eflag = mflag = xflag = Xflag = false; modeflags = 0; - while ((ch = getopt(argc, argv, "c:EfmrvVwz")) != -1) { + while ((ch = getopt(argc, argv, "c:EefmrvVwxXz")) != -1) { switch (ch) { case 'c': t.coalesce_period = atoi(optarg); @@ -124,6 +127,10 @@ main(int argc, char **argv) Eflag = true; modeflags++; break; + case 'e': + eflag = true; + modeflags++; + break; case 'f': fflag = true; modeflags++; @@ -145,6 +152,12 @@ main(int argc, char **argv) case 'w': t.raw_write = true; break; + case 'x': + xflag = true; + break; + case 'X': + Xflag = true; + break; case 'z': t.zero_stats = true; break; @@ -171,11 +184,15 @@ main(int argc, char **argv) if (fflag) t.testkind = IOAT_TEST_FILL; - else if (Eflag) { + else if (Eflag || eflag) { t.testkind = IOAT_TEST_DMA_8K; t.buffer_size = 8 * 1024; } else if (mflag) t.testkind = IOAT_TEST_MEMCPY; + else if (xflag) + t.testkind = IOAT_TEST_DMA_CRC; + else if (xflag) + t.testkind = IOAT_TEST_DMA_CRC_COPY; t.channel_index = atoi(argv[0]); if (t.channel_index > 8) { From owner-svn-src-stable-11@freebsd.org Sat Nov 30 05:01:12 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5E711C8853; Sat, 30 Nov 2019 05:01:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Pzjh5nLDz3DF7; Sat, 30 Nov 2019 05:01:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7FF521456; Sat, 30 Nov 2019 05:01:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAU51CwS019445; Sat, 30 Nov 2019 05:01:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAU51CKf019444; Sat, 30 Nov 2019 05:01:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201911300501.xAU51CKf019444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 30 Nov 2019 05:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355220 - stable/11/etc/ntp X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/etc/ntp X-SVN-Commit-Revision: 355220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 05:01:13 -0000 Author: delphij Date: Sat Nov 30 05:01:12 2019 New Revision: 355220 URL: https://svnweb.freebsd.org/changeset/base/355220 Log: MFC r355128: Update leap-seconds to leap-seconds.3676924800. Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800 Modified: stable/11/etc/ntp/leap-seconds Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/ntp/leap-seconds ============================================================================== --- stable/11/etc/ntp/leap-seconds Sat Nov 30 04:55:17 2019 (r355219) +++ stable/11/etc/ntp/leap-seconds Sat Nov 30 05:01:12 2019 (r355220) @@ -62,7 +62,7 @@ # Terry Quinn, "The BIPM and the Accurate Measurement # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, # July, 1991. -# reprinted in: +# reprinted in: # Christine Hackman and Donald B Sullivan (eds.) # Time and Frequency Measurement # American Association of Physics Teachers (1996) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C57 -# File expires on: 28 December 2019 +# Updated through IERS Bulletin C58 +# File expires on: 28 June 2020 # -#@ 3786480000 +#@ 3802291200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a +#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 From owner-svn-src-stable-11@freebsd.org Sat Nov 30 18:55:50 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B31251B38F4; Sat, 30 Nov 2019 18:55:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QLDk4Hzmz4LJ5; Sat, 30 Nov 2019 18:55:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77FF52A69; Sat, 30 Nov 2019 18:55:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUItomo007436; Sat, 30 Nov 2019 18:55:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUItof2007435; Sat, 30 Nov 2019 18:55:50 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911301855.xAUItof2007435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 18:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355238 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 355238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 18:55:50 -0000 Author: np Date: Sat Nov 30 18:55:50 2019 New Revision: 355238 URL: https://svnweb.freebsd.org/changeset/base/355238 Log: MFC r349242: cxgbe/t4_tom: DDP_DEAD is a ddp flag and not a toepcb flag. The driver was in effect setting TPF_ABORT_SHUTDOWN on the toepcb instead of what was intended. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_ddp.c Sat Nov 30 18:05:38 2019 (r355237) +++ stable/11/sys/dev/cxgbe/tom/t4_ddp.c Sat Nov 30 18:55:50 2019 (r355238) @@ -225,7 +225,7 @@ release_ddp_resources(struct toepcb *toep) int i; DDP_LOCK(toep); - toep->flags |= DDP_DEAD; + toep->ddp.flags |= DDP_DEAD; for (i = 0; i < nitems(toep->ddp.db); i++) { free_ddp_buffer(toep->td, &toep->ddp.db[i]); } From owner-svn-src-stable-11@freebsd.org Sat Nov 30 19:21:30 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4A311B464A; Sat, 30 Nov 2019 19:21:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QLpL4ym5z4Mkx; Sat, 30 Nov 2019 19:21:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E3D52F44; Sat, 30 Nov 2019 19:21:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUJLUEU020868; Sat, 30 Nov 2019 19:21:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUJLUBx020866; Sat, 30 Nov 2019 19:21:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911301921.xAUJLUBx020866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 19:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355240 - stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 355240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 19:21:30 -0000 Author: np Date: Sat Nov 30 19:21:29 2019 New Revision: 355240 URL: https://svnweb.freebsd.org/changeset/base/355240 Log: MFC r349499: cxgbe/iw_cxgbe: Remove unused field from the endpoint structure. Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Sat Nov 30 19:16:44 2019 (r355239) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Sat Nov 30 19:21:29 2019 (r355240) @@ -526,7 +526,6 @@ set_tcpinfo(struct c4iw_ep *ep) ep->hwtid = toep->tid; ep->snd_seq = tp->snd_nxt; ep->rcv_seq = tp->rcv_nxt; - ep->emss = max(tp->t_maxseg, 128); done: INP_WUNLOCK(inp); return (rc); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sat Nov 30 19:16:44 2019 (r355239) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sat Nov 30 19:21:29 2019 (r355240) @@ -860,7 +860,6 @@ struct c4iw_ep { u32 tx_chan; u32 mtu; u16 mss; - u16 emss; u16 plen; u16 rss_qid; u16 txq_idx; From owner-svn-src-stable-11@freebsd.org Sat Nov 30 19:33:15 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C07F21B4CCA; Sat, 30 Nov 2019 19:33:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QM3v4lDhz4Ncf; Sat, 30 Nov 2019 19:33:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85F4C3177; Sat, 30 Nov 2019 19:33:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUJXF2v030602; Sat, 30 Nov 2019 19:33:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUJXFdr030599; Sat, 30 Nov 2019 19:33:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911301933.xAUJXFdr030599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 19:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355242 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 355242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 19:33:15 -0000 Author: np Date: Sat Nov 30 19:33:14 2019 New Revision: 355242 URL: https://svnweb.freebsd.org/changeset/base/355242 Log: MFC r349500: cxgbe/t4_tom: Fix regression in t_maxseg usage within t4_tom. t_maxseg was changed in r293284 to not have any adjustment for TCP timestamps. t4_tom inadvertently went back to pre-r293284 semantics in r332506. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Nov 30 19:33:02 2019 (r355241) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Nov 30 19:33:14 2019 (r355242) @@ -337,31 +337,33 @@ send_reset(struct adapter *sc, struct toepcb *toep, ui * reported by HW to FreeBSD's native format. */ static void -assign_rxopt(struct tcpcb *tp, unsigned int opt) +assign_rxopt(struct tcpcb *tp, uint16_t opt) { struct toepcb *toep = tp->t_toe; struct inpcb *inp = tp->t_inpcb; struct adapter *sc = td_adapter(toep->td); - int n; INP_LOCK_ASSERT(inp); + toep->tcp_opt = opt; + toep->mtu_idx = G_TCPOPT_MSS(opt); + tp->t_maxseg = sc->params.mtus[toep->mtu_idx]; if (inp->inp_inc.inc_flags & INC_ISIPV6) - n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + tp->t_maxseg -= sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else - n = sizeof(struct ip) + sizeof(struct tcphdr); - tp->t_maxseg = sc->params.mtus[G_TCPOPT_MSS(opt)] - n; + tp->t_maxseg -= sizeof(struct ip) + sizeof(struct tcphdr); + toep->emss = tp->t_maxseg; if (G_TCPOPT_TSTAMP(opt)) { tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ tp->ts_recent = 0; /* hmmm */ tp->ts_recent_age = tcp_ts_getticks(); - tp->t_maxseg -= TCPOLEN_TSTAMP_APPA; + toep->emss -= TCPOLEN_TSTAMP_APPA; } - CTR5(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), mss %u", __func__, - toep->tid, G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)], - tp->t_maxseg); + CTR6(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), t_maxseg %u, emss %u", + __func__, toep->tid, toep->mtu_idx, + sc->params.mtus[G_TCPOPT_MSS(opt)], tp->t_maxseg, toep->emss); if (G_TCPOPT_SACK(opt)) tp->t_flags |= TF_SACK_PERMIT; /* should already be set */ @@ -409,7 +411,7 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->irs = irs; tcp_rcvseqinit(tp); - tp->rcv_wnd = toep->opt0_rcv_bufsize << 10; + tp->rcv_wnd = (u_int)toep->opt0_rcv_bufsize << 10; tp->rcv_adv += tp->rcv_wnd; tp->last_ack_sent = tp->rcv_nxt; @@ -431,7 +433,7 @@ make_established(struct toepcb *toep, uint32_t iss, ui ftxp.snd_nxt = tp->snd_nxt; ftxp.rcv_nxt = tp->rcv_nxt; ftxp.snd_space = bufsize; - ftxp.mss = tp->t_maxseg; + ftxp.mss = toep->emss; send_flowc_wr(toep, &ftxp); soisconnected(so); @@ -623,7 +625,7 @@ write_tx_wr(void *dst, struct toepcb *toep, unsigned i if (txalign > 0) { struct tcpcb *tp = intotcpcb(toep->inp); - if (plen < 2 * tp->t_maxseg) + if (plen < 2 * toep->emss) txwr->lsodisable_to_flags |= htobe32(F_FW_OFLD_TX_DATA_WR_LSODISABLE); else Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Nov 30 19:33:02 2019 (r355241) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Nov 30 19:33:14 2019 (r355242) @@ -532,8 +532,7 @@ remove_tid(struct adapter *sc, int tid, int ntids) * What mtu_idx to use, given a 4-tuple. Note that both s->mss and tcp_mssopt * have the MSS that we should advertise in our SYN. Advertised MSS doesn't * account for any TCP options so the effective MSS (only payload, no headers or - * options) could be different. We fill up tp->t_maxseg with the effective MSS - * at the end of the 3-way handshake. + * options) could be different. */ int find_best_mtu_idx(struct adapter *sc, struct in_conninfo *inc, Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Sat Nov 30 19:33:02 2019 (r355241) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Sat Nov 30 19:33:14 2019 (r355242) @@ -178,7 +178,10 @@ struct toepcb { u_int tx_nocompl; /* tx WR credits since last compl request */ u_int plen_nocompl; /* payload since last compl request */ - int opt0_rcv_bufsize; /* XXX: save full opt0/opt2 for later? */ + uint16_t opt0_rcv_bufsize; /* XXX: save full opt0/opt2 for later? */ + uint16_t mtu_idx; + uint16_t emss; + uint16_t tcp_opt; u_int ulp_mode; /* ULP mode */ void *ulpcb; From owner-svn-src-stable-11@freebsd.org Sat Nov 30 19:35:20 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D99D81B4DDF; Sat, 30 Nov 2019 19:35:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QM6J4L4yz4Nls; Sat, 30 Nov 2019 19:35:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78E61317D; Sat, 30 Nov 2019 19:35:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUJZKfj030742; Sat, 30 Nov 2019 19:35:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUJZKvB030741; Sat, 30 Nov 2019 19:35:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911301935.xAUJZKvB030741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 19:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355243 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 355243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 19:35:20 -0000 Author: np Date: Sat Nov 30 19:35:20 2019 New Revision: 355243 URL: https://svnweb.freebsd.org/changeset/base/355243 Log: MFC r349865: cxgbe(4): Use the simplest configuration possible when falling back from the default configuration. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sat Nov 30 19:33:14 2019 (r355242) +++ stable/11/sys/dev/cxgbe/t4_main.c Sat Nov 30 19:35:20 2019 (r355243) @@ -3959,10 +3959,8 @@ retry: rc, cfg_file); snprintf(cfg_file, sizeof(cfg_file), "%s", BUILTIN_CF); bzero(&caps_allowed, sizeof(caps_allowed)); - COPY_CAPS(nbm); - COPY_CAPS(link); COPY_CAPS(switch); - COPY_CAPS(nic); + caps_allowed.niccaps = FW_CAPS_CONFIG_NIC; fallback = false; goto retry; } From owner-svn-src-stable-11@freebsd.org Sat Nov 30 19:52:48 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8081E1B55D2; Sat, 30 Nov 2019 19:52:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QMVS2rMRz4Pg6; Sat, 30 Nov 2019 19:52:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 461F136B8; Sat, 30 Nov 2019 19:52:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUJqmvb042393; Sat, 30 Nov 2019 19:52:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUJqm8x042392; Sat, 30 Nov 2019 19:52:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911301952.xAUJqm8x042392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 19:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355244 - stable/11/sys/dev/cxgbe/common X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/common X-SVN-Commit-Revision: 355244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 19:52:48 -0000 Author: np Date: Sat Nov 30 19:52:47 2019 New Revision: 355244 URL: https://svnweb.freebsd.org/changeset/base/355244 Log: MFC r349956: cxgbe(4): Completely ignore all top level interrupts that are not enabled. The driver used to log any non-zero cause and when running with a single line interrupt it would spam the console/logs with reports of interrupts that are of no interest to anyone. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Sat Nov 30 19:35:20 2019 (r355243) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Sat Nov 30 19:52:47 2019 (r355244) @@ -4021,17 +4021,16 @@ t4_handle_intr(struct adapter *adap, const struct intr bool rc; const struct intr_action *action; - /* read and display cause. */ - cause = t4_read_reg(adap, ii->cause_reg); - if (verbose || cause != 0) - t4_show_intr_info(adap, ii, cause); /* - * The top level interrupt cause is a bit special and we need to ignore - * the bits that are not in the enable. Note that we did display them - * above in t4_show_intr_info but will not clear them. + * Read and display cause. Note that the top level PL_INT_CAUSE is a + * bit special and we need to completely ignore the bits that are not in + * PL_INT_ENABLE. */ + cause = t4_read_reg(adap, ii->cause_reg); if (ii->cause_reg == A_PL_INT_CAUSE) cause &= t4_read_reg(adap, ii->enable_reg); + if (verbose || cause != 0) + t4_show_intr_info(adap, ii, cause); fatal = cause & ii->fatal; if (fatal != 0 && ii->flags & NONFATAL_IF_DISABLED) fatal &= t4_read_reg(adap, ii->enable_reg); From owner-svn-src-stable-11@freebsd.org Sat Nov 30 19:54:46 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A711D1B5689; Sat, 30 Nov 2019 19:54:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QMXk3Pyzz4PnP; Sat, 30 Nov 2019 19:54:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5419436B9; Sat, 30 Nov 2019 19:54:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUJskdt042524; Sat, 30 Nov 2019 19:54:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUJskJN042523; Sat, 30 Nov 2019 19:54:46 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911301954.xAUJskJN042523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 19:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355245 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 355245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 19:54:46 -0000 Author: np Date: Sat Nov 30 19:54:45 2019 New Revision: 355245 URL: https://svnweb.freebsd.org/changeset/base/355245 Log: MFC r351445: whitespace nit. Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Sat Nov 30 19:52:47 2019 (r355244) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Sat Nov 30 19:54:45 2019 (r355245) @@ -1143,7 +1143,7 @@ get_l2te_for_nexthop(struct port_info *pi, struct ifne struct l2t_entry *e; struct sockaddr_in6 sin6; struct sockaddr *dst = (void *)&sin6; - + if (inc->inc_flags & INC_ISIPV6) { struct nhop6_basic nh6; From owner-svn-src-stable-11@freebsd.org Sat Nov 30 20:04:40 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D165B1B5B9D; Sat, 30 Nov 2019 20:04:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QMm85Dkxz4QLT; Sat, 30 Nov 2019 20:04:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96FFE389F; Sat, 30 Nov 2019 20:04:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUK4e1o048347; Sat, 30 Nov 2019 20:04:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUK4ecS048346; Sat, 30 Nov 2019 20:04:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911302004.xAUK4ecS048346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 20:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355246 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 355246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 20:04:40 -0000 Author: np Date: Sat Nov 30 20:04:40 2019 New Revision: 355246 URL: https://svnweb.freebsd.org/changeset/base/355246 Log: MFC r351446: cxgbe/t4_tom: Any invalid scaling factor in the hardware's wsf field implies that window scaling is not in use. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Sat Nov 30 19:54:45 2019 (r355245) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Sat Nov 30 20:04:40 2019 (r355246) @@ -992,7 +992,7 @@ t4opt_to_tcpopt(const struct tcp_options *t4opt, struc to->to_mss = be16toh(t4opt->mss); } - if (t4opt->wsf) { + if (t4opt->wsf > 0 && t4opt->wsf < 15) { to->to_flags |= TOF_SCALE; to->to_wscale = t4opt->wsf; } From owner-svn-src-stable-11@freebsd.org Sat Nov 30 20:22:04 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19B541B6A65; Sat, 30 Nov 2019 20:22:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QN8C6zgGz4S7P; Sat, 30 Nov 2019 20:22:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2DF53C8F; Sat, 30 Nov 2019 20:22:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUKM3mQ059027; Sat, 30 Nov 2019 20:22:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUKM3XH059026; Sat, 30 Nov 2019 20:22:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911302022.xAUKM3XH059026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 20:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355249 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 355249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 20:22:04 -0000 Author: np Date: Sat Nov 30 20:22:03 2019 New Revision: 355249 URL: https://svnweb.freebsd.org/changeset/base/355249 Log: MFC r351524: cxgbe/t4_tom: Limit work requests with immediate payload to a single descriptor. The per-tid tx credits are in demand during active Tx and it's best not to use too many just for payload. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Nov 30 20:10:50 2019 (r355248) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Nov 30 20:22:03 2019 (r355249) @@ -572,7 +572,7 @@ t4_close_conn(struct adapter *sc, struct toepcb *toep) static inline int max_imm_payload(int tx_credits) { - const int n = 2; /* Use only up to 2 desc for imm. data WR */ + const int n = 1; /* Use no more than one desc for imm. data WR */ KASSERT(tx_credits >= 0 && tx_credits <= MAX_OFLD_TX_CREDITS, From owner-svn-src-stable-11@freebsd.org Sat Nov 30 20:42:19 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5412C1B788B; Sat, 30 Nov 2019 20:42:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QNbb1XKGz4TwY; Sat, 30 Nov 2019 20:42:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 192074092; Sat, 30 Nov 2019 20:42:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUKgImK072133; Sat, 30 Nov 2019 20:42:18 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUKgIqI072130; Sat, 30 Nov 2019 20:42:18 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911302042.xAUKgIqI072130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 20:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355250 - in stable/11/sys/dev/cxgbe: . common iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common iw_cxgbe X-SVN-Commit-Revision: 355250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 20:42:19 -0000 Author: np Date: Sat Nov 30 20:42:18 2019 New Revision: 355250 URL: https://svnweb.freebsd.org/changeset/base/355250 Log: MFC r354106: cxgbe(4): Use correct FetchBurstMin values for T6. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/common/t4_regs_values.h stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c stable/11/sys/dev/cxgbe/t4_netmap.c stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/t4_regs_values.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_regs_values.h Sat Nov 30 20:22:03 2019 (r355249) +++ stable/11/sys/dev/cxgbe/common/t4_regs_values.h Sat Nov 30 20:42:18 2019 (r355250) @@ -145,6 +145,11 @@ #define X_FETCHBURSTMIN_64B 2 #define X_FETCHBURSTMIN_128B 3 +/* T6 and later use a single-bit encoding for FetchBurstMin */ +#define X_FETCHBURSTMIN_SHIFT_T6 6 +#define X_FETCHBURSTMIN_64B_T6 0 +#define X_FETCHBURSTMIN_128B_T6 1 + #define X_FETCHBURSTMAX_SHIFT 6 #define X_FETCHBURSTMAX_64B 0 #define X_FETCHBURSTMAX_128B 1 Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Sat Nov 30 20:22:03 2019 (r355249) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Sat Nov 30 20:42:18 2019 (r355250) @@ -264,7 +264,8 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4 res->u.sqrq.dcaen_to_eqsize = cpu_to_be32( V_FW_RI_RES_WR_DCAEN(0) | V_FW_RI_RES_WR_DCACPU(0) | - V_FW_RI_RES_WR_FBMIN(2) | + V_FW_RI_RES_WR_FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_64B : X_FETCHBURSTMIN_64B_T6) | V_FW_RI_RES_WR_FBMAX(3) | V_FW_RI_RES_WR_CIDXFTHRESHO(0) | V_FW_RI_RES_WR_CIDXFTHRESH(0) | @@ -286,7 +287,8 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4 res->u.sqrq.dcaen_to_eqsize = cpu_to_be32( V_FW_RI_RES_WR_DCAEN(0) | V_FW_RI_RES_WR_DCACPU(0) | - V_FW_RI_RES_WR_FBMIN(2) | + V_FW_RI_RES_WR_FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_64B : X_FETCHBURSTMIN_64B_T6) | V_FW_RI_RES_WR_FBMAX(3) | V_FW_RI_RES_WR_CIDXFTHRESHO(0) | V_FW_RI_RES_WR_CIDXFTHRESH(0) | Modified: stable/11/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_netmap.c Sat Nov 30 20:22:03 2019 (r355249) +++ stable/11/sys/dev/cxgbe/t4_netmap.c Sat Nov 30 20:42:18 2019 (r355250) @@ -134,7 +134,7 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq (black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0)); c.fl0dcaen_to_fl0cidxfthresh = htobe16(V_FW_IQ_CMD_FL0FBMIN(chip_id(sc) <= CHELSIO_T5 ? - X_FETCHBURSTMIN_128B : X_FETCHBURSTMIN_64B) | + X_FETCHBURSTMIN_128B : X_FETCHBURSTMIN_64B_T6) | V_FW_IQ_CMD_FL0FBMAX(chip_id(sc) <= CHELSIO_T5 ? X_FETCHBURSTMAX_512B : X_FETCHBURSTMAX_256B)); c.fl0size = htobe16(na->num_rx_desc / 8 + sp->spg_len / EQ_ESIZE); @@ -248,9 +248,11 @@ alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | V_FW_EQ_ETH_CMD_PCIECHN(vi->pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO | V_FW_EQ_ETH_CMD_IQID(sc->sge.nm_rxq[nm_txq->iqidx].iq_cntxt_id)); - c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(X_FETCHBURSTMIN_64B) | - V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) | - V_FW_EQ_ETH_CMD_EQSIZE(len / EQ_ESIZE)); + c.dcaen_to_eqsize = + htobe32(V_FW_EQ_ETH_CMD_FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_64B : X_FETCHBURSTMIN_64B_T6) | + V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_ETH_CMD_EQSIZE(len / EQ_ESIZE)); c.eqaddr = htobe64(nm_txq->ba); rc = -t4_wr_mbox(sc, sc->mbox, &c, sizeof(c), &c); Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Sat Nov 30 20:22:03 2019 (r355249) +++ stable/11/sys/dev/cxgbe/t4_sge.c Sat Nov 30 20:42:18 2019 (r355250) @@ -2886,7 +2886,7 @@ alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, str } c.fl0dcaen_to_fl0cidxfthresh = htobe16(V_FW_IQ_CMD_FL0FBMIN(chip_id(sc) <= CHELSIO_T5 ? - X_FETCHBURSTMIN_128B : X_FETCHBURSTMIN_64B) | + X_FETCHBURSTMIN_128B : X_FETCHBURSTMIN_64B_T6) | V_FW_IQ_CMD_FL0FBMAX(chip_id(sc) <= CHELSIO_T5 ? X_FETCHBURSTMAX_512B : X_FETCHBURSTMAX_256B)); c.fl0size = htobe16(fl->qsize); @@ -3458,7 +3458,8 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) V_FW_EQ_CTRL_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = - htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | + htobe32(V_FW_EQ_CTRL_CMD_FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_64B : X_FETCHBURSTMIN_64B_T6) | V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | V_FW_EQ_CTRL_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); @@ -3502,9 +3503,11 @@ eth_eq_alloc(struct adapter *sc, struct vi_info *vi, s htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | V_FW_EQ_ETH_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO | V_FW_EQ_ETH_CMD_IQID(eq->iqid)); - c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(X_FETCHBURSTMIN_64B) | - V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) | - V_FW_EQ_ETH_CMD_EQSIZE(qsize)); + c.dcaen_to_eqsize = + htobe32(V_FW_EQ_ETH_CMD_FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_64B : X_FETCHBURSTMIN_64B_T6) | + V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_ETH_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); rc = -t4_wr_mbox(sc, sc->mbox, &c, sizeof(c), &c); @@ -3546,7 +3549,8 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, V_FW_EQ_OFLD_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_OFLD_CMD_FETCHRO | V_FW_EQ_OFLD_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = - htobe32(V_FW_EQ_OFLD_CMD_FBMIN(X_FETCHBURSTMIN_64B) | + htobe32(V_FW_EQ_OFLD_CMD_FBMIN(chip_id(sc) <= CHELSIO_T5 ? + X_FETCHBURSTMIN_64B : X_FETCHBURSTMIN_64B_T6) | V_FW_EQ_OFLD_CMD_FBMAX(X_FETCHBURSTMAX_512B) | V_FW_EQ_OFLD_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | V_FW_EQ_OFLD_CMD_EQSIZE(qsize)); From owner-svn-src-stable-11@freebsd.org Sat Nov 30 20:43:31 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 919151B79B5; Sat, 30 Nov 2019 20:43:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QNcz3MXHz4V6V; Sat, 30 Nov 2019 20:43:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5655A40B0; Sat, 30 Nov 2019 20:43:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUKhV2N072226; Sat, 30 Nov 2019 20:43:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUKhVtS072225; Sat, 30 Nov 2019 20:43:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911302043.xAUKhVtS072225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 20:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355251 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 355251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 20:43:31 -0000 Author: np Date: Sat Nov 30 20:43:30 2019 New Revision: 355251 URL: https://svnweb.freebsd.org/changeset/base/355251 Log: MFC r354110: Fix typo in cxgbe.4. Modified: stable/11/share/man/man4/cxgbe.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/cxgbe.4 ============================================================================== --- stable/11/share/man/man4/cxgbe.4 Sat Nov 30 20:42:18 2019 (r355250) +++ stable/11/share/man/man4/cxgbe.4 Sat Nov 30 20:43:30 2019 (r355251) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Sep 24, 2018 +.Dd Oct 25, 2019 .Dt CXGBE 4 .Os .Sh NAME @@ -291,7 +291,7 @@ Settings can be displayed and controlled on a per-port dev..X.pause_settings sysctl. .It Va hw.cxgbe.fec FEC (Forward Error Correction) settings. -0 diables FEC. +0 disables FEC. Bit 0 enables RS FEC, bit 1 enables BASE-R FEC (aka Firecode FEC). The default is -1 which lets the driver pick a value. This tunable establishes the default FEC settings for all ports. From owner-svn-src-stable-11@freebsd.org Sat Nov 30 20:51:48 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 365FA1B7E55; Sat, 30 Nov 2019 20:51:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QNpX0jkTz4Vh9; Sat, 30 Nov 2019 20:51:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0BF9412A; Sat, 30 Nov 2019 20:51:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAUKplaF077154; Sat, 30 Nov 2019 20:51:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAUKplal077151; Sat, 30 Nov 2019 20:51:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911302051.xAUKplal077151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 20:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355252 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 355252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 20:51:48 -0000 Author: np Date: Sat Nov 30 20:51:47 2019 New Revision: 355252 URL: https://svnweb.freebsd.org/changeset/base/355252 Log: MFC r354522: cxgbe(4): Query Vdd from the firmware if its last known value is 0. TVSENSE may not be ready by the time t4_fw_initialize returns and the firmware returns 0 if the driver asks for the Vdd before the sensor is ready. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sat Nov 30 20:43:30 2019 (r355251) +++ stable/11/sys/dev/cxgbe/t4_main.c Sat Nov 30 20:51:47 2019 (r355252) @@ -640,6 +640,7 @@ static int sysctl_fec(SYSCTL_HANDLER_ARGS); static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); +static int sysctl_vdd(SYSCTL_HANDLER_ARGS); static int sysctl_loadavg(SYSCTL_HANDLER_ARGS); static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS); @@ -5959,8 +5960,8 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RD, sc, 0, sysctl_loadavg, "A", "microprocessor load averages (debug firmwares only)"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_vdd", CTLFLAG_RD, - &sc->params.core_vdd, 0, "core Vdd (in mV)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "core_vdd", CTLTYPE_INT | + CTLFLAG_RD, sc, 0, sysctl_vdd, "I", "core Vdd (in mV)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "local_cpus", CTLTYPE_STRING | CTLFLAG_RD, sc, LOCAL_CPUS, @@ -7087,6 +7088,31 @@ sysctl_temperature(SYSCTL_HANDLER_ARGS) rc = sysctl_handle_int(oidp, &t, 0, req); return (rc); +} + +static int +sysctl_vdd(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + int rc; + uint32_t param, val; + + if (sc->params.core_vdd == 0) { + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, + "t4vdd"); + if (rc) + return (rc); + param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_DIAG) | + V_FW_PARAMS_PARAM_Y(FW_PARAM_DEV_DIAG_VDD); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + end_synchronized_op(sc, 0); + if (rc) + return (rc); + sc->params.core_vdd = val; + } + + return (sysctl_handle_int(oidp, &sc->params.core_vdd, 0, req)); } static int From owner-svn-src-stable-11@freebsd.org Sat Nov 30 21:11:18 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 083FE1B8D47; Sat, 30 Nov 2019 21:11:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47QPF16WtGz4XBq; Sat, 30 Nov 2019 21:11:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3F1A4479; Sat, 30 Nov 2019 21:11:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAULBHIm085436; Sat, 30 Nov 2019 21:11:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAULBHOO085435; Sat, 30 Nov 2019 21:11:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911302111.xAULBHOO085435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 30 Nov 2019 21:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355253 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 355253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2019 21:11:18 -0000 Author: np Date: Sat Nov 30 21:11:17 2019 New Revision: 355253 URL: https://svnweb.freebsd.org/changeset/base/355253 Log: MFC r354742: cxgbev(4): Catch up with the pciids in the PF driver. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_iov.c stable/11/sys/dev/cxgbe/t4_vf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_iov.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_iov.c Sat Nov 30 20:51:47 2019 (r355252) +++ stable/11/sys/dev/cxgbe/t4_iov.c Sat Nov 30 21:11:17 2019 (r355253) @@ -81,16 +81,10 @@ struct { {0x5012, "Chelsio T560-CR"}, /* 1 x 40G, 2 x 10G */ {0x5014, "Chelsio T580-LP-SO-CR"}, /* 2 x 40G, nomem */ {0x5015, "Chelsio T502-BT"}, /* 2 x 1G */ -#ifdef notyet - {0x5004, "Chelsio T520-BCH"}, - {0x5005, "Chelsio T540-BCH"}, - {0x5006, "Chelsio T540-CH"}, - {0x5008, "Chelsio T520-CX"}, - {0x500b, "Chelsio B520-SR"}, - {0x500c, "Chelsio B504-BT"}, - {0x500f, "Chelsio Amsterdam"}, - {0x5013, "Chelsio T580-CHR"}, -#endif + {0x5018, "Chelsio T540-BT"}, /* 4 x 10GBaseT */ + {0x5019, "Chelsio T540-LP-BT"}, /* 4 x 10GBaseT */ + {0x501a, "Chelsio T540-SO-BT"}, /* 4 x 10GBaseT, nomem */ + {0x501b, "Chelsio T540-SO-CR"}, /* 4 x 10G, nomem */ }, t6iov_pciids[] = { {0x6000, "Chelsio T6-DBG-25"}, /* 2 x 10/25G, debug */ {0x6001, "Chelsio T6225-CR"}, /* 2 x 10/25G */ @@ -111,6 +105,12 @@ struct { /* Custom */ {0x6080, "Chelsio T6225 80"}, {0x6081, "Chelsio T62100 81"}, + {0x6082, "Chelsio T6225-CR 82"}, + {0x6083, "Chelsio T62100-CR 83"}, + {0x6084, "Chelsio T64100-CR 84"}, + {0x6085, "Chelsio T6240-SO 85"}, + {0x6086, "Chelsio T6225-SO-CR 86"}, + {0x6087, "Chelsio T6225-CR 87"}, }; static int t4iov_attach_child(device_t dev); Modified: stable/11/sys/dev/cxgbe/t4_vf.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_vf.c Sat Nov 30 20:51:47 2019 (r355252) +++ stable/11/sys/dev/cxgbe/t4_vf.c Sat Nov 30 21:11:17 2019 (r355253) @@ -97,16 +97,10 @@ struct { {0x5812, "Chelsio T560-CR VF"}, /* 1 x 40G, 2 x 10G */ {0x5814, "Chelsio T580-LP-SO-CR VF"}, /* 2 x 40G, nomem */ {0x5815, "Chelsio T502-BT VF"}, /* 2 x 1G */ -#ifdef notyet - {0x5804, "Chelsio T520-BCH VF"}, - {0x5805, "Chelsio T540-BCH VF"}, - {0x5806, "Chelsio T540-CH VF"}, - {0x5808, "Chelsio T520-CX VF"}, - {0x580b, "Chelsio B520-SR VF"}, - {0x580c, "Chelsio B504-BT VF"}, - {0x580f, "Chelsio Amsterdam VF"}, - {0x5813, "Chelsio T580-CHR VF"}, -#endif + {0x5818, "Chelsio T540-BT VF"}, /* 4 x 10GBaseT */ + {0x5819, "Chelsio T540-LP-BT VF"}, /* 4 x 10GBaseT */ + {0x581a, "Chelsio T540-SO-BT VF"}, /* 4 x 10GBaseT, nomem */ + {0x581b, "Chelsio T540-SO-CR VF"}, /* 4 x 10G, nomem */ }, t6vf_pciids[] = { {0x6800, "Chelsio T6-DBG-25 VF"}, /* 2 x 10/25G, debug */ {0x6801, "Chelsio T6225-CR VF"}, /* 2 x 10/25G */ @@ -127,6 +121,12 @@ struct { /* Custom */ {0x6880, "Chelsio T6225 80 VF"}, {0x6881, "Chelsio T62100 81 VF"}, + {0x6882, "Chelsio T6225-CR 82 VF"}, + {0x6883, "Chelsio T62100-CR 83 VF"}, + {0x6884, "Chelsio T64100-CR 84 VF"}, + {0x6885, "Chelsio T6240-SO 85 VF"}, + {0x6886, "Chelsio T6225-SO-CR 86 VF"}, + {0x6887, "Chelsio T6225-CR 87 VF"}, }; static d_ioctl_t t4vf_ioctl;