Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194787
b: refs/heads/master
c: d9d52b5
h: refs/heads/master
i:
  194785: 7bf3b9f
  194783: e4299ad
v: v3
  • Loading branch information
Michael S. Tsirkin committed May 3, 2010
1 parent 3e490a5 commit a1232c4
Show file tree
Hide file tree
Showing 195 changed files with 2,013 additions and 5,991 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2873957df0ead5b53fa00fddfb52ca3df38af4a9
refs/heads/master: d9d52b5178af586d679c1052fb161ee05ea2e83f
1 change: 0 additions & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3956,7 +3956,6 @@ F: net/rfkill/
F: net/wireless/
F: include/net/ieee80211*
F: include/linux/wireless.h
F: include/linux/iw_handler.h
F: drivers/net/wireless/

NETWORKING DRIVERS
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,20 @@ config FORCEDETH
To compile this driver as a module, choose M here. The module
will be called forcedeth.

config FORCEDETH_NAPI
bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"
depends on FORCEDETH && EXPERIMENTAL
help
NAPI is a new driver API designed to reduce CPU and interrupt load
when the driver is receiving lots of packets from the card. It is
still somewhat experimental and thus not yet enabled by default.

If your estimated Rx load is 10kpps or more, or if the card will be
deployed on potentially unfriendly networks (e.g. in a firewall),
then say Y here.

If in doubt, say N.

config CS89x0
tristate "CS89x0 support"
depends on NET_ETHERNET && (ISA || EISA || MACH_IXDP2351 \
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)

skb->protocol = eth_type_trans(skb, bp->dev);

