* [patch 0/7] 2.6.5-bk-netdev - r8169 queue
@ 2004-04-05 21:55 Francois Romieu
2004-04-05 21:56 ` [patch 1/7] " Francois Romieu
2004-04-07 21:13 ` [patch 0/3] 2.6.5-netdev2 - r8169 update Francois Romieu
0 siblings, 2 replies; 14+ messages in thread
From: Francois Romieu @ 2004-04-05 21:55 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
No ack for previous patches. Try #2.
The following serie of patches applies against 2.6.5 + bk-netdev (as found
in 2.6.5-mm1 for instance). It contains:
- r8169-dma-api-resync.patch
resync with the recent DMA api changes (pci_dma_sync_single_for_{cpu/device})
- r8169-ethtool-introduction.patch
lightweight ethtool support
- r8169-missing-static.patch
missing 'static' qualifiers
- r8169-barrier.patch
safety rmb()
- r8169-kill-potential-busy-loop.patch
A similar patch exists in -mm. I like mine better.
- r8169-dac-00.patch
DMA_{32/64}_BIT_MASK thing against include/linux/dma-mapping.h
- r8169-dac-10.patch
DAC changes for (as of now even more) happy owners of x86-64.
It seems to work.
An update of the patch against 2.6.5 is available for testers at:
http://www.fr.zoreil.com/people/francois/misc/20040405-2.6.5-r8169.c-stable.patch
The link loss issue when cable is unplugged is on the TODO.
--
Ueimor
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 1/7] 2.6.5-bk-netdev - r8169 queue
2004-04-05 21:55 [patch 0/7] 2.6.5-bk-netdev - r8169 queue Francois Romieu
@ 2004-04-05 21:56 ` Francois Romieu
2004-04-05 21:57 ` [patch 2/7] " Francois Romieu
2004-04-07 21:13 ` [patch 0/3] 2.6.5-netdev2 - r8169 update Francois Romieu
1 sibling, 1 reply; 14+ messages in thread
From: Francois Romieu @ 2004-04-05 21:56 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
DMA api resync.
drivers/net/r8169.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff -puN drivers/net/r8169.c~r8169-dma-api-resync drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-dma-api-resync 2004-04-05 23:05:27.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:05:27.000000000 +0200
@@ -1429,19 +1429,22 @@ rtl8169_rx_interrupt(struct net_device *
struct RxDesc *desc = tp->RxDescArray + entry;
struct sk_buff *skb = tp->Rx_skbuff[entry];
int pkt_size = (status & 0x00001FFF) - 4;
+ void (*pci_action)(struct pci_dev *, dma_addr_t,
+ size_t, int) = pci_dma_sync_single_for_device;
- pci_dma_sync_single(tp->pci_dev,
- le32_to_cpu(desc->buf_addr),
- RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
+
+ pci_dma_sync_single_for_cpu(tp->pci_dev,
+ le32_to_cpu(desc->buf_addr), RX_BUF_SIZE,
+ PCI_DMA_FROMDEVICE);
if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) {
- pci_unmap_single(tp->pci_dev,
- le32_to_cpu(desc->buf_addr),
- RX_BUF_SIZE,
- PCI_DMA_FROMDEVICE);
+ pci_action = pci_unmap_single;
tp->Rx_skbuff[entry] = NULL;
}
+ pci_action(tp->pci_dev, le32_to_cpu(desc->buf_addr),
+ RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
+
skb_put(skb, pkt_size);
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 2/7] 2.6.5-bk-netdev - r8169 queue
2004-04-05 21:56 ` [patch 1/7] " Francois Romieu
@ 2004-04-05 21:57 ` Francois Romieu
2004-04-05 21:58 ` [patch 3/7] " Francois Romieu
0 siblings, 1 reply; 14+ messages in thread
From: Francois Romieu @ 2004-04-05 21:57 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
ethtool driver info (Krishnakumar R. <krishnakumar@naturesoft.net>).
drivers/net/r8169.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+)
diff -puN drivers/net/r8169.c~r8169-ethtool-introduction drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-ethtool-introduction 2004-04-05 23:05:42.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:05:42.000000000 +0200
@@ -40,6 +40,7 @@ VERSION 1.2 <2002/11/30>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
+#include <linux/ethtool.h>
#include <linux/crc32.h>
#include <linux/init.h>
@@ -382,6 +383,20 @@ mdio_read(void *ioaddr, int RegAddr)
return value;
}
+static void rtl8169_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *info)
+{
+ struct rtl8169_private *tp = dev->priv;
+
+ strcpy(info->driver, RTL8169_DRIVER_NAME);
+ strcpy(info->version, RTL8169_VERSION );
+ strcpy(info->bus_info, pci_name(tp->pci_dev));
+}
+
+static struct ethtool_ops rtl8169_ethtool_ops = {
+ .get_drvinfo = rtl8169_get_drvinfo,
+};
+
static void rtl8169_write_gmii_reg_bit(void *ioaddr, int reg, int bitnum,
int bitval)
{
@@ -793,6 +808,7 @@ rtl8169_init_one(struct pci_dev *pdev, c
dev->open = rtl8169_open;
dev->hard_start_xmit = rtl8169_start_xmit;
dev->get_stats = rtl8169_get_stats;
+ dev->ethtool_ops = &rtl8169_ethtool_ops;
dev->stop = rtl8169_close;
dev->tx_timeout = rtl8169_tx_timeout;
dev->set_multicast_list = rtl8169_set_rx_mode;
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 3/7] 2.6.5-bk-netdev - r8169 queue
2004-04-05 21:57 ` [patch 2/7] " Francois Romieu
@ 2004-04-05 21:58 ` Francois Romieu
2004-04-05 21:58 ` [patch 4/7] " Francois Romieu
0 siblings, 1 reply; 14+ messages in thread
From: Francois Romieu @ 2004-04-05 21:58 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
Missing 'static' qualifier for functions.
drivers/net/r8169.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff -puN drivers/net/r8169.c~r8169-missing-static drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-missing-static 2004-04-05 23:05:53.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:05:53.000000000 +0200
@@ -346,8 +346,7 @@ static const unsigned int rtl8169_rx_con
#define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less
#define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less
-void
-mdio_write(void *ioaddr, int RegAddr, int value)
+static void mdio_write(void *ioaddr, int RegAddr, int value)
{
int i;
@@ -364,8 +363,7 @@ mdio_write(void *ioaddr, int RegAddr, in
}
}
-int
-mdio_read(void *ioaddr, int RegAddr)
+static int mdio_read(void *ioaddr, int RegAddr)
{
int i, value = -1;
@@ -1642,8 +1640,7 @@ rtl8169_set_rx_mode(struct net_device *d
*
* Get TX/RX statistics for rtl8169
*/
-struct net_device_stats *
-rtl8169_get_stats(struct net_device *dev)
+static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
{
struct rtl8169_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 4/7] 2.6.5-bk-netdev - r8169 queue
2004-04-05 21:58 ` [patch 3/7] " Francois Romieu
@ 2004-04-05 21:58 ` Francois Romieu
2004-04-05 21:59 ` [patch 5/7] " Francois Romieu
0 siblings, 1 reply; 14+ messages in thread
From: Francois Romieu @ 2004-04-05 21:58 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
Barrier against compiler optimization.
drivers/net/r8169.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)
diff -puN drivers/net/r8169.c~r8169-barrier drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-barrier 2004-04-05 23:06:04.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:06:04.000000000 +0200
@@ -1367,6 +1367,7 @@ rtl8169_tx_interrupt(struct net_device *
while (tx_left > 0) {
int entry = dirty_tx % NUM_TX_DESC;
+ rmb();
if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) {
struct sk_buff *skb = tp->Tx_skbuff[entry];
@@ -1428,7 +1429,10 @@ rtl8169_rx_interrupt(struct net_device *
while (rx_left > 0) {
int entry = cur_rx % NUM_RX_DESC;
- u32 status = le32_to_cpu(tp->RxDescArray[entry].status);
+ u32 status;
+
+ rmb();
+ status = le32_to_cpu(tp->RxDescArray[entry].status);
if (status & OWNbit)
break;
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 5/7] 2.6.5-bk-netdev - r8169 queue
2004-04-05 21:58 ` [patch 4/7] " Francois Romieu
@ 2004-04-05 21:59 ` Francois Romieu
2004-04-05 21:59 ` [patch 6/7] " Francois Romieu
0 siblings, 1 reply; 14+ messages in thread
From: Francois Romieu @ 2004-04-05 21:59 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
If a few packets have been scheduled for Tx, it is possible to keep looping
in the Tx irq handler as soon as the irq for the first packet has been
received until the descriptor of the last packet has been sent (with
interrupts disabled btw).
drivers/net/r8169.c | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff -puN drivers/net/r8169.c~r8169-kill-potential-busy-loop drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-kill-potential-busy-loop 2004-04-05 23:06:15.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:06:15.000000000 +0200
@@ -1366,22 +1366,24 @@ rtl8169_tx_interrupt(struct net_device *
while (tx_left > 0) {
int entry = dirty_tx % NUM_TX_DESC;
+ struct sk_buff *skb = tp->Tx_skbuff[entry];
+ u32 status;
rmb();
- if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) {
- struct sk_buff *skb = tp->Tx_skbuff[entry];
+ status = le32_to_cpu(tp->TxDescArray[entry].status);
+ if (status & OWNbit)
+ break;
- /* FIXME: is it really accurate for TxErr ? */
- tp->stats.tx_bytes += skb->len >= ETH_ZLEN ?
- skb->len : ETH_ZLEN;
- tp->stats.tx_packets++;
- rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + entry,
- tp->TxDescArray + entry);
- dev_kfree_skb_irq(skb);
- tp->Tx_skbuff[entry] = NULL;
- dirty_tx++;
- tx_left--;
- }
+ /* FIXME: is it really accurate for TxErr ? */
+ tp->stats.tx_bytes += skb->len >= ETH_ZLEN ?
+ skb->len : ETH_ZLEN;
+ tp->stats.tx_packets++;
+ rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + entry,
+ tp->TxDescArray + entry);
+ dev_kfree_skb_irq(skb);
+ tp->Tx_skbuff[entry] = NULL;
+ dirty_tx++;
+ tx_left--;
}
if (tp->dirty_tx != dirty_tx) {
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 6/7] 2.6.5-bk-netdev - r8169 queue
2004-04-05 21:59 ` [patch 5/7] " Francois Romieu
@ 2004-04-05 21:59 ` Francois Romieu
2004-04-05 22:00 ` [patch 7/7] " Francois Romieu
0 siblings, 1 reply; 14+ messages in thread
From: Francois Romieu @ 2004-04-05 21:59 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
DMA_{32/64}BIT_MASK for all.
include/linux/dma-mapping.h | 3 +++
1 files changed, 3 insertions(+)
diff -puN include/linux/dma-mapping.h~r8169-dac-00 include/linux/dma-mapping.h
--- linux-2.6.5/include/linux/dma-mapping.h~r8169-dac-00 2004-04-05 23:06:28.000000000 +0200
+++ linux-2.6.5-fr/include/linux/dma-mapping.h 2004-04-05 23:06:28.000000000 +0200
@@ -10,6 +10,9 @@ enum dma_data_direction {
DMA_NONE = 3,
};
+#define DMA_64BIT_MASK 0xffffffffffffffffULL
+#define DMA_32BIT_MASK 0x00000000ffffffffULL
+
#include <asm/dma-mapping.h>
/* Backwards compat, remove in 2.7.x */
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 7/7] 2.6.5-bk-netdev - r8169 queue
2004-04-05 21:59 ` [patch 6/7] " Francois Romieu
@ 2004-04-05 22:00 ` Francois Romieu
0 siblings, 0 replies; 14+ messages in thread
From: Francois Romieu @ 2004-04-05 22:00 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
DAC changes:
- Rx and Tx descriptors rings handled on 64 bit;
- enable DAC through use of CPlusCmd register (reserved bits apart, this is
similar to the 8139cp driver);
- use the higher 32 bits of addresses for the Rx/Tx buffers.
linux/dma-mapping.h | 0
drivers/net/r8169.c | 66 ++++++++++++++++++++++++++++++++++++----------------
2 files changed, 46 insertions(+), 20 deletions(-)
diff -puN drivers/net/r8169.c~r8169-dac-10 drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-dac-10 2004-04-05 23:06:48.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:06:48.000000000 +0200
@@ -149,8 +149,10 @@ static int rx_copybreak = 200;
enum RTL8169_registers {
MAC0 = 0, /* Ethernet hardware address. */
MAR0 = 8, /* Multicast filter. */
- TxDescStartAddr = 0x20,
- TxHDescStartAddr = 0x28,
+ TxDescStartAddrLow = 0x20,
+ TxDescStartAddrHigh = 0x24,
+ TxHDescStartAddrLow = 0x28,
+ TxHDescStartAddrHigh = 0x2c,
FLASH = 0x30,
ERSR = 0x36,
ChipCmd = 0x37,
@@ -175,7 +177,8 @@ enum RTL8169_registers {
PHYstatus = 0x6C,
RxMaxSize = 0xDA,
CPlusCmd = 0xE0,
- RxDescStartAddr = 0xE4,
+ RxDescAddrLow = 0xE4,
+ RxDescAddrHigh = 0xE8,
EarlyTxThres = 0xEC,
FuncEvent = 0xF0,
FuncEventMask = 0xF4,
@@ -227,7 +230,13 @@ enum RTL8169_register_content {
/*TxConfigBits */
TxInterFrameGapShift = 24,
- TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */
+ TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */
+
+ /* CPlusCmd p.31 */
+ RxVlan = (1 << 6),
+ RxChkSum = (1 << 5),
+ PCIDAC = (1 << 4),
+ PCIMulRW = (1 << 3),
/*rtl8169_PHYstatus */
TBI_Enable = 0x80,
@@ -286,15 +295,13 @@ enum _DescStatusBit {
struct TxDesc {
u32 status;
u32 vlan_tag;
- u32 buf_addr;
- u32 buf_Haddr;
+ u64 addr;
};
struct RxDesc {
u32 status;
u32 vlan_tag;
- u32 buf_addr;
- u32 buf_Haddr;
+ u64 addr;
};
struct rtl8169_private {
@@ -317,6 +324,7 @@ struct rtl8169_private {
struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */
struct timer_list timer;
unsigned long phy_link_down_cnt;
+ u16 cp_cmd;
};
MODULE_AUTHOR("Realtek");
@@ -713,6 +721,20 @@ rtl8169_init_board(struct pci_dev *pdev,
goto err_out_disable;
}
+ tp->cp_cmd = PCIMulRW | RxChkSum;
+
+ if ((sizeof(dma_addr_t) > 32) &&
+ !pci_set_dma_mask(pdev, DMA_64BIT_MASK))
+ tp->cp_cmd |= PCIDAC;
+ else {
+ rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+ if (rc < 0) {
+ printk(KERN_ERR PFX "DMA configuration failed.\n");
+ goto err_out_free_res;
+ }
+ }
+
+
// enable PCI bus-mastering
pci_set_master(pdev);
@@ -1099,17 +1121,21 @@ rtl8169_hw_start(struct net_device *dev)
RTL_W32(TxConfig,
(TX_DMA_BURST << TxDMAShift) | (InterFrameGap <<
TxInterFrameGapShift));
- RTL_W16(CPlusCmd, RTL_R16(CPlusCmd));
+ tp->cp_cmd |= RTL_R16(CPlusCmd);
+ RTL_W16(CPlusCmd, tp->cp_cmd);
if (tp->mac_version == RTL_GIGA_MAC_VER_D) {
dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14 MUST be 1\n");
- RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | (1 << 14) | (1 << 3));
+ tp->cp_cmd |= (1 << 14) | PCIMulRW;
+ RTL_W16(CPlusCmd, tp->cp_cmd);
}
tp->cur_rx = 0;
- RTL_W32(TxDescStartAddr, tp->TxPhyAddr);
- RTL_W32(RxDescStartAddr, tp->RxPhyAddr);
+ RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK));
+ RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32));
+ RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK));
+ RTL_W32(RxDescAddrHigh, ((u64) tp->RxPhyAddr >> 32));
RTL_W8(Cfg9346, Cfg9346_Lock);
udelay(10);
@@ -1129,14 +1155,14 @@ rtl8169_hw_start(struct net_device *dev)
static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
{
- desc->buf_addr = 0xdeadbeef;
+ desc->addr = 0x0badbadbadbadbad;
desc->status &= ~cpu_to_le32(OWNbit | RsvdMask);
}
static void rtl8169_free_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
struct RxDesc *desc)
{
- pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE,
+ pci_unmap_single(pdev, le64_to_cpu(desc->addr), RX_BUF_SIZE,
PCI_DMA_FROMDEVICE);
dev_kfree_skb(*sk_buff);
*sk_buff = NULL;
@@ -1150,7 +1176,7 @@ static inline void rtl8169_return_to_asi
static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping)
{
- desc->buf_addr = cpu_to_le32(mapping);
+ desc->addr = cpu_to_le64(mapping);
desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE);
}
@@ -1248,9 +1274,9 @@ static void rtl8169_unmap_tx_skb(struct
{
u32 len = sk_buff[0]->len;
- pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr),
+ pci_unmap_single(pdev, le64_to_cpu(desc->addr),
len < ETH_ZLEN ? ETH_ZLEN : len, PCI_DMA_TODEVICE);
- desc->buf_addr = 0x00;
+ desc->addr = 0x00;
*sk_buff = NULL;
}
@@ -1322,7 +1348,7 @@ rtl8169_start_xmit(struct sk_buff *skb,
PCI_DMA_TODEVICE);
tp->Tx_skbuff[entry] = skb;
- tp->TxDescArray[entry].buf_addr = cpu_to_le32(mapping);
+ tp->TxDescArray[entry].addr = cpu_to_le64(mapping);
tp->TxDescArray[entry].status = cpu_to_le32(OWNbit | FSbit |
LSbit | len | (EORbit * !((entry + 1) % NUM_TX_DESC)));
@@ -1454,7 +1480,7 @@ rtl8169_rx_interrupt(struct net_device *
pci_dma_sync_single_for_cpu(tp->pci_dev,
- le32_to_cpu(desc->buf_addr), RX_BUF_SIZE,
+ le64_to_cpu(desc->addr), RX_BUF_SIZE,
PCI_DMA_FROMDEVICE);
if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) {
@@ -1462,7 +1488,7 @@ rtl8169_rx_interrupt(struct net_device *
tp->Rx_skbuff[entry] = NULL;
}
- pci_action(tp->pci_dev, le32_to_cpu(desc->buf_addr),
+ pci_action(tp->pci_dev, le64_to_cpu(desc->addr),
RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
skb_put(skb, pkt_size);
diff -puN include/linux/dma-mapping.h~r8169-dac-10 include/linux/dma-mapping.h
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 0/3] 2.6.5-netdev2 - r8169 update
2004-04-05 21:55 [patch 0/7] 2.6.5-bk-netdev - r8169 queue Francois Romieu
2004-04-05 21:56 ` [patch 1/7] " Francois Romieu
@ 2004-04-07 21:13 ` Francois Romieu
2004-04-07 21:14 ` [patch 1/3] " Francois Romieu
2004-04-13 23:42 ` [patch 0/3] " Srihari Vijayaraghavan
1 sibling, 2 replies; 14+ messages in thread
From: Francois Romieu @ 2004-04-07 21:13 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, Srihari Vijayaraghavan
The following serie of patches applies against 2.6.5 + 2.6.5-netdev2.
- r8169-missing-static.patch
missing 'static' qualifiers.
- r8169-irq-handler-status.patch
fix status code bogosity for the irq handler if the r8169 interrupt is
shared.
- r8169-mod_timer.patch
missing "jiffies +" in mod_timer(). The link recovery code seems to work
again.
An update of the patch against 2.6.5 for the whole driver is available for
testers at:
http://www.fr.zoreil.com/people/francois/misc/20040407-2.6.5-r8169.c-stable.patch
--
Ueimor
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 1/3] 2.6.5-netdev2 - r8169 update
2004-04-07 21:13 ` [patch 0/3] 2.6.5-netdev2 - r8169 update Francois Romieu
@ 2004-04-07 21:14 ` Francois Romieu
2004-04-07 21:15 ` [patch 2/3] " Francois Romieu
2004-04-13 18:27 ` [patch 1/3] " Jeff Garzik
2004-04-13 23:42 ` [patch 0/3] " Srihari Vijayaraghavan
1 sibling, 2 replies; 14+ messages in thread
From: Francois Romieu @ 2004-04-07 21:14 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, Srihari Vijayaraghavan
Missing 'static' qualifier for functions.
drivers/net/r8169.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff -puN drivers/net/r8169.c~r8169-missing-static drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-missing-static 2004-04-07 22:51:10.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-07 22:51:10.000000000 +0200
@@ -357,8 +357,7 @@ static const unsigned int rtl8169_rx_con
#define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less
#define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less
-void
-mdio_write(void *ioaddr, int RegAddr, int value)
+static void mdio_write(void *ioaddr, int RegAddr, int value)
{
int i;
@@ -375,8 +374,7 @@ mdio_write(void *ioaddr, int RegAddr, in
}
}
-int
-mdio_read(void *ioaddr, int RegAddr)
+static int mdio_read(void *ioaddr, int RegAddr)
{
int i, value = -1;
@@ -1677,8 +1675,7 @@ rtl8169_set_rx_mode(struct net_device *d
*
* Get TX/RX statistics for rtl8169
*/
-struct net_device_stats *
-rtl8169_get_stats(struct net_device *dev)
+static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
{
struct rtl8169_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 2/3] 2.6.5-netdev2 - r8169 update
2004-04-07 21:14 ` [patch 1/3] " Francois Romieu
@ 2004-04-07 21:15 ` Francois Romieu
2004-04-07 21:16 ` [patch 3/3] " Francois Romieu
2004-04-13 18:27 ` [patch 1/3] " Jeff Garzik
1 sibling, 1 reply; 14+ messages in thread
From: Francois Romieu @ 2004-04-07 21:15 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
The irq handler must not return 1 when the status register is null
during the firt iteration.
drivers/net/r8169.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff -puN drivers/net/r8169.c~r8169-irq-handler-status drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-irq-handler-status 2004-04-07 22:56:57.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-07 22:58:21.000000000 +0200
@@ -1540,8 +1540,8 @@ rtl8169_interrupt(int irq, void *dev_ins
do {
status = RTL_R16(IntrStatus);
- /* h/w no longer present (hotplug?) or major error, bail */
- if (status == 0xFFFF)
+ /* hotplug/major error/no more work/shared irq */
+ if ((status == 0xFFFF) || !status)
break;
handled = 1;
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch 3/3] 2.6.5-netdev2 - r8169 update
2004-04-07 21:15 ` [patch 2/3] " Francois Romieu
@ 2004-04-07 21:16 ` Francois Romieu
0 siblings, 0 replies; 14+ messages in thread
From: Francois Romieu @ 2004-04-07 21:16 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
mod_timer() expects an absolute time, not a relative offset.
drivers/net/r8169.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff -puN drivers/net/r8169.c~r8169-mod_timer drivers/net/r8169.c
--- linux-2.6.5/drivers/net/r8169.c~r8169-mod_timer 2004-04-07 22:59:15.000000000 +0200
+++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-07 22:59:15.000000000 +0200
@@ -617,7 +617,7 @@ static void rtl8169_phy_timer(unsigned l
}
}
- mod_timer(timer, RTL8169_PHY_TIMEOUT);
+ mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT);
}
static inline void rtl8169_delete_timer(struct net_device *dev)
_
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch 1/3] 2.6.5-netdev2 - r8169 update
2004-04-07 21:14 ` [patch 1/3] " Francois Romieu
2004-04-07 21:15 ` [patch 2/3] " Francois Romieu
@ 2004-04-13 18:27 ` Jeff Garzik
1 sibling, 0 replies; 14+ messages in thread
From: Jeff Garzik @ 2004-04-13 18:27 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, Srihari Vijayaraghavan
My apologies, these three patches applied successfully to 2.6.x:
1) Missing 'static' qualifier for functions.
2) The irq handler must not return 1 when the status register is null
during the firt iteration.
3) mod_timer() expects an absolute time, not a relative offset.
Also, future requests:
a) please include a useful Subject line (mentioned in previous email)
b) please -exclude- your diffstat output
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch 0/3] 2.6.5-netdev2 - r8169 update
2004-04-07 21:13 ` [patch 0/3] 2.6.5-netdev2 - r8169 update Francois Romieu
2004-04-07 21:14 ` [patch 1/3] " Francois Romieu
@ 2004-04-13 23:42 ` Srihari Vijayaraghavan
1 sibling, 0 replies; 14+ messages in thread
From: Srihari Vijayaraghavan @ 2004-04-13 23:42 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, Srihari Vijayaraghavan, Jeff Garzik
Hello Francois,
On Thursday 08 April 2004 07:13, Francois Romieu wrote:
> The following serie of patches applies against 2.6.5 + 2.6.5-netdev2.
>
> - r8169-missing-static.patch
> missing 'static' qualifiers.
>
> - r8169-irq-handler-status.patch
> fix status code bogosity for the irq handler if the r8169 interrupt is
> shared.
>
> - r8169-mod_timer.patch
> missing "jiffies +" in mod_timer(). The link recovery code seems to work
> again.
>
> An update of the patch against 2.6.5 for the whole driver is available for
> testers at:
> http://www.fr.zoreil.com/people/francois/misc/20040407-2.6.5-r8169.c-stable
>.patch
I have tested this under moderate network load on my Athlon 64 (2.6.5 64 bit
kernel). It is working fine.
Thanks
Hari
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2004-04-13 23:42 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-05 21:55 [patch 0/7] 2.6.5-bk-netdev - r8169 queue Francois Romieu
2004-04-05 21:56 ` [patch 1/7] " Francois Romieu
2004-04-05 21:57 ` [patch 2/7] " Francois Romieu
2004-04-05 21:58 ` [patch 3/7] " Francois Romieu
2004-04-05 21:58 ` [patch 4/7] " Francois Romieu
2004-04-05 21:59 ` [patch 5/7] " Francois Romieu
2004-04-05 21:59 ` [patch 6/7] " Francois Romieu
2004-04-05 22:00 ` [patch 7/7] " Francois Romieu
2004-04-07 21:13 ` [patch 0/3] 2.6.5-netdev2 - r8169 update Francois Romieu
2004-04-07 21:14 ` [patch 1/3] " Francois Romieu
2004-04-07 21:15 ` [patch 2/3] " Francois Romieu
2004-04-07 21:16 ` [patch 3/3] " Francois Romieu
2004-04-13 18:27 ` [patch 1/3] " Jeff Garzik
2004-04-13 23:42 ` [patch 0/3] " Srihari Vijayaraghavan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).