Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
drv_xgbe_intf.h File Reference

Go to the source code of this file.

Data Structures

struct  netio_ipp_address_t
 
union  __netio_getset_offset_t
 
struct  netio_fastio_rv3_t
 
union  __netio_checksum_header_t
 
struct  lepp_cmd_t
 
struct  lepp_frag_t
 
struct  lepp_tso_cmd_t
 
struct  lepp_queue_t
 

Macros

#define NETIO_BASE_OFFSET(off)   ((off) & 0xFF00000000000000ULL)
 
#define NETIO_LOCAL_OFFSET(off)   ((off) & 0x00FFFFFFFFFFFFFFULL)
 
#define __netio_fastio_allocate(fastio_index, size)   __netio_fastio1((fastio_index) + NETIO_FASTIO_ALLOCATE, size)
 
#define __netio_fastio_free_buffer(fastio_index, handle)   __netio_fastio1((fastio_index) + NETIO_FASTIO_FREE_BUFFER, handle)
 
#define __netio_fastio_return_credits(fastio_index, credits)   __netio_fastio1((fastio_index) + NETIO_FASTIO_RETURN_CREDITS, credits)
 
#define __netio_fastio_send_pkt_nock(fastio_index, ackflag, size, va, handle)
 
#define __netio_fastio_send_pkt_ck(fastio_index, ackflag, size, va, handle, csum0, csum1)
 
#define __netio_fastio_sendv_pkt_1_2(fastio_index, flags, confno, csum0, va_F, va_L, len_F_L)
 
#define __netio_fastio_send_pcie_pkt(fastio_index, flags, confno, csum0, va_F, va_L, len_F_L)
 
#define __netio_fastio_sendv_pkt_3_4(fastio_index, flags, confno, csum0, va_F, va_L, len_F_L, va_M0, va_M1, len_M0_M1)
 
#define __netio_fastio_send_pkt_vec(fastio_index, seqno, nentries, va)
 
#define LEPP_MAX_FRAGS   (65536 / HV_DEFAULT_PAGE_SIZE_SMALL + 2 + 1)
 
#define LEPP_TSO_CMD_SIZE(num_frags, header_size)
 
#define LEPP_CMD_QUEUE_BYTES
 
#define LEPP_MAX_CMD_SIZE   LEPP_TSO_CMD_SIZE(LEPP_MAX_FRAGS, 128)
 
#define LEPP_CMD_LIMIT   (LEPP_CMD_QUEUE_BYTES - LEPP_MAX_CMD_SIZE)
 
#define LEPP_COMP_QUEUE_SIZE   ((LEPP_CMD_LIMIT + sizeof(lepp_cmd_t) - 1) / sizeof(lepp_cmd_t))
 
#define LEPP_QINC(var)   (var = __insn_mnz(var - (LEPP_COMP_QUEUE_SIZE - 1), var + 1))
 
#define LIPP_VERSION   1
 
#define LIPP_PACKET_PADDING   2
 
#define LIPP_SMALL_PACKET_SIZE   128
 
#define LIPP_SMALL_BUFFERS   6785
 
#define LIPP_LARGE_BUFFERS   6785
 

Typedefs

typedef voidlepp_comp_t
 

Enumerations

enum  netio_hv_offset_t {
  NETIO_FIXED_ADDR = 0x5000000000000000ULL, NETIO_FIXED_SIZE = 0x5100000000000000ULL, NETIO_IPP_INPUT_REGISTER_OFF = 0x6000000000000000ULL, NETIO_IPP_INPUT_UNREGISTER_OFF = 0x6100000000000000ULL,
  NETIO_IPP_INPUT_INIT_OFF = 0x6200000000000000ULL, NETIO_IPP_INPUT_UNINIT_OFF = 0x6300000000000000ULL, NETIO_IPP_INPUT_GROUP_CFG_OFF = 0x6400000000000000ULL, NETIO_IPP_INPUT_BUCKET_CFG_OFF = 0x6500000000000000ULL,
  NETIO_IPP_PARAM_OFF = 0x6600000000000000ULL, NETIO_IPP_GET_FASTIO_OFF = 0x6700000000000000ULL, NETIO_IPP_INPUT_HIJACK_CFG_OFF = 0x6800000000000000ULL, NETIO_IPP_USER_MAX_OFF = 0x6FFFFFFFFFFFFFFFULL,
  NETIO_IPP_IOMEM_REGISTER_OFF = 0x7000000000000000ULL, NETIO_IPP_IOMEM_UNREGISTER_OFF = 0x7100000000000000ULL, NETIO_IPP_DRAIN_OFF = 0xFA00000000000000ULL, NETIO_EPP_SHM_OFF = 0xFB00000000000000ULL,
  NETIO_IPP_STOP_SHIM_OFF = 0xFD00000000000000ULL, NETIO_IPP_START_SHIM_OFF = 0xFE00000000000000ULL, NETIO_IPP_ADDRESS_OFF = 0xFF00000000000000ULL
}
 
