Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
netio_intf.h File Reference
#include <hv/netio_errors.h>
#include <stdint.h>
#include <assert.h>
#include <sched.h>

Go to the source code of this file.

Data Structures

union  netio_group_t
 A group-to-bucket identifier. More...
 
struct  netio_pkt_metadata_t
 Ethernet standard (ingress) packet metadata. More...
 
struct  netio_pkt_minimal_metadata_t
 Ethernet minimal (egress) packet metadata. More...
 
union  __netio_pkt_notif_t
 An I/O notification header. More...
 
union  __netio_pkt_handle_t
 An I/O notification packet (second word) More...
 
struct  netio_pkt_handle_t
 A handle for an I/O packet's storage.netio_pkt_handle_t encodes the concept of a netio_pkt_t with its packet metadata removed. It is a much smaller type that exists to facilitate applications where the full netio_pkt_t type is too large, such as those that cache enormous numbers of packets or wish to transmit packet descriptors over the UDN. More...
 
struct  netio_pkt_t
 A packet descriptor. More...
 
struct  netio_input_config_t
 An object for specifying the characteristics of NetIO communication endpoint. More...
 
struct  netio_queue_t
 
struct  netio_send_pkt_context_t
 Packet send context. More...
 
struct  netio_stat_t
 
union  netio_mdio_addr_t
 

Macros

#define netio_assert   assert
 
#define _NETIO_PTHREAD
 
#define NETIO_MAX_TILES_PER_QUEUE   64
 
#define NETIO_MAX_QUEUE_ID   255
 
#define _NETIO_PKT_NO_L4_CSUM_SHIFT   0
 
#define _NETIO_PKT_NO_L4_CSUM_RMASK   1
 
#define _NETIO_PKT_NO_L4_CSUM_MASK   (_NETIO_PKT_NO_L4_CSUM_RMASK << _NETIO_PKT_NO_L4_CSUM_SHIFT)
 
#define _NETIO_PKT_NO_L3_CSUM_SHIFT   1
 
#define _NETIO_PKT_NO_L3_CSUM_RMASK   1
 
#define _NETIO_PKT_NO_L3_CSUM_MASK   (_NETIO_PKT_NO_L3_CSUM_RMASK << _NETIO_PKT_NO_L3_CSUM_SHIFT)
 
#define _NETIO_PKT_BAD_L3_CSUM_SHIFT   2
 
#define _NETIO_PKT_BAD_L3_CSUM_RMASK   1
 
#define _NETIO_PKT_BAD_L3_CSUM_MASK   (_NETIO_PKT_BAD_L3_CSUM_RMASK << _NETIO_PKT_BAD_L3_CSUM_SHIFT)
 
#define _NETIO_PKT_TYPE_UNRECOGNIZED_SHIFT   3
 
#define _NETIO_PKT_TYPE_UNRECOGNIZED_RMASK   1
 
#define _NETIO_PKT_TYPE_UNRECOGNIZED_MASK
 
#define _NETIO_PKT_TYPE_SHIFT   4
 
#define _NETIO_PKT_TYPE_RMASK   0x3F
 
#define _NETIO_PKT_VLAN_SHIFT   4
 
#define _NETIO_PKT_VLAN_RMASK   0x3
 
#define _NETIO_PKT_VLAN_MASK   (_NETIO_PKT_VLAN_RMASK << _NETIO_PKT_VLAN_SHIFT)
 
#define _NETIO_PKT_VLAN_NONE   0 /* No VLAN tag. */
 
#define _NETIO_PKT_VLAN_ONE   1 /* One VLAN tag. */
 
#define _NETIO_PKT_VLAN_TWO_OUTER   2 /* Two VLAN tags, outer one used. */
 
#define _NETIO_PKT_VLAN_TWO_INNER   3 /* Two VLAN tags, inner one used. */
 
#define _NETIO_PKT_TAG_SHIFT   6
 
#define _NETIO_PKT_TAG_RMASK   0x3
 
#define _NETIO_PKT_TAG_MASK   (_NETIO_PKT_TAG_RMASK << _NETIO_PKT_TAG_SHIFT)
 
#define _NETIO_PKT_TAG_NONE   0 /* No proprietary tags. */
 
#define _NETIO_PKT_TAG_MRVL   1 /* Marvell HyperG.Stack tags. */
 
#define _NETIO_PKT_TAG_MRVL_EXT   2 /* HyperG.Stack extended tags. */
 
