<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/virtio/network, branch release/12.3.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F12.3.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F12.3.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2021-08-05T20:05:26Z</updated>
<entry>
<title>virtio: enable VTNET_LEGACY_TX when ALTQ is enabled.</title>
<updated>2021-08-05T20:05:26Z</updated>
<author>
<name>Luiz Otavio O Souza</name>
<email>loos@FreeBSD.org</email>
</author>
<published>2017-10-26T02:30:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=973304077ff865a6ebeb55aa1d38f8d44b7dc3b4'/>
<id>urn:sha1:973304077ff865a6ebeb55aa1d38f8d44b7dc3b4</id>
<content type='text'>
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)
</content>
</entry>
<entry>
<title>netmap: vtnet: stop krings during interface reset</title>
<updated>2021-01-17T13:38:09Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2021-01-09T22:34:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fa1a4ff944f4b3e841df0cdd67c6373a589ffdd5'/>
<id>urn:sha1:fa1a4ff944f4b3e841df0cdd67c6373a589ffdd5</id>
<content type='text'>
Similarly to what done for iflib in 1d238b07d5d4d9660ae0e,
this patch prevents access to the krings during the interface
reset triggered by netmap_register().

MFC after:	1 week

(cherry picked from commit 9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a)

netmap: vtnet: enable/disable krings on any interface reinit

See 3d65fd97e85ab807f3b for a detailed explanation.

PR:             252453
MFC after:      1 week

(cherry picked from commit bb714db6d39583a9fbf5d11849c5e2365e7c0d80)

netmap: vtnet: fix RX initialization after netmap_reset()

At device reset, we must not publish those netmap receive buffers
that are owned by userspace (nm_kr_rxspace).

MFC after:	1 week

(cherry picked from commit 3005e10ddbfbec3ecf46a080607bb0d85986eee5)
</content>
</entry>
<entry>
<title>MFC r362204</title>
<updated>2020-07-01T19:42:23Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-07-01T19:42:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9b8f0814882923c3cbbb39ad852bcd5460d1fa4a'/>
<id>urn:sha1:9b8f0814882923c3cbbb39ad852bcd5460d1fa4a</id>
<content type='text'>
if_vtnet: let vtnet_rx_vq_intr() and vtnet_rxq_tq_intr() share code

Since the two functions are similar, introduce a common function
(vtnet_rx_vq_process()) to share common code.
This also improves locking, by ensuring vrxs_rescheduled is accessed
under the RXQ lock, and taskqueue_enqueue() is not called under the
lock (therefore avoiding a spurious duplicate lock warning).

Reported by:    jrtc27
</content>
</entry>
<entry>
<title>MFC r362183</title>
<updated>2020-06-23T20:41:10Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-23T20:41:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e2573c8c1836ac4c91d5fd042c69e0d4932a2ea4'/>
<id>urn:sha1:e2573c8c1836ac4c91d5fd042c69e0d4932a2ea4</id>
<content type='text'>
netmap: vtnet: fix races in vtnet_netmap_reg()

The nm_register callback needs to call nm_set_native_flags()
or nm_clear_native_flags() once the device has been stopped.
However, in the current implementation this is not true,
as the device is stopped by vtnet_init_locked(). This causes
race conditions where the driver crashes as soon as it
dequeues netmap buffers assuming they are mbufs (or the other
way around).
To fix the issue, we extend vtnet_init_locked() with a second
argument that, if not zero, will set/clear the netmap flags.
This results in a huge simplification of the nm_register
callback itself.
Also, use netmap_reset() to check if a ring is going to be
re-initialized in netmap mode.
</content>
</entry>
<entry>
<title>MFC r362076</title>
<updated>2020-06-18T10:03:17Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-18T10:03:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=eb49c2778b3b0cfc38eb5659ec94a48bd5d251c9'/>
<id>urn:sha1:eb49c2778b3b0cfc38eb5659ec94a48bd5d251c9</id>
<content type='text'>
netmap: introduce netmap_kring_on()