enum  netio_fastio_index_t {
  NETIO_FASTIO_ALLOCATE = 0, NETIO_FASTIO_FREE_BUFFER = 1, NETIO_FASTIO_RETURN_CREDITS = 2, NETIO_FASTIO_SEND_PKT_NOCK = 3,
  NETIO_FASTIO_SEND_PKT_CK = 4, NETIO_FASTIO_SEND_PKT_VEC = 5, NETIO_FASTIO_SENDV_PKT = 6, NETIO_FASTIO_NUM_INDEX = 7
}
 

Functions

int __netio_fastio0 (uint32_t fastio_index)
 
int __netio_fastio1 (uint32_t fastio_index, uint32_t arg0)
 
netio_fastio_rv3_t __netio_fastio3_rv3 (uint32_t fastio_index, uint32_t arg0, uint32_t arg1, uint32_t arg2)
 
int __netio_fastio4 (uint32_t fastio_index, uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3)
 
int __netio_fastio6 (uint32_t fastio_index, uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, uint32_t arg5)
 
int __netio_fastio9 (uint32_t fastio_index, uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, uint32_t arg5, uint32_t arg6, uint32_t arg7, uint32_t arg8)
 

Detailed Description

Interface to the hypervisor XGBE driver.

Definition in file drv_xgbe_intf.h.

Macro Definition Documentation

#define __netio_fastio_allocate (   fastio_index,
  size 
)    __netio_fastio1((fastio_index) + NETIO_FASTIO_ALLOCATE, size)

Allocate an empty packet.

Parameters
fastio_indexFast I/O index.
sizeSize of the packet to allocate.

Definition at line 199 of file drv_xgbe_intf.h.

#define __netio_fastio_free_buffer (   fastio_index,
  handle 
)    __netio_fastio1((fastio_index) + NETIO_FASTIO_FREE_BUFFER, handle)

Free a buffer.

Parameters
fastio_indexFast I/O index.
handleHandle for the packet to free.

Definition at line 206 of file drv_xgbe_intf.h.

#define __netio_fastio_return_credits (   fastio_index,
  credits 
)    __netio_fastio1((fastio_index) + NETIO_FASTIO_RETURN_CREDITS, credits)

Increment our receive credits.

Parameters
fastio_indexFast I/O index.
creditsNumber of credits to add.

Definition at line 213 of file drv_xgbe_intf.h.

#define __netio_fastio_send_pcie_pkt (   fastio_index,
  flags,
  confno,
  csum0,
  va_F,
  va_L,
  len_F_L 
)
Value:
__netio_fastio6((fastio_index) + PCIE_FASTIO_SENDV_PKT, flags, confno, \
csum0, va_F, va_L, len_F_L)

Send packet on PCIe interface.

Parameters
fastio_indexFast I/O index.
flagsAck/csum/notify flags in low 3 bits.
confnoConfirmation number to request, if notify flag set.
csum0Checksum descriptor; Hard wired 0, not needed for PCIe.
va_FVirtual address of the packet buffer.
va_LVirtual address of last segment, if 2 segments. Hard wired 0.
len_F_LLength of the packet buffer in low 16 bits.

Definition at line 284 of file drv_xgbe_intf.h.

#define __netio_fastio_send_pkt_ck (   fastio_index,
  ackflag,
  size,
  va,
  handle,
  csum0,
  csum1 
)
Value:
__netio_fastio6((fastio_index) + NETIO_FASTIO_SEND_PKT_CK, ackflag, \
size, va, handle, csum0, csum1)

Send packet, calculate checksum.