#define _NETIO_PKT_TAG_BRCM   3 /* Broadcom HiGig tags. */
 
#define _NETIO_PKT_SNAP_SHIFT   8
 
#define _NETIO_PKT_SNAP_RMASK   0x1
 
#define _NETIO_PKT_SNAP_MASK   (_NETIO_PKT_SNAP_RMASK << _NETIO_PKT_SNAP_SHIFT)
 
#define _NETIO_PKT_CUSTOM_LEN_SHIFT   11
 
#define _NETIO_PKT_CUSTOM_LEN_RMASK   0x1F
 
#define _NETIO_PKT_CUSTOM_LEN_MASK   (_NETIO_PKT_CUSTOM_LEN_RMASK << _NETIO_PKT_CUSTOM_LEN_SHIFT)
 
#define _NETIO_PKT_BAD_L4_CSUM_SHIFT   16
 
#define _NETIO_PKT_BAD_L4_CSUM_RMASK   0x1
 
#define _NETIO_PKT_BAD_L4_CSUM_MASK   (_NETIO_PKT_BAD_L4_CSUM_RMASK << _NETIO_PKT_BAD_L4_CSUM_SHIFT)
 
#define _NETIO_PKT_L2_LEN_SHIFT   17
 
#define _NETIO_PKT_L2_LEN_RMASK   0x1F
 
#define _NETIO_PKT_L2_LEN_MASK   (_NETIO_PKT_L2_LEN_RMASK << _NETIO_PKT_L2_LEN_SHIFT)
 
#define _NETIO_PKT_NEED_EDMA_CSUM_SHIFT   0
 
#define _NETIO_PKT_NEED_EDMA_CSUM_RMASK   1
 
#define _NETIO_PKT_NEED_EDMA_CSUM_MASK   (_NETIO_PKT_NEED_EDMA_CSUM_RMASK << _NETIO_PKT_NEED_EDMA_CSUM_SHIFT)
 
#define _NETIO_PKT_INFO_ETYPE_SHIFT   6
 
#define _NETIO_PKT_INFO_ETYPE_RMASK   0x1F
 
#define _NETIO_PKT_INFO_VLAN_SHIFT   11
 
#define _NETIO_PKT_INFO_VLAN_RMASK   0x1F
 
#define SMALL_PACKET_SIZE   256
 
#define LARGE_PACKET_SIZE   2048
 
#define JUMBO_PACKET_SIZE   (12 * 1024)
 
#define NETIO_LOG2_NUM_BUCKETS   (10)
 
#define NETIO_NUM_BUCKETS   (1 << NETIO_LOG2_NUM_BUCKETS)
 
#define NETIO_PACKET_PADDING   2
 
#define _NETIO_PKT_HANDLE_BASE(p)   ((unsigned char*)((p).word & 0xFFFFFFC0))
 
#define _NETIO_PKT_BASE(p)   _NETIO_PKT_HANDLE_BASE(p->__packet)
 
#define __NETIO_PKT_NOTIF_HEADER(pkt)   ((pkt)->__notif_header)
 
#define __NETIO_PKT_IPP_HANDLE(pkt)   ((pkt)->__packet.bits.__ipp_handle)
 
#define __NETIO_PKT_QUEUE(pkt)   ((pkt)->__packet.bits.__queue)
 
#define __NETIO_PKT_NOTIF_HEADER_M(mda, pkt)   ((pkt)->__notif_header)
 
#define __NETIO_PKT_IPP_HANDLE_M(mda, pkt)   ((pkt)->__packet.bits.__ipp_handle)
 
#define __NETIO_PKT_MINIMAL(pkt)   ((pkt)->__packet.bits.__minimal)
 
#define __NETIO_PKT_QUEUE_M(mda, pkt)   ((pkt)->__packet.bits.__queue)
 
#define __NETIO_PKT_FLAGS_M(mda, pkt)   ((mda)->__flags)
 
#define NETIO_PKT_GOOD_CHECKSUM(pkt)   NETIO_PKT_L4_CSUM_CORRECT(pkt)
 
#define NETIO_PKT_GOOD_CHECKSUM_M(mda, pkt)   NETIO_PKT_L4_CSUM_CORRECT_M(mda, pkt)
 
#define NETIO_PKT_HANDLE_NONE   ((netio_pkt_handle_t) { 0 })
 
#define NETIO_NUM_NODE_WEIGHTS   16
 
#define NETIO_STRICT_HOMING   0x00000002
 
#define NETIO_TAG_NONE   0x00000004
 
