FD.io VPP  v18.07-34-g55fbdb9
Vector Packet Processing
net_netmap.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  netmap_slot
 
struct  netmap_ring
 
struct  netmap_if
 
struct  nmreq
 
struct  nm_ifreq
 
struct  ptn_vmm_ioctl_msix
 
struct  nm_kth_ioctl
 
struct  ptnet_ring_cfg
 

Macros

#define NETMAP_API   11 /* current API version */
 
#define NETMAP_MIN_API   11 /* min and max versions accepted */
 
#define NETMAP_MAX_API   15
 
#define NM_CACHE_ALIGN   128
 
#define NS_BUF_CHANGED   0x0001 /* buf_idx changed */
 
#define NS_REPORT   0x0002 /* ask the hardware to report results */
 
#define NS_FORWARD   0x0004 /* pass packet 'forward' */
 
#define NS_NO_LEARN   0x0008 /* disable bridge learning */
 
#define NS_INDIRECT   0x0010 /* userspace buffer */
 
#define NS_MOREFRAG   0x0020 /* packet has more fragments */
 
#define NS_PORT_SHIFT   8
 
#define NS_PORT_MASK   (0xff << NS_PORT_SHIFT)
 
#define NS_RFRAGS(_slot)   ( ((_slot)->flags >> 8) & 0xff)
 
#define NR_TIMESTAMP   0x0002 /* set timestamp on *sync() */
 
#define NR_FORWARD   0x0004 /* enable NS_FORWARD for ring */
 
#define NI_PRIV_MEM   0x1 /* private memory region */
 
#define NETMAP_HW_RING   0x4000 /* single NIC ring pair */
 
#define NETMAP_SW_RING   0x2000 /* only host ring pair */
 
#define NETMAP_RING_MASK   0x0fff /* the ring number */
 
#define NETMAP_NO_TX_POLL   0x1000 /* no automatic txsync on poll */
 
#define NETMAP_DO_RX_POLL   0x8000 /* DO automatic rxsync on poll */
 
#define NETMAP_BDG_ATTACH   1 /* attach the NIC */
 
#define NETMAP_BDG_DETACH   2 /* detach the NIC */
 
#define NETMAP_BDG_REGOPS   3 /* register bridge callbacks */
 
#define NETMAP_BDG_LIST   4 /* get bridge's info */
 
#define NETMAP_BDG_VNET_HDR   5 /* set the port virtio-net-hdr length */
 
#define NETMAP_BDG_OFFSET   NETMAP_BDG_VNET_HDR /* deprecated alias */
 
#define NETMAP_BDG_NEWIF   6 /* create a virtual port */
 
#define NETMAP_BDG_DELIF   7 /* destroy a virtual port */
 
#define NETMAP_PT_HOST_CREATE   8 /* create ptnetmap kthreads */
 
#define NETMAP_PT_HOST_DELETE   9 /* delete ptnetmap kthreads */
 
#define NETMAP_BDG_POLLING_ON   10 /* delete polling kthread */
 
#define NETMAP_BDG_POLLING_OFF   11 /* delete polling kthread */
 
#define NETMAP_VNET_HDR_GET   12 /* get the port virtio-net-hdr length */
 
#define NETMAP_BDG_HOST   1 /* attach the host stack on ATTACH */
 
#define NR_REG_MASK   0xf /* values for nr_flags */
 
#define NR_MONITOR_TX   0x100
 
#define NR_MONITOR_RX   0x200
 
#define NR_ZCOPY_MON   0x400
 
#define NR_EXCLUSIVE   0x800
 
#define NR_PASSTHROUGH_HOST   NR_PTNETMAP_HOST /* deprecated */
 
#define NR_PTNETMAP_HOST   0x1000
 
#define NR_RX_RINGS_ONLY   0x2000
 
#define NR_TX_RINGS_ONLY   0x4000
 
