aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/virtio
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the Yarrow PRNG algorithm option in accordance with due noticeMark Murray2018-08-261-2/+1
| | | | | | | | | | | | | | | | | | | given in random(4). This includes updating of the relevant man pages, and no-longer-used harvesting parameters. Ensure that the pseudo-unit-test still does something useful, now also with the "other" algorithm instead of Yarrow. PR: 230870 Reviewed by: cem Approved by: so(delphij,gtetlow) Approved by: re(marius) Differential Revision: https://reviews.freebsd.org/D16898 Notes: svn path=/head/; revision=338324
* Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headersBryan Venteicher2018-06-172-7/+37
| | | | Notes: svn path=/head/; revision=335305
* Make virtio queue re-initialization steps to be similar toRuslan Bukin2018-06-151-3/+14
| | | | | | | | | | | | | | | | original initialization, so we don't miss few registers to configure. This fixes vtnet(4) operation with QEMU's virtio-net-device. Tested in QEMU with FreeBSD/RISC-V. Reviewed by: bryanv Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15821 Notes: svn path=/head/; revision=335211
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run on LLNW canaries and tested by pho@ gallatin: Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5 based ConnectX 4-LX NIC, I see an almost 12% improvement in received packet rate, and a larger improvement in bytes delivered all the way to userspace. When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1, I see, using nstat -I mce0 1 before the patch: InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32 4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32 4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32 4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32 4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32 4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32 4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32 After the patch InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51 5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51 5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51 5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51 5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52 5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52 Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15366 Notes: svn path=/head/; revision=333813
* Add netdump support to vtnet(4).Mark Johnston2018-05-061-5/+76
| | | | | | | | | | | | Tested with bhyve. Reviewed by: bryanv, julian MFC after: 1 month Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15261 Notes: svn path=/head/; revision=333290
* Add more virtqueue getter methodsBryan Venteicher2018-02-192-0/+31
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=329602
* Add VirtIO bus config_generation methodBryan Venteicher2018-02-193-0/+20
| | | | | | | | | | VirtIO buses (PCI, MMIO) can provide a generation field so a driver can ensure either a 64-bit or array read was stable. MFC after: 2 weeks Notes: svn path=/head/; revision=329601
* Revert r327828, r327949, r327953, r328016-r328026, r328041:Pedro F. Giffuni2018-01-214-13/+10
| | | | | | | | | | | | | | | | | | Uses of mallocarray(9). The use of mallocarray(9) has rocketed the required swap to build FreeBSD. This is likely caused by the allocation size attributes which put extra pressure on the compiler. Given that most of these checks are superfluous we have to choose better where to use mallocarray(9). We still have more uses of mallocarray(9) but hopefully this is enough to bring swap usage to a reasonable level. Reported by: wosch PR: 225197 Notes: svn path=/head/; revision=328218
* Sync VirtIO IDs with LinuxBryan Venteicher2018-01-142-16/+30
| | | | Notes: svn path=/head/; revision=327958
* dev: make some use of mallocarray(9).Pedro F. Giffuni2018-01-134-10/+13
| | | | | | | | | | | | | | Focus on code where we are doing multiplications within malloc(9). None of these is likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. Notes: svn path=/head/; revision=327949
* Fix possible panic when creating VirtIO console dev aliasesBryan Venteicher2018-01-131-23/+76
| | | | | | | | | | | | | | | | | | | | | Since we have no control over the name, the MAKEDEV_CHECKNAME flag must be used to return an error on an invalid (to devfs) name instead of panicing. r305900 that originally added this feature also introduced a few other bugs: - Proper locking not performed - Theoretically broke the expectation that the control event buffer would not span more than one pages, but did not update the CTASSERT that was in place to prevent this. However, since the struct virtio_console_control and the bulk buffer together were quite small, this could not have happened. Also workaround an QEMU VirtIO spec violation in that it includes the NUL terminator in the buffer length when the spec says it is not included. PR: 223531 MFC after: 1 week Notes: svn path=/head/; revision=327948
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2712-0/+24
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-206-0/+12
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326022
* vtnet: Support jumbo frames without TSO/GSOKristof Provost2017-07-291-1/+1
| | | | | | | | | | | | | | | | | | | Currently in Virtio driver without TSO/GSO features enabled, the max scatter gather segments for the TX path can be 4, which limits the support for 9K JUMBO frames. 9K JUMBO frames results in more than 4 scatter gather segments and virtio driver fails to send the frame down to host OS. With TSO/GSO feature enabled max scatter gather segments can be 64, then 9K JUMBO frames are fine, this is making virtio driver to support JUMBO frames only with TSO/GSO. Increasing the VTNET_MIN_TX_SEGS which is the case for non TSO/GSO to 32 to support upto 64K JUMBO frames to Host. Submitted by: Lohith Bellad <lohithbsd@gmail.com> Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D8803 Notes: svn path=/head/; revision=321679
* vtnet: don't update VLAN filter when parent is not runningPhilip Paeps2017-02-131-0/+1
| | | | | | | | | | Submitted by: Gerrie Roos <groos -at- xiplink -dot- com> Reviewed by: gnn Sponsored by: XipLink, Inc. Differential Revision: https://reviews.freebsd.org/D9573 Notes: svn path=/head/; revision=313711
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v". This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field. PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
* virtio_pci: fix announcement of MSI-X interrupts for queuesAndriy Gapon2016-11-241-1/+2
| | | | | | | | | | | | | | | | Queues that do not need interrupts - for instance, output queues - do not have a corresponding entry in vtpci_msix_vq_interrupts. So, it was wrong to increment a pointer into that array when iterating over such a queue. I ran into this bug while trying to use virtio_console(4) that allocates a lot of queues with every other being an output queue without an interrupt handler (if MultiplePorts feature is negotiated). MFC after: 2 weeks Notes: svn path=/head/; revision=309119
* virtio_console: correctly determine presense of payload and its lengthAndriy Gapon2016-11-241-2/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=309116
* Reserve space for control message payload (currently a port name).Jakub Wojciech Klama2016-11-121-2/+3
| | | | | | | | Approved by: trasz (mentor) Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=308566
* Create aliases for named virtio-console ports.Jakub Wojciech Klama2016-09-171-6/+45
| | | | | | | | | | | | | | Make virtio_console(4) create `/dev/vtcon/<port_name>` alias pointing to /dev/ttyVx.y upon receiving PORT_NAME (id = 7) event over the control queue. Approved by: trasz MFC after: 1 month Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D7182 Notes: svn path=/head/; revision=305900
* Fix vtnet hang with max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRSSteven Hartland2016-08-112-24/+38
| | | | | | | | | | | | | | | | | | | | | Correctly limit npairs passed to vtnet_ctrl_mq_cmd. This ensures that VQ_ALLOC_INFO_INIT is called with the correct value, preventing the system from hanging when max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRS. Add new sysctl requested_vq_pairs which allow the user to configure the requested number of virtqueue pairs. The actual value will still take into account the system limits. Also missing sysctls for the current tunables so their values can be seen. PR: 207446 Reported by: Andy Carrel MFC after: 3 days Relnotes: Yes Sponsored by: Multiplay Notes: svn path=/head/; revision=303971
* vtnet: fix panic on unloadKristof Provost2016-05-141-8/+9
| | | | | | | | | | | | | | | Since r276367 added the virtio_mmio support vtnet_modevent() gets called twice. This resulted in a memory leak during load and a panic on unload. Count the loads so we only initialise once (just like cxgbe(4)), and only clean up in the final unload. PR: 209428 Submitted by: novel@FreeBSD.org MFC after: 1 week Notes: svn path=/head/; revision=299725
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Create an API to reset a struct bio (g_reset_bio). This is mandatoryWarner Losh2016-02-171-3/+4
| | | | | | | | | | | | for all struct bio you get back from g_{new,alloc}_bio. Temporary bios that you create on the stack or elsewhere should use this before first use of the bio, and between uses of the bio. At the moment, it is nothing more than a wrapper around bzero, but that may change in the future. The wrapper also removes one place where we encode the size of struct bio in the KBI. Notes: svn path=/head/; revision=295707
* Lower the compiler warning: unused-but-set-variable.Marcelo Araujo2015-09-031-4/+0
| | | | | | | | Approved by: bapt (mentor) Differential Revision: D3556 Notes: svn path=/head/; revision=287423
* add netmap dependency when compiled as a moduleLuigi Rizzo2015-07-101-0/+3
| | | | Notes: svn path=/head/; revision=285351
* Add 'prewrite' method allowing us to run some platform-specificRuslan Bukin2015-07-032-0/+22
| | | | | | | | code before each write happens, e.g. write-back caches. This will help booting in Bluespec simulator of CHERI processor. Notes: svn path=/head/; revision=285091
* Huge cleanup of random(4) code.Mark Murray2015-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * GENERAL - Update copyright. - Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set neither to ON, which means we want Fortuna - If there is no 'device random' in the kernel, there will be NO random(4) device in the kernel, and the KERN_ARND sysctl will return nothing. With RANDOM_DUMMY there will be a random(4) that always blocks. - Repair kern.arandom (KERN_ARND sysctl). The old version went through arc4random(9) and was a bit weird. - Adjust arc4random stirring a bit - the existing code looks a little suspect. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Redo read_random(9) so as to duplicate random(4)'s read internals. This makes it a first-class citizen rather than a hack. - Move stuff out of locked regions when it does not need to be there. - Trim RANDOM_DEBUG printfs. Some are excess to requirement, some behind boot verbose. - Use SYSINIT to sequence the startup. - Fix init/deinit sysctl stuff. - Make relevant sysctls also tunables. - Add different harvesting "styles" to allow for different requirements (direct, queue, fast). - Add harvesting of FFS atime events. This needs to be checked for weighing down the FS code. - Add harvesting of slab allocator events. This needs to be checked for weighing down the allocator code. - Fix the random(9) manpage. - Loadable modules are not present for now. These will be re-engineered when the dust settles. - Use macros for locks. - Fix comments. * src/share/man/... - Update the man pages. * src/etc/... - The startup/shutdown work is done in D2924. * src/UPDATING - Add UPDATING announcement. * src/sys/dev/random/build.sh - Add copyright. - Add libz for unit tests. * src/sys/dev/random/dummy.c - Remove; no longer needed. Functionality incorporated into randomdev.*. * live_entropy_sources.c live_entropy_sources.h - Remove; content moved. - move content to randomdev.[ch] and optimise. * src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h - Remove; plugability is no longer used. Compile-time algorithm selection is the way to go. * src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h - Add early (re)boot-time randomness caching. * src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h - Remove; no longer needed. * src/sys/dev/random/uint128.h - Provide a fake uint128_t; if a real one ever arrived, we can use that instead. All that is needed here is N=0, N++, N==0, and some localised trickery is used to manufacture a 128-bit 0ULLL. * src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h - Improve unit tests; previously the testing human needed clairvoyance; now the test will do a basic check of compressibility. Clairvoyant talent is still a good idea. - This is still a long way off a proper unit test. * src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h - Improve messy union to just uint128_t. - Remove unneeded 'static struct fortuna_start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) * src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h - Improve messy union to just uint128_t. - Remove unneeded 'staic struct start_cache'. - Tighten up up arithmetic. - Provide a method to allow eternal junk to be introduced; harden it against blatant by compress/hashing. - Assert that locks are held correctly. - Fix the nasty pre- and post-read overloading by providing explictit functions to do these tasks. - Turn into self-sufficient module (no longer requires randomdev_soft.[ch]) - Fix some magic numbers elsewhere used as FAST and SLOW. Differential Revision: https://reviews.freebsd.org/D2025 Reviewed by: vsevolod,delphij,rwatson,trasz,jmg Approved by: so (delphij) Notes: svn path=/head/; revision=284959
* Remove duplicate defines.Ruslan Bukin2015-06-181-4/+0
| | | | | | | Sponsored by: HEIF5 Notes: svn path=/head/; revision=284544
* Fix panic when adding vtnet interfaces to a bridgeKristof Provost2015-06-131-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | vtnet interfaces are always in promiscuous mode (at least if the VIRTIO_NET_F_CTRL_RX feature is not negotiated with the host). if_promisc() on a vtnet interface returned ENOTSUP although it has IFF_PROMISC set. This confused the bridge code. Instead we now accept all enable/disable promiscuous commands (and always keep IFF_PROMISC set). There are also two issues with the if_bridge error handling. If if_promisc() fails it uses bridge_delete_member() to clean up. This tries to disable promiscuous mode on the interface. That runs into an assert, because promiscuous mode was never set in the first place. (That's the panic reported in PR 200210.) We can only unset promiscuous mode if the interface actually is promiscuous. This goes against the reference counting done by if_promisc(), but only the first/last if_promic() calls can actually fail, so this is safe. A second issue is a double free of bif. It's already freed by bridge_delete_member(). PR: 200210 Differential Revision: https://reviews.freebsd.org/D2804 Reviewed by: philip (mentor) Notes: svn path=/head/; revision=284348
* Fix typo when deregistering the VLAN unconfig event handlerBryan Venteicher2015-06-131-1/+1
| | | | | | | | Submitted by: Masao Uebayashi <uebayasi@tombiinc.com> MFC after: 3 days Notes: svn path=/head/; revision=284342
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-05-221-1/+1
| | | | | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
* Don't free mbufs when stopping an interface in netmap mode.John Baldwin2015-04-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Currently if you ifconfig down a vtnet interface while it is being used via netmap, the kernel panics due to trying to treat the cookie values in the virtio rings as mbufs to be freed. When netmap is enabled, these cookie values are pointers to something else. Note that other netmap-aware drivers don't seem to need this as they store the mbuf pointers in the software rings that mirror the hardware descriptor rings, and since netmap doesn't touch those, the software state always has NULL mbuf pointers causing the loops to free mbufs to not do anything. However, vtnet reuses the same state area for both netmap and non-netmap mode, so it needs to explicitly avoid looking at the rings and treating the cookie values as mbufs if netmap is enabled. Differential Revision: https://reviews.freebsd.org/D2348 Reviewed by: adrian, bryanv, luigi MFC after: 1 week Sponsored by: Norse Corp, Inc. Notes: svn path=/head/; revision=282241
* Do not report stripe size if it is equal to sector size.Alexander Motin2015-04-181-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=281698
* Hide virtio features negotiation messages under bootverbose.Alexander Motin2015-03-152-2/+2
| | | | | | | | | Those messages are noisy, but useless for average user. MFC after: 2 weeks Notes: svn path=/head/; revision=280090
* Size of opt_io_size field is 32 bit.Alexander Motin2015-03-051-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=279651
* Reenable VIRTIO_BLK_F_TOPOLOGY feature.Alexander Motin2015-03-051-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=279642
* Rework vtblk dump handling of in flight requestsBryan Venteicher2015-01-271-41/+31
| | | | | | | | | | | | | | | | | Previously, the driver resets the device and abandon the requests that are caught in flight when the dump was initiated. This was problematic if the system is resumed after the dump is completed. While that is probably not the typical action, it is simple to rework the driver to very likely have the device usable after the dump without making it more likely for the dump to fail. The in flight requests are simply queued for completion once the dump is finished. Requested by: markj MFC after: 1 month Notes: svn path=/head/; revision=277788
* Add softc flag for when the indirect descriptor feature was negotiatedBryan Venteicher2015-01-012-2/+5
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=276491
* Use the appropriate IPv4 or IPv6 TSO HW assist flagBryan Venteicher2015-01-011-2/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=276489
* Set the page size in the virtio-mmio driver. Some backends, e.g QEMU, assumeAndrew Turner2014-12-301-0/+2
| | | | | | | | | a 1 byte page size until told otherwise. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=276409
* Attach vtnet to virtio_mmio. Qemu provides this as an option with AArch64.Andrew Turner2014-12-291-0/+2
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=276367
* Allow virtio_mmio to attach to ofwbus. Qemu places these here on at leastAndrew Turner2014-12-291-0/+1
| | | | | | | | | the AArch64 virtual platform with the Linaro UEFI. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=276358
* Add virtio bus 'poll' method allowing us to inform backend we areRuslan Bukin2014-12-124-1/+29
| | | | | | | | | | | | going to poll virtqueue. Use on BERI soft-core to invalidate cpu caches. Reviewed by: bryanv Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=275728
* o Add BERI Virtio Networking Frontend (if_vtbe)Ruslan Bukin2014-12-092-17/+18
| | | | | | | | | | | o Move similar block/networking methods to common file o Follow r275640 and correct MMIO registers width o Pass value to MMIO platform_note method. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=275647
* Update the virtio driver to work on the ARM AArch64 Foundation Model.Andrew Turner2014-12-091-28/+68
| | | | | | | | | | | | | | There are two main parts to get it to work, 1) most of the register accesses need to be word sized, other than the config register which needs to be byte aligned, and 2) we don't need the platform driver for this to work on the Foundation Model, allow it to be NULL. Differential Revision: https://reviews.freebsd.org/D1240 Reviewed by: bryanv Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=275640
* Start process of removing the use of the deprecated "M_FLOWID" flagHans Petter Selasky2014-12-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. Additional notes: - The SCTP code changes will be committed as a separate patch. - Removal of the "M_FLOWID" flag will also be done separately. - The FreeBSD version has been bumped. MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=275358
* Cleanup and performance improvement of the virtio_blk driverBryan Venteicher2014-11-301-417/+422
| | | | | | | | | | | | | - Add support for GEOM direct completion. Depending on the benchmark, this tends to give a ~30% improvement w.r.t IOPs and BW. - Remove an invariants check in the strategy routine. This assertion is caught later on by an existing panic. - Rename and resort various related functions to make more sense. MFC after: 1 month Notes: svn path=/head/; revision=275335
* Prevent overflow issues in timeout processingSteven Hartland2014-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Previously, any timeout value for which (timeout * hz) will overflow the signed integer, will give weird results, since callout(9) routines will convert negative values of ticks to '1'. For unsigned integer overflow we will get sufficiently smaller timeout values than expected. Switch from callout_reset, which requires conversion to int based ticks to callout_reset_sbt to avoid this. Also correct isci to correctly resolve ccb timeout. This was based on the original work done by Eygene Ryabinkin <rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid the overlow. Differential Revision: https://reviews.freebsd.org/D1157 Reviewed by: mav, davide MFC after: 1 month Sponsored by: Multiplay Notes: svn path=/head/; revision=274819
* Add Virtio MMIO bus driver.Ruslan Bukin2014-11-184-0/+941
| | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=274655