#define NETIO_TAG_MRVL   0x00000008
 
#define NETIO_TAG_BRCM   0x00000010
 
#define NETIO_RECV   0x00000020
 
#define NETIO_NO_RECV   0x00000040
 
#define NETIO_XMIT   0x00000080
 
#define NETIO_XMIT_CSUM   0x00000100
 
#define NETIO_NO_XMIT   0x00000200
 
#define NETIO_FIXED_BUFFER_VA   0x00000400
 
#define NETIO_REQUIRE_LINK_UP   0x00000800
 
#define NETIO_NOREQUIRE_LINK_UP   0x00001000
 
#define _NETIO_AUTO_UP   0x00002000
 
#define _NETIO_AUTO_DN   0x00004000
 
#define _NETIO_AUTO_PRESENT   0x00008000
 
#define NETIO_AUTO_LINK_UP   (_NETIO_AUTO_PRESENT | _NETIO_AUTO_UP)
 
#define NETIO_AUTO_LINK_UPDN
 
#define NETIO_AUTO_LINK_DN   (_NETIO_AUTO_PRESENT | _NETIO_AUTO_DN)
 
#define NETIO_AUTO_LINK_NONE   _NETIO_AUTO_PRESENT
 
#define NETIO_MIN_RECEIVE_PKTS   16
 
#define NETIO_MAX_RECEIVE_PKTS   128
 
#define NETIO_MAX_SEND_BUFFERS   16
 
#define NETIO_TOTAL_SENDS_OUTSTANDING   2015
 
#define NETIO_MIN_SENDS_OUTSTANDING   16
 
#define SEND_PKT_CTX_USE_EPP   1
 
#define SEND_PKT_CTX_SEND_CSUM   2
 
#define NETIO_STAT_DROPS_NO_WORKER   0
 
#define NETIO_STAT_DROPS_NO_SMALLBUF   1
 
#define NETIO_STAT_DROPS_NO_LARGEBUF   2
 
#define NETIO_STAT_DROPS_NO_JUMBOBUF   3
 
#define ETHERTYPE_IPv4   (0x0800)
 
#define ETHERTYPE_ARP   (0x0806)
 
#define ETHERTYPE_VLAN   (0x8100)
 
#define ETHERTYPE_Q_IN_Q   (0x9100)
 
#define ETHERTYPE_IPv6   (0x86DD)
 
#define ETHERTYPE_MPLS   (0x8847)
 
#define NETIO_PARAM   0
 
#define NETIO_PARAM_MAC   0
 
#define NETIO_PARAM_PAUSE_IN   1
 
#define NETIO_PARAM_PAUSE_OUT   2
 
#define NETIO_PARAM_JUMBO   3
 
#define NETIO_PARAM_OVERFLOW   4
 
#define NETIO_PARAM_STAT   5
 
#define NETIO_PARAM_LINK_POSSIBLE_STATE   6
 
#define NETIO_PARAM_LINK_CONFIG   NETIO_PARAM_LINK_POSSIBLE_STATE
 
#define NETIO_PARAM_LINK_CURRENT_STATE   7
 
#define NETIO_PARAM_LINK_STATUS   NETIO_PARAM_LINK_CURRENT_STATE
 
#define NETIO_PARAM_COHERENT   8
 
#define NETIO_PARAM_LINK_DESIRED_STATE   9
 
#define NETIO_LINK_10M   0x01
 
#define NETIO_LINK_100M   0x02
 
#define NETIO_LINK_1G   0x04
 
#define NETIO_LINK_10G   0x08
 
#define NETIO_LINK_ANYSPEED   0x10
 
#define NETIO_LINK_SPEED
 
#define NETIO_MAC   1
 
#define NETIO_MDIO   2
 
#define NETIO_MDIO_CLAUSE45   3
 

Typedefs

typedef int _netio_percpu_mutex_t
 
typedef netio_group_t netio_vlan_t
 A VLAN-to-bucket identifier.
 
typedef unsigned char netio_bucket_t
 
typedef unsigned int netio_size_t
 

Enumerations

enum  netio_pkt_status_t { NETIO_PKT_STATUS_OK, NETIO_PKT_STATUS_UNDERSIZE, NETIO_PKT_STATUS_OVERSIZE, NETIO_PKT_STATUS_BAD }
 

Functions

struct __attribute__ ((aligned(8)))
 Packet vector entry.
 

Variables

const uint16_t _netio_pkt_info []
 
 netio_pkt_vector_entry_t
 