Parameters
fastio_indexFast I/O index.
ackflagNonzero if we want an ack.
sizeSize of the packet.
vaVirtual address of start of packet.
handlePacket handle.
csum0Shim checksum header.
csum1Checksum seed.

Definition at line 236 of file drv_xgbe_intf.h.

#define __netio_fastio_send_pkt_nock (   fastio_index,
  ackflag,
  size,
  va,
  handle 
)
Value:
__netio_fastio4((fastio_index) + NETIO_FASTIO_SEND_PKT_NOCK, ackflag, \

Send packet, no checksum.

Parameters
fastio_indexFast I/O index.
ackflagNonzero if we want an ack.
sizeSize of the packet.
vaVirtual address of start of packet.
handlePacket handle.

Definition at line 223 of file drv_xgbe_intf.h.

#define __netio_fastio_send_pkt_vec (   fastio_index,
  seqno,
  nentries,
  va 
)
Value:
nentries, va)

Send vector of packets.

Parameters
fastio_indexFast I/O index.
seqnoNumber of packets transmitted so far on this interface; used to decide which packets should be acknowledged.
nentriesNumber of entries in vector.
vaVirtual address of start of vector entry array.
Returns
3-word netio_fastio_rv3_t structure. The structure's err member is an error code, or zero if no error. The val0 member is the updated value of seqno; it has been incremented by 1 for each packet sent. That increment may be less than nentries if an error occurred, or if some of the entries in the vector contain handles equal to NETIO_PKT_HANDLE_NONE. The val1 member is the updated value of nentries; it has been decremented by 1 for each vector entry processed. Again, that decrement may be less than nentries (leaving the returned value positive) if an error occurred.

Definition at line 329 of file drv_xgbe_intf.h.

#define __netio_fastio_sendv_pkt_1_2 (   fastio_index,
  flags,
  confno,
  csum0,
  va_F,
  va_L,
  len_F_L 
)
Value:
__netio_fastio6((fastio_index) + NETIO_FASTIO_SENDV_PKT, flags, confno, \
csum0, va_F, va_L, len_F_L)

Sendv packet with 1 or 2 segments.

Parameters
fastio_indexFast I/O index.
flagsAck/csum/notify flags in low 3 bits; number of segments minus 1 in next 2 bits; expected checksum in high 16 bits.
confnoConfirmation number to request, if notify flag set.
csum0Checksum descriptor; if zero, no checksum.
va_FVirtual address of first segment.
va_LVirtual address of last segment, if 2 segments.
len_F_LLength of first segment in low 16 bits; length of last segment, if 2 segments, in high 16 bits.

Definition at line 270 of file drv_xgbe_intf.h.

#define __netio_fastio_sendv_pkt_3_4 (   fastio_index,
  flags,
  confno,
  csum0,
  va_F,
  va_L,
  len_F_L,
  va_M0,
  va_M1,
  len_M0_M1 
)
Value:
__netio_fastio9((fastio_index) + NETIO_FASTIO_SENDV_PKT, flags, confno, \
csum0, va_F, va_L, len_F_L, va_M0, va_M1, len_M0_M1)

Sendv packet with 3 or 4 segments.

Parameters
fastio_indexFast I/O index.
flagsAck/csum/notify flags in low 3 bits; number of segments minus 1 in next 2 bits; expected checksum in high 16 bits.
confnoConfirmation number to request, if notify flag set.
csum0Checksum descriptor; if zero, no checksum.
va_FVirtual address of first segment.
va_LVirtual address of last segment (third segment if 3 segments, fourth segment if 4 segments).
len_F_LLength of first segment in low 16 bits; length of last segment in high 16 bits.
va_M0Virtual address of "middle 0" segment; this segment is sent second when there are three segments, and third if there are four.
va_M1Virtual address of "middle 1" segment; this segment is sent second when there are four segments.
len_M0_M1Length of middle 0 segment in low 16 bits; length of middle 1 segment, if 4 segments, in high 16 bits.

Definition at line 307 of file drv_xgbe_intf.h.

#define LEPP_CMD_LIMIT   (LEPP_CMD_QUEUE_BYTES - LEPP_MAX_CMD_SIZE)

The largest possible value of lepp_queue_t::cmd_{head, tail} (inclusive).

Definition at line 481 of file drv_xgbe_intf.h.

#define LEPP_CMD_QUEUE_BYTES
Value:
(sizeof(lepp_cmd_t) + sizeof(lepp_comp_t))) * sizeof(lepp_cmd_t))