if ((bp->dev->features & NETIF_F_RXHASH) &&
if ((bp->dev->features & ETH_FLAG_RXHASH) &&
(cqe_fp_status_flags &
ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG))
skb->rxhash = le32_to_cpu(
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/net/e1000/e1000_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@ static int e1000_get_coalesce(struct net_device *netdev,
if (adapter->hw.mac_type < e1000_82545)
return -EOPNOTSUPP;

if (adapter->itr_setting <= 4)
if (adapter->itr_setting <= 3)
ec->rx_coalesce_usecs = adapter->itr_setting;
else
ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting;
Expand All @@ -1826,14 +1826,12 @@ static int e1000_set_coalesce(struct net_device *netdev,
return -EOPNOTSUPP;

if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) ||
((ec->rx_coalesce_usecs > 4) &&
((ec->rx_coalesce_usecs > 3) &&
(ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) ||
(ec->rx_coalesce_usecs == 2))
return -EINVAL;

if (ec->rx_coalesce_usecs == 4) {
adapter->itr = adapter->itr_setting = 4;
} else if (ec->rx_coalesce_usecs <= 3) {
if (ec->rx_coalesce_usecs <= 3) {
adapter->itr = 20000;
adapter->itr_setting = ec->rx_coalesce_usecs;
} else {
Expand Down
18 changes: 1 addition & 17 deletions trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

char e1000_driver_name[] = "e1000";
static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
#define DRV_VERSION "7.3.21-k6-NAPI"
#define DRV_VERSION "7.3.21-k5-NAPI"
const char e1000_driver_version[] = DRV_VERSION;
static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";

Expand Down Expand Up @@ -2386,22 +2386,6 @@ static void e1000_watchdog(unsigned long data)
}
}

/* Simple mode for Interrupt Throttle Rate (ITR) */
if (hw->mac_type >= e1000_82540 && adapter->itr_setting == 4) {
/*
* Symmetric Tx/Rx gets a reduced ITR=2000;
* Total asymmetrical Tx or Rx gets ITR=8000;
* everyone else is between 2000-8000.
*/
u32 goc = (adapter->gotcl + adapter->gorcl) / 10000;
u32 dif = (adapter->gotcl > adapter->gorcl ?
adapter->gotcl - adapter->gorcl :
adapter->gorcl - adapter->gotcl) / 10000;
u32 itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000;

ew32(ITR, 1000000000 / (itr * 256));
}

/* Cause software interrupt to ensure rx ring is cleaned */
ew32(ICS, E1000_ICS_RXDMT0);

Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/net/e1000/e1000_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,17 +484,11 @@ void __devinit e1000_check_options(struct e1000_adapter *adapter)
adapter->itr_setting = adapter->itr;
adapter->itr = 20000;
break;
case 4:
e_dev_info("%s set to simplified "
"(2000-8000) ints mode\n", opt.name);
adapter->itr_setting = adapter->itr;
break;
default:
e1000_validate_option(&adapter->itr, &opt,
adapter);
/* save the setting, because the dynamic bits
* change itr.
* clear the lower two bits because they are
/* save the setting, because the dynamic bits change itr */
/* clear the lower two bits because they are
* used as control */
adapter->itr_setting = adapter->itr & ~3;
break;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/e1000e/82571.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ struct e1000_info e1000_82574_info = {
| FLAG_HAS_SMART_POWER_DOWN
| FLAG_HAS_AMT
| FLAG_HAS_CTRLEXT_ON_LOAD,
.pba = 36,
.pba = 20,
.max_hw_frame_size = DEFAULT_JUMBO,
.get_variants = e1000_get_variants_82571,
.mac_ops = &e82571_mac_ops,
Expand All @@ -1862,7 +1862,7 @@ struct e1000_info e1000_82583_info = {
| FLAG_HAS_SMART_POWER_DOWN
| FLAG_HAS_AMT
| FLAG_HAS_CTRLEXT_ON_LOAD,
.pba = 36,
.pba = 20,
.max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN,
.get_variants = e1000_get_variants_82571,
.mac_ops = &e82571_mac_ops,
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/e1000e/e1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ struct e1000_buffer {
unsigned long time_stamp;
u16 length;
u16 next_to_watch;
unsigned int segs;
unsigned int bytecount;
u16 mapped_as_page;
};
/* Rx */
Expand Down
9 changes: 4 additions & 5 deletions trunk/drivers/net/e1000e/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ static int e1000_set_tso(struct net_device *netdev, u32 data)
netdev->features &= ~NETIF_F_TSO6;
}

e_info("TSO is %s\n", data ? "Enabled" : "Disabled");
adapter->flags |= FLAG_TSO_FORCE;
return 0;
}
Expand Down Expand Up @@ -1890,7 +1891,7 @@ static int e1000_get_coalesce(struct net_device *netdev,
{
struct e1000_adapter *adapter = netdev_priv(netdev);

if (adapter->itr_setting <= 4)
if (adapter->itr_setting <= 3)
ec->rx_coalesce_usecs = adapter->itr_setting;
else
ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting;
Expand All @@ -1905,14 +1906,12 @@ static int e1000_set_coalesce(struct net_device *netdev,
struct e1000_hw *hw = &adapter->hw;

if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) ||
((ec->rx_coalesce_usecs > 4) &&
((ec->rx_coalesce_usecs > 3) &&
(ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) ||
(ec->rx_coalesce_usecs == 2))
return -EINVAL;

if (ec->rx_coalesce_usecs == 4) {
adapter->itr = adapter->itr_setting = 4;
} else if (ec->rx_coalesce_usecs <= 3) {
if (ec->rx_coalesce_usecs <= 3) {
adapter->itr = 20000;
adapter->itr_setting = ec->rx_coalesce_usecs;
} else {
Expand Down
95 changes: 44 additions & 51 deletions trunk/drivers/net/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

#include "e1000.h"

#define DRV_VERSION "1.0.2-k4"
#define DRV_VERSION "1.0.2-k2"
char e1000e_driver_name[] = "e1000e";
const char e1000e_driver_version[] = DRV_VERSION;

Expand Down Expand Up @@ -548,23 +548,26 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
rx_desc = E1000_RX_DESC(*rx_ring, i);
rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);

if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) {
/*
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs,
* such as IA-64).
*/
wmb();
writel(i, adapter->hw.hw_addr + rx_ring->tail);
}
i++;
if (i == rx_ring->count)
i = 0;
buffer_info = &rx_ring->buffer_info[i];
}

rx_ring->next_to_use = i;
if (rx_ring->next_to_use != i) {
rx_ring->next_to_use = i;
if (i-- == 0)
i = (rx_ring->count - 1);

/*
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs,
* such as IA-64).
*/
wmb();
writel(i, adapter->hw.hw_addr + rx_ring->tail);
}
}

/**
Expand Down Expand Up @@ -646,25 +649,33 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,

rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma);

if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) {
/*
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs,
* such as IA-64).
*/
wmb();
writel(i<<1, adapter->hw.hw_addr + rx_ring->tail);
}

i++;
if (i == rx_ring->count)
i = 0;
buffer_info = &rx_ring->buffer_info[i];
}

no_buffers:
rx_ring->next_to_use = i;
if (rx_ring->next_to_use != i) {
rx_ring->next_to_use = i;

if (!(i--))
i = (rx_ring->count - 1);

/*
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs,
* such as IA-64).
*/
wmb();
/*
* Hardware increments by 16 bytes, but packet split
* descriptors are 32 bytes...so we increment tail
* twice as much.
*/
writel(i<<1, adapter->hw.hw_addr + rx_ring->tail);
}
}

/**
Expand Down Expand Up @@ -990,8 +1001,14 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
cleaned = (i == eop);

if (cleaned) {
total_tx_packets += buffer_info->segs;
total_tx_bytes += buffer_info->bytecount;
struct sk_buff *skb = buffer_info->skb;
unsigned int segs, bytecount;
segs = skb_shinfo(skb)->gso_segs ?: 1;
/* multiply data chunks by size of headers */
bytecount = ((segs - 1) * skb_headlen(skb)) +
skb->len;
total_tx_packets += segs;
total_tx_bytes += bytecount;
}

e1000_put_txbuf(adapter, buffer_info);
Expand Down Expand Up @@ -4070,22 +4087,6 @@ static void e1000_watchdog_task(struct work_struct *work)
}
}

