Skip to content

Commit

Permalink
Merge branch 'davem-next' of master.kernel.org:/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/jgarzik/netdev-2.6
  • Loading branch information
David S. Miller committed Nov 2, 2008
2 parents 8ba25da + 3f8b4b1 commit 2a6cf35
Show file tree
Hide file tree
Showing 15 changed files with 219 additions and 104 deletions.
16 changes: 9 additions & 7 deletions Documentation/networking/bonding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -922,25 +922,27 @@ USERCTL=no
NETMASK, NETWORK and BROADCAST) to match your network configuration.

For later versions of initscripts, such as that found with Fedora
7 and Red Hat Enterprise Linux version 5 (or later), it is possible, and,
indeed, preferable, to specify the bonding options in the ifcfg-bond0
7 (or later) and Red Hat Enterprise Linux version 5 (or later), it is possible,
and, indeed, preferable, to specify the bonding options in the ifcfg-bond0
file, e.g. a line of the format:

BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=+192.168.1.254"
BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=192.168.1.254"

will configure the bond with the specified options. The options
specified in BONDING_OPTS are identical to the bonding module parameters
except for the arp_ip_target field. Each target should be included as a
separate option and should be preceded by a '+' to indicate it should be
added to the list of queried targets, e.g.,
except for the arp_ip_target field when using versions of initscripts older
than and 8.57 (Fedora 8) and 8.45.19 (Red Hat Enterprise Linux 5.2). When
using older versions each target should be included as a separate option and
should be preceded by a '+' to indicate it should be added to the list of
queried targets, e.g.,

arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2

is the proper syntax to specify multiple targets. When specifying
options via BONDING_OPTS, it is not necessary to edit /etc/modules.conf or
/etc/modprobe.conf.

For older versions of initscripts that do not support
For even older versions of initscripts that do not support
BONDING_OPTS, it is necessary to edit /etc/modules.conf (or
/etc/modprobe.conf, depending upon your distro) to load the bonding module
with your desired options when the bond0 interface is brought up. The
Expand Down
68 changes: 25 additions & 43 deletions drivers/net/atlx/atl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,8 @@ static u32 atl1_check_link(struct atl1_adapter *adapter)
/* auto-neg, insert timer to re-config phy */
if (!adapter->phy_timer_pending) {
adapter->phy_timer_pending = true;
mod_timer(&adapter->phy_config_timer, jiffies + 3 * HZ);
mod_timer(&adapter->phy_config_timer,
round_jiffies(jiffies + 3 * HZ));
}

return 0;
Expand Down Expand Up @@ -1662,6 +1663,7 @@ static void atl1_via_workaround(struct atl1_adapter *adapter)

static void atl1_inc_smb(struct atl1_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
struct stats_msg_block *smb = adapter->smb.smb;

/* Fill out the OS statistics structure */
Expand Down Expand Up @@ -1704,30 +1706,30 @@ static void atl1_inc_smb(struct atl1_adapter *adapter)
adapter->soft_stats.tx_trunc += smb->tx_trunc;
adapter->soft_stats.tx_pause += smb->tx_pause;

adapter->net_stats.rx_packets = adapter->soft_stats.rx_packets;
adapter->net_stats.tx_packets = adapter->soft_stats.tx_packets;
adapter->net_stats.rx_bytes = adapter->soft_stats.rx_bytes;
adapter->net_stats.tx_bytes = adapter->soft_stats.tx_bytes;
adapter->net_stats.multicast = adapter->soft_stats.multicast;
adapter->net_stats.collisions = adapter->soft_stats.collisions;
adapter->net_stats.rx_errors = adapter->soft_stats.rx_errors;
adapter->net_stats.rx_over_errors =
netdev->stats.rx_packets = adapter->soft_stats.rx_packets;
netdev->stats.tx_packets = adapter->soft_stats.tx_packets;
netdev->stats.rx_bytes = adapter->soft_stats.rx_bytes;
netdev->stats.tx_bytes = adapter->soft_stats.tx_bytes;
netdev->stats.multicast = adapter->soft_stats.multicast;
netdev->stats.collisions = adapter->soft_stats.collisions;
netdev->stats.rx_errors = adapter->soft_stats.rx_errors;
netdev->stats.rx_over_errors =
adapter->soft_stats.rx_missed_errors;
adapter->net_stats.rx_length_errors =
netdev->stats.rx_length_errors =
adapter->soft_stats.rx_length_errors;
adapter->net_stats.rx_crc_errors = adapter->soft_stats.rx_crc_errors;
adapter->net_stats.rx_frame_errors =
netdev->stats.rx_crc_errors = adapter->soft_stats.rx_crc_errors;
netdev->stats.rx_frame_errors =
adapter->soft_stats.rx_frame_errors;
adapter->net_stats.rx_fifo_errors = adapter->soft_stats.rx_fifo_errors;
adapter->net_stats.rx_missed_errors =
netdev->stats.rx_fifo_errors = adapter->soft_stats.rx_fifo_errors;
netdev->stats.rx_missed_errors =
adapter->soft_stats.rx_missed_errors;
adapter->net_stats.tx_errors = adapter->soft_stats.tx_errors;
adapter->net_stats.tx_fifo_errors = adapter->soft_stats.tx_fifo_errors;
adapter->net_stats.tx_aborted_errors =
netdev->stats.tx_errors = adapter->soft_stats.tx_errors;
netdev->stats.tx_fifo_errors = adapter->soft_stats.tx_fifo_errors;
netdev->stats.tx_aborted_errors =
adapter->soft_stats.tx_aborted_errors;
adapter->net_stats.tx_window_errors =
netdev->stats.tx_window_errors =
adapter->soft_stats.tx_window_errors;
adapter->net_stats.tx_carrier_errors =
netdev->stats.tx_carrier_errors =
adapter->soft_stats.tx_carrier_errors;
}

