FD.io VPP  v21.01.1
Vector Packet Processing
net_netmap.h File Reference

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

◆ NETMAP_API

#define NETMAP_API   11 /* current API version */

Definition at line 42 of file net_netmap.h.

◆ NETMAP_BDG_ATTACH

#define NETMAP_BDG_ATTACH   1 /* attach the NIC */

Definition at line 495 of file net_netmap.h.

◆ NETMAP_BDG_DELIF

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

Definition at line 502 of file net_netmap.h.

◆ NETMAP_BDG_DETACH

#define NETMAP_BDG_DETACH   2 /* detach the NIC */

Definition at line 496 of file net_netmap.h.

◆ NETMAP_BDG_HOST

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

Definition at line 509 of file net_netmap.h.

◆ NETMAP_BDG_LIST

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

Definition at line 498 of file net_netmap.h.

◆ NETMAP_BDG_NEWIF

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

Definition at line 501 of file net_netmap.h.

◆ NETMAP_BDG_OFFSET

#define NETMAP_BDG_OFFSET   NETMAP_BDG_VNET_HDR /* deprecated alias */

Definition at line 500 of file net_netmap.h.

◆ NETMAP_BDG_POLLING_OFF

#define NETMAP_BDG_POLLING_OFF   11 /* delete polling kthread */

Definition at line 506 of file net_netmap.h.

◆ NETMAP_BDG_POLLING_ON

#define NETMAP_BDG_POLLING_ON   10 /* delete polling kthread */

Definition at line 505 of file net_netmap.h.

◆ NETMAP_BDG_REGOPS

#define NETMAP_BDG_REGOPS   3 /* register bridge callbacks */

Definition at line 497 of file net_netmap.h.

◆ NETMAP_BDG_VNET_HDR

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

Definition at line 499 of file net_netmap.h.

◆ NETMAP_DO_RX_POLL

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

Definition at line 492 of file net_netmap.h.

◆ NETMAP_HW_RING

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

Definition at line 485 of file net_netmap.h.

◆ NETMAP_MAX_API

#define NETMAP_MAX_API   15

Definition at line 45 of file net_netmap.h.

◆ NETMAP_MIN_API

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

Definition at line 44 of file net_netmap.h.

◆ NETMAP_NO_TX_POLL

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

Definition at line 490 of file net_netmap.h.

◆ NETMAP_PT_HOST_CREATE

#define NETMAP_PT_HOST_CREATE   8 /* create ptnetmap kthreads */

Definition at line 503 of file net_netmap.h.

◆ NETMAP_PT_HOST_DELETE

#define NETMAP_PT_HOST_DELETE   9 /* delete ptnetmap kthreads */

Definition at line 504 of file net_netmap.h.

◆ NETMAP_RING_MASK

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

Definition at line 488 of file net_netmap.h.

◆ NETMAP_SW_RING

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

Definition at line 486 of file net_netmap.h.

◆ NETMAP_VNET_HDR_GET

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

Definition at line 507 of file net_netmap.h.

◆ NI_PRIV_MEM

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

Definition at line 322 of file net_netmap.h.

◆ NIOCCONFIG

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

Definition at line 598 of file net_netmap.h.

◆ NIOCGINFO

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

Definition at line 594 of file net_netmap.h.

◆ NIOCREGIF

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

Definition at line 595 of file net_netmap.h.

◆ NIOCRXSYNC

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

Definition at line 597 of file net_netmap.h.

◆ NIOCTXSYNC

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

Definition at line 596 of file net_netmap.h.

◆ NM_CACHE_ALIGN

#define NM_CACHE_ALIGN   128

Definition at line 52 of file net_netmap.h.

◆ NM_IFRDATA_LEN

#define NM_IFRDATA_LEN   256

Definition at line 620 of file net_netmap.h.

◆ NR_ACCEPT_VNET_HDR

#define NR_ACCEPT_VNET_HDR   0x8000

Definition at line 543 of file net_netmap.h.

◆ NR_EXCLUSIVE

#define NR_EXCLUSIVE   0x800

Definition at line 532 of file net_netmap.h.

◆ NR_FORWARD

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

Definition at line 301 of file net_netmap.h.

◆ NR_MONITOR_RX

#define NR_MONITOR_RX   0x200

Definition at line 529 of file net_netmap.h.

◆ NR_MONITOR_TX

#define NR_MONITOR_TX   0x100

Definition at line 528 of file net_netmap.h.

◆ NR_PASSTHROUGH_HOST

#define NR_PASSTHROUGH_HOST   NR_PTNETMAP_HOST /* deprecated */

Definition at line 534 of file net_netmap.h.

◆ NR_PTNETMAP_HOST

#define NR_PTNETMAP_HOST   0x1000

Definition at line 535 of file net_netmap.h.

◆ NR_REG_MASK

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

Definition at line 518 of file net_netmap.h.

◆ NR_RX_RINGS_ONLY

#define NR_RX_RINGS_ONLY   0x2000

Definition at line 536 of file net_netmap.h.

◆ NR_TIMESTAMP

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

Definition at line 294 of file net_netmap.h.

◆ NR_TX_RINGS_ONLY

#define NR_TX_RINGS_ONLY   0x4000

Definition at line 537 of file net_netmap.h.

◆ NR_ZCOPY_MON

#define NR_ZCOPY_MON   0x400

Definition at line 530 of file net_netmap.h.

◆ NS_BUF_CHANGED

#define NS_BUF_CHANGED   0x0001 /* buf_idx changed */

Definition at line 156 of file net_netmap.h.

◆ NS_FORWARD

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

Definition at line 175 of file net_netmap.h.

◆ NS_INDIRECT

#define NS_INDIRECT   0x0010 /* userspace buffer */

Definition at line 190 of file net_netmap.h.

◆ NS_MOREFRAG

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

Definition at line 196 of file net_netmap.h.

◆ NS_NO_LEARN

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

Definition at line 184 of file net_netmap.h.

◆ NS_PORT_MASK

#define NS_PORT_MASK   (0xff << NS_PORT_SHIFT)

Definition at line 204 of file net_netmap.h.

◆ NS_PORT_SHIFT

#define NS_PORT_SHIFT   8

Definition at line 203 of file net_netmap.h.

◆ NS_REPORT

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

Definition at line 167 of file net_netmap.h.

◆ NS_RFRAGS

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

Definition at line 211 of file net_netmap.h.

Enumeration Type Documentation

◆ anonymous enum

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

◆ nm_ring_empty()

static int nm_ring_empty ( struct netmap_ring ring)
inlinestatic

Definition at line 610 of file net_netmap.h.