Linux Kernel
3.7.1
|
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 |
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 | |
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.
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 |
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.
Definition at line 146 of file netio_intf.h.
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 |
#define NETIO_LINK_SPEED |
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 |
#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 |
#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 |
#define NETIO_PARAM_JUMBO 3 |
#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 |
#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.
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 int _netio_percpu_mutex_t |
Definition at line 55 of file netio_intf.h.
enum netio_pkt_status_t |
The possible return values of NETIO_PKT_STATUS.
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.
|
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.
netio_pkt_vector_entry_t |
Definition at line 2699 of file netio_intf.h.