Expand Down Expand Up @@ -1860,7 +1862,7 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter *adapter)
adapter->rx_buffer_len + NET_IP_ALIGN);
if (unlikely(!skb)) {
/* Better luck next round */
adapter->net_stats.rx_dropped++;
adapter->netdev->stats.rx_dropped++;
break;
}

Expand Down Expand Up @@ -2524,17 +2526,6 @@ static irqreturn_t atl1_intr(int irq, void *data)
return IRQ_HANDLED;
}

/*
* atl1_watchdog - Timer Call-back
* @data: pointer to netdev cast into an unsigned long
*/
static void atl1_watchdog(unsigned long data)
{
struct atl1_adapter *adapter = (struct atl1_adapter *)data;

/* Reset the timer */
mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ);
}

/*
* atl1_phy_config - Timer Call-back
Expand Down Expand Up @@ -2607,7 +2598,6 @@ static s32 atl1_up(struct atl1_adapter *adapter)
if (unlikely(err))
goto err_up;

mod_timer(&adapter->watchdog_timer, jiffies);
atlx_irq_enable(adapter);
atl1_check_link(adapter);
netif_start_queue(netdev);
Expand All @@ -2625,7 +2615,6 @@ static void atl1_down(struct atl1_adapter *adapter)
struct net_device *netdev = adapter->netdev;

netif_stop_queue(netdev);
del_timer_sync(&adapter->watchdog_timer);
del_timer_sync(&adapter->phy_config_timer);
adapter->phy_timer_pending = false;

Expand Down Expand Up @@ -2983,7 +2972,7 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
netdev->open = &atl1_open;
netdev->stop = &atl1_close;
netdev->hard_start_xmit = &atl1_xmit_frame;
netdev->get_stats = &atlx_get_stats;

netdev->set_multicast_list = &atlx_set_multi;
netdev->set_mac_address = &atl1_set_mac;
netdev->change_mtu = &atl1_change_mtu;
Expand Down Expand Up @@ -3049,13 +3038,8 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
netif_carrier_off(netdev);
netif_stop_queue(netdev);

init_timer(&adapter->watchdog_timer);
adapter->watchdog_timer.function = &atl1_watchdog;
adapter->watchdog_timer.data = (unsigned long)adapter;

init_timer(&adapter->phy_config_timer);
adapter->phy_config_timer.function = &atl1_phy_config;
adapter->phy_config_timer.data = (unsigned long)adapter;
setup_timer(&adapter->phy_config_timer, &atl1_phy_config,
(unsigned long)adapter);
adapter->phy_timer_pending = false;

INIT_WORK(&adapter->tx_timeout_task, atl1_tx_timeout_task);
Expand Down Expand Up @@ -3173,8 +3157,6 @@ static struct atl1_stats atl1_gstrings_stats[] = {
{"tx_bytes", ATL1_STAT(soft_stats.tx_bytes)},
{"rx_errors", ATL1_STAT(soft_stats.rx_errors)},
{"tx_errors", ATL1_STAT(soft_stats.tx_errors)},
{"rx_dropped", ATL1_STAT(net_stats.rx_dropped)},
{"tx_dropped", ATL1_STAT(net_stats.tx_dropped)},
{"multicast", ATL1_STAT(soft_stats.multicast)},
{"collisions", ATL1_STAT(soft_stats.collisions)},
{"rx_length_errors", ATL1_STAT(soft_stats.rx_length_errors)},
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/atlx/atl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ struct atl1_hw {
struct atl1_adapter {
struct net_device *netdev;
struct pci_dev *pdev;
struct net_device_stats net_stats;

struct atl1_sft_stats soft_stats;
struct vlan_group *vlgrp;
u32 rx_buffer_len;
Expand All @@ -765,7 +765,7 @@ struct atl1_adapter {
struct work_struct tx_timeout_task;
struct work_struct link_chg_task;
struct work_struct pcie_dma_to_rst_task;
struct timer_list watchdog_timer;

struct timer_list phy_config_timer;
bool phy_timer_pending;

Expand Down
63 changes: 27 additions & 36 deletions drivers/net/atlx/atl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static void atl2_intr_rx(struct atl2_adapter *adapter)
* Check that some rx space is free. If not,
* free one and mark stats->rx_dropped++.
*/
adapter->net_stats.rx_dropped++;
netdev->stats.rx_dropped++;
break;
}
skb_reserve(skb, NET_IP_ALIGN);
Expand All @@ -435,20 +435,20 @@ static void atl2_intr_rx(struct atl2_adapter *adapter)
} else
#endif
netif_rx(skb);
adapter->net_stats.rx_bytes += rx_size;
adapter->net_stats.rx_packets++;
netdev->stats.rx_bytes += rx_size;
netdev->stats.rx_packets++;
netdev->last_rx = jiffies;
} else {
adapter->net_stats.rx_errors++;
netdev->stats.rx_errors++;

if (rxd->status.ok && rxd->status.pkt_size <= 60)
adapter->net_stats.rx_length_errors++;
netdev->stats.rx_length_errors++;
if (rxd->status.mcast)
adapter->net_stats.multicast++;
netdev->stats.multicast++;
if (rxd->status.crc)
adapter->net_stats.rx_crc_errors++;
netdev->stats.rx_crc_errors++;
if (rxd->status.align)
adapter->net_stats.rx_frame_errors++;
netdev->stats.rx_frame_errors++;
}