The size of the lepp "cmd" queue.

Definition at line 472 of file drv_xgbe_intf.h.

#define LEPP_COMP_QUEUE_SIZE   ((LEPP_CMD_LIMIT + sizeof(lepp_cmd_t) - 1) / sizeof(lepp_cmd_t))

The maximum number of completions in an LEPP queue.

Definition at line 485 of file drv_xgbe_intf.h.

#define LEPP_MAX_CMD_SIZE   LEPP_TSO_CMD_SIZE(LEPP_MAX_FRAGS, 128)

The largest possible command that can go in lepp_queue_t::cmds[].

Definition at line 477 of file drv_xgbe_intf.h.

#define LEPP_MAX_FRAGS   (65536 / HV_DEFAULT_PAGE_SIZE_SMALL + 2 + 1)

Maximum number of frags for one TSO command. This is adapted from linux's "MAX_SKB_FRAGS", and presumably over-estimates by one, for our page size of exactly 65536. We add one for a "body" fragment.

Definition at line 463 of file drv_xgbe_intf.h.

#define LEPP_QINC (   var)    (var = __insn_mnz(var - (LEPP_COMP_QUEUE_SIZE - 1), var + 1))

Increment an index modulo the queue size.

Definition at line 489 of file drv_xgbe_intf.h.

#define LEPP_TSO_CMD_SIZE (   num_frags,
  header_size 
)
Value:
(sizeof(lepp_tso_cmd_t) + \
(num_frags) * sizeof(lepp_frag_t) + \
(((header_size) + 3) & -4))

Total number of bytes needed for an lepp_tso_cmd_t.

Definition at line 466 of file drv_xgbe_intf.h.

#define LIPP_LARGE_BUFFERS   6785

The maximum number of "large" buffers. This is enough for 53 network cpus with 128 credits.

Definition at line 613 of file drv_xgbe_intf.h.

#define LIPP_PACKET_PADDING   2

We use exactly two bytes of alignment padding.

Definition at line 594 of file drv_xgbe_intf.h.

#define LIPP_SMALL_BUFFERS   6785

The maximum number of "small" buffers. This is enough for 53 network cpus with 128 credits. Note that if these are exhausted, we will fall back to using large buffers.

Definition at line 608 of file drv_xgbe_intf.h.

#define LIPP_SMALL_PACKET_SIZE   128

The minimum size of a "small" buffer (including the padding).

Definition at line 597 of file drv_xgbe_intf.h.

#define LIPP_VERSION   1

FIXME: Check this from linux, via a new "pwrite()" call.

Definition at line 590 of file drv_xgbe_intf.h.

#define NETIO_BASE_OFFSET (   off)    ((off) & 0xFF00000000000000ULL)

Extract the base offset from an offset

Definition at line 133 of file drv_xgbe_intf.h.

#define NETIO_LOCAL_OFFSET (   off)    ((off) & 0x00FFFFFFFFFFFFFFULL)

Extract the local offset from an offset

Definition at line 135 of file drv_xgbe_intf.h.

Typedef Documentation

typedef void* lepp_comp_t

An LEPP completion ring entry.

Definition at line 456 of file drv_xgbe_intf.h.

Enumeration Type Documentation

Fast I/O index offsets (must be contiguous).

Enumerator:
NETIO_FASTIO_ALLOCATE 

Get empty packet buffer

NETIO_FASTIO_FREE_BUFFER 

Give buffer back to IPP

NETIO_FASTIO_RETURN_CREDITS 

Give credits to IPP

NETIO_FASTIO_SEND_PKT_NOCK 

Send a packet, no checksum

NETIO_FASTIO_SEND_PKT_CK 

Send a packet, with checksum

NETIO_FASTIO_SEND_PKT_VEC 

Send a vector of packets

NETIO_FASTIO_SENDV_PKT 

Sendv one packet

NETIO_FASTIO_NUM_INDEX 

Total number of fast I/O indices

Definition at line 157 of file drv_xgbe_intf.h.

The various pread/pwrite offsets into the hypervisor-level driver.

Enumerator:
NETIO_FIXED_ADDR 

Inform the Linux driver of the address of the NetIO arena memory. This offset is actually only used to convey information from netio to the Linux driver; it never makes it from there to the hypervisor. Write-only; takes a uint32_t specifying the VA address.

