Deleted Added
full compact
netmap_kern.h (285359) netmap_kern.h (285695)
1/*
2 * Copyright (C) 2011-2014 Matteo Landi, Luigi Rizzo. All rights reserved.
3 * Copyright (C) 2013-2014 Universita` di Pisa. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27/*
1/*
2 * Copyright (C) 2011-2014 Matteo Landi, Luigi Rizzo. All rights reserved.
3 * Copyright (C) 2013-2014 Universita` di Pisa. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27/*
28 * $FreeBSD: head/sys/dev/netmap/netmap_kern.h 285359 2015-07-10 16:05:24Z luigi $
28 * $FreeBSD: head/sys/dev/netmap/netmap_kern.h 285695 2015-07-19 17:54:42Z luigi $
29 *
30 * The header contains the definitions of constants and function
31 * prototypes used only in kernelspace.
32 */
33
34#ifndef _NET_NETMAP_KERN_H_
35#define _NET_NETMAP_KERN_H_
36

--- 461 unchanged lines hidden (view full) ---

498#define NAF_BDG_MAYSLEEP 4 /* the bridge is allowed to sleep when
499 * forwarding packets coming from this
500 * interface
501 */
502#define NAF_MEM_OWNER 8 /* the adapter uses its own memory area
503 * that cannot be changed
504 */
505#define NAF_NATIVE 16 /* the adapter is native.
29 *
30 * The header contains the definitions of constants and function
31 * prototypes used only in kernelspace.
32 */
33
34#ifndef _NET_NETMAP_KERN_H_
35#define _NET_NETMAP_KERN_H_
36

--- 461 unchanged lines hidden (view full) ---

498#define NAF_BDG_MAYSLEEP 4 /* the bridge is allowed to sleep when
499 * forwarding packets coming from this
500 * interface
501 */
502#define NAF_MEM_OWNER 8 /* the adapter uses its own memory area
503 * that cannot be changed
504 */
505#define NAF_NATIVE 16 /* the adapter is native.
506 * Virtual ports (vale, pipe, monitor...)
507 * should never use this flag.
506 * Virtual ports (non persistent vale ports,
507 * pipes, monitors...) should never use
508 * this flag.
508 */
509#define NAF_NETMAP_ON 32 /* netmap is active (either native or
510 * emulated). Where possible (e.g. FreeBSD)
511 * IFCAP_NETMAP also mirrors this flag.
512 */
513#define NAF_HOST_RINGS 64 /* the adapter supports the host rings */
514#define NAF_FORCE_NATIVE 128 /* the adapter is always NATIVE */
515#define NAF_BUSY (1U<<31) /* the adapter is used internally and

--- 962 unchanged lines hidden (view full) ---

1478/*
1479 * Structure associated to each netmap file descriptor.
1480 * It is created on open and left unbound (np_nifp == NULL).
1481 * A successful NIOCREGIF will set np_nifp and the first few fields;
1482 * this is protected by a global lock (NMG_LOCK) due to low contention.
1483 *
1484 * np_refs counts the number of references to the structure: one for the fd,
1485 * plus (on FreeBSD) one for each active mmap which we track ourselves
509 */
510#define NAF_NETMAP_ON 32 /* netmap is active (either native or
511 * emulated). Where possible (e.g. FreeBSD)
512 * IFCAP_NETMAP also mirrors this flag.
513 */
514#define NAF_HOST_RINGS 64 /* the adapter supports the host rings */
515#define NAF_FORCE_NATIVE 128 /* the adapter is always NATIVE */
516#define NAF_BUSY (1U<<31) /* the adapter is used internally and

--- 962 unchanged lines hidden (view full) ---

1479/*
1480 * Structure associated to each netmap file descriptor.
1481 * It is created on open and left unbound (np_nifp == NULL).
1482 * A successful NIOCREGIF will set np_nifp and the first few fields;
1483 * this is protected by a global lock (NMG_LOCK) due to low contention.
1484 *
1485 * np_refs counts the number of references to the structure: one for the fd,
1486 * plus (on FreeBSD) one for each active mmap which we track ourselves
1486 * (they are not unmapped on close(), unlike linux).
1487 * (linux automatically tracks them, but FreeBSD does not).
1487 * np_refs is protected by NMG_LOCK.
1488 *
1489 * Read access to the structure is lock free, because ni_nifp once set
1490 * can only go to 0 when nobody is using the entry anymore. Readers
1491 * must check that np_nifp != NULL before using the other fields.
1492 */
1493struct netmap_priv_d {
1494 struct netmap_if * volatile np_nifp; /* netmap if descriptor. */

--- 180 unchanged lines hidden ---
1488 * np_refs is protected by NMG_LOCK.
1489 *
1490 * Read access to the structure is lock free, because ni_nifp once set
1491 * can only go to 0 when nobody is using the entry anymore. Readers
1492 * must check that np_nifp != NULL before using the other fields.
1493 */
1494struct netmap_priv_d {
1495 struct netmap_if * volatile np_nifp; /* netmap if descriptor. */

--- 180 unchanged lines hidden ---