#define NR_ACCEPT_VNET_HDR   0x8000
 
#define NIOCGINFO   _IOWR('i', 145, struct nmreq) /* return IF info */
 
#define NIOCREGIF   _IOWR('i', 146, struct nmreq) /* interface register */
 
#define NIOCTXSYNC   _IO('i', 148) /* sync tx queues */
 
#define NIOCRXSYNC   _IO('i', 149) /* sync rx queues */
 
#define NIOCCONFIG   _IOWR('i',150, struct nm_ifreq) /* for ext. modules */
 
#define NM_IFRDATA_LEN   256
 

Enumerations

enum  {
  NR_REG_DEFAULT = 0, NR_REG_ALL_NIC = 1, NR_REG_SW = 2, NR_REG_NIC_SW = 3,
  NR_REG_ONE_NIC = 4, NR_REG_PIPE_MASTER = 5, NR_REG_PIPE_SLAVE = 6
}
 

Functions

static int nm_ring_empty (struct netmap_ring *ring)
 

Macro Definition Documentation

#define NETMAP_API   11 /* current API version */

Definition at line 42 of file net_netmap.h.

#define NETMAP_BDG_ATTACH   1 /* attach the NIC */

Definition at line 495 of file net_netmap.h.

#define NETMAP_BDG_DELIF   7 /* destroy a virtual port */

Definition at line 502 of file net_netmap.h.

#define NETMAP_BDG_DETACH   2 /* detach the NIC */

Definition at line 496 of file net_netmap.h.

#define NETMAP_BDG_HOST   1 /* attach the host stack on ATTACH */

Definition at line 509 of file net_netmap.h.

#define NETMAP_BDG_LIST   4 /* get bridge's info */

Definition at line 498 of file net_netmap.h.

#define NETMAP_BDG_NEWIF   6 /* create a virtual port */

Definition at line 501 of file net_netmap.h.

#define NETMAP_BDG_OFFSET   NETMAP_BDG_VNET_HDR /* deprecated alias */

Definition at line 500 of file net_netmap.h.

#define NETMAP_BDG_POLLING_OFF   11 /* delete polling kthread */

Definition at line 506 of file net_netmap.h.

#define NETMAP_BDG_POLLING_ON   10 /* delete polling kthread */

Definition at line 505 of file net_netmap.h.

#define NETMAP_BDG_REGOPS   3 /* register bridge callbacks */

Definition at line 497 of file net_netmap.h.

#define NETMAP_BDG_VNET_HDR   5 /* set the port virtio-net-hdr length */

Definition at line 499 of file net_netmap.h.

#define NETMAP_DO_RX_POLL   0x8000 /* DO automatic rxsync on poll */

Definition at line 492 of file net_netmap.h.

#define NETMAP_HW_RING   0x4000 /* single NIC ring pair */

Definition at line 485 of file net_netmap.h.

#define NETMAP_MAX_API   15

Definition at line 45 of file net_netmap.h.

#define NETMAP_MIN_API   11 /* min and max versions accepted */

Definition at line 44 of file net_netmap.h.

#define NETMAP_NO_TX_POLL   0x1000 /* no automatic txsync on poll */

Definition at line 490 of file net_netmap.h.

#define NETMAP_PT_HOST_CREATE   8 /* create ptnetmap kthreads */

Definition at line 503 of file net_netmap.h.

#define NETMAP_PT_HOST_DELETE   9 /* delete ptnetmap kthreads */

Definition at line 504 of file net_netmap.h.

#define NETMAP_RING_MASK   0x0fff /* the ring number */

Definition at line 488 of file net_netmap.h.

#define NETMAP_SW_RING   0x2000 /* only host ring pair */

Definition at line 486 of file net_netmap.h.

#define NETMAP_VNET_HDR_GET   12 /* get the port virtio-net-hdr length */

Definition at line 507 of file net_netmap.h.

#define NI_PRIV_MEM   0x1 /* private memory region */