/* advance write ptr */
Expand All @@ -463,6 +463,7 @@ static void atl2_intr_rx(struct atl2_adapter *adapter)

static void atl2_intr_tx(struct atl2_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
u32 txd_read_ptr;
u32 txs_write_ptr;
struct tx_pkt_status *txs;
Expand Down Expand Up @@ -522,20 +523,20 @@ static void atl2_intr_tx(struct atl2_adapter *adapter)

/* tx statistics: */
if (txs->ok) {
adapter->net_stats.tx_bytes += txs->pkt_size;
adapter->net_stats.tx_packets++;
netdev->stats.tx_bytes += txs->pkt_size;
netdev->stats.tx_packets++;
}
else
adapter->net_stats.tx_errors++;
netdev->stats.tx_errors++;

if (txs->defer)
adapter->net_stats.collisions++;
netdev->stats.collisions++;
if (txs->abort_col)
adapter->net_stats.tx_aborted_errors++;
netdev->stats.tx_aborted_errors++;
if (txs->late_col)
adapter->net_stats.tx_window_errors++;
netdev->stats.tx_window_errors++;
if (txs->underun)
adapter->net_stats.tx_fifo_errors++;
netdev->stats.tx_fifo_errors++;
} while (1);

if (free_hole) {
Expand Down Expand Up @@ -621,7 +622,7 @@ static irqreturn_t atl2_intr(int irq, void *data)

/* link event */
if (status & (ISR_PHY | ISR_MANUAL)) {
adapter->net_stats.tx_carrier_errors++;
adapter->netdev->stats.tx_carrier_errors++;
atl2_check_for_link(adapter);
}

Expand Down Expand Up @@ -723,7 +724,7 @@ static int atl2_open(struct net_device *netdev)

clear_bit(__ATL2_DOWN, &adapter->flags);

mod_timer(&adapter->watchdog_timer, jiffies + 4*HZ);
mod_timer(&adapter->watchdog_timer, round_jiffies(jiffies + 4*HZ));

val = ATL2_READ_REG(&adapter->hw, REG_MASTER_CTRL);
ATL2_WRITE_REG(&adapter->hw, REG_MASTER_CTRL,
Expand Down Expand Up @@ -899,19 +900,6 @@ static int atl2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
return NETDEV_TX_OK;
}

/*
* atl2_get_stats - Get System Network Statistics
* @netdev: network interface device structure
*
* Returns the address of the device statistics structure.
* The statistics are actually updated from the timer callback.
*/
static struct net_device_stats *atl2_get_stats(struct net_device *netdev)
{
struct atl2_adapter *adapter = netdev_priv(netdev);
return &adapter->net_stats;
}

/*
* atl2_change_mtu - Change the Maximum Transfer Unit
* @netdev: network interface device structure
Expand Down Expand Up @@ -1050,18 +1038,21 @@ static void atl2_tx_timeout(struct net_device *netdev)
static void atl2_watchdog(unsigned long data)
{
struct atl2_adapter *adapter = (struct atl2_adapter *) data;
u32 drop_rxd, drop_rxs;
unsigned long flags;

if (!test_bit(__ATL2_DOWN, &adapter->flags)) {
u32 drop_rxd, drop_rxs;
unsigned long flags;

spin_lock_irqsave(&adapter->stats_lock, flags);
drop_rxd = ATL2_READ_REG(&adapter->hw, REG_STS_RXD_OV);
drop_rxs = ATL2_READ_REG(&adapter->hw, REG_STS_RXS_OV);
adapter->net_stats.rx_over_errors += (drop_rxd+drop_rxs);
spin_unlock_irqrestore(&adapter->stats_lock, flags);

adapter->netdev->stats.rx_over_errors += drop_rxd + drop_rxs;

/* Reset the timer */
mod_timer(&adapter->watchdog_timer, jiffies + 4 * HZ);
mod_timer(&adapter->watchdog_timer,
round_jiffies(jiffies + 4 * HZ));
}
}