NETIO_FIXED_SIZE 

Inform the Linux driver of the size of the NetIO arena memory. This offset is actually only used to convey information from netio to the Linux driver; it never makes it from there to the hypervisor. Write-only; takes a uint32_t specifying the VA size.

NETIO_IPP_INPUT_REGISTER_OFF 

Register current tile with IPP. Write then read: write, takes a netio_input_config_t, read returns a pointer to a netio_queue_impl_t.

NETIO_IPP_INPUT_UNREGISTER_OFF 

Unregister current tile from IPP. Write-only, takes a dummy argument.

NETIO_IPP_INPUT_INIT_OFF 

Start packets flowing. Write-only, takes a dummy argument.

NETIO_IPP_INPUT_UNINIT_OFF 

Stop packets flowing. Write-only, takes a dummy argument.

NETIO_IPP_INPUT_GROUP_CFG_OFF 

Configure group (typically we group on VLAN). Write-only: takes an array of netio_group_t's, low 24 bits of the offset is the base group number times the size of a netio_group_t.

NETIO_IPP_INPUT_BUCKET_CFG_OFF 

Configure bucket. Write-only: takes an array of netio_bucket_t's, low 24 bits of the offset is the base bucket number times the size of a netio_bucket_t.

NETIO_IPP_PARAM_OFF 

Get/set a parameter. Read or write: read or write data is the parameter value, low 32 bits of the offset is a __netio_getset_offset_t.

NETIO_IPP_GET_FASTIO_OFF 

Get fast I/O index. Read-only; returns a 4-byte base index value.

NETIO_IPP_INPUT_HIJACK_CFG_OFF 

Configure hijack IP address. Packets with this IPv4 dest address go to bucket NETIO_NUM_BUCKETS - 1. Write-only: takes an IP address in some standard form. FIXME: Define the form!

NETIO_IPP_USER_MAX_OFF 

Offsets beyond this point are reserved for the supervisor (although that enforcement must be done by the supervisor driver itself).

NETIO_IPP_IOMEM_REGISTER_OFF 

Register I/O memory. Write-only, takes a netio_ipp_address_t.

NETIO_IPP_IOMEM_UNREGISTER_OFF 

Unregister I/O memory. Write-only, takes a netio_ipp_address_t.

NETIO_IPP_DRAIN_OFF 

Drain LIPP buffers.

NETIO_EPP_SHM_OFF 

Supply a netio_ipp_address_t to be used as shared memory for the LEPP command queue.

NETIO_IPP_STOP_SHIM_OFF 

Stop IPP/EPP tiles. Write-only, takes a dummy argument.

NETIO_IPP_START_SHIM_OFF 

Start IPP/EPP tiles. Write-only, takes a dummy argument.

NETIO_IPP_ADDRESS_OFF 

Supply packet arena. Write-only, takes an array of netio_ipp_address_t values.

Definition at line 48 of file drv_xgbe_intf.h.

Function Documentation

int __netio_fastio0 ( uint32_t  fastio_index)

0-argument fast I/O call

int __netio_fastio1 ( uint32_t  fastio_index,
uint32_t  arg0 
)
inline

1-argument fast I/O call

Definition at line 328 of file tilepro.c.

netio_fastio_rv3_t __netio_fastio3_rv3 ( uint32_t  fastio_index,
uint32_t  arg0,
uint32_t  arg1,
uint32_t  arg2 
)

3-argument fast I/O call, 2-word return value

int __netio_fastio4 ( uint32_t  fastio_index,
uint32_t  arg0,
uint32_t  arg1,
uint32_t  arg2,
uint32_t  arg3 
)

4-argument fast I/O call

int __netio_fastio6 ( uint32_t  fastio_index,
uint32_t  arg0,
uint32_t  arg1,
uint32_t  arg2,
uint32_t  arg3,
uint32_t  arg4,
uint32_t  arg5 
)

6-argument fast I/O call

int __netio_fastio9 ( uint32_t  fastio_index,
uint32_t  arg0,
uint32_t  arg1,
uint32_t  arg2,
uint32_t  arg3,
uint32_t  arg4,
uint32_t  arg5,
uint32_t  arg6,
uint32_t  arg7,
uint32_t  arg8 
)

9-argument fast I/O call