Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (48 commits)
  [PATCH] bonding: update version number
  [PATCH] git-netdev-all: pc300_tty build fix
  [PATCH] Make PC300 WAN driver compile again
  [PATCH] Modularize generic HDLC
  [PATCH] more s2io __iomem annotations
  [PATCH] restore __iomem annotations in e1000
  [PATCH] 64bit bugs in s2io
  [PATCH] bonding: Fix primary selection error at enslavement time
  [PATCH] bonding: Don't mangle LACPDUs
  [PATCH] bonding: Validate probe replies in ARP monitor
  [PATCH] bonding: Don't release slaves when master is admin down
  [PATCH] bonding: Add priv_flag to avoid event mishandling
  [PATCH] bonding: Handle large hard_header_len
  [PATCH] bonding: Remove unneeded NULL test
  [PATCH] bonding: Format fix in seq_printf call
  [PATCH] bonding: Convert delay value from s16 to int
  [PATCH] bonding: Allow bonding to enslave a 10 Gig adapter
  Delete unused drivers/net/gt64240eth.h
  [PATCH] skge: fiber support
  [PATCH] fix possible NULL ptr deref in forcedeth
  ...
  • Loading branch information
Linus Torvalds committed Sep 27, 2006
2 parents ac7f6b5 + 0ba8821 commit a77c64c
Show file tree
Hide file tree
Showing 59 changed files with 1,751 additions and 1,385 deletions.
59 changes: 59 additions & 0 deletions Documentation/networking/bonding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ or, for backwards compatibility, the option value. E.g.,
arp_interval

Specifies the ARP link monitoring frequency in milliseconds.

The ARP monitor works by periodically checking the slave
devices to determine whether they have sent or received
traffic recently (the precise criteria depends upon the
bonding mode, and the state of the slave). Regular traffic is
generated via ARP probes issued for the addresses specified by
the arp_ip_target option.

This behavior can be modified by the arp_validate option,
below.

If ARP monitoring is used in an etherchannel compatible mode
(modes 0 and 2), the switch should be configured in a mode
that evenly distributes packets across all links. If the
Expand All @@ -213,6 +224,54 @@ arp_ip_target
maximum number of targets that can be specified is 16. The
default value is no IP addresses.

arp_validate

Specifies whether or not ARP probes and replies should be
validated in the active-backup mode. This causes the ARP
monitor to examine the incoming ARP requests and replies, and
only consider a slave to be up if it is receiving the
appropriate ARP traffic.

Possible values are:

none or 0

No validation is performed. This is the default.

active or 1

Validation is performed only for the active slave.

backup or 2

Validation is performed only for backup slaves.

all or 3

Validation is performed for all slaves.

For the active slave, the validation checks ARP replies to
confirm that they were generated by an arp_ip_target. Since
backup slaves do not typically receive these replies, the
validation performed for backup slaves is on the ARP request
sent out via the active slave. It is possible that some
switch or network configurations may result in situations
wherein the backup slaves do not receive the ARP requests; in
such a situation, validation of backup slaves must be
disabled.

This option is useful in network configurations in which
multiple bonding hosts are concurrently issuing ARPs to one or
more targets beyond a common switch. Should the link between
the switch and target fail (but not the switch itself), the
probe traffic generated by the multiple bonding instances will
fool the standard ARP monitor into considering the links as
still up. Use of the arp_validate option can resolve this, as
the ARP monitor will only consider ARP requests and replies
associated with its own instance of bonding.

This option was added in bonding version 3.1.0.

downdelay

Specifies the time, in milliseconds, to wait before disabling
Expand Down
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2679,7 +2679,6 @@ M: josejx@gentoo.org
P: Daniel Drake
M: dsd@gentoo.org
W: http://softmac.sipsolutions.net/
L: softmac-dev@sipsolutions.net
L: netdev@vger.kernel.org
S: Maintained

Expand Down
4 changes: 0 additions & 4 deletions drivers/net/acenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ MODULE_DEVICE_TABLE(pci, acenic_pci_tbl);
#define SET_NETDEV_DEV(net, pdev) do{} while(0)
#endif

#if LINUX_VERSION_CODE >= 0x2051c
#define ace_sync_irq(irq) synchronize_irq(irq)
#else
#define ace_sync_irq(irq) synchronize_irq()
#endif

#ifndef offset_in_page
#define offset_in_page(ptr) ((unsigned long)(ptr) & ~PAGE_MASK)
Expand Down
70 changes: 39 additions & 31 deletions drivers/net/bonding/bond_3ad.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
#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
//endalloun

