Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
bonding.h File Reference
#include <linux/timer.h>
#include <linux/proc_fs.h>
#include <linux/if_bonding.h>
#include <linux/cpumask.h>
#include <linux/in6.h>
#include <linux/netpoll.h>
#include <linux/inetdevice.h>
#include "bond_3ad.h"
#include "bond_alb.h"

Go to the source code of this file.

Data Structures

struct  bond_params
 
struct  bond_parm_tbl
 
struct  vlan_entry
 
struct  slave
 
struct  bonding
 
struct  bond_net
 

Macros

#define DRV_VERSION   "3.7.1"
 
#define DRV_RELDATE   "April 27, 2011"
 
#define DRV_NAME   "bonding"
 
#define DRV_DESCRIPTION   "Ethernet Channel Bonding Driver"
 
#define bond_version   DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n"
 
#define BOND_MAX_ARP_TARGETS   16
 
#define IS_UP(dev)
 
#define SLAVE_IS_OK(slave)
 
#define USES_PRIMARY(mode)
 
#define TX_QUEUE_OVERRIDE(mode)
 
#define IOCTL(dev, arg, cmd)
 
#define bond_for_each_slave_from(bond, pos, cnt, start)
 
#define bond_for_each_slave_from_to(bond, pos, cnt, start, stop)
 
#define bond_for_each_slave(bond, pos, cnt)   bond_for_each_slave_from(bond, pos, cnt, (bond)->first_slave)
 
#define block_netpoll_tx()
 
#define unblock_netpoll_tx()
 
#define is_netpoll_tx_blocked(dev)   (0)
 
#define BOND_MAX_MODENAME_LEN   20
 
#define BOND_LINK_NOCHANGE   -1
 
#define bond_slave_get_rcu(dev)   ((struct slave *) rcu_dereference(dev->rx_handler_data))
 
#define BOND_PRI_RESELECT_ALWAYS   0
 
#define BOND_PRI_RESELECT_BETTER   1
 
#define BOND_PRI_RESELECT_FAILURE   2
 
#define BOND_FOM_NONE   0
 
#define BOND_FOM_ACTIVE   1
 
#define BOND_FOM_FOLLOW   2
 
#define BOND_ARP_VALIDATE_NONE   0
 
#define BOND_ARP_VALIDATE_ACTIVE   (1 << BOND_STATE_ACTIVE)
 
#define BOND_ARP_VALIDATE_BACKUP   (1 << BOND_STATE_BACKUP)
 
#define BOND_ARP_VALIDATE_ALL
 

Functions

struct vlan_entrybond_next_vlan (struct bonding *bond, struct vlan_entry *curr)
 
int bond_dev_queue_xmit (struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev)
 
int bond_create (struct net *net, const char *name)
 
int bond_create_sysfs (struct bond_net *net)
 
void bond_destroy_sysfs (struct bond_net *net)
 
void bond_prepare_sysfs_group (struct bonding *bond)
 
int bond_create_slave_symlinks (struct net_device *master, struct net_device *slave)
 
void bond_destroy_slave_symlinks (struct net_device *master, struct net_device *slave)
 
int bond_enslave (struct net_device *bond_dev, struct net_device *slave_dev)
 
int bond_release (struct net_device *bond_dev, struct net_device *slave_dev)
 
void bond_mii_monitor (struct work_struct *)
 
void bond_loadbalance_arp_mon (struct work_struct *)
 
void bond_activebackup_arp_mon (struct work_struct *)
 
void bond_set_mode_ops (struct bonding *bond, int mode)
 
int bond_parse_parm (const char *mode_arg, const struct bond_parm_tbl *tbl)
 
void bond_select_active_slave (struct bonding *bond)
 
void bond_change_active_slave (struct bonding *bond, struct slave *new_active)
 
void bond_create_debugfs (void)
 
void bond_destroy_debugfs (void)
 
void bond_debug_register (struct bonding *bond)
 
void bond_debug_unregister (struct bonding *bond)
 
void bond_debug_reregister (struct bonding *bond)
 
const charbond_mode_name (int mode)
 

Variables

int bond_net_id
 
struct bond_parm_tbl bond_lacp_tbl []
 
struct bond_parm_tbl bond_mode_tbl []
 
struct bond_parm_tbl xmit_hashtype_tbl []
 
struct bond_parm_tbl arp_validate_tbl []
 
struct bond_parm_tbl fail_over_mac_tbl []
 
struct bond_parm_tbl pri_reselect_tbl []
 
struct bond_parm_tbl ad_select_tbl []
 

Macro Definition Documentation

#define block_netpoll_tx ( )

Definition at line 134 of file bonding.h.

