| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
Similar commit in current:
(cherry picked from commit 95ee2897e98f)
|
|
|
|
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Disable software LRO during kernel dumping, because having it enabled
requires to be in a network epoch, which might or might not be the
case depending on the code path resulting in the panic.
Reviewed by: markj
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D34787
(cherry picked from commit 53236f905dbf4f3d58b1d5eff5c9b14f100d0c5d)
|
|
|
|
|
|
|
|
|
|
|
| |
Remove virtio_swap_endian(). htole*() are nops on little-endian
platforms. No functional change intended.
MFC after: 1 week
Reviewed by: corvink, jhb
Differential Revision: https://reviews.freebsd.org/D37298
(cherry picked from commit db494ceb65ef301c8fb48f57b60c4f7a9cfebba5)
|
|
|
|
|
|
| |
Sponsored by: Netflix
(cherry picked from commit 76e96756633e5d33f334bb48bedf981557272ead)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The physical address argument is essentially ignored by every dumper
method. In addition, the dump routines don't actually pass a real
address; every call to dump_append() passes a value of zero for
physical.
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35173
(cherry picked from commit 489ba2223676ec251ab1bfe2906d2a62959c8ce3)
|
|
|
|
|
|
|
| |
I accidentally didn't include hunk in the committed patch.
Fixes: 6c4f95161d6e ("virtio: make the write_config buffer argument const")
(cherry picked from commit 9017870541daf46358c6cbaa3d4a40e1bffaaaa1)
|
|
|
|
|
|
|
|
|
|
| |
No functional change intended, but noticed that we could add const here
while adding linuxkpi support for virtio.
Reviewed By: bryanv, imp
Differential Revision: https://reviews.freebsd.org/D32370
(cherry picked from commit 6c4f95161d6e38ba3fd50ca1cceee3110cbfa02e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FreeBSD 13+ running as virtual guest may load virtio_random(8) driver
by means of devd(8) unless the driver is blacklisted or disabled
via device.hints(5). Currently, the driver may prevent
the system from rebooting or shutting down correctly.
This change deactivates virtio_random at very late stage
during system shutdown sequence to avoid deadlock
that results in kernel hang.
PR: 253175
Tested by: tom
Relnotes: yes
(cherry picked from commit adbf7727b3a2aad3c2faa6e543ee7fa7a6c9a3d5)
|
|
|
|
|
|
|
|
|
|
|
| |
PR: 254343, 255054
Reviewed by: vmaffione (mentor), donner
Approved by: vmaffione (mentor), donner
MFC after: 2 weeks
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D30639
(cherry picked from commit fc035df8af32d496885e5da26e519ce6a262c9bf)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove page zeroing code from consumers and stop specifying
VM_ALLOC_NOOBJ. In a few places, also convert an allocation loop to
simply use VM_ALLOC_WAITOK.
Similarly, convert vm_page_alloc_domain() callers.
Note that callers are now responsible for assigning the pindex.
Reviewed by: alc, hselasky, kib
Sponsored by: The FreeBSD Foundation
(cherry picked from commit a4667e09e6520dc2c4b0b988051f060fed695a91)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some simulators don't implement arbitrary sized memory access to the
virtio PCI registers. Follow Linux and use single byte accesses to read
and write to these registers.
Reviewed by: bryanv, emaste (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31424
(cherry picked from commit 89c085b8993d7d1e7b137f99fa6df94c37c3a68a)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Virtio modern has the common data organized in little endian, but
on powerpc64 BE it was reading and writing in the wrong endian.
Submitted by: Leonardo Bianconi <leonardo.bianconi@eldorado.org.br>
Reviewed by: bryanv, alfredo
Sponsored by: Eldorado Research Institute (eldorado.org.br)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28947
(cherry picked from commit fb53b42e36a9745d0a33821175a962c7a15eeeaa)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Definitions inside usr.sbin/bhyve/virtio.h are thrown away.
Definitions in sys/dev/virtio are used instead.
This reduces code duplication.
Sponsored by: The FreeBSD Foundation
Reviewed by: grehan
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D29084
(cherry picked from commit 54ac6f721efccdba5a09aa9f38be0a1c4ef6cf14)
|
|
|
|
|
|
|
|
|
|
|
| |
ALTQ only works on network drivers which use if_start (rather than
if_transmit). vtnet uses if_start if built with VTNET_LEGACY_TX. Default
to that the kernel is built with ALTQ enabled, to reduce user surprise.
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 5afe81a7b23afd27289ca40e04a6a764134d6273)
|
|
|
|
|
|
|
| |
Reviewed By: grehan
Differential Revision: https://reviews.freebsd.org/D28726
(cherry picked from commit c1b554c868195ed10ac1eb25fa9ca4a5baae4638)
|
|
|
|
|
|
|
|
|
|
|
|
| |
DRIVER_OK status is set after device_attach() succeeds. For now postpone
disk_create to attach_completed() method.
Sponsored by: The FreeBSD Foundation
Reviewed by: grehan
Approved by: lwhsu (mentor)
Differential Revision: https://reviews.freebsd.org/D30049
(cherry picked from commit 4e1e1d667fc84460c131dfe617b39072e87473ab)
|
|
|
|
|
|
|
|
|
|
|
|
| |
For guests running under some kind of VMMs, configuration structure is
available in memory space but not I/O space.
Reported by: Yuan Rui <number201724@me.com>
Reviewed by: rpokala, bryanv, jhb
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D28818
(cherry picked from commit cf5d1112408ddef3fdff8212599727c49ba90fa4)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MSI-X resource shouldn't be assumed to be always on BAR1.
The Virtio v1.1 Spec did not specify that MSI-X table and PBA BAR has to
be BAR1 either.
Reported by: Yuan Rui <number201724@me.com>
Reviewed by: bryanv, jhb
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D28817
(cherry picked from commit faf9a4e9142a02c289ee543a6091bd4b925c6a63)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The decision whether a TCP packet is sent over IPv4 or IPv6 was
based on ethertype, which works correctly. In D27926 the criteria
was changed to checking if the CSUM_IP_TSO flag is set in the
csum-flags and then considering it to be TCP/IPv4.
However, the TCP stack sets the flag to CSUM_TSO for IPv4 and IPv6,
where CSUM_TSO is defined as CSUM_IP_TSO|CSUM_IP6_TSO.
Therefore TCP/IPv6 packets gets mis-classified as TCP/IPv4,
which breaks TSO for TCP/IPv6.
This patch bases the check again on the ethertype.
This fix is instantly MFCed.
Approved by: re(gjb)
PR: 254366
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D29331
(cherry picked from commit d4697a6b56168876fc0ffec1a0bb1b24d25b198e)
|
|
|
|
|
|
|
|
| |
This was blindly moved in r360722 but the variable being printed is not
yet initialised. It's of little use and can easily be added back in the
right place if needed by someone debugging, so just delete it.
Reported by: bryanv
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than have every device register itself for both virtio_pci and
virtio_mmio, provide a VIRTIO_DRIVER_MODULE wrapper to declare both,
merge VIRTIO_SIMPLE_PNPTABLE with VIRTIO_SIMPLE_PNPINFO and make the
latter register for both buses. This also has the benefit of abstracting
away the available transports and their names.
Reviewed by: bryanv
Differential Revision: https://reviews.freebsd.org/D28073
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We must check MagicValue not just Version before anything else, and then
we must check DeviceID and immediately abort if zero (and this must not
be an error).
Do all this when probing rather than at the start of attaching as that's
where this belongs, and provides a clear boundary between the device
detection and device initialisation parts of the specified driver
initialisation process. This also means we don't create empty device
instances for placeholder devices, reducing clutter on systems that
pre-allocate a large number, such as QEMU's AArch64 virt machine (which
provides 32).
Reviewed by: bryanv
Differential Revision: https://reviews.freebsd.org/D28070
|
| |
|
|
|
|
|
|
|
|
| |
Try to standardize how drivers negotiate feature and the
function names
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27930
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27928
|
|
|
|
|
|
|
|
|
| |
- Add and fix a few error path counters
- Improve sysctl descriptions
- Use flags consistently to determine IPv4 vs IPv6
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27926
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27933
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27925
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27923
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to V1, the driver would enable interrupts and then notify the
host that DRIVER_OK. Since for V1, DRIVER_OK needs to be set before
notifying the virtqueues, there may be items in the queues waiting
to be processed by the time interrupts are enabled.
This fixes a bug where the Rx queue would appear stuck, only being
usable after an interface down/up cycle.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27922
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27931
|
|
|
|
|
|
|
|
|
| |
For multiqueue, we may use fewer than the provided maximum number of
queues. Try to limit allocations of the unused queues: no interrupts,
no indirect descriptors, and no taskqueues.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27921
|
|
|
|
|
|
|
|
| |
Verify the max_virtqueue_pairs is within the range allowed by
the spec.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27920
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This useful when running on hosts that support checksum offloading
but not the GUEST_TSO (LRO) feature. Or potentially, some GRO-like
support when doing forwarding.
Only enable SW LRO when the host LRO is not available since both
tends to be harmful, and difficult to enable/disable selectively
with only a single IFCAP_LRO flag.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27919
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27917
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows the Rx checksum and LRO to be modified without a full
reinit of the device.
Remove IFCAP_RXCSUM_IPV6 from the interface capabilities since in
VirtIO Rx checksums are just enabled or disabled for all protocols.
Properly update IFCAP_LRO if LRO is becomes disabled when Rx
checksums are disabled.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27916
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27914 https://reviews.freebsd.org/D27915
|
|
|
|
|
|
|
|
| |
In modern VirtIO, the virtqueues cannot be notified before setting
DRIVER_OK status.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27932
|
|
|
|
|
|
|
|
| |
Defer the ether_ifattach until the interface capabilities
are configured
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27913
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27912
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27911
|
|
|
|
|
|
|
|
|
|
|
|
| |
This improves spec compliance because the driver is not suppose
to notify the device prior to setting the DRIVER_OK status, which
could happen with the VIRTIO_NET_F_CTRL_MAC_ADDR.
The VIRTIO_NET_F_MAC feature should always be negotiated so would
be a rare situation.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27910
|
|
|
|
|
|
|
|
|
| |
This may have been required in an early, early, early version of the
specification but I cannot find any reference to it, and a promiscuous
default seems very odd so remove this code.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27909
|
|
|
|
|
|
|
|
|
|
|
|
| |
This features lets the guest driver know the speed and duplex of
the "link". Instead of trying to support many media types based
on the possible/likely speeds/duplexes, only use the speed to
set the interface baudrate.
Cleanup ifmedia code to match other drivers.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27908
|
|
|
|
|
|
|
|
|
|
| |
This feature lets the guest driver know the maximum MTU size
supported by the host device. If set, use this to limit the
acceptable MTUs, and improve how the receive mbuf cluster size
then is selected.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27907
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fix the NEEDS_CSUM and DATA_VALID checksum flags. The NEEDS_CSUM
checksum is incomplete (partial) so offer a fallback for the driver
to calculate the checksum. Simplify DATA_VALID because we know
the host has validated the checksum.
- Default 4K mbuf clusters for mergeable buffers. May need to
scale this down to 2K clusters in certain configurations such
many queue pairs, big queues (like 4096 in GCP), and low memory.
- Use the MTU when calculated the receive mbuf cluster size
when not doing TSO/LRO. This will need more adjustment once
the MTU feature is supported.
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27906
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27905
|
|
|
|
|
|
|
|
|
|
|
| |
Very basic support to get packets flowing on modern QEMU but still
several conformance issues remain that will be addressed in later
commits.
First of many passes at cleaning up various accumulated cruft
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27904
|
|
|
|
|
| |
Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27903
|