// compare MAC addresses
Expand All @@ -99,7 +100,7 @@ static u16 __get_link_speed(struct port *port);
static u8 __get_duplex(struct port *port);
static inline void __initialize_port_locks(struct port *port);
//conversions
static void __ntohs_lacpdu(struct lacpdu *lacpdu);
static void __htons_lacpdu(struct lacpdu *lacpdu);
static u16 __ad_timer_to_ticks(u16 timer_type, u16 Par);


Expand Down Expand Up @@ -330,7 +331,8 @@ static inline void __release_rx_machine_lock(struct port *port)
* 0,
* %AD_LINK_SPEED_BITMASK_10MBPS,
* %AD_LINK_SPEED_BITMASK_100MBPS,
* %AD_LINK_SPEED_BITMASK_1000MBPS
* %AD_LINK_SPEED_BITMASK_1000MBPS,
* %AD_LINK_SPEED_BITMASK_10000MBPS
*/
static u16 __get_link_speed(struct port *port)
{
Expand All @@ -357,6 +359,10 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_BITMASK_1000MBPS;
break;

case SPEED_10000:
speed = AD_LINK_SPEED_BITMASK_10000MBPS;
break;

default:
speed = 0; // unknown speed value from ethtool. shouldn't happen
break;
Expand Down Expand Up @@ -414,23 +420,23 @@ static inline void __initialize_port_locks(struct port *port)

//conversions
/**
* __ntohs_lacpdu - convert the contents of a LACPDU to host byte order
* __htons_lacpdu - convert the contents of a LACPDU to network byte order
* @lacpdu: the speicifed lacpdu
*
* For each multi-byte field in the lacpdu, convert its content
*/
static void __ntohs_lacpdu(struct lacpdu *lacpdu)
static void __htons_lacpdu(struct lacpdu *lacpdu)
{
if (lacpdu) {
lacpdu->actor_system_priority = ntohs(lacpdu->actor_system_priority);
lacpdu->actor_key = ntohs(lacpdu->actor_key);
lacpdu->actor_port_priority = ntohs(lacpdu->actor_port_priority);
lacpdu->actor_port = ntohs(lacpdu->actor_port);
lacpdu->partner_system_priority = ntohs(lacpdu->partner_system_priority);
lacpdu->partner_key = ntohs(lacpdu->partner_key);
lacpdu->partner_port_priority = ntohs(lacpdu->partner_port_priority);
lacpdu->partner_port = ntohs(lacpdu->partner_port);
lacpdu->collector_max_delay = ntohs(lacpdu->collector_max_delay);
lacpdu->actor_system_priority = htons(lacpdu->actor_system_priority);
lacpdu->actor_key = htons(lacpdu->actor_key);
lacpdu->actor_port_priority = htons(lacpdu->actor_port_priority);
lacpdu->actor_port = htons(lacpdu->actor_port);
lacpdu->partner_system_priority = htons(lacpdu->partner_system_priority);
lacpdu->partner_key = htons(lacpdu->partner_key);
lacpdu->partner_port_priority = htons(lacpdu->partner_port_priority);
lacpdu->partner_port = htons(lacpdu->partner_port);
lacpdu->collector_max_delay = htons(lacpdu->collector_max_delay);
}
}

Expand Down Expand Up @@ -490,11 +496,11 @@ static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
// validate lacpdu and port
if (lacpdu && port) {
// record the new parameter values for the partner operational
port->partner_oper_port_number = lacpdu->actor_port;
port->partner_oper_port_priority = lacpdu->actor_port_priority;
port->partner_oper_port_number = ntohs(lacpdu->actor_port);
port->partner_oper_port_priority = ntohs(lacpdu->actor_port_priority);
port->partner_oper_system = lacpdu->actor_system;
port->partner_oper_system_priority = lacpdu->actor_system_priority;
port->partner_oper_key = lacpdu->actor_key;
port->partner_oper_system_priority = ntohs(lacpdu->actor_system_priority);
port->partner_oper_key = ntohs(lacpdu->actor_key);
// zero partener's lase states
port->partner_oper_port_state = 0;
port->partner_oper_port_state |= (lacpdu->actor_state & AD_STATE_LACP_ACTIVITY);
Expand Down Expand Up @@ -561,11 +567,11 @@ static void __update_selected(struct lacpdu *lacpdu, struct port *port)
// validate lacpdu and port
if (lacpdu && port) {
// check if any parameter is different
if ((lacpdu->actor_port != port->partner_oper_port_number) ||
(lacpdu->actor_port_priority != port->partner_oper_port_priority) ||
if ((ntohs(lacpdu->actor_port) != port->partner_oper_port_number) ||
(ntohs(lacpdu->actor_port_priority) != port->partner_oper_port_priority) ||
MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->partner_oper_system)) ||
(lacpdu->actor_system_priority != port->partner_oper_system_priority) ||
(lacpdu->actor_key != port->partner_oper_key) ||
(ntohs(lacpdu->actor_system_priority) != port->partner_oper_system_priority) ||
(ntohs(lacpdu->actor_key) != port->partner_oper_key) ||
((lacpdu->actor_state & AD_STATE_AGGREGATION) != (port->partner_oper_port_state & AD_STATE_AGGREGATION))
) {
// update the state machine Selected variable
Expand Down Expand Up @@ -628,11 +634,11 @@ static void __choose_matched(struct lacpdu *lacpdu, struct port *port)
// validate lacpdu and port
if (lacpdu && port) {
// check if all parameters are alike
if (((lacpdu->partner_port == port->actor_port_number) &&
(lacpdu->partner_port_priority == port->actor_port_priority) &&
if (((ntohs(lacpdu->partner_port) == port->actor_port_number) &&
(ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) &&
!MAC_ADDRESS_COMPARE(&(lacpdu->partner_system), &(port->actor_system)) &&
(lacpdu->partner_system_priority == port->actor_system_priority) &&
(lacpdu->partner_key == port->actor_oper_port_key) &&
(ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) &&
(ntohs(lacpdu->partner_key) == port->actor_oper_port_key) &&
((lacpdu->partner_state & AD_STATE_AGGREGATION) == (port->actor_oper_port_state & AD_STATE_AGGREGATION))) ||
// or this is individual link(aggregation == FALSE)
((lacpdu->actor_state & AD_STATE_AGGREGATION) == 0)
Expand Down Expand Up @@ -662,11 +668,11 @@ static void __update_ntt(struct lacpdu *lacpdu, struct port *port)
// validate lacpdu and port
if (lacpdu && port) {
// check if any parameter is different
if ((lacpdu->partner_port != port->actor_port_number) ||
(lacpdu->partner_port_priority != port->actor_port_priority) ||
if ((ntohs(lacpdu->partner_port) != port->actor_port_number) ||
(ntohs(lacpdu->partner_port_priority) != port->actor_port_priority) ||
MAC_ADDRESS_COMPARE(&(lacpdu->partner_system), &(port->actor_system)) ||
(lacpdu->partner_system_priority != port->actor_system_priority) ||
(lacpdu->partner_key != port->actor_oper_port_key) ||
(ntohs(lacpdu->partner_system_priority) != port->actor_system_priority) ||
(ntohs(lacpdu->partner_key) != port->actor_oper_port_key) ||
((lacpdu->partner_state & AD_STATE_LACP_ACTIVITY) != (port->actor_oper_port_state & AD_STATE_LACP_ACTIVITY)) ||
((lacpdu->partner_state & AD_STATE_LACP_TIMEOUT) != (port->actor_oper_port_state & AD_STATE_LACP_TIMEOUT)) ||
((lacpdu->partner_state & AD_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & AD_STATE_SYNCHRONIZATION)) ||
Expand Down Expand Up @@ -775,6 +781,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_BITMASK_1000MBPS:
bandwidth = aggregator->num_of_ports * 1000;
break;
case AD_LINK_SPEED_BITMASK_10000MBPS:
bandwidth = aggregator->num_of_ports * 10000;
break;
default:
bandwidth=0; // to silent the compilor ....
}
Expand Down Expand Up @@ -847,7 +856,7 @@ static inline void __update_lacpdu_from_port(struct port *port)
*/

/* Convert all non u8 parameters to Big Endian for transmit */
__ntohs_lacpdu(lacpdu);
__htons_lacpdu(lacpdu);
}

//////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -2171,7 +2180,6 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u

switch (lacpdu->subtype) {
case AD_TYPE_LACPDU:
__ntohs_lacpdu(lacpdu);
dprintk("Received LACPDU on port %d\n", port->actor_port_number);
ad_rx_machine(lacpdu, port);
break;
Expand Down
Loading

0 comments on commit a77c64c

Please sign in to comment.