| a44270bd | 15-Jul-2019 |
Vincenzo Maffione <[email protected]> |
MFC r349581
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
MFC r349581
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: [email protected] Reviewed by: vmaffione Differential Revision: https://reviews.freebsd.org/D20824
show more ...
|
| e8cc65cd | 13-Feb-2019 |
Vincenzo Maffione <[email protected]> |
MFC r343579
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 c
MFC r343579
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.
Reviewed by: aleksandr.fedorov_itglobal.com Differential Revision: https://reviews.freebsd.org/D18956
show more ...
|
| e2e0ef76 | 06-Feb-2019 |
Vincenzo Maffione <[email protected]> |
MFC r343549
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. |
| 93b1d6a0 | 06-Feb-2019 |
Vincenzo Maffione <[email protected]> |
MFC r343346
netmap: improvements to the netmap kloop (CSB mode)
Changelist: - Add the proper memory barriers in the kloop ring processing functions. - Fix memory barriers usage in the
MFC r343346
netmap: improvements to the netmap kloop (CSB mode)
Changelist: - Add the proper memory barriers in the kloop ring processing functions. - Fix memory barriers usage in the user helpers (nm_sync_kloop_appl_write, nm_sync_kloop_appl_read). - Fix nm_kr_txempty() helper to look at rhead rather than rcur. This is important since the kloop can read a value of rcur which is ahead of the value of rhead (see explanation in nm_sync_kloop_appl_write) - Remove obsolete ptnetmap_guest_write_kring_csb() and ptnet_guest_read_kring_csb(), and update if_ptnet(4) to use those. - Prepare in advance the arguments for netmap_sync_kloop_[tr]x_ring(), to make the kloop faster. - Provide kernel and user implementation for nm_ldld_barrier() and nm_ldst_barrier()
show more ...
|
| 3d9e570d | 31-Dec-2018 |
Vincenzo Maffione <[email protected]> |
MFC r342368, r342369
netmap: fix bug in netmap_poll() optimization
The bug was introduced by r339639, although it is present in the upstream netmap code since 2015. It is due to resetting the want_
MFC r342368, r342369
netmap: fix bug in netmap_poll() optimization
The bug was introduced by r339639, although it is present in the upstream netmap code since 2015. It is due to resetting the want_rx variable to POLLIN, rather than resetting it to POLLIN|POLLRDNORM. It only affects select(), which uses POLLRDNORM. poll() is not affected, because it uses POLLIN. Also, it only affects FreeBSD, because Linux skips the optimization implemented by the piece of code where the bug occurs. To check if txsync can be skipped, it is necessary to look for unseen TX space. However, this means comparing ring->cur against ring->tail, rather than ring->head against ring->tail (like nm_ring_empty() does).
Sponsored by: Sunny Valley Networks
show more ...
|
| b381819a | 24-Dec-2018 |
Vincenzo Maffione <[email protected]> |
MFC r342300
netmap: move buf_size validation code to its own function
This code validates the netmap buf_size against the interface MTU and maximum descriptor size, to make sure the values are cons
MFC r342300
netmap: move buf_size validation code to its own function
This code validates the netmap buf_size against the interface MTU and maximum descriptor size, to make sure the values are consistent. Moving this functionality to its own function is needed because this function is also called by Linux-specific code.
show more ...
|
| a47bd78b | 14-Dec-2018 |
Vincenzo Maffione <[email protected]> |
MFC r341680
netmap: remove dead code obsoleted by iflib
The iflib subsystem implements netmap support in a driver-independent way (sys/net/iflib.c). We can therefore remove the headers that used to
MFC r341680
netmap: remove dead code obsoleted by iflib
The iflib subsystem implements netmap support in a driver-independent way (sys/net/iflib.c). We can therefore remove the headers that used to implement netmap support for all the drivers now supported by iflib (em, igb, ixl, ixgbe, lem).
show more ...
|