svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys...
Author: tsoome Date: Tue Nov 8 06:50:18 2016 New Revision: 308434 URL: https://svnweb.freebsd.org/changeset/base/308434 Log: Loader paged/pageable data is not always paged. This change does modify devsw dv_print() to return the int value, enabling walkers to interrupt the walk on non zero value from dv_print(). This will allow the pager_print actually to stop displaying data on user input, and additionally pager is used in various *dev_print callbacks, where it was missing. For test, lsdev [-v] command should display data by screenfuls and should stop when the key 'q' is pressed on pager prompt. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision:https://reviews.freebsd.org/D5461 Modified: head/lib/libstand/stand.h head/sys/boot/common/dev_net.c head/sys/boot/common/module.c head/sys/boot/common/part.c head/sys/boot/common/util.c head/sys/boot/common/util.h head/sys/boot/efi/libefi/efinet.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/efi/loader/main.c head/sys/boot/i386/libfirewire/firewire.c head/sys/boot/i386/libi386/bioscd.c head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/libi386/pxe.c head/sys/boot/mips/beri/loader/beri_disk_cfi.c head/sys/boot/mips/beri/loader/beri_disk_sdcard.c head/sys/boot/ofw/libofw/ofw_disk.c head/sys/boot/pc98/libpc98/bioscd.c head/sys/boot/pc98/libpc98/biosdisk.c head/sys/boot/powerpc/kboot/hostdisk.c head/sys/boot/powerpc/ps3/ps3cdrom.c head/sys/boot/powerpc/ps3/ps3disk.c head/sys/boot/uboot/lib/disk.c head/sys/boot/usb/storage/umass_loader.c head/sys/boot/userboot/userboot/host.c head/sys/boot/userboot/userboot/userboot_disk.c head/sys/boot/zfs/zfs.c head/sys/boot/zfs/zfsimpl.c Modified: head/lib/libstand/stand.h == --- head/lib/libstand/stand.h Tue Nov 8 06:13:22 2016(r308433) +++ head/lib/libstand/stand.h Tue Nov 8 06:50:18 2016(r308434) @@ -143,7 +143,7 @@ struct devsw { int(*dv_open)(struct open_file *f, ...); int(*dv_close)(struct open_file *f); int(*dv_ioctl)(struct open_file *f, u_long cmd, void *data); -void (*dv_print)(int verbose); /* print device information */ +int(*dv_print)(int verbose); /* print device information */ void (*dv_cleanup)(void); }; Modified: head/sys/boot/common/dev_net.c == --- head/sys/boot/common/dev_net.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/common/dev_net.c Tue Nov 8 06:50:18 2016 (r308434) @@ -80,7 +80,7 @@ static intnet_open(struct open_file *, static int net_close(struct open_file *); static voidnet_cleanup(void); static int net_strategy(); -static voidnet_print(int); +static int net_print(int); static int net_getparams(int sock); @@ -325,23 +325,27 @@ exit: return (0); } -static void +static int net_print(int verbose) { struct netif_driver *drv; int i, d, cnt; + int ret = 0; cnt = 0; for (d = 0; netif_drivers[d]; d++) { drv = netif_drivers[d]; for (i = 0; i < drv->netif_nifs; i++) { printf("\t%s%d:", "net", cnt++); - if (verbose) + if (verbose) { printf(" (%s%d)", drv->netif_bname, drv->netif_ifs[i].dif_unit); + } + if ((ret = pager_output("\n")) != 0) + return (ret); } } - printf("\n"); + return (ret); } /* Modified: head/sys/boot/common/module.c == --- head/sys/boot/common/module.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/common/module.c Tue Nov 8 06:50:18 2016 (r308434) @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[]) struct kernel_module *mp; struct file_metadata *md; char lbuf[80]; -intch, verbose; +intch, verbose, ret = 0; verbose = 0; optind = 1; @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[]) pager_open(); for (fp = preloaded_files; fp; fp = fp->f_next) { - sprintf(lbuf, " %p: ", (void *) fp->f_addr); + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); pager_output(lbuf); pager_output(fp->f_name); - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size); - pager_output(lbuf); + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, +
svn commit: r308432 - in head: bin/echo bin/sleep usr.bin/basename usr.bin/dc usr.bin/dirname usr.bin/fold usr.bin/getopt usr.bin/locate/bigram usr.bin/logname usr.bin/printenv usr.bin/yes
Author: cem Date: Tue Nov 8 05:31:01 2016 New Revision: 308432 URL: https://svnweb.freebsd.org/changeset/base/308432 Log: Capsicumize some trivial stdio programs Trivially capsicumize some simple programs that just interact with stdio. This list of programs uses 'pledge("stdio")' in OpenBSD. No objection from:allanjude, emaste, oshogbo Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D8307 Modified: head/bin/echo/echo.c head/bin/sleep/sleep.c head/usr.bin/basename/basename.c head/usr.bin/dc/dc.c head/usr.bin/dirname/dirname.c head/usr.bin/fold/fold.c head/usr.bin/getopt/getopt.c head/usr.bin/locate/bigram/locate.bigram.c head/usr.bin/logname/logname.c head/usr.bin/printenv/printenv.c head/usr.bin/yes/yes.c Modified: head/bin/echo/echo.c == --- head/bin/echo/echo.cTue Nov 8 00:24:49 2016(r308431) +++ head/bin/echo/echo.cTue Nov 8 05:31:01 2016(r308432) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -78,6 +80,9 @@ main(int argc, char *argv[]) char newline[] = "\n"; char *progname = argv[0]; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + /* This utility may NOT do getopt(3) option parsing. */ if (*++argv && !strcmp(*argv, "-n")) { ++argv; Modified: head/bin/sleep/sleep.c == --- head/bin/sleep/sleep.c Tue Nov 8 00:24:49 2016(r308431) +++ head/bin/sleep/sleep.c Tue Nov 8 05:31:01 2016(r308432) @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)sleep.c 8.3 #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -69,6 +70,9 @@ main(int argc, char *argv[]) time_t original; char buf[2]; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + if (argc != 2) usage(); Modified: head/usr.bin/basename/basename.c == --- head/usr.bin/basename/basename.cTue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/basename/basename.cTue Nov 8 05:31:01 2016 (r308432) @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)basename.c8 #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -64,6 +65,9 @@ main(int argc, char **argv) setlocale(LC_ALL, ""); + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + aflag = 0; suffix = NULL; suffixlen = 0; Modified: head/usr.bin/dc/dc.c == --- head/usr.bin/dc/dc.cTue Nov 8 00:24:49 2016(r308431) +++ head/usr.bin/dc/dc.cTue Nov 8 05:31:01 2016(r308432) @@ -22,9 +22,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include #include #include #include @@ -58,11 +60,11 @@ usage(void) } static void -procfile(char *fname) { +procfd(int fd, char *fname) { struct stat st; FILE *file; - file = fopen(fname, "r"); + file = fdopen(fd, "r"); if (file == NULL) err(1, "cannot open file %s", fname); if (fstat(fileno(file), ) == -1) @@ -80,7 +82,7 @@ procfile(char *fname) { int main(int argc, char *argv[]) { - int ch; + int ch, fd; bool extended_regs = false, preproc_done = false; /* accept and ignore a single dash to be 4.4BSD dc(1) compatible */ @@ -97,7 +99,10 @@ main(int argc, char *argv[]) case 'f': if (!preproc_done) init_bmachine(extended_regs); - procfile(optarg); + fd = open(optarg, O_RDONLY); + if (fd < 0) + err(1, "cannot open file %s", optarg); + procfd(fd, optarg); preproc_done = true; break; case 'x': @@ -126,12 +131,23 @@ main(int argc, char *argv[]) if (argc > 1) usage(); if (argc == 1) { - procfile(argv[0]); + fd = open(argv[0], O_RDONLY); + if (fd < 0) + err(1, "cannot open file %s", argv[0]); + + if (caph_limit_stream(fd, CAPH_READ) < 0 || + caph_limit_stdio() < 0 || + (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + + procfd(fd, argv[0]); preproc_done
svn commit: r308431 - head/sys/dev/nvme
Author: scottl Date: Tue Nov 8 00:24:49 2016 New Revision: 308431 URL: https://svnweb.freebsd.org/changeset/base/308431 Log: Convert the Q-Pair and PRP list memory allocations to use BUSDMA. Add a bunch of safery belts and error handling in related codepaths. Reviewed by: jimharris Obtained from:Netflix Differential Revision:D8453 Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c == --- head/sys/dev/nvme/nvme_ctrlr.c Mon Nov 7 22:41:52 2016 (r308430) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Nov 8 00:24:49 2016 (r308431) @@ -80,11 +80,12 @@ nvme_ctrlr_allocate_bar(struct nvme_cont return (0); } -static void +static int nvme_ctrlr_construct_admin_qpair(struct nvme_controller *ctrlr) { struct nvme_qpair *qpair; uint32_tnum_entries; + int error; qpair = >adminq; @@ -105,12 +106,13 @@ nvme_ctrlr_construct_admin_qpair(struct * The admin queue's max xfer size is treated differently than the * max I/O xfer size. 16KB is sufficient here - maybe even less? */ - nvme_qpair_construct(qpair, -0, /* qpair ID */ -0, /* vector */ -num_entries, -NVME_ADMIN_TRACKERS, -ctrlr); + error = nvme_qpair_construct(qpair, +0, /* qpair ID */ +0, /* vector */ +num_entries, +NVME_ADMIN_TRACKERS, +ctrlr); + return (error); } static int @@ -118,7 +120,7 @@ nvme_ctrlr_construct_io_qpairs(struct nv { struct nvme_qpair *qpair; union cap_lo_register cap_lo; - int i, num_entries, num_trackers; + int i, error, num_entries, num_trackers; num_entries = NVME_IO_ENTRIES; TUNABLE_INT_FETCH("hw.nvme.io_entries", _entries); @@ -163,12 +165,14 @@ nvme_ctrlr_construct_io_qpairs(struct nv * For I/O queues, use the controller-wide max_xfer_size * calculated in nvme_attach(). */ - nvme_qpair_construct(qpair, + error = nvme_qpair_construct(qpair, i+1, /* qpair ID */ ctrlr->msix_enabled ? i+1 : 0, /* vector */ num_entries, num_trackers, ctrlr); + if (error) + return (error); /* * Do not bother binding interrupts if we only have one I/O @@ -1098,7 +1102,8 @@ nvme_ctrlr_construct(struct nvme_control nvme_ctrlr_setup_interrupts(ctrlr); ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; - nvme_ctrlr_construct_admin_qpair(ctrlr); + if (nvme_ctrlr_construct_admin_qpair(ctrlr) != 0) + return (ENXIO); ctrlr->cdev = make_dev(_ctrlr_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "nvme%d", device_get_unit(dev)); Modified: head/sys/dev/nvme/nvme_private.h == --- head/sys/dev/nvme/nvme_private.hMon Nov 7 22:41:52 2016 (r308430) +++ head/sys/dev/nvme/nvme_private.hTue Nov 8 00:24:49 2016 (r308431) @@ -172,9 +172,8 @@ struct nvme_tracker { bus_dmamap_tpayload_dma_map; uint16_tcid; - uint64_tprp[NVME_MAX_PRP_LIST_ENTRIES]; + uint64_t*prp; bus_addr_t prp_bus_addr; - bus_dmamap_tprp_dma_map; }; struct nvme_qpair { @@ -206,10 +205,8 @@ struct nvme_qpair { bus_dma_tag_t dma_tag; bus_dma_tag_t dma_tag_payload; - bus_dmamap_tcmd_dma_map; + bus_dmamap_tqueuemem_map; uint64_tcmd_bus_addr; - - bus_dmamap_tcpl_dma_map; uint64_tcpl_bus_addr; TAILQ_HEAD(, nvme_tracker) free_tr; @@ -417,7 +414,7 @@ voidnvme_ctrlr_submit_io_request(struct void nvme_ctrlr_post_failed_request(struct nvme_controller *ctrlr, struct nvme_request *req); -void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, +intnvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t
Re: svn commit: r308230 - head/sys/dev/ioat
Nope. On Mon, Nov 7, 2016 at 12:17 PM, Ngie Cooperwrote: > On Wed, Nov 2, 2016 at 4:18 PM, Conrad E. Meyer wrote: >> Author: cem >> Date: Wed Nov 2 23:18:16 2016 >> New Revision: 308230 >> URL: https://svnweb.freebsd.org/changeset/base/308230 >> >> Log: >> ioat(4): Read CHANSTS register for suspended/halted checks >> >> The device doesn't accurately update the CHANCMP address with the device >> state >> when the device is suspended or halted. So, read the CHANSTS register to >> check >> for those states. >> >> We still need to read the CHANCMP address for the last completed >> descriptor. >> >> Sponsored by: Dell EMC Isilon > > Did anyone review this change, either external or internal to Isilon? > Thanks, > -Ngie ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308430 - head/contrib/elftoolchain/libelftc
Author: emaste Date: Mon Nov 7 22:41:52 2016 New Revision: 308430 URL: https://svnweb.freebsd.org/changeset/base/308430 Log: libelftc: add elf{32,64}-tradbigmips target emulation names Reported by: theraven Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 == --- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Nov 7 22:24:37 2016(r308429) +++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Nov 7 22:41:52 2016(r308430) @@ -82,6 +82,7 @@ Known descriptor names and their propert .It Li elf32-shbig-linux Ta ELF Ta MSB Ta 32 .It Li elf32-shl-linux Ta ELF Ta LSB Ta 32 .It Li elf32-sparc Ta ELF Ta MSB Ta 32 +.It Li elf32-tradbigmips Ta ELF Ta MSB Ta 32 .It Li elf64-alpha Ta ELF Ta LSB Ta 64 .It Li elf64-alpha-freebsd Ta ELF Ta LSB Ta 64 .It Li elf64-big Ta ELF Ta MSB Ta 64 @@ -101,6 +102,7 @@ Known descriptor names and their propert .It Li elf64-sh64-linux Ta ELF Ta LSB Ta 64 .It Li elf64-sparc Ta ELF Ta MSB Ta 64 .It Li elf64-sparc-freebsd Ta ELF Ta MSB Ta 64 +.It Li elf64-tradbigmips Ta ELF Ta MSB Ta 64 .It Li elf64-x86-64 Ta ELF Ta LSB Ta 64 .It Li elf64-x86-64-freebsd Ta ELF Ta LSB Ta 64 .It Li ihex Ta IHEX Ta - Ta - Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c == --- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Nov 7 22:24:37 2016(r308429) +++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Nov 7 22:41:52 2016(r308430) @@ -195,6 +195,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf32-tradbigmips", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2MSB, + .bt_elfclass = ELFCLASS32, + .bt_machine = EM_MIPS, + }, + + { .bt_name = "elf64-alpha", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, @@ -351,6 +359,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf64-tradbigmips", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2MSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_MIPS, + }, + + { .bt_name = "elf64-x86-64", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308429 - head/sys/dev/e1000
Author: sbruno Date: Mon Nov 7 22:24:37 2016 New Revision: 308429 URL: https://svnweb.freebsd.org/changeset/base/308429 Log: The igb driver currently requires a VF interface to have a non-zero MAC address, but the associated PF is giving the VF an all zeros MAC address when one is not administratively assigned. The driver should check for this case and generate a random address, similar to how the linux igbvf driver does. Submitted by: skoumj...@juniper.net (Scott Koumjian) MFH: 2 weeks Differential Revision:https://reviews.freebsd.org/D8399 Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c == --- head/sys/dev/e1000/if_igb.c Mon Nov 7 21:15:39 2016(r308428) +++ head/sys/dev/e1000/if_igb.c Mon Nov 7 22:24:37 2016(r308429) @@ -590,11 +590,20 @@ igb_attach(device_t dev) error = EIO; goto err_late; } - /* Check its sanity */ - if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) { - device_printf(dev, "Invalid MAC address\n"); - error = EIO; - goto err_late; + + /* Check its sanity */ + if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) { + if (adapter->vf_ifp) { + u8 addr[ETHER_ADDR_LEN]; + arc4rand(, sizeof(addr), 0); + addr[0] &= 0xFE; + addr[0] |= 0x02; + bcopy(addr, adapter->hw.mac.addr, sizeof(addr)); + } else { + device_printf(dev, "Invalid MAC address\n"); + error = EIO; + goto err_late; + } } /* Setup OS specific network interface */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308428 - in head/sys: conf dev/gpio modules/gpio/gpioled
Author: gonzo Date: Mon Nov 7 21:15:39 2016 New Revision: 308428 URL: https://svnweb.freebsd.org/changeset/base/308428 Log: Refactor FDT part of gpioled driver - Split driver in two parts: FDT and non-FDT - Instead of reattach gpioled nodes to GPIO bus use gpio_pin_get_by_ofw_idx and add ofwbus and simplebus as parrent buses Reviewed by: loos Differential Revision:https://reviews.freebsd.org/D8233 Added: head/sys/dev/gpio/gpioled_fdt.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/gpio/gpioled.c head/sys/modules/gpio/gpioled/Makefile Modified: head/sys/conf/files == --- head/sys/conf/files Mon Nov 7 20:02:18 2016(r308427) +++ head/sys/conf/files Mon Nov 7 21:15:39 2016(r308428) @@ -1612,7 +1612,8 @@ dev/gpio/gpiobus.coptional gpio \ dev/gpio/gpioc.c optional gpio \ dependency "gpio_if.h" dev/gpio/gpioiic.c optional gpioiic -dev/gpio/gpioled.c optional gpioled +dev/gpio/gpioled.c optional gpioled !fdt +dev/gpio/gpioled_fdt.c optional gpioled fdt dev/gpio/gpioregulator.c optional gpioregulator fdt ext_resources dev/gpio/gpiospi.c optional gpiospi dev/gpio/gpio_if.m optional gpio Modified: head/sys/dev/gpio/gpioled.c == --- head/sys/dev/gpio/gpioled.c Mon Nov 7 20:02:18 2016(r308427) +++ head/sys/dev/gpio/gpioled.c Mon Nov 7 21:15:39 2016(r308428) @@ -39,11 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef FDT -#include -#include -#endif - #include #include @@ -91,66 +86,9 @@ gpioled_control(void *priv, int onoff) GPIOLED_UNLOCK(sc); } -#ifdef FDT -static void -gpioled_identify(driver_t *driver, device_t bus) -{ - phandle_t child, leds, root; - - root = OF_finddevice("/"); - if (root == 0) - return; - for (leds = OF_child(root); leds != 0; leds = OF_peer(leds)) { - if (!fdt_is_compatible_strict(leds, "gpio-leds")) - continue; - /* Traverse the 'gpio-leds' node and add its children. */ - for (child = OF_child(leds); child != 0; child = OF_peer(child)) { - if (!OF_hasprop(child, "gpios")) - continue; - if (ofw_gpiobus_add_fdt_child(bus, driver->name, child) == NULL) - continue; - } - } -} -#endif - static int gpioled_probe(device_t dev) { -#ifdef FDT - int match; - phandle_t node; - char *compat; - - /* -* We can match against our own node compatible string and also against -* our parent node compatible string. The first is normally used to -* describe leds on a gpiobus and the later when there is a common node -* compatible with 'gpio-leds' which is used to concentrate all the -* leds nodes on the dts. -*/ - match = 0; - if (ofw_bus_is_compatible(dev, "gpioled")) - match = 1; - - if (match == 0) { - if ((node = ofw_bus_get_node(dev)) == -1) - return (ENXIO); - if ((node = OF_parent(node)) == -1) - return (ENXIO); - if (OF_getprop_alloc(node, "compatible", 1, - (void **)) == -1) - return (ENXIO); - - if (strcasecmp(compat, "gpio-leds") == 0) - match = 1; - - OF_prop_free(compat); - } - - if (match == 0) - return (ENXIO); -#endif device_set_desc(dev, "GPIO led"); return (BUS_PROBE_DEFAULT); @@ -161,13 +99,7 @@ gpioled_attach(device_t dev) { struct gpioled_softc *sc; int state; -#ifdef FDT - phandle_t node; - char *default_state; - char *name; -#else const char *name; -#endif sc = device_get_softc(dev); sc->sc_dev = dev; @@ -176,42 +108,14 @@ gpioled_attach(device_t dev) state = 0; -#ifdef FDT - if ((node = ofw_bus_get_node(dev)) == -1) - return (ENXIO); - - if (OF_getprop_alloc(node, "default-state", - sizeof(char), (void **)_state) != -1) { - if (strcasecmp(default_state, "on") == 0) - state = 1; - else if (strcasecmp(default_state, "off") == 0) - state = 0; - else if (strcasecmp(default_state, "keep") == 0) - state = -1; - else { - device_printf(dev, - "unknown value for default-state in FDT\n"); - } -
Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835
> On Nov 7, 2016, at 11:51 AM, Hans Petter Selaskywrote: > > On 11/07/16 20:32, Hans Petter Selasky wrote: >> On 11/07/16 20:23, Oleksandr Tymoshenko wrote: >>> On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky wrote: On 11/07/16 18:38, Oleksandr Tymoshenko wrote: > +bcm2835_audio_unlock(sc); > +cv_signal(>worker_cv); Shouldn't cv_signal() be done locked, so that you don't loose any transactions? CV's only wakeup the treads that are sleeping right there and then. >>> >>> Hi Hans, >>> >>> In this case it doesn’t matter. bcm2835_audio_xxx lock functions are >>> used to keep channel state consistent. The actual audio hw >>> reprogramming happens in worker thread which only picks up latest >>> state of the virtual channel, there is no need to run every >>> transaction in sequence. >>> >> >> Hi, >> >> It is not about running in sequence, but that if the worker thread is >> not sleeping, but on the way to sleep, it will never get woken up unless >> you use proper locks here! >> >> --HPS > > Hi, > > Also the teardown sequence for the worker thread looks a bit broken, that it > doesn't wait for the thread to exit. > > I've made a patch, attached which I think is the right way to do it. > > Try opening and closing /dev/dsp in a loop with some DSP ioctls and see what > happens. Thanks for patch Hans. Looks good to me. I’ll test and commit it. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r308230 - head/sys/dev/ioat
On Wed, Nov 2, 2016 at 4:18 PM, Conrad E. Meyerwrote: > Author: cem > Date: Wed Nov 2 23:18:16 2016 > New Revision: 308230 > URL: https://svnweb.freebsd.org/changeset/base/308230 > > Log: > ioat(4): Read CHANSTS register for suspended/halted checks > > The device doesn't accurately update the CHANCMP address with the device > state > when the device is suspended or halted. So, read the CHANSTS register to > check > for those states. > > We still need to read the CHANCMP address for the last completed descriptor. > > Sponsored by: Dell EMC Isilon Did anyone review this change, either external or internal to Isilon? Thanks, -Ngie ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308427 - head/sys/cddl/dev/dtrace/arm
Author: gonzo Date: Mon Nov 7 20:02:18 2016 New Revision: 308427 URL: https://svnweb.freebsd.org/changeset/base/308427 Log: Fix include order as required post r308415 Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S == --- head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Mon Nov 7 18:29:21 2016 (r308426) +++ head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Mon Nov 7 20:02:18 2016 (r308427) @@ -32,8 +32,8 @@ #include #include -#include #include +#include #include "assym.s" ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835
On 11/07/16 20:32, Hans Petter Selasky wrote: On 11/07/16 20:23, Oleksandr Tymoshenko wrote: On Nov 7, 2016, at 10:27 AM, Hans Petter Selaskywrote: On 11/07/16 18:38, Oleksandr Tymoshenko wrote: +bcm2835_audio_unlock(sc); +cv_signal(>worker_cv); Shouldn't cv_signal() be done locked, so that you don't loose any transactions? CV's only wakeup the treads that are sleeping right there and then. Hi Hans, In this case it doesn’t matter. bcm2835_audio_xxx lock functions are used to keep channel state consistent. The actual audio hw reprogramming happens in worker thread which only picks up latest state of the virtual channel, there is no need to run every transaction in sequence. Hi, It is not about running in sequence, but that if the worker thread is not sleeping, but on the way to sleep, it will never get woken up unless you use proper locks here! --HPS Hi, Also the teardown sequence for the worker thread looks a bit broken, that it doesn't wait for the thread to exit. I've made a patch, attached which I think is the right way to do it. Try opening and closing /dev/dsp in a loop with some DSP ioctls and see what happens. --HPS Index: sys/arm/broadcom/bcm2835/bcm2835_audio.c === --- sys/arm/broadcom/bcm2835/bcm2835_audio.c (revision 308426) +++ sys/arm/broadcom/bcm2835/bcm2835_audio.c (working copy) @@ -149,6 +149,14 @@ } static void +bcm2835_wakeup_worker(struct bcm2835_audio_info *sc) +{ + sx_xlock(>worker_lock); + cv_signal(>worker_cv); + sx_xunlock(>worker_lock); +} + +static void bcm2835_audio_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *msg_handle) { struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)param; @@ -540,6 +548,8 @@ } } } + sc->unloading = 2; + cv_signal(>worker_cv); sx_sunlock(>worker_lock); kproc_exit(0); @@ -586,8 +596,9 @@ } sc->parameters_update_pending = true; - cv_signal(>worker_cv); + bcm2835_wakeup_worker(sc); + return ch; } @@ -615,7 +626,7 @@ sc->parameters_update_pending = true; bcm2835_audio_unlock(sc); - cv_signal(>worker_cv); + bcm2835_wakeup_worker(sc); return 0; } @@ -631,7 +642,7 @@ sc->parameters_update_pending = true; bcm2835_audio_unlock(sc); - cv_signal(>worker_cv); + bcm2835_wakeup_worker(sc); return ch->spd; } @@ -662,8 +673,7 @@ bcm2835_audio_unlock(sc); /* kickstart data flow */ chn_intr(sc->pch.channel); - /* wakeup worker thread */ - cv_signal(>worker_cv); + bcm2835_wakeup_worker(sc); break; case PCMTRIG_STOP: @@ -671,7 +681,7 @@ bcm2835_audio_lock(sc); ch->playback_state = PLAYBACK_STOPPING; bcm2835_audio_unlock(sc); - cv_signal(>worker_cv); + bcm2835_wakeup_worker(sc); break; default: @@ -738,7 +748,8 @@ sc->volume = left; sc->controls_update_pending = true; bcm2835_audio_unlock(sc); - cv_signal(>worker_cv); + + bcm2835_wakeup_worker(sc); break; default: @@ -776,7 +787,7 @@ sc->controls_update_pending = true; bcm2835_audio_unlock(sc); - cv_signal(>worker_cv); + bcm2835_wakeup_worker(sc); device_printf(sc->dev, "destination set to %s\n", dest_description(val)); return (0); @@ -898,8 +909,11 @@ /* Stop worker thread */ sx_xlock(>worker_lock); sc->unloading = 1; + cv_signal(>worker_cv); + /* Wait for thread to exit */ + while (sc->unloading != 2) + cv_wait_sig(>worker_cv, >worker_lock); sx_xunlock(>worker_lock); - cv_signal(>worker_cv); r = pcm_unregister(dev); if (r) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835
On 11/07/16 20:23, Oleksandr Tymoshenko wrote: On Nov 7, 2016, at 10:27 AM, Hans Petter Selaskywrote: On 11/07/16 18:38, Oleksandr Tymoshenko wrote: + bcm2835_audio_unlock(sc); + cv_signal(>worker_cv); Shouldn't cv_signal() be done locked, so that you don't loose any transactions? CV's only wakeup the treads that are sleeping right there and then. Hi Hans, In this case it doesn’t matter. bcm2835_audio_xxx lock functions are used to keep channel state consistent. The actual audio hw reprogramming happens in worker thread which only picks up latest state of the virtual channel, there is no need to run every transaction in sequence. Hi, It is not about running in sequence, but that if the worker thread is not sleeping, but on the way to sleep, it will never get woken up unless you use proper locks here! --HPS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835
> On Nov 7, 2016, at 10:27 AM, Hans Petter Selaskywrote: > > On 11/07/16 18:38, Oleksandr Tymoshenko wrote: >> +bcm2835_audio_unlock(sc); >> +cv_signal(>worker_cv); > > > Shouldn't cv_signal() be done locked, so that you don't loose any > transactions? CV's only wakeup the treads that are sleeping right there and > then. Hi Hans, In this case it doesn’t matter. bcm2835_audio_xxx lock functions are used to keep channel state consistent. The actual audio hw reprogramming happens in worker thread which only picks up latest state of the virtual channel, there is no need to run every transaction in sequence. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835
On 11/07/16 18:38, Oleksandr Tymoshenko wrote: + bcm2835_audio_unlock(sc); + cv_signal(>worker_cv); Shouldn't cv_signal() be done locked, so that you don't loose any transactions? CV's only wakeup the treads that are sleeping right there and then. --HPS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308425 - head/sys/cam/scsi
Author: mav Date: Mon Nov 7 18:21:53 2016 New Revision: 308425 URL: https://svnweb.freebsd.org/changeset/base/308425 Log: Add support for EIIOE flag in Additional Element Status. It was added in SES-3 spec, and its support required to properly link the Additional Element Status page data to the original elements. MFC after:2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_enc_ses.c head/sys/cam/scsi/scsi_ses.h Modified: head/sys/cam/scsi/scsi_enc_ses.c == --- head/sys/cam/scsi/scsi_enc_ses.cMon Nov 7 17:38:39 2016 (r308424) +++ head/sys/cam/scsi/scsi_enc_ses.cMon Nov 7 18:21:53 2016 (r308425) @@ -1758,14 +1758,20 @@ ses_process_elm_addlstatus(enc_softc_t * eip = ses_elm_addlstatus_eip(elm_hdr); if (eip && !ignore_index) { struct ses_elm_addlstatus_eip_hdr *eip_hdr; - int expected_index; + int expected_index, index; + ses_elem_index_type_t index_type; eip_hdr = (struct ses_elm_addlstatus_eip_hdr *)elm_hdr; - expected_index = iter.individual_element_index; + if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) { + index_type = SES_ELEM_INDEX_GLOBAL; + expected_index = iter.global_element_index; + } else { + index_type = SES_ELEM_INDEX_INDIVIDUAL; + expected_index = iter.individual_element_index; + } titer = iter; telement = ses_iter_seek_to(, - eip_hdr->element_index, - SES_ELEM_INDEX_INDIVIDUAL); + eip_hdr->element_index, index_type); if (telement != NULL && (ses_typehasaddlstatus(enc, titer.type_index) != TYPE_ADDLSTATUS_NONE || @@ -1775,13 +1781,18 @@ ses_process_elm_addlstatus(enc_softc_t * } else ignore_index = 1; - if (iter.individual_element_index > expected_index + if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) + index = iter.global_element_index; + else + index = iter.individual_element_index; + if (index > expected_index && status_type == TYPE_ADDLSTATUS_MANDATORY) { - ENC_VLOG(enc, "%s: provided element " + ENC_VLOG(enc, "%s: provided %s element" "index %d skips mandatory status " " element at index %d\n", - __func__, eip_hdr->element_index, - expected_index); + __func__, (eip_hdr->byte2 & + SES_ADDL_EIP_EIIOE) ? "global " : "", + index, expected_index); } } elmpriv = element->elm_private; Modified: head/sys/cam/scsi/scsi_ses.h == --- head/sys/cam/scsi/scsi_ses.hMon Nov 7 17:38:39 2016 (r308424) +++ head/sys/cam/scsi/scsi_ses.hMon Nov 7 18:21:53 2016 (r308425) @@ -2413,7 +2413,8 @@ int ses_elm_addlstatus_invalid(struct se struct ses_elm_addlstatus_eip_hdr { struct ses_elm_addlstatus_base_hdr base; - uint8_t reserved; + uint8_t byte2; +#defineSES_ADDL_EIP_EIIOE 1 uint8_t element_index; /* NB: This define (currently) applies to all eip=1 headers */ #defineSES_EIP_HDR_EXTRA_LEN 2 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308424 - head/sys/arm/broadcom/bcm2835
Author: gonzo Date: Mon Nov 7 17:38:39 2016 New Revision: 308424 URL: https://svnweb.freebsd.org/changeset/base/308424 Log: Fix locking in bcm2835_audio driver - Move all VCHI activity to worker thread: channel methods are called with non-sleepable lock held and VCHI uses sleepable lock. - In worker thread use sx(9) lock instead of mutex(9) for the same reason. PR: 213801, 205979 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Mon Nov 7 17:34:19 2016(r308423) +++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Mon Nov 7 17:38:39 2016(r308424) @@ -104,14 +104,17 @@ struct bcm2835_audio_info { struct intr_config_hook intr_hook; /* VCHI data */ - struct mtx vchi_lock; + struct sx vchi_lock; VCHI_INSTANCE_T vchi_instance; VCHI_CONNECTION_T *vchi_connection; VCHI_SERVICE_HANDLE_T vchi_handle; - struct mtx data_lock; - struct cv data_cv; + struct sx worker_lock; + struct cv worker_cv; + + bool parameters_update_pending; + bool controls_update_pending; /* Unloadign module */ int unloading; @@ -121,8 +124,8 @@ struct bcm2835_audio_info { #define bcm2835_audio_unlock(_ess) snd_mtxunlock((_ess)->lock) #define bcm2835_audio_lock_assert(_ess) snd_mtxassert((_ess)->lock) -#define VCHIQ_VCHI_LOCK(sc)mtx_lock(&(sc)->vchi_lock) -#define VCHIQ_VCHI_UNLOCK(sc) mtx_unlock(&(sc)->vchi_lock) +#define VCHIQ_VCHI_LOCK(sc)sx_xlock(&(sc)->vchi_lock) +#define VCHIQ_VCHI_UNLOCK(sc) sx_xunlock(&(sc)->vchi_lock) static const char * dest_description(uint32_t dest) @@ -175,7 +178,7 @@ bcm2835_audio_callback(void *param, cons chn_intr(sc->pch.channel); if (perr || ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE) - cv_signal(>data_cv); + cv_signal(>worker_cv); } else printf("%s: unknown m.type: %d\n", __func__, m.type); } @@ -261,8 +264,6 @@ bcm2835_audio_start(struct bcm2835_audio if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { vchi_service_use(sc->vchi_handle); - bcm2835_audio_reset_channel(ch); - m.type = VC_AUDIO_MSG_TYPE_START; ret = vchi_msg_queue(sc->vchi_handle, , sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); @@ -324,7 +325,7 @@ bcm2835_audio_open(struct bcm2835_audio_ } static void -bcm2835_audio_update_controls(struct bcm2835_audio_info *sc) +bcm2835_audio_update_controls(struct bcm2835_audio_info *sc, uint32_t volume, uint32_t dest) { VC_AUDIO_MSG_T m; int ret, db; @@ -334,10 +335,10 @@ bcm2835_audio_update_controls(struct bcm vchi_service_use(sc->vchi_handle); m.type = VC_AUDIO_MSG_TYPE_CONTROL; - m.u.control.dest = sc->dest; - if (sc->volume > 99) - sc->volume = 99; - db = db_levels[sc->volume/5]; + m.u.control.dest = dest; + if (volume > 99) + volume = 99; + db = db_levels[volume/5]; m.u.control.volume = VCHIQ_AUDIO_VOLUME(db); ret = vchi_msg_queue(sc->vchi_handle, @@ -352,7 +353,7 @@ bcm2835_audio_update_controls(struct bcm } static void -bcm2835_audio_update_params(struct bcm2835_audio_info *sc, struct bcm2835_audio_chinfo *ch) +bcm2835_audio_update_params(struct bcm2835_audio_info *sc, uint32_t fmt, uint32_t speed) { VC_AUDIO_MSG_T m; int ret; @@ -362,9 +363,9 @@ bcm2835_audio_update_params(struct bcm28 vchi_service_use(sc->vchi_handle); m.type = VC_AUDIO_MSG_TYPE_CONFIG; - m.u.config.channels = AFMT_CHANNEL(ch->fmt); - m.u.config.samplerate = ch->spd; - m.u.config.bps = AFMT_BIT(ch->fmt); + m.u.config.channels = AFMT_CHANNEL(fmt); + m.u.config.samplerate = speed; + m.u.config.bps = AFMT_BIT(fmt); ret = vchi_msg_queue(sc->vchi_handle, , sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); @@ -474,29 +475,61 @@ bcm2835_audio_worker(void *data) { struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)data; struct bcm2835_audio_chinfo *ch = >pch; - mtx_lock(>data_lock); + uint32_t speed, format; + uint32_t volume, dest; + bool parameters_changed, controls_changed; + + sx_slock(>worker_lock); while(1) { if (sc->unloading) break; + parameters_changed = false; + controls_changed = false; +
svn commit: r308423 - head/sys/dev/mpt
Author: scottl Date: Mon Nov 7 17:34:19 2016 New Revision: 308423 URL: https://svnweb.freebsd.org/changeset/base/308423 Log: Fix the fallout from r308268 (mpt driver causes endless witness warnings in VMWare and elsewhere) with the precision of a dull, rusty butter knife. Reported by: tuexen Obtained from:Netflix Modified: head/sys/dev/mpt/mpt.c Modified: head/sys/dev/mpt/mpt.c == --- head/sys/dev/mpt/mpt.c Mon Nov 7 17:17:46 2016(r308422) +++ head/sys/dev/mpt/mpt.c Mon Nov 7 17:34:19 2016(r308423) @@ -2695,7 +2695,11 @@ mpt_configure_ioc(struct mpt_softc *mpt, */ mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1); + /* XXX Lame Locking! */ + MPT_UNLOCK(mpt); error = mpt_dma_buf_alloc(mpt); + MPT_LOCK(mpt); + if (error != 0) { mpt_prt(mpt, "mpt_dma_buf_alloc() failed!\n"); return (EIO); @@ -2745,6 +2749,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, * retrieved, we are responsible for re-downloading * the firmware after any hard-reset. */ + MPT_UNLOCK(mpt); mpt->fw_image_size = mpt->ioc_facts.FWImageSize; error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, @@ -2752,6 +2757,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, >fw_dmat); if (error != 0) { mpt_prt(mpt, "cannot create firmware dma tag\n"); + MPT_LOCK(mpt); return (ENOMEM); } error = bus_dmamem_alloc(mpt->fw_dmat, @@ -2760,6 +2766,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, if (error != 0) { mpt_prt(mpt, "cannot allocate firmware memory\n"); bus_dma_tag_destroy(mpt->fw_dmat); + MPT_LOCK(mpt); return (ENOMEM); } mi.mpt = mpt; @@ -2768,6 +2775,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->fw_image, mpt->fw_image_size, mpt_map_rquest, , 0); mpt->fw_phys = mi.phys; + MPT_LOCK(mpt); error = mpt_upload_fw(mpt); if (error != 0) { mpt_prt(mpt, "firmware upload failed.\n"); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308420 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src lib/libmagic
Author: delphij Date: Mon Nov 7 15:54:47 2016 New Revision: 308420 URL: https://svnweb.freebsd.org/changeset/base/308420 Log: MFV r308392: file 5.29. MFC after:2 weeks Added: head/contrib/file/magic/Magdir/algol68 - copied unchanged from r308392, vendor/file/dist/magic/Magdir/algol68 head/contrib/file/magic/Magdir/application - copied unchanged from r308392, vendor/file/dist/magic/Magdir/application head/contrib/file/magic/Magdir/apt - copied unchanged from r308392, vendor/file/dist/magic/Magdir/apt head/contrib/file/magic/Magdir/psl - copied unchanged from r308392, vendor/file/dist/magic/Magdir/psl Modified: head/contrib/file/ChangeLog head/contrib/file/TODO head/contrib/file/config.guess head/contrib/file/config.sub head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/doc/file.man head/contrib/file/doc/magic.man head/contrib/file/ltmain.sh head/contrib/file/magic/Magdir/animation head/contrib/file/magic/Magdir/apple head/contrib/file/magic/Magdir/bioinformatics head/contrib/file/magic/Magdir/c-lang head/contrib/file/magic/Magdir/claris head/contrib/file/magic/Magdir/commands head/contrib/file/magic/Magdir/compress head/contrib/file/magic/Magdir/cups head/contrib/file/magic/Magdir/editors head/contrib/file/magic/Magdir/filesystems head/contrib/file/magic/Magdir/fonts head/contrib/file/magic/Magdir/gcc head/contrib/file/magic/Magdir/gnu head/contrib/file/magic/Magdir/images head/contrib/file/magic/Magdir/jpeg head/contrib/file/magic/Magdir/msdos head/contrib/file/magic/Magdir/pgp head/contrib/file/magic/Magdir/python head/contrib/file/magic/Magdir/ruby head/contrib/file/magic/Magdir/sgml head/contrib/file/magic/Magdir/sql head/contrib/file/magic/Makefile.am head/contrib/file/magic/Makefile.in head/contrib/file/python/magic.py head/contrib/file/src/apprentice.c head/contrib/file/src/ascmagic.c head/contrib/file/src/cdf.c head/contrib/file/src/cdf.h head/contrib/file/src/compress.c head/contrib/file/src/der.c head/contrib/file/src/file.c head/contrib/file/src/file.h head/contrib/file/src/funcs.c head/contrib/file/src/magic.c head/contrib/file/src/readcdf.c head/contrib/file/src/readelf.c head/contrib/file/src/softmagic.c head/lib/libmagic/config.h Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog == --- head/contrib/file/ChangeLog Mon Nov 7 14:07:11 2016(r308419) +++ head/contrib/file/ChangeLog Mon Nov 7 15:54:47 2016(r308420) @@ -1,3 +1,32 @@ +2016-10-25 10:40 Christos Zoulas+ + * release 5.28 + +2016-10-24 11:20 Christos Zoulas + + * der getlength overflow (Jonas Wagner) + * multiple magic file load failure (Christoph Biedl) + +2016-10-17 11:26 Christos Zoulas + + * CDF parsing improvements (Guy Helmer) + +2016-07-20 7:26 Christos Zoulas + + * Add support for signed indirect offsets + +2016-07-18 7:41 Christos Zoulas + + * cat /dev/null | file - should print empty (Christoph Biedl) + +2016-07-05 15:20 Christos Zoulas + + * Bump string size from 64 to 96. + +2016-06-13 20:20 Christos Zoulas + + * PR/556: Fix separators on annotations. + 2016-06-13 19:40 Christos Zoulas * release 5.28 Modified: head/contrib/file/TODO == --- head/contrib/file/TODO Mon Nov 7 14:07:11 2016(r308419) +++ head/contrib/file/TODO Mon Nov 7 15:54:47 2016(r308420) @@ -6,7 +6,6 @@ file, not here. More speculative materia listed in the BUGS section of the man page had been fixed!) --- - It would be nice to simplify file considerably. For example, reimplement the apprentice and non-pattern magic methods in Python, and compile the magic patterns to a giant regex (or something similar; @@ -15,8 +14,23 @@ small amount of C is needed (because fas required for soft magic, not the more detailed information given by hard-wired routines). In this regard, note that hplip, which is BSD-licensed, has a magic reimplementation in Python. - +--- Read the kerberos magic entry for more ideas. - +--- Write a string merger to make magic entry sizes dynamic. Strings will be converted to offsets from the string table. +--- +Programming language support, we can introduce the concept of a group +of rules where n rules need to match before the rule is positive. This +could require structural changes to the matching code :-( + +0 group 2 # require 2 matches +# rule 1 +>0 +... +# rule 2 +>0 +... + +christos + Modified: head/contrib/file/config.guess
Re: svn commit: r308345 - head/sys/dev/e1000
On Monday, November 07, 2016 07:02:23 AM Sean Bruno wrote: > > On 11/05/16 17:16, John Baldwin wrote: > > On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: > >> Author: sbruno > >> Date: Sat Nov 5 16:30:42 2016 > >> New Revision: 308345 > >> URL: https://svnweb.freebsd.org/changeset/base/308345 > >> > >> Log: > >> r295133 attempted to deactivate TSO in the 100Mbit link case with this > >> adapter to work around bugs in TSO handling at this speed. > >> > >> em_init_locked is called during first boot of the adapter and will > >> see that link_speed is unitialized, effectively turning off tso for > >> all cards at all speeds, which I believe was *not* the intent. > >> > >> Move the handling of TSO deactivation to the link handler where we can > >> more effectively make the decision about what to do. In addition, > >> completely purge the TSO capabilities instead of disabling just CSUM_TSO. > >> > >> Thanks to jhb for explanation of the hw capabilites api. > >> > >> Thanks to royger and cognet for testing the 100Mbit failure case to > >> ensure that their adapters do indeed still work. > >> > >> MFC after: 1 week > >> Sponsored by:Limelight Networks > >> > >> Modified: > >> head/sys/dev/e1000/if_em.c > >> > >> Modified: head/sys/dev/e1000/if_em.c > >> == > >> --- head/sys/dev/e1000/if_em.c Sat Nov 5 16:23:33 2016 > >> (r308344) > >> +++ head/sys/dev/e1000/if_em.c Sat Nov 5 16:30:42 2016 > >> (r308345) > >> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); > >> #define MAX_INTS_PER_SEC 8000 > >> #define DEFAULT_ITR (10/(MAX_INTS_PER_SEC * 256)) > >> > >> -/* Allow common code without TSO */ > >> -#ifndef CSUM_TSO > >> -#define CSUM_TSO 0 > >> -#endif > >> - > >> #define TSO_WORKAROUND4 > >> > >> static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver > >> parameters"); > >> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) > >>if_clearhwassist(ifp); > >>if (if_getcapenable(ifp) & IFCAP_TXCSUM) > >>if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); > >> - /* > >> - ** There have proven to be problems with TSO when not > >> - ** at full gigabit speed, so disable the assist automatically > >> - ** when at lower speeds. -jfv > >> - */ > >> - if (if_getcapenable(ifp) & IFCAP_TSO4) { > >> - if (adapter->link_speed == SPEED_1000) > >> - if_sethwassistbits(ifp, CSUM_TSO, 0); > >> - } > >> + > >> + if (if_getcapenable(ifp) & IFCAP_TSO4) > >> + if_sethwassistbits(ifp, CSUM_TSO, 0); > > > > Does this always disable TSO? Should this part be removed entirely? > > (That is, it seems like this would disable TSO even on Gigabit links). > > > > I was confused by this question. The old code *always* disabled TSO > because link_speed was always 0 here on boot. My intention is to ensure > that CSUM_TSO is set if IFCAP_TSO4 is set. Oh, I misread the code. It is setting CSUM_TSO and clearing 0. I think you probably don't need this as the flag can only be set in capenable by an ioctl handler that sets the flag to true (and the calling ioctl code should update hwassist for you). Oh, the driver does 'if_clearhwassist()' above this. How... unfortunate. I think that since you are now handling this in 'update_link_status' that you can instead remove this whole block starting with 'if_clearhwassist()' and ending with the 'if_sethwassist' for CSUM_TSO. That is, you can now leave if_hwasssist alone in em_init_locked() and not change it. > >>/* Configure for OS presence */ > >>em_init_manageability(adapter); > >> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad > >>if (link_check && (adapter->link_active == 0)) { > >>e1000_get_speed_and_duplex(hw, >link_speed, > >>>link_duplex); > >> + /* > >> + ** There have proven to be problems with TSO when not > >> + ** at full gigabit speed, so disable the assist automatically > >> + ** when at lower speeds. -jfv > >> + */ > >> + if (adapter->link_speed != SPEED_1000) { > >> + if_sethwassistbits(ifp, 0, CSUM_TSO); > >> + if_setcapenablebit(ifp, 0, IFCAP_TSO4); > >> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); > >> + > >> + } > > > > Even though I suggested it, I wonder if it wouldn't be better to only > > modify if_capenable and not if_capabilities, that way the admin can > > decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving > > an adapter from 100 to 1G). > > > > I spent several hours trying to come up with logic that would allow me > to allow the user to do this. I am open to suggestions here, but it > would require quite a bit more finesse than my "big hammer" approach. I think you just need to remove
svn commit: r308419 - head/tools/tools/nanobsd/embedded
Author: andrew Date: Mon Nov 7 14:07:11 2016 New Revision: 308419 URL: https://svnweb.freebsd.org/changeset/base/308419 Log: Use the armv6 GENERIC in the qemu nanobsd image. Sponsored by: ABT Systems Ltd Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg == --- head/tools/tools/nanobsd/embedded/qemu-armv7.cfgMon Nov 7 12:10:17 2016(r308418) +++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfgMon Nov 7 14:07:11 2016(r308419) @@ -29,7 +29,7 @@ NANO_ARCH=armv6 NANO_DRIVE=vtbd0 -NANO_KERNEL=VIRT +NANO_KERNEL=GENERIC NANO_NAME=qemu-armv7 NANO_LAYOUT=std-uefi-bios NANO_CPUTYPE=cortexa ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r308345 - head/sys/dev/e1000
On 11/06/16 23:37, Sepherosa Ziehau wrote: > On Sun, Nov 6, 2016 at 7:16 AM, John Baldwinwrote: >> On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: >>> Author: sbruno >>> Date: Sat Nov 5 16:30:42 2016 >>> New Revision: 308345 >>> URL: https://svnweb.freebsd.org/changeset/base/308345 >>> >>> Log: >>> r295133 attempted to deactivate TSO in the 100Mbit link case with this >>> adapter to work around bugs in TSO handling at this speed. >>> >>> em_init_locked is called during first boot of the adapter and will >>> see that link_speed is unitialized, effectively turning off tso for >>> all cards at all speeds, which I believe was *not* the intent. >>> >>> Move the handling of TSO deactivation to the link handler where we can >>> more effectively make the decision about what to do. In addition, >>> completely purge the TSO capabilities instead of disabling just CSUM_TSO. >>> >>> Thanks to jhb for explanation of the hw capabilites api. >>> >>> Thanks to royger and cognet for testing the 100Mbit failure case to >>> ensure that their adapters do indeed still work. >>> >>> MFC after: 1 week >>> Sponsored by: Limelight Networks >>> >>> Modified: >>> head/sys/dev/e1000/if_em.c >>> >>> Modified: head/sys/dev/e1000/if_em.c >>> == >>> --- head/sys/dev/e1000/if_em.cSat Nov 5 16:23:33 2016 >>> (r308344) >>> +++ head/sys/dev/e1000/if_em.cSat Nov 5 16:30:42 2016 >>> (r308345) >>> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); >>> #define MAX_INTS_PER_SEC 8000 >>> #define DEFAULT_ITR (10/(MAX_INTS_PER_SEC * 256)) >>> >>> -/* Allow common code without TSO */ >>> -#ifndef CSUM_TSO >>> -#define CSUM_TSO 0 >>> -#endif >>> - >>> #define TSO_WORKAROUND 4 >>> >>> static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver >>> parameters"); >>> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) >>> if_clearhwassist(ifp); >>> if (if_getcapenable(ifp) & IFCAP_TXCSUM) >>> if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); >>> - /* >>> - ** There have proven to be problems with TSO when not >>> - ** at full gigabit speed, so disable the assist automatically >>> - ** when at lower speeds. -jfv >>> - */ >>> - if (if_getcapenable(ifp) & IFCAP_TSO4) { >>> - if (adapter->link_speed == SPEED_1000) >>> - if_sethwassistbits(ifp, CSUM_TSO, 0); >>> - } >>> + >>> + if (if_getcapenable(ifp) & IFCAP_TSO4) >>> + if_sethwassistbits(ifp, CSUM_TSO, 0); >> >> Does this always disable TSO? Should this part be removed entirely? >> (That is, it seems like this would disable TSO even on Gigabit links). >> >>> /* Configure for OS presence */ >>> em_init_manageability(adapter); >>> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad >>> if (link_check && (adapter->link_active == 0)) { >>> e1000_get_speed_and_duplex(hw, >link_speed, >>> >link_duplex); >>> + /* >>> + ** There have proven to be problems with TSO when not >>> + ** at full gigabit speed, so disable the assist automatically >>> + ** when at lower speeds. -jfv >>> + */ >>> + if (adapter->link_speed != SPEED_1000) { >>> + if_sethwassistbits(ifp, 0, CSUM_TSO); >>> + if_setcapenablebit(ifp, 0, IFCAP_TSO4); >>> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); >>> + >>> + } >> >> Even though I suggested it, I wonder if it wouldn't be better to only >> modify if_capenable and not if_capabilities, that way the admin can >> decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving >> an adapter from 100 to 1G). > > I believe simply clearing CSUM_TSO should work for the TCP stack; > messing administrative like capenable and hwcaps does not sound > correct to me. > I don't disagree, but I also don't have an opinion. What I didn't want, was a continuation of the half disabled/half enabled TSO code path that we had prior to this change. > As for this patch, do you need to re-enable TSO once link speed > becomes 1000Mbps? Probably? There wasn't a clear way to flip this back on that I could find that would catch the case of "link speed was 100 and is now 1000". BTW, since the link status check/update is async w/ > the TX path, does this really work, if there are TSO packets pending > on the TX rings (let alone inflight TSO packets from the TCP stack) > when the link speed changed to 100Mbps? TSO packets that are "pending" will continue out their path, AFAIK. I don't believe that a link speed change from 1000 to 100 is a very common occurrence, but I'm willing to change the code to something more "graceful" if you have an idea of how to do it. sean
Re: svn commit: r308345 - head/sys/dev/e1000
On 11/05/16 17:16, John Baldwin wrote: > On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: >> Author: sbruno >> Date: Sat Nov 5 16:30:42 2016 >> New Revision: 308345 >> URL: https://svnweb.freebsd.org/changeset/base/308345 >> >> Log: >> r295133 attempted to deactivate TSO in the 100Mbit link case with this >> adapter to work around bugs in TSO handling at this speed. >> >> em_init_locked is called during first boot of the adapter and will >> see that link_speed is unitialized, effectively turning off tso for >> all cards at all speeds, which I believe was *not* the intent. >> >> Move the handling of TSO deactivation to the link handler where we can >> more effectively make the decision about what to do. In addition, >> completely purge the TSO capabilities instead of disabling just CSUM_TSO. >> >> Thanks to jhb for explanation of the hw capabilites api. >> >> Thanks to royger and cognet for testing the 100Mbit failure case to >> ensure that their adapters do indeed still work. >> >> MFC after: 1 week >> Sponsored by: Limelight Networks >> >> Modified: >> head/sys/dev/e1000/if_em.c >> >> Modified: head/sys/dev/e1000/if_em.c >> == >> --- head/sys/dev/e1000/if_em.c Sat Nov 5 16:23:33 2016 >> (r308344) >> +++ head/sys/dev/e1000/if_em.c Sat Nov 5 16:30:42 2016 >> (r308345) >> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); >> #define MAX_INTS_PER_SEC8000 >> #define DEFAULT_ITR (10/(MAX_INTS_PER_SEC * 256)) >> >> -/* Allow common code without TSO */ >> -#ifndef CSUM_TSO >> -#define CSUM_TSO0 >> -#endif >> - >> #define TSO_WORKAROUND 4 >> >> static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver >> parameters"); >> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) >> if_clearhwassist(ifp); >> if (if_getcapenable(ifp) & IFCAP_TXCSUM) >> if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); >> -/* >> -** There have proven to be problems with TSO when not >> -** at full gigabit speed, so disable the assist automatically >> -** when at lower speeds. -jfv >> -*/ >> -if (if_getcapenable(ifp) & IFCAP_TSO4) { >> -if (adapter->link_speed == SPEED_1000) >> -if_sethwassistbits(ifp, CSUM_TSO, 0); >> -} >> + >> +if (if_getcapenable(ifp) & IFCAP_TSO4) >> +if_sethwassistbits(ifp, CSUM_TSO, 0); > > Does this always disable TSO? Should this part be removed entirely? > (That is, it seems like this would disable TSO even on Gigabit links). > I was confused by this question. The old code *always* disabled TSO because link_speed was always 0 here on boot. My intention is to ensure that CSUM_TSO is set if IFCAP_TSO4 is set. >> /* Configure for OS presence */ >> em_init_manageability(adapter); >> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad >> if (link_check && (adapter->link_active == 0)) { >> e1000_get_speed_and_duplex(hw, >link_speed, >> >link_duplex); >> +/* >> +** There have proven to be problems with TSO when not >> +** at full gigabit speed, so disable the assist automatically >> +** when at lower speeds. -jfv >> +*/ >> +if (adapter->link_speed != SPEED_1000) { >> +if_sethwassistbits(ifp, 0, CSUM_TSO); >> +if_setcapenablebit(ifp, 0, IFCAP_TSO4); >> +if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); >> + >> +} > > Even though I suggested it, I wonder if it wouldn't be better to only > modify if_capenable and not if_capabilities, that way the admin can > decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving > an adapter from 100 to 1G). > I spent several hours trying to come up with logic that would allow me to allow the user to do this. I am open to suggestions here, but it would require quite a bit more finesse than my "big hammer" approach. sean signature.asc Description: OpenPGP digital signature
svn commit: r308417 - head/sys/arm/ti
Author: andrew Date: Mon Nov 7 11:56:18 2016 New Revision: 308417 URL: https://svnweb.freebsd.org/changeset/base/308417 Log: Fix the order of includes so machine/asm.h is first. MFC after:1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/ti/ti_smc.S Modified: head/sys/arm/ti/ti_smc.S == --- head/sys/arm/ti/ti_smc.SMon Nov 7 11:39:45 2016(r308416) +++ head/sys/arm/ti/ti_smc.SMon Nov 7 11:56:18 2016(r308417) @@ -22,10 +22,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include __FBSDID("$FreeBSD$"); +#include + .cpu cortex-a8 .arch_extension sec ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308416 - head/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Mon Nov 7 11:39:45 2016 New Revision: 308416 URL: https://svnweb.freebsd.org/changeset/base/308416 Log: Add timer to watch the RQ when we are out of mbufs. The firmware/hardware does not generate additional completion events unless we post new buffers. Use a timer to try to post more buffers in case we are temporarily out of mbufs. Else the receive schedule completely stops. Sponsored by: Mellanox Technologies MFC after:1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h == --- head/sys/dev/mlx5/mlx5_en/en.h Mon Nov 7 11:35:14 2016 (r308415) +++ head/sys/dev/mlx5/mlx5_en/en.h Mon Nov 7 11:39:45 2016 (r308416) @@ -478,6 +478,7 @@ struct mlx5e_rq { struct mlx5_wq_ctrl wq_ctrl; u32 rqn; struct mlx5e_channel *channel; + struct callout watchdog; } __aligned(MLX5E_CACHELINE_SIZE); struct mlx5e_sq_mbuf { Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c == --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cMon Nov 7 11:35:14 2016 (r308415) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cMon Nov 7 11:39:45 2016 (r308416) @@ -855,7 +855,13 @@ err_destroy_rq: static void mlx5e_close_rq(struct mlx5e_rq *rq) { + mtx_lock(>mtx); rq->enabled = 0; + callout_stop(>watchdog); + mtx_unlock(>mtx); + + callout_drain(>watchdog); + mlx5e_modify_rq(rq, MLX5_RQC_STATE_RDY, MLX5_RQC_STATE_ERR); } @@ -1439,6 +1445,8 @@ mlx5e_chan_mtx_init(struct mlx5e_channel mtx_init(>rq.mtx, "mlx5rx", MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(>rq.watchdog, >rq.mtx, 0); + for (tc = 0; tc < c->num_tc; tc++) { struct mlx5e_sq *sq = c->sq + tc; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c == --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Nov 7 11:35:14 2016 (r308415) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Nov 7 11:39:45 2016 (r308416) @@ -82,9 +82,10 @@ mlx5e_post_rx_wqes(struct mlx5e_rq *rq) while (!mlx5_wq_ll_is_full(>wq)) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(>wq, rq->wq.head); - if (unlikely(mlx5e_alloc_rx_wqe(rq, wqe, rq->wq.head))) + if (unlikely(mlx5e_alloc_rx_wqe(rq, wqe, rq->wq.head))) { + callout_reset_curcpu(>watchdog, 1, (void *)_post_rx_wqes, rq); break; - + } mlx5_wq_ll_push(>wq, be16_to_cpu(wqe->next.next_wqe_index)); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308415 - head/sys/arm/include
Author: sgalabov Date: Mon Nov 7 11:35:14 2016 New Revision: 308415 URL: https://svnweb.freebsd.org/changeset/base/308415 Log: Generate an error if machine/armreg.h is included without sys/cdefs.h machine/armreg.h requires access to the __ARM_ARCH macro, which is not always properly defined (especially by gcc 4.2.1). We should include sys/cdefs.h in order to get the definitions in machine/acle-compat.h, which would properly define the __ARM_ARCH macro in these cases. So, in cases where machine/armreg.h is included without _SYS_CDEFS_H_ being defined - generate an #error. Reviewed by: andrew Sponsored by: Smartcom - Bulgaria AD Differential Revision:https://reviews.freebsd.org/D8460 Modified: head/sys/arm/include/armreg.h Modified: head/sys/arm/include/armreg.h == --- head/sys/arm/include/armreg.h Mon Nov 7 11:28:50 2016 (r308414) +++ head/sys/arm/include/armreg.h Mon Nov 7 11:35:14 2016 (r308415) @@ -41,6 +41,10 @@ #ifndef MACHINE_ARMREG_H #define MACHINE_ARMREG_H +#ifndef _SYS_CDEFS_H_ +#error Please include sys/cdefs.h before including machine/armreg.h +#endif + #define INSN_SIZE 4 #define INSN_COND_MASK 0xf000 /* Condition mask */ #define PSR_MODE0x001f /* mode mask */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308414 - in head/sys/dev/mlx5: . mlx5_core
Author: hselasky Date: Mon Nov 7 11:28:50 2016 New Revision: 308414 URL: https://svnweb.freebsd.org/changeset/base/308414 Log: Add more firmware related structures and update existing ones in the MLX5 core module. Update the set and query diagnostics counter API. Sponsored by: Mellanox Technologies MFC after:1 week Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/dev/mlx5/qp.h Modified: head/sys/dev/mlx5/device.h == --- head/sys/dev/mlx5/device.h Mon Nov 7 11:26:25 2016(r308413) +++ head/sys/dev/mlx5/device.h Mon Nov 7 11:28:50 2016(r308414) @@ -1271,9 +1271,11 @@ enum { MLX5_RFC_2819_COUNTERS_GROUP = 0x2, MLX5_RFC_3635_COUNTERS_GROUP = 0x3, MLX5_ETHERNET_EXTENDED_COUNTERS_GROUP = 0x5, + MLX5_ETHERNET_DISCARD_COUNTERS_GROUP = 0x6, MLX5_PER_PRIORITY_COUNTERS_GROUP = 0x10, MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP= 0x12, + MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20, }; enum { Modified: head/sys/dev/mlx5/driver.h == --- head/sys/dev/mlx5/driver.h Mon Nov 7 11:26:25 2016(r308413) +++ head/sys/dev/mlx5/driver.h Mon Nov 7 11:28:50 2016(r308414) @@ -120,6 +120,7 @@ enum { MLX5_REG_QETCR = 0x4005, MLX5_REG_QPDP= 0x4007, MLX5_REG_QTCT= 0x400A, + MLX5_REG_QHLL= 0x4016, MLX5_REG_DCBX_PARAM = 0x4020, MLX5_REG_DCBX_APP= 0x4021, MLX5_REG_PCAP= 0x5001, @@ -954,9 +955,11 @@ int mlx5_modify_port_cong_params(struct void *in, int in_size); int mlx5_query_port_cong_statistics(struct mlx5_core_dev *mdev, int clear, void *out, int out_size); -int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size); -int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, - u16 sample_index, void *out, int out_size); +int mlx5_set_diagnostic_params(struct mlx5_core_dev *mdev, void *in, + int in_size); +int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev, + u8 num_of_samples, u16 sample_index, + void *out, int out_size); static inline u32 mlx5_mkey_to_idx(u32 mkey) { return mkey >> 8; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c == --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Nov 7 11:26:25 2016 (r308413) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Nov 7 11:28:50 2016 (r308414) @@ -831,28 +831,32 @@ int mlx5_query_port_cong_statistics(stru out, out_size); } -int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size) +int mlx5_set_diagnostic_params(struct mlx5_core_dev *mdev, void *in, + int in_size) { - u32 out[MLX5_ST_SZ_DW(set_diagnostics_out)]; + u32 out[MLX5_ST_SZ_DW(set_diagnostic_params_out)]; memset(out, 0, sizeof(out)); - MLX5_SET(set_diagnostics_in, in, opcode, MLX5_CMD_OP_SET_DIAGNOSTICS); + MLX5_SET(set_diagnostic_params_in, in, opcode, +MLX5_CMD_OP_SET_DIAGNOSTICS); return mlx5_cmd_exec_check_status(mdev, in, in_size, out, sizeof(out)); } -int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, - u16 sample_index, void *out, int out_size) +int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev, + u8 num_of_samples, u16 sample_index, + void *out, int out_size) { - u32 in[MLX5_ST_SZ_DW(query_diagnostics_in)]; + u32 in[MLX5_ST_SZ_DW(query_diagnostic_counters_in)]; memset(in, 0, sizeof(in)); - MLX5_SET(query_diagnostics_in, in, opcode, + MLX5_SET(query_diagnostic_counters_in, in, opcode, MLX5_CMD_OP_QUERY_DIAGNOSTICS); - MLX5_SET(query_diagnostics_in, in, num_of_samples, num_of_samples); - MLX5_SET(query_diagnostics_in, in, sample_index, sample_index); + MLX5_SET(query_diagnostic_counters_in, in, num_of_samples, +num_of_samples); + MLX5_SET(query_diagnostic_counters_in, in, sample_index, sample_index); return mlx5_cmd_exec_check_status(mdev, in, sizeof(in), out, out_size); } Modified: head/sys/dev/mlx5/mlx5_ifc.h == --- head/sys/dev/mlx5/mlx5_ifc.hMon Nov 7 11:26:25
svn commit: r308413 - head/sys/dev/mlx5/mlx5_core
Author: hselasky Date: Mon Nov 7 11:26:25 2016 New Revision: 308413 URL: https://svnweb.freebsd.org/changeset/base/308413 Log: Query flow table capabilities according to the correct capability bit for infiniband. Sponsored by: Mellanox Technologies MFC after:1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c == --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Mon Nov 7 11:22:50 2016 (r308412) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Mon Nov 7 11:26:25 2016 (r308413) @@ -167,7 +167,11 @@ int mlx5_query_hca_caps(struct mlx5_core return err; } - if (MLX5_CAP_GEN(dev, nic_flow_table)) { + if ((MLX5_CAP_GEN(dev, port_type) == + MLX5_CMD_HCA_CAP_PORT_TYPE_ETHERNET && + MLX5_CAP_GEN(dev, nic_flow_table)) || + (MLX5_CAP_GEN(dev, port_type) == MLX5_CMD_HCA_CAP_PORT_TYPE_IB && + MLX5_CAP_GEN(dev, ipoib_enhanced_offloads))) { err = mlx5_core_get_caps(dev, MLX5_CAP_FLOW_TABLE, HCA_CAP_OPMOD_GET_CUR); if (err) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308412 - head/sys/dev/mlx5
Author: hselasky Date: Mon Nov 7 11:22:50 2016 New Revision: 308412 URL: https://svnweb.freebsd.org/changeset/base/308412 Log: Correct checksum fields in the "mlx5_mini_cqe8" structure. The fields in question are currently not used. Sponsored by: Mellanox Technologies MFC after:1 week Modified: head/sys/dev/mlx5/device.h Modified: head/sys/dev/mlx5/device.h == --- head/sys/dev/mlx5/device.h Mon Nov 7 11:20:13 2016(r308411) +++ head/sys/dev/mlx5/device.h Mon Nov 7 11:22:50 2016(r308412) @@ -1348,15 +1348,16 @@ struct mlx5_ifc_mcia_reg_bits { struct mlx5_mini_cqe8 { union { - u32 rx_hash_result; - u32 checksum; + __be32 rx_hash_result; + __be16 checksum; + __be16 rsvd; struct { - u16 wqe_counter; + __be16 wqe_counter; u8 s_wqe_opcode; u8 reserved; } s_wqe_info; }; - u32 byte_cnt; + __be32 byte_cnt; }; enum { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308411 - head/sys/dev/mlx5/mlx5_core
Author: hselasky Date: Mon Nov 7 11:20:13 2016 New Revision: 308411 URL: https://svnweb.freebsd.org/changeset/base/308411 Log: Ensure the firmware is notified of any host memory allocation failures. Else firmware commands may time out waiting for host memory. Sponsored by: Mellanox Technologies MFC after:1 week 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.cMon Nov 7 11:16:23 2016(r308410) +++ head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cMon Nov 7 11:20:13 2016(r308411) @@ -246,13 +246,14 @@ static int give_pages(struct mlx5_core_d int inlen; u64 addr; int err; - int i; + int i = 0; inlen = sizeof(*in) + npages * sizeof(in->pas[0]); in = mlx5_vzalloc(inlen); if (!in) { mlx5_core_warn(dev, "vzalloc failed %d\n", inlen); - return -ENOMEM; + err = -ENOMEM; + goto out_alloc; } memset(, 0, sizeof(out)); @@ -263,7 +264,7 @@ retry: if (err == -ENOMEM) err = alloc_system_page(dev, func_id); if (err) - goto out_4k; + goto out_alloc; goto retry; } @@ -301,12 +302,11 @@ out_alloc: memset(, 0, sizeof(out)); nin->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_MANAGE_PAGES); nin->hdr.opmod = cpu_to_be16(MLX5_PAGES_CANT_GIVE); + nin->func_id = cpu_to_be16(func_id); if (mlx5_cmd_exec(dev, nin, sizeof(*nin), , sizeof(out))) mlx5_core_warn(dev, "page notify failed\n"); kfree(nin); } - -out_4k: for (i--; i >= 0; i--) free_4k(dev, be64_to_cpu(in->pas[i])); out_free: ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308409 - head/sys/dev/mlx5/mlx5_core
Author: hselasky Date: Mon Nov 7 11:15:40 2016 New Revision: 308409 URL: https://svnweb.freebsd.org/changeset/base/308409 Log: When a firmware command times out do not free the command structure to avoid use after free. Sponsored by: Mellanox Technologies MFC after:1 week 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 Mon Nov 7 11:01:09 2016 (r308408) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Nov 7 11:15:40 2016 (r308409) @@ -1245,8 +1245,11 @@ static int cmd_exec_helper(struct mlx5_c err = mlx5_cmd_invoke(dev, inb, outb, out, out_size, callback, context, pages_queue, ); - if (err) + if (err) { + if (err == -ETIMEDOUT) + return err; goto out_out; + } mlx5_core_dbg(dev, "err %d, status %d\n", err, status); if (status) { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308408 - head/sys/arm/arm
Author: andrew Date: Mon Nov 7 11:01:09 2016 New Revision: 308408 URL: https://svnweb.freebsd.org/changeset/base/308408 Log: Include machine/armreg.h after machine/asm.h to ensure __ARM_ARCH is defined. MFC after:1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S head/sys/arm/arm/cpufunc_asm_xscale.S head/sys/arm/arm/cpufunc_asm_xscale_c3.S head/sys/arm/arm/fiq_subr.S head/sys/arm/arm/setstack.s Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S == --- head/sys/arm/arm/cpufunc_asm_sheeva.S Mon Nov 7 10:55:56 2016 (r308407) +++ head/sys/arm/arm/cpufunc_asm_sheeva.S Mon Nov 7 11:01:09 2016 (r308408) @@ -29,10 +29,10 @@ * SUCH DAMAGE. */ -#include #include __FBSDID("$FreeBSD$"); +#include #include .Lsheeva_cache_line_size: Modified: head/sys/arm/arm/cpufunc_asm_xscale.S == --- head/sys/arm/arm/cpufunc_asm_xscale.S Mon Nov 7 10:55:56 2016 (r308407) +++ head/sys/arm/arm/cpufunc_asm_xscale.S Mon Nov 7 11:01:09 2016 (r308408) @@ -71,10 +71,11 @@ * * XScale assembly functions for CPU / MMU / TLB specific operations */ -#include #include __FBSDID("$FreeBSD$"); +#include + /* * Size of the XScale core D-cache. */ Modified: head/sys/arm/arm/cpufunc_asm_xscale_c3.S == --- head/sys/arm/arm/cpufunc_asm_xscale_c3.SMon Nov 7 10:55:56 2016 (r308407) +++ head/sys/arm/arm/cpufunc_asm_xscale_c3.SMon Nov 7 11:01:09 2016 (r308408) @@ -73,10 +73,11 @@ * XScale core 3 assembly functions for CPU / MMU / TLB specific operations */ -#include #include __FBSDID("$FreeBSD$"); +#include + /* * Size of the XScale core D-cache. */ Modified: head/sys/arm/arm/fiq_subr.S == --- head/sys/arm/arm/fiq_subr.S Mon Nov 7 10:55:56 2016(r308407) +++ head/sys/arm/arm/fiq_subr.S Mon Nov 7 11:01:09 2016(r308408) @@ -37,10 +37,11 @@ */ -#include #include __FBSDID("$FreeBSD$"); +#include + /* * MODE_CHANGE_NOP should be inserted between a mode change and a * banked register (R8--R15) access. Modified: head/sys/arm/arm/setstack.s == --- head/sys/arm/arm/setstack.s Mon Nov 7 10:55:56 2016(r308407) +++ head/sys/arm/arm/setstack.s Mon Nov 7 11:01:09 2016(r308408) @@ -48,10 +48,11 @@ * */ -#include #include __FBSDID("$FreeBSD$"); +#include + /* To set the stack pointer for a particular mode we must switch * to that mode update the banked r13 and then switch back. * This routine provides an easy way of doing this for any mode ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308407 - head/sys/kern
Author: kib Date: Mon Nov 7 10:55:56 2016 New Revision: 308407 URL: https://svnweb.freebsd.org/changeset/base/308407 Log: vn_fullpath1() checked VV_ROOT and then unreferenced vp->v_mount->mnt_vnodecovered unlocked. This allowed unmount to race. Lock vnode after we noticed the VV_ROOT flag. See comments for explanation why unlocked check for the flag is considered safe. Reported and tested by: avg Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Mon Nov 7 10:54:56 2016(r308406) +++ head/sys/kern/vfs_cache.c Mon Nov 7 10:55:56 2016(r308407) @@ -2245,17 +2245,35 @@ vn_fullpath1(struct thread *td, struct v slash_prefixed = 1; } while (vp != rdir && vp != rootvnode) { - if (vp->v_vflag & VV_ROOT) { - if (vp->v_iflag & VI_DOOMED) { /* forced unmount */ - vrele(vp); + /* +* The vp vnode must be already fully constructed, +* since it is either found in namecache or obtained +* from VOP_VPTOCNP(). We may test for VV_ROOT safely +* without obtaining the vnode lock. +*/ + if ((vp->v_vflag & VV_ROOT) != 0) { + vn_lock(vp, LK_RETRY | LK_SHARED); + + /* +* With the vnode locked, check for races with +* unmount, forced or not. Note that we +* already verified that vp is not equal to +* the root vnode, which means that +* mnt_vnodecovered can be NULL only for the +* case of unmount. +*/ + if ((vp->v_iflag & VI_DOOMED) != 0 || + (vp1 = vp->v_mount->mnt_vnodecovered) == NULL || + vp1->v_mountedhere != vp->v_mount) { + vput(vp); error = ENOENT; SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL); break; } - vp1 = vp->v_mount->mnt_vnodecovered; + vref(vp1); - vrele(vp); + vput(vp); vp = vp1; continue; } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308406 - head/sys/arm/arm
Author: sgalabov Date: Mon Nov 7 10:54:56 2016 New Revision: 308406 URL: https://svnweb.freebsd.org/changeset/base/308406 Log: Only include sys/boot.h if LINUX_BOOT_ABI is defined Only include sys/boot.h if LINUX_BOOT_ABI is defined in sys/arm/arm/machdep.c Not doing this prevents kernels that do not define LINUX_BOOT_ABI from being build with gcc (at least 4.2.1). Reviewed by: mmel Sponsored by: Smartcom - Bulgaria AD Differential Revision:https://reviews.freebsd.org/D8459 Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c == --- head/sys/arm/arm/machdep.c Mon Nov 7 10:26:44 2016(r308405) +++ head/sys/arm/arm/machdep.c Mon Nov 7 10:54:56 2016(r308406) @@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(LINUX_BOOT_ABI) #include +#endif #include #include #include ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r308405 - head/sys/arm/conf
Author: andrew Date: Mon Nov 7 10:26:44 2016 New Revision: 308405 URL: https://svnweb.freebsd.org/changeset/base/308405 Log: Start to deorbit the kernel configs in GENERIC by marking them with NO_UNIVERSE. This stops them from being built with the universe, tinderbox, and related targets. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/conf/ALLWINNER head/sys/arm/conf/RPI2 Modified: head/sys/arm/conf/ALLWINNER == --- head/sys/arm/conf/ALLWINNER Mon Nov 7 09:27:05 2016(r308404) +++ head/sys/arm/conf/ALLWINNER Mon Nov 7 10:26:44 2016(r308405) @@ -18,6 +18,8 @@ # in NOTES. # # $FreeBSD$ +# +#NO_UNIVERSE ident ALLWINNER Modified: head/sys/arm/conf/RPI2 == --- head/sys/arm/conf/RPI2 Mon Nov 7 09:27:05 2016(r308404) +++ head/sys/arm/conf/RPI2 Mon Nov 7 10:26:44 2016(r308405) @@ -17,6 +17,8 @@ # in NOTES. # # $FreeBSD$ +# +#NO_UNIVERSE ident RPI2 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"