Macro Definition Documentation

#define __NETIO_PKT_FLAGS_M (   mda,
  pkt 
)    ((mda)->__flags)

Definition at line 584 of file netio_intf.h.

#define __NETIO_PKT_IPP_HANDLE (   pkt)    ((pkt)->__packet.bits.__ipp_handle)

Definition at line 578 of file netio_intf.h.

#define __NETIO_PKT_IPP_HANDLE_M (   mda,
  pkt 
)    ((pkt)->__packet.bits.__ipp_handle)

Definition at line 581 of file netio_intf.h.

#define __NETIO_PKT_MINIMAL (   pkt)    ((pkt)->__packet.bits.__minimal)

Definition at line 582 of file netio_intf.h.

#define __NETIO_PKT_NOTIF_HEADER (   pkt)    ((pkt)->__notif_header)

Definition at line 577 of file netio_intf.h.

#define __NETIO_PKT_NOTIF_HEADER_M (   mda,
  pkt 
)    ((pkt)->__notif_header)

Definition at line 580 of file netio_intf.h.

#define __NETIO_PKT_QUEUE (   pkt)    ((pkt)->__packet.bits.__queue)

Definition at line 579 of file netio_intf.h.

#define __NETIO_PKT_QUEUE_M (   mda,
  pkt 
)    ((pkt)->__packet.bits.__queue)

Definition at line 583 of file netio_intf.h.

#define _NETIO_PKT_BAD_L3_CSUM_MASK   (_NETIO_PKT_BAD_L3_CSUM_RMASK << _NETIO_PKT_BAD_L3_CSUM_SHIFT)

Definition at line 119 of file netio_intf.h.

#define _NETIO_PKT_BAD_L3_CSUM_RMASK   1

Definition at line 118 of file netio_intf.h.

#define _NETIO_PKT_BAD_L3_CSUM_SHIFT   2

The L3 checksum is incorrect (or perhaps has not been calculated).

Definition at line 117 of file netio_intf.h.

#define _NETIO_PKT_BAD_L4_CSUM_MASK   (_NETIO_PKT_BAD_L4_CSUM_RMASK << _NETIO_PKT_BAD_L4_CSUM_SHIFT)

Definition at line 175 of file netio_intf.h.

#define _NETIO_PKT_BAD_L4_CSUM_RMASK   0x1

Definition at line 174 of file netio_intf.h.

#define _NETIO_PKT_BAD_L4_CSUM_SHIFT   16

The L4 checksum is incorrect (or perhaps has not been calculated).

Definition at line 173 of file netio_intf.h.

#define _NETIO_PKT_BASE (   p)    _NETIO_PKT_HANDLE_BASE(p->__packet)

Returns the base address of the packet.

Definition at line 447 of file netio_intf.h.

#define _NETIO_PKT_CUSTOM_LEN_MASK   (_NETIO_PKT_CUSTOM_LEN_RMASK << _NETIO_PKT_CUSTOM_LEN_SHIFT)

Definition at line 169 of file netio_intf.h.

#define _NETIO_PKT_CUSTOM_LEN_RMASK   0x1F

Definition at line 168 of file netio_intf.h.

#define _NETIO_PKT_CUSTOM_LEN_SHIFT   11

Length of any custom data before the L2 header, in words.

Definition at line 167 of file netio_intf.h.

#define _NETIO_PKT_HANDLE_BASE (   p)    ((unsigned char*)((p).word & 0xFFFFFFC0))

Returns the base address of the packet.

Definition at line 441 of file netio_intf.h.

#define _NETIO_PKT_INFO_ETYPE_RMASK   0x1F

Definition at line 200 of file netio_intf.h.

#define _NETIO_PKT_INFO_ETYPE_SHIFT   6

Offset within the L2 header of the innermost ethertype (in halfwords).

Definition at line 199 of file netio_intf.h.

#define _NETIO_PKT_INFO_VLAN_RMASK   0x1F

Definition at line 204 of file netio_intf.h.

#define _NETIO_PKT_INFO_VLAN_SHIFT   11

Offset within the L2 header of the VLAN tag (in halfwords).

Definition at line 203 of file netio_intf.h.

#define _NETIO_PKT_L2_LEN_MASK   (_NETIO_PKT_L2_LEN_RMASK << _NETIO_PKT_L2_LEN_SHIFT)

Definition at line 181 of file netio_intf.h.

#define _NETIO_PKT_L2_LEN_RMASK   0x1F

Definition at line 180 of file netio_intf.h.

