History log of /freebsd/sys/dev/virtio/network/if_vtnet.c (Results 1 – 25 of 203)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 0fc7bdc9 29-Nov-2024 Richard Scheffenegger <rscheff@FreeBSD.org>

tcp: extend the use of the th_flags accessor function

Formally, there are 12 bits for TCP header flags.
Use the accessor functions in more (kernel) places.

No functional change.

Reviewed By: cc, #

tcp: extend the use of the th_flags accessor function

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

show more ...


Revision tags: release/14.2.0, release/13.4.0
# aa386085 28-Jun-2024 Zhenlei Huang <zlei@FreeBSD.org>

net: Remove unneeded NULL check for the allocated ifnet

Change 4787572d0580 made if_alloc_domain() never fail, then also do the
wrappers if_alloc(), if_alloc_dev(), and if_gethandle().

No functiona

net: Remove unneeded NULL check for the allocated ifnet

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

show more ...


Revision tags: release/14.1.0
# a01c7081 18-Apr-2024 Gleb Smirnoff <glebius@FreeBSD.org>

vtnet: use CURVNET_SET() instead of CURVNET_SET_QUIET()

We don't expect the VNET context to be set for virtqueue neither
for taskqueue handlers.

Suggested by: zec
Fixes: 3f2b9607756d0f92ca29c844db

vtnet: use CURVNET_SET() instead of CURVNET_SET_QUIET()

We don't expect the VNET context to be set for virtqueue neither
for taskqueue handlers.

Suggested by: zec
Fixes: 3f2b9607756d0f92ca29c844db0718b313a06634

show more ...


# 3f2b9607 28-Mar-2024 Gleb Smirnoff <glebius@FreeBSD.org>

vtnet: set VNET context in RX handler

The context is required for NIC-level pfil(9) filtering.


Revision tags: release/13.3.0
# 0ea4b408 05-Feb-2024 Warner Losh <imp@FreeBSD.org>

vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT

Some platforms require an adjustment of the ethernet hearders. Rather
than make this be on __NO_STRICT_ALIGNMENT being defined, define
VTNET_ETHER_

vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT

Some platforms require an adjustment of the ethernet hearders. Rather
than make this be on __NO_STRICT_ALIGNMENT being defined, define
VTNET_ETHER_ALIGN to be either 0 or ETHER_ALIGN (aka 2). Add a test to
the if statements to only do them when != 0. This eliminates the #ifdef
sprinkled in the code, still communicates the intent and gives the same
compiled results.

Sponsored by: Netflix
Reviewed by: bz, bryanv
Differential Revision: https://reviews.freebsd.org/D43654

show more ...


# d9e0e426 05-Feb-2024 Warner Losh <imp@FreeBSD.org>

vtnet: Account for the padding when selecting allocation size

While we account for the padding in the length of the mbuf we use, we do
not account for it when we 'guess' the size of the mbuf to allo

vtnet: Account for the padding when selecting allocation size

While we account for the padding in the length of the mbuf we use, we do
not account for it when we 'guess' the size of the mbuf to allocate
based in the MTU of the device. This leads to a situation where we might
fail if the mtu is close to a bucket size (say 2018) such that the added
padding would push us over the edge for a full-sized packet. mtu of 2018
is super rare (2016 and 2020 would both work), but fix it none-the-less.
It's a shame we can't just set VTNET_RX_HEADER_PAD to 2 in this case. The 4
seems hard-coded somewhere I've not found documented (I think it's in the
protocol given the comments about VIRTIO_F_ANY_LAYOUT).

Sponsored by: Netflix
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D43656

show more ...


# 3be59adb 29-Jan-2024 Warner Losh <imp@FreeBSD.org>

vtnet: Adjust for ethernet alignment.

If the header that we add to the packet's size is 0 % 4 and we're
strictly aligning, then we need to adjust where we store the header so
the packet that follows

vtnet: Adjust for ethernet alignment.

