Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core
On 08/04/17 08:40, Colin Percival wrote: Casting to "int" or truncating is the right thing to do in this case. Signed integer overflow is undefined. Using 'int' is liable to cause problems after 2^32 ticks. Hi, If you check the code how this function is used, you'll see that the argument passed is computed from: jiffies + n, where "n" is a relatively small value. The <= 0 check is basically there to catch cases where the jiffies value has changed between the point where it was set and the point where the relative ticks timeout value "n" was extracted. Basically the code is doing like this, reading the value of "jiffies" twice. delay = (jiffies0 + n) - jiffies1; if (delay <= 0) delay = 1; And then "delay" should be "int", because we are usually not dealing with timeouts greater than a few hundred seconds or so. --HPS ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core
On 08/03/17 23:28, Hans Petter Selasky wrote: > On 08/03/17 16:37, Conrad Meyer wrote: >> Is it not important that the subtraction and result are evaluated >> without truncation? > > ticks is a circular counter. Assuming time = 0 and jiffies = -1U, then "delay" > becomes a very large negative value, because long is used, and the delay <= 0 > check, is no longer working like expected. > > Casting to "int" or truncating is the right thing to do in this case. Signed integer overflow is undefined. Using 'int' is liable to cause problems after 2^32 ticks. Colin Percival >>> Log: >>>Ticks are 32-bit in FreeBSD. >>> >>>MFC after:3 days >>>Sponsored by: Mellanox Technologies >>> >>> Modified: >>>head/sys/ofed/drivers/infiniband/core/addr.c >>> >>> Modified: head/sys/ofed/drivers/infiniband/core/addr.c >>> == >>> --- head/sys/ofed/drivers/infiniband/core/addr.cThu Aug 3 09:14:43 >>> 2017(r321984) >>> +++ head/sys/ofed/drivers/infiniband/core/addr.cThu Aug 3 09:18:25 >>> 2017(r321985) >>> @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); >>> >>> static void set_timeout(unsigned long time) >>> { >>> - unsigned long delay; >>> + int delay; /* under FreeBSD ticks are 32-bit */ >>> >>> delay = time - jiffies; >>> - if ((long)delay <= 0) >>> + if (delay <= 0) >>> delay = 1; >>> >>> mod_delayed_work(addr_wq, &work, delay); -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core
On 08/03/17 16:37, Conrad Meyer wrote: Hey Hans, Is it not important that the subtraction and result are evaluated without truncation? Hi, ticks is a circular counter. Assuming time = 0 and jiffies = -1U, then "delay" becomes a very large negative value, because long is used, and the delay <= 0 check, is no longer working like expected. Casting to "int" or truncating is the right thing to do in this case. --HPS Thanks, Conrad On Thu, Aug 3, 2017 at 2:18 AM, Hans Petter Selasky wrote: Author: hselasky Date: Thu Aug 3 09:18:25 2017 New Revision: 321985 URL: https://svnweb.freebsd.org/changeset/base/321985 Log: Ticks are 32-bit in FreeBSD. MFC after:3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/addr.c Modified: head/sys/ofed/drivers/infiniband/core/addr.c == --- head/sys/ofed/drivers/infiniband/core/addr.cThu Aug 3 09:14:43 2017(r321984) +++ head/sys/ofed/drivers/infiniband/core/addr.cThu Aug 3 09:18:25 2017(r321985) @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); static void set_timeout(unsigned long time) { - unsigned long delay; + int delay; /* under FreeBSD ticks are 32-bit */ delay = time - jiffies; - if ((long)delay <= 0) + if (delay <= 0) delay = 1; mod_delayed_work(addr_wq, &work, delay); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322041 - head/sys/kern
Author: alc Date: Fri Aug 4 04:23:23 2017 New Revision: 322041 URL: https://svnweb.freebsd.org/changeset/base/322041 Log: In case readers are misled by expressions that combine multiplication and division, add parentheses to make the precedence explicit. Submitted by: Doug Moore Requested by: imp Reviewed by: imp MFC after:1 week X-MFC after: r321840 Differential Revision:https://reviews.freebsd.org/D11815 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c == --- head/sys/kern/subr_blist.c Fri Aug 4 04:20:11 2017(r322040) +++ head/sys/kern/subr_blist.c Fri Aug 4 04:23:23 2017(r322041) @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); #definebitcount64(x) __bitcount64((uint64_t)(x)) #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) +#define CTASSERT(expr) #include @@ -142,6 +143,8 @@ static void blst_radix_print(blmeta_t *scan, daddr_t b static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); #endif +CTASSERT(BLIST_BMAP_RADIX % BLIST_META_RADIX == 0); + /* * For a subtree that can represent the state of up to 'radix' blocks, the * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX. If 'm' @@ -151,17 +154,19 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); * in the 'meta' functions that process subtrees. Since integer division * discards remainders, we can express this computation as * skip = (m * m**h) / (m - 1) - * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1) - * and if m divides BLIST_BMAP_RADIX, we can simplify further to - * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1)) - * so that a simple integer division is enough for the calculation. + * skip = (m * (radix / BLIST_BMAP_RADIX)) / (m - 1) + * and since m divides BLIST_BMAP_RADIX, we can simplify further to + * skip = (radix / (BLIST_BMAP_RADIX / m)) / (m - 1) + * skip = radix / ((BLIST_BMAP_RADIX / m) * (m - 1)) + * so that simple integer division by a constant can safely be used for the + * calculation. */ static inline daddr_t radix_to_skip(daddr_t radix) { return (radix / - (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - 1))); + ((BLIST_BMAP_RADIX / BLIST_META_RADIX) * (BLIST_META_RADIX - 1))); } /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322039 - in head/sys/boot/efi: include libefi loader
Author: imp Date: Fri Aug 4 04:20:06 2017 New Revision: 322039 URL: https://svnweb.freebsd.org/changeset/base/322039 Log: Move EFI ZFS functions to libefi This patch moves some EFI ZFS functions from loader to libefi, allowing them to be used by anything that links against libefi. Submitted by: Eric McCorkle Differential Revision: https://reviews.freebsd.org/D11855 Added: head/sys/boot/efi/include/efizfs.h (contents, props changed) head/sys/boot/efi/libefi/efizfs.c (contents, props changed) Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/main.c Added: head/sys/boot/efi/include/efizfs.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/efizfs.h Fri Aug 4 04:20:06 2017 (r322039) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#ifndef _EFIZFS_H_ +#define _EFIZFS_H_ + +#ifdef EFI_ZFS_BOOT +typedef STAILQ_HEAD(zfsinfo_list, zfsinfo) zfsinfo_list_t; + +typedef struct zfsinfo +{ + STAILQ_ENTRY(zfsinfo) zi_link; + EFI_HANDLE zi_handle; +uint64_t zi_pool_guid; +} zfsinfo_t; + +extern uint64_t pool_guid; + +extern void efi_zfs_probe(void); +extern zfsinfo_list_t *efizfs_get_zfsinfo_list(void); + +#endif + +#endif Modified: head/sys/boot/efi/libefi/Makefile == --- head/sys/boot/efi/libefi/Makefile Fri Aug 4 04:16:41 2017 (r322038) +++ head/sys/boot/efi/libefi/Makefile Fri Aug 4 04:20:06 2017 (r322039) @@ -12,7 +12,7 @@ INTERNALLIB= WARNS?=2 SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ - handles.c wchar.c libefi.c efi_driver_utils.c + handles.c wchar.c libefi.c efi_driver_utils.c efizfs.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= time.c @@ -38,6 +38,12 @@ CFLAGS+= -fPIC -mno-red-zone CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +.if ${MK_ZFS} != "no" +CFLAGS+= -I${.CURDIR}/../../zfs +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein +CFLAGS+= -DEFI_ZFS_BOOT +.endif # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common Added: head/sys/boot/efi/libefi/efizfs.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/libefi/efizfs.c Fri Aug 4 04:20:06 2017 (r322039) @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 2008-2010 Rui Paulo + * Copyright (c) 2006 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE L
svn commit: r322040 - in head/sys/boot/efi: include libefi
Author: imp Date: Fri Aug 4 04:20:11 2017 New Revision: 322040 URL: https://svnweb.freebsd.org/changeset/base/322040 Log: Add EFI utility functions to libefi This patch adds additional EFI utility functions to convert errno values to EFI_STATUS errors, as well as EFI times to UNIX times. Submitted by: Eric McCorkle Differential Revision: https://reviews.freebsd.org/D11858 Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/errno.c head/sys/boot/efi/libefi/time.c Modified: head/sys/boot/efi/include/efilib.h == --- head/sys/boot/efi/include/efilib.h Fri Aug 4 04:20:06 2017 (r322039) +++ head/sys/boot/efi/include/efilib.h Fri Aug 4 04:20:11 2017 (r322040) @@ -79,6 +79,7 @@ CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); int efi_status_to_errno(EFI_STATUS); +EFI_STATUS errno_to_efi_status(int errno); void efi_time_init(void); void efi_time_fini(void); Modified: head/sys/boot/efi/libefi/errno.c == --- head/sys/boot/efi/libefi/errno.cFri Aug 4 04:20:06 2017 (r322039) +++ head/sys/boot/efi/libefi/errno.cFri Aug 4 04:20:11 2017 (r322040) @@ -30,6 +30,69 @@ __FBSDID("$FreeBSD$"); #include #include +EFI_STATUS +errno_to_efi_status(int errno) +{ +EFI_STATUS status; + +switch (errno) { +case EPERM: +status = EFI_ACCESS_DENIED; +break; + +case EOVERFLOW: +status = EFI_BUFFER_TOO_SMALL; +break; + +case EIO: +status = EFI_DEVICE_ERROR; +break; + +case EINVAL: +status = EFI_INVALID_PARAMETER; +break; + +case ESTALE: +status = EFI_MEDIA_CHANGED; +break; + +case ENXIO: +status = EFI_NO_MEDIA; +break; + +case ENOENT: +status = EFI_NOT_FOUND; +break; + +case ENOMEM: +status = EFI_OUT_OF_RESOURCES; +break; + +case ENOTSUP: +case ENODEV: +status = EFI_UNSUPPORTED; +break; + +case ENOSPC: +status = EFI_VOLUME_FULL; +break; + +case EACCES: +status = EFI_WRITE_PROTECTED; +break; + +case 0: +status = EFI_SUCCESS; +break; + +default: +status = EFI_DEVICE_ERROR; +break; +} + +return (status); +} + int efi_status_to_errno(EFI_STATUS status) { Modified: head/sys/boot/efi/libefi/time.c == --- head/sys/boot/efi/libefi/time.c Fri Aug 4 04:20:06 2017 (r322039) +++ head/sys/boot/efi/libefi/time.c Fri Aug 4 04:20:11 2017 (r322040) @@ -58,6 +58,41 @@ __FBSDID("$FreeBSD$"); #define SECSPERHOUR ( 60*60 ) #define SECSPERDAY (24 * SECSPERHOUR) +/* +// These arrays give the cumulative number of days up to the first of the +// month number used as the index (1 -> 12) for regular and leap years. +// The value at index 13 is for the whole year. +*/ +static const time_t CumulativeDays[2][14] = { + {0, + 0, + 31, + 31 + 28, + 31 + 28 + 31, + 31 + 28 + 31 + 30, + 31 + 28 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }, + {0, + 0, + 31, + 31 + 29, + 31 + 29 + 31, + 31 + 29 + 31 + 30, + 31 + 29 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }}; + void efi_time_init(void) { @@ -68,45 +103,46 @@ efi_time_fini(void) { } -static time_t -efi_time(EFI_TIME *ETime) +void +to_efi_time(EFI_TIME *efi_time, time_t time) { -/* -// These arrays give the cumulative number of days up to the first of the -// month number used as the index (1 -> 12) for regular and leap years. -// The value at index 13 is for the whole year. -*/ -static time_t CumulativeDays[2][14] = { -{0, - 0, - 31, - 31 + 28, - 31 + 28 + 31, - 31 + 28 + 31 + 30, - 31 + 28 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31, -
svn commit: r322038 - in head/sys/boot/efi: include libefi
Author: imp Date: Fri Aug 4 04:16:41 2017 New Revision: 322038 URL: https://svnweb.freebsd.org/changeset/base/322038 Log: Add definitions and utilities for EFI drivers This patch adds definitions and utility code for creating EFI drivers using the EFI_DRIVER_BINDING_PROTOCOL. Submitted by: Eric McCorkle Differential Revision: https://reviews.freebsd.org/D11852 Added: head/sys/boot/efi/include/efi_driver_utils.h (contents, props changed) head/sys/boot/efi/include/efi_drivers.h (contents, props changed) head/sys/boot/efi/libefi/efi_driver_utils.c (contents, props changed) Modified: head/sys/boot/efi/include/efiprot.h head/sys/boot/efi/libefi/Makefile Added: head/sys/boot/efi/include/efi_driver_utils.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/efi_driver_utils.hFri Aug 4 04:16:41 2017(r322038) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2017 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _EFI_DRIVER_UTILS_H_ +#define _EFI_DRIVER_UTILS_H_ + +#include +#include + +extern EFI_STATUS install_driver(EFI_DRIVER_BINDING *driver); +extern EFI_STATUS connect_controllers(EFI_GUID *filter); + +#endif Added: head/sys/boot/efi/include/efi_drivers.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/efi_drivers.h Fri Aug 4 04:16:41 2017 (r322038) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _EFI_DRIVERS_H_ +#define _EFI_DRIVERS_H_ + +#include + +typedef struct efi_driver_t { +const char *name; +void (*init)(void); +} efi_driver_t; + +extern struct devsw efipart_dev; +extern int efipart_getdesc(struct devdesc *dev, char **out); + +/* EFI drivers. */ +extern const efi_driver_t fs_driver; + +#endif Modified: head/sys/boot/efi/include/efiprot.h == --- head/sys/boot/efi/include/efiprot.h Fri Aug 4 03:48:17 2017 (r322037) +++ head/sys/boot/efi/include/efiprot.h Fri Aug 4 04:16:41 2017 (r322038) @@ -27,6 +27,8 @@ Revision History --
svn commit: r322037 - head/lib/libstand
Author: imp Date: Fri Aug 4 03:48:17 2017 New Revision: 322037 URL: https://svnweb.freebsd.org/changeset/base/322037 Log: Add stpcpy and stpncpy to libstand This adds the stpcpy and stpncpy functions to libstand. Differential Revision: https://reviews.freebsd.org/D11844 Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile == --- head/lib/libstand/Makefile Fri Aug 4 03:40:01 2017(r322036) +++ head/lib/libstand/Makefile Fri Aug 4 03:48:17 2017(r322037) @@ -41,7 +41,7 @@ SRCS+= ntoh.c .PATH: ${LIBC_SRC}/string SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ - qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} == "arm" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322036 - in head/sys: conf dev/nvd dev/nvme
Author: imp Date: Fri Aug 4 03:40:01 2017 New Revision: 322036 URL: https://svnweb.freebsd.org/changeset/base/322036 Log: Make nvd vs nda choice boot-time rather than build-time Introduce hw.nvme.use_nvd tunable. This tunable allows both nvd and nda to be installed in the kernel, while allowing only one of them to create devices. This is an all-or-nothing setting, and you can't change it after boot-time. However, it will allow easier A/B testing. Differential Revision: https://reviews.freebsd.org/D11825 Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/dev/nvd/nvd.c head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_sim.c head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/conf/files == --- head/sys/conf/files Fri Aug 4 03:20:01 2017(r322035) +++ head/sys/conf/files Fri Aug 4 03:40:01 2017(r322036) @@ -86,9 +86,9 @@ cam/cam_xpt.c optional scbus cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus cam/ata/ata_pmp.c optional scbus -cam/nvme/nvme_all.coptional scbus nvme !nvd -cam/nvme/nvme_da.c optional scbus nvme da !nvd -cam/nvme/nvme_xpt.coptional scbus nvme !nvd +cam/nvme/nvme_all.coptional scbus nvme +cam/nvme/nvme_da.c optional scbus nvme da +cam/nvme/nvme_xpt.coptional scbus nvme cam/scsi/scsi_xpt.coptional scbus cam/scsi/scsi_all.coptional scbus cam/scsi/scsi_cd.c optional cd Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Fri Aug 4 03:20:01 2017(r322035) +++ head/sys/conf/files.amd64 Fri Aug 4 03:40:01 2017(r322036) @@ -341,7 +341,7 @@ dev/nvme/nvme_ctrlr_cmd.c optionalnvme dev/nvme/nvme_ns.c optionalnvme dev/nvme/nvme_ns_cmd.c optionalnvme dev/nvme/nvme_qpair.c optionalnvme -dev/nvme/nvme_sim.coptionalnvme scbus !nvd +dev/nvme/nvme_sim.coptionalnvme scbus dev/nvme/nvme_sysctl.c optionalnvme dev/nvme/nvme_test.c optionalnvme dev/nvme/nvme_util.c optionalnvme Modified: head/sys/dev/nvd/nvd.c == --- head/sys/dev/nvd/nvd.c Fri Aug 4 03:20:01 2017(r322035) +++ head/sys/dev/nvd/nvd.c Fri Aug 4 03:40:01 2017(r322036) @@ -134,6 +134,8 @@ MODULE_DEPEND(nvd, nvme, 1, 1, 1); static int nvd_load() { + if (!nvme_use_nvd) + return 0; TAILQ_INIT(&ctrlr_head); TAILQ_INIT(&disk_head); @@ -149,6 +151,9 @@ nvd_unload() { struct nvd_controller *ctrlr; struct nvd_disk *disk; + + if (!nvme_use_nvd) + return; while (!TAILQ_EMPTY(&ctrlr_head)) { ctrlr = TAILQ_FIRST(&ctrlr_head); Modified: head/sys/dev/nvme/nvme.h == --- head/sys/dev/nvme/nvme.hFri Aug 4 03:20:01 2017(r322035) +++ head/sys/dev/nvme/nvme.hFri Aug 4 03:40:01 2017(r322036) @@ -1003,6 +1003,8 @@ void nvme_ns_trim_cmd(struct nvme_command *cmd, uint16 cmd->cdw11 = NVME_DSM_ATTR_DEALLOCATE; } +extern int nvme_use_nvd; + #endif /* _KERNEL */ #endif /* __NVME_H__ */ Modified: head/sys/dev/nvme/nvme_sim.c == --- head/sys/dev/nvme/nvme_sim.cFri Aug 4 03:20:01 2017 (r322035) +++ head/sys/dev/nvme/nvme_sim.cFri Aug 4 03:40:01 2017 (r322036) @@ -371,6 +371,8 @@ struct nvme_consumer *consumer_cookie; static void nvme_sim_init(void) { + if (nvme_use_nvd) + return; consumer_cookie = nvme_register_consumer(nvme_sim_new_ns, nvme_sim_new_controller, NULL, nvme_sim_controller_fail); @@ -382,6 +384,8 @@ SYSINIT(nvme_sim_register, SI_SUB_DRIVERS, SI_ORDER_AN static void nvme_sim_uninit(void) { + if (nvme_use_nvd) + return; /* XXX Cleanup */ nvme_unregister_consumer(consumer_cookie); Modified: head/sys/dev/nvme/nvme_sysctl.c == --- head/sys/dev/nvme/nvme_sysctl.c Fri Aug 4 03:20:01 2017 (r322035) +++ head/sys/dev/nvme/nvme_sysctl.c Fri Aug 4 03:40:01 2017 (r322036) @@ -33,6 +33,12 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +int nvme_use_nvd = 1; + +SYSCTL_NODE(_hw, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVMe sysctl tunables"); +SYSCTL_INT(_hw_nvme, OID_AUTO, use_nvd, CTLFLAG_RDTUN, +&nvme_use_nvd, 1, "1 = Create NVD devices, 0 = Create NDA devices"
svn commit: r322035 - head/usr.bin/calendar/calendars
Author: alc Date: Fri Aug 4 03:20:01 2017 New Revision: 322035 URL: https://svnweb.freebsd.org/changeset/base/322035 Log: Add myself. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdFri Aug 4 01:28:06 2017(r322034) +++ head/usr.bin/calendar/calendars/calendar.freebsdFri Aug 4 03:20:01 2017(r322035) @@ -423,6 +423,7 @@ 12/19 Stephen Hurd born in Estevan, Saskatchewan, Canada, 1975 12/19 Emmanuel Vadot born in Decines-Charpieu, France, 1983 12/21 Rong-En Fan born in Taipei, Taiwan, Republic of China, 1982 +12/22 Alan L. Cox born in Warren, Ohio, United States, 1964 12/22 Maxim Sobolev born in Dnepropetrovsk, Ukraine, 1976 12/23 Sean Chittenden born in Seattle, Washington, United States, 1979 12/23 Alejandro Pulver born in Buenos Aires, Argentina, 1989 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
On Thu, 3 Aug 2017, Joerg Sonnenberger wrote: On Thu, Aug 03, 2017 at 05:53:43PM +1000, Bruce Evans wrote: Freestanding versions (static and otherwise) cause problems with builtins. -ffreestanding turns off all builtins. The static memcpy used to be ifdefed so as to use __builtin_memcpy instead of the static one if the compiler is gcc. That apparently broke with gcc-4.2, since the builtin will call libc memcpy() in some cases, although memcpy() is unavailable in the freestanding case. GCC always had a requirement that freestanding environment must provide certain functions (memcpy, memmove, memset, memcmp). At least memcpy and memset are regulary used for certain code constructs. While most calls will be inlined, it is not required. I had forgotten about that bug. boot2 doesn't have many fancy code constructs, but it might have struct copying and gcc uses memcpy for copying large structs. clang-4.0 has the same bug. Testing showed 1 bug nearby: for newer CPUs, it generates large code with several movups's for small struct copies. The bug is that -Os doesn't turn this off. But boot2 uses -march=i386 which does turn this off. For not so new CPUs like core2 where movups is slower than movaps but movaps is unusable because the structs might not be aligned, it normally generates large code with moves through integer registers, but -Os works to turn this off. The change for gcc-4.2 was apparently to support this. The static memcpy is not quite compatible, but is close enough and you can check this in the generated code. The problem is that it should be re-checked for every change in the source code and compiler. Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322034 - head/sys/dev/cxgbe
Author: np Date: Fri Aug 4 01:28:06 2017 New Revision: 322034 URL: https://svnweb.freebsd.org/changeset/base/322034 Log: cxgbe(4): Always use the first and not the last virtual interface associated with a port in begin_synchronized_op. MFC after:3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Aug 3 22:41:34 2017 (r322033) +++ head/sys/dev/cxgbe/t4_main.cFri Aug 4 01:28:06 2017 (r322034) @@ -9236,12 +9236,13 @@ t4_os_portmod_changed(struct port_info *pi, int old_pt build_medialist(pi, &vi->media); } PORT_UNLOCK(pi); + vi = &pi->vi[0]; if (begin_synchronized_op(pi->adapter, vi, HOLD_LOCK, "t4mod") == 0) { init_l1cfg(pi); end_synchronized_op(pi->adapter, LOCK_HELD); } - ifp = pi->vi[0].ifp; + ifp = vi->ifp; if (pi->mod_type == FW_PORT_MOD_TYPE_NONE) if_printf(ifp, "transceiver unplugged.\n"); else if (pi->mod_type == FW_PORT_MOD_TYPE_UNKNOWN) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r322029 - in head: usr.bin usr.sbin
> On Aug 3, 2017, at 14:30, Jeremie Le Hen wrote: > > Author: jlh > Date: Thu Aug 3 21:30:12 2017 > New Revision: 322029 > URL: https://svnweb.freebsd.org/changeset/base/322029 > > Log: > rwho/ruptime/rwhod shouldn't be gated by RCMDS. The why in this commit and the next you made (r322031) would have been incredibly helpful. If bugzilla disappears I only have the commit history tracking the what. Cheers, -Ngie signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r322033 - head/usr.bin/procstat
Author: markj Date: Thu Aug 3 22:41:34 2017 New Revision: 322033 URL: https://svnweb.freebsd.org/changeset/base/322033 Log: Fix procstat --libxo -L. - Use the title role for column headers. - Fix a typo in a field name (lpwid -> lwpid). - Place the fields of different threads in separate containers. Modified: head/usr.bin/procstat/procstat_ptlwpinfo.c Modified: head/usr.bin/procstat/procstat_ptlwpinfo.c == --- head/usr.bin/procstat/procstat_ptlwpinfo.c Thu Aug 3 22:28:30 2017 (r322032) +++ head/usr.bin/procstat/procstat_ptlwpinfo.c Thu Aug 3 22:41:34 2017 (r322033) @@ -46,13 +46,15 @@ procstat_ptlwpinfo(struct procstat *prstat) return; if (!hflag) - xo_emit("{:/%6s %7s %5s %5s %5s %6s %5s} {[:/%d}{:/%s}{]:}" - " {:/%s}\n", + xo_emit( + "{T:/%6s %7s %5s %5s %5s %6s %5s} {[:/%d}{T:/%s}{]:} {T:/%s}\n", "LWPID", "EVENT", "SIGNO", "CODE", "ERRNO", "PID", "UID", 2 * sizeof(void *) + 2, "ADDR", "TDNAME"); + xo_open_container("threads"); for (i = 0; i < count; i++) { - xo_emit("{:lpwid/%6d} ", pl[i].pl_lwpid); + xo_open_container("thread"); + xo_emit("{:lwpid/%6d} ", pl[i].pl_lwpid); switch (pl[i].pl_event) { case PL_EVENT_NONE: xo_emit("{eq:event/none}{d:event/%7s} ", "none"); @@ -85,7 +87,9 @@ procstat_ptlwpinfo(struct procstat *prstat) 2 * sizeof(void *) + 2, "-"); } xo_emit("{:tdname/%s}\n", pl[i].pl_tdname); + xo_close_container("thread"); } + xo_close_container("threads"); procstat_freeptlwpinfo(prstat, pl); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322032 - in head/sys: amd64/include i386/include
Author: cem Date: Thu Aug 3 22:28:30 2017 New Revision: 322032 URL: https://svnweb.freebsd.org/changeset/base/322032 Log: x86: Tag some intrinsics with __pure2 Some C wrappers for x86 instructions do not touch global memory and only act on their arguments; they can be marked __pure2, aka __const__. Without this annotation, Clang 3.9.1 is not intelligent enough on its own to grok that these functions are __const__. Submitted by: Anton Rang Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/include/cpufunc.h head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h == --- head/sys/amd64/include/cpufunc.hThu Aug 3 21:37:57 2017 (r322031) +++ head/sys/amd64/include/cpufunc.hThu Aug 3 22:28:30 2017 (r322032) @@ -63,7 +63,7 @@ breakpoint(void) __asm __volatile("int $3"); } -static __inline u_int +static __inline __pure2 u_int bsfl(u_int mask) { u_int result; @@ -72,7 +72,7 @@ bsfl(u_int mask) return (result); } -static __inline u_long +static __inline __pure2 u_long bsfq(u_long mask) { u_long result; @@ -81,7 +81,7 @@ bsfq(u_long mask) return (result); } -static __inline u_int +static __inline __pure2 u_int bsrl(u_int mask) { u_int result; @@ -90,7 +90,7 @@ bsrl(u_int mask) return (result); } -static __inline u_long +static __inline __pure2 u_long bsrq(u_long mask) { u_long result; @@ -155,7 +155,7 @@ enable_intr(void) #defineHAVE_INLINE_FFSL -static __inline int +static __inline __pure2 int ffsl(long mask) { return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1); @@ -163,7 +163,7 @@ ffsl(long mask) #defineHAVE_INLINE_FFSLL -static __inline int +static __inline __pure2 int ffsll(long long mask) { return (ffsl((long)mask)); @@ -171,7 +171,7 @@ ffsll(long long mask) #defineHAVE_INLINE_FLS -static __inline int +static __inline __pure2 int fls(int mask) { return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1); @@ -179,7 +179,7 @@ fls(int mask) #defineHAVE_INLINE_FLSL -static __inline int +static __inline __pure2 int flsl(long mask) { return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1); @@ -187,7 +187,7 @@ flsl(long mask) #defineHAVE_INLINE_FLSLL -static __inline int +static __inline __pure2 int flsll(long long mask) { return (flsl((long)mask)); Modified: head/sys/i386/include/cpufunc.h == --- head/sys/i386/include/cpufunc.h Thu Aug 3 21:37:57 2017 (r322031) +++ head/sys/i386/include/cpufunc.h Thu Aug 3 22:28:30 2017 (r322032) @@ -60,7 +60,7 @@ breakpoint(void) __asm __volatile("int $3"); } -static __inline u_int +static __inline __pure2 u_int bsfl(u_int mask) { u_int result; @@ -69,7 +69,7 @@ bsfl(u_int mask) return (result); } -static __inline u_int +static __inline __pure2 u_int bsrl(u_int mask) { u_int result; @@ -169,7 +169,7 @@ sfence(void) #defineHAVE_INLINE_FFS -static __inline int +static __inline __pure2 int ffs(int mask) { /* @@ -183,7 +183,7 @@ ffs(int mask) #defineHAVE_INLINE_FFSL -static __inline int +static __inline __pure2 int ffsl(long mask) { return (ffs((int)mask)); @@ -191,7 +191,7 @@ ffsl(long mask) #defineHAVE_INLINE_FLS -static __inline int +static __inline __pure2 int fls(int mask) { return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1); @@ -199,7 +199,7 @@ fls(int mask) #defineHAVE_INLINE_FLSL -static __inline int +static __inline __pure2 int flsl(long mask) { return (fls((int)mask)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r318780 - in head: include sys/sys
Konstantin Belousov writes: > -#ifndef _POSIX_SOURCE > +#if __BSD_VISIBLE > #define ONLCR 0x0002 /* map NL to CR-NL (ala CRMOD) > */ This caused a regression for apps building with _XOPEN_SOURCE e.g., https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220843 DragonFly uses __XSI_VISIBLE for ONLCR and other XSI extensions. https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e08b3836c962 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322031 - in head: usr.bin/ruptime usr.bin/rwho usr.sbin/rwhod
Author: jlh Date: Thu Aug 3 21:37:57 2017 New Revision: 322031 URL: https://svnweb.freebsd.org/changeset/base/322031 Log: Remove deprecation notice for ruptime/rwho/rwhod. PR: 220953 Reported by: peter Modified: head/usr.bin/ruptime/ruptime.1 head/usr.bin/rwho/rwho.1 head/usr.sbin/rwhod/rwhod.8 Modified: head/usr.bin/ruptime/ruptime.1 == --- head/usr.bin/ruptime/ruptime.1 Thu Aug 3 21:35:53 2017 (r322030) +++ head/usr.bin/ruptime/ruptime.1 Thu Aug 3 21:37:57 2017 (r322031) @@ -38,15 +38,6 @@ .Nm .Op Fl alrtu .Op Ar host ... -.Sh DEPRECATION NOTICE -.Nm -is deprecated and will be removed from future versions of the -.Fx -base system. -If -.Nm -is still required, it can be installed from ports or packages -(net/bsdrcmds). .Sh DESCRIPTION The .Nm Modified: head/usr.bin/rwho/rwho.1 == --- head/usr.bin/rwho/rwho.1Thu Aug 3 21:35:53 2017(r322030) +++ head/usr.bin/rwho/rwho.1Thu Aug 3 21:37:57 2017(r322031) @@ -37,15 +37,6 @@ .Sh SYNOPSIS .Nm .Op Fl a -.Sh DEPRECATION NOTICE -.Nm -is deprecated and will be removed from future versions of the -.Fx -base system. -If -.Nm -is still required, it can be installed from ports or packages -(net/bsdrcmds). .Sh DESCRIPTION The .Nm Modified: head/usr.sbin/rwhod/rwhod.8 == --- head/usr.sbin/rwhod/rwhod.8 Thu Aug 3 21:35:53 2017(r322030) +++ head/usr.sbin/rwhod/rwhod.8 Thu Aug 3 21:37:57 2017(r322031) @@ -40,15 +40,6 @@ .Op Fl p .Op Fl l .Op Fl m Op Ar ttl -.Sh DEPRECATION NOTICE -.Nm -is deprecated and will be removed from future versions of the -.Fx -base system. -If -.Nm -is still required, it can be installed from ports or packages -(net/bsdrcmds). .Sh DESCRIPTION The .Nm ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322030 - head/sys/fs/pseudofs
Author: markj Date: Thu Aug 3 21:35:53 2017 New Revision: 322030 URL: https://svnweb.freebsd.org/changeset/base/322030 Log: Bump the maximum file name length in pseudofs filesystems to 48. The previous limit of 24 was somewhat restrictive, and with this change ceil(log2(sizeof(struct pfs_node))) is the same as before in both the ILP32 and LP64 models, so the malloc zone used for allocations of struct pfs_node is the same as before. Approved by: des Modified: head/sys/fs/pseudofs/pseudofs.h Modified: head/sys/fs/pseudofs/pseudofs.h == --- head/sys/fs/pseudofs/pseudofs.h Thu Aug 3 21:30:12 2017 (r322029) +++ head/sys/fs/pseudofs/pseudofs.h Thu Aug 3 21:35:53 2017 (r322030) @@ -50,7 +50,7 @@ struct vnode; /* * Limits and constants */ -#define PFS_NAMELEN24 +#define PFS_NAMELEN48 #define PFS_FSNAMELEN 16 /* equal to MFSNAMELEN */ #define PFS_DELEN (offsetof(struct dirent, d_name) + PFS_NAMELEN) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322029 - in head: usr.bin usr.sbin
Author: jlh Date: Thu Aug 3 21:30:12 2017 New Revision: 322029 URL: https://svnweb.freebsd.org/changeset/base/322029 Log: rwho/ruptime/rwhod shouldn't be gated by RCMDS. PR: 220953 Reported by: peter@ Differential Revision:https://reviews.freebsd.org/D11743 Modified: head/usr.bin/Makefile head/usr.sbin/Makefile Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Thu Aug 3 21:14:46 2017(r322028) +++ head/usr.bin/Makefile Thu Aug 3 21:30:12 2017(r322029) @@ -133,8 +133,10 @@ SUBDIR=alias \ rpcinfo \ rs \ rup \ + ruptime \ rusers \ rwall \ + rwho \ script \ sdiff \ sed \ @@ -251,8 +253,6 @@ SUBDIR.${MK_OPENSSL}+= newkey SUBDIR.${MK_QUOTAS}+= quota SUBDIR.${MK_RCMDS}+= rlogin SUBDIR.${MK_RCMDS}+= rsh -SUBDIR.${MK_RCMDS}+= ruptime -SUBDIR.${MK_RCMDS}+= rwho SUBDIR.${MK_SENDMAIL}+=vacation SUBDIR.${MK_TALK}+=talk SUBDIR.${MK_TELNET}+= telnet Modified: head/usr.sbin/Makefile == --- head/usr.sbin/Makefile Thu Aug 3 21:14:46 2017(r322028) +++ head/usr.sbin/Makefile Thu Aug 3 21:30:12 2017(r322029) @@ -74,6 +74,7 @@ SUBDIR= adduser \ rpc.statd \ rpc.umntall \ rtprio \ + rwhod \ service \ services_mkdb \ sesutil \ @@ -191,7 +192,6 @@ SUBDIR.${MK_PPP}+= ppp SUBDIR.${MK_QUOTAS}+= edquota SUBDIR.${MK_QUOTAS}+= quotaon SUBDIR.${MK_QUOTAS}+= repquota -SUBDIR.${MK_RCMDS}+= rwhod SUBDIR.${MK_SENDMAIL}+=editmap SUBDIR.${MK_SENDMAIL}+=mailstats SUBDIR.${MK_SENDMAIL}+=makemap ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322028 - in head/sys/compat/linuxkpi/common: include/linux src
Author: markj Date: Thu Aug 3 21:14:46 2017 New Revision: 322028 URL: https://svnweb.freebsd.org/changeset/base/322028 Log: Add subsystem vendor and device ID fields to struct pci_dev. MFC after:1 week Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h == --- head/sys/compat/linuxkpi/common/include/linux/pci.h Thu Aug 3 19:01:46 2017(r322027) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Thu Aug 3 21:14:46 2017(r322028) @@ -202,6 +202,8 @@ struct pci_dev { uint64_tdma_mask; uint16_tdevice; uint16_tvendor; + uint16_tsubsystem_vendor; + uint16_tsubsystem_device; unsigned intirq; unsigned intdevfn; uint32_tclass; Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c == --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Aug 3 19:01:46 2017(r322027) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Aug 3 21:14:46 2017(r322028) @@ -119,10 +119,13 @@ linux_pci_attach(device_t dev) { struct resource_list_entry *rle; struct pci_dev *pdev; + struct pci_devinfo *dinfo; struct pci_driver *pdrv; const struct pci_device_id *id; int error; + dinfo = device_get_ivars(dev); + linux_set_current(curthread); pdrv = linux_pci_find(dev, &id); pdev = device_get_softc(dev); @@ -132,6 +135,8 @@ linux_pci_attach(device_t dev) pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); pdev->device = id->device; pdev->vendor = id->vendor; + pdev->subsystem_vendor = dinfo->cfg.subvendor; + pdev->subsystem_device = dinfo->cfg.subdevice; pdev->class = pci_get_class(dev); pdev->revision = pci_get_revid(dev); pdev->dev.dma_mask = &pdev->dma_mask; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322027 - head/sys/arm/conf
Author: manu Date: Thu Aug 3 19:01:46 2017 New Revision: 322027 URL: https://svnweb.freebsd.org/changeset/base/322027 Log: arm: Add a GENERIC-NODEBUG kernel config Like amd64 or arm64 provide a GENERIC-NODEBUG configuration file that remove WITNESS and INVARIANTS etc ... Added: head/sys/arm/conf/GENERIC-NODEBUG (contents, props changed) Added: head/sys/arm/conf/GENERIC-NODEBUG == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/GENERIC-NODEBUG Thu Aug 3 19:01:46 2017 (r322027) @@ -0,0 +1,40 @@ +# +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/arm +# +# This configuration file removes several debugging options, including +# WITNESS and INVARIANTS checking, which are known to have significant +# performance impact on running systems. When benchmarking new features +# this kernel should be used instead of the standard GENERIC. +# This kernel configuration should never appear outside of the HEAD +# of the FreeBSD tree. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC + +ident GENERIC-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions BUF_TRACKING +nooptions DEADLKRES +nooptions FULL_BUF_TRACKING + ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322026 - head/sys/modules/i2c/nxprtc
Author: ian Date: Thu Aug 3 18:49:15 2017 New Revision: 322026 URL: https://svnweb.freebsd.org/changeset/base/322026 Log: Add missing header file to SRCS. Reported by: manu@ Modified: head/sys/modules/i2c/nxprtc/Makefile Modified: head/sys/modules/i2c/nxprtc/Makefile == --- head/sys/modules/i2c/nxprtc/MakefileThu Aug 3 18:43:54 2017 (r322025) +++ head/sys/modules/i2c/nxprtc/MakefileThu Aug 3 18:49:15 2017 (r322026) @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = nxprtc -SRCS = nxprtc.c bus_if.h clock_if.h device_if.h iicbus_if.h +SRCS = nxprtc.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322025 - head/sys/arm/allwinner
Author: ian Date: Thu Aug 3 18:43:54 2017 New Revision: 322025 URL: https://svnweb.freebsd.org/changeset/base/322025 Log: Switch to iicdev_readfrom/writeto() to do xfers with proper bus ownership. Tested by:manu@ Modified: head/sys/arm/allwinner/axp209.c Modified: head/sys/arm/allwinner/axp209.c == --- head/sys/arm/allwinner/axp209.c Thu Aug 3 18:07:01 2017 (r322024) +++ head/sys/arm/allwinner/axp209.c Thu Aug 3 18:43:54 2017 (r322025) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -59,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include -#include "iicbus_if.h" #include "gpio_if.h" #include "regdev_if.h" @@ -602,7 +600,6 @@ enum AXP2XX_TYPE { struct axp2xx_softc { device_tdev; - uint32_taddr; struct resource * res[1]; void * intrcookie; struct intr_config_hook intr_hook; @@ -641,57 +638,15 @@ static struct resource_spec axp_res_spec[] = { static int axp2xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { - struct axp2xx_softc *sc = device_get_softc(dev); - struct iic_msg msg[2]; - msg[0].slave = sc->addr; - msg[0].flags = IIC_M_WR; - msg[0].len = 1; - msg[0].buf = ® - - msg[1].slave = sc->addr; - msg[1].flags = IIC_M_RD; - msg[1].len = size; - msg[1].buf = data; - - return (iicbus_transfer(dev, msg, 2)); + return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT)); } static int axp2xx_write(device_t dev, uint8_t reg, uint8_t data) { - uint8_t buffer[2]; - struct axp2xx_softc *sc = device_get_softc(dev); - struct iic_msg msg[2]; - int nmsgs = 0; - if (sc->type == AXP209) { - buffer[0] = reg; - buffer[1] = data; - - msg[0].slave = sc->addr; - msg[0].flags = IIC_M_WR; - msg[0].len = 2; - msg[0].buf = buffer; - - nmsgs = 1; - } - else if (sc->type == AXP221) { - msg[0].slave = sc->addr; - msg[0].flags = IIC_M_WR; - msg[0].len = 1; - msg[0].buf = ® - - msg[1].slave = sc->addr; - msg[1].flags = IIC_M_WR; - msg[1].len = 1; - msg[1].buf = &data; - nmsgs = 2; - } - else - return (EINVAL); - - return (iicbus_transfer(dev, msg, nmsgs)); + return (iicdev_writeto(dev, reg, &data, sizeof(data), IIC_INTRWAIT)); } static int @@ -1239,7 +1194,6 @@ axp2xx_start(void *pdev) dev = pdev; sc = device_get_softc(dev); - sc->addr = iicbus_get_addr(dev); sc->dev = dev; if (bootverbose) { @@ -1451,4 +1405,4 @@ EARLY_DRIVER_MODULE(ofw_gpiobus, axp2xx_pmu, ofw_gpiob DRIVER_MODULE(gpioc, axp2xx_pmu, gpioc_driver, gpioc_devclass, 0, 0); MODULE_VERSION(axp2xx, 1); -MODULE_DEPEND(axp2xx, iicbus, 1, 1, 1); +MODULE_DEPEND(axp2xx, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322023 - head/lib/libxo/tests
Author: ngie Date: Thu Aug 3 17:53:14 2017 New Revision: 322023 URL: https://svnweb.freebsd.org/changeset/base/322023 Log: Remove special-case logic for running tests on host machines I'm not sure what process sjg@ was using, but using CHECKDIR=${.OBJDIR} with "make check" on ^/head is the correct thing to do. This unbreaks "make check" for me (unsandboxed, not using CHECKDIR=${.OBJDIR}). While here, fix a whitespace nit with LIBADD. MFC after:1 week Modified: head/lib/libxo/tests/Makefile Modified: head/lib/libxo/tests/Makefile == --- head/lib/libxo/tests/Makefile Thu Aug 3 17:43:26 2017 (r322022) +++ head/lib/libxo/tests/Makefile Thu Aug 3 17:53:14 2017 (r322023) @@ -242,13 +242,8 @@ PROGS+= test_11 CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H} -LIBADD=xo util +LIBADD=xo util SUBDIR+= encoder - -.if ${MACHINE} == "host" -# make it easy to test without install -TESTSDIR= ${.OBJDIR} -.endif .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322019 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/tests/xo contrib/libxo/tests/xo/saved contri...
Author: phil Date: Thu Aug 3 15:47:42 2017 New Revision: 322019 URL: https://svnweb.freebsd.org/changeset/base/322019 Log: Update from libxo-0.8.1 to 0.8.4: 0.8.4: - void anchor width optimization when we have a custom formatter (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221130) - make "{[:/18}" do the right thing (also allows "{[:/%s}", wide ? 40 : 10) - Can't skip anchor formatting in non-display styles - add test case for {[:/18} - add upload-xohtml-files to 'make upload' 0.8.3: - xohtml: Add "-w" option to pull support files from gh_pages - Add "upload-xohtml-files" target to publish support files in gh_pages/ - add HISTORY/AUTHORS section to man pages 0.8.2: - xohtml: Add div.units as standard CSS text - Don't treat values as format strings; they are not - add "-p" to "mkdir -p build" in setup.sh - add test case for {U:%%} (from df.c) - detect end-of-string in '%' and '' escaping - make xo_simple_field, for common simple cases - xohtml: nuke "n" in "echo" commands - rename "format" to "fmt" for consistency; same for "str" to "value" Submitted by: phil Modified: head/contrib/libxo/Makefile.am head/contrib/libxo/configure.ac head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/libxo/libxo.3 head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo_attr.3 head/contrib/libxo/libxo/xo_create.3 head/contrib/libxo/libxo/xo_emit.3 head/contrib/libxo/libxo/xo_emit_err.3 head/contrib/libxo/libxo/xo_emit_f.3 head/contrib/libxo/libxo/xo_err.3 head/contrib/libxo/libxo/xo_error.3 head/contrib/libxo/libxo/xo_finish.3 head/contrib/libxo/libxo/xo_flush.3 head/contrib/libxo/libxo/xo_format.5 head/contrib/libxo/libxo/xo_message.3 head/contrib/libxo/libxo/xo_no_setlocale.3 head/contrib/libxo/libxo/xo_open_container.3 head/contrib/libxo/libxo/xo_open_list.3 head/contrib/libxo/libxo/xo_open_marker.3 head/contrib/libxo/libxo/xo_options.7 head/contrib/libxo/libxo/xo_parse_args.3 head/contrib/libxo/libxo/xo_set_allocator.3 head/contrib/libxo/libxo/xo_set_flags.3 head/contrib/libxo/libxo/xo_set_info.3 head/contrib/libxo/libxo/xo_set_options.3 head/contrib/libxo/libxo/xo_set_style.3 head/contrib/libxo/libxo/xo_set_syslog_enterprise_id.3 head/contrib/libxo/libxo/xo_set_version.3 head/contrib/libxo/libxo/xo_set_writer.3 head/contrib/libxo/libxo/xo_syslog.3 head/contrib/libxo/tests/core/saved/test_01.E.out head/contrib/libxo/tests/core/saved/test_01.H.out head/contrib/libxo/tests/core/saved/test_01.HIPx.out head/contrib/libxo/tests/core/saved/test_01.HP.out head/contrib/libxo/tests/core/saved/test_01.J.out head/contrib/libxo/tests/core/saved/test_01.JP.out head/contrib/libxo/tests/core/saved/test_01.T.out head/contrib/libxo/tests/core/saved/test_01.X.out head/contrib/libxo/tests/core/saved/test_01.XP.out head/contrib/libxo/tests/core/saved/test_02.E.out head/contrib/libxo/tests/core/saved/test_02.J.out head/contrib/libxo/tests/core/saved/test_02.JP.out head/contrib/libxo/tests/core/saved/test_02.X.out head/contrib/libxo/tests/core/saved/test_02.XP.out head/contrib/libxo/tests/core/test_01.c head/contrib/libxo/tests/xo/saved/xo_01.H.out head/contrib/libxo/tests/xo/saved/xo_01.HIPx.out head/contrib/libxo/tests/xo/saved/xo_01.HP.out head/contrib/libxo/tests/xo/saved/xo_01.J.out head/contrib/libxo/tests/xo/saved/xo_01.JP.out head/contrib/libxo/tests/xo/saved/xo_01.T.out head/contrib/libxo/tests/xo/saved/xo_01.X.out head/contrib/libxo/tests/xo/saved/xo_01.XP.out head/contrib/libxo/tests/xo/xo_01.sh head/contrib/libxo/xo/xo.1 head/contrib/libxo/xohtml/xohtml.1 head/contrib/libxo/xohtml/xohtml.sh.in head/contrib/libxo/xolint/xolint.1 head/contrib/libxo/xopo/xopo.1 head/lib/libxo/add.man head/lib/libxo/xo_config.h head/usr.bin/xohtml/xohtml.sh Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/Makefile.am == --- head/contrib/libxo/Makefile.am Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/Makefile.am Thu Aug 3 15:47:42 2017 (r322019) @@ -38,7 +38,14 @@ GH_PAGES_DIR = gh-pages/ GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION} PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz -upload: dist upload-docs +XOHTML_FILES = \ +${top_srcdir}/xohtml/xohtml.css \ +${top_srcdir}/xohtml/xohtml.js \ +${top_srcdir}/xohtml/external/jquery.js \ +${top_srcdir}/xohtml/external/jquery.qtip.css \ +${top_srcdir}/xohtml/external/jquery.qtip.js + +upload: dist upload-docs upload-xohtml-files @echo "Remember to run:" @echo "gt tag ${PACKAGE_VERSION}" @@ -54,6 +61,18 @@ upload-docs: docs && git add libxo-manual.html \ && git commit -m 'new docs' \
svn commit: r322018 - vendor/Juniper/libxo/0.8.4
Author: phil Date: Thu Aug 3 15:43:29 2017 New Revision: 322018 URL: https://svnweb.freebsd.org/changeset/base/322018 Log: Tag libxo 0.8.4 Added: - copied from r322017, vendor/Juniper/libxo/dist/ Directory Properties: vendor/Juniper/libxo/0.8.4/ (props changed) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322017 - in vendor/Juniper/libxo/dist: . doc libxo tests/core tests/core/saved tests/xo tests/xo/saved xo xohtml xolint xopo
Author: phil Date: Thu Aug 3 15:43:14 2017 New Revision: 322017 URL: https://svnweb.freebsd.org/changeset/base/322017 Log: Import libxo 0.8.4 Modified: vendor/Juniper/libxo/dist/Makefile.am vendor/Juniper/libxo/dist/configure.ac vendor/Juniper/libxo/dist/doc/libxo-manual.html vendor/Juniper/libxo/dist/libxo/libxo.3 vendor/Juniper/libxo/dist/libxo/libxo.c vendor/Juniper/libxo/dist/libxo/xo_attr.3 vendor/Juniper/libxo/dist/libxo/xo_create.3 vendor/Juniper/libxo/dist/libxo/xo_emit.3 vendor/Juniper/libxo/dist/libxo/xo_emit_err.3 vendor/Juniper/libxo/dist/libxo/xo_emit_f.3 vendor/Juniper/libxo/dist/libxo/xo_err.3 vendor/Juniper/libxo/dist/libxo/xo_error.3 vendor/Juniper/libxo/dist/libxo/xo_finish.3 vendor/Juniper/libxo/dist/libxo/xo_flush.3 vendor/Juniper/libxo/dist/libxo/xo_format.5 vendor/Juniper/libxo/dist/libxo/xo_message.3 vendor/Juniper/libxo/dist/libxo/xo_no_setlocale.3 vendor/Juniper/libxo/dist/libxo/xo_open_container.3 vendor/Juniper/libxo/dist/libxo/xo_open_list.3 vendor/Juniper/libxo/dist/libxo/xo_open_marker.3 vendor/Juniper/libxo/dist/libxo/xo_options.7 vendor/Juniper/libxo/dist/libxo/xo_parse_args.3 vendor/Juniper/libxo/dist/libxo/xo_set_allocator.3 vendor/Juniper/libxo/dist/libxo/xo_set_flags.3 vendor/Juniper/libxo/dist/libxo/xo_set_info.3 vendor/Juniper/libxo/dist/libxo/xo_set_options.3 vendor/Juniper/libxo/dist/libxo/xo_set_style.3 vendor/Juniper/libxo/dist/libxo/xo_set_syslog_enterprise_id.3 vendor/Juniper/libxo/dist/libxo/xo_set_version.3 vendor/Juniper/libxo/dist/libxo/xo_set_writer.3 vendor/Juniper/libxo/dist/libxo/xo_syslog.3 vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out vendor/Juniper/libxo/dist/tests/core/test_01.c vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.H.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HIPx.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HP.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.J.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.JP.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.T.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.X.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.XP.out vendor/Juniper/libxo/dist/tests/xo/xo_01.sh vendor/Juniper/libxo/dist/xo/xo.1 vendor/Juniper/libxo/dist/xohtml/xohtml.1 vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in vendor/Juniper/libxo/dist/xolint/xolint.1 vendor/Juniper/libxo/dist/xopo/xopo.1 Modified: vendor/Juniper/libxo/dist/Makefile.am == --- vendor/Juniper/libxo/dist/Makefile.am Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/Makefile.am Thu Aug 3 15:43:14 2017 (r322017) @@ -38,7 +38,14 @@ GH_PAGES_DIR = gh-pages/ GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION} PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz -upload: dist upload-docs +XOHTML_FILES = \ +${top_srcdir}/xohtml/xohtml.css \ +${top_srcdir}/xohtml/xohtml.js \ +${top_srcdir}/xohtml/external/jquery.js \ +${top_srcdir}/xohtml/external/jquery.qtip.css \ +${top_srcdir}/xohtml/external/jquery.qtip.js + +upload: dist upload-docs upload-xohtml-files @echo "Remember to run:" @echo "gt tag ${PACKAGE_VERSION}" @@ -54,6 +61,18 @@ upload-docs: docs && git add libxo-manual.html \ && git commit -m 'new docs' \ libxo-manual.html ${PACKAGE_VERSION} \ + && git push origin gh-pages ) ; true + +upload-xohtml-files: + @echo "Uploading xohtml files ... " + @-[ -d ${GH_PAGES_DIR} ] \ + && echo "Updating xohtml files on gh-pages ..." \ + && mkdir -p ${GH_PAGES_DIR_VER}/xohtml \ + && cp ${XOHTML_FILES} ${GH_PAGES_DIR_VER}/xohtml \ + && (cd ${GH_PAGES_DIR} \ + && git add ${PACKAGE_VERSION}/xohtml \ + && git commit -m 'new xohtml files' \ + ${PACKAGE_VERSION}/xohtml \ && git push origin gh-pages ) ; true pkgconfigdir=$(libdir)/pkgconfig Modified: ve
svn commit: r322016 - head/usr.bin/mt
Author: ken Date: Thu Aug 3 15:04:54 2017 New Revision: 322016 URL: https://svnweb.freebsd.org/changeset/base/322016 Log: Oracle T1 tape drives use PRML encoding. Source: Oracle T1 SCSI reference guide. MFC after:3 days Sponsored by: Spectra Logic Modified: head/usr.bin/mt/mt.1 Modified: head/usr.bin/mt/mt.1 == --- head/usr.bin/mt/mt.1Thu Aug 3 14:43:41 2017(r322015) +++ head/usr.bin/mt/mt.1Thu Aug 3 15:04:54 2017(r322016) @@ -29,7 +29,7 @@ .\"@(#)mt.18.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 14, 2017 +.Dd August 3, 2017 .Dt MT 1 .Os .Sh NAME @@ -509,10 +509,10 @@ Value WidthTracksDensity Code Typ 0x473.81 (0.25) ? 6,417 (163,000) CS DAT-72 0x48 12.7 (0.5) 448 5,236 (133,000) PRML C SDLTapeI(110) 6,8,13 0x49 12.7 (0.5) 448 7,598 (193,000) PRML C SDLTapeI(160) 6,8 -0x4A 12.7 (0.5) 768 ? C T1A 10 -0x4B 12.7 (0.5) 1152 ? C T1B 10 -0x4C 12.7 (0.5) 3584 ? C T1C 10 -0x4D 12.7 (0.5) 4608 ? C T1D 10 +0x4A 12.7 (0.5) 768 ?PRML C T1A 10 +0x4B 12.7 (0.5) 1152 ?PRML C T1B 10 +0x4C 12.7 (0.5) 3584 ?PRML C T1C 10 +0x4D 12.7 (0.5) 4608 ?PRML C T1D 10 0x51 12.7 (0.5) 512 11,800 (299,720) C 3592A1 (unencrypted) 0x52 12.7 (0.5) 896 11,800 (299,720) C 3592A2 (unencrypted) 0x53 12.7 (0.5) 1152 13,452 (341,681) C 3592A3 (unencrypted) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core
Hey Hans, Is it not important that the subtraction and result are evaluated without truncation? Thanks, Conrad On Thu, Aug 3, 2017 at 2:18 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Aug 3 09:18:25 2017 > New Revision: 321985 > URL: https://svnweb.freebsd.org/changeset/base/321985 > > Log: > Ticks are 32-bit in FreeBSD. > > MFC after:3 days > Sponsored by: Mellanox Technologies > > Modified: > head/sys/ofed/drivers/infiniband/core/addr.c > > Modified: head/sys/ofed/drivers/infiniband/core/addr.c > == > --- head/sys/ofed/drivers/infiniband/core/addr.cThu Aug 3 09:14:43 > 2017(r321984) > +++ head/sys/ofed/drivers/infiniband/core/addr.cThu Aug 3 09:18:25 > 2017(r321985) > @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); > > static void set_timeout(unsigned long time) > { > - unsigned long delay; > + int delay; /* under FreeBSD ticks are 32-bit */ > > delay = time - jiffies; > - if ((long)delay <= 0) > + if (delay <= 0) > delay = 1; > > mod_delayed_work(addr_wq, &work, delay); > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322015 - in head/sys/arm: conf freescale/imx
Author: ian Date: Thu Aug 3 14:43:41 2017 New Revision: 322015 URL: https://svnweb.freebsd.org/changeset/base/322015 Log: Add an ahci driver for imx6. This was submitted by Rogiel Sulzbach (thank you!) but has a few last-minute changes by me, mostly where the code interfaces to my still-utterly-deficient imx6_ccm clocks implementation. So blame me for any mistakes. Submitted by: Rogiel Sulzbach Differential Revision:https://reviews.freebsd.org/D11177 Added: head/sys/arm/freescale/imx/imx6_ahci.c (contents, props changed) Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h head/sys/arm/freescale/imx/imx_ccmvar.h head/sys/arm/freescale/imx/imx_iomuxreg.h Modified: head/sys/arm/conf/IMX6 == --- head/sys/arm/conf/IMX6 Thu Aug 3 14:43:30 2017(r322014) +++ head/sys/arm/conf/IMX6 Thu Aug 3 14:43:41 2017(r322015) @@ -78,6 +78,9 @@ deviceda # Direct Access (disks) device cd # CD device pass# Passthrough device (direct ATA/SCSI access) +# ATA controllers +device ahci# AHCI-compatible SATA controllers + # USB support device ehci# OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/freescale/imx/files.imx6 == --- head/sys/arm/freescale/imx/files.imx6 Thu Aug 3 14:43:30 2017 (r322014) +++ head/sys/arm/freescale/imx/files.imx6 Thu Aug 3 14:43:41 2017 (r322015) @@ -25,6 +25,7 @@ arm/freescale/imx/imx_i2c.c optional fsliic arm/freescale/imx/imx6_sdma.c optional sdma arm/freescale/imx/imx6_audmux.coptional sound arm/freescale/imx/imx6_ssi.c optional sound +arm/freescale/imx/imx6_ahci.c optional ahci dev/hdmi/hdmi_if.m optional hdmi dev/hdmi/dwc_hdmi.coptional hdmi Added: head/sys/arm/freescale/imx/imx6_ahci.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_ahci.c Thu Aug 3 14:43:41 2017 (r322015) @@ -0,0 +1,358 @@ +/*- + * Copyright (c) 2017 Rogiel Sulzbach + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#defineSATA_TIMER1MS 0x00e0 + +#defineSATA_P0PHYCR0x0178 +#define SATA_P0PHYCR_CR_READ(1 << 19) +#define SATA_P0PHYCR_CR_WRITE (1 << 18) +#define SATA_P0PHYCR_CR_CAP_DATA(1 << 17) +#define SATA_P0PHYCR_CR_CAP_ADDR(1 << 16) +#define SATA_P0PHYCR_CR_DATA_IN(v) ((v) & 0x) + +#defineSATA_P0PHYSR0x017c +#define SATA_P0PHYSR_CR_ACK (1 << 18) +#define SATA_P0PHYSR_CR_DATA_OUT(v) ((v) & 0x) + +/* phy registers */ +#defineSATA_PHY_CLOCK_RESET0x7f3f +#define SATA_PHY_CLOCK_RESET_RST(1 << 0) + +#defineSATA_PHY_L
svn commit: r322014 - in head: sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/cudbg sys/modules/cxgbe/if_cxgbe usr.sbin/cxgbetool
Author: np Date: Thu Aug 3 14:43:30 2017 New Revision: 322014 URL: https://svnweb.freebsd.org/changeset/base/322014 Log: cxgbe(4): Initial import of the "collect" component of Chelsio unified debug (cudbg) code, hooked up to the main driver via an ioctl. The ioctl can be used to collect the chip's internal state in a compressed dump file. These dumps can be decoded with the "view" component of cudbg. Obtained from:Chelsio Communications MFC after:2 months Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/cudbg/ head/sys/dev/cxgbe/cudbg/cudbg.h (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_common.c (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_entity.h (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_flash_utils.c (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_lib.c (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_lib.h (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_lib_common.h (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_wtp.c (contents, props changed) head/sys/dev/cxgbe/cudbg/fastlz.c (contents, props changed) head/sys/dev/cxgbe/cudbg/fastlz.h (contents, props changed) head/sys/dev/cxgbe/cudbg/fastlz_api.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/cxgbe/common/t4_hw.h head/sys/dev/cxgbe/t4_ioctl.h head/sys/dev/cxgbe/t4_main.c head/sys/modules/cxgbe/if_cxgbe/Makefile head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/sys/conf/files == --- head/sys/conf/files Thu Aug 3 14:35:02 2017(r322013) +++ head/sys/conf/files Thu Aug 3 14:43:30 2017(r322014) @@ -1352,6 +1352,18 @@ dev/cxgbe/common/t4_hw.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/common/t4vf_hw.c optional cxgbev pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_common.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_flash_utils.coptional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_lib.coptional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_wtp.coptional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/fastlz.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/fastlz_api.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" t4fw_cfg.c optional cxgbe \ compile-with"${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local\ Modified: head/sys/dev/cxgbe/common/t4_hw.h == --- head/sys/dev/cxgbe/common/t4_hw.h Thu Aug 3 14:35:02 2017 (r322013) +++ head/sys/dev/cxgbe/common/t4_hw.h Thu Aug 3 14:43:30 2017 (r322014) @@ -276,8 +276,17 @@ enum { FLASH_MIN_SIZE = FLASH_CFG_START + FLASH_CFG_MAX_SIZE, /* -* Sectors 32-63 are reserved for FLASH failover. +* Sectors 32-63 for CUDBG. */ + FLASH_CUDBG_START_SEC = 32, + FLASH_CUDBG_NSECS = 32, + FLASH_CUDBG_START = FLASH_START(FLASH_CUDBG_START_SEC), + FLASH_CUDBG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CUDBG_NSECS), + + /* +* Size of defined FLASH regions. +*/ + FLASH_END_SEC = 64, }; #undef FLASH_START Added: head/sys/dev/cxgbe/cudbg/cudbg.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/cudbg/cudbg.hThu Aug 3 14:43:30 2017 (r322014) @@ -0,0 +1,474 @@ +/*- + * Copyright (c) 2017 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +
svn commit: r322013 - head/usr.bin/cut
Author: sevan (doc committer) Date: Thu Aug 3 14:35:02 2017 New Revision: 322013 URL: https://svnweb.freebsd.org/changeset/base/322013 Log: Document -w flag is an extension to POSIX. PR: 201937 Submitted by: Approved by: bcr (mentor) Differential Revision:https://reviews.freebsd.org/D11842 Modified: head/usr.bin/cut/cut.1 Modified: head/usr.bin/cut/cut.1 == --- head/usr.bin/cut/cut.1 Thu Aug 3 14:22:48 2017(r322012) +++ head/usr.bin/cut/cut.1 Thu Aug 3 14:35:02 2017(r322013) @@ -31,7 +31,7 @@ .\" @(#)cut.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 8, 2012 +.Dd August 3, 2017 .Dt CUT 1 .Os .Sh NAME @@ -154,6 +154,10 @@ The .Nm utility conforms to .St -p1003.2-92 . +.Pp +The +.Fl w +flag is an extension to the specification. .Sh HISTORY A .Nm ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322012 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter
Author: cy Date: Thu Aug 3 14:22:48 2017 New Revision: 322012 URL: https://svnweb.freebsd.org/changeset/base/322012 Log: MFC r321605: As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. (This implementation of arc4rand(9) is used by the userland ipftest utility as it approximates ipfilter kernelspace in userspace.) PR: 217920 Submitted by: codar...@hackers.mu Reviewed by: emaste, cem Approved by: so (implicit, in r315225) Differential Revision:D11747 Patterned after: r315225 Modified: stable/10/contrib/ipfilter/arc4random.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/arc4random.c Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/ipfilter/arc4random.c == --- stable/10/contrib/ipfilter/arc4random.c Thu Aug 3 14:20:19 2017 (r322011) +++ stable/10/contrib/ipfilter/arc4random.c Thu Aug 3 14:22:48 2017 (r322012) @@ -109,9 +109,9 @@ arc4_randomstir (void) /* * Throw away the first N words of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" -* by Fluher, Mantin, and Shamir. (N = 256 in our case.) +* by Fluher, Mantin, and Shamir. (N = 768 in our case.) */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); MUTEX_EXIT(&arc4_mtx); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322012 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter
Author: cy Date: Thu Aug 3 14:22:48 2017 New Revision: 322012 URL: https://svnweb.freebsd.org/changeset/base/322012 Log: MFC r321605: As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. (This implementation of arc4rand(9) is used by the userland ipftest utility as it approximates ipfilter kernelspace in userspace.) PR: 217920 Submitted by: codar...@hackers.mu Reviewed by: emaste, cem Approved by: so (implicit, in r315225) Differential Revision:D11747 Patterned after: r315225 Modified: stable/11/contrib/ipfilter/arc4random.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/arc4random.c Directory Properties: stable/10/ (props changed) Modified: stable/11/contrib/ipfilter/arc4random.c == --- stable/11/contrib/ipfilter/arc4random.c Thu Aug 3 14:20:19 2017 (r322011) +++ stable/11/contrib/ipfilter/arc4random.c Thu Aug 3 14:22:48 2017 (r322012) @@ -109,9 +109,9 @@ arc4_randomstir (void) /* * Throw away the first N words of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" -* by Fluher, Mantin, and Shamir. (N = 256 in our case.) +* by Fluher, Mantin, and Shamir. (N = 768 in our case.) */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); MUTEX_EXIT(&arc4_mtx); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322011 - stable/10/sys/dev/mlx5
Author: hselasky Date: Thu Aug 3 14:20:19 2017 New Revision: 322011 URL: https://svnweb.freebsd.org/changeset/base/322011 Log: MFC r312983: Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry structure. This fixes compilation with amd64-xtoolchain-gcc. PR: 216588 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/diagnostics.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/diagnostics.h == --- stable/10/sys/dev/mlx5/diagnostics.hThu Aug 3 14:19:26 2017 (r322010) +++ stable/10/sys/dev/mlx5/diagnostics.hThu Aug 3 14:20:19 2017 (r322011) @@ -33,7 +33,7 @@ #defineMLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, struct mlx5_core_diagnostics_entry { - const char *const desc; + const char *desc; u16 counter_id; }; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322010 - stable/11/sys/dev/mlx5
Author: hselasky Date: Thu Aug 3 14:19:26 2017 New Revision: 322010 URL: https://svnweb.freebsd.org/changeset/base/322010 Log: MFC r312983: Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry structure. This fixes compilation with amd64-xtoolchain-gcc. PR: 216588 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/diagnostics.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/diagnostics.h == --- stable/11/sys/dev/mlx5/diagnostics.hThu Aug 3 14:17:25 2017 (r322009) +++ stable/11/sys/dev/mlx5/diagnostics.hThu Aug 3 14:19:26 2017 (r322010) @@ -33,7 +33,7 @@ #defineMLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, struct mlx5_core_diagnostics_entry { - const char *const desc; + const char *desc; u16 counter_id; }; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322009 - in stable/10/sys/dev/mlx5: . mlx5_core
Author: hselasky Date: Thu Aug 3 14:17:25 2017 New Revision: 322009 URL: https://svnweb.freebsd.org/changeset/base/322009 Log: MFC r312876: Use ffs() to scan for first bit instead of using a for() loop. Minor code refactor while at it. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/driver.h == --- stable/10/sys/dev/mlx5/driver.h Thu Aug 3 14:16:31 2017 (r322008) +++ stable/10/sys/dev/mlx5/driver.h Thu Aug 3 14:17:25 2017 (r322009) @@ -859,7 +859,7 @@ void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type); void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector); +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, int nent, u64 mask, const char *name, struct mlx5_uar *uar); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c == --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:16:31 2017 (r322008) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:17:25 2017 (r322009) @@ -760,7 +760,7 @@ static void cmd_work_handler(struct work_struct *work) poll_timeout(ent); /* make sure we read the descriptor after ownership is SW */ rmb(); - mlx5_cmd_comp_handler(dev, 1UL << ent->idx); + mlx5_cmd_comp_handler(dev, 1U << ent->idx); } } @@ -1104,7 +1104,7 @@ static void free_msg(struct mlx5_core_dev *dev, struct } } -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector) { struct mlx5_cmd *cmd = &dev->cmd; struct mlx5_cmd_work_ent *ent; @@ -1112,60 +1112,63 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, void *context; int err; int i; + struct semaphore *sem; s64 ds; struct mlx5_cmd_stats *stats; unsigned long flags; - for (i = 0; i < (1 << cmd->log_sz); i++) { - if (test_bit(i, &vector)) { - struct semaphore *sem; - - ent = cmd->ent_arr[i]; - if (ent->page_queue) - sem = &cmd->pages_sem; + while (vector != 0) { + i = ffs(vector) - 1; + vector &= ~(1U << i); + ent = cmd->ent_arr[i]; + if (ent->page_queue) + sem = &cmd->pages_sem; + else + sem = &cmd->sem; + ent->ts2 = ktime_get_ns(); + memcpy(ent->out->first.data, ent->lay->out, + sizeof(ent->lay->out)); + dump_command(dev, ent, 0); + if (!ent->ret) { + if (!cmd->checksum_disabled) + ent->ret = verify_signature(ent); else - sem = &cmd->sem; - ent->ts2 = ktime_get_ns(); - memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); - dump_command(dev, ent, 0); - if (!ent->ret) { - if (!cmd->checksum_disabled) - ent->ret = verify_signature(ent); - else - ent->ret = 0; - ent->status = ent->lay->status_own >> 1; - mlx5_core_dbg(dev, "command completed. ret 0x%x, delivery status %s(0x%x)\n", - ent->ret, deliv_status_to_str(ent->status), ent->status); + ent->ret = 0; + ent->status = ent->lay->status_own >> 1; + mlx5_core_dbg(dev, + "FW command ret 0x%x, status %s(0x%x)\n", + ent->ret, + deliv_status_to_str(ent->status), + ent->status); + } + free_ent(cmd, ent->idx); + if (ent->callback) { + ds = ent->ts2 - ent->ts1; + if (ent->op < ARRAY_S
svn commit: r322008 - in stable/11/sys/dev/mlx5: . mlx5_core
Author: hselasky Date: Thu Aug 3 14:16:31 2017 New Revision: 322008 URL: https://svnweb.freebsd.org/changeset/base/322008 Log: MFC r312876: Use ffs() to scan for first bit instead of using a for() loop. Minor code refactor while at it. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h == --- stable/11/sys/dev/mlx5/driver.h Thu Aug 3 14:14:13 2017 (r322007) +++ stable/11/sys/dev/mlx5/driver.h Thu Aug 3 14:16:31 2017 (r322008) @@ -859,7 +859,7 @@ void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type); void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector); +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, int nent, u64 mask, const char *name, struct mlx5_uar *uar); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c == --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:14:13 2017 (r322007) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:16:31 2017 (r322008) @@ -760,7 +760,7 @@ static void cmd_work_handler(struct work_struct *work) poll_timeout(ent); /* make sure we read the descriptor after ownership is SW */ rmb(); - mlx5_cmd_comp_handler(dev, 1UL << ent->idx); + mlx5_cmd_comp_handler(dev, 1U << ent->idx); } } @@ -1104,7 +1104,7 @@ static void free_msg(struct mlx5_core_dev *dev, struct } } -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector) { struct mlx5_cmd *cmd = &dev->cmd; struct mlx5_cmd_work_ent *ent; @@ -1112,60 +1112,63 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, void *context; int err; int i; + struct semaphore *sem; s64 ds; struct mlx5_cmd_stats *stats; unsigned long flags; - for (i = 0; i < (1 << cmd->log_sz); i++) { - if (test_bit(i, &vector)) { - struct semaphore *sem; - - ent = cmd->ent_arr[i]; - if (ent->page_queue) - sem = &cmd->pages_sem; + while (vector != 0) { + i = ffs(vector) - 1; + vector &= ~(1U << i); + ent = cmd->ent_arr[i]; + if (ent->page_queue) + sem = &cmd->pages_sem; + else + sem = &cmd->sem; + ent->ts2 = ktime_get_ns(); + memcpy(ent->out->first.data, ent->lay->out, + sizeof(ent->lay->out)); + dump_command(dev, ent, 0); + if (!ent->ret) { + if (!cmd->checksum_disabled) + ent->ret = verify_signature(ent); else - sem = &cmd->sem; - ent->ts2 = ktime_get_ns(); - memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); - dump_command(dev, ent, 0); - if (!ent->ret) { - if (!cmd->checksum_disabled) - ent->ret = verify_signature(ent); - else - ent->ret = 0; - ent->status = ent->lay->status_own >> 1; - mlx5_core_dbg(dev, "command completed. ret 0x%x, delivery status %s(0x%x)\n", - ent->ret, deliv_status_to_str(ent->status), ent->status); + ent->ret = 0; + ent->status = ent->lay->status_own >> 1; + mlx5_core_dbg(dev, + "FW command ret 0x%x, status %s(0x%x)\n", + ent->ret, + deliv_status_to_str(ent->status), + ent->status); + } + free_ent(cmd, ent->idx); + if (ent->callback) { + ds = ent->ts2 - ent->ts1; + if (ent->op < ARRAY_S
svn commit: r322007 - in stable/10/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5
Author: hselasky Date: Thu Aug 3 14:14:13 2017 New Revision: 322007 URL: https://svnweb.freebsd.org/changeset/base/322007 Log: MFC r312872: Add support for reading advanced diagnostic counters. By default reading the diagnostic counters is disabled. The firmware decides which counters are supported and only those supported show up in the dev.mce.X.diagnostics sysctl tree. To enable reading of diagnostic counters set one or more of the following sysctls to one: dev.mce.X.conf.diag_general_enable=1 dev.mce.X.conf.diag_pci_enable=1 Sponsored by: Mellanox Technologies Added: stable/10/sys/dev/mlx5/diagnostics.h - copied unchanged from r312872, head/sys/dev/mlx5/diagnostics.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c - copied unchanged from r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Modified: stable/10/sys/conf/files stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/modules/mlx5/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files == --- stable/10/sys/conf/filesThu Aug 3 14:12:23 2017(r322006) +++ stable/10/sys/conf/filesThu Aug 3 14:14:13 2017(r322007) @@ -3939,6 +3939,8 @@ dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_flow_table.c optional mlx5 pci \ Copied: stable/10/sys/dev/mlx5/diagnostics.h (from r312872, head/sys/dev/mlx5/diagnostics.h) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/mlx5/diagnostics.hThu Aug 3 14:14:13 2017 (r322007, copy of r312872, head/sys/dev/mlx5/diagnostics.h) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef MLX5_CORE_DIAGNOSTICS_H +#defineMLX5_CORE_DIAGNOSTICS_H + +#defineMLX5_CORE_DIAGNOSTICS_NUM(n, s, t) n +#defineMLX5_CORE_DIAGNOSTICS_STRUCT(n, s, t) s, +#defineMLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, + +struct mlx5_core_diagnostics_entry { + const char *const desc; + u16 counter_id; +}; + +#defineMLX5_CORE_PCI_DIAGNOSTICS(m) \ +m(+1, pxd_ready_bp, 0x0401) \ +m(+1, pci_write_bp, 0x0402) \ +m(+1, pci_read_bp, 0x0403) \ +m(+1, pci_read_stuck_no_completion_buffer, 0x0404) \ +m(+1, max_pci_bw, 0x0405) \ +m(+1, used_pci_bw, 0x0406) \ +m(+1, rx_pci_errors, 0) \ +m(+1, tx_pci_errors, 0) \ +m(+1, tx_pci_correctable_errors, 0) \ +m(+1, tx_pci_non_fatal_errors, 0) \ +m(+1, tx_pci_fatal_errors, 0) + +#defineMLX5_CORE_PCI_DIAGNOSTICS_NUM \ + (0 MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM)) + +union mlx5_core_pci_diagnostics { + u64 array[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + struct { + u64 MLX5_CORE_PCI_DIAGNOSTICS( + MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0]; + } counter; +}; + +extern const struct mlx5_core_diagnostics_entry + mlx5_core_pci_diagnostics_table[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + +#d
svn commit: r322006 - in stable/11/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5
Author: hselasky Date: Thu Aug 3 14:12:23 2017 New Revision: 322006 URL: https://svnweb.freebsd.org/changeset/base/322006 Log: MFC r312872: Add support for reading advanced diagnostic counters. By default reading the diagnostic counters is disabled. The firmware decides which counters are supported and only those supported show up in the dev.mce.X.diagnostics sysctl tree. To enable reading of diagnostic counters set one or more of the following sysctls to one: dev.mce.X.conf.diag_general_enable=1 dev.mce.X.conf.diag_pci_enable=1 Sponsored by: Mellanox Technologies Added: stable/11/sys/dev/mlx5/diagnostics.h - copied unchanged from r312872, head/sys/dev/mlx5/diagnostics.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c - copied unchanged from r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Modified: stable/11/sys/conf/files stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/modules/mlx5/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files == --- stable/11/sys/conf/filesThu Aug 3 14:09:36 2017(r322005) +++ stable/11/sys/conf/filesThu Aug 3 14:12:23 2017(r322006) @@ -4288,6 +4288,8 @@ dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_flow_table.c optional mlx5 pci \ Copied: stable/11/sys/dev/mlx5/diagnostics.h (from r312872, head/sys/dev/mlx5/diagnostics.h) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/mlx5/diagnostics.hThu Aug 3 14:12:23 2017 (r322006, copy of r312872, head/sys/dev/mlx5/diagnostics.h) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef MLX5_CORE_DIAGNOSTICS_H +#defineMLX5_CORE_DIAGNOSTICS_H + +#defineMLX5_CORE_DIAGNOSTICS_NUM(n, s, t) n +#defineMLX5_CORE_DIAGNOSTICS_STRUCT(n, s, t) s, +#defineMLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, + +struct mlx5_core_diagnostics_entry { + const char *const desc; + u16 counter_id; +}; + +#defineMLX5_CORE_PCI_DIAGNOSTICS(m) \ +m(+1, pxd_ready_bp, 0x0401) \ +m(+1, pci_write_bp, 0x0402) \ +m(+1, pci_read_bp, 0x0403) \ +m(+1, pci_read_stuck_no_completion_buffer, 0x0404) \ +m(+1, max_pci_bw, 0x0405) \ +m(+1, used_pci_bw, 0x0406) \ +m(+1, rx_pci_errors, 0) \ +m(+1, tx_pci_errors, 0) \ +m(+1, tx_pci_correctable_errors, 0) \ +m(+1, tx_pci_non_fatal_errors, 0) \ +m(+1, tx_pci_fatal_errors, 0) + +#defineMLX5_CORE_PCI_DIAGNOSTICS_NUM \ + (0 MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM)) + +union mlx5_core_pci_diagnostics { + u64 array[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + struct { + u64 MLX5_CORE_PCI_DIAGNOSTICS( + MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0]; + } counter; +}; + +extern const struct mlx5_core_diagnostics_entry + mlx5_core_pci_diagnostics_table[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + +#d
svn commit: r322005 - stable/10/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Thu Aug 3 14:09:36 2017 New Revision: 322005 URL: https://svnweb.freebsd.org/changeset/base/322005 Log: MFC r312865: Enforce reading the consumer and producer counters once to ensure consistent return values from the mlx5e_sq_has_room_for() function. The two counters are incremented by different threads under different locks. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h == --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:08:39 2017 (r322004) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:09:36 2017 (r322005) @@ -556,8 +556,10 @@ struct mlx5e_sq { static inline bool mlx5e_sq_has_room_for(struct mlx5e_sq *sq, u16 n) { - return ((sq->wq.sz_m1 & (sq->cc - sq->pc)) >= n || - sq->cc == sq->pc); + u16 cc = sq->cc; + u16 pc = sq->pc; + + return ((sq->wq.sz_m1 & (cc - pc)) >= n || cc == pc); } struct mlx5e_channel { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322003 - stable/11/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Thu Aug 3 14:08:37 2017 New Revision: 322003 URL: https://svnweb.freebsd.org/changeset/base/322003 Log: MFC r312865: Enforce reading the consumer and producer counters once to ensure consistent return values from the mlx5e_sq_has_room_for() function. The two counters are incremented by different threads under different locks. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h == --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:07:14 2017 (r322002) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:08:37 2017 (r322003) @@ -546,8 +546,10 @@ struct mlx5e_sq { static inline bool mlx5e_sq_has_room_for(struct mlx5e_sq *sq, u16 n) { - return ((sq->wq.sz_m1 & (sq->cc - sq->pc)) >= n || - sq->cc == sq->pc); + u16 cc = sq->cc; + u16 pc = sq->pc; + + return ((sq->wq.sz_m1 & (cc - pc)) >= n || cc == pc); } struct mlx5e_channel { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322002 - stable/10/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Thu Aug 3 14:07:14 2017 New Revision: 322002 URL: https://svnweb.freebsd.org/changeset/base/322002 Log: MFC r312537: Remove superfluous return statement. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c == --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:06:22 2017(r322001) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:07:14 2017(r322002) @@ -1212,7 +1212,6 @@ done: mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); sq->doorbell.d64 = 0; } - return; } void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322001 - stable/11/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Thu Aug 3 14:06:22 2017 New Revision: 322001 URL: https://svnweb.freebsd.org/changeset/base/322001 Log: MFC r312537: Remove superfluous return statement. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c == --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:05:03 2017(r322000) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:06:22 2017(r322001) @@ -1205,7 +1205,6 @@ done: mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); sq->doorbell.d64 = 0; } - return; } void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r322000 - stable/10/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Thu Aug 3 14:05:03 2017 New Revision: 322000 URL: https://svnweb.freebsd.org/changeset/base/322000 Log: MFC r312536: Allow transmit packet bufring in software to be disabled. - Add new sysctl node to control the transmit packet bufring. - Add optimised version of the transmit routine which output packets directly to the DMA ring instead of using bufring in case the transmit lock is congested. This can reduce the number of taskswitches which in turn influence the overall system CPU usage, depending on the workload. - Add " TX" suffix to debug name for transmit mutexes to silence some witness warnings about aquiring duplicate locks having same name. Sponsored by: Mellanox Technologies Suggested by: gallatin @ Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h == --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:05:03 2017 (r322000) @@ -408,6 +408,7 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 tx_bufring_disable, "tx_bufring_disable", "0: Enable bufring 1: Disable bufring") \ m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c == --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.cThu Aug 3 14:03:48 2017(r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.cThu Aug 3 14:05:03 2017(r322000) @@ -352,6 +352,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(tx_bufring_disable): + /* rangecheck input value */ + priv->params_ethtool.tx_bufring_disable = + priv->params_ethtool.tx_bufring_disable ? 1 : 0; + + /* reconfigure the sendqueues, if any */ + if (was_opened) { + mlx5e_close_locked(priv->ifp); + mlx5e_open_locked(priv->ifp); + } + break; + case MLX5_PARAM_OFFSET(tx_completion_fact): /* network interface must be down */ if (was_opened) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c == --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:03:48 2017(r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:05:03 2017(r322000) @@ -439,7 +439,8 @@ mlx5e_update_stats_work(struct work_struct *work) tso_packets += sq_stats->tso_packets; tso_bytes += sq_stats->tso_bytes; tx_queue_dropped += sq_stats->dropped; - tx_queue_dropped += sq_br->br_drops; + if (sq_br != NULL) + tx_queue_dropped += sq_br->br_drops; tx_defragged += sq_stats->defragged; tx_offload_none += sq_stats->csum_offload_none; } @@ -1008,34 +1009,37 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->priv = priv; sq->tc = tc; - sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, - M_WAITOK, &sq->lock); - if (sq->br == NULL) { - if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", - __func__); - err = -ENOMEM; - goto err_free_sq_db; - } + /* check if we should allocate a second packet buffer */ + if (priv->params_ethtool.tx_bufring_disable == 0) { + sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, + M_WAITOK, &sq->lock); + if (sq->br == NULL) { + if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", + __func__); + err = -ENOMEM; + goto err_free_sq_db; + } - sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, -
svn commit: r321999 - stable/11/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Thu Aug 3 14:03:48 2017 New Revision: 321999 URL: https://svnweb.freebsd.org/changeset/base/321999 Log: MFC r312536: Allow transmit packet bufring in software to be disabled. - Add new sysctl node to control the transmit packet bufring. - Add optimised version of the transmit routine which output packets directly to the DMA ring instead of using bufring in case the transmit lock is congested. This can reduce the number of taskswitches which in turn influence the overall system CPU usage, depending on the workload. - Add " TX" suffix to debug name for transmit mutexes to silence some witness warnings about aquiring duplicate locks having same name. Sponsored by: Mellanox Technologies Suggested by: gallatin @ Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h == --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:01:25 2017 (r321998) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:03:48 2017 (r321999) @@ -402,6 +402,7 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 tx_bufring_disable, "tx_bufring_disable", "0: Enable bufring 1: Disable bufring") \ m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c == --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.cThu Aug 3 14:01:25 2017(r321998) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.cThu Aug 3 14:03:48 2017(r321999) @@ -352,6 +352,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(tx_bufring_disable): + /* rangecheck input value */ + priv->params_ethtool.tx_bufring_disable = + priv->params_ethtool.tx_bufring_disable ? 1 : 0; + + /* reconfigure the sendqueues, if any */ + if (was_opened) { + mlx5e_close_locked(priv->ifp); + mlx5e_open_locked(priv->ifp); + } + break; + case MLX5_PARAM_OFFSET(tx_completion_fact): /* network interface must be down */ if (was_opened) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c == --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:01:25 2017(r321998) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:03:48 2017(r321999) @@ -439,7 +439,8 @@ mlx5e_update_stats_work(struct work_struct *work) tso_packets += sq_stats->tso_packets; tso_bytes += sq_stats->tso_bytes; tx_queue_dropped += sq_stats->dropped; - tx_queue_dropped += sq_br->br_drops; + if (sq_br != NULL) + tx_queue_dropped += sq_br->br_drops; tx_defragged += sq_stats->defragged; tx_offload_none += sq_stats->csum_offload_none; } @@ -1001,34 +1002,37 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->priv = priv; sq->tc = tc; - sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, - M_WAITOK, &sq->lock); - if (sq->br == NULL) { - if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", - __func__); - err = -ENOMEM; - goto err_free_sq_db; - } + /* check if we should allocate a second packet buffer */ + if (priv->params_ethtool.tx_bufring_disable == 0) { + sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, + M_WAITOK, &sq->lock); + if (sq->br == NULL) { + if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", + __func__); + err = -ENOMEM; + goto err_free_sq_db; + } - sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, -
svn commit: r321998 - stable/10/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Thu Aug 3 14:01:25 2017 New Revision: 321998 URL: https://svnweb.freebsd.org/changeset/base/321998 Log: MFC r312528: Make draining a sendqueue more robust. Add own state variable to track if a sendqueue is stopped or not. This will prevent traffic from entering the sendqueue while it is being destroyed. Update drain function to wait for traffic to be transmitted before returning when the link state is active. Add extra checks in transmit path for stopped SQ's. While at it: - Use likely() for a mbuf pointer check. - Remove redundant IFF_DRV_RUNNING check. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h == --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:00:26 2017 (r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:01:25 2017 (r321998) @@ -517,10 +517,11 @@ struct mlx5e_sq { u16 bf_offset; u16 cev_counter;/* completion event counter */ u16 cev_factor; /* completion event factor */ - u32 cev_next_state; /* next completion event state */ + u16 cev_next_state; /* next completion event state */ #defineMLX5E_CEV_STATE_INITIAL 0 /* timer not started */ #defineMLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ #defineMLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ + u16 stopped;/* set if SQ is stopped */ struct callout cev_callout; union { u32 d32[2]; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c == --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:00:26 2017(r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:01:25 2017(r321998) @@ -1240,8 +1240,25 @@ mlx5e_sq_cev_timeout(void *arg) void mlx5e_drain_sq(struct mlx5e_sq *sq) { + int error; + /* +* Check if already stopped. +* +* NOTE: The "stopped" variable is only written when both the +* priv's configuration lock and the SQ's lock is locked. It +* can therefore safely be read when only one of the two locks +* is locked. This function is always called when the priv's +* configuration lock is locked. +*/ + if (sq->stopped != 0) + return; + mtx_lock(&sq->lock); + + /* don't put more packets into the SQ */ + sq->stopped = 1; + /* teardown event factor timer, if any */ sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; callout_stop(&sq->cev_callout); @@ -1253,14 +1270,29 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* make sure it is safe to free the callout */ callout_drain(&sq->cev_callout); + /* wait till SQ is empty or link is down */ + mtx_lock(&sq->lock); + while (sq->cc != sq->pc && + (sq->priv->media_status_last & IFM_ACTIVE) != 0) { + mtx_unlock(&sq->lock); + msleep(1); + sq->cq.mcq.comp(&sq->cq.mcq); + mtx_lock(&sq->lock); + } + mtx_unlock(&sq->lock); + /* error out remaining requests */ - mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + error = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + if (error != 0) { + if_printf(sq->ifp, + "mlx5e_modify_sq() from RDY to ERR failed: %d\n", error); + } /* wait till SQ is empty */ mtx_lock(&sq->lock); while (sq->cc != sq->pc) { mtx_unlock(&sq->lock); - msleep(4); + msleep(1); sq->cq.mcq.comp(&sq->cq.mcq); mtx_lock(&sq->lock); } Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c == --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:00:26 2017 (r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:01:25 2017 (r321998) @@ -81,11 +81,15 @@ static struct mlx5e_sq * mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) { struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_channel * volatile *ppch; + struct mlx5e_channel *pch; u32 ch; u32 tc; + ppch = priv->channel; + /* check if channels are successfully opened */ - if (unlikely(priv->channel == NULL)) + if (unlikely(ppch == NULL)) return (NULL); /* obtain VLAN info
svn commit: r321997 - stable/11/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Thu Aug 3 14:00:26 2017 New Revision: 321997 URL: https://svnweb.freebsd.org/changeset/base/321997 Log: MFC r312528: Make draining a sendqueue more robust. Add own state variable to track if a sendqueue is stopped or not. This will prevent traffic from entering the sendqueue while it is being destroyed. Update drain function to wait for traffic to be transmitted before returning when the link state is active. Add extra checks in transmit path for stopped SQ's. While at it: - Use likely() for a mbuf pointer check. - Remove redundant IFF_DRV_RUNNING check. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h == --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 13:57:17 2017 (r321996) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:00:26 2017 (r321997) @@ -507,10 +507,11 @@ struct mlx5e_sq { u16 bf_offset; u16 cev_counter;/* completion event counter */ u16 cev_factor; /* completion event factor */ - u32 cev_next_state; /* next completion event state */ + u16 cev_next_state; /* next completion event state */ #defineMLX5E_CEV_STATE_INITIAL 0 /* timer not started */ #defineMLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ #defineMLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ + u16 stopped;/* set if SQ is stopped */ struct callout cev_callout; union { u32 d32[2]; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c == --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 13:57:17 2017(r321996) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:00:26 2017(r321997) @@ -1233,8 +1233,25 @@ mlx5e_sq_cev_timeout(void *arg) void mlx5e_drain_sq(struct mlx5e_sq *sq) { + int error; + /* +* Check if already stopped. +* +* NOTE: The "stopped" variable is only written when both the +* priv's configuration lock and the SQ's lock is locked. It +* can therefore safely be read when only one of the two locks +* is locked. This function is always called when the priv's +* configuration lock is locked. +*/ + if (sq->stopped != 0) + return; + mtx_lock(&sq->lock); + + /* don't put more packets into the SQ */ + sq->stopped = 1; + /* teardown event factor timer, if any */ sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; callout_stop(&sq->cev_callout); @@ -1246,14 +1263,29 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* make sure it is safe to free the callout */ callout_drain(&sq->cev_callout); + /* wait till SQ is empty or link is down */ + mtx_lock(&sq->lock); + while (sq->cc != sq->pc && + (sq->priv->media_status_last & IFM_ACTIVE) != 0) { + mtx_unlock(&sq->lock); + msleep(1); + sq->cq.mcq.comp(&sq->cq.mcq); + mtx_lock(&sq->lock); + } + mtx_unlock(&sq->lock); + /* error out remaining requests */ - mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + error = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + if (error != 0) { + if_printf(sq->ifp, + "mlx5e_modify_sq() from RDY to ERR failed: %d\n", error); + } /* wait till SQ is empty */ mtx_lock(&sq->lock); while (sq->cc != sq->pc) { mtx_unlock(&sq->lock); - msleep(4); + msleep(1); sq->cq.mcq.comp(&sq->cq.mcq); mtx_lock(&sq->lock); } Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c == --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 13:57:17 2017 (r321996) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:00:26 2017 (r321997) @@ -81,11 +81,15 @@ static struct mlx5e_sq * mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) { struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_channel * volatile *ppch; + struct mlx5e_channel *pch; u32 ch; u32 tc; + ppch = priv->channel; + /* check if channels are successfully opened */ - if (unlikely(priv->channel == NULL)) + if (unlikely(ppch == NULL)) return (NULL); /* obtain VLAN info
svn commit: r321996 - in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en
Author: hselasky Date: Thu Aug 3 13:57:17 2017 New Revision: 321996 URL: https://svnweb.freebsd.org/changeset/base/321996 Log: MFC r312527: Add runtime support for modifying the SQ and RQ completion event moderation mode. The presence of this feature is indicated through the firmware capabilities. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/cq.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/cq.h == --- stable/10/sys/dev/mlx5/cq.h Thu Aug 3 13:55:39 2017(r321995) +++ stable/10/sys/dev/mlx5/cq.h Thu Aug 3 13:57:17 2017(r321996) @@ -88,6 +88,7 @@ enum { MLX5_CQ_MODIFY_PERIOD = 1 << 0, MLX5_CQ_MODIFY_COUNT= 1 << 1, MLX5_CQ_MODIFY_OVERRUN = 1 << 2, + MLX5_CQ_MODIFY_PERIOD_MODE = 1 << 4, }; enum { @@ -165,6 +166,11 @@ int mlx5_core_modify_cq(struct mlx5_core_dev *dev, str int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, u16 cq_period, u16 cq_max_count); +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode); int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c == --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:57:17 2017 (r321996) @@ -266,6 +266,28 @@ int mlx5_core_modify_cq_moderation(struct mlx5_core_de return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); } +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode) +{ + struct mlx5_modify_cq_mbox_in in; + + memset(&in, 0, sizeof(in)); + + in.cqn = cpu_to_be32(cq->cqn); + in.ctx.cq_period= cpu_to_be16(cq_period); + in.ctx.cq_max_count = cpu_to_be16(cq_max_count); + in.ctx.cqe_sz_flags = (cq_mode & 2) >> 1; + in.ctx.st = (cq_mode & 1) << 7; + in.field_select = cpu_to_be32(MLX5_CQ_MODIFY_PERIOD | + MLX5_CQ_MODIFY_COUNT | + MLX5_CQ_MODIFY_PERIOD_MODE); + + return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); +} + int mlx5_init_cq_table(struct mlx5_core_dev *dev) { struct mlx5_cq_table *table = &dev->priv.cq_table; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c == --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.cThu Aug 3 13:55:39 2017(r321995) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.cThu Aug 3 13:57:17 2017(r321996) @@ -92,6 +92,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; uint64_t value; + int mode_modify; int was_opened; int error; @@ -114,6 +115,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) goto done; } was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); + mode_modify = MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify); switch (MLX5_PARAM_OFFSET(arg[arg2])) { case MLX5_PARAM_OFFSET(rx_coalesce_usecs): @@ -266,7 +268,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) case MLX5_PARAM_OFFSET(rx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import RX coalesce mode */ @@ -276,13 +278,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.rx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error
svn commit: r321995 - in stable/11/sys/dev/mlx5: . mlx5_core mlx5_en
Author: hselasky Date: Thu Aug 3 13:55:39 2017 New Revision: 321995 URL: https://svnweb.freebsd.org/changeset/base/321995 Log: MFC r312527: Add runtime support for modifying the SQ and RQ completion event moderation mode. The presence of this feature is indicated through the firmware capabilities. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/cq.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/cq.h == --- stable/11/sys/dev/mlx5/cq.h Thu Aug 3 13:54:46 2017(r321994) +++ stable/11/sys/dev/mlx5/cq.h Thu Aug 3 13:55:39 2017(r321995) @@ -88,6 +88,7 @@ enum { MLX5_CQ_MODIFY_PERIOD = 1 << 0, MLX5_CQ_MODIFY_COUNT= 1 << 1, MLX5_CQ_MODIFY_OVERRUN = 1 << 2, + MLX5_CQ_MODIFY_PERIOD_MODE = 1 << 4, }; enum { @@ -165,6 +166,11 @@ int mlx5_core_modify_cq(struct mlx5_core_dev *dev, str int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, u16 cq_period, u16 cq_max_count); +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode); int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c == --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:54:46 2017 (r321994) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:55:39 2017 (r321995) @@ -266,6 +266,28 @@ int mlx5_core_modify_cq_moderation(struct mlx5_core_de return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); } +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode) +{ + struct mlx5_modify_cq_mbox_in in; + + memset(&in, 0, sizeof(in)); + + in.cqn = cpu_to_be32(cq->cqn); + in.ctx.cq_period= cpu_to_be16(cq_period); + in.ctx.cq_max_count = cpu_to_be16(cq_max_count); + in.ctx.cqe_sz_flags = (cq_mode & 2) >> 1; + in.ctx.st = (cq_mode & 1) << 7; + in.field_select = cpu_to_be32(MLX5_CQ_MODIFY_PERIOD | + MLX5_CQ_MODIFY_COUNT | + MLX5_CQ_MODIFY_PERIOD_MODE); + + return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); +} + int mlx5_init_cq_table(struct mlx5_core_dev *dev) { struct mlx5_cq_table *table = &dev->priv.cq_table; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c == --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.cThu Aug 3 13:54:46 2017(r321994) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.cThu Aug 3 13:55:39 2017(r321995) @@ -92,6 +92,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; uint64_t value; + int mode_modify; int was_opened; int error; @@ -114,6 +115,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) goto done; } was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); + mode_modify = MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify); switch (MLX5_PARAM_OFFSET(arg[arg2])) { case MLX5_PARAM_OFFSET(rx_coalesce_usecs): @@ -266,7 +268,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) case MLX5_PARAM_OFFSET(rx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import RX coalesce mode */ @@ -276,13 +278,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.rx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error
svn commit: r321993 - stable/10/sys/dev/mlx5
Author: hselasky Date: Thu Aug 3 13:52:39 2017 New Revision: 321993 URL: https://svnweb.freebsd.org/changeset/base/321993 Log: MFC r312526: Update firmware interface structures and definitions adding support for new features and commands. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_ifc.h == --- stable/10/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:51:18 2017 (r321992) +++ stable/10/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:52:39 2017 (r321993) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,13 +23,8 @@ * SUCH DAMAGE. * * $FreeBSD$ + */ - Autogenerated file. - Date: 2015-04-13 14:59 - Source Document Name: Mellanox - Source Document Version: 0.28 - Generated by adb_to_c.py (EAT.ME Version: 1.0.70) -*/ #ifndef MLX5_IFC_H #define MLX5_IFC_H @@ -56,6 +51,8 @@ enum { MLX5_EVENT_TYPE_CODING_TEMP_WARNING_EVENT = 0x17, MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19, MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT = 0x1e, + MLX5_EVENT_TYPE_CODING_PPS_EVENT = 0x25, + MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT = 0x22, MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a, MLX5_EVENT_TYPE_STALL_EVENT= 0x1b, MLX5_EVENT_TYPE_DROPPED_PACKET_LOGGED_EVENT= 0x1f, @@ -89,6 +86,8 @@ enum { MLX5_CMD_OP_QUERY_ISSI= 0x10a, MLX5_CMD_OP_SET_ISSI = 0x10b, MLX5_CMD_OP_SET_DRIVER_VERSION= 0x10d, + MLX5_CMD_OP_QUERY_OTHER_HCA_CAP = 0x10e, + MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP = 0x10f, MLX5_CMD_OP_CREATE_MKEY = 0x200, MLX5_CMD_OP_QUERY_MKEY= 0x201, MLX5_CMD_OP_DESTROY_MKEY = 0x202, @@ -190,6 +189,12 @@ enum { MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b, MLX5_CMD_OP_SET_WOL_ROL = 0x830, MLX5_CMD_OP_QUERY_WOL_ROL = 0x831, + MLX5_CMD_OP_CREATE_LAG= 0x840, + MLX5_CMD_OP_MODIFY_LAG= 0x841, + MLX5_CMD_OP_QUERY_LAG = 0x842, + MLX5_CMD_OP_DESTROY_LAG = 0x843, + MLX5_CMD_OP_CREATE_VPORT_LAG = 0x844, + MLX5_CMD_OP_DESTROY_VPORT_LAG = 0x845, MLX5_CMD_OP_CREATE_TIR= 0x900, MLX5_CMD_OP_MODIFY_TIR= 0x901, MLX5_CMD_OP_DESTROY_TIR = 0x902, @@ -206,6 +211,8 @@ enum { MLX5_CMD_OP_MODIFY_RMP= 0x90d, MLX5_CMD_OP_DESTROY_RMP = 0x90e, MLX5_CMD_OP_QUERY_RMP = 0x90f, + MLX5_CMD_OP_SET_DELAY_DROP_PARAMS = 0x910, + MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS = 0x911, MLX5_CMD_OP_CREATE_TIS= 0x912, MLX5_CMD_OP_MODIFY_TIS= 0x913, MLX5_CMD_OP_DESTROY_TIS = 0x914, @@ -226,7 +233,10 @@ enum { MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY = 0x938, MLX5_CMD_OP_ALLOC_FLOW_COUNTER= 0x939, MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a, - MLX5_CMD_OP_QUERY_FLOW_COUNTER= 0x93b + MLX5_CMD_OP_QUERY_FLOW_COUNTER= 0x93b, + MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c, + MLX5_CMD_OP_ALLOC_ENCAP_HEADER= 0x93d, + MLX5_CMD_OP_DEALLOC_ENCAP_HEADER = 0x93e, }; enum { @@ -271,7 +281,11 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 outer_gre_protocol[0x1]; u8 outer_gre_key[0x1]; u8 outer_vxlan_vni[0x1]; - u8 reserved_2[0x5]; + u8 outer_geneve_vni[0x1]; + u8 outer_geneve_oam[0x1]; + u8 outer_geneve_protocol_type[0x1]; + u8 outer_geneve_opt_len[0x1]; + u8 reserved_2[0x1]; u8 source_eswitch_port[0x1]; u8 inner_dmac[0x1]; @@ -299,10 +313,12 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 inner_tcp_flags[0x1]; u8 reserved_5[0x9]; - u8 reserved_6[0x1f]; + u8 reserved_6[0x1a]; + u8 bth_dst_qp[0x1]; + u8 reserved_7[0x4];
svn commit: r321992 - stable/11/sys/dev/mlx5
Author: hselasky Date: Thu Aug 3 13:51:18 2017 New Revision: 321992 URL: https://svnweb.freebsd.org/changeset/base/321992 Log: MFC r312526: Update firmware interface structures and definitions adding support for new features and commands. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h == --- stable/11/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:50:46 2017 (r321991) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:51:18 2017 (r321992) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,13 +23,8 @@ * SUCH DAMAGE. * * $FreeBSD$ + */ - Autogenerated file. - Date: 2015-04-13 14:59 - Source Document Name: Mellanox - Source Document Version: 0.28 - Generated by adb_to_c.py (EAT.ME Version: 1.0.70) -*/ #ifndef MLX5_IFC_H #define MLX5_IFC_H @@ -56,6 +51,8 @@ enum { MLX5_EVENT_TYPE_CODING_TEMP_WARNING_EVENT = 0x17, MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19, MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT = 0x1e, + MLX5_EVENT_TYPE_CODING_PPS_EVENT = 0x25, + MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT = 0x22, MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a, MLX5_EVENT_TYPE_STALL_EVENT= 0x1b, MLX5_EVENT_TYPE_DROPPED_PACKET_LOGGED_EVENT= 0x1f, @@ -89,6 +86,8 @@ enum { MLX5_CMD_OP_QUERY_ISSI= 0x10a, MLX5_CMD_OP_SET_ISSI = 0x10b, MLX5_CMD_OP_SET_DRIVER_VERSION= 0x10d, + MLX5_CMD_OP_QUERY_OTHER_HCA_CAP = 0x10e, + MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP = 0x10f, MLX5_CMD_OP_CREATE_MKEY = 0x200, MLX5_CMD_OP_QUERY_MKEY= 0x201, MLX5_CMD_OP_DESTROY_MKEY = 0x202, @@ -190,6 +189,12 @@ enum { MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b, MLX5_CMD_OP_SET_WOL_ROL = 0x830, MLX5_CMD_OP_QUERY_WOL_ROL = 0x831, + MLX5_CMD_OP_CREATE_LAG= 0x840, + MLX5_CMD_OP_MODIFY_LAG= 0x841, + MLX5_CMD_OP_QUERY_LAG = 0x842, + MLX5_CMD_OP_DESTROY_LAG = 0x843, + MLX5_CMD_OP_CREATE_VPORT_LAG = 0x844, + MLX5_CMD_OP_DESTROY_VPORT_LAG = 0x845, MLX5_CMD_OP_CREATE_TIR= 0x900, MLX5_CMD_OP_MODIFY_TIR= 0x901, MLX5_CMD_OP_DESTROY_TIR = 0x902, @@ -206,6 +211,8 @@ enum { MLX5_CMD_OP_MODIFY_RMP= 0x90d, MLX5_CMD_OP_DESTROY_RMP = 0x90e, MLX5_CMD_OP_QUERY_RMP = 0x90f, + MLX5_CMD_OP_SET_DELAY_DROP_PARAMS = 0x910, + MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS = 0x911, MLX5_CMD_OP_CREATE_TIS= 0x912, MLX5_CMD_OP_MODIFY_TIS= 0x913, MLX5_CMD_OP_DESTROY_TIS = 0x914, @@ -226,7 +233,10 @@ enum { MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY = 0x938, MLX5_CMD_OP_ALLOC_FLOW_COUNTER= 0x939, MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a, - MLX5_CMD_OP_QUERY_FLOW_COUNTER= 0x93b + MLX5_CMD_OP_QUERY_FLOW_COUNTER= 0x93b, + MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c, + MLX5_CMD_OP_ALLOC_ENCAP_HEADER= 0x93d, + MLX5_CMD_OP_DEALLOC_ENCAP_HEADER = 0x93e, }; enum { @@ -271,7 +281,11 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 outer_gre_protocol[0x1]; u8 outer_gre_key[0x1]; u8 outer_vxlan_vni[0x1]; - u8 reserved_2[0x5]; + u8 outer_geneve_vni[0x1]; + u8 outer_geneve_oam[0x1]; + u8 outer_geneve_protocol_type[0x1]; + u8 outer_geneve_opt_len[0x1]; + u8 reserved_2[0x1]; u8 source_eswitch_port[0x1]; u8 inner_dmac[0x1]; @@ -299,10 +313,12 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 inner_tcp_flags[0x1]; u8 reserved_5[0x9]; - u8 reserved_6[0x1f]; + u8 reserved_6[0x1a]; + u8 bth_dst_qp[0x1]; + u8 reserved_7[0x4];
svn commit: r321991 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
Author: ngie Date: Thu Aug 3 13:50:46 2017 New Revision: 321991 URL: https://svnweb.freebsd.org/changeset/base/321991 Log: Revert r321969 My change had good intentions, but the implementation was incorrect: - printf was returning the number of characters in the format string plus the NUL, but failed in two regards implementation wise: -- the pathological case, printf(""), wasn't being handled properly since the pointer is always incremented, so the value returned would be off-by-one. -- printf(3) reports the number of characters printed post-conversion via vfprintf, etc. - putchar(3) should return the character printed or EOF, not the number of characters output to the screen. My goal in making the change (again) was to increase parity, but as bde pointed out these are freestanding functions, so they don't have to conform to libc/POSIX. I argued that the functions should be named differently since the implementation is different enough to warrant it and to allow boot2 code to be usable when linked against sys/boot and libstand and other libraries in base. I have no interest in pushing this change forward more though, as the original concern I had behind the change with zfsboottest was resolved in r321849 and r321852. The next person that updates the toolchain gets to deal with the inconsistency if it's flagged by a newer compiler. MFC after:1 month Reported by: ed, markj Modified: head/sys/boot/arm/at91/libat91/lib.h head/sys/boot/arm/at91/libat91/printf.c head/sys/boot/arm/at91/libat91/putchar.c head/sys/boot/arm/ixp425/boot2/ixp425_board.c head/sys/boot/arm/ixp425/boot2/lib.h head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/arm/at91/libat91/lib.h == --- head/sys/boot/arm/at91/libat91/lib.hThu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/arm/at91/libat91/lib.hThu Aug 3 13:50:46 2017 (r321991) @@ -28,9 +28,9 @@ #define ARM_BOOT_LIB_H int getc(int); -int putchar(int); -int xputchar(int); -int printf(const char *fmt,...); +void putchar(int); +void xputchar(int); +void printf(const char *fmt,...); /* The following function write eeprom at ee_addr using data */ /* from data_add for size bytes. */ Modified: head/sys/boot/arm/at91/libat91/printf.c == --- head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 13:50:46 2017 (r321991) @@ -20,13 +20,12 @@ #include #include "lib.h" -int +void printf(const char *fmt,...) { va_list ap; const char *hex = "0123456789abcdef"; char buf[10]; - const char *fmt_orig = fmt; char *s; unsigned u; int c; @@ -67,5 +66,5 @@ printf(const char *fmt,...) } va_end(ap); - return (int)(fmt - fmt_orig); + return; } Modified: head/sys/boot/arm/at91/libat91/putchar.c == --- head/sys/boot/arm/at91/libat91/putchar.cThu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/arm/at91/libat91/putchar.cThu Aug 3 13:50:46 2017 (r321991) @@ -39,11 +39,11 @@ #include "lib.h" /* - * int putchar(int ch) + * void putchar(int ch) * Writes a character to the DBGU port. It assumes that DBGU has * already been initialized. */ -int +void putchar(int ch) { AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU; @@ -51,14 +51,12 @@ putchar(int ch) while (!(pUSART->US_CSR & AT91C_US_TXRDY)) continue; pUSART->US_THR = (ch & 0xFF); - return (1); } -int +void xputchar(int ch) { - if (ch == '\n') - putchar('\r'); - putchar(ch); - return (ch == '\n' ? 2 : 1); +if (ch == '\n') + putchar('\r'); +putchar(ch); } Modified: head/sys/boot/arm/ixp425/boot2/ixp425_board.c == --- head/sys/boot/arm/ixp425/boot2/ixp425_board.c Thu Aug 3 13:45:26 2017(r321990) +++ head/sys/boot/arm/ixp425/boot2/ixp425_board.c Thu Aug 3 13:50:46 2017(r321991) @@ -165,7 +165,7 @@ getc(int seconds) return c; } -int +void putchar(int ch) { int delay, limit; @@ -179,16 +179,14 @@ putchar(int ch) limit = 40; while ((uart_getreg(ubase, REG_LSR) & LSR_TEMT) == 0 && --limit) DELAY(delay); - return (1); } -int +void xputchar(int ch) { if (ch == '\n') putchar('\r'); putchar(ch); - return (ch == '\n' ? 2 : 1); } void Modified: head/sys/boot/arm/ixp425/boot2/lib.h ==
svn commit: r321990 - stable/11/sys/dev/usb/controller
Author: hselasky Date: Thu Aug 3 13:45:26 2017 New Revision: 321990 URL: https://svnweb.freebsd.org/changeset/base/321990 Log: MFC r320773: Implement fix for BULK IN-token retry mechanism. When the hardware is programmed for infinite IN token retry after NAK, the SAF1761 hardware, however, does not retry the IN-token. This problem is described in the SAF1761 errata, section 18.1.1. While at it: - Add some minor chip specific initialization for RTEMS. - Add debug print for status registers in the interrupt filter. Submitted by: Christian Mauderer Modified: stable/11/sys/dev/usb/controller/saf1761_otg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/controller/saf1761_otg.c == --- stable/11/sys/dev/usb/controller/saf1761_otg.c Thu Aug 3 13:26:51 2017(r321989) +++ stable/11/sys/dev/usb/controller/saf1761_otg.c Thu Aug 3 13:45:26 2017(r321990) @@ -516,7 +516,25 @@ saf1761_host_bulk_data_rx(struct saf1761_otg_softc *sc DPRINTFN(5, "STATUS=0x%08x\n", status); if (status & SOTG_PTD_DW3_ACTIVE) { - goto busy; + temp = saf1761_peek_host_status_le_4(sc, + pdt_addr + SOTG_PTD_DW0); + if (temp & SOTG_PTD_DW0_VALID) { + goto busy; + } else { + status = saf1761_peek_host_status_le_4(sc, + pdt_addr + SOTG_PTD_DW3); + + /* check if still active */ + if (status & SOTG_PTD_DW3_ACTIVE) { + saf1761_host_channel_free(sc, td); + goto retry; + } else if (status & SOTG_PTD_DW3_HALTED) { + if (!(status & SOTG_PTD_DW3_ERRORS)) + td->error_stall = 1; + td->error_any = 1; + goto complete; + } + } } else if (status & SOTG_PTD_DW3_HALTED) { if (!(status & SOTG_PTD_DW3_ERRORS)) td->error_stall = 1; @@ -560,6 +578,7 @@ saf1761_host_bulk_data_rx(struct saf1761_otg_softc *sc } saf1761_host_channel_free(sc, td); } +retry: if (saf1761_host_channel_alloc(sc, td)) goto busy; @@ -1589,6 +1608,8 @@ saf1761_otg_filter_interrupt(void *arg) (void) SAF1761_READ_LE_4(sc, SOTG_INT_PTD_DONE_PTD); (void) SAF1761_READ_LE_4(sc, SOTG_ISO_PTD_DONE_PTD); + DPRINTFN(9, "HCINTERRUPT=0x%08x DCINTERRUPT=0x%08x\n", hcstat, status); + if (status & SOTG_DCINTERRUPT_IEPSOF) { if ((sc->sc_host_async_busy_map[1] | sc->sc_host_async_busy_map[0] | sc->sc_host_intr_busy_map[1] | sc->sc_host_intr_busy_map[0] | @@ -2446,11 +2467,15 @@ saf1761_otg_init(struct saf1761_otg_softc *sc) */ SAF1761_WRITE_LE_4(sc, SOTG_CTRL_SET_CLR, SOTG_CTRL_CLR(0x)); +#ifdef __rtems__ SAF1761_WRITE_LE_4(sc, SOTG_CTRL_SET_CLR, + SOTG_CTRL_SET(SOTG_CTRL_SEL_CP_EXT | SOTG_CTRL_VBUS_DRV)); +#else + SAF1761_WRITE_LE_4(sc, SOTG_CTRL_SET_CLR, SOTG_CTRL_SET(SOTG_CTRL_SW_SEL_HC_DC | SOTG_CTRL_BDIS_ACON_EN | SOTG_CTRL_SEL_CP_EXT | SOTG_CTRL_VBUS_DRV)); - +#endif /* disable device address */ SAF1761_WRITE_LE_4(sc, SOTG_ADDRESS, 0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321989 - head/usr.bin/calendar/calendars
Author: loos Date: Thu Aug 3 13:26:51 2017 New Revision: 321989 URL: https://svnweb.freebsd.org/changeset/base/321989 Log: Add myself to the calendar.freebsd. Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 3 10:11:06 2017(r321988) +++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 3 13:26:51 2017(r321989) @@ -99,6 +99,7 @@ 03/07 Michael P. Pritchard born in Los Angeles, California, United States, 1964 03/07 Giorgos Keramidas born in Athens, Greece, 1976 03/10 Andreas Klemm born in Duesseldorf, Nordrhein-Westfalen, Germany, 1963 +03/10 Luiz Otavio O Souza born in Bauru, Sao Paulo, Brazil, 1978 03/10 Nikolai Lifanov born in Moscow, Russian Federation, 1989 03/11 Soeren Straarup born in Andst, Denmark, 1978 03/12 Greg Lewis born in Adelaide, South Australia, Australia, 1969 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
> On Aug 3, 2017, at 00:53, Bruce Evans wrote: > > On Thu, 3 Aug 2017, Ngie Cooper wrote: > >> Log: >> Fix the return types for printf and putchar to match their libc and >> POSIX equivalents >> >> Both printf and putchar return int, not void. >> >> This will allow code that leverages the libcalls and checks/rely on the >> return type to interchangeably between loader code and non-loader >> code. >> >> MFC after: 1 month >> >> Modified: >> head/sys/boot/arm/at91/libat91/lib.h >> head/sys/boot/arm/at91/libat91/printf.c >> head/sys/boot/arm/at91/libat91/putchar.c >> head/sys/boot/arm/ixp425/boot2/ixp425_board.c >> head/sys/boot/arm/ixp425/boot2/lib.h >> head/sys/boot/i386/boot2/boot2.c > > This is wrong for at least i386/boot2. It isn't part of the loader, and > saves space by not returning unused values. > >> Modified: head/sys/boot/i386/boot2/boot2.c >> == >> --- head/sys/boot/i386/boot2/boot2.c Thu Aug 3 03:45:48 2017 >> (r321968) >> +++ head/sys/boot/i386/boot2/boot2.c Thu Aug 3 05:27:05 2017 >> (r321969) >> @@ -114,8 +114,8 @@ void exit(int); >> static void load(void); >> static int parse(void); >> static int dskread(void *, unsigned, unsigned); >> -static void printf(const char *,...); >> -static void putchar(int); >> +static int printf(const char *,...); >> +static int putchar(int); > > These are freestanding static functions, so they have nothing to do > with library functions except their name is a hint that they are > similar. > > Since they are static, -funit-at-a-time might allow the unused return values > to be optimized away. Then returning unused values would be just an > obfuscation. > > This file still has a static memcpy() which is quite different from the > libc version. It doesn't return an unused value, and its arg types are > all different (no newfangled size_t or newerfangled restrict). > > Freestanding versions (static and otherwise) cause problems with builtins. > -ffreestanding turns off all builtins. The static memcpy used to be > ifdefed so as to use __builtin_memcpy instead of the static one if the > compiler is gcc. That apparently broke with gcc-4.2, since the builtin > will call libc memcpy() in some cases, although memcpy() is unavailable > in the freestanding case. I get the point about them being freestanding functions, but if the functions aren’t meant to be compatible they should be named differently. Part of the issue some code that bridged loader and non-loader users (bootdevtest and zfsboottest for example) relied on feature parity (in part because the ZFS code required it and because of how things are compiled/linked together). If compilers get pedantic enough, then they’ll flag these issues as errors and we’ll have to address these compatibilities at that point. My intent was ok (I think), but the implementation I did is wrong, so I’ll revert the change completely and leave it for someone else to deal with the incompatibilities (I’ll just integrate bootdevtest and zfsboottest into buildworld under sys/boot so they won’t remain broken for weeks on end, like they were recently). Thanks, -Ngie signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
On Thu, Aug 03, 2017 at 05:53:43PM +1000, Bruce Evans wrote: > Freestanding versions (static and otherwise) cause problems with builtins. > -ffreestanding turns off all builtins. The static memcpy used to be > ifdefed so as to use __builtin_memcpy instead of the static one if the > compiler is gcc. That apparently broke with gcc-4.2, since the builtin > will call libc memcpy() in some cases, although memcpy() is unavailable > in the freestanding case. GCC always had a requirement that freestanding environment must provide certain functions (memcpy, memmove, memset, memcmp). At least memcpy and memset are regulary used for certain code constructs. While most calls will be inlined, it is not required. Joerg ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
> On Aug 3, 2017, at 04:48, Ed Schouten wrote: > > 2017-08-03 7:27 GMT+02:00 Ngie Cooper : >> Modified: head/sys/boot/arm/at91/libat91/printf.c >> == >> --- head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 03:45:48 2017 >>(r321968) >> +++ head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 05:27:05 2017 >>(r321969) >> @@ -20,12 +20,13 @@ >> #include >> #include "lib.h" >> >> -void >> +int >> printf(const char *fmt,...) >> { >>va_list ap; >>const char *hex = "0123456789abcdef"; >>char buf[10]; >> + const char *fmt_orig = fmt; >>char *s; >>unsigned u; >>int c; >> @@ -66,5 +67,5 @@ printf(const char *fmt,...) >>} >>va_end(ap); >> >> - return; >> + return (int)(fmt - fmt_orig); >> } > > This makes printf() return the number of characters from the format > processed, right? This is different from libc's printf(), which > returns the number of characters printed. Yes. markj identified flaws with my approach that need to be addressed in another commit (unfortunately I didn’t pay close enough attention to the details when I implemented the change). Thanks, -Ngie signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r321920 - head/sys/sys
On Thu, Aug 03, 2017 at 07:34:56PM +1000, Bruce Evans wrote: > I see another problem. Masking with 0xf and casting to unsigned > are gratuitously different spellings for extracting the low 32 bits. > I prefer the cast. Below is one more update. I reformulated the man page text, but not too deep. Also I replaced masking with the cast. diff --git a/share/man/man3/makedev.3 b/share/man/man3/makedev.3 index 87ca953dc79..8ce9c554a09 100644 --- a/share/man/man3/makedev.3 +++ b/share/man/man3/makedev.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2008 +.Dd August 3, 2017 .Dt MAKEDEV 3 .Os .Sh NAME @@ -43,7 +43,7 @@ .Sh DESCRIPTION The .Fn makedev -macro allows a unique device number to be generated based on its +macro returns a device number created from the provided .Fa major and .Fa minor @@ -52,13 +52,26 @@ The .Fn major and .Fn minor -macros can be used to obtain the original numbers from the device number +macros return the original numbers from the device number .Fa dev . +In other words, for a value +.Va dev +of the type +.Vt dev_t , +and values +.Va ma , mi +of the type +.Vt int , +the assertions +.Dl dev == makedev(major(dev), minor(dev)) +.Dl ma == major(makedev(ma, mi)) +.Dl mi == minor(makedev(ma, mi)) +are valid. .Pp In previous implementations of .Fx all block and character devices were uniquely identified by a pair of -major and minor numbers. +stable major and minor numbers. The major number referred to a certain device class (e.g. disks, TTYs) while the minor number identified an instance within the device class. Later versions of @@ -66,7 +79,8 @@ Later versions of automatically generate a unique device number for each character device visible in .Pa /dev/ . -These numbers are not divided in device classes. +These numbers are not divided in device classes and are not guaranteed +to be stable upon reboot or driver reload. .Pp On .Fx @@ -78,11 +92,9 @@ conventional way. .Sh RETURN VALUES The .Fn major -macro returns a device major number that has a value between 0 and 255. -The +and .Fn minor -macro returns a device minor number whose value can span the complete -range of an +macros return numbers whose value can span the complete range of an .Vt int . .Sh SEE ALSO .Xr mknod 2 , diff --git a/sys/sys/types.h b/sys/sys/types.h index 30a08724443..eacbc1ba0c4 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -364,9 +364,9 @@ __bitcount64(__uint64_t _x) #include -#definemajor(x)((int)((dev_t)(x) >> 32)) /* major number */ -#defineminor(x)((int)((x) & 0x)) /* minor number */ -#definemakedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ +#definemajor(x)((int)((dev_t)(x) >> 32)) +#defineminor(x)((int)(x)) +#definemakedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* * These declarations belong elsewhere, but are repeated here and in ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
2017-08-03 7:27 GMT+02:00 Ngie Cooper : > Modified: head/sys/boot/arm/at91/libat91/printf.c > == > --- head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 03:45:48 2017 > (r321968) > +++ head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 05:27:05 2017 > (r321969) > @@ -20,12 +20,13 @@ > #include > #include "lib.h" > > -void > +int > printf(const char *fmt,...) > { > va_list ap; > const char *hex = "0123456789abcdef"; > char buf[10]; > + const char *fmt_orig = fmt; > char *s; > unsigned u; > int c; > @@ -66,5 +67,5 @@ printf(const char *fmt,...) > } > va_end(ap); > > - return; > + return (int)(fmt - fmt_orig); > } This makes printf() return the number of characters from the format processed, right? This is different from libc's printf(), which returns the number of characters printed. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321988 - vendor-crypto/openssh/7.5p1
Author: des Date: Thu Aug 3 10:11:06 2017 New Revision: 321988 URL: https://svnweb.freebsd.org/changeset/base/321988 Log: Tag OpenSSH 7.5p1. Added: vendor-crypto/openssh/7.5p1/ - copied from r321987, vendor-crypto/openssh/dist/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321987 - in vendor-crypto/openssh/dist: . contrib/cygwin contrib/redhat contrib/suse openbsd-compat regress regress/unittests regress/unittests/conversion regress/unittests/match regre...
Author: des Date: Thu Aug 3 10:10:20 2017 New Revision: 321987 URL: https://svnweb.freebsd.org/changeset/base/321987 Log: Vendor import of OpenSSH 7.5p1. Added: vendor-crypto/openssh/dist/regress/unittests/conversion/ vendor-crypto/openssh/dist/regress/unittests/conversion/Makefile (contents, props changed) vendor-crypto/openssh/dist/regress/unittests/conversion/tests.c (contents, props changed) Modified: vendor-crypto/openssh/dist/ChangeLog vendor-crypto/openssh/dist/INSTALL vendor-crypto/openssh/dist/Makefile.in vendor-crypto/openssh/dist/README vendor-crypto/openssh/dist/auth-pam.c vendor-crypto/openssh/dist/auth2-pubkey.c vendor-crypto/openssh/dist/auth2.c vendor-crypto/openssh/dist/channels.c vendor-crypto/openssh/dist/channels.h vendor-crypto/openssh/dist/clientloop.c vendor-crypto/openssh/dist/compat.c vendor-crypto/openssh/dist/config.h.in vendor-crypto/openssh/dist/configure vendor-crypto/openssh/dist/configure.ac vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config vendor-crypto/openssh/dist/contrib/redhat/openssh.spec vendor-crypto/openssh/dist/contrib/suse/openssh.spec vendor-crypto/openssh/dist/digest-openssl.c vendor-crypto/openssh/dist/hostfile.c vendor-crypto/openssh/dist/kex.c vendor-crypto/openssh/dist/krl.c vendor-crypto/openssh/dist/log.c vendor-crypto/openssh/dist/match.c vendor-crypto/openssh/dist/match.h vendor-crypto/openssh/dist/misc.c vendor-crypto/openssh/dist/monitor.c vendor-crypto/openssh/dist/mux.c vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.c vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.h vendor-crypto/openssh/dist/openbsd-compat/fmt_scaled.c vendor-crypto/openssh/dist/packet.c vendor-crypto/openssh/dist/packet.h vendor-crypto/openssh/dist/pathnames.h vendor-crypto/openssh/dist/readconf.c vendor-crypto/openssh/dist/regress/Makefile vendor-crypto/openssh/dist/regress/agent-getpeereid.sh vendor-crypto/openssh/dist/regress/allow-deny-users.sh vendor-crypto/openssh/dist/regress/cert-file.sh vendor-crypto/openssh/dist/regress/forwarding.sh vendor-crypto/openssh/dist/regress/integrity.sh vendor-crypto/openssh/dist/regress/test-exec.sh vendor-crypto/openssh/dist/regress/unittests/Makefile vendor-crypto/openssh/dist/regress/unittests/match/tests.c vendor-crypto/openssh/dist/regress/unittests/test_helper/test_helper.c vendor-crypto/openssh/dist/regress/unittests/test_helper/test_helper.h vendor-crypto/openssh/dist/regress/unittests/utf8/tests.c vendor-crypto/openssh/dist/sandbox-seccomp-filter.c vendor-crypto/openssh/dist/servconf.c vendor-crypto/openssh/dist/serverloop.c vendor-crypto/openssh/dist/sftp-client.c vendor-crypto/openssh/dist/sftp.c vendor-crypto/openssh/dist/ssh-agent.c vendor-crypto/openssh/dist/ssh-keygen.c vendor-crypto/openssh/dist/ssh-keyscan.c vendor-crypto/openssh/dist/ssh.c vendor-crypto/openssh/dist/ssh_config.0 vendor-crypto/openssh/dist/ssh_config.5 vendor-crypto/openssh/dist/sshconnect.c vendor-crypto/openssh/dist/sshconnect1.c vendor-crypto/openssh/dist/sshconnect2.c vendor-crypto/openssh/dist/sshd.0 vendor-crypto/openssh/dist/sshd.8 vendor-crypto/openssh/dist/sshd.c vendor-crypto/openssh/dist/sshd_config vendor-crypto/openssh/dist/sshd_config.0 vendor-crypto/openssh/dist/sshd_config.5 vendor-crypto/openssh/dist/sshkey.c vendor-crypto/openssh/dist/sshkey.h vendor-crypto/openssh/dist/utf8.c vendor-crypto/openssh/dist/version.h Modified: vendor-crypto/openssh/dist/ChangeLog == --- vendor-crypto/openssh/dist/ChangeLogThu Aug 3 09:31:10 2017 (r321986) +++ vendor-crypto/openssh/dist/ChangeLogThu Aug 3 10:10:20 2017 (r321987) @@ -1,3 +1,1174 @@ +commit d38f05dbdd291212bc95ea80648b72b7177e9f4e +Author: Darren Tucker +Date: Mon Mar 20 13:38:27 2017 +1100 + +Add llabs() implementation. + +commit 72536316a219b7394996a74691a5d4ec197480f7 +Author: Damien Miller +Date: Mon Mar 20 12:23:04 2017 +1100 + +crank version numbers + +commit 3be52bc36bdfd24ded7e0f46999e7db520fb4e3f +Author: d...@openbsd.org +Date: Mon Mar 20 01:18:59 2017 + + +upstream commit + +openssh-7.5 + +Upstream-ID: b8b9a4a949427c393cd868215e1724ceb3467ee5 + +commit db84e52fe9cfad57f22e7e23c5fbf00092385129 +Author: Damien Miller +Date: Mon Mar 20 12:07:20 2017 +1100 + +I'm a doofus. + +Unbreak obvious syntax error. + +commit 89f04852db27643717c9c3a2b0dde97ae50099ee +Author: Damien Miller +Date: Mon Mar 20 11:53:34 2017 +1100 + +on Cygwin, check paths from server for backslashes + +Pointed out by Jann Horn of Google Project Zero + +commit 7ef1f9bafc2cc8d97ff2fbd4f280002b6e8ea5d9 +Author: Damien Miller +Date: Mon Mar 20 11:48:34 2017 +1100 + +Yet another synonym for ASCII: "646" + +Used by NetBSD; this unbreaks mprintf() and friends there fo
Re: svn commit: r321920 - head/sys/sys
On Thu, 3 Aug 2017, Konstantin Belousov wrote: On Thu, Aug 03, 2017 at 01:21:56PM +1000, Bruce Evans wrote: It would be better to remove the comments. makedev() actually has a man page (a FreeBSD addition makedev(3)). This could have been better, and is now out of date. The largest error is that major() is still documented to return a value between 0 and 255. This reduction prevented makedev() being the inverse of major()+minor() on arbitrary args. The man page doesn't claim that it is, and barely gives a hint that makedev() can be used to synthesize a dev_t from (x, y) provided 0 <= x <= 255. See below. diff --git a/share/man/man3/makedev.3 b/share/man/man3/makedev.3 index 87ca953dc79..a54d0590bc5 100644 --- a/share/man/man3/makedev.3 +++ b/share/man/man3/makedev.3 ... @@ -54,11 +54,18 @@ and .Fn minor macros can be used to obtain the original numbers from the device number Problems with old wording: - "can be used" is too informal. Before this, makedev() is described as "allows" something. "allow" is almost never used in share/man3/*, even in the sense of giving permission. Only pthread man pages have many instances of this bug. - "original" is an anachronism. The major and minor used to be the original numbers, but now it is the dev_t that is original except when the dev_t is synthesized. "original" might also mean "original representation". Fixes: "can be used to obtain" is just a verbose spelling of "return". "allows" can be improved using "returns" too, and it would be good to shorten "a unique device number to be generated based on" to something that says less about the one to one correspondence. "generation" is just a special case of applying the correspondence to get an alternative representation. "original" is also related to the correspondence. Perhaps describe the correspondence first and then only say that the functions are the ones that implement it. .Fa dev . +In other words, for a value +.Va dev +of the type +.Vt dev_t , +the assertion +.Dl dev == makedev(major(dev), minor(dev)) +is valid. This describes the correspondence in another way. Pehaps delete all details about what the functions do in ther previous description and say that they are defined by this property. I think the inverse property also needs to be spelled out. It is that for (int ma, int mi) .Dl ma = major(makedev(ma, mi)) .Dl mi = minor(makedev(ma, mi)) .Pp In previous implementations of .Fx all block and character devices were uniquely identified by a pair of -major and minor numbers. +stable major and minor numbers. "stable" is clarified later, but is hard to understand in context. The major number referred to a certain device class (e.g. disks, TTYs) while the minor number identified an instance within the device class. Later versions of @@ -66,7 +73,8 @@ Later versions of automatically generate a unique device number for each character device visible in .Pa /dev/ . -These numbers are not divided in device classes. +These numbers are not divided in device classes and are not guaranteed +to be stable upon reboot or driver reload. They used to be stable across even more than reboot. They were kept in file systems, and that required them to be stable across OS versions in practice. .Pp On .Fx @@ -78,11 +86,9 @@ conventional way. .Sh RETURN VALUES The .Fn major -macro returns a device major number that has a value between 0 and 255. -The +and .Fn minor -macro returns a device minor number whose value can span the complete -range of an +macros return numbers whose value can span the complete range of an .Vt int . .Sh SEE ALSO .Xr mknod 2 , diff --git a/sys/sys/types.h b/sys/sys/types.h index 30a08724443..8ea6e146e08 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -364,9 +364,9 @@ __bitcount64(__uint64_t _x) #include -#definemajor(x)((int)((dev_t)(x) >> 32)) /* major number */ -#defineminor(x)((int)((x) & 0x)) /* minor number */ -#definemakedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ +#definemajor(x)((int)((dev_t)(x) >> 32)) +#defineminor(x)((int)((x) & 0x)) +#definemakedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) I see another problem. Masking with 0xf and casting to unsigned are gratuitously different spellings for extracting the low 32 bits. I prefer the cast. It only works if ints have 32 bits, but we assume that for other reasons. The mask is especially hard to understand for the 1's complement case. We avoid complications with dodgy args for major() by casting the arg to dev_t. For minor(), the behaviour is only clear if x is unsigned (it should be dev_t), or int or lower rank unsigned and typeof(0x) == unsigned (true with 32-bit ints). In the second case, the default promotions convert x to unsigned. -0 becomes 0U which probably breaks it on 1's complement systems, but -0L doesn't change, which is hard to underst
svn commit: r321986 - head/sys/ofed/drivers/infiniband/core
Author: hselasky Date: Thu Aug 3 09:31:10 2017 New Revision: 321986 URL: https://svnweb.freebsd.org/changeset/base/321986 Log: Change reject message type when destroying cm_id in ibore. This patch fixes an interopability issue between FreeBSD and non-FreeBSD systems when the connection establishment is aborted. Refer to the initial commit in Linux, drivers/infiniband/core/cm.c, for a more detailed description. Obtained from:Linux MFC after:3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/cm.c Modified: head/sys/ofed/drivers/infiniband/core/cm.c == --- head/sys/ofed/drivers/infiniband/core/cm.c Thu Aug 3 09:18:25 2017 (r321985) +++ head/sys/ofed/drivers/infiniband/core/cm.c Thu Aug 3 09:31:10 2017 (r321986) @@ -889,6 +889,7 @@ retest: cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT); break; case IB_CM_REQ_SENT: + case IB_CM_MRA_REQ_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); spin_unlock_irq(&cm_id_priv->lock); ib_send_cm_rej(cm_id, IB_CM_REJ_TIMEOUT, @@ -907,7 +908,6 @@ retest: NULL, 0, NULL, 0); } break; - case IB_CM_MRA_REQ_RCVD: case IB_CM_REP_SENT: case IB_CM_MRA_REP_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321985 - head/sys/ofed/drivers/infiniband/core
Author: hselasky Date: Thu Aug 3 09:18:25 2017 New Revision: 321985 URL: https://svnweb.freebsd.org/changeset/base/321985 Log: Ticks are 32-bit in FreeBSD. MFC after:3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/addr.c Modified: head/sys/ofed/drivers/infiniband/core/addr.c == --- head/sys/ofed/drivers/infiniband/core/addr.cThu Aug 3 09:14:43 2017(r321984) +++ head/sys/ofed/drivers/infiniband/core/addr.cThu Aug 3 09:18:25 2017(r321985) @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); static void set_timeout(unsigned long time) { - unsigned long delay; + int delay; /* under FreeBSD ticks are 32-bit */ delay = time - jiffies; - if ((long)delay <= 0) + if (delay <= 0) delay = 1; mod_delayed_work(addr_wq, &work, delay); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321984 - head/sys/dev/mlx5/mlx5_core
Author: hselasky Date: Thu Aug 3 09:14:43 2017 New Revision: 321984 URL: https://svnweb.freebsd.org/changeset/base/321984 Log: Resolve locking issue for non-sleepable context in the mlx5core. Code inspection reveals the busdma unload and free functions do not write to the belonging dma tag and does not need to be serialized. This allows mlx5_fwp_free() to be called from software interrupt context. MFC after:3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c == --- head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cThu Aug 3 09:11:51 2017(r321983) +++ head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cThu Aug 3 09:14:43 2017(r321984) @@ -190,13 +190,10 @@ mlx5_fwp_free(struct mlx5_fw_page *fwp) num = fwp->numpages; dev = fwp->dev; - /* serialize unloading the DMA maps */ - sx_xlock(&dev->cmd.dma_sx); while (num--) { bus_dmamap_unload(dev->cmd.dma_tag, fwp[num].dma_map); bus_dmamem_free(dev->cmd.dma_tag, fwp[num].virt_addr, fwp[num].dma_map); } - sx_xunlock(&dev->cmd.dma_sx); kfree(fwp); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321983 - head/sys/dev/mlx5/mlx5_core
Author: hselasky Date: Thu Aug 3 09:11:51 2017 New Revision: 321983 URL: https://svnweb.freebsd.org/changeset/base/321983 Log: Using GFP_ATOMIC with firmware commands is not supported after busdma was introduced in the mlx5core, because busdma might sleep when loading memory into DMA. MFC after:3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c == --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 08:03:22 2017 (r321982) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 09:11:51 2017 (r321983) @@ -1434,12 +1434,11 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *inb; struct mlx5_cmd_msg *outb; int pages_queue; - gfp_t gfp; + const gfp_t gfp = GFP_KERNEL; int err; u8 status = 0; pages_queue = is_manage_pages(in); - gfp = callback ? GFP_ATOMIC : GFP_KERNEL; inb = alloc_msg(dev, in_size, gfp); if (IS_ERR(inb)) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2
On Thu, 3 Aug 2017, Ngie Cooper wrote: Log: Fix the return types for printf and putchar to match their libc and POSIX equivalents Both printf and putchar return int, not void. This will allow code that leverages the libcalls and checks/rely on the return type to interchangeably between loader code and non-loader code. MFC after: 1 month Modified: head/sys/boot/arm/at91/libat91/lib.h head/sys/boot/arm/at91/libat91/printf.c head/sys/boot/arm/at91/libat91/putchar.c head/sys/boot/arm/ixp425/boot2/ixp425_board.c head/sys/boot/arm/ixp425/boot2/lib.h head/sys/boot/i386/boot2/boot2.c This is wrong for at least i386/boot2. It isn't part of the loader, and saves space by not returning unused values. Modified: head/sys/boot/i386/boot2/boot2.c == --- head/sys/boot/i386/boot2/boot2.cThu Aug 3 03:45:48 2017 (r321968) +++ head/sys/boot/i386/boot2/boot2.cThu Aug 3 05:27:05 2017 (r321969) @@ -114,8 +114,8 @@ void exit(int); static void load(void); static int parse(void); static int dskread(void *, unsigned, unsigned); -static void printf(const char *,...); -static void putchar(int); +static int printf(const char *,...); +static int putchar(int); These are freestanding static functions, so they have nothing to do with library functions except their name is a hint that they are similar. Since they are static, -funit-at-a-time might allow the unused return values to be optimized away. Then returning unused values would be just an obfuscation. This file still has a static memcpy() which is quite different from the libc version. It doesn't return an unused value, and its arg types are all different (no newfangled size_t or newerfangled restrict). Freestanding versions (static and otherwise) cause problems with builtins. -ffreestanding turns off all builtins. The static memcpy used to be ifdefed so as to use __builtin_memcpy instead of the static one if the compiler is gcc. That apparently broke with gcc-4.2, since the builtin will call libc memcpy() in some cases, although memcpy() is unavailable in the freestanding case. Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321920 - head/sys/sys
On Thu, Aug 03, 2017 at 10:02:48AM +0200, Hans Petter Selasky wrote: > On 08/03/17 09:57, Konstantin Belousov wrote: > > .Xr mknod 2 , > > Should mknod be removed from base or stubbed in light of the more recent > devfs ? mknod is used on devfs as a way to 'undelete' devfs node. You may do rm /dev/node and then mknod /dev/node ... would restore it. Also, for UFS or other filesystems which are exported by NFS, mknod is useful to provide device nodes for non-FreeBSD clients. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321920 - head/sys/sys
On 08/03/17 09:57, Konstantin Belousov wrote: .Xr mknod 2 , Should mknod be removed from base or stubbed in light of the more recent devfs ? --HPS ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321982 - head/usr.bin/calendar/calendars
Author: hselasky Date: Thu Aug 3 08:03:22 2017 New Revision: 321982 URL: https://svnweb.freebsd.org/changeset/base/321982 Log: Add myself to the calendar. Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 3 07:56:39 2017(r321981) +++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 3 08:03:22 2017(r321982) @@ -176,6 +176,7 @@ 05/14 Tatsumi Hosokawa born in Tokyo, Japan, 1968 05/14 Shigeyuku Fukushima born in Osaka, Japan, 1974 05/14 Bruce Cran born in Cambridge, United Kingdom, 1981 +05/15 Hans Petter Selasky born in Flekkefjord, Norway, 1982 05/16 Johann Kois born in Wolfsberg, Austria, 1975 05/16 Marcus Alves Grando born in Florianopolis, Santa Catarina, Brazil, 1979 05/17 Thomas Abthorpe born in Port Arthur, Ontario, Canada, 1968 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r321920 - head/sys/sys
On Thu, Aug 03, 2017 at 01:21:56PM +1000, Bruce Evans wrote: > It would be better to remove the comments. > > makedev() actually has a man page (a FreeBSD addition makedev(3)). > This could have been better, and is now out of date. The largest error > is that major() is still documented to return a value between 0 and > 255. This reduction prevented makedev() being the inverse of > major()+minor() on arbitrary args. The man page doesn't claim that > it is, and barely gives a hint that makedev() can be used to synthesize > a dev_t from (x, y) provided 0 <= x <= 255. See below. diff --git a/share/man/man3/makedev.3 b/share/man/man3/makedev.3 index 87ca953dc79..a54d0590bc5 100644 --- a/share/man/man3/makedev.3 +++ b/share/man/man3/makedev.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2008 +.Dd August 3, 2017 .Dt MAKEDEV 3 .Os .Sh NAME @@ -54,11 +54,18 @@ and .Fn minor macros can be used to obtain the original numbers from the device number .Fa dev . +In other words, for a value +.Va dev +of the type +.Vt dev_t , +the assertion +.Dl dev == makedev(major(dev), minor(dev)) +is valid. .Pp In previous implementations of .Fx all block and character devices were uniquely identified by a pair of -major and minor numbers. +stable major and minor numbers. The major number referred to a certain device class (e.g. disks, TTYs) while the minor number identified an instance within the device class. Later versions of @@ -66,7 +73,8 @@ Later versions of automatically generate a unique device number for each character device visible in .Pa /dev/ . -These numbers are not divided in device classes. +These numbers are not divided in device classes and are not guaranteed +to be stable upon reboot or driver reload. .Pp On .Fx @@ -78,11 +86,9 @@ conventional way. .Sh RETURN VALUES The .Fn major -macro returns a device major number that has a value between 0 and 255. -The +and .Fn minor -macro returns a device minor number whose value can span the complete -range of an +macros return numbers whose value can span the complete range of an .Vt int . .Sh SEE ALSO .Xr mknod 2 , diff --git a/sys/sys/types.h b/sys/sys/types.h index 30a08724443..8ea6e146e08 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -364,9 +364,9 @@ __bitcount64(__uint64_t _x) #include -#definemajor(x)((int)((dev_t)(x) >> 32)) /* major number */ -#defineminor(x)((int)((x) & 0x)) /* minor number */ -#definemakedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ +#definemajor(x)((int)((dev_t)(x) >> 32)) +#defineminor(x)((int)((x) & 0x)) +#definemakedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* * These declarations belong elsewhere, but are repeated here and in ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321981 - stable/10/sys/dev/usb/wlan
Author: hselasky Date: Thu Aug 3 07:56:39 2017 New Revision: 321981 URL: https://svnweb.freebsd.org/changeset/base/321981 Log: MFC r321722: Properly range check length of parsed information elements in RSU driver. Found by: Ilja van Sprundel Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c == --- stable/10/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:50:46 2017 (r321980) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:56:39 2017 (r321981) @@ -1126,6 +1126,8 @@ rsu_disconnect(struct rsu_softc *sc) return (rsu_fw_cmd(sc, R92S_CMD_DISCONNECT, &zero, sizeof(zero))); } +CTASSERT(MCLBYTES > sizeof(struct ieee80211_frame)); + static void rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) { @@ -1135,34 +1137,30 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i struct ieee80211_channel *c; struct ndis_wlan_bssid_ex *bss; struct mbuf *m; - int pktlen; + uint32_t ieslen; + uint32_t pktlen; if (__predict_false(len < sizeof(*bss))) return; bss = (struct ndis_wlan_bssid_ex *)buf; - if (__predict_false(len < sizeof(*bss) + le32toh(bss->ieslen))) + ieslen = le32toh(bss->ieslen); + /* range check length of information element */ + if (__predict_false(ieslen > (uint32_t)(len - sizeof(*bss return; DPRINTFN(2, "found BSS %s: len=%d chan=%d inframode=%d " "networktype=%d privacy=%d\n", - ether_sprintf(bss->macaddr), le32toh(bss->len), + ether_sprintf(bss->macaddr), ieslen, le32toh(bss->config.dsconfig), le32toh(bss->inframode), le32toh(bss->networktype), le32toh(bss->privacy)); /* Build a fake beacon frame to let net80211 do all the parsing. */ - pktlen = sizeof(*wh) + le32toh(bss->ieslen); - if (__predict_false(pktlen > MCLBYTES)) + if (__predict_false(ieslen > (size_t)(MCLBYTES - sizeof(*wh return; - MGETHDR(m, M_NOWAIT, MT_DATA); + pktlen = sizeof(*wh) + ieslen; + m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) return; - if (pktlen > MHLEN) { - MCLGET(m, M_NOWAIT); - if (!(m->m_flags & M_EXT)) { - m_free(m); - return; - } - } wh = mtod(m, struct ieee80211_frame *); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON; @@ -1172,7 +1170,7 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i IEEE80211_ADDR_COPY(wh->i_addr2, bss->macaddr); IEEE80211_ADDR_COPY(wh->i_addr3, bss->macaddr); *(uint16_t *)wh->i_seq = 0; - memcpy(&wh[1], (uint8_t *)&bss[1], le32toh(bss->ieslen)); + memcpy(&wh[1], (uint8_t *)&bss[1], ieslen); /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; @@ -2123,13 +2121,15 @@ rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t return (0); } +CTASSERT(sizeof(size_t) >= sizeof(uint32_t)); + static int rsu_load_firmware(struct rsu_softc *sc) { const struct r92s_fw_hdr *hdr; struct r92s_fw_priv *dmem; const uint8_t *imem, *emem; - int imemsz, ememsz; + uint32_t imemsz, ememsz; const struct firmware *fw; size_t size; uint32_t reg; @@ -2178,7 +2178,8 @@ rsu_load_firmware(struct rsu_softc *sc) imemsz = le32toh(hdr->imemsz); ememsz = le32toh(hdr->sramsz); /* Check that all FW sections fit in image. */ - if (size < sizeof(*hdr) + imemsz + ememsz) { + if (imemsz > (size_t)(size - sizeof(*hdr)) || + ememsz > (size_t)(size - sizeof(*hdr) - imemsz)) { device_printf(sc->sc_dev, "firmware too short\n"); error = EINVAL; goto fail; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321980 - stable/11/sys/dev/usb/wlan
Author: hselasky Date: Thu Aug 3 07:50:46 2017 New Revision: 321980 URL: https://svnweb.freebsd.org/changeset/base/321980 Log: MFC r321722: Properly range check length of parsed information elements in RSU driver. Found by: Ilja van Sprundel Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/wlan/if_rsu.c == --- stable/11/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:42:08 2017 (r321979) +++ stable/11/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:50:46 2017 (r321980) @@ -1481,6 +1481,8 @@ rsu_hwrssi_to_rssi(struct rsu_softc *sc, int hw_rssi) return (v); } +CTASSERT(MCLBYTES > sizeof(struct ieee80211_frame)); + static void rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) { @@ -1489,28 +1491,31 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i struct ndis_wlan_bssid_ex *bss; struct ieee80211_rx_stats rxs; struct mbuf *m; - int pktlen; + uint32_t ieslen; + uint32_t pktlen; if (__predict_false(len < sizeof(*bss))) return; bss = (struct ndis_wlan_bssid_ex *)buf; - if (__predict_false(len < sizeof(*bss) + le32toh(bss->ieslen))) + ieslen = le32toh(bss->ieslen); + /* range check length of information element */ + if (__predict_false(ieslen > (uint32_t)(len - sizeof(*bss return; RSU_DPRINTF(sc, RSU_DEBUG_SCAN, "%s: found BSS %s: len=%d chan=%d inframode=%d " "networktype=%d privacy=%d, RSSI=%d\n", __func__, - ether_sprintf(bss->macaddr), le32toh(bss->len), + ether_sprintf(bss->macaddr), ieslen, le32toh(bss->config.dsconfig), le32toh(bss->inframode), le32toh(bss->networktype), le32toh(bss->privacy), le32toh(bss->rssi)); /* Build a fake beacon frame to let net80211 do all the parsing. */ /* XXX TODO: just call the new scan API methods! */ - pktlen = sizeof(*wh) + le32toh(bss->ieslen); - if (__predict_false(pktlen > MCLBYTES)) + if (__predict_false(ieslen > (size_t)(MCLBYTES - sizeof(*wh return; + pktlen = sizeof(*wh) + ieslen; m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) return; @@ -1523,7 +1528,7 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i IEEE80211_ADDR_COPY(wh->i_addr2, bss->macaddr); IEEE80211_ADDR_COPY(wh->i_addr3, bss->macaddr); *(uint16_t *)wh->i_seq = 0; - memcpy(&wh[1], (uint8_t *)&bss[1], le32toh(bss->ieslen)); + memcpy(&wh[1], (uint8_t *)&bss[1], ieslen); /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; @@ -2621,6 +2626,8 @@ rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t return (0); } +CTASSERT(sizeof(size_t) >= sizeof(uint32_t)); + static int rsu_load_firmware(struct rsu_softc *sc) { @@ -2628,7 +2635,7 @@ rsu_load_firmware(struct rsu_softc *sc) struct r92s_fw_priv *dmem; struct ieee80211com *ic = &sc->sc_ic; const uint8_t *imem, *emem; - int imemsz, ememsz; + uint32_t imemsz, ememsz; const struct firmware *fw; size_t size; uint32_t reg; @@ -2679,7 +2686,8 @@ rsu_load_firmware(struct rsu_softc *sc) imemsz = le32toh(hdr->imemsz); ememsz = le32toh(hdr->sramsz); /* Check that all FW sections fit in image. */ - if (size < sizeof(*hdr) + imemsz + ememsz) { + if (imemsz > (size_t)(size - sizeof(*hdr)) || + ememsz > (size_t)(size - sizeof(*hdr) - imemsz)) { device_printf(sc->sc_dev, "firmware too short\n"); error = EINVAL; goto fail; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321979 - head/share/misc
Author: remko Date: Thu Aug 3 07:42:08 2017 New Revision: 321979 URL: https://svnweb.freebsd.org/changeset/base/321979 Log: Update the entry for postmaster@ Reviewed by: dhw Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot == --- head/share/misc/organization.dotThu Aug 3 07:30:35 2017 (r321978) +++ head/share/misc/organization.dotThu Aug 3 07:42:08 2017 (r321979) @@ -50,7 +50,7 @@ dnsadm [label="DNS Administrators\ndns...@freebsd.org\ mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-ad...@freebsd.org\nkuriyama, kensmith"] ncvs [label="CVS src Repository Managers\nn...@freebsd.org\njoe, kuriyama, markm,\nsimon, peter"] perforceadmin [label="Perforce Repository Administrators\nperforce-ad...@freebsd.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"] -postmaster [label="Postmaster Team\npostmas...@freebsd.org\njmb, brd, sahil, dhw"] +postmaster [label="Postmaster Team\npostmas...@freebsd.org\ndhw, ler, pi, rea, remko, zi"] refadm [label="Reference Systems Administrators\nref...@freebsd.org\njake, billf, markm, simon,\nobrien, ps, kensmith,\npeter, dhw"] webmaster [label="Webmaster Team\nwebmas...@freebsd.org\ngjb, wblock, blackend,\ngabor, hrs, wosch"] ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321978 - stable/11/sys/kern
Author: kib Date: Thu Aug 3 07:30:35 2017 New Revision: 321978 URL: https://svnweb.freebsd.org/changeset/base/321978 Log: MFC r321627: Make it possible to request nosys logging to console. Modified: stable/11/sys/kern/kern_sig.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sig.c == --- stable/11/sys/kern/kern_sig.c Thu Aug 3 07:28:54 2017 (r321977) +++ stable/11/sys/kern/kern_sig.c Thu Aug 3 07:30:35 2017 (r321978) @@ -3595,9 +3595,14 @@ nosys(td, args) PROC_LOCK(p); tdsignal(td, SIGSYS); PROC_UNLOCK(p); - if (kern_lognosys) + if (kern_lognosys == 1 || kern_lognosys == 3) { uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); + } + if (kern_lognosys == 2 || kern_lognosys == 3) { + printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, + td->td_sa.code); + } return (ENOSYS); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321977 - in stable/11/sys: kern sys
Author: kib Date: Thu Aug 3 07:28:54 2017 New Revision: 321977 URL: https://svnweb.freebsd.org/changeset/base/321977 Log: MFC r321625: Make the number of children for pctrie node available outside subr_pctrie.c. Modified: stable/11/sys/kern/subr_pctrie.c stable/11/sys/sys/pctrie.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_pctrie.c == --- stable/11/sys/kern/subr_pctrie.cThu Aug 3 07:20:19 2017 (r321976) +++ stable/11/sys/kern/subr_pctrie.cThu Aug 3 07:28:54 2017 (r321977) @@ -58,18 +58,6 @@ __FBSDID("$FreeBSD$"); #include #endif -/* - * These widths should allow the pointers to a node's children to fit within - * a single cache line. The extra levels from a narrow width should not be - * a problem thanks to path compression. - */ -#ifdef __LP64__ -#definePCTRIE_WIDTH4 -#else -#definePCTRIE_WIDTH3 -#endif - -#definePCTRIE_COUNT(1 << PCTRIE_WIDTH) #definePCTRIE_MASK (PCTRIE_COUNT - 1) #definePCTRIE_LIMIT(howmany(sizeof(uint64_t) * NBBY, PCTRIE_WIDTH) - 1) Modified: stable/11/sys/sys/pctrie.h == --- stable/11/sys/sys/pctrie.h Thu Aug 3 07:20:19 2017(r321976) +++ stable/11/sys/sys/pctrie.h Thu Aug 3 07:28:54 2017(r321977) @@ -133,5 +133,18 @@ pctrie_is_empty(struct pctrie *ptree) return (ptree->pt_root == 0); } +/* + * These widths should allow the pointers to a node's children to fit within + * a single cache line. The extra levels from a narrow width should not be + * a problem thanks to path compression. + */ +#ifdef __LP64__ +#definePCTRIE_WIDTH4 +#else +#definePCTRIE_WIDTH3 +#endif + +#definePCTRIE_COUNT(1 << PCTRIE_WIDTH) + #endif /* _KERNEL */ #endif /* !_SYS_PCTRIE_H_ */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321976 - stable/11/sys/cam/ata
Author: mav Date: Thu Aug 3 07:20:19 2017 New Revision: 321976 URL: https://svnweb.freebsd.org/changeset/base/321976 Log: MFC r321606: adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE The attached patch lets adaasync() set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE instead of ADA_FLAG_CAN_RAHEAD. This fixes a regression introduced in r300207 which changed the flag names. PR: 220948 Submitted by: Fabian Keil Obtained from:ElectroBSD Modified: stable/11/sys/cam/ata/ata_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c == --- stable/11/sys/cam/ata/ata_da.c Thu Aug 3 07:17:41 2017 (r321975) +++ stable/11/sys/cam/ata/ata_da.c Thu Aug 3 07:20:19 2017 (r321976) @@ -1288,7 +1288,7 @@ adaasync(void *callback_arg, u_int32_t code, xpt_action((union ccb *)&cgd); if (ADA_RA >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD) softc->state = ADA_STATE_RAHEAD; - else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD) + else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_WCACHE) softc->state = ADA_STATE_WCACHE; else if ((softc->flags & ADA_FLAG_CAN_LOG) && (softc->zone_mode != ADA_ZONE_NONE)) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321975 - stable/11/usr.bin/w
Author: mav Date: Thu Aug 3 07:17:41 2017 New Revision: 321975 URL: https://svnweb.freebsd.org/changeset/base/321975 Log: MFC r321620: Fix singular/plural "users" output. It was broken during libxo'fication. PR: 221039 Submitted by: timur@ Modified: stable/11/usr.bin/w/w.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/w/w.c == --- stable/11/usr.bin/w/w.c Thu Aug 3 07:00:55 2017(r321974) +++ stable/11/usr.bin/w/w.c Thu Aug 3 07:17:41 2017(r321975) @@ -511,7 +511,7 @@ pr_header(time_t *nowp, int nusers) } /* Print number of users logged in to system */ - xo_emit(" {:users/%d} {N:user%s}", nusers, nusers == 1 ? "" : "s"); + xo_emit(" {:users/%d} {Np:user,users}", nusers); /* * Print 1, 5, and 15 minute load averages. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r321974 - head/usr.bin/calendar/calendars
Author: ak (ports committer) Date: Thu Aug 3 07:00:55 2017 New Revision: 321974 URL: https://svnweb.freebsd.org/changeset/base/321974 Log: Add entry to the calendar Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 3 05:55:01 2017(r321973) +++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 3 07:00:55 2017(r321974) @@ -332,6 +332,7 @@ 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 09/18 Matthew Fleming born in Cleveland, Ohio, United States, 1975 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 +09/21 Alex Kozlov born in Bila Tserkva, Ukraine, 1970 09/21 Gleb Kurtsou born in Minsk, Belarus, 1984 09/22 Alan Somers born in San Antonio, Texas, United States, 1982 09/22 Bryan Drewery born in San Diego, California, United States, 1984 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"