#define _NETIO_PKT_L2_LEN_SHIFT   17

Length of the L2 header, in words.

Definition at line 179 of file netio_intf.h.

#define _NETIO_PKT_NEED_EDMA_CSUM_MASK   (_NETIO_PKT_NEED_EDMA_CSUM_RMASK << _NETIO_PKT_NEED_EDMA_CSUM_SHIFT)

Definition at line 190 of file netio_intf.h.

#define _NETIO_PKT_NEED_EDMA_CSUM_RMASK   1

Definition at line 189 of file netio_intf.h.

#define _NETIO_PKT_NEED_EDMA_CSUM_SHIFT   0

We need an eDMA checksum on this packet.

Definition at line 188 of file netio_intf.h.

#define _NETIO_PKT_NO_L3_CSUM_MASK   (_NETIO_PKT_NO_L3_CSUM_RMASK << _NETIO_PKT_NO_L3_CSUM_SHIFT)

Definition at line 113 of file netio_intf.h.

#define _NETIO_PKT_NO_L3_CSUM_RMASK   1

Definition at line 112 of file netio_intf.h.

#define _NETIO_PKT_NO_L3_CSUM_SHIFT   1

The L3 checksum has not been calculated.

Definition at line 111 of file netio_intf.h.

#define _NETIO_PKT_NO_L4_CSUM_MASK   (_NETIO_PKT_NO_L4_CSUM_RMASK << _NETIO_PKT_NO_L4_CSUM_SHIFT)

Definition at line 107 of file netio_intf.h.

#define _NETIO_PKT_NO_L4_CSUM_RMASK   1

Definition at line 106 of file netio_intf.h.

#define _NETIO_PKT_NO_L4_CSUM_SHIFT   0

The L4 checksum has not been calculated.

Definition at line 105 of file netio_intf.h.

#define _NETIO_PKT_SNAP_MASK   (_NETIO_PKT_SNAP_RMASK << _NETIO_PKT_SNAP_SHIFT)

Definition at line 161 of file netio_intf.h.

#define _NETIO_PKT_SNAP_RMASK   0x1

Definition at line 160 of file netio_intf.h.

#define _NETIO_PKT_SNAP_SHIFT   8

Whether a packet has an LLC + SNAP header.

Definition at line 159 of file netio_intf.h.

#define _NETIO_PKT_TAG_BRCM   3 /* Broadcom HiGig tags. */

Definition at line 156 of file netio_intf.h.

#define _NETIO_PKT_TAG_MASK   (_NETIO_PKT_TAG_RMASK << _NETIO_PKT_TAG_SHIFT)

Definition at line 151 of file netio_intf.h.

#define _NETIO_PKT_TAG_MRVL   1 /* Marvell HyperG.Stack tags. */

Definition at line 154 of file netio_intf.h.

#define _NETIO_PKT_TAG_MRVL_EXT   2 /* HyperG.Stack extended tags. */

Definition at line 155 of file netio_intf.h.

#define _NETIO_PKT_TAG_NONE   0 /* No proprietary tags. */

Definition at line 153 of file netio_intf.h.

#define _NETIO_PKT_TAG_RMASK   0x3

Definition at line 150 of file netio_intf.h.

#define _NETIO_PKT_TAG_SHIFT   6

Which proprietary tags the packet has.

Definition at line 149 of file netio_intf.h.

#define _NETIO_PKT_TYPE_RMASK   0x3F

Definition at line 134 of file netio_intf.h.

#define _NETIO_PKT_TYPE_SHIFT   4

Where the packet type bits are; this field is the index into _netio_pkt_info.

Definition at line 133 of file netio_intf.h.

#define _NETIO_PKT_TYPE_UNRECOGNIZED_MASK
Value:
_NETIO_PKT_TYPE_UNRECOGNIZED_SHIFT)

Definition at line 125 of file netio_intf.h.

#define _NETIO_PKT_TYPE_UNRECOGNIZED_RMASK   1

Definition at line 124 of file netio_intf.h.

#define _NETIO_PKT_TYPE_UNRECOGNIZED_SHIFT   3

The Ethernet packet type is unrecognized.

Definition at line 123 of file netio_intf.h.

#define _NETIO_PKT_VLAN_MASK   (_NETIO_PKT_VLAN_RMASK << _NETIO_PKT_VLAN_SHIFT)

Definition at line 141 of file netio_intf.h.

#define _NETIO_PKT_VLAN_NONE   0 /* No VLAN tag. */