Expand Down Expand Up @@ -1265,7 +1256,8 @@ static int atl2_check_link(struct atl2_adapter *adapter)
* (if interval smaller than 5 seconds, something strange) */
if (!test_bit(__ATL2_DOWN, &adapter->flags)) {
if (!test_and_set_bit(0, &adapter->cfg_phy))
mod_timer(&adapter->phy_config_timer, jiffies + 5 * HZ);
mod_timer(&adapter->phy_config_timer,
round_jiffies(jiffies + 5 * HZ));
}

return 0;
Expand Down Expand Up @@ -1396,7 +1388,6 @@ static int __devinit atl2_probe(struct pci_dev *pdev,
netdev->open = &atl2_open;
netdev->stop = &atl2_close;
netdev->hard_start_xmit = &atl2_xmit_frame;
netdev->get_stats = &atl2_get_stats;
netdev->set_multicast_list = &atl2_set_multi;
netdev->set_mac_address = &atl2_set_mac;
netdev->change_mtu = &atl2_change_mtu;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/atlx/atl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ struct atl2_adapter {
/* OS defined structs */
struct net_device *netdev;
struct pci_dev *pdev;
struct net_device_stats net_stats;
#ifdef NETIF_F_HW_VLAN_TX
struct vlan_group *vlgrp;
#endif
Expand Down
13 changes: 0 additions & 13 deletions drivers/net/atlx/atlx.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,6 @@ static void atlx_clear_phy_int(struct atlx_adapter *adapter)
spin_unlock_irqrestore(&adapter->lock, flags);
}

/*
* atlx_get_stats - Get System Network Statistics
* @netdev: network interface device structure
*
* Returns the address of the device statistics structure.
* The statistics are actually updated from the timer callback.
*/
static struct net_device_stats *atlx_get_stats(struct net_device *netdev)
{
struct atlx_adapter *adapter = netdev_priv(netdev);
return &adapter->net_stats;
}

/*
* atlx_tx_timeout - Respond to a Tx Hang
* @netdev: network interface device structure
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ struct fe_priv {
* Maximum number of loops until we assume that a bit in the irq mask
* is stuck. Overridable with module param.
*/
static int max_interrupt_work = 5;
static int max_interrupt_work = 15;

/*
* Optimization can be either throuput mode or cpu mode
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ixgbe/ixgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ struct ixgbe_adapter {
#define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 17)
#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18)
#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19)
#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20)
#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22)
#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1 << 23)

Expand Down
Loading

0 comments on commit 2a6cf35

Please sign in to comment.