svn commit: r366013 - in stable/12: lib lib/libnetmap share/mk
Vincenzo Maffione
vmaffione at FreeBSD.org
Tue Sep 22 21:16:05 UTC 2020
Author: vmaffione
Date: Tue Sep 22 21:16:03 2020
New Revision: 366013
URL: https://svnweb.freebsd.org/changeset/base/366013
Log:
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
Added:
stable/12/lib/libnetmap/
- copied from r364936, head/lib/libnetmap/
Modified:
stable/12/lib/Makefile
stable/12/lib/libnetmap/nmctx-pthreads.c
stable/12/lib/libnetmap/nmctx.c
stable/12/lib/libnetmap/nmport.c
stable/12/lib/libnetmap/nmreq.c
stable/12/share/mk/bsd.libnames.mk
stable/12/share/mk/src.libnames.mk
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/lib/Makefile
==============================================================================
--- stable/12/lib/Makefile Tue Sep 22 21:13:26 2020 (r366012)
+++ stable/12/lib/Makefile Tue Sep 22 21:16:03 2020 (r366013)
@@ -66,6 +66,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libmt \
lib80211 \
libnetbsd \
+ libnetmap \
libnv \
libopenbsd \
libopie \
Modified: stable/12/lib/libnetmap/nmctx-pthreads.c
==============================================================================
--- head/lib/libnetmap/nmctx-pthreads.c Fri Aug 28 20:03:54 2020 (r364936)
+++ stable/12/lib/libnetmap/nmctx-pthreads.c Tue Sep 22 21:16:03 2020 (r366013)
@@ -1,4 +1,34 @@
-/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2018 Universita` di Pisa
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
Modified: stable/12/lib/libnetmap/nmctx.c
==============================================================================
--- head/lib/libnetmap/nmctx.c Fri Aug 28 20:03:54 2020 (r364936)
+++ stable/12/lib/libnetmap/nmctx.c Tue Sep 22 21:16:03 2020 (r366013)
@@ -1,4 +1,34 @@
-/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2018 Universita` di Pisa
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
Modified: stable/12/lib/libnetmap/nmport.c
==============================================================================
--- head/lib/libnetmap/nmport.c Fri Aug 28 20:03:54 2020 (r364936)
+++ stable/12/lib/libnetmap/nmport.c Tue Sep 22 21:16:03 2020 (r366013)
@@ -1,4 +1,34 @@
-/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2018 Universita` di Pisa
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
Modified: stable/12/lib/libnetmap/nmreq.c
==============================================================================
--- head/lib/libnetmap/nmreq.c Fri Aug 28 20:03:54 2020 (r364936)
+++ stable/12/lib/libnetmap/nmreq.c Tue Sep 22 21:16:03 2020 (r366013)
@@ -1,4 +1,34 @@
-/* $FreeBSD$ */
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2018 Universita` di Pisa
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
Modified: stable/12/share/mk/bsd.libnames.mk
==============================================================================
--- stable/12/share/mk/bsd.libnames.mk Tue Sep 22 21:13:26 2020 (r366012)
+++ stable/12/share/mk/bsd.libnames.mk Tue Sep 22 21:16:03 2020 (r366013)
@@ -109,6 +109,7 @@ LIBNANDFS?= ${LIBDESTDIR}${LIBDIR_BASE}/libnandfs.a
LIBNCURSES?= ${LIBDESTDIR}${LIBDIR_BASE}/libncurses.a
LIBNCURSESW?= ${LIBDESTDIR}${LIBDIR_BASE}/libncursesw.a
LIBNETGRAPH?= ${LIBDESTDIR}${LIBDIR_BASE}/libnetgraph.a
+LIBNETMAP?= ${LIBDESTDIR}${LIBDIR_BASE}/libnetmap.a
LIBNGATM?= ${LIBDESTDIR}${LIBDIR_BASE}/libngatm.a
LIBNV?= ${LIBDESTDIR}${LIBDIR_BASE}/libnv.a
LIBNVPAIR?= ${LIBDESTDIR}${LIBDIR_BASE}/libnvpair.a
Modified: stable/12/share/mk/src.libnames.mk
==============================================================================
--- stable/12/share/mk/src.libnames.mk Tue Sep 22 21:13:26 2020 (r366012)
+++ stable/12/share/mk/src.libnames.mk Tue Sep 22 21:16:03 2020 (r366013)
@@ -139,6 +139,7 @@ _LIBRARIES= \
ncurses \
ncursesw \
netgraph \
+ netmap \
ngatm \
nv \
nvpair \
@@ -363,6 +364,7 @@ _DP_zfs= md pthread umem util uutil m nvpair avl bsdxm
_DP_zfs_core= nvpair
_DP_zpool= md pthread z nvpair avl umem
_DP_be= zfs nvpair
+_DP_netmap=
# OFED support
.if ${MK_OFED} != "no"
More information about the svn-src-all
mailing list