This function returns NULL if the ring identified by
queue id and direction is in netmap mode. Otherwise
return the corresponding kring.
Use this function to replace vtnet_netmap_queue_on().
</content>
</entry>
<entry>
<title>MFC r361758</title>
<updated>2020-06-10T20:04:20Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T20:04:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0dd06b856e0076af19d1a828f6751342b75c8e49'/>
<id>urn:sha1:0dd06b856e0076af19d1a828f6751342b75c8e49</id>
<content type='text'>
netmap: vtnet: add vtnrx_nm_refill index to receive queues

The new index tracks the next netmap slot that is going
to be enqueued into the virtqueue. The index is necessary
to prevent the receive VQ and the netmap rx ring from going
out of sync, considering that we never enqueue N slots, but
at most N-1. This change fixes a bug that causes the VQ
and the netmap ring to go out of sync after N-1 packets
have been received.
</content>
</entry>
<entry>
<title>MFC r361745</title>
<updated>2020-06-10T20:02:38Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T20:02:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c3c61399d66e6ba3b6c0dba7d30be7f87528c29c'/>
<id>urn:sha1:c3c61399d66e6ba3b6c0dba7d30be7f87528c29c</id>
<content type='text'>
netmap: vtnet: call netmap_rx_irq() under VQ lock

The netmap_rx_irq() function normally wakes up user-space threads
waiting for more packets. In this case, it is not necessary to
call it under the driver queue lock. However, if the interface is
attached to a VALE switch, netmap_rx_irq() ends up calling rxsync
on the interface (see netmap_bwrap_intr_notify()). Although
concurrent rxsyncs are serialized through the kring lock
(see nm_kr_tryget()), the lock acquire operation is not blocking.
As a result, it may happen that netmap_rx_irq() is called on
an RX ring while another instance is running, causing the
second call to fail, and received packets stall in the receive VQ.
We fix this issue by calling netmap_irx_irq() under the VQ lock.
</content>
</entry>
<entry>
<title>MFC r361744</title>
<updated>2020-06-10T19:59:11Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T19:59:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4e13200941b362f02f4331a47e081c9596fcf74c'/>
<id>urn:sha1:4e13200941b362f02f4331a47e081c9596fcf74c</id>
<content type='text'>
netmap: vtnet: honor NM_IRQ_RESCHED

The netmap_rx_irq() function may return NM_IRQ_RESCHED to inform the
driver that more work is pending, and that netmap expects netmap_rx_irq()
to be called again as soon as possible.
This change implements this behaviour in the vtnet driver.
</content>
</entry>
<entry>
<title>MFC r347233:</title>
<updated>2019-05-17T08:19:43Z</updated>
<author>
<name>Michael Tuexen</name>
<email>tuexen@FreeBSD.org</email>
</author>
<published>2019-05-17T08:19:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1218c570f80c9eeb896478df74bf6401c752aa80'/>
<id>urn:sha1:1218c570f80c9eeb896478df74bf6401c752aa80</id>
<content type='text'>
Remove non-functional SCTP checksum offload support for virtio.

Checksum offloading for SCTP is not currently specified for virtio.
If the hypervisor announces checksum offloading support, it means TCP
and UDP checksum offload. If an SCTP packet is sent and the host announced
checksum offload support, the hypervisor inserts the IP checksum (16-bit)
at the correct offset, but this is not the right checksum, which is a CRC32c.
This results in all outgoing packets having the wrong checksum and therefore
breaking SCTP based communications.

This patch removes SCTP checksum offloading support from the virtio
network interface.

Thanks to Felix Weinrank for making me aware of the issue.
</content>
</entry>
<entry>
<title>MFC r343552</title>
<updated>2019-02-01T12:22:48Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2019-02-01T12:22:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2a629edb61941e9ccedb8146c91a597bc9bcb7d6'/>
<id>urn:sha1:2a629edb61941e9ccedb8146c91a597bc9bcb7d6</id>
<content type='text'>
vtnet: fix typo in vtnet_free_taskqueues

Because of a typo, the code was mistakenly resetting the
vtnrx_vq pointer rather than vtntx_tq.

Reviewed by:    bryanv
Differential Revision:  https://reviews.freebsd.org/D19015
</content>
</entry>
</feed>