#define BOND_ARP_VALIDATE_ACTIVE   (1 << BOND_STATE_ACTIVE)

Definition at line 324 of file bonding.h.

#define BOND_ARP_VALIDATE_ALL
Value:
BOND_ARP_VALIDATE_BACKUP)

Definition at line 326 of file bonding.h.

#define BOND_ARP_VALIDATE_BACKUP   (1 << BOND_STATE_BACKUP)

Definition at line 325 of file bonding.h.

#define BOND_ARP_VALIDATE_NONE   0

Definition at line 323 of file bonding.h.

#define BOND_FOM_ACTIVE   1

Definition at line 320 of file bonding.h.

#define BOND_FOM_FOLLOW   2

Definition at line 321 of file bonding.h.

#define BOND_FOM_NONE   0

Definition at line 319 of file bonding.h.

#define bond_for_each_slave (   bond,
  pos,
  cnt 
)    bond_for_each_slave_from(bond, pos, cnt, (bond)->first_slave)

bond_for_each_slave - iterate the slaves list from head : the bond holding this list. : current slave. : counter for max number of moves

Caller must hold bond->lock

Definition at line 110 of file bonding.h.

#define bond_for_each_slave_from (   bond,
  pos,
  cnt,
  start 
)
Value:
for (cnt = 0, pos = start; \
cnt < (bond)->slave_cnt; \
cnt++, pos = (pos)->next)

bond_for_each_slave_from - iterate the slaves list from a starting point : the bond holding this list. : current slave. : counter for max number of moves : starting point.

Caller must hold bond->lock

Definition at line 82 of file bonding.h.

#define bond_for_each_slave_from_to (   bond,
  pos,
  cnt,
  start,
  stop 
)
Value:
for (cnt = 0, pos = start; \
((cnt < (bond)->slave_cnt) && (pos != (stop)->next)); \
cnt++, pos = (pos)->next)

bond_for_each_slave_from_to - iterate the slaves list from start point to stop point : the bond holding this list. : current slave. : counter for number max of moves : start point. : stop point.

Caller must hold bond->lock

Definition at line 97 of file bonding.h.

#define BOND_LINK_NOCHANGE   -1

Definition at line 202 of file bonding.h.

#define BOND_MAX_ARP_TARGETS   16

Definition at line 35 of file bonding.h.

#define BOND_MAX_MODENAME_LEN   20

Definition at line 166 of file bonding.h.

#define BOND_PRI_RESELECT_ALWAYS   0

Definition at line 315 of file bonding.h.

#define BOND_PRI_RESELECT_BETTER   1

Definition at line 316 of file bonding.h.

#define BOND_PRI_RESELECT_FAILURE   2

Definition at line 317 of file bonding.h.

#define bond_slave_get_rcu (   dev)    ((struct slave *) rcu_dereference(dev->rx_handler_data))

Definition at line 257 of file bonding.h.

#define bond_version   DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n"

Definition at line 33 of file bonding.h.

#define DRV_DESCRIPTION   "Ethernet Channel Bonding Driver"

Definition at line 31 of file bonding.h.

#define DRV_NAME   "bonding"

Definition at line 30 of file bonding.h.

#define DRV_RELDATE   "April 27, 2011"

Definition at line 29 of file bonding.h.

#define DRV_VERSION   "3.7.1"

Definition at line 28 of file bonding.h.

#define IOCTL (   dev,
  arg,
  cmd 
)
Value:
({ \
int res = 0; \
set_fs(get_ds()); \
res = ioctl(dev, arg, cmd); \
set_fs(fs); \
res; })

Definition at line 65 of file bonding.h.

#define is_netpoll_tx_blocked (   dev)    (0)

Definition at line 136 of file bonding.h.

#define IS_UP (   dev)
Value:
((((dev)->flags & IFF_UP) == IFF_UP) && \
netif_running(dev) && \
netif_carrier_ok(dev))

Definition at line 37 of file bonding.h.

#define SLAVE_IS_OK (   slave)
Value:
(((slave)->dev->flags & IFF_UP) && \
netif_running((slave)->dev) && \
((slave)->link == BOND_LINK_UP) && \
bond_is_active_slave(slave))

Definition at line 45 of file bonding.h.

#define TX_QUEUE_OVERRIDE (   mode)
Value:

Definition at line 57 of file bonding.h.

#define unblock_netpoll_tx ( )

Definition at line 135 of file bonding.h.

#define USES_PRIMARY (   mode)
Value:

Definition at line 52 of file bonding.h.

Function Documentation

void bond_activebackup_arp_mon ( struct work_struct )

Definition at line 3171 of file bond_main.c.