If the header that we add to the packet's size is 0 % 4 and we're
strictly aligning, then we need to adjust where we store the header so
the packet that follows will have it's struct ip header properly
aligned. We do this on allocation (and when we check the length of the
mbufs in the lro_nomrg case). We can't just adjust the clustersz in the
softc, because it's also used to allocate the mbufs and it needs to be
the proper size for that. Since we otherwise use the size of the mbuf
(or sometimes the smaller size of the received packet) to compute how
much we can buffer, this ensures no overflows. The 2 byte adjustment
also does not affect how many packets we can receive in the lro_nomrg
case.

PR: 271288
Sponsored by: Netflix
Reviewed by: bryanv
Differential Revision: https://reviews.freebsd.org/D43224

show more ...


# 23699ff2 28-Dec-2023 Warner Losh <imp@FreeBSD.org>

Revert "vtnet: Adjust rx buffer so IP header 32-bit aligned"

This reverts commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4.

This wasn't right to start with...

Requested by: markj


# 8ee1cc4a 28-Dec-2023 Warner Losh <imp@FreeBSD.org>

Revert "vtnet: Better adjust for ethernet alignment."

This reverts commit e9da71cd35d46ca13da4396d99e0af1703290e68.

This was inadvertantly pushed and turns out ot be not quite right.

Requested by:

Revert "vtnet: Better adjust for ethernet alignment."

This reverts commit e9da71cd35d46ca13da4396d99e0af1703290e68.

This was inadvertantly pushed and turns out ot be not quite right.

Requested by: markj

show more ...


# e9da71cd 21-Dec-2023 Warner Losh <imp@FreeBSD.org>

vtnet: Better adjust for ethernet alignment.

Move adjustment of the mbuf from where we allocate it to where we are
about to queue it to the device. Do this only on those platforms that
require it. T

vtnet: Better adjust for ethernet alignment.

Move adjustment of the mbuf from where we allocate it to where we are
about to queue it to the device. Do this only on those platforms that
require it. This allows us to receive an entire jumbo frame on other
platforms. It also doesn't make the adjustment on subsequent frames when
we queue mulitple mbufs for LRO operations.

For the normal use case on armv7, there's no difference because we only
ever allocate one mbuf. However, for the LRO cases it increases what's
available in LRO. It also ensure that we get enough mbufs in those cases
as well (though I have no ability to test this on a LRO scenario with
armv7).

This has the side effect of reverting 527b62e37e68.

Fixes: 527b62e37e68
Sponsored by: Netflix

show more ...


# 9e6d11ce 20-Dec-2023 Warner Losh <imp@FreeBSD.org>

vtnet: Adjust rx buffer so IP header 32-bit aligned

Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating them.
This improves performance everywhere, and allows armv7 to work at all.

PR:

vtnet: Adjust rx buffer so IP header 32-bit aligned

Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating them.
This improves performance everywhere, and allows armv7 to work at all.

PR: 271288 (PR had a different fix than I wound up with)
MFC After: 3 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43136

show more ...


# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remov

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


Revision tags: release/14.0.0
# 180c0240 18-Sep-2023 Mina Galić <freebsd@igalic.co>

virtio: remove virtio_alloc_virtqueues' flags arg

Summary:
the flags argument is unused.
Its initial design idea has been superceded by the addition of
virtio_setup_intr and related APIs.

Sponsored

virtio: remove virtio_alloc_virtqueues' flags arg

Summary:
the flags argument is unused.
Its initial design idea has been superceded by the addition of
virtio_setup_intr and related APIs.

Sponsored by: The FreeBSD Foundation

Reviewers: bryanv

Reviewed By: bryanv

Subscribers: cognet, imp

Differential Revision: https://reviews.freebsd.org/D41850

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 580cadd6 08-Aug-2023 Kristof Provost <kp@FreeBSD.org>

vtnet: allow IFF_ALLMULTI to be set without VIRTIO_NET_F_CTRL_RX

If the host doesn't announce VIRTIO_NET_F_CTRL_RX we cannot disable all
multicast traffic. Previously we'd refuse to set the IFF_ALLM

vtnet: allow IFF_ALLMULTI to be set without VIRTIO_NET_F_CTRL_RX