Definition at line 322 of file net_netmap.h.

#define NIOCCONFIG   _IOWR('i',150, struct nm_ifreq) /* for ext. modules */

Definition at line 598 of file net_netmap.h.

#define NIOCGINFO   _IOWR('i', 145, struct nmreq) /* return IF info */

Definition at line 594 of file net_netmap.h.

#define NIOCREGIF   _IOWR('i', 146, struct nmreq) /* interface register */

Definition at line 595 of file net_netmap.h.

#define NIOCRXSYNC   _IO('i', 149) /* sync rx queues */

Definition at line 597 of file net_netmap.h.

#define NIOCTXSYNC   _IO('i', 148) /* sync tx queues */

Definition at line 596 of file net_netmap.h.

#define NM_CACHE_ALIGN   128

Definition at line 52 of file net_netmap.h.

#define NM_IFRDATA_LEN   256

Definition at line 620 of file net_netmap.h.

#define NR_ACCEPT_VNET_HDR   0x8000

Definition at line 543 of file net_netmap.h.

#define NR_EXCLUSIVE   0x800

Definition at line 532 of file net_netmap.h.

#define NR_FORWARD   0x0004 /* enable NS_FORWARD for ring */

Definition at line 301 of file net_netmap.h.

#define NR_MONITOR_RX   0x200

Definition at line 529 of file net_netmap.h.

#define NR_MONITOR_TX   0x100

Definition at line 528 of file net_netmap.h.

#define NR_PASSTHROUGH_HOST   NR_PTNETMAP_HOST /* deprecated */

Definition at line 534 of file net_netmap.h.

#define NR_PTNETMAP_HOST   0x1000

Definition at line 535 of file net_netmap.h.

#define NR_REG_MASK   0xf /* values for nr_flags */

Definition at line 518 of file net_netmap.h.

#define NR_RX_RINGS_ONLY   0x2000

Definition at line 536 of file net_netmap.h.

#define NR_TIMESTAMP   0x0002 /* set timestamp on *sync() */

Definition at line 294 of file net_netmap.h.

#define NR_TX_RINGS_ONLY   0x4000

Definition at line 537 of file net_netmap.h.

#define NR_ZCOPY_MON   0x400

Definition at line 530 of file net_netmap.h.

#define NS_BUF_CHANGED   0x0001 /* buf_idx changed */

Definition at line 156 of file net_netmap.h.

#define NS_FORWARD   0x0004 /* pass packet 'forward' */

Definition at line 175 of file net_netmap.h.

#define NS_INDIRECT   0x0010 /* userspace buffer */

Definition at line 190 of file net_netmap.h.

#define NS_MOREFRAG   0x0020 /* packet has more fragments */

Definition at line 196 of file net_netmap.h.

#define NS_NO_LEARN   0x0008 /* disable bridge learning */

Definition at line 184 of file net_netmap.h.

#define NS_PORT_MASK   (0xff << NS_PORT_SHIFT)

Definition at line 204 of file net_netmap.h.

#define NS_PORT_SHIFT   8

Definition at line 203 of file net_netmap.h.

#define NS_REPORT   0x0002 /* ask the hardware to report results */

Definition at line 167 of file net_netmap.h.

#define NS_RFRAGS (   _slot)    ( ((_slot)->flags >> 8) & 0xff)

Definition at line 211 of file net_netmap.h.

Enumeration Type Documentation

anonymous enum
Enumerator
NR_REG_DEFAULT 
NR_REG_ALL_NIC 
NR_REG_SW 
NR_REG_NIC_SW 
NR_REG_ONE_NIC 
NR_REG_PIPE_MASTER 
NR_REG_PIPE_SLAVE 

Definition at line 519 of file net_netmap.h.

Function Documentation

static int nm_ring_empty ( struct netmap_ring ring)
inlinestatic

Definition at line 610 of file net_netmap.h.