Definition at line 143 of file netio_intf.h.

#define _NETIO_PKT_VLAN_ONE   1 /* One VLAN tag. */

Definition at line 144 of file netio_intf.h.

#define _NETIO_PKT_VLAN_RMASK   0x3

Definition at line 140 of file netio_intf.h.

#define _NETIO_PKT_VLAN_SHIFT   4

How many VLAN tags the packet has, and, if we have two, which one we actually grouped on. A VLAN within a proprietary (Marvell or Broadcom) tag is counted here.

Definition at line 139 of file netio_intf.h.

#define _NETIO_PKT_VLAN_TWO_INNER   3 /* Two VLAN tags, inner one used. */

Definition at line 146 of file netio_intf.h.

#define _NETIO_PKT_VLAN_TWO_OUTER   2 /* Two VLAN tags, outer one used. */

Definition at line 145 of file netio_intf.h.

#define _NETIO_PTHREAD

Include a mutex in netio_queue_t below

Definition at line 43 of file netio_intf.h.

#define ETHERTYPE_ARP   (0x0806)

The ethertype of ARP.

Definition at line 228 of file netio_intf.h.

#define ETHERTYPE_IPv4   (0x0800)

The ethertype of IPv4.

Definition at line 226 of file netio_intf.h.

#define ETHERTYPE_IPv6   (0x86DD)

The ethertype of IPv6.

Definition at line 234 of file netio_intf.h.

#define ETHERTYPE_MPLS   (0x8847)

The ethertype of MPLS.

Definition at line 236 of file netio_intf.h.

#define ETHERTYPE_Q_IN_Q   (0x9100)

The ethertype of a Q-in-Q header.

Definition at line 232 of file netio_intf.h.

#define ETHERTYPE_VLAN   (0x8100)

The ethertype of VLANs.

Definition at line 230 of file netio_intf.h.

#define JUMBO_PACKET_SIZE   (12 * 1024)

The size of a memory buffer representing a jumbo packet.

Definition at line 219 of file netio_intf.h.

#define LARGE_PACKET_SIZE   2048

The size of a memory buffer representing a large packet.

Definition at line 215 of file netio_intf.h.

#define netio_assert   assert

NetIO interface structures and macros.Enable assertions from macros

Definition at line 32 of file netio_intf.h.

#define NETIO_LINK_100M   0x02

Link can run, should run, or is running at 100 Mbps.

Definition at line 2918 of file netio_intf.h.

#define NETIO_LINK_10G   0x08

Link can run, should run, or is running at 10 Gbps.

Definition at line 2924 of file netio_intf.h.

#define NETIO_LINK_10M   0x01

Link can run, should run, or is running at 10 Mbps.

Definition at line 2915 of file netio_intf.h.

#define NETIO_LINK_1G   0x04

Link can run, should run, or is running at 1 Gbps.

Definition at line 2921 of file netio_intf.h.

#define NETIO_LINK_ANYSPEED   0x10

Link should run at the highest speed supported by the link and by the device connected to the link. Only usable as a value for the link's desired state; never returned as a value for the current or possible states.

Definition at line 2930 of file netio_intf.h.

#define NETIO_LINK_SPEED
Value:
NETIO_LINK_100M | \
NETIO_LINK_1G | \
NETIO_LINK_10G | \
NETIO_LINK_ANYSPEED)

All legal link speeds.

Definition at line 2933 of file netio_intf.h.

#define NETIO_LOG2_NUM_BUCKETS   (10)

Log2 of how many buckets we have.

Definition at line 263 of file netio_intf.h.

#define NETIO_MAC   1

MAC register class. Addr is a register offset within the MAC. Registers within the XGbE and GbE MACs are documented in the Tile Processor I/O Device Guide (UG104). MAC registers start at address 0x4000, and do not include the MAC_INTERFACE registers.

Definition at line 2944 of file netio_intf.h.

#define NETIO_MDIO   2

MDIO register class (IEEE 802.3 clause 22 format). Addr is the "addr" member of a netio_mdio_addr_t structure.

Definition at line 2948 of file netio_intf.h.

#define NETIO_MDIO_CLAUSE45   3

MDIO register class (IEEE 802.3 clause 45 format). Addr is the "addr" member of a netio_mdio_addr_t structure.

Definition at line 2952 of file netio_intf.h.

#define NETIO_NUM_BUCKETS   (1 << NETIO_LOG2_NUM_BUCKETS)

How many buckets we have.