If the host doesn't announce VIRTIO_NET_F_CTRL_RX we cannot disable all
multicast traffic. Previously we'd refuse to set the IFF_ALLMULTI flag,
which is the exact opposite of what is actually happening.

This broke things such as igmpproxy.

See also: https://redmine.pfsense.org/issues/14301
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41356

show more ...


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

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

show more ...


# a6b55ee6 17-Apr-2023 Gleb Smirnoff <glebius@FreeBSD.org>

net: replace IFF_KNOWSEPOCH with IFF_NEEDSEPOCH

Expect that drivers call into the network stack with the net epoch
entered. This has already been the fact since early 2020. The net
interrupts, that

net: replace IFF_KNOWSEPOCH with IFF_NEEDSEPOCH

Expect that drivers call into the network stack with the net epoch
entered. This has already been the fact since early 2020. The net
interrupts, that are marked with INTR_TYPE_NET, were entering epoch
since 511d1afb6bf. For the taskqueues there is NET_TASK_INIT() and
all drivers that were known back in 2020 we marked with it in
6c3e93cb5a4. However in e87c4940156 we took conservative approach
and preferred to opt-in rather than opt-out for the epoch.

This change not only reverts e87c4940156 but adds a safety belt to
avoid panicing with INVARIANTS if there is a missed driver. With
INVARIANTS we will run in_epoch() check, print a warning and enter
the net epoch. A driver that prints can be quickly fixed with the
IFF_NEEDSEPOCH flag, but better be augmented to properly enter the
epoch itself.

Note on TCP LRO: it is a backdoor to enter the TCP stack bypassing
some layers of net stack, ignoring either old IFF_KNOWSEPOCH or the
new IFF_NEEDSEPOCH. But the tcp_lro_flush_all() asserts the presence
of network epoch. Indeed, all NIC drivers that support LRO already
provide the epoch, either with help of INTR_TYPE_NET or just running
NET_EPOCH_ENTER() in their code.

Reviewed by: zlei, gallatin, erj
Differential Revision: https://reviews.freebsd.org/D39510

show more ...


Revision tags: release/13.2.0
# a2256150 14-Feb-2023 Gleb Smirnoff <glebius@FreeBSD.org>

net: use pfil_mbuf_{in,out} where we always have an mbuf

This finalizes what has been started in 0b70e3e78b0.

Reviewed by: kp, mjg
Differential revision: https://reviews.freebsd.org/D37976


Revision tags: release/12.4.0, release/13.1.0
# 4ee96792 01-Mar-2022 Justin Hibbits <jhibbits@FreeBSD.org>

Mechanically convert if_vtnet(4) to IfAPI

Reviewed By: bryanv
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37799


# 5c4c96d3 07-May-2022 John Baldwin <jhb@FreeBSD.org>

virtio: Remove unused devclass arguments to DRIVER_MODULE.


# 53236f90 19-Apr-2022 Michael Tuexen <tuexen@FreeBSD.org>

if_vtnet: improve dumping a kernel

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

if_vtnet: improve dumping a kernel

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
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D34787

show more ...


# 127b40e7 14-Apr-2022 John Baldwin <jhb@FreeBSD.org>

vtnet: offset is only used for INET or INET6.


# fc035df8 05-Feb-2022 Aleksandr Fedorov <afedorov@FreeBSD.org>

if_vtnet(4): Restore the ability to set promisc mode.

PR: 254343, 255054
Reviewed by: vmaffione (mentor), donner
Approved by: vmaffione (mentor), donner
MFC after: 2 weeks
Sponsored by: vstack.com
D

if_vtnet(4): Restore the ability to set promisc mode.

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

show more ...


# 526ddf17 20-Jan-2022 Mark Johnston <markj@FreeBSD.org>

vtnet: Mark MRG_RXBUF headers as initialized before loading fields

MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# 3f6ab549 05-Jan-2022 Gleb Smirnoff <glebius@FreeBSD.org>

vtnet: don't leak pfil(9) data on detach

PR: 260667
Submitted by: <ghuckriede blackberry.com>


123456789