| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Transmit segment offloading depends on transmit checksum offloading.
Enforce that constraint. This also fixes a bug, since if_hwassist bits
are from the CSUM_ space, not from the IFCAP_ space.
PR: 290773
Reviewed by: Timo Völker
Tested by: lg@efficientip.com
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53629
|
| |
|
|
|
|
|
|
|
|
| |
According to section 5.1.6.2.1 of version 1.3 of the virtio
specification, the driver MUST NOT set VIRTIO_NET_HDR_F_DATA_VALID in
the flags. So don't do that.
Reviewed by: Timo Völker
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53650
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The access of vq->vq_ring.used->idx needs to be volatile-qualified,
otherwise the compiler may optimize virtqueue_poll() into an infinite
loop if there is no data available upon the first poll.
Prior to commit ad17789a8569 this wasn't a problem since an external
function call after each poll inhibited the optimization.
PR: 289930
MFC after: 3 days
Sponsored by: Klara, Inc.
Fixes: ad17789a8569 ("virtio: Remove the unused poll method")
|
| |
|
|
|
|
|
| |
- s/reponse/response/
- s/Cannnot/Cannot/
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hardware TCP LRO results in problems in settings with IP forwarding
being enabled. In case of nodes without IP forwarding, using
software LRO is also beneficial in general, since it can provide better
information about what was received on the wire.
Therefore, disable hardware TCP LRO by default.
By tuning the loader tunable, this can be changed.
PR: 263229
Reviewed by: Timo Völker
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52684
|
| |
|
|
|
|
|
|
|
|
| |
Keep the hwassist flags for transmit checksum offload and transmit
segment offload in sync with the enabled capabilities.
Reported by: Timo Völker
Reviewed by: Timo Völker
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52765
|
| |
|
|
|
|
|
|
|
|
| |
Enable the handling of the IFCAP_RXCSUM_IPV6 handling by handling
IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6 as a pair. Also make clear, that
software and hardware LRO require receive checksum offload.
Reviewed by: Timo Völker
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52682
|
| |
|
|
|
|
| |
Reported by: bz
Fixes: 3008f30d2c2c ("vtnet: improve checksum offloading")
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When transmitting a packet over the vtnet interface, map the
csum flags CSUM_DATA_VALID | CSUM_PSEUDO_HDR to the virtio
flag VIRTIO_NET_HDR_F_DATA_VALID.
When receiving a packet over the virtio network channel, translate
the virtio flag VIRTIO_NET_HDR_F_NEEDS_CSUM not to CSUM_DATA_VALID |
CSUM_PSEUDO_HDR, but to CSUM_TCP, CSUM_TCP_IPV6, CSUM_UDP, or
CSUM_UDP_IPV6.
The second change fixes a series of issue related to checksum
offloading for if_vtnet.
While there, improve the stats counters to allow a detailed view
on what is going on in relation to checksum offloading.
PR: 165059
Reviewed by: tuexen, manpages
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D51686
|
| |
|
|
|
| |
This reverts commit 1c23d8f9f39870951c1d0dfbb112fc4e53237737.
Will be committed again with correct authorship.
|
| |
|
|
|
| |
This reverts commit 7c448f5aab8be6977d0860e608e7d497b495d28c.
Will be committed again with correct authorship.
|
| |
|
|
|
|
|
| |
Reported by: bz
Fixes: 1c23d8f9f398 ("vtnet: improve checksum offloading")
MFC after: 3 days
Sponsored by: Netflix, Inc.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
octets sent
When ALTQ is enabled, this driver does "hardware" accounting and soft
accounting at the same time. Prefer the "hardware" one to make the logic
simpler.
Reviewed by: zlei
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44817
|
| |
|
|
|
|
|
|
|
|
| |
While here, advertise the IFCAP_HWSTATS capability to avoid the net
stack from double counting it.
Co-authored-by: zlei
Reviewed by: zlei
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44816
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When transmitting a packet over the vtnet interface, map the
csum flags CSUM_DATA_VALID | CSUM_PSEUDO_HDR to the virtio
flag VIRTIO_NET_HDR_F_DATA_VALID.
When receiving a packet over the virtio network channel, translate
the virtio flag VIRTIO_NET_HDR_F_NEEDS_CSUM not to CSUM_DATA_VALID |
CSUM_PSEUDO_HDR, but to CSUM_TCP, CSUM_TCP_IPV6, CSUM_UDP, or
CSUM_UDP_IPV6.
The second change fixes a series of issue related to checksum
offloading for if_vtnet.
While there, improve the stats counters to allow a detailed view
on what is going on in relation to checksum offloading.
PR: 165059
Reviewed by: tuexen, manpages
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D51686
|
| |
|
|
|
|
|
|
|
| |
The type of variable promisc and allmulti was changed from int to bool
by commit [1].
[1] 7dce56596f36 Convert to if_foreach_llmaddr() KPI
MFC after: 3 days
|
| |
|
|
|
|
| |
Reviewed by: Timo Völker
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D51999
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the aggregation of the interface level counters
* dev.vtnet.X.tx_task_rescheduled,
* dev.vtnet.X.tx_tso_offloaded,
* dev.vtnet.X.tx_csum_offloaded,
* dev.vtnet.X.rx_task_rescheduled,
* dev.vtnet.X.rx_csum_offloaded, and
* dev.vtnet.X.rx_csum_failed.
Also ensure that dev.vtnet.X.tx_defrag_failed only counts the number
of times m_defrag() fails.
While there, mark sysctl-variables used for exporting statistics as
such (CTLFLAG_STATS).
Reviewed by: Timo Völker
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D51999
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Include opt_inet.h and opt_inet6.h early in the files including
virtio_net.h, since they use INET and/or INET6.
While there, remove redundant inclusion of sys/types.h, since it is
included already by sys/param.h.
There was a discussion to include opt_inet.h and opt_inet6.h also
in virtio_net.h. glebius suggested to add a mechanism for files
to check, if required opt_*.h files were included. virtio_net.h
will be the first consumer of this mechanism.
Reviewed by: glebius, Peter Lei
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52046
|
| |
|
|
|
|
|
|
|
| |
This was used by virtio_mmio to poll via another driver. This support
has been removed so we can remove it from here too.
Reviewed by: br
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D51993
|
| |
|
|
|
|
|
|
|
| |
The only driver I know that implemented this interface was removed 7
months ago. Remove the interface and platform from the softc.
Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D51992
|
| |
|
|
|
|
|
|
|
|
|
| |
We can do so trivially, so make these tables read-only. No functional
change intended.
Reviewed by: cem, emaste
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D52003
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass 0 as the number of indirect descriptors when they are not
supported.
This fixes an issue on the Arm FVP model where we don't negotiate
them, however pass a number of segments greater than
VIRTIO_MAX_INDIRECT. This leads to virtqueue_alloc failing and
virtio_blk failing to attach.
Reviewed by: Harry Moulton <harry.moulton@arm.com>
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50909
|
| |
|
|
|
|
| |
Reviewed by: imp, jhb
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D50913
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Switch to using sys/stdarg.h for va_list type and va_* builtins.
Make an attempt to insert the include in a sensible place. Where
style(9) was followed this is easy, where it was ignored, aim for the
first block of sys/*.h headers and don't get too fussy or try to fix
other style bugs.
Reviewed by: imp
Exp-run by: antoine (PR 286274)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
|
| |
|
|
|
|
| |
PR: 286280
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D50489
|
| |
|
|
|
|
| |
Signed-off-by: Bjoern Jakobsen <Bjoern.Jakobsen@lrz.de>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1679
|
| |
|
|
|
|
| |
Signed-off-by: Bjoern Jakobsen <Bjoern.Jakobsen@lrz.de>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1679
|
| |
|
|
|
|
| |
Signed-off-by: Bjoern Jakobsen <Bjoern.Jakobsen@lrz.de>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1679
|
| |
|
|
|
|
|
|
|
|
| |
Some implementations of the virtio 9p transport are implemented on
virtio_mmio, e.g. the Arm FVP. Use the correct macro so the driver
attaches when this is the case.
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D49600
|
| |
|
|
|
|
|
| |
This is simpler and more robust than individual calls to
device_delete_child.
Differential Revision: https://reviews.freebsd.org/D47972
|
| |
|
|
|
|
|
|
|
|
|
| |
Formally, there are 12 bits for TCP header flags.
Use the accessor functions in more (kernel) places.
No functional change.
Reviewed By: cc, #transport, cy, glebius, #iflib, kbowling
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D47063
|
| |
|
|
|
|
|
|
|
|
|
| |
Remove an always-false check for whether the request has already
completed before sleeping. Even if the request is complete, the
response tag is updated while holding the channel lock, which is also
held here.
No functional change intended.
Sponsored by: Klara, Inc.
|
| |
|
|
|
|
|
|
|
|
| |
Otherwise we can end up with a lost interrupt, causing lost request
completion wakeups and hangs in the filesystem layer.
Continue processing until we enable interrupts and then observe an empty
queue, like other virtio drivers do.
Sponsored by: Klara, Inc.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
If, when submitting a request, the virtqueue is full, we sleep until an
interrupt has fired, then restart the request. However, while sleeping
the channel lock is dropped, and in the meantime another thread may have
reset the per-channel SG list, so upon retrying we'd (re)submit whatever
happened to be left over in the previous request.
Fix the problem by rebuilding the SG list after sleeping.
Sponsored by: Klara, Inc.
|
| |
|
|
|
|
|
|
|
|
| |
- Remove superfluous newlines.
- Use bool literals.
- Replace an unneeded SYSINIT with static initialization.
No functional change intended.
Sponsored by: Klara, Inc.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As of 9e6544dd6e02c46b805d11ab925c4f3b18ad7a4b contigfree(9) is no longer
needed and should not be used anymore. We leave a wrapper for 3rd party
code in at least 15.x but remove (almost) all other cases from the tree.
This leaves one use of contigfree(9) untouched; that was the original
trigger for 9e6544dd6e02 and is handled in D45813 (to be committed
seperately later).
Sponsored by: The FreeBSD Foundation
Reviewed by: markj, kib
Tested by: pho (10h stress test run)
Differential Revision: https://reviews.freebsd.org/D46099
|
| |
|
|
| |
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
| |
This blit an ARGB image on the dedicated vd.
This also adds vt_fb_bitblt_argb which will works for most of the vt backends
Differential Revision: https://reviews.freebsd.org/D45929
Reviewed by: tsoome
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the module is loaded on a system running on qemu/kvm the "modern"
virtio infrastructure is used and virtio_read_device_config() will end
up calling vtpci_modern_read_dev_config(). This function cannot read
values of arbitrary sizes and will panic if the p9fs mount tag size is
not supported by it.
Use virtio_read_device_config_array() instead. It was tested on both
bhyve and qemu/kvm.
PR: 280098
Co-authored-by: Mark Peek <mp@FreeBSD.org>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1320
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vtblk_poll_request() is used for kernel dumps and for fetching the block
device's identifier string during device probing. In the latter case,
it was not calling bus_dmamap_sync() after completing the I/O, but this
is required in general.
Thus:
- Factor out per-request code from vtblk_queue_completed().
- Use it in vtblk_poll_request() once virtqueue_poll() finishes.
- While here, assert that virtqueue_poll() returns the request that we
expect.
Reported by: KMSAN
Fixes: 782105f7c898 ("vtblk: Use busdma")
Reviewed by: cperciva, imp
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D45665
|
| |
|
|
|
|
|
|
|
|
|
| |
Change 4787572d0580 made if_alloc_domain() never fail, then also do the
wrappers if_alloc(), if_alloc_dev(), and if_gethandle().
No functional change intended.
Reviewed by: kp, imp, glebius, stevek
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D45740
|
| |
|
|
|
|
|
|
|
|
|
| |
device_attach routines are allowed to sleep, and this routine already
has other M_WAITOK allocations.
Reported by: markj
Reviewed by: markj
Fixes: 1efd69f933b6 ("p9fs: move NULL check immediately after alloc...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45721
|
| |
|
|
|
|
|
| |
Reported by: Shawn Webb (HardenedBSD)
Reviewed by: dfr
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45719
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is derived from swills@ fork of the Juniper virtfs with many
changes by me including bug fixes, style improvements, clearer layering
and more consistent logging. The filesystem is renamed to p9fs to better
reflect its function and to prevent possible future confusion with
virtio-fs.
Several updates and fixes from Juniper have been integrated into this
version by Val Packett and these contributions along with the original
Juniper authors are credited below.
To use this with bhyve, add 'virtio_p9fs_load=YES' to loader.conf. The
bhyve virtio-9p device allows access from the guest to files on the host
by mapping a 'sharename' to a host path. It is possible to use p9fs as a
root filesystem by adding this to /boot/loader.conf:
vfs.root.mountfrom="p9fs:sharename"
for non-root filesystems add something like this to /etc/fstab:
sharename /mnt p9fs rw 0 0
In both examples, substitute the share name used on the bhyve command
line.
The 9P filesystem protocol relies on stateful file opens which map
protocol-level FIDs to host file descriptors. The FreeBSD vnode
interface doesn't really support this and we use heuristics to guess the
right FID to use for file operations. This can be confused by privilege
lowering and does not guarantee that the FID created for a given file
open is always used for file operations, even if the calling process is
using the file descriptor from the original open call. Improving this
would involve changes to the vnode interface which is out-of-scope for
this import.
Differential Revision: https://reviews.freebsd.org/D41844
Reviewed by: kib, emaste, dch
MFC after: 3 months
Co-authored-by: Val Packett <val@packett.cool>
Co-authored-by: Ka Ho Ng <kahon@juniper.net>
Co-authored-by: joyu <joyul@juniper.net>
Co-authored-by: Kumara Babu Narayanaswamy <bkumara@juniper.net>
|
| |
|
|
|
|
| |
- s/emtpy/empty/
MFC after: 5 days
|
| |
|
|
|
|
| |
No functional change intended.
MFC after: 1 week
|
| |
|
|
|
|
|
|
| |
We don't expect the VNET context to be set for virtqueue neither
for taskqueue handlers.
Suggested by: zec
Fixes: 3f2b9607756d0f92ca29c844db0718b313a06634
|
| |
|
|
|
|
|
|
|
|
|
| |
Add a new virtio backend to support SCMI VirtIO devices (type 32) as
defined by the VirtIO specification since version v1.2.
https://docs.oasis-open.org/virtio/virtio/v1.2/cs01/virtio-v1.2-cs01.pdf
Reviewed by: andrew, bryanv
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43047
|
| |
|
|
| |
The context is required for NIC-level pfil(9) filtering.
|