Definition at line 267 of file netio_intf.h.

#define NETIO_PACKET_PADDING   2

To ensure that the L3 header is aligned mod 4, the L2 header should be aligned mod 4 plus 2, since every supported L2 header is 4n + 2 bytes long. The standard way to do this is to simply add 2 bytes of padding before the L2 header.

Definition at line 367 of file netio_intf.h.

#define NETIO_PARAM   0

Flags and structures for netio_get() and netio_set().Parameter class; addr is a NETIO_PARAM_xxx value.

Definition at line 2760 of file netio_intf.h.

#define NETIO_PARAM_COHERENT   8

Packet Coherence protocol. This address is only valid with netio_get(). The value is nonzero if the interface is configured for cache-coherent DMA.

Definition at line 2836 of file netio_intf.h.

#define NETIO_PARAM_JUMBO   3

Jumbo frame support. The value is a 4-byte integer. If the value is nonzero, the MAC will accept frames of up to 10240 bytes. If the value is zero, the MAC will only accept frames of up to 1544 bytes.

Definition at line 2780 of file netio_intf.h.

#define NETIO_PARAM_LINK_CONFIG   NETIO_PARAM_LINK_POSSIBLE_STATE

Link configuration. The value is a combination of "NETIO_LINK_xxx" flags. With netio_set(), this will attempt to immediately bring up the link using whichever of the requested flags are supported by the hardware, or take down the link if the flags are zero; if this is not possible, an error will be returned. Many programs will want to use NETIO_PARAM_LINK_DESIRED_STATE instead.

For historical reasons, specifying this value to netio_get() will have the same behavior as using NETIO_PARAM_LINK_POSSIBLE_STATE, but this usage is discouraged.

Definition at line 2819 of file netio_intf.h.

#define NETIO_PARAM_LINK_CURRENT_STATE   7

Current link state. This address is only valid with netio_get(). The value is zero or more of the "NETIO_LINK_xxx" flags, ORed together. If the link is down, the value ANDed with NETIO_LINK_SPEED will be zero; if the link is up, the value ANDed with NETIO_LINK_SPEED will result in exactly one of the NETIO_LINK_xxx values, indicating the current speed.

Definition at line 2827 of file netio_intf.h.

#define NETIO_PARAM_LINK_DESIRED_STATE   9

Desired link state. The value is a conbination of "NETIO_LINK_xxx" flags, which specify the desired state for the link. With netio_set(), this will, in the background, attempt to bring up the link using whichever of the requested flags are reasonable, or take down the link if the flags are zero. The actual link up or down operation may happen after this call completes. If the link state changes in the future, the system will continue to try to get back to the desired link state; for instance, if the link is brought up successfully, and then the network cable is disconnected, the link will go down. However, the desired state of the link is still up, so if the cable is reconnected, the link will be brought up again.

With netio_get(), this will indicate the desired state for the link, as set with a previous netio_set() call, or implicitly by a netio_input_register() or netio_input_unregister() operation. This may not reflect the current state of the link; to get that, use NETIO_PARAM_LINK_CURRENT_STATE.

Definition at line 2855 of file netio_intf.h.

#define NETIO_PARAM_LINK_POSSIBLE_STATE   6

Possible link state. The value is a combination of "NETIO_LINK_xxx" flags. With netio_get(), this will indicate which flags are actually supported by the hardware.

For historical reasons, specifying this value to netio_set() will have the same behavior as using NETIO_PARAM_LINK_CONFIG, but this usage is discouraged.

Definition at line 2806 of file netio_intf.h.

#define NETIO_PARAM_LINK_STATUS   NETIO_PARAM_LINK_CURRENT_STATE

Variant symbol for current state, retained for compatibility with pre-MDE-2.1 programs.

Definition at line 2831 of file netio_intf.h.

#define NETIO_PARAM_MAC   0

Interface MAC address. This address is only valid with netio_get(). The value is a 6-byte MAC address. Depending upon the overall system design, a MAC address may or may not be available for each interface.

Definition at line 2764 of file netio_intf.h.

#define NETIO_PARAM_OVERFLOW   4

I/O shim's overflow statistics register. The value is two 16-bit integers. The first 16-bit value (or the low 16 bits, if the value is treated as a 32-bit number) is the count of packets which were completely dropped and not delivered by the shim. The second 16-bit value (or the high 16 bits, if the value is treated as a 32-bit number) is the count of packets which were truncated and thus only partially delivered by the shim. This register is automatically reset to zero after it has been read.

