Commit Graph

4 Commits

Author SHA1 Message Date
Adrian Chadd
26c29e743b [libnetmap] Fix 32 bit compilation under gcc-6.4
Use uintptr_t to cast a uint64_t to a pointer type.
Yeah, it isn't technically correct for platforms with pointers
> 64 bits, but it's fine here.

This fixes 32 bit compat library builds on amd64 and also
mips32 builds.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D26790
2020-11-02 15:01:37 +00:00
Vincenzo Maffione
92c5d82c86 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
MFC after:	3 days
2020-09-22 20:20:43 +00:00
Vincenzo Maffione
4c067f3842 lib: libnetmap: add missing copyright headers
MFC after:	2 weeks
2020-09-01 06:06:32 +00:00
Vincenzo Maffione
5c4f8d801c 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
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26171
2020-08-28 20:03:54 +00:00