| #
89f6b863 |
| 09-Mar-2013 |
Attilio Rao <[email protected]> |
Switch the vm_object mutex to be a rwlock. This will enable in the future further optimizations where the vm_object lock will be held in read mode most of the time the page cache resident pool of pa
Switch the vm_object mutex to be a rwlock. This will enable in the future further optimizations where the vm_object lock will be held in read mode most of the time the page cache resident pool of pages are accessed for reading purposes.
The change is mostly mechanical but few notes are reported: * The KPI changes as follow: - VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK() - VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK() - VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK() - VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED() (in order to avoid visibility of implementation details) - The read-mode operations are added: VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(), VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED() * The vm/vm_pager.h namespace pollution avoidance (forcing requiring sys/mutex.h in consumers directly to cater its inlining functions using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h consumers now must include also sys/rwlock.h. * zfs requires a quite convoluted fix to include FreeBSD rwlocks into the compat layer because the name clash between FreeBSD and solaris versions must be avoided. At this purpose zfs redefines the vm_object locking functions directly, isolating the FreeBSD components in specific compat stubs.
The KPI results heavilly broken by this commit. Thirdy part ports must be updated accordingly (I can think off-hand of VirtualBox, for example).
Sponsored by: EMC / Isilon storage division Reviewed by: jeff Reviewed by: pjd (ZFS specific review) Discussed with: alc Tested by: pho
show more ...
|
| #
091fd0ab |
| 23-Jan-2013 |
Luigi Rizzo <[email protected]> |
Add support for transparent mode while in netmap.
By setting dev.netmap.fwd=1 (or enabling the feature with a per-ring flag), packets are forwarded between the NIC and the host stack unless the netm
Add support for transparent mode while in netmap.
By setting dev.netmap.fwd=1 (or enabling the feature with a per-ring flag), packets are forwarded between the NIC and the host stack unless the netmap client clears the NS_FORWARD flag on the individual descriptors.
This feature greatly simplifies applications where some traffic (think of ARP, control traffic, ssh sessions...) must be processed by the host stack, whereas the bulk is handled by the netmap process which simply (un)marks packets that should not be forwarded. The default is chosen so that now a netmap receiver operates in a mode very similar to bpf.
Of course there is no free lunch: traffic to/from the host stack still operates at OS speed (or less, as there is one extra copy in one direction). HOWEVER, since traffic goes to the user process before being reinjected, and reinjection occurs in a user context, you get some form of livelock protection for free.
show more ...
|
| #
ae10d1af |
| 23-Jan-2013 |
Luigi Rizzo <[email protected]> |
control some debugging messages with dev.netmap.verbose
add infrastracture to adapt to changes in number of queues and buffers at runtime
|
|
Revision tags: release/9.1.0 |
|
| #
88f79057 |
| 19-Oct-2012 |
Gleb Smirnoff <[email protected]> |
Fix build.
|
| #
8241616d |
| 19-Oct-2012 |
Luigi Rizzo <[email protected]> |
This is an import of code, mostly from Giuseppe Lettieri, that revises the netmap memory allocator so that the various parameters (number and size of buffers, rings, descriptors) can be modified at r
This is an import of code, mostly from Giuseppe Lettieri, that revises the netmap memory allocator so that the various parameters (number and size of buffers, rings, descriptors) can be modified at runtime through sysctl variables. The changes become effective when no netmap clients are active.
The API is mostly unchanged, although the NIOCUNREGIF ioctl now does not bring the interface back to normal mode: and you need to close the file descriptor for that. This change was necessary to track who is using the mapped region, and since it is a simplification of the API there was no incentive in trying to preserve NIOCUNREGIF. We will remove the ioctl from the kernel next time we need a real API change (and version bump).
Among other things, buffer allocation when opening devices is now much faster: it used to take O(N^2) time, now it is linear.
Submitted by: Giuseppe Lettieri
show more ...
|
| #
2f70fca5 |
| 09-Aug-2012 |
Ed Maste <[email protected]> |
Improve lock and unlock symmetry
- Move destruction of per-ring locks to netmap_dtor_locked to mirror the initialization that happens in NIOCREGIF. Otherwise unloading a netmap- capable interface t
Improve lock and unlock symmetry
- Move destruction of per-ring locks to netmap_dtor_locked to mirror the initialization that happens in NIOCREGIF. Otherwise unloading a netmap- capable interface that was never put into netmap mode would try to mtx_destroy an uninitialized mutex, and panic.
- Destroy core_lock in netmap_detach, mirroring init in netmap_attach.
- Also comment out the knlist_destroy for now as there is currently no knlist_init.
Sponsored by: ADARA Networks Reviewed by: luigi@
show more ...
|
| #
0bf88954 |
| 08-Aug-2012 |
Ed Maste <[email protected]> |
Fix whitespace (missing newline)
|
| #
24e57ec9 |
| 08-Aug-2012 |
Ed Maste <[email protected]> |
Clarify comments about number of tx / rx rings
|
| #
b3d53016 |
| 02-Aug-2012 |
Luigi Rizzo <[email protected]> |
fix some signed/unsigned warnings in the netmap code. Unfortunately the original drivers still have a lot of sign conversion/comparison warnings.
|
| #
42a3a5bd |
| 02-Aug-2012 |
Luigi Rizzo <[email protected]> |
Add a newline on an error message; rename linux functions to avoid confusion; fix error reporting on linux
|
| #
0b8ed8e0 |
| 30-Jul-2012 |
Luigi Rizzo <[email protected]> |
- move the inclusion of netmap headers to the common part of the code; - more portable annotations for unused arguments;
|
| #
01c7d25f |
| 27-Jul-2012 |
Luigi Rizzo <[email protected]> |
use __builtin_prefetch() for prefetch.
merge in the remaining part of the linux-specific glue so i do not need to maintain two different distributions.
|
| #
29ecb031 |
| 26-Jul-2012 |
Luigi Rizzo <[email protected]> |
define prefetch as a noop on !x86
|
| #
f196ce38 |
| 26-Jul-2012 |
Luigi Rizzo <[email protected]> |
Add support for VALE bridges to the netmap core, see
http://info.iet.unipi.it/~luigi/vale/
VALE lets you dynamically instantiate multiple software bridges that talk the netmap API (and are *ext
Add support for VALE bridges to the netmap core, see
http://info.iet.unipi.it/~luigi/vale/
VALE lets you dynamically instantiate multiple software bridges that talk the netmap API (and are *extremely* fast), so you can test netmap applications without the need for high end hardware.
This is particularly useful as I am completing a netmap-aware version of ipfw, and VALE provides an excellent testing platform.
Also, I also have netmap backends for qemu mostly ready for commit to the port, and this too will let you interconnect virtual machines at high speed without fiddling with bridges, tap or other slow solutions.
The API for applications is unchanged, so you can use the code in tools/tools/netmap (which i will update soon) on the VALE ports.
This commit also syncs the code with the one in my internal repository, so you will see some conditional code for other platforms. The code should run mostly unmodified on stable/9 so people interested in trying it can just copy sys/dev/netmap/ and sys/net/netmap*.h from HEAD
VALE is joint work with my colleague Giuseppe Lettieri, and is partly supported by the EU Projects CHANGE and OPENLAB
show more ...
|
| #
5b248374 |
| 03-May-2012 |
Luigi Rizzo <[email protected]> |
print 'netmap stack ring full' only in verbose mode.
|
| #
d76bf4ff |
| 13-Apr-2012 |
Luigi Rizzo <[email protected]> |
A bit of cleanup in the names of fields of netmap-related structures. Use the name 'ring' instead of 'queue' in all fields. Bump NETMAP_API.
|
| #
3c0caf6c |
| 12-Apr-2012 |
Luigi Rizzo <[email protected]> |
Some code restructuring to bring the memory allocator out of netmap.c and make it easier to replace it with a different implementation. On passing, also fix indentation.
NOTE: I know that #include "
Some code restructuring to bring the memory allocator out of netmap.c and make it easier to replace it with a different implementation. On passing, also fix indentation.
NOTE: I know that #include "foo.c" is ugly, but the alternative (add another entry to sys/conf/files, add a separate header with structs and prototypes, and expose functions that are meant to be private) looks even worse to me. We need a more modular way to specify dependencies and build options.
show more ...
|
| #
13b9940f |
| 12-Apr-2012 |
Luigi Rizzo <[email protected]> |
use correct selinfo pointer for the generic interrupt handler (it is never used in current FreeBSD drivers).
|
| #
c85cb1a0 |
| 11-Apr-2012 |
Luigi Rizzo <[email protected]> |
A couple of changes related to ixgbe operation in netmap mode:
- add a sysctl, dev.netmap.ix_crcstrip, to control whether ixgbe should strip the CRC on received frames. Defaults to 0, which keeps
A couple of changes related to ixgbe operation in netmap mode:
- add a sysctl, dev.netmap.ix_crcstrip, to control whether ixgbe should strip the CRC on received frames. Defaults to 0, which keeps the CRC. and improves performance when receiving min-sized (64-byte) frames. This matters because min-sized frames is one of the standard benchmarks for switches and routers, some chipsets seem to issue read-modify-write cycles for PCIe transactions that are not a full cache line, and a min-sized frame triggers the bug, resulting in reduced throughput -- 9.7 instead of 14.88 Mpps -- and heavy bus load.
- for the time being, always look for incoming packets on a select/poll even if there has not been an interrupt in the meantime. This is only a temporary workaround for a probable race condition in keeping track of rx interrupts. Add a couple of diagnostic vars to help studying the problem.
show more ...
|
|
Revision tags: release/8.3.0_cvs, release/8.3.0 |
|
| #
64ae02c3 |
| 27-Feb-2012 |
Luigi Rizzo <[email protected]> |
A bunch of netmap fixes:
USERSPACE: 1. add support for devices with different number of rx and tx queues;
2. add better support for zero-copy operation, adding an extra field to the netmap ring
A bunch of netmap fixes:
USERSPACE: 1. add support for devices with different number of rx and tx queues;
2. add better support for zero-copy operation, adding an extra field to the netmap ring to indicate how many buffers we have already processed but not yet released (with help from Eddie Kohler);
3. The two changes above unfortunately require an API change, so while at it add a version field and some spares to the ioctl() argument to help detect mismatches.
4. update the manual page for the two changes above;
5. update sample applications in tools/tools/netmap
KERNEL:
1. simplify the internal structures moving the global wait queues to the 'struct netmap_adapter';
2. simplify the functions that map kring<->nic ring indexes
3. normalize device-specific code, helps mainteinance;
4. start exploring the impact of micro-optimizations (prefetch etc.) in the ixgbe driver. Use 'legacy' descriptors on the tx ring and prefetch slots gives about 20% speedup at 900 MHz. Another 7-10% would come from removing the explict calls to bus_dmamap* in the core (they are effectively NOPs in this case, but it takes expensive load of the per-buffer dma maps to figure out that they are all NULL.
Rx performance not investigated.
I am postponing the MFC so i can import a few more improvements before merging.
show more ...
|
| #
babc7c12 |
| 17-Feb-2012 |
Luigi Rizzo <[email protected]> |
Various cleanups for readability (no functional changes)
- remove the KEVENT code, which was incomplete and not compiled anyways; - change some while() loops into for() - adjust indentation - remove
Various cleanups for readability (no functional changes)
- remove the KEVENT code, which was incomplete and not compiled anyways; - change some while() loops into for() - adjust indentation - remove extra whitespace
MFC after: 1 week
show more ...
|
| #
1a26580e |
| 13-Feb-2012 |
Luigi Rizzo <[email protected]> |
- use struct ifnet as explicit type of the argument to the txsync() and rxsync() callbacks, removing some variables made useless by this change;
- add generic lock and irq handling routines. The
- use struct ifnet as explicit type of the argument to the txsync() and rxsync() callbacks, removing some variables made useless by this change;
- add generic lock and irq handling routines. These can be useful in case there are no driver locks that we can reuse;
- add a few macros to reduce differences with the Linux version.
show more ...
|
| #
5819da83 |
| 08-Feb-2012 |
Luigi Rizzo <[email protected]> |
- change the buffer size from a constant to a TUNABLE variable (hw.netmap.buf_size) so we can experiment with values different from 2048 which may give better cache performance.
- rearrange the
- change the buffer size from a constant to a TUNABLE variable (hw.netmap.buf_size) so we can experiment with values different from 2048 which may give better cache performance.
- rearrange the memory allocation code so it will be easier to replace it with a different implementation. The current code relies on a single large contiguous chunk of memory obtained through contigmalloc. The new implementation (not committed yet) uses multiple smaller chunks which are easier to fit in a fragmented address space.
show more ...
|
| #
2157a17c |
| 26-Jan-2012 |
Luigi Rizzo <[email protected]> |
ixgbe changes: - remove experimental code for disabling CRC - use the correct constant for conversion between interrupt rate and EITR values (the previous values were off by a factor of 2) - make d
ixgbe changes: - remove experimental code for disabling CRC - use the correct constant for conversion between interrupt rate and EITR values (the previous values were off by a factor of 2) - make dev.ix.N.queueM.interrupt_rate a RW sysctl variable. Changing individual values affects the queue immediately, and propagates to all interfaces at the next reinit. - add dev.ix.N.queueM.irqs rdonly sysctl, to export the actual interrupt counts
Netmap-related changes for ixgbe: - use the "new" format for TX descriptors in netmap mode. - pass interrupt mitigation delays to the user process doing poll() on a netmap file descriptor. On the RX side this means we will not check the ring more than once per interrupt. This gives the process a chance to sleep and process packets in larger batches, thus reducing CPU usage. On the TX side we take this even further: completed transmissions are reclaimed every half ring even if the NIC interrupts more often. This saves even more CPU without any additional tx delays.
Generic Netmap-related changes: - align the netmap_kring to cache lines so that there is no false sharing (possibly useful for multiqueue NICs and MSIX interrupts, which are handled by different cores). It's a minor improvement but it does not cost anything.
Reviewed by: Jack Vogel Approved by: Jack Vogel
show more ...
|
| #
bcda432e |
| 13-Jan-2012 |
Luigi Rizzo <[email protected]> |
indentation and whitespace fixes
|