Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
bond_3ad.c File Reference
#include <linux/skbuff.h>
#include <linux/if_ether.h>
#include <linux/netdevice.h>
#include <linux/spinlock.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/if_bonding.h>
#include <linux/pkt_sched.h>
#include <net/net_namespace.h>
#include "bonding.h"
#include "bond_3ad.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define AD_SHORT_TIMEOUT   1
 
#define AD_LONG_TIMEOUT   0
 
#define AD_STANDBY   0x2
 
#define AD_MAX_TX_IN_SECOND   3
 
#define AD_COLLECTOR_MAX_DELAY   0
 
#define AD_FAST_PERIODIC_TIME   1
 
#define AD_SLOW_PERIODIC_TIME   30
 
#define AD_SHORT_TIMEOUT_TIME   (3*AD_FAST_PERIODIC_TIME)
 
#define AD_LONG_TIMEOUT_TIME   (3*AD_SLOW_PERIODIC_TIME)
 
#define AD_CHURN_DETECTION_TIME   60
 
#define AD_AGGREGATE_WAIT_TIME   2
 
#define AD_STATE_LACP_ACTIVITY   0x1
 
#define AD_STATE_LACP_TIMEOUT   0x2
 
#define AD_STATE_AGGREGATION   0x4
 
#define AD_STATE_SYNCHRONIZATION   0x8
 
#define AD_STATE_COLLECTING   0x10
 
#define AD_STATE_DISTRIBUTING   0x20
 
#define AD_STATE_DEFAULTED   0x40
 
#define AD_STATE_EXPIRED   0x80
 
#define AD_PORT_BEGIN   0x1
 
#define AD_PORT_LACP_ENABLED   0x2
 
#define AD_PORT_ACTOR_CHURN   0x4
 
#define AD_PORT_PARTNER_CHURN   0x8
 
#define AD_PORT_READY   0x10
 
#define AD_PORT_READY_N   0x20
 
#define AD_PORT_MATCHED   0x40
 
#define AD_PORT_STANDBY   0x80
 
#define AD_PORT_SELECTED   0x100
 
#define AD_PORT_MOVED   0x200
 
#define AD_DUPLEX_KEY_BITS   0x1
 
#define AD_SPEED_KEY_BITS   0x3E
 
#define AD_USER_KEY_BITS   0xFFC0
 
#define AD_LINK_SPEED_BITMASK_1MBPS   0x1
 
#define AD_LINK_SPEED_BITMASK_10MBPS   0x2
 
#define AD_LINK_SPEED_BITMASK_100MBPS   0x4
 
#define AD_LINK_SPEED_BITMASK_1000MBPS   0x8
 
#define AD_LINK_SPEED_BITMASK_10000MBPS   0x10
 
#define MAC_ADDRESS_COMPARE(A, B)   memcmp(A, B, ETH_ALEN)
 
#define AD_AGGREGATOR_SELECTION_TIMER   8
 

Functions

void bond_3ad_initiate_agg_selection (struct bonding *bond, int timeout)
 
void bond_3ad_initialize (struct bonding *bond, u16 tick_resolution)
 
int bond_3ad_bind_slave (struct slave *slave)
 
void bond_3ad_unbind_slave (struct slave *slave)
 
void bond_3ad_state_machine_handler (struct work_struct *work)
 
void bond_3ad_adapter_speed_changed (struct slave *slave)
 
void bond_3ad_adapter_duplex_changed (struct slave *slave)
 
void bond_3ad_handle_link_change (struct slave *slave, char link)
 
int bond_3ad_set_carrier (struct bonding *bond)
 
int bond_3ad_get_active_agg_info (struct bonding *bond, struct ad_info *ad_info)
 
int bond_3ad_xmit_xor (struct sk_buff *skb, struct net_device *dev)
 
int bond_3ad_lacpdu_recv (const struct sk_buff *skb, struct bonding *bond, struct slave *slave)
 
