53 { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x02 };
68 default:
return "<invalid>";
84 default:
return "<invalid>";
95 static char state_chars[] =
"AFGSCDLX";
98 for ( i = 0 ; i < 8 ; i++ ) {
99 state_chars[i] |= 0x20;
100 if (
state & ( 1 << i ) )
101 state_chars[i] &= ~0x20;
115 const char *
label ) {
120 "SLOW %s %s LACP actor (%04x,%s,%04x,%02x,%04x) [%s]\n",
128 "SLOW %s %s LACP partner (%04x,%s,%04x,%02x,%04x) [%s]\n",
135 DBGC (
netdev,
"SLOW %s %s LACP collector %04x (%d us)\n",
152 unsigned int interval;
159 DBGC (
netdev,
"SLOW %s RX loopback detected\n",
178 DBGC (
netdev,
"SLOW %s LACP partner is up\n",
226 const char *
label ) {
230 DBGC (
netdev,
"SLOW %s %s marker %s port %04x system %s xact %08x\n",
284 if (
iob_len ( iobuf ) <
sizeof ( *eth_slow ) ) {
299 DBGC (
netdev,
"SLOW %s RX unknown subtype %02x\n",
#define EINVAL
Invalid argument.
const char * name
Protocol name.
#define TICKS_PER_SEC
Number of ticks per second.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct eth_slow_lacp lacp
LACP packet.
uint8_t reserved[3]
Reserved.
#define ETH_SLOW_LACP_VERSION
LACP version number.
static int eth_slow_lacp_rx(struct io_buffer *iobuf, struct net_device *netdev)
Process incoming LACP packet.
uint8_t system[ETH_ALEN]
Requester system.
struct eth_slow_terminator_tlv terminator
Terminator.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
uint32_t type
Operating system type.
#define ETH_SLOW_SUBTYPE_MARKER
Marker subtype.
static const uint8_t eth_slow_address[ETH_ALEN]
Slow protocols multicast address.
#define LACP_STATE_AGGREGATABLE
LACP link is aggregateable.
#define LACP_STATE_COLLECTING
LACP link is collecting (receiving)
#define LACP_STATE_IN_SYNC
LACP link is in synchronisation.
struct eth_slow_lacp lacp
LACP packet.
#define ETH_SLOW_TLV_MARKER_REQUEST
Marker request type.
#define LACP_SYSTEM_PRIORITY_MAX
Maximum system priority.
struct eth_slow_tlv_header tlv
TLV header.
#define ETH_SLOW_TLV_LACP_COLLECTOR
LACP collector type.
static const char * eth_slow_lacp_tlv_name(uint8_t type)
Name LACP TLV type.
static int netdev_link_blocked(struct net_device *netdev)
Check link block state of network device.
struct eth_slow_lacp_collector_tlv collector
Collector information.
#define ELOOP
Too many levels of symbolic links.
struct eth_slow_header header
Slow protocols header.
#define ETH_SLOW_TLV_MARKER_RESPONSE
Marker response type.
struct eth_slow_tlv_header tlv
TLV header.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint16_t max_delay
Maximum delay (in 10us increments)
#define __unused
Declare a variable or data structure as unused.
void netdev_link_block(struct net_device *netdev, unsigned long timeout)
Mark network device link as being blocked.
static int eth_slow_marker_rx(struct io_buffer *iobuf, struct net_device *netdev)
Process incoming marker packet.
uint8_t system[ETH_ALEN]
System identifier.
void netdev_link_unblock(struct net_device *netdev)
Mark network device link as being unblocked.
static struct net_device * netdev
uint16_t port
Requester port.
static const char * eth_slow_marker_tlv_name(uint8_t type)
Name marker TLV type.
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.
struct eth_slow_header header
Slow protocols header.
#define LACP_PORT_PRIORITY_MAX
Maximum port priority.
#define LACP_STATE_FAST
LACP timeout is short.
#define iob_unput(iobuf, len)
#define ETH_SLOW_TLV_LACP_PARTNER
LACP partner type.
#define ETH_SLOW_TLV_LACP_ACTOR_LEN
LACP actor length.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define ETH_SLOW_TLV_LACP_COLLECTOR_LEN
LACP collector length.
#define ETH_SLOW_TLV_LACP_PARTNER_LEN
LACP partner length.
struct eth_slow_lacp_entity_tlv partner
Partner information.
#define LACP_INTERVAL_SLOW
LACP slow interval (30 seconds)
struct net_protocol eth_slow_protocol __net_protocol
Slow protocol.
A network-layer protocol.
#define ETH_SLOW_TLV_TERMINATOR
Terminator type.
uint8_t reserved[50]
Reserved.
uint16_t system_priority
System priority.
Network device management.
uint32_t xact
Requester transaction ID.
#define ETH_SLOW_SUBTYPE_LACP
LACP subtype.
struct eth_slow_marker marker
Marker packet.
char name[NETDEV_NAME_LEN]
Name of this network device.
#define ETH_SLOW_TLV_LACP_ACTOR
LACP actor type.
int net_tx(struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *ll_dest, const void *ll_source)
Transmit network-layer packet.
void * data
Start of data.
static void eth_slow_marker_dump(struct io_buffer *iobuf, struct net_device *netdev, const char *label)
Dump marker packet.
uint16_t port_priority
Port priority.
static const char * eth_slow_lacp_state_name(uint8_t state)
Name LACP state.
struct eth_slow_tlv_header tlv
TLV header.
struct eth_slow_lacp_entity_tlv actor
Actor information.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
#define LACP_STATE_DISTRIBUTING
LACP link is distributing (transmitting)
#define LACP_INTERVAL_FAST
LACP fast interval (1 second)
uint16_t port
Port identifier.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
struct eth_slow_marker_tlv marker
Marker information.
static void eth_slow_lacp_dump(struct io_buffer *iobuf, struct net_device *netdev, const char *label)
Dump LACP packet.
void * memset(void *dest, int character, size_t len) __nonnull