/* Simple mode for Interrupt Throttle Rate (ITR) */
if (adapter->itr_setting == 4) {
/*
* Symmetric Tx/Rx gets a reduced ITR=2000;
* Total asymmetrical Tx or Rx gets ITR=8000;
* everyone else is between 2000-8000.
*/
u32 goc = (adapter->gotc + adapter->gorc) / 10000;
u32 dif = (adapter->gotc > adapter->gorc ?
adapter->gotc - adapter->gorc :
adapter->gorc - adapter->gotc) / 10000;
u32 itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000;

ew32(ITR, 1000000000 / (itr * 256));
}

/* Cause software interrupt to ensure Rx ring is cleaned */
if (adapter->msix_entries)
ew32(ICS, adapter->rx_ring->ims_val);
Expand Down Expand Up @@ -4260,7 +4261,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
struct e1000_buffer *buffer_info;
unsigned int len = skb_headlen(skb);
unsigned int offset = 0, size, count = 0, i;
unsigned int f, bytecount, segs;
unsigned int f;

i = tx_ring->next_to_use;

Expand Down Expand Up @@ -4320,13 +4321,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
}
}

segs = skb_shinfo(skb)->gso_segs ?: 1;
/* multiply data chunks by size of headers */
bytecount = ((segs - 1) * skb_headlen(skb)) + skb->len;

tx_ring->buffer_info[i].skb = skb;
tx_ring->buffer_info[i].segs = segs;
tx_ring->buffer_info[i].bytecount = bytecount;
tx_ring->buffer_info[first].next_to_watch = i;

return count;
Expand Down Expand Up @@ -5456,8 +5451,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev,

SET_NETDEV_DEV(netdev, &pdev->dev);

netdev->irq = pdev->irq;

pci_set_drvdata(pdev, netdev);
adapter = netdev_priv(netdev);
hw = &adapter->hw;
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/net/e1000e/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,6 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
adapter->itr_setting = adapter->itr;
adapter->itr = 20000;
break;
case 4:
e_info("%s set to simplified (2000-8000 ints) "
"mode\n", opt.name);
adapter->itr_setting = 4;
break;
default:
/*
* Save the setting, because the dynamic bits
Expand Down
Loading

0 comments on commit a1232c4

Please sign in to comment.