void bond_3ad_update_lacp_rate (struct bonding *bond)
 

Macro Definition Documentation

#define AD_AGGREGATE_WAIT_TIME   2

Definition at line 50 of file bond_3ad.c.

#define AD_AGGREGATOR_SELECTION_TIMER   8

Definition at line 1843 of file bond_3ad.c.

#define AD_CHURN_DETECTION_TIME   60

Definition at line 49 of file bond_3ad.c.

#define AD_COLLECTOR_MAX_DELAY   0

Definition at line 42 of file bond_3ad.c.

#define AD_DUPLEX_KEY_BITS   0x1

Definition at line 81 of file bond_3ad.c.

#define AD_FAST_PERIODIC_TIME   1

Definition at line 45 of file bond_3ad.c.

#define AD_LINK_SPEED_BITMASK_10000MBPS   0x10

Definition at line 90 of file bond_3ad.c.

#define AD_LINK_SPEED_BITMASK_1000MBPS   0x8

Definition at line 89 of file bond_3ad.c.

#define AD_LINK_SPEED_BITMASK_100MBPS   0x4

Definition at line 88 of file bond_3ad.c.

#define AD_LINK_SPEED_BITMASK_10MBPS   0x2

Definition at line 87 of file bond_3ad.c.

#define AD_LINK_SPEED_BITMASK_1MBPS   0x1

Definition at line 86 of file bond_3ad.c.

#define AD_LONG_TIMEOUT   0

Definition at line 39 of file bond_3ad.c.

#define AD_LONG_TIMEOUT_TIME   (3*AD_SLOW_PERIODIC_TIME)

Definition at line 48 of file bond_3ad.c.

#define AD_MAX_TX_IN_SECOND   3

Definition at line 41 of file bond_3ad.c.

#define AD_PORT_ACTOR_CHURN   0x4

Definition at line 65 of file bond_3ad.c.

#define AD_PORT_BEGIN   0x1

Definition at line 63 of file bond_3ad.c.

#define AD_PORT_LACP_ENABLED   0x2

Definition at line 64 of file bond_3ad.c.

#define AD_PORT_MATCHED   0x40

Definition at line 69 of file bond_3ad.c.

#define AD_PORT_MOVED   0x200

Definition at line 72 of file bond_3ad.c.

#define AD_PORT_PARTNER_CHURN   0x8

Definition at line 66 of file bond_3ad.c.

#define AD_PORT_READY   0x10

Definition at line 67 of file bond_3ad.c.

#define AD_PORT_READY_N   0x20

Definition at line 68 of file bond_3ad.c.

#define AD_PORT_SELECTED   0x100

Definition at line 71 of file bond_3ad.c.

#define AD_PORT_STANDBY   0x80

Definition at line 70 of file bond_3ad.c.

#define AD_SHORT_TIMEOUT   1

Definition at line 38 of file bond_3ad.c.

#define AD_SHORT_TIMEOUT_TIME   (3*AD_FAST_PERIODIC_TIME)

Definition at line 47 of file bond_3ad.c.

#define AD_SLOW_PERIODIC_TIME   30

Definition at line 46 of file bond_3ad.c.

#define AD_SPEED_KEY_BITS   0x3E

Definition at line 82 of file bond_3ad.c.

#define AD_STANDBY   0x2

Definition at line 40 of file bond_3ad.c.

#define AD_STATE_AGGREGATION   0x4

Definition at line 55 of file bond_3ad.c.

#define AD_STATE_COLLECTING   0x10

Definition at line 57 of file bond_3ad.c.

#define AD_STATE_DEFAULTED   0x40

Definition at line 59 of file bond_3ad.c.

#define AD_STATE_DISTRIBUTING   0x20

Definition at line 58 of file bond_3ad.c.

#define AD_STATE_EXPIRED   0x80

Definition at line 60 of file bond_3ad.c.

