iPXE
Data Structures | Defines | Enumerations | Functions | Variables
netfront.h File Reference

Xen netfront driver. More...

#include <ipxe/xen.h>
#include <xen/io/netif.h>

Go to the source code of this file.

Data Structures

struct  netfront_ring
 A netfront descriptor ring. More...

Defines

#define NETFRONT_NUM_TX_DESC   16
 Number of transmit ring entries.
#define NETFRONT_NUM_RX_DESC   32
 Number of receive ring entries.
#define NETFRONT_RX_FILL   18
 Receive ring fill level.
#define tx_sring   tx.sring.tx
 Transmit shared ring field.
#define rx_sring   rx.sring.rx
 Receive shared ring field.

Enumerations

enum  netfront_ref_index {
  NETFRONT_REF_TX_RING = 0, NETFRONT_REF_TX_BASE, NETFRONT_REF_RX_RING = ( NETFRONT_REF_TX_BASE + NETFRONT_NUM_TX_DESC ), NETFRONT_REF_RX_BASE,
  NETFRONT_REF_COUNT = ( NETFRONT_REF_RX_BASE + NETFRONT_NUM_RX_DESC )
}
 Grant reference indices. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static __attribute__ ((always_inline)) void netfront_init_ring(struct netfront_ring *ring
 Initialise descriptor ring.

Variables

static const char * ref_key
static const char grant_ref_t ref
static const char grant_ref_t
unsigned int 
count
static const char grant_ref_t
unsigned int struct io_buffer ** 
iobufs
static const char grant_ref_t
unsigned int struct io_buffer
grant_ref_t
refs

Detailed Description

Xen netfront driver.

Definition in file netfront.h.


Define Documentation

#define NETFRONT_NUM_TX_DESC   16

Number of transmit ring entries.

Definition at line 16 of file netfront.h.

Referenced by netfront_probe().

#define NETFRONT_NUM_RX_DESC   32

Number of receive ring entries.

Definition at line 19 of file netfront.h.

Referenced by netfront_probe().

#define NETFRONT_RX_FILL   18

Receive ring fill level.

The xen-netback driver from kernels 3.18 to 4.2 inclusive have a bug (CA-163395) which prevents packet reception if fewer than 18 receive descriptors are available. This was fixed in upstream kernel commit d5d4852 ("xen-netback: require fewer guest Rx slots when not using GSO").

We provide 18 receive descriptors to avoid unpleasant silent failures on these kernel versions.

Definition at line 32 of file netfront.h.

Referenced by netfront_refill_rx().

#define tx_sring   tx.sring.tx

Transmit shared ring field.

Definition at line 173 of file netfront.h.

#define rx_sring   rx.sring.rx

Receive shared ring field.

Definition at line 176 of file netfront.h.


Enumeration Type Documentation

Grant reference indices.

Enumerator:
NETFRONT_REF_TX_RING 

Transmit ring grant reference index.

NETFRONT_REF_TX_BASE 

Transmit descriptor grant reference base index.

NETFRONT_REF_RX_RING 

Receive ring grant reference index.

NETFRONT_REF_RX_BASE 

Receive descriptor grant reference base index.

NETFRONT_REF_COUNT 

Total number of grant references required.

Definition at line 35 of file netfront.h.

                        {
        /** Transmit ring grant reference index */
        NETFRONT_REF_TX_RING = 0,
        /** Transmit descriptor grant reference base index */
        NETFRONT_REF_TX_BASE,
        /** Receive ring grant reference index */
        NETFRONT_REF_RX_RING = ( NETFRONT_REF_TX_BASE + NETFRONT_NUM_TX_DESC ),
        /** Receive descriptor grant reference base index */
        NETFRONT_REF_RX_BASE,
        /** Total number of grant references required */
        NETFRONT_REF_COUNT = ( NETFRONT_REF_RX_BASE + NETFRONT_NUM_RX_DESC )
};

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static __attribute__ ( (always_inline)  ) [inline, static]

Initialise descriptor ring.

Parameters:
ringDescriptor ring
ref_keyShared ring grant reference key
refShared ring grant reference
countMaxium number of used descriptors
iobufsI/O buffers
refsI/O buffer grant references
idsBuffer IDs

Variable Documentation

const char* ref_key

Definition at line 91 of file netfront.h.

const char grant_ref_t ref

Definition at line 91 of file netfront.h.

Referenced by xengrant_alloc(), and xengrant_free().

const char grant_ref_t unsigned int count

Definition at line 91 of file netfront.h.

const char grant_ref_t unsigned int struct io_buffer** iobufs

Definition at line 93 of file netfront.h.

const char grant_ref_t unsigned int struct io_buffer grant_ref_t* refs

Definition at line 93 of file netfront.h.