Definition at line 2790 of file netio_intf.h.

#define NETIO_PARAM_PAUSE_IN   1

Determine whether to suspend output on the receipt of pause frames. If the value is nonzero, the I/O shim will suspend output when a pause frame is received. If the value is zero, pause frames will be ignored.

Definition at line 2769 of file netio_intf.h.

#define NETIO_PARAM_PAUSE_OUT   2

Determine whether to send pause frames if the I/O shim packet FIFOs are nearly full. If the value is zero, pause frames are not sent. If the value is nonzero, it is the delay value which will be sent in any pause frames which are output, in units of 512 bit times.

Definition at line 2775 of file netio_intf.h.

#define NETIO_PARAM_STAT   5

IPP statistics. This address is only valid with netio_get(). The value is a netio_stat_t structure. Unlike the I/O shim statistics, the IPP statistics are not all reset to zero on read; see the description of the netio_stat_t for details.

Definition at line 2796 of file netio_intf.h.

#define NETIO_PKT_GOOD_CHECKSUM (   pkt)    NETIO_PKT_L4_CSUM_CORRECT(pkt)

Definition at line 594 of file netio_intf.h.

#define NETIO_PKT_GOOD_CHECKSUM_M (   mda,
  pkt 
)    NETIO_PKT_L4_CSUM_CORRECT_M(mda, pkt)

Definition at line 596 of file netio_intf.h.

#define NETIO_PKT_HANDLE_NONE   ((netio_pkt_handle_t) { 0 })

A special reserved value indicating the absence of a packet handle.

Definition at line 684 of file netio_intf.h.

#define NETIO_STAT_DROPS_NO_JUMBOBUF   3

Definition at line 2908 of file netio_intf.h.

#define NETIO_STAT_DROPS_NO_LARGEBUF   2

Definition at line 2901 of file netio_intf.h.

#define NETIO_STAT_DROPS_NO_SMALLBUF   1

Definition at line 2894 of file netio_intf.h.

#define NETIO_STAT_DROPS_NO_WORKER   0

Definition at line 2887 of file netio_intf.h.

#define SEND_PKT_CTX_SEND_CSUM   2

Request includes a checksum.

Definition at line 2657 of file netio_intf.h.

#define SEND_PKT_CTX_USE_EPP   1

We're sending to an EPP.

Definition at line 2656 of file netio_intf.h.

#define SMALL_PACKET_SIZE   256

The size of a memory buffer representing a small packet.

Definition at line 211 of file netio_intf.h.

Typedef Documentation

Definition at line 55 of file netio_intf.h.

Enumeration Type Documentation

The possible return values of NETIO_PKT_STATUS.

Enumerator:
NETIO_PKT_STATUS_OK 

No problems were detected with this packet.

NETIO_PKT_STATUS_UNDERSIZE 

The packet is undersized; this is expected behavior if the packet's ethertype is unrecognized, but otherwise the packet is likely corrupt.

NETIO_PKT_STATUS_OVERSIZE 

The packet is oversized and some trailing bytes have been discarded. This is expected behavior for short packets, since it's impossible to precisely determine the amount of padding which may have been added to them to make them meet the minimum Ethernet packet size.

NETIO_PKT_STATUS_BAD 

The packet was judged to be corrupt by hardware (for instance, it had a bad CRC, or part of it was discarded due to lack of buffer space in the I/O shim) and should be discarded.

Definition at line 243 of file netio_intf.h.

Function Documentation

struct __attribute__ ( (aligned(8))  )
read

Packet vector entry.

This data structure is used with netio_send_packet_vector() to send multiple packets with one NetIO call. The structure should be initialized by calling netio_pkt_vector_set(), rather than by setting the fields directly.

This structure is guaranteed to be a power of two in size, no bigger than one L2 cache line, and to be aligned modulo its size.

Reserved for use by the user application. When initialized with the netio_set_pkt_vector_entry() function, this field is guaranteed to be visible to readers only after all other fields are already visible. This way it can be used as a valid flag or generation counter.

Low 8 bits of the packet address to send. The high bits are acquired from the 'handle' field.

Number of bytes to transmit.

The raw handle from a netio_pkt_t. If this is NETIO_PKT_HANDLE_NONE, this vector entry will be skipped and no packet will be transmitted.

Definition at line 2675 of file netio_intf.h.

Variable Documentation

const uint16_t _netio_pkt_info[]
netio_pkt_vector_entry_t

Definition at line 2699 of file netio_intf.h.