iPXE
|
Ethernet slow protocols. More...
#include <stdlib.h>
#include <string.h>
#include <byteswap.h>
#include <errno.h>
#include <ipxe/timer.h>
#include <ipxe/iobuf.h>
#include <ipxe/netdevice.h>
#include <ipxe/if_ether.h>
#include <ipxe/ethernet.h>
#include <ipxe/eth_slow.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static const char * | eth_slow_lacp_tlv_name (uint8_t type) |
Name LACP TLV type. More... | |
static const char * | eth_slow_marker_tlv_name (uint8_t type) |
Name marker TLV type. More... | |
static const char * | eth_slow_lacp_state_name (uint8_t state) |
Name LACP state. More... | |
static void | eth_slow_lacp_dump (struct io_buffer *iobuf, struct net_device *netdev, const char *label) |
Dump LACP packet. More... | |
static int | eth_slow_lacp_rx (struct io_buffer *iobuf, struct net_device *netdev) |
Process incoming LACP packet. More... | |
static void | eth_slow_marker_dump (struct io_buffer *iobuf, struct net_device *netdev, const char *label) |
Dump marker packet. More... | |
static int | eth_slow_marker_rx (struct io_buffer *iobuf, struct net_device *netdev) |
Process incoming marker packet. More... | |
static int | eth_slow_rx (struct io_buffer *iobuf, struct net_device *netdev, const void *ll_dest __unused, const void *ll_source __unused, unsigned int flags __unused) |
Process incoming slow packet. More... | |
Variables | |
struct net_protocol eth_slow_protocol | __net_protocol |
Slow protocol. More... | |
static const uint8_t | eth_slow_address [ETH_ALEN] |
Slow protocols multicast address. More... | |
Ethernet slow protocols.
We implement a very simple passive LACP entity, that pretends that each port is the only port on an individual system. We avoid the need for timeout logic (and retaining local state about our partner) by requesting the same timeout period (1s or 30s) as our partner requests, and then simply responding to every packet the partner sends us.
Definition in file eth_slow.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Name LACP TLV type.
type | LACP TLV type |
name | Name of LACP TLV type |
Definition at line 62 of file eth_slow.c.
References ETH_SLOW_TLV_LACP_ACTOR, ETH_SLOW_TLV_LACP_COLLECTOR, ETH_SLOW_TLV_LACP_PARTNER, ETH_SLOW_TLV_TERMINATOR, and type.
|
inlinestatic |
Name marker TLV type.
type | Marker TLV type |
name | Name of marker TLV type |
Definition at line 79 of file eth_slow.c.
References ETH_SLOW_TLV_MARKER_REQUEST, ETH_SLOW_TLV_MARKER_RESPONSE, ETH_SLOW_TLV_TERMINATOR, and type.
Referenced by eth_slow_marker_dump().
|
static |
Name LACP state.
state | LACP state |
name | LACP state name |
Definition at line 94 of file eth_slow.c.
References state.
Referenced by eth_slow_lacp_dump().
|
static |
Dump LACP packet.
iobuf | I/O buffer |
netdev | Network device |
label | "RX" or "TX" |
Definition at line 113 of file eth_slow.c.
References eth_slow_lacp::actor, eth_slow_lacp::collector, io_buffer::data, DBGC, DBGC2_HDA, eth_ntoa(), eth_slow_lacp_state_name(), iob_len(), eth_slow_lacp_entity_tlv::key, lacp, eth_slow_packet::lacp, eth_slow_lacp_collector_tlv::max_delay, net_device::name, netdev, ntohs, eth_slow_lacp::partner, eth_slow_lacp_entity_tlv::port, eth_slow_lacp_entity_tlv::port_priority, eth_slow_lacp_entity_tlv::state, eth_slow_lacp_entity_tlv::system, and eth_slow_lacp_entity_tlv::system_priority.
Referenced by eth_slow_lacp_rx().
|
static |
Process incoming LACP packet.
iobuf | I/O buffer |
netdev | Network device |
rc | Return status code |
Definition at line 148 of file eth_slow.c.
References eth_slow_lacp::actor, eth_slow_lacp::collector, io_buffer::data, DBGC, ELOOP, eth_slow_address, eth_slow_lacp_dump(), ETH_SLOW_LACP_VERSION, ETH_SLOW_TLV_LACP_ACTOR, ETH_SLOW_TLV_LACP_ACTOR_LEN, ETH_SLOW_TLV_LACP_COLLECTOR, ETH_SLOW_TLV_LACP_COLLECTOR_LEN, ETH_SLOW_TLV_LACP_PARTNER, ETH_SLOW_TLV_LACP_PARTNER_LEN, eth_slow_lacp::header, htons, eth_slow_lacp_entity_tlv::key, lacp, eth_slow_packet::lacp, LACP_INTERVAL_FAST, LACP_INTERVAL_SLOW, LACP_PORT_PRIORITY_MAX, LACP_STATE_AGGREGATABLE, LACP_STATE_COLLECTING, LACP_STATE_DISTRIBUTING, LACP_STATE_FAST, LACP_STATE_IN_SYNC, LACP_SYSTEM_PRIORITY_MAX, eth_slow_tlv_header::length, net_device::ll_addr, memcmp(), memcpy(), memset(), net_device::name, net_tx(), netdev, netdev_link_block(), netdev_link_blocked(), netdev_link_unblock(), eth_slow_lacp::partner, eth_slow_lacp_entity_tlv::port, eth_slow_lacp_entity_tlv::port_priority, eth_slow_lacp_entity_tlv::reserved, eth_slow_lacp::reserved, eth_slow_lacp_entity_tlv::state, eth_slow_lacp_entity_tlv::system, eth_slow_lacp_entity_tlv::system_priority, eth_slow_lacp::terminator, TICKS_PER_SEC, eth_slow_lacp_entity_tlv::tlv, eth_slow_lacp_collector_tlv::tlv, eth_slow_tlv_header::type, and eth_slow_header::version.
Referenced by eth_slow_rx().
|
static |
Dump marker packet.
iobuf | I/O buffer |
netdev | Network device |
label | "RX" or "TX" |
Definition at line 224 of file eth_slow.c.
References io_buffer::data, DBGC, DBGC2_HDA, eth_ntoa(), eth_slow_marker_tlv_name(), iob_len(), eth_slow_packet::marker, marker, net_device::name, netdev, ntohl, ntohs, eth_slow_marker_tlv::port, eth_slow_marker_tlv::system, eth_slow_marker_tlv::tlv, eth_slow_tlv_header::type, and eth_slow_marker_tlv::xact.
Referenced by eth_slow_marker_rx().
|
static |
Process incoming marker packet.
iobuf | I/O buffer |
netdev | Network device |
rc | Return status code |
Definition at line 246 of file eth_slow.c.
References io_buffer::data, EINVAL, eth_slow_address, eth_slow_marker_dump(), ETH_SLOW_TLV_MARKER_REQUEST, ETH_SLOW_TLV_MARKER_RESPONSE, free_iob(), net_device::ll_addr, eth_slow_packet::marker, marker, net_tx(), netdev, eth_slow_marker_tlv::tlv, and eth_slow_tlv_header::type.
Referenced by eth_slow_rx().
|
static |
Process incoming slow packet.
iobuf | I/O buffer |
netdev | Network device |
ll_dest | Link-layer destination address |
ll_source | Link-layer source address |
flags | Packet flags |
rc | Return status code |
Definition at line 276 of file eth_slow.c.
References io_buffer::data, DBGC, EINVAL, eth_slow_lacp_rx(), eth_slow_marker_rx(), ETH_SLOW_SUBTYPE_LACP, ETH_SLOW_SUBTYPE_MARKER, free_iob(), eth_slow_packet::header, iob_len(), iob_unput, net_device::name, netdev, and eth_slow_header::subtype.
struct net_protocol eth_slow_protocol __net_protocol |
Slow protocol.
AoE protocol.
Definition at line 49 of file eth_slow.c.
Slow protocols multicast address.
Definition at line 52 of file eth_slow.c.
Referenced by eth_slow_lacp_rx(), and eth_slow_marker_rx().