<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/netmap/if_vtnet_netmap.h, 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-01-17T13:38:09Z</updated>
<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 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 r361760</title>
<updated>2020-06-10T20:05:53Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T20:05:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e00de8771ba728c75529e3354b317bc0bb42b632'/>
<id>urn:sha1:e00de8771ba728c75529e3354b317bc0bb42b632</id>
<content type='text'>
netmap: vtnet: clean up rxsync disabled logs
</content>
</entry>
<entry>
<title>MFC r361759</title>
<updated>2020-06-10T20:05:07Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T20:05:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=beb423280d436e421f6230c6b9062ac63d0179cd'/>
<id>urn:sha1:beb423280d436e421f6230c6b9062ac63d0179cd</id>
<content type='text'>
netmap: vtnet: fix race condition in rxsync

This change prevents a race that happens when rxsync dequeues
N-1 rx packets (with N being the size of the netmap rx ring).
In this situation, the loop exits without re-enabling the
rx interrupts, thus causing the VQ to stall.
</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 r361746</title>
<updated>2020-06-10T20:03:11Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T20:03:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d5255b344c2fdd20c33c5637be76fe11e2b260db'/>
<id>urn:sha1:d5255b344c2fdd20c33c5637be76fe11e2b260db</id>
<content type='text'>
netmap: vale: fix disabled logs
</content>
</entry>
<entry>
<title>MFC r361698</title>
<updated>2020-06-10T19:58:03Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T19:58:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5422d37b8a664d341462ca9e350162432fea674f'/>
<id>urn:sha1:5422d37b8a664d341462ca9e350162432fea674f</id>
<content type='text'>
netmap: if_vtnet: avoid netmap ring wraparound

netmap assumes the one "slot" is left unused to distinguish
the empty ring and full ring conditions. This assumption was
violated by vtnet_netmap_rxq_populate().
</content>
</entry>
<entry>
<title>MFC r361697</title>
<updated>2020-06-10T19:57:10Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T19:57:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e71f4bb392395bee4bb5c4445d190f685d46d585'/>
<id>urn:sha1:e71f4bb392395bee4bb5c4445d190f685d46d585</id>
<content type='text'>
netmap: if_vtnet: replace vtnet_free_used()

The functionality contained in this function is duplicated,
as it is already available in vtnet_txq_free_mbufs()
and vtnet_rxq_free_mbufs().
</content>
</entry>
<entry>
<title>MFC r361696</title>
<updated>2020-06-10T19:55:36Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2020-06-10T19:55:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=98927bed50c1a504ff68818c080d0cfe3fcbe758'/>
<id>urn:sha1:98927bed50c1a504ff68818c080d0cfe3fcbe758</id>
<content type='text'>
netmap: vtnet: fix RX virtqueue initialization bug

The vtnet_netmap_rxq_populate() function erroneously assumed
that kring-&gt;nr_hwcur = 0, i.e. the kring was in the initial
state. However, this is not always the case: for example,
when a vtnet reinit is triggered by some changes in the
interface flags or capenable.
This patch changes the behaviour of vtnet_netmap_kring_refill()
so that it always starts publishing the netmap buffers starting
from the current value of kring-&gt;nr_hwcur.
</content>
</entry>
</feed>
