Commit graph

2 commits

Author SHA1 Message Date
Vincenzo Maffione
89277d29d3 MFC r366011
libnetmap: fix cast from uint64_t to void*

We use uintptr_t as an intermediate cast to avoid compiler
warnings on 32 bit architectures.

Reported by:    adrian
2021-08-17 07:30:34 +02:00
Vincenzo Maffione
36dca0fec6 MFC r364936, r365023
lib: add libnetmap

This changeset introduces the new libnetmap library for writing
netmap applications.
Before libnetmap, applications could either use the kernel API
directly (e.g. NIOCREGIF/NIOCCTRL) or the simple header-only-library
netmap_user.h (e.g. nm_open(), nm_close(), nm_mmap() etc.)

The new library offers more functionalities than netmap_user.h:
  - Support for complex netmap options, such as external memory
    allocators or per-buffer offsets. This opens the way to future
    extensions.
  - More flexibility in the netmap port bind options, such as
    non-numeric names for pipes, or the ability to specify the netmap
    allocator that must be used for a given port.
  - Automatic tracking of the netmap memory regions in use across the
    open ports.

At the moment there is no man page, but the libnetmap.h header file
 has in-depth documentation.

Reviewed by:    hrs
Differential Revision:  https://reviews.freebsd.org/D26171
2021-08-17 07:30:33 +02:00