void bond_change_active_slave ( struct bonding bond,
struct slave new_active 
)

change_active_interface - change the active slave into the specified one : our bonding struct : the new slave to make the active one

Set the new slave to the bond's settings and unset them on the old curr_active_slave. Setting include flags, mc-list, promiscuity, allmulti, etc.

If 's link state is BOND_LINK_BACK we'll set it to BOND_LINK_UP, because it is apparently the best available slave we have, even though its updelay hasn't timed out yet.

If new_active is not NULL, caller must hold bond->lock for read and curr_slave_lock for write_bh.

Definition at line 1054 of file bond_main.c.

int bond_create ( struct net net,
const char name 
)

Definition at line 4886 of file bond_main.c.

void bond_create_debugfs ( void  )

Definition at line 138 of file bond_debugfs.c.

int bond_create_slave_symlinks ( struct net_device master,
struct net_device slave 
)

Definition at line 171 of file bond_sysfs.c.

int bond_create_sysfs ( struct bond_net net)

Definition at line 1671 of file bond_sysfs.c.

void bond_debug_register ( struct bonding bond)

Definition at line 126 of file bond_debugfs.c.

void bond_debug_reregister ( struct bonding bond)

Definition at line 134 of file bond_debugfs.c.

void bond_debug_unregister ( struct bonding bond)

Definition at line 130 of file bond_debugfs.c.

void bond_destroy_debugfs ( void  )

Definition at line 142 of file bond_debugfs.c.

void bond_destroy_slave_symlinks ( struct net_device master,
struct net_device slave 
)

Definition at line 190 of file bond_sysfs.c.

void bond_destroy_sysfs ( struct bond_net net)

Definition at line 1706 of file bond_sysfs.c.

int bond_dev_queue_xmit ( struct bonding bond,
struct sk_buff skb,
struct net_device slave_dev 
)

bond_dev_queue_xmit - Prepare skb for xmit.

: bond device that got this skb for tx. : hw accel VLAN tagged skb to transmit : slave that is supposed to xmit this skbuff

Definition at line 392 of file bond_main.c.

int bond_enslave ( struct net_device bond_dev,
struct net_device slave_dev 
)

Definition at line 1503 of file bond_main.c.

void bond_loadbalance_arp_mon ( struct work_struct )

Definition at line 2815 of file bond_main.c.

void bond_mii_monitor ( struct work_struct )

Definition at line 2545 of file bond_main.c.

const char* bond_mode_name ( int  mode)

Definition at line 255 of file bond_main.c.

struct vlan_entry* bond_next_vlan ( struct bonding bond,
struct vlan_entry curr 
)
read

bond_next_vlan - safely skip to the next item in the vlans list. : the bond we're working on : item we're advancing from

Returns NULL if list is empty, bond->next_vlan if is NULL, or ->next otherwise (even if it is itself again).

Caller must hold bond->lock

Definition at line 360 of file bond_main.c.

int bond_parse_parm ( const char mode_arg,
const struct bond_parm_tbl tbl 
)

Definition at line 4459 of file bond_main.c.

void bond_prepare_sysfs_group ( struct bonding bond)

Definition at line 1715 of file bond_sysfs.c.

int bond_release ( struct net_device bond_dev,
struct net_device slave_dev 
)

Definition at line 1935 of file bond_main.c.

void bond_select_active_slave ( struct bonding bond)

bond_select_active_slave - select a new active slave, if needed : our bonding struct

This functions should be called when one of the following occurs:

  • The old curr_active_slave has been released or lost its link.
  • The primary_slave has got its link back.
  • A slave has got its link back and there's no old curr_active_slave.

Caller must hold bond->lock for read and curr_slave_lock for write_bh.

Definition at line 1156 of file bond_main.c.

void bond_set_mode_ops ( struct bonding bond,
int  mode 
)

Definition at line 4292 of file bond_main.c.

Variable Documentation

struct bond_parm_tbl ad_select_tbl[]

Definition at line 241 of file bond_main.c.

struct bond_parm_tbl arp_validate_tbl[]

Definition at line 219 of file bond_main.c.

struct bond_parm_tbl bond_lacp_tbl[]

Definition at line 195 of file bond_main.c.

struct bond_parm_tbl bond_mode_tbl[]

Definition at line 201 of file bond_main.c.

int bond_net_id
struct bond_parm_tbl fail_over_mac_tbl[]

Definition at line 227 of file bond_main.c.

struct bond_parm_tbl pri_reselect_tbl[]

Definition at line 234 of file bond_main.c.

struct bond_parm_tbl xmit_hashtype_tbl[]

Definition at line 212 of file bond_main.c.