#define AD_STATE_LACP_ACTIVITY   0x1

Definition at line 53 of file bond_3ad.c.

#define AD_STATE_LACP_TIMEOUT   0x2

Definition at line 54 of file bond_3ad.c.

#define AD_STATE_SYNCHRONIZATION   0x8

Definition at line 56 of file bond_3ad.c.

#define AD_USER_KEY_BITS   0xFFC0

Definition at line 83 of file bond_3ad.c.

#define MAC_ADDRESS_COMPARE (   A,
  B 
)    memcmp(A, B, ETH_ALEN)

Definition at line 94 of file bond_3ad.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 23 of file bond_3ad.c.

Function Documentation

void bond_3ad_adapter_duplex_changed ( struct slave slave)

bond_3ad_adapter_duplex_changed - handle a slave's duplex change indication : slave struct to work on

Handle reselection of aggregator (if needed) for this port.

Definition at line 2262 of file bond_3ad.c.

void bond_3ad_adapter_speed_changed ( struct slave slave)

bond_3ad_adapter_speed_changed - handle a slave's speed change indication : slave struct to work on

Handle reselection of aggregator (if needed) for this port.

Definition at line 2234 of file bond_3ad.c.

int bond_3ad_bind_slave ( struct slave slave)

bond_3ad_bind_slave - initialize a slave's port : slave struct to work on

Returns: 0 on success < 0 on error

Definition at line 1893 of file bond_3ad.c.

int bond_3ad_get_active_agg_info ( struct bonding bond,
struct ad_info ad_info 
)

bond_3ad_get_active_agg_info - get information of the active aggregator : bonding struct to work on : ad_info struct to fill with the bond's info

Returns: 0 on success < 0 on error

Definition at line 2371 of file bond_3ad.c.

void bond_3ad_handle_link_change ( struct slave slave,
char  link 
)

bond_3ad_handle_link_change - handle a slave's link status change indication : slave struct to work on : whether the link is now up or down

Handle reselection of aggregator (if needed) for this port.

Definition at line 2291 of file bond_3ad.c.

void bond_3ad_initialize ( struct bonding bond,
u16  tick_resolution 
)

bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures : bonding struct to work on : tick duration (millisecond resolution)

Can be called only after the mac address of the bond is set.

Definition at line 1866 of file bond_3ad.c.

void bond_3ad_initiate_agg_selection ( struct bonding bond,
int  timeout 
)

Definition at line 1852 of file bond_3ad.c.

int bond_3ad_lacpdu_recv ( const struct sk_buff skb,
struct bonding bond,
struct slave slave 
)

Definition at line 2463 of file bond_3ad.c.

int bond_3ad_set_carrier ( struct bonding bond)

Definition at line 2337 of file bond_3ad.c.

void bond_3ad_state_machine_handler ( struct work_struct work)

bond_3ad_state_machine_handler - handle state machines timeout : bonding struct to work on

The state machine handling concept in this module is to check every tick which state machine should operate any function. The execution order is round robin, so when we have an interaction between state machines, the reply of one to each other might be delayed until next tick.

This function also complete the initialization when the agg_select_timer times out, and it selects an aggregator for the ports that are yet not related to any aggregator, and selects the active aggregator for a bond.

Definition at line 2104 of file bond_3ad.c.

void bond_3ad_unbind_slave ( struct slave slave)

bond_3ad_unbind_slave - deinitialize a slave's port : slave struct to work on

Search for the aggregator that is related to this port, remove the aggregator and assign another aggregator for other port related to it (if any), and remove the port.

Definition at line 1961 of file bond_3ad.c.

void bond_3ad_update_lacp_rate ( struct bonding bond)

Definition at line 2490 of file bond_3ad.c.

int bond_3ad_xmit_xor ( struct sk_buff skb,
struct net_device dev 
)

Definition at line 2395 of file bond_3ad.c.