<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/sys/dev/netmap/netmap_freebsd.c, branch release/11.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F11.4.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F11.4.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2019-07-15T20:38:56Z</updated>
<entry>
<title>MFC r349581</title>
<updated>2019-07-15T20:38:56Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2019-07-15T20:38:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=98e3c366bcccb2be7fa1457820599afa23f9faf1'/>
<id>urn:sha1:98e3c366bcccb2be7fa1457820599afa23f9faf1</id>
<content type='text'>
netmap: fix two panics with emulated adapter

This patch fixes 2 panics. The first one is due to the current VNET not
being set in the emulated adapter transmission path. The second one
is caused by the M_PKTHDR flag not being set when preallocated mbufs
are recycled in the transmit path.

Submitted by:   aleksandr.fedorov@itglobal.com
Reviewed by:    vmaffione
Differential Revision:  https://reviews.freebsd.org/D20824
</content>
</entry>
<entry>
<title>MFC r343579, r344253</title>
<updated>2019-02-25T09:13:33Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2019-02-25T09:13:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=98fe26932fe1d4af562a7ba2a6edf1c23295656a'/>
<id>urn:sha1:98fe26932fe1d4af562a7ba2a6edf1c23295656a</id>
<content type='text'>
netmap: fix lock order reversal related to kqueue usage

When using poll(), select() or kevent() on netmap file descriptors,
netmap executes the equivalent of NIOCTXSYNC and NIOCRXSYNC commands,
before collecting the events that are ready. In other words, the
poll/kevent callback has side effects. This is done to avoid the
overhead of two system call per iteration (e.g., poll() + ioctl(NIOC*XSYNC)).

When the kqueue subsystem invokes the kqueue(9) f_event callback
(netmap_knrw), it holds the lock of the struct knlist object associated
to the netmap port (the lock is provided at initialization, by calling
knlist_init_mtx).
However, netmap_knrw() may need to wake up another netmap port (or even
the same one), which means that it may need to call knote().
Since knote() needs the lock of the struct knlist object associated to
the to-be-wake-up netmap port, it is possible to have a lock order reversal
problem (AB/BA deadlock).

This change prevents the deadlock by executing the knote() call in a
per-selinfo taskqueue, where it is possible to hold a mutex.
The change also adds a counter (kqueue_users) to keep track of how many
kqueue users are referencing a given struct nm_selinfo.
In this way, nm_os_selwakeup() can schedule the kevent notification
task only when kqueue is actually being used.
This is important to avoid wasting CPU in the common case where
kqueue is not used.

Reviewed by:    aleksandr.fedorov_itglobal.com
Differential Revision:  https://reviews.freebsd.org/D18956
</content>
</entry>
<entry>
<title>MFC r343772, r343867</title>
<updated>2019-02-12T09:26:05Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2019-02-12T09:26:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=adf75b88b6bf12a8e23193335dcffd9cab6125a1'/>
<id>urn:sha1:adf75b88b6bf12a8e23193335dcffd9cab6125a1</id>
<content type='text'>
netmap: refactor logging macros and pipes

Changelist:
    - Replace ND, D and RD macros with nm_prdis, nm_prinf, nm_prerr
      and nm_prlim, to avoid possible naming conflicts.
    - Add netmap_krings_mode_commit() helper function and use that
      to reduce code duplication.
    - Refactor pipes control code to export some functions that
      can be reused by the veth driver (on Linux) and epair(4).
    - Add check to reject API requests with version less than 11.
    - Small code refactoring for the null adapter.
</content>
</entry>
<entry>
<title>MFC r343549</title>
<updated>2019-02-06T10:00:40Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2019-02-06T10:00:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=e83cf8b55eb855051cac43804353e4871e2253f2'/>
<id>urn:sha1:e83cf8b55eb855051cac43804353e4871e2253f2</id>
<content type='text'>
netmap: add notifications on kloop stop

On sync-kloop stop, send a wake-up signal to the kloop, so that
waiting for the timeout is not needed.
Also, improve logging in netmap_freebsd.c.
</content>
</entry>
<entry>
<title>MFC r343344</title>
<updated>2019-02-06T09:38:44Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2019-02-06T09:38:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=468f2bc0a33e5b7b94c5c5be4ac43372c0ff8098'/>
<id>urn:sha1:468f2bc0a33e5b7b94c5c5be4ac43372c0ff8098</id>
<content type='text'>
netmap: fix knote() argument to match the mutex state

The nm_os_selwakeup function needs to call knote() to wake up kqueue(9)
users. However, this function can be called from different code paths,
with different lock requirements.
This patch fixes the knote() call argument to match the relavant lock state.
Also, comments have been updated to reflect current code.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219846
Reported by:    Aleksandr Fedorov &lt;aleksandr.fedorov@itglobal.com&gt;
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D18876
</content>
</entry>
<entry>
<title>MFC r341516, r341589</title>
<updated>2018-12-13T10:13:29Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2018-12-13T10:13:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=e73b4a2eeb9072e4f55e8a8cdac21137874d6e77'/>
<id>urn:sha1:e73b4a2eeb9072e4f55e8a8cdac21137874d6e77</id>
<content type='text'>
netmap: align codebase to the current upstream (760279cfb2730a585)

Changelist:
  - Replace netmap passthrough host support with a more general
    mechanism to call TXSYNC/RXSYNC from an in-kernel event-loop.
    No kernel threads are used to use this feature: the application
    is required to spawn a thread (or a process) and issue a
    SYNC_KLOOP_START (NIOCCTRL) command in the thread body. The
    kernel loop is executed by the ioctl implementation, which returns
    to userspace only when a different thread calls SYNC_KLOOP_STOP
    or the netmap file descriptor is closed.
  - Update the if_ptnet driver to cope with the new data structures,
    and prune all the obsolete ptnetmap code.
  - Add support for "null" netmap ports, useful to allocate netmap_if,
    netmap_ring and netmap buffers to be used by specialized applications
    (e.g. hypervisors). TXSYNC/RXSYNC on these ports have no effect.
  - Various fixes and code refactoring.

Sponsored by:   Sunny Valley Networks
Differential Revision:  https://reviews.freebsd.org/D18015
</content>
</entry>
<entry>
<title>MFC r341144</title>
<updated>2018-12-04T17:47:43Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2018-12-04T17:47:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=6301fa85108b1431720d110cdb84c7af7184dd4a'/>
<id>urn:sha1:6301fa85108b1431720d110cdb84c7af7184dd4a</id>
<content type='text'>
netmap: set IFCAP_NETMAP in if_capabilities

Revision r307394 removed (by mistake) the code that sets IFCAP_NETMAP
in if_capabilities on netmap_attach. This patch reverts this change.

Reviewed by:    np
Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17987
</content>
</entry>
<entry>
<title>MFC r339639</title>
<updated>2018-12-04T17:40:56Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2018-12-04T17:40:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=6d6d3f62b0e244d40adfbfc82c7f4b3aa1f14f70'/>
<id>urn:sha1:6d6d3f62b0e244d40adfbfc82c7f4b3aa1f14f70</id>
<content type='text'>
netmap: align codebase to the current upstream (sha 8374e1a7e6941)

Changelist:
    - Move large parts of VALE code to a new file and header netmap_bdg.[ch].
      This is useful to reuse the code within upcoming projects.
    - Improvements and bug fixes to pipes and monitors.
    - Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to
      handle differences between FreeBSD and Linux.
    - Introduce some new helper functions to handle more host rings and fake
      rings (netmap_all_rings(), netmap_real_rings(), ...)
    - Added new sysctl to enable/disable hw checksum in emulated netmap mode.
    - nm_inject: add support for NS_MOREFRAG

Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17364
</content>
</entry>
<entry>
<title>MFC r337812,r337814,r337820,r341068:</title>
<updated>2018-11-30T02:06:30Z</updated>
<author>
<name>David Bright</name>
<email>dab@FreeBSD.org</email>
</author>
<published>2018-11-30T02:06:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=e0c9b086295b723105a2d9db6952220865c8347d'/>
<id>urn:sha1:e0c9b086295b723105a2d9db6952220865c8347d</id>
<content type='text'>
Fix several memory leaks (r337812 &amp; r337814).

The libkqueue tests have several places that leak memory by using an
idiom like:

  puts(kevent_to_str(kevp));

Rework to save the pointer returned from kevent_to_str() and then
free() it after it has been used.

r337812 also fixed a bug in the netmap kevent code. The inclusion of
that fix was an oversight that I didn't notice until this
MFC. Reference the code review and PR here in the MFC for
completeness.

r337820 &amp; r341068 were white-space only changes as a follow-up to
r337812 &amp; r337814:

After r337820, which "corrected" some spaces-instead-of-tab whitespace
issues in the libkqueue tests, jmg@ pointed out that these files were
originally space-based, not tab-spaced, and so the correction should
have been to get rid of the tabs that had been introduced in previous
changes, not the spaces. This change does that. This is a whitespace
only change; no functional change is intended.

PR:  206053
Differential Revision:    https://reviews.freebsd.org/D16531
Sponsored by:	Dell EMC Isilon
</content>
</entry>
<entry>
<title>Revert r330897:</title>
<updated>2018-03-29T02:50:57Z</updated>
<author>
<name>Eitan Adler</name>
<email>eadler@FreeBSD.org</email>
</author>
<published>2018-03-29T02:50:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=4ab2e064d7950be84256d671a7ae93f87cc6aa36'/>
<id>urn:sha1:4ab2e064d7950be84256d671a7ae93f87cc6aa36</id>
<content type='text'>
This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)
